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
Return an AttributeSet with the elements in this set which are not in the given set.
public AttributeSet subtract(AttributeSet s) { Hashtable newElements = (Hashtable) elements.clone(); Iterator iter = s.iterator(); while (iter.hasNext()) { newElements.remove(iter.next()); } return new AttributeSet(newElements); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Set setDifference(Set diff){\n Set newSet = new Set();\n for(int element = 0; element < set.length; element++){\n if(!diff.elementOf(set[element]))\n newSet.add(set[element]);\n }\n return newSet;\n }", "public ZYSet<ElementType> difference(ZYSet<ElementType> otherSet){\n ZYSet<ElementType> result = new ZYArraySet<ElementType>();\n for(ElementType e :this){\n if(!otherSet.contains(e)){\n result.add(e);\n }\n }\n return result;\n }", "public OrderedSet difference (OrderedSet set) {\n if (set == null)\n return null;\n boolean oldshow = show;\n boolean oldshowErro = showErro;\n show = false;\n showErro = false;\n for (DoubleLinkedList p=first; p!=null; p=p.getNext()) {\n Object info = p.getInfo();\n if (set.dictionary.get(info) != null)\n\tremove(info);\n }\n show = oldshow;\n showErro = oldshowErro;\n return this;\n }", "private static HashSet<Annotation> setDifference(HashSet<Annotation> setA,\r\n\t\t\tHashSet<Annotation> setB) {\r\n\r\n\t\tHashSet<Annotation> tmp = new HashSet<Annotation>(setA);\r\n\t\ttmp.removeAll(setB);\r\n\t\treturn tmp;\r\n\t}", "public static Set unmodifiableSet(Set set) {\n/* 175 */ return UnmodifiableSet.decorate(set);\n/* */ }", "public Set union(Set in_set) throws SetException {\n\t\tSet union = new Set(this);\n\t\tfor (Object element : in_set.list) {\n\t\t\tif (!member(element))\n\t\t\t\tunion.addItem(element);\n\t\t}\n\t\treturn union;\n\t}", "public Set xor(Set in_set) throws SetException {\n\t\tSet temp = union(in_set);\n\t\ttemp.removeItems(intersection(in_set));\n\n\t\treturn temp;\n\t}", "public void andNot(BitSet set){\n for(int i=Math.min(wordsInUse,set.wordsInUse)-1;i>=0;i--)\n words[i]&=~set.words[i];\n recalculateWordsInUse();\n checkInvariants();\n }", "public static Set<Doc> not(Set<Doc> set1,Set<Doc> corpus) {\r\n \t\tif(set1 == null)\r\n \t\t\tset1 = new TreeSet<Doc>();\r\n \t\tTreeSet<Doc> result = new TreeSet<Doc>(corpus);\r\n \t\tresult.removeAll(set1);\r\n \t\treturn result;\r\n \t}", "public SetSet setDifference(SetSet second){\n\t\tSetSet result = new SetSet();\n\t\tfor(int i=0;i<size();i++){\n\t\t\tif(second.contains(get(i))==-1){\n\t\t\t\tresult.add(get(i));\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "public static SetExpression notIn(String propertyName, Collection<? extends Object> values) {\n return notIn(propertyName, values.toArray());\n }", "public static java.util.Set unmodifiableSet(java.util.Set arg0)\n { return null; }", "private static <T> Set<T> Create_UnModifiableSet_By_InputElements(@NonNull Set<T> set, @NonNull T... ts) {\n for (T t : ts) {\n set.add(t);\n }\n\n return Collections.unmodifiableSet(set);\n }", "private static Set symmetricSetDifference (Set<Integer> set1, Set<Integer> set2)\n {\n Set<Integer> skæringspunktet = new HashSet<Integer>(set1);\n\n // Holder på set2 også\n skæringspunktet.retainAll(set2);\n\n // Set1 fjerner alt fra Settet\n set1.removeAll(skæringspunktet);\n // Set1 fjerner alt fra Settet\n set2.removeAll(skæringspunktet);\n\n // Tilføjer alt fra set2 til set1\n set1.addAll(set2);\n\n // Returnerer set1\n return set1;\n }", "@Override\n public SetInterface<T> difference(SetInterface<T> rhs) {\n //create return SetInterface\n SetInterface<T> result = new ArraySet();\n //Look through the calling set\n for(int i = 0; i < numItems; i++){\n //if the item is NOT also in the param set, add it to result\n if(!rhs.contains(arr[i]))\n result.addItem(arr[i]);\n }\n return result;\n }", "public static SetExpression notIn(String propertyName, Object[] values) {\n return new SetExpression(Operator.NOT_IN, propertyName, values);\n }", "public FlavorSet without(Set<Flavor> flavors) {\n if (this.isEmpty() || flavors.isEmpty()) {\n return this;\n }\n return copyOf(Sets.difference(this.flavors, flavors));\n }", "public static ChipSet getNegation(ChipSet cs) {\n\t\tChipSet newchips = new ChipSet();\n\n\t\tfor (CtColor color : cs.getColors())\n\t\t\tnewchips.setNumChips(color, -1 * cs.getNumChips(color));\n\n\t\treturn newchips;\n\t}", "public AttributeSet unionWith(AttributeSet s) {\n\n Hashtable newElements = (Hashtable) elements.clone();\n\n Iterator iter = s.iterator();\n while (iter.hasNext()) {\n Object next = iter.next();\n newElements.put(next, next);\n }\n\n return new AttributeSet(newElements);\n }", "@Override\n public SetI subtract(SetI other) {\n int[] newArr = new int[count];\n int i = 0;\n\n // For each element I have,\n for (Integer e : this) {\n // If you do not...\n if (!other.contains(e)) {\n newArr[i++] = e;\n }\n }\n\n return new Set(newArr, i);\n }", "public Set retainAll(final int[] newSet) {\n Set s2 = new Set();\n for (int i = 0; i < size; i++) {\n for (int element : newSet) {\n if (set[i] == element) {\n s2.add(set[i]);\n }\n }\n }\n // for (int i = 0; i < size; i++) {\n // if (newSet.contains(set[i])) {\n // s2.add(set[i]);\n // }\n // }\n return s2;\n }", "public BSTSet difference(BSTSet s) {\n int[] thisArray = BSTToArray();\n int[] sArray = s.BSTToArray();\n\n BSTSet diffSet = new BSTSet(thisArray);\n\n for (int value : sArray) {\n diffSet.remove(value);\n }\n\n return diffSet;\n }", "public static <T> Set<T> diff(final Set<T> a, final Set<T> b) {\n return new Set<T>() {\n public boolean has(final T n) {\n return a.has(n) && ! b.has(n);\n }\n };\n }", "public void removeAllPartOfSet() {\r\n\t\tBase.removeAll(this.model, this.getResource(), PARTOFSET);\r\n\t}", "public AttributeSet immutable() {\r\n return ImmutableAttributeSet.copyOf(this);\r\n }", "public AttributeSet flatCopy() {\r\n AttributeSet res = new AttributeSet();\r\n for (String k : getAllAttributes()) {\r\n res.put(k, copyValue(get(k)));\r\n }\r\n return res;\r\n }", "public final Set<String> findRemoved(Set<String> set, List<Control> list) {\n ArrayList arrayList = new ArrayList(CollectionsKt__IterablesKt.collectionSizeOrDefault(list, 10));\n for (Control control : list) {\n arrayList.add(control.getControlId());\n }\n return SetsKt___SetsKt.minus(set, arrayList);\n }", "public AttributeSet intersectWith(AttributeSet s) {\n\n Hashtable newElements = new Hashtable();\n\n Iterator iter = s.iterator();\n while (iter.hasNext()) {\n Object next = iter.next();\n if (elements.get(next) != null) {\n newElements.put(next, next);\n }\n }\n\n return new AttributeSet(newElements);\n }", "public SetSet deepCopy(){\n\t\tSetSet copy = new SetSet();\n\t\tfor(int i=0;i<size();i++){\n\t\t\tcopy.add(get(i).deepCopy());\n\t\t}\n\t\treturn copy;\n\t}", "public final ANTLRv3Parser.notSet_return notSet() throws RecognitionException {\r\n ANTLRv3Parser.notSet_return retval = new ANTLRv3Parser.notSet_return();\r\n retval.start = input.LT(1);\r\n\r\n\r\n CommonTree root_0 = null;\r\n\r\n Token char_literal112=null;\r\n ANTLRv3Parser.notTerminal_return notTerminal113 =null;\r\n\r\n ANTLRv3Parser.elementOptions_return elementOptions114 =null;\r\n\r\n ANTLRv3Parser.block_return block115 =null;\r\n\r\n ANTLRv3Parser.elementOptions_return elementOptions116 =null;\r\n\r\n\r\n CommonTree char_literal112_tree=null;\r\n RewriteRuleTokenStream stream_93=new RewriteRuleTokenStream(adaptor,\"token 93\");\r\n RewriteRuleSubtreeStream stream_notTerminal=new RewriteRuleSubtreeStream(adaptor,\"rule notTerminal\");\r\n RewriteRuleSubtreeStream stream_elementOptions=new RewriteRuleSubtreeStream(adaptor,\"rule elementOptions\");\r\n RewriteRuleSubtreeStream stream_block=new RewriteRuleSubtreeStream(adaptor,\"rule block\");\r\n try {\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:271:2: ( '~' ( notTerminal ( elementOptions )? -> ^( '~' notTerminal ( elementOptions )? ) | block ( elementOptions )? -> ^( '~' block ( elementOptions )? ) ) )\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:271:4: '~' ( notTerminal ( elementOptions )? -> ^( '~' notTerminal ( elementOptions )? ) | block ( elementOptions )? -> ^( '~' block ( elementOptions )? ) )\r\n {\r\n char_literal112=(Token)match(input,93,FOLLOW_93_in_notSet1966); if (state.failed) return retval; \r\n if ( state.backtracking==0 ) stream_93.add(char_literal112);\r\n\r\n\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:272:3: ( notTerminal ( elementOptions )? -> ^( '~' notTerminal ( elementOptions )? ) | block ( elementOptions )? -> ^( '~' block ( elementOptions )? ) )\r\n int alt57=2;\r\n int LA57_0 = input.LA(1);\r\n\r\n if ( (LA57_0==CHAR_LITERAL||LA57_0==STRING_LITERAL||LA57_0==TOKEN_REF) ) {\r\n alt57=1;\r\n }\r\n else if ( (LA57_0==68) ) {\r\n alt57=2;\r\n }\r\n else {\r\n if (state.backtracking>0) {state.failed=true; return retval;}\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 57, 0, input);\r\n\r\n throw nvae;\r\n\r\n }\r\n switch (alt57) {\r\n case 1 :\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:272:5: notTerminal ( elementOptions )?\r\n {\r\n pushFollow(FOLLOW_notTerminal_in_notSet1972);\r\n notTerminal113=notTerminal();\r\n\r\n state._fsp--;\r\n if (state.failed) return retval;\r\n if ( state.backtracking==0 ) stream_notTerminal.add(notTerminal113.getTree());\r\n\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:272:17: ( elementOptions )?\r\n int alt55=2;\r\n int LA55_0 = input.LA(1);\r\n\r\n if ( (LA55_0==77) ) {\r\n alt55=1;\r\n }\r\n switch (alt55) {\r\n case 1 :\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:272:17: elementOptions\r\n {\r\n pushFollow(FOLLOW_elementOptions_in_notSet1974);\r\n elementOptions114=elementOptions();\r\n\r\n state._fsp--;\r\n if (state.failed) return retval;\r\n if ( state.backtracking==0 ) stream_elementOptions.add(elementOptions114.getTree());\r\n\r\n }\r\n break;\r\n\r\n }\r\n\r\n\r\n // AST REWRITE\r\n // elements: elementOptions, 93, notTerminal\r\n // token labels: \r\n // rule labels: retval\r\n // token list labels: \r\n // rule list labels: \r\n // wildcard labels: \r\n if ( state.backtracking==0 ) {\r\n\r\n retval.tree = root_0;\r\n RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.tree:null);\r\n\r\n root_0 = (CommonTree)adaptor.nil();\r\n // 272:33: -> ^( '~' notTerminal ( elementOptions )? )\r\n {\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:272:36: ^( '~' notTerminal ( elementOptions )? )\r\n {\r\n CommonTree root_1 = (CommonTree)adaptor.nil();\r\n root_1 = (CommonTree)adaptor.becomeRoot(\r\n stream_93.nextNode()\r\n , root_1);\r\n\r\n adaptor.addChild(root_1, stream_notTerminal.nextTree());\r\n\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:272:54: ( elementOptions )?\r\n if ( stream_elementOptions.hasNext() ) {\r\n adaptor.addChild(root_1, stream_elementOptions.nextTree());\r\n\r\n }\r\n stream_elementOptions.reset();\r\n\r\n adaptor.addChild(root_0, root_1);\r\n }\r\n\r\n }\r\n\r\n\r\n retval.tree = root_0;\r\n }\r\n\r\n }\r\n break;\r\n case 2 :\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:273:5: block ( elementOptions )?\r\n {\r\n pushFollow(FOLLOW_block_in_notSet1992);\r\n block115=block();\r\n\r\n state._fsp--;\r\n if (state.failed) return retval;\r\n if ( state.backtracking==0 ) stream_block.add(block115.getTree());\r\n\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:273:11: ( elementOptions )?\r\n int alt56=2;\r\n int LA56_0 = input.LA(1);\r\n\r\n if ( (LA56_0==77) ) {\r\n alt56=1;\r\n }\r\n switch (alt56) {\r\n case 1 :\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:273:11: elementOptions\r\n {\r\n pushFollow(FOLLOW_elementOptions_in_notSet1994);\r\n elementOptions116=elementOptions();\r\n\r\n state._fsp--;\r\n if (state.failed) return retval;\r\n if ( state.backtracking==0 ) stream_elementOptions.add(elementOptions116.getTree());\r\n\r\n }\r\n break;\r\n\r\n }\r\n\r\n\r\n // AST REWRITE\r\n // elements: 93, block, elementOptions\r\n // token labels: \r\n // rule labels: retval\r\n // token list labels: \r\n // rule list labels: \r\n // wildcard labels: \r\n if ( state.backtracking==0 ) {\r\n\r\n retval.tree = root_0;\r\n RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.tree:null);\r\n\r\n root_0 = (CommonTree)adaptor.nil();\r\n // 273:28: -> ^( '~' block ( elementOptions )? )\r\n {\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:273:31: ^( '~' block ( elementOptions )? )\r\n {\r\n CommonTree root_1 = (CommonTree)adaptor.nil();\r\n root_1 = (CommonTree)adaptor.becomeRoot(\r\n stream_93.nextNode()\r\n , root_1);\r\n\r\n adaptor.addChild(root_1, stream_block.nextTree());\r\n\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:273:43: ( elementOptions )?\r\n if ( stream_elementOptions.hasNext() ) {\r\n adaptor.addChild(root_1, stream_elementOptions.nextTree());\r\n\r\n }\r\n stream_elementOptions.reset();\r\n\r\n adaptor.addChild(root_0, root_1);\r\n }\r\n\r\n }\r\n\r\n\r\n retval.tree = root_0;\r\n }\r\n\r\n }\r\n break;\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n retval.stop = input.LT(-1);\r\n\r\n\r\n if ( state.backtracking==0 ) {\r\n\r\n retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);\r\n adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);\r\n }\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n \tretval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);\r\n\r\n }\r\n\r\n finally {\r\n \t// do for sure before leaving\r\n }\r\n return retval;\r\n }", "@Override\n\tprotected Set<Pair<Integer, Attribute>> getExcludedAttributes(ExampleSet leftExampleSet, ExampleSet rightExampleSet)\n\t\t\tthrows OperatorException {\n\t\tif (getParameterAsBoolean(PARAMETER_KEEP_BOTH_JOIN_ATTRIBUTES)) {\n\t\t\treturn Collections.emptySet();\n\t\t} else {\n\t\t\tAttribute[] keyAttributes = getKeyAttributes(leftExampleSet, rightExampleSet).getSecond();\n\t\t\tSet<Pair<Integer, Attribute>> excludedAttributes = new HashSet<>();\n\t\t\tfor (Attribute attribute : keyAttributes) {\n\t\t\t\texcludedAttributes.add(new Pair<>(AttributeSource.SECOND_SOURCE, attribute));\n\t\t\t}\n\t\t\treturn excludedAttributes;\n\t\t}\n\t}", "public static ArrayList<ArrayList<String>> getAllMinusOneSizedSubsets(ArrayList<String> set) {\n\t\tint elementToIgnore = 0;\n\t\tArrayList<ArrayList<String>> result = new ArrayList<ArrayList<String>>();\n\t\t\n\t\tfor(int i=0;i<set.size();i++) {\n\t\t\telementToIgnore = i;\n\t\t\t\n\t\t\tArrayList<String> subSet = new ArrayList<String>();\n\t\t\t\n\t\t\tfor(int j=0;j<set.size();j++) {\n\t\t\t\tif(j != elementToIgnore) {\n\t\t\t\t\tsubSet.add(set.get(j));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tresult.add(subSet);\n\t\t}\n\t\treturn result;\n\t}", "private Set<Attribute> removeCurrentAttrFromSet(Set<Attribute> attrs,\n\t\t\tObjectClass objClass) {\n\t\tSet<Attribute> attributes = new HashSet<Attribute>(attrs);\n\t\tattributes.remove(AttributeBuilder.buildCurrentAttributes(objClass,\n\t\t\t\tAttributeUtil.getCurrentAttributes(attrs)));\n\t\treturn attributes;\n\t}", "protected HashSet getNotTraversable(){\n tester.removeTraversedComponents();\n return tester.traversableComponents;\n }", "@Override\n\tprotected Set<Pair<Integer, AttributeMetaData>> getExcludedAttributesMD(ExampleSetMetaData leftExampleSetMD,\n\t\t\tExampleSetMetaData rightExampleSetMD) throws OperatorException {\n\t\tPair<AttributeMetaData[], AttributeMetaData[]> keyAttributeMD = getKeyAttributesMD(leftExampleSetMD,\n\t\t\t\trightExampleSetMD);\n\t\tif (keyAttributeMD == null) {\n\t\t\treturn Collections.emptySet();\n\t\t}\n\t\tAttributeMetaData[] keyAttributes = keyAttributeMD.getSecond();\n\t\tSet<Pair<Integer, AttributeMetaData>> excludedAttributes = new HashSet<>();\n\t\tfor (int i = 0; i < keyAttributes.length; ++i) {\n\t\t\texcludedAttributes.add(new Pair<>(AttributeSource.SECOND_SOURCE, keyAttributes[i]));\n\t\t}\n\t\treturn excludedAttributes;\n\t}", "public Set lookupNoAttributes( String lfn ) {\n Set result = new HashSet();\n for( Iterator it = this.rcIterator(); it.hasNext() ; ){\n ReplicaCatalog catalog = (ReplicaCatalog) it.next();\n result.addAll( catalog.lookupNoAttributes( lfn ) );\n }\n return result;\n }", "public Units whereNot(UnitSelector.BooleanSelector selector)\n\t{\n\t\tUnits result = new Units();\n\t\tfor (Unit unit : this)\n\t\t{\n\t\t\tif (!selector.isTrueFor(unit))\n\t\t\t{\n\t\t\t\tresult.add(unit);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "public Set getNonEscapingEdges() {\n if (addedEdges == null) return Collections.EMPTY_SET;\n return addedEdges.entrySet();\n }", "public CodeSet lessSpecificCodesNotIn(CodeSet resultCodeSet) {\r\n\t\tCodeSet returnSet = new CodeSet();\r\n\t\t// loop over all codes in the specification set (this)\r\n\t\tfor (Code specificationCode: this) {\r\n\t\t\tboolean resultMatchesSpec = false;\r\n\t\t\t// find a match in the result set\r\n\t\t\tfor (Code resultCode: resultCodeSet) {\r\n\t\t\t\tlogger.trace(\"comparing spec code {} to {}\", specificationCode, resultCode);\r\n\t\t\t\tif (resultCode.isSameOrMoreSpecific(specificationCode)) {\r\n\t\t\t\t\tresultMatchesSpec = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (!resultMatchesSpec) {\r\n\t\t\t\tlogger.debug(\"no match\");\r\n\t\t\t\treturnSet.add(specificationCode);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn returnSet;\r\n\t}", "public Collection getNonEscapingEdgeTargets() {\n if (addedEdges == null) return Collections.EMPTY_SET;\n return new FlattenedCollection(addedEdges.values());\n }", "public static SortedSet unmodifiableSortedSet(SortedSet set) {\n/* 276 */ return UnmodifiableSortedSet.decorate(set);\n/* */ }", "public ISet<E> union(ISet<E> otherSet) {\n\t\tif (otherSet == null)\n\t\t\tthrow new IllegalArgumentException(\"The given set is null.\");\n\t\tISet<E> result = this.difference(otherSet);\n\t\tresult.addAll(this.intersection(otherSet));\n\t\tresult.addAll(otherSet.difference(this));\n\t\treturn result;\n\t}", "@Override\r\n\tprotected Set<String>[] getForbidSetArray() {\n\t\treturn null;\r\n\t}", "public Set union(Set join){\n Set newSet = new Set();\n for(int element = 0; element < join.size(); element++){\n if (!elementOf(join.getSet()[element]))\n newSet.add(join.getSet()[element]);\n }\n for(int element = 0; element < set.length; element++){\n newSet.add(set[element]);\n }\n return newSet;\n }", "public Set getOriginalAttributes() {\n\t\tSet out = new HashSet();\n\t\tfor (Iterator ci = getClasses().iterator(); ci.hasNext();) {\n\t\t\tSchemaClass cls = (SchemaClass) ci.next();\n\t\t\tfor (Iterator ai = cls.getAttributes().iterator(); ai.hasNext();) {\n\t\t\t\tSchemaAttribute att = (SchemaAttribute) ai.next();\n\t\t\t\tif (att.getOrigin() == cls) {\n\t\t\t\t\tout.add(att);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn out;\n\t}", "public void pruneItemSet(ItemSet itemSet) {\n Map<ItemSet,Integer> listentry = scb.get(itemSet.getNumberOfItems());\n listentry.put(itemSet, 0);\n }", "private Collection<Node> keepOnlySetElement(Collection<Node> nodes) {\n Set<Node> elements = new HashSet<>();\n for (Node node : nodes) {\n Edge originalEdge = synchronizer().getOriginalEdge(node);\n if ((originalEdge != null && !boundaries.edges.contains(originalEdge))\n || !boundaries.nodes.contains(node)) {\n elements.add(node);\n }\n }\n return elements;\n }", "public DisjointSet() {}", "@Test\r\n public void testRegexpSetExclusion() {\r\n rs.getRegexp(reString);\r\n final Set<String> s1 = rs.getRegexpSet();\r\n stringSet.add(reString);\r\n s1.removeAll(stringSet);\r\n assertTrue(s1.isEmpty());\r\n }", "@Override\n public SetInterface<T> difference(SetInterface<T> rhs) {\n SetInterface<T> result = new LinkedSet();\n Node n = first;\n while(n != null){\n //make sure the item is not also in rhs\n if(!rhs.contains(n.value))\n result.addItem(n.value);\n n = n.next;\n }\n return result;\n }", "public DisjointSets getSets()\n\t{\n\t\treturn sets;\n\t}", "public ZYSet<ElementType> union(ZYSet<ElementType> otherSet){\n ZYSet<ElementType> result = new ZYArraySet<ElementType>();\n for(ElementType e :this){\n result.add(e);\n }\n for(ElementType e :otherSet){\n result.add(e);\n }\n \n return result;\n }", "public static Set symmetricDifference(Set a, Set b){\n\t\tSet aMinusB = a.difference(b);\n\t\tSet bMinusA = b.difference(b);\n\t\treturn aMinusB.union(bMinusA);\n\t}", "public static <T> ImmutableSet<T> asSetWithoutNulls(T... elements) {\n return Arrays.stream(elements).filter(Objects::nonNull).collect(toImmutableSet());\n }", "public void makeEmpty(){\n for(int element = set.length - 1; element >= 0; element--){\n remove(set[element]);\n }\n }", "public Set<T> noFollow(T elem) {\n\t\t Set<T> s = rule.get(elem.hashCode());\n\t\t return s == null ? new HashSet<T>() :s; // TODO YOUR CODE HERE\n\t}", "public static Set<AT> getRemoveAts() {\n return getAts(removeAts);\n }", "public EfficientTerminalSet empty() {\n return new EfficientTerminalSet(terminals, indices, new int[data.length]);\n }", "public static <T> void intersectionToSet1(HashSet<T> set1, HashSet<T> set2) {\n for (T element : set1) {\n if (!set2.contains(element)) {\n set1.remove(element);\n }\n }\n }", "public static Set<String> unmodifiableSet(ArrayString values) {\n\t\treturn Collections.unmodifiableSet(set(values));\n\t}", "public AttributeSet copy() {\r\n AttributeSet res = new AttributeSet(parent.orNull());\r\n for (String k : attributeMap.keySet()) {\r\n res.put(k, copyValue(get(k)));\r\n }\r\n return res;\r\n }", "protected <Ty> HashSet<Ty> union(HashSet<Ty> setA, HashSet<Ty> setB) {\n HashSet<Ty> retSet = new HashSet<>();\n retSet.addAll(setA);\n retSet.addAll(setB);\n return retSet;\n }", "public boolean overridesSet(){\n return overrides.stream().anyMatch(k->!k.dontAllowSet());\n }", "public Set Difference(Set secondSet) {\n\t\t\n\t\tArrayList<String> firstArray = noDuplicates(stringArray);\n\t\t// Taking out duplications out of our sets by calling the noDuplicates private function\n\t\tArrayList<String> secondArray = noDuplicates(secondSet.returnArray());\n\t\t\n\t\tArrayList<String> differenceOfBoth = new ArrayList<String>();\n\t\t// New ArrayList to hold the final values\n\t\t\n\t\tfor (int i=0; i < firstArray.size(); i++) {\n\t\t\tif (secondArray.contains(firstArray.get(i)) == false && differenceOfBoth.contains(firstArray.get(i)) == false && firstArray.get(i).equals(\"emptyElement\") == false) {\n\t\t\t\tdifferenceOfBoth.add(firstArray.get(i));\n\t\t\t\t// If our second array does not contain that same element as our first array, our final ArrayList does not already contain the element, and the element is not\n\t\t\t\t// an empty string (A string containing the phrase \"emptyElement\"), then add the element to our final ArrayList\n\t\t\t}\n\t\t\t\n\t\t\tif (secondArray.contains(firstArray.get(i)) == false && differenceOfBoth.contains(firstArray.get(i)) == false && firstArray.get(i).equals(\"emptyElement\")) {\n\t\t\t\tdifferenceOfBoth.add(\"\");\n\t\t\t\t// If our second array does not contain that same element as our first array, our final ArrayList does not already contain the element, and the element is\n\t\t\t\t// an empty string (A string containing the phrase \"emptyElement\"), then add an empty string to our final ArrayList\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\tSet differenceReturn = new Set(differenceOfBoth); // Initiate a Set object from our final ArrayList\n\t\t\n\t\treturn differenceReturn; // Return the final Set Object\n\t}", "public final HashSet<Attribute> attributeSet() {\n final HashSet<Attribute> set = new HashSet<Attribute>();\n\n for (int i = 0; i < m_body.size(); i++) {\n final Condition c = m_body.get(i);\n set.add(c.getAttr());\n }\n\n return set;\n }", "public SortedSet<Date> getUnselectableDates()\n/* */ {\n/* 223 */ return new TreeSet(this.unselectableDates);\n/* */ }", "public static FeatureSet empty() {\n return new FeatureSet(ImmutableSet.of(), ImmutableSet.of());\n }", "private Set() {\n this(\"<Set>\", null, null);\n }", "AggregationBuilder buildExcludeFilteredAggregation(Set<String> excludeNames);", "@Test\n\tpublic void testRemoveAll() {\n\t\tSet<Integer> setA = new HashSet<>(Arrays.asList(1, 2, 3, 4, 5));\n\t\tSet<Integer> setB = new HashSet<>(Arrays.asList(9, 8, 7, 6, 5, 4, 3));\n\t\tsetA.removeAll(setB);\n\t\tSet<Integer> union = new HashSet<>(Arrays.asList(1, 2));\n\t\tassertEquals(setA, union);\n\t}", "@Override\r\n\tpublic boolean removeAll(Collection<?> c) {\n\t\treturn set.removeAll(c);\r\n\t}", "public Query not() {\n builder.negateQuery();\n return this;\n }", "private Set buildSet(String attrName, Map attributes, Set resultSet) {\n Set vals = (Set) attributes.get(attrName);\n if ((vals != null) && !vals.isEmpty()) {\n resultSet.addAll(vals);\n }\n return (resultSet);\n }", "public Set<String> getWordsNotFoundByUser(){\n\n Set<String> validWordsOnBoardCopy = new HashSet<String>();\n validWordsOnBoardCopy.addAll(validWordsOnBoard);\n validWordsOnBoardCopy.removeAll(validWordsFoundByUser);\n\n return validWordsOnBoardCopy;\n }", "public ZYSet<ElementType> intersection(ZYSet<ElementType> otherSet){\n ZYSet<ElementType> result = new ZYArraySet<ElementType>();\n for(ElementType e :this){\n if(otherSet.contains(e)){\n result.add(e);\n }\n }\n return result;\n }", "public Set removeDuplicateUsingSet() throws ComputationException {\n Set<Integer> uniqueSet = new HashSet<>();\n log.debug(\"Removing duplicate using Set......\");\n int[] intArray = getRandomArray();\n log.debug(\"Actual size of int array:\" + intArray.length);\n for (int i = 0; i < intArray.length; i++) {\n uniqueSet.add(intArray[i]);\n }\n log.debug(\"refined size of int array using Set: \" + uniqueSet.size());\n log.debug(Arrays.toString(uniqueSet.toArray()));\n return uniqueSet;\n }", "@SuppressWarnings(\"unchecked\") // Nested sets are immutable, so a downcast is fine.\n <E> NestedSet<E> emptySet() {\n return (NestedSet<E>) emptySet;\n }", "public void removeAllOnlyFromCanvas() {\n ArrayList<Integer> delList = new ArrayList<Integer>();\n \n for (CanvasWindow o : this) {\n delList.add(o.getID());\n }\n \n for (Integer i : delList) {\n removeObjectOnlyFromCanvas(i);\n }\n }", "static Set createEmpty() {\n return new EmptySet();\n }", "private ImmutableSet<ImmutableSetMultimap<BindingWithoutComponent, Binding>> duplicateBindingSets(\n BindingGraph bindingGraph) {\n return groupBindingsByKey(bindingGraph).stream()\n .flatMap(bindings -> mutuallyVisibleSubsets(bindings).stream())\n .map(BindingWithoutComponent::index)\n .filter(duplicates -> duplicates.keySet().size() > 1)\n .collect(toImmutableSet());\n }", "private Set<String> cleanSet(Set<String> s){\n\t\t\tLog.i(TAG, \"cleanSet(msg)\");\n\n\t\t\tif (s.contains(\"\")) {\n\t\t\t\ts.remove(\"\");\t\n\t\t\t}if (s.contains(\"etc\")) { // Developers prerogative\n\t\t\t\ts.remove(\"etc\");\n\t\t\t}\n\t\t\treturn s;\n\t\t}", "@Override\n public Iterator<Set<E>> iterator() {\n return new DisjointSetIterator(theSet);\n }", "@Override\n\tpublic AttributeSet getAttributes() {\n\t\treturn null;\n\t}", "public Set getNonEscapingEdgeFields() {\n if (addedEdges == null) return Collections.EMPTY_SET;\n return addedEdges.keySet();\n }", "public AttributeSet getAttributes() {\n return null;\n }", "public AttributeSet() {\n\n elements = new Hashtable();\n }", "public Value setNotDontDelete() {\n checkNotUnknown();\n if (isNotDontDelete())\n return this;\n Value r = new Value(this);\n r.flags &= ~ATTR_DONTDELETE_ANY;\n r.flags |= ATTR_NOTDONTDELETE;\n return canonicalize(r);\n }", "public org.ga4gh.models.CallSet.Builder clearVariantSetIds() {\n variantSetIds = null;\n fieldSetFlags()[3] = false;\n return this;\n }", "public Set intersection(Set intersect){\n Set newSet = new Set();\n for(int element = 0; element < intersect.size(); element++){\n if(elementOf(intersect.getSet()[element]))\n newSet.add(intersect.getSet()[element]);\n }\n return newSet;\n }", "public Units intersection(Units set)\n\t{\n\t\tUnits result = new Units();\n\n\t\tfor (Unit unit : this)\n\t\t{\n\t\t\tif (set.contains(unit))\n\t\t\t{\n\t\t\t\tresult.add(unit);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}", "@Override\n public IntSet union(IntSet other) {\n return other;\n }", "public Set lookupNoAttributes(String lfn) {\n Set lfns = new HashSet();\n lfns.add( lfn );\n \n Map<String, Set<String>> result = this.lookupNoAttributes( lfns );\n\n if( result == null ){\n return null;\n }\n else{\n Set values = result.get( lfn );\n if( values == null ){\n //JIRA PM-74\n values = new HashSet();\n }\n return values;\n }\n \n }", "Set createSet();", "public static List<Integer> findDisappearedNumbers_set(int[] nums) {\n List<Integer> ans = new ArrayList<>();\n int len = nums.length;\n Set<Integer> set = new HashSet<>();\n for (int x : nums) {\n set.add(x);\n }\n\n for (int i = 1; i <= len; i++) {\n if (!set.contains(i)) {\n ans.add(i);\n }\n }\n\n return ans;\n }", "public Units union(Units set)\n\t{\n\t\tUnits result = new Units(this);\n\n\t\tresult.addAll(set);\n\n\t\treturn result;\n\t}", "private List<Set<String>> getSubSets(Set<String> set) {\n\t\tString[] setArray = set.toArray(new String[0]);\n\t\tList<Set<String>> result = new ArrayList<Set<String>>();\n\t\tfor(int i = 0; i < setArray.length; i++){\n\t\t\tSet<String> subSet = new HashSet<String>();\n\t\t\tfor(int j = 0; j < setArray.length; j++){\n\t\t\t\tif(j != i) subSet.add(setArray[j]);\n\t\t\t}\n\t\t\tresult.add(subSet);\n\t\t}\n\t\treturn result;\n\t}", "public static void parseSetExp() {\n parseSLevel2();\n if (currToken.tokenType == Token.SETDIFFERENCE) {\n //TODO: Consume set difference token and add to output\n sb.append(\".intersect(\");\n getNextToken();\n parseSetExp();\n sb.append(\".complement())\");\n }\n \n }", "@attribute(value = \"\", required = false, defaultValue=\"false\")\r\n\tpublic void removeAll() {\r\n\t\tcombo.removeAll();\r\n\t}", "public CodeSet moreSpecificCodesNotIn(CodeSet specificationCodeSet) {\r\n\t\tCodeSet returnSet = new CodeSet();\r\n\t\t// loop over all codes in the result set\r\n\t\tfor (Code resultCode: this) {\r\n\t\t\tboolean resultMatchesSpec = false;\r\n\t\t\t// find a match in the specification set\r\n\t\t\tfor (Code specCode: specificationCodeSet) {\r\n\t\t\t\tlogger.trace(\"comparing result code {} to {}\", resultCode, specCode);\r\n\t\t\t\tif (resultCode.isSameOrMoreSpecific(specCode)) {\r\n\t\t\t\t\tresultMatchesSpec = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (!resultMatchesSpec) {\r\n\t\t\t\tlogger.debug(\"no match\");\r\n\t\t\t\treturnSet.add(resultCode);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn returnSet;\r\n\t}", "private void init(final AttributeSet set) {\n }" ]
[ "0.673168", "0.6596304", "0.63665265", "0.6300225", "0.62998337", "0.6194156", "0.60371655", "0.60088414", "0.59715337", "0.5904548", "0.5815608", "0.5799161", "0.5732929", "0.56981844", "0.5696186", "0.56959134", "0.56897", "0.568816", "0.56355643", "0.5622299", "0.5610281", "0.5610115", "0.55430233", "0.5526203", "0.552219", "0.5498283", "0.54907924", "0.54082847", "0.53970844", "0.5396883", "0.53965807", "0.5385915", "0.5357674", "0.5348269", "0.534402", "0.5310625", "0.5306758", "0.5257761", "0.5239625", "0.5202933", "0.5201714", "0.51437885", "0.512518", "0.51162803", "0.51119053", "0.5082306", "0.507472", "0.50734454", "0.5032303", "0.5031339", "0.50232697", "0.50222754", "0.5006843", "0.50031865", "0.500025", "0.49989584", "0.4970459", "0.49522233", "0.49447262", "0.49254072", "0.4913733", "0.49071106", "0.489581", "0.48849687", "0.48780453", "0.48640376", "0.4860504", "0.48582542", "0.48516616", "0.48434773", "0.48433238", "0.48323172", "0.48232982", "0.48139012", "0.481293", "0.47869802", "0.47759098", "0.47627363", "0.47625718", "0.47548652", "0.4741065", "0.4740369", "0.4735455", "0.4732745", "0.4710826", "0.4707119", "0.47063264", "0.4704066", "0.46949917", "0.46920678", "0.46911559", "0.4685029", "0.4681627", "0.46770692", "0.46768534", "0.46738958", "0.4672864", "0.4662335", "0.4642588", "0.46387807" ]
0.6176175
6
TODO Autogenerated method stub
@Override public void initialize(URL location, ResourceBundle resources) { nomCol.setCellValueFactory( new Callback<CellDataFeatures<List<String>, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<List<String>, String> data) { return new ReadOnlyStringWrapper(data.getValue().get(0)) ; } } ) ; prenomCol.setCellValueFactory( new Callback<CellDataFeatures<List<String>, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<List<String>, String> data) { return new ReadOnlyStringWrapper(data.getValue().get(1)) ; } }) ; cinCol.setCellValueFactory( new Callback<CellDataFeatures<List<String>, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<List<String>, String> data) { return new ReadOnlyStringWrapper(data.getValue().get(2)) ; } } ) ; typeCol.setCellValueFactory( new Callback<CellDataFeatures<List<String>, String>, ObservableValue<String>>() { @Override public ObservableValue<String> call(CellDataFeatures<List<String>, String> data) { return new ReadOnlyStringWrapper(data.getValue().get(3)) ; } } ) ; }
{ "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 with IntelliJ IDEA. User: Denis Date: 8/8/13 Time: 7:56 PM To change this template use File | Settings | File Templates.
public interface UserService { User getUserById(Long id); User getUserNyName(String name); void saveUser(User user); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private stendhal() {\n\t}", "private Solution() {\n /**.\n * { constructor }\n */\n }", "public void mo38117a() {\n }", "public void mo21785J() {\n }", "@Override\n public void perish() {\n \n }", "@SuppressWarnings(\"unused\")\n\tprivate void version() {\n\n\t}", "private static void oneUserExample()\t{\n\t}", "public static void generateCode()\n {\n \n }", "public final void mo51373a() {\n }", "public void mo21792Q() {\n }", "@Override\n public String getDescription() {\n return DESCRIPTION;\n }", "@Override\r\n\tpublic void tires() {\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 protected String getDescription() {\n return DESCRIPTION;\n }", "@Override\n public void settings() {\n // TODO Auto-generated method stub\n \n }", "public static void thisDemo() {\n\t}", "public void mo97908d() {\n }", "public void mo21779D() {\n }", "@Override\n protected void startUp() {\n }", "public void mo21795T() {\n }", "public final void mo91715d() {\n }", "@Override\n\tpublic void name() {\n\t\t\n\t}", "@Override\n\tpublic void name() {\n\t\t\n\t}", "public void mo12930a() {\n }", "public void m23075a() {\n }", "public void mo1531a() {\n }", "@Override\n public void func_104112_b() {\n \n }", "public void mo21825b() {\n }", "public void mo23813b() {\n }", "public static void main(String args[]) throws Exception\n {\n \n \n \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 static void listing5_14() {\n }", "public void mo4359a() {\n }", "private void habilitar() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "public void mo21781F() {\n }", "@Override\n public int describeContents() { return 0; }", "public void mo21878t() {\n }", "public void mo56167c() {\n }", "public void mo21877s() {\n }", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "public void mo21782G() {\n }", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void test() {\n\t\t\t}", "private void cargartabla() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }", "@Override\n public String getDescription() {\n return description;\n }", "public void mo115188a() {\n }", "public void mo6081a() {\n }", "public static void main(String[] args) {\n throw new NotImplementedException();\n }", "private TMCourse() {\n\t}", "public void mo2740a() {\n }", "public static void main() {\n \n }", "public void mo21793R() {\n }", "public void mo3376r() {\n }", "private test5() {\r\n\t\r\n\t}", "public void mo5382o() {\n }", "@Override\n public void init() {\n\n }", "@Override\n protected void initialize() {\n\n \n }", "public void mo5248a() {\n }", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "private void m50366E() {\n }", "private SourcecodePackage() {}", "@Override\n\tprotected void logic() {\n\n\t}", "default void projectOpenFailed() {\n }", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "void pramitiTechTutorials() {\n\t\n}", "@Override\r\n\tprotected void doF6() {\n\t\t\r\n\t}", "public void mo21791P() {\n }", "protected void mo6255a() {\n }", "private Rekenhulp()\n\t{\n\t}", "public void mo9848a() {\n }", "private Example() {\n\t\tthrow new Error(\"no instantiation is permitted\");\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public void mo3749d() {\n }", "@Deprecated\n\tprivate void oldCode()\n\t{\n\t}", "public void mo44053a() {\n }", "public void mo115190b() {\n }", "@org.junit.Test\r\n\tpublic void test() {\n\t\t\t\t\r\n\t}", "public void method_4270() {}", "@Override\n\tpublic void einkaufen() {\n\t}", "public void mo21787L() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "public static void created() {\n\t\t// TODO\n\t}", "private JacobUtils() {}", "@Override\n public void initialize() { \n }", "default void refactoring() {\n templateBuilder.set(new StringBuilder());\n }", "private void someUtilityMethod() {\n }", "private void someUtilityMethod() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }" ]
[ "0.61259925", "0.59610677", "0.5876718", "0.5838025", "0.58343256", "0.58136636", "0.58040583", "0.5796057", "0.5793894", "0.5788824", "0.575565", "0.5733781", "0.5717255", "0.5717255", "0.571268", "0.56921345", "0.5678297", "0.5665762", "0.56627226", "0.5659941", "0.5659101", "0.56359524", "0.5631905", "0.5631905", "0.56253743", "0.5615301", "0.5608037", "0.5600498", "0.559246", "0.55916256", "0.5589327", "0.5587374", "0.5587374", "0.5587374", "0.5587374", "0.5587374", "0.5587374", "0.5582621", "0.5581832", "0.5580991", "0.5577587", "0.5574521", "0.55557275", "0.55469793", "0.55463165", "0.55423343", "0.5539588", "0.5539588", "0.55375916", "0.5527156", "0.5525869", "0.5525046", "0.5523158", "0.55220234", "0.55209225", "0.55174804", "0.5514623", "0.5510716", "0.5506716", "0.5502728", "0.5501626", "0.55012584", "0.5500922", "0.55007696", "0.5499864", "0.5499279", "0.54980916", "0.54955256", "0.5495237", "0.5493095", "0.5489886", "0.5489792", "0.5487892", "0.54766095", "0.54740936", "0.54738635", "0.5463469", "0.5460015", "0.54582554", "0.54560006", "0.5455878", "0.545381", "0.545381", "0.54527456", "0.5450248", "0.54499036", "0.5448768", "0.5444657", "0.54434496", "0.5440352", "0.54394376", "0.5435425", "0.5433418", "0.54333454", "0.54287636", "0.54253703", "0.54241776", "0.5423473", "0.5423473", "0.54216015", "0.54216015" ]
0.0
-1
Method that generates a rounding list to be used
public static ArrayList<Double> rounding(){ roundQuestion = new ArrayList<Double>(); for (int k=0;k<12;k++){ Double rand = randomDecimal(); roundQuestion.add(rand); } return roundQuestion; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static List<Double> getNormalizedAndRoundedSpeeds( List<Stat> statList ) {\n \tList<Double> speeds = new LinkedList<Double>();\n \tdouble normalization = 15;\n \t\n \tfor (Stat stat: statList) {\n \t\tDouble speed = stat.stepSpeed;\n \t\tDouble roundedspeed = new Double((double) Math.round((speed/normalization) * 10) / 10);\n \t\tspeeds.add( roundedspeed );\n \t}\n \t\n \treturn speeds;\n }", "public ArrayList<Move> getRound(int round) {\r\n\t\tint startIndex;\r\n\t\tint endIndex;\r\n\t\t\r\n\t\tArrayList<Move> moves = new ArrayList<Move>();\r\n\t\t\r\n\t\t// Guard against negatives\r\n\t\tif (round < 0) {\r\n\t\t\tround = 0;\r\n\t\t}\r\n\t\t\r\n\t\tif (round >= offsets.size()) {\r\n\t\t\tround = offsets.size() - 1;\r\n\t\t\tendIndex = offsets.size();\r\n\t\t} else {\r\n\t\t\tendIndex = offsets.get(round+1);\r\n\t\t}\r\n\t\t\r\n\t\tstartIndex = offsets.get(round);\r\n\t\t\r\n\t\tfor(int i = startIndex; i < endIndex; i++) {\r\n\t\t\tmoves.add(this.getResults().get(i));\r\n\t\t}\r\n\t\t\r\n\t\treturn moves;\r\n\t}", "public int getRound() {\n return round;\n }", "public static List<Match> getRound(int roundNum) {\n\t\tList<Match> round = new ArrayList<Match>();\n\t\tint numInRound = numInRound(roundNum);\n\t\tint roundStart = numInRound - 1;\n\t\tfor (int i = 0; i < numInRound; i++)\n\t\t\tround.add(matches[roundStart + i]);\n\t\treturn round;\n\t}", "public Integer getRound() {\n return round;\n }", "public int getRound()\r\n\t{\r\n\t\treturn this.round;\r\n\t}", "public PaxosRound createRound()\n {\n return createRound(0);\n }", "public static List<ReversalAmount> createJForexPriceRanges() {\r\n\t\tList<ReversalAmount> result = new ArrayList<>();\r\n\t\t\r\n\t\tresult.add(ONE);\r\n\t\tresult.add(TWO);\r\n\t\tresult.add(THREE);\r\n\t\tresult.add(FOUR);\r\n\t\tresult.add(FIVE);\r\n\t\t\r\n\t\tfor (int i = 6; i <= MAXIMAL_REVERSAL_AMOUNT; i ++) {\r\n\t\t\tresult.add(new ReversalAmount(i));\r\n\t\t}\r\n\t\t\r\n\t\treturn result;\r\n\t}", "public Round(ArrayList<Move> niceMoves) {\n\t\tthis.niceMoves = niceMoves;\n\t\tthis.roundNo = 1;\n\t}", "public void setRound(int round) {\r\n this.round = round;\r\n }", "public Round getRound(){\n return mRound;\n }", "public BigDecimal getPriceList();", "public String roundUp(){\n return \"Numero original: \" + this._X + \" numero redondeado hacia arriba \" + (int)Math.ceil(this._X);\n }", "public int getRoundNumber() {\n return roundNumber;\n }", "private ArrayList<double[]> generatePoints(int divisions) {\n\t\tArrayList<double[]> result = new ArrayList<double[]>();\n\t\tdouble[] weight = new double[Run.NUMBER_OF_OBJECTIVES];\n\t\t\n\t\tif (divisions != 0) {\n\t\t\tgenerateRecursive(result, weight, Run.NUMBER_OF_OBJECTIVES, divisions, divisions, 0);\n\t\t}\n\t\t\n\t\treturn result;\n\t}", "private void newRound() {\r\n\t\tballoonsThisRound = currentRoundNumber * balloonsPerRound * 5;\r\n\t\tcurrentRound = new Round(balloonTypes, 0.3f, balloonsThisRound);\r\n\t\tcurrentRoundNumber++;\r\n\r\n\t\tSystem.out.println(\"Begining Round: \" + currentRoundNumber);\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 }", "private double round(double data) {\n\n\t\treturn Math.rint(data / m_Precision) * m_Precision;\n\t}", "public int getDraws() {\n return drawRound;\n }", "private void roundNumber(String roundingFormat){\n float num1 = 0;\n num1 = Float.parseFloat(txtBox.getText());\n DecimalFormat format = new DecimalFormat(roundingFormat);\n txtBox.setText(String.valueOf(format.format(num1)));\n }", "private void printRandomNumbers() {\n\t\tdouble convAmt = (double)numberAmt/5;\n\t\tint amtCeiling = (int)Math.ceil(convAmt);\n\t\tint index = 0;\n\t\t\n\t\tfor(int i = 0; i < amtCeiling; i++) {\n\t\t\tfor(int j = 0; j < 5; j++) {\n\t\t\t\tSystem.out.print(\"\\t\" + randomNumbers.get(index));\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public static String manyRounds(int rounds) {\n\t\tString StringToJSON = \"{\\\"Rounds\\\":[\";\n\t\tfor(int i = 1; i <= rounds; i++) {\n\t\t\tPlayerBean.PLAYERTWO = 0;\n\t\t\tStringToJSON += round();\n\t\t\tif ( i < rounds) {\n\t\t\t\tStringToJSON += \",\";\n\t\t\t}\n\t\t}\n\t\tStringToJSON += \"]}\";\n\t\treturn StringToJSON;\n\t}", "public int getCurrentRound()\n\t{\n \treturn currentRound;\n\t}", "public int getRoundNum(){\n return gameRounds;\n }", "public Round(ArrayList<Move> niceMoves, int roundNo) {\n\t\tthis.niceMoves = niceMoves;\n\t\tthis.roundNo = roundNo;\n\t}", "public String roundDown(){\n return \"Numero original: \" + this._X + \" numero redondeado hacia abajo \" + (int)Math.floor(this._X);\n }", "@Override\n\tpublic String toString() {\n\t\tdouble value = getValue();\n\t\tint round = (int)(value* 1000);\n\t\tvalue = ((double)round)/1000; \n\t\tif (value >= 0)\n\t\t\treturn \"+\" + value;\n\t\telse\n\t\t\treturn \"\" + value;\n\t}", "public static void main(String[] args) {\n// System.out.println(Math.floor(12.34));/\n// System.out.println(Math.(12.34));/\n// System.out.println(Math.ceil(12.34));/\n// System.out.println(Math.ceil(12.34));/\n int start=5;\n int end=66;\n int i=start+(int)(Math.round(Math.random()*(end-start)) );\n System.out.println(i);\n }", "public static String getDisplayCurrencyFormatRoundedAccounting(double val) {\n\n\t\tjava.text.NumberFormat format = new java.text.DecimalFormat(\n\t\t\t\t\"###,###\");\n\t\tformat.setMaximumFractionDigits(0);\n\t\tformat.setMinimumFractionDigits(0);\n\t\t\n\t\tif (val < 0){\n\t\t\treturn \"(\"+ format.format(val * -1) + \")\";\t\n\t\t}else{\n\t\t\treturn format.format(val);\t\n\t\t}\n\n\t}", "public int calculate(java.util.List<Round> rounds, int index, Round round);", "public double getRoundingIncrement() {\n return roundingIncrement;\n }", "public double gennemsnit(ArrayList<Integer> list) {\r\n double snit = 0.0;\r\n\r\n for (int i : list) {\r\n snit = snit + i;\r\n }\r\n\r\n return snit / list.size();\r\n }", "public int getRounds() {\n\n\t\treturn rounds;\n\t}", "double[] getSplitRatios();", "public int getNround()\n {\n \treturn this.nround;\n }", "List<BigDecimal> computeRes();", "@Override\n public String toString(){\n StringBuilder ret = new StringBuilder(\"The round track contains:\");\n for (int i=1; i<getRound(); i++)\n ret.append(\"Round \").append(i).append(\": \").append(this.getDice(i).toString());\n return ret.toString();\n }", "public Round() {\n\t\tthis.niceMoves = null;\n\t\tthis.roundNo = 1;\n\t}", "public ArrayList<int[]> getRoundHistory()\n {\n return this.roundHistory;\n }", "private static List<String> listDecimalFormats(){\r\n List<String> result = new ArrayList<String>();\r\n result.add(\"0.###\");\r\n result.add(\"0.00\");\r\n result.add(\"#,##0.###\");\r\n result.add(\"#,##0.00\");\r\n result.add(\"#,##0\");\r\n result.add(\"#,##0%\");\r\n \r\n // Create list of common patterns\r\n Set<String> set = new HashSet<String>();\r\n set.addAll(result);\r\n for (Locale locale: NumberFormat.getAvailableLocales()) {\r\n for (NumberFormat format : new NumberFormat[] { NumberFormat.getNumberInstance(locale),\r\n NumberFormat.getIntegerInstance(locale),\r\n NumberFormat.getCurrencyInstance(locale),\r\n NumberFormat.getPercentInstance(locale) }) {\r\n\r\n // Add pattern\r\n if (format instanceof DecimalFormat) {\r\n String pattern = ((DecimalFormat)format).toPattern();\r\n if (!set.contains(pattern)) {\r\n set.add(pattern);\r\n result.add(pattern);\r\n }\r\n }\r\n }\r\n \r\n }\r\n return result;\r\n }", "public String toString() {\n\t\treturn \"(\" + roundToOneDecimal(x) + \", \" + roundToOneDecimal(y) + \")\";\n\t}", "public BigDecimal getTaxAmtPriceList();", "public void addRound(ArrayList<Move> round) {\r\n\t\tfor (Move move : round) {\r\n\t\t\tadd(move);\r\n\t\t}\r\n\r\n\t\tint lastIndex = offsets.size() - 1;\r\n\t\toffsets.add(round.size() + offsets.get(lastIndex)); // accumulate the\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// index\r\n\t}", "private static double rundeBetrag(double betrag){\n \tdouble round = Math.round(betrag*10000); \r\n \t\r\n \tround = round / 10000; \r\n \tround = Math.round(round*1000); \r\n \tround = round / 1000; \r\n \tround = Math.round(round*100); \r\n \r\n \treturn round / 100; \r\n }", "public BigDecimal getPriceListEntered();", "protected double toPounds(double weightOunces){\n\t\treturn 0.0625 * weightOunces;\n\t}", "private RoundOffUtil()\n {\n\n }", "private void nextRound() {\n\t\n\t\t\n\t\tcfight++;\n\t\tif(cfight>=maxround)\n\t\t{\n\t\tcfight=0;\n\t\t\n\t\tround++;\n\t\t\tmaxround/=2;\n\t\t}\n\t\t\n\tif(round<4)\n\t{\n\tcontrollPCRound();\n\t}\n\telse\n\t{\n\t\tint sp=0;\n\t\tint round=0;\n\t\tfor(int i=0; i<fighter.length; i++)\n\t\t{\n\t\t\tif(spieler[i]>0)\n\t\t\t{\n\t\t\t\tsp++;\n\t\t\t\tif(fround[i]>round)\n\t\t\t\t{\n\t\t\t\tround=fround[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\tif(geld==false)\n\t{\n\t\tgeld=true;\n\t\tif(sp==1)\n\t\t{\n\t\tZeniScreen.addZenis(round*3500);\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tint w=round*4000-500*sp;\n\t\t\tif(w<1)\n\t\t\t{\n\t\t\t\tw=100;\n\t\t\t}\n\t\t\tZeniScreen.addZenis(w);\t\n\t\t}\n\t}\n\t}\n\t\n\t\n\t}", "List<Prize> getPrizeList();", "private MyIntegerList generatedPopulatedList() {\n final MyIntegerList mil = new MyIntegerList();\n\n mil.push(1);\n mil.push(2);\n mil.push(1);\n mil.push(6);\n mil.push(6);\n mil.push(7);\n mil.push(2);\n mil.push(2);\n mil.push(0);\n mil.push(5);\n\n return mil;\n }", "private double roundToOneDecimal(double num) {\n\t\treturn (int)((10 * num) + 0.5) / 10.0;\n\t}", "public String dpRounding(float f) {\n DecimalFormat df = new DecimalFormat(\"#.##\");\n df.setRoundingMode(RoundingMode.CEILING);\n return df.format(f);\n }", "public void addSquaresToList()\n {\n int i = 0;\n int size = 50;\n int spacing = 0;\n int interval = size + spacing;\n\n while (i < 8)\n {\n sqList.add(new Square(interval * i, 0, size, \"red\"));\n i++;\n }\n }", "protected static List<PVector> simplifyDouglasPeucker(List<PVector> points, float sqTolerance) {\n\n\t\tint len = points.size();\n\n\t\tList<Integer> markers = new ArrayList<Integer>(len);\n\t\tfor (int i = 0; i < len; i++) {\n\t\t\tmarkers.add(i, 0);\n\t\t}\n\n\t\tint first = 0;\n\t\tint last = len - 1;\n\n\t\tint i;\n\t\tfloat maxSqDist;\n\t\tfloat sqDist;\n\t\tint index = 0;\n\n\t\tStack<Integer> firstStack = new Stack<Integer>();\n\t\tStack<Integer> lastStack = new Stack<Integer>();\n\n\t\tList<PVector> newPoints = new ArrayList<PVector>();\n\n\t\tmarkers.set(first, 1);\n\t\tmarkers.set(last, 1);\n\n\t\twhile (last > 0) {\n\n\t\t\tmaxSqDist = 0;\n\n\t\t\tfor (i = first + 1; i < last; i++) {\n\t\t\t\tsqDist = getSquareSegmentDistance(points.get(i), points.get(first), points.get(last));\n\n\t\t\t\tif (sqDist > maxSqDist) {\n\t\t\t\t\tindex = i;\n\t\t\t\t\tmaxSqDist = sqDist;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (maxSqDist > sqTolerance) {\n\t\t\t\tmarkers.set(index, 1);\n\n\t\t\t\tfirstStack.push(first);\n\t\t\t\tlastStack.push(index);\n\n\t\t\t\tfirstStack.push(index);\n\t\t\t\tlastStack.push(last);\n\t\t\t}\n\n\t\t\tif (firstStack.isEmpty()) {\n\t\t\t\tfirst = 0;\n\t\t\t} else {\n\t\t\t\tfirst = firstStack.pop();\n\t\t\t}\n\t\t\tif (lastStack.isEmpty()) {\n\t\t\t\tlast = 0;\n\t\t\t} else {\n\t\t\t\tlast = lastStack.pop();\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (markers.get(i) != 0) {\n\t\t\t\tnewPoints.add(points.get(i));\n\t\t\t}\n\t\t}\n\n\t\treturn newPoints;\n\t}", "public List<Double> linespace(double min, double max, int n){\n List<Double> values = new ArrayList<Double>();\n double delta = (max - min) / (n - 1);\n for (int i = 0; i < n; i++){\n values.add(min + delta * i);\n }\n \n return values;\n }", "public static long kRounding(){\n\t\tScanner kbd = new Scanner(System.in); //see fairgame\n\t\tint input = kbd.nextInt();\n\t\tint Nput = input;\n\t\tint rounding = kbd.nextInt();\n\n\t\tint div2 = 0;\n\t\tint div5 = 0;\n\n\t\twhile (input % 2 == 0){\n\t\t\tdiv2++;\n\t\t\tinput = input/2;\n\t\t}\n\t\twhile (input % 5 == 0){\n\t\t\tdiv5++;\n\t\t\tinput = input/5;\n\t\t}\n\n\t\tint multiplierTwo = 1;\n\t\tint multiplierFive = 1;\n\t\tif(rounding - div2 > 0){\n\t\t\tmultiplierTwo = (int) Math.pow(2, rounding - div2);\n\t\t}\n\t\tif(rounding - div5 > 0){\n\t\t\tmultiplierFive = (int) Math.pow(5, rounding - div5)\n\t\t}\n\n\t\treturn multiplierTwo*(long)multiplierFive*(long)Nput;\n\t}", "public Round(int roundNo) {\n\t\tthis.niceMoves = new ArrayList<Move>();\n\t\tthis.roundNo = roundNo;\n\t}", "public int getCurrentRound() {\n\t\treturn roundNumber;\n\t}", "private double roundDecimal(double value, int precision) {\n \tdouble precisionMultiple = Math.pow(10, precision);\n \treturn Math.round(value * precisionMultiple) / precisionMultiple;\n }", "public List<Integer> generateLine() {\r\n\t\tList<Integer> tempLine = new ArrayList<Integer>();\r\n\t\tfor (int j=0; j <3; j++) {\r\n\t\t\tint randomNum = ThreadLocalRandom.current().nextInt(0,3);\r\n\t\t\ttempLine.add(randomNum);\r\n\t\t}\r\n\t\treturn tempLine;\r\n\t}", "public Collection<Die> getDice(int round){\n return new ArrayList<>(dice.get(round-1));\n }", "public static ArrayList<String> getPreviousBillRounds() {\n\n\t\tAppLog.begin();\n\t\tConnection conn = null;\n\t\tPreparedStatement ps = null;\n\t\tResultSet rs = null;\n\t\tList<String> previousBillRoundList = new ArrayList<String>();\n\t\ttry {\n\t\t\tString query = QueryContants.getPreviousBillRoundQuery();\n\t\t\tAppLog.info(\"getPreviousBillRoundsQuery::\" + query);\n\t\t\tconn = DBConnector.getConnection();\n\t\t\tps = conn.prepareStatement(query);\n\t\t\trs = ps.executeQuery();\n\t\t\twhile (rs.next()) {\n\t\t\t\tString previousBillRound = rs.getString(\"PREV_BILL_ROUND\");\n\t\t\t\tpreviousBillRoundList.add(previousBillRound);\n\t\t\t}\n\n\t\t} catch (SQLException e) {\n\t\t\tAppLog.error(e);\n\t\t} catch (IOException e) {\n\t\t\tAppLog.error(e);\n\t\t} catch (Exception e) {\n\t\t\tAppLog.error(e);\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (null != ps) {\n\t\t\t\t\tps.close();\n\t\t\t\t}\n\t\t\t\tif (null != rs) {\n\t\t\t\t\trs.close();\n\t\t\t\t}\n\t\t\t\tif (null != conn) {\n\t\t\t\t\tconn.close();\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tAppLog.error(e);\n\t\t\t}\n\t\t}\n\t\tAppLog.end();\n\t\treturn (ArrayList<String>) previousBillRoundList;\n\t}", "public ArrayList<ArrayList<Float>> getRandomCurrencyPrices(int size){\n ArrayList<ArrayList<Float>> prices = new ArrayList<>();\n for(int i = 0; i < size; i++){\n ArrayList<Float> row = new ArrayList<>();\n prices.add(row);\n for(int j = 0; j < size; j++){\n float x = generator.nextFloat() * 10;\n if(j > i){\n prices.get(i).add(x);\n }\n else if (j == i){\n prices.get(i).add(1.f);\n }\n else if(j < i){\n prices.get(i).add(1.f/x);\n }\n }\n }\n return prices;\n }", "@Override\r\n\tpublic void setRound(int round) {\n\t\tthis.round = \"Round: \"+round;\r\n\t\tupdate();\r\n\t}", "public void createRatingList() {\n this.ratings = List.of(kriterium1, kriterium2,\n kriterium3, kriterium4, kriterium5, kriterium6, kriterium7, kriterium8);\n }", "public double getRadSpacing() {\n return radSpacing;\n }", "public static List<Double> getRandomDoubles(int range, int amount) {\n List<Double> randomNums = new ArrayList<>();\n Random randomGenerator = new Random();\n for (int i = 0; i <= range; i++) {\n randomNums.add((double) i + (double) randomGenerator.nextInt(9) / 10);\n }\n Collections.shuffle(randomNums);\n return randomNums.subList(0, amount);\n }", "public static List<Point> generateTestPoints()\n {\n List<Point> points = new ArrayList<>();\n double r = 1.0;\n int k = 0; // for naming the points.\n for (int i = 0; i <= 360; i += 10) {\n double t = (i)* Math.PI / 180.0;\n double x = r * Math.cos(t);\n double y = r * Math.sin(t);\n String name = \"Point-\" + k;\n Point p = new Point(name, x, y);\n points.add(p);\n k++;\n }\n return points;\n }", "public ArrayList<Integer> generateWinner() {\n if (winner.size() == 7) {\n if (!sorted) {\n Collections.sort(winner);\n sorted = true;\n }\n return winner;\n }\n if (numbers.size() == 32 || winner.size() != 0) {\n init();\n }\n\n for (int i = 0; i < 7; i++) {\n winner.add(numbers.get(random.nextInt(numbers.size())));\n numbers.remove(winner.get(i));\n }\n Collections.sort(winner);\n return winner;\n }", "private float getRoundFourDecimals(float priceIndex) {\n\t\t\n\t\tpriceIndex = ((float)(int)(priceIndex * 100000)) / (float)100000;\t\n\t\t\n\t\tpriceIndex = priceIndex * 10000;\n\t\tpriceIndex = ((float)(int)(priceIndex * 10)) / (float)10;\t\t\n\t\tpriceIndex = (float) Math.ceil(priceIndex);\n\n\t\tpriceIndex = priceIndex / 10000;\n\t\t\n\t\treturn priceIndex;\n\t}", "private double roundNumber(double in_number, int precision) {\r\n\t\tdouble round_precision = Math.pow(10, (double) precision);\r\n\t\treturn Math.round(in_number * round_precision) / round_precision;\r\n\t}", "public void makePathList() {\r\n\t\tPath p = new Path(false,false,false,false);\r\n\t\tfor(int i=0; i<15; i++) {\r\n\t\t\tp = p.randomizePath(p.makeCornerPath());\r\n\t\t\t_list.add(p);\r\n\t\t}\r\n\t\tfor(int i=0; i<13; i++) {\r\n\t\t\tp = p.randomizePath(p.makeStraightPath());\r\n\t\t\t_list.add(p);\r\n\t\t}\r\n\t\tfor(int i=0; i<6; i++) {\r\n\t\t\tp = p.randomizePath(p.makeTPath());\r\n\t\t\t_list.add(p);\r\n\t\t}\r\n\t\tCollections.shuffle(_list);\r\n\t}", "public List<List<Die>> getCollections (){\n List<List<Die>> dieList = new ArrayList<>();\n for(int i = 1; i<getRound(); i++) {\n dieList.add(new ArrayList<>());\n dieList.get(i - 1).addAll(getDice(i));\n }\n return dieList;\n }", "protected double round(double value, int precision) {\n int scale = (int) Math.pow(10, precision);\n return (double) Math.round(value * scale) / scale;\n }", "public int getRound() {\n\t\treturn myHistory.size() + opponentHistory.size();\n\t}", "public void makeRounds() {\n for (int i = 0; i < nrofturns; i++) {\n int check = 0;\n // If all distributors are bankrupt we intrrerupt the simulation\n for (Distributor d : listOfDistributors.getList()) {\n if (d.isBankrupt()) {\n continue;\n }\n check = 1;\n break;\n }\n if (check == 0) {\n break;\n }\n // Auxiliary variable that will point to the best deal for the consumers\n Distributor bestDist;\n // Making the updates at the start of each month\n if (listOfUpdates.getList().get(i).getNewConsumers().size() != 0) {\n for (Consumer x : listOfUpdates.getList().get(i).getNewConsumers()) {\n listOfConsumers.getList().add(x);\n }\n }\n if (listOfUpdates.getList().get(i).getDistributorChanges().size() != 0) {\n for (DistributorChanges x : listOfUpdates.getList().get(\n i).getDistributorChanges()) {\n listOfDistributors.grabDistributorbyID(\n x.getId()).setInitialInfrastructureCost(x.getInfrastructureCost());\n }\n }\n\n // Checking if the producers have changed their costs asta ar trb sa fie update\n\n // Making the variable point to the best deal in the current round\n // while also calculating the contract price for each distributor\n bestDist = listOfDistributors.getBestDistinRound();\n // Removing the link between consumers and distributors when the contract has ended\n for (Distributor d : listOfDistributors.getList()) {\n if (d.isBankrupt()) {\n // Case in which we delete the due payment of the consumer if\n // its current distributor goes bankrupt\n for (Consumer cons : listOfConsumers.getList()) {\n if (cons.getIdofDist() == d.getId()) {\n cons.setDuepayment(0);\n cons.setMonthstoPay(0);\n cons.setIdofDist(-1);\n }\n }\n continue;\n }\n d.getSubscribedconsumers().removeIf(\n c -> c.isBankrupt() || c.getMonthstoPay() <= 0);\n }\n // Giving the non-bankrupt consumers their monthly income and getting the ones\n // without a contract a deal (the best one)\n for (Consumer c : listOfConsumers.getList()) {\n if (c.isBankrupt()) {\n continue;\n }\n c.addtoBudget(c.getMonthlyIncome());\n if (c.getMonthstoPay() <= 0 || c.getIdofDist() == -1) {\n c.setIdofDist(bestDist.getId());\n c.setMonthstoPay(bestDist.getContractLength());\n c.setToPay(bestDist.getContractPrice());\n bestDist.addSubscribedconsumer(c);\n }\n }\n // Making the monthly payments for the non-bankrupt consumers\n for (Consumer entity : listOfConsumers.getList()) {\n if (entity.isBankrupt()) {\n continue;\n }\n // If the consumer has no due payment we check if he can pay the current rate\n if (entity.getDuepayment() == 0) {\n // If he can, do just that\n if (entity.getBudget() >= entity.getToPay()) {\n entity.addtoBudget(-entity.getToPay());\n listOfDistributors.grabDistributorbyID(entity.getIdofDist()).addBudget(\n entity.getToPay());\n entity.reduceMonths();\n // Contract has ended\n if (entity.getMonthstoPay() <= 0) {\n entity.setIdofDist(-1);\n }\n } else {\n // He cannot pay so he gets a due payment\n entity.setDuepayment(entity.getToPay());\n entity.reduceMonths();\n }\n } else {\n // The consumer has a due payment\n if (entity.getMonthstoPay() == 0) {\n // He has one to a distributor with whom he has ended the contract so\n // he must make the due payment and the one to the new distributor\n int aux = (int) Math.round(Math.floor(DUECOEFF * entity.getDuepayment()));\n int idAux = entity.getIdofDist();\n entity.setIdofDist(bestDist.getId());\n entity.setToPay(bestDist.getContractPrice());\n entity.setMonthstoPay(bestDist.getContractLength());\n bestDist.addSubscribedconsumer(entity);\n // He is able to\n if (entity.getBudget() >= (aux + entity.getToPay())) {\n entity.addtoBudget(-(aux + entity.getToPay()));\n listOfDistributors.grabDistributorbyID(idAux).addBudget(\n aux);\n listOfDistributors.grabDistributorbyID(entity.getIdofDist()).addBudget(\n entity.getToPay());\n entity.reduceMonths();\n } else {\n // He has insufficient funds\n entity.setBankrupt(true);\n }\n } else {\n // His due payment is at the same distributor he has to make the monthly\n // payments\n // He can do the payments\n if (entity.getBudget()\n >= (int) Math.round(Math.floor(DUECOEFF * entity.getDuepayment())\n + entity.getToPay())) {\n entity.addtoBudget(-(int) Math.round(Math.floor(DUECOEFF\n * entity.getDuepayment()) + entity.getToPay()));\n listOfDistributors.grabDistributorbyID(entity.getIdofDist()).addBudget(\n (int) Math.round(Math.floor(DUECOEFF * entity.getDuepayment())\n + entity.getToPay()));\n entity.reduceMonths();\n } else {\n // He cannot do the payments\n entity.setBankrupt(true);\n }\n }\n }\n }\n // The non-bankrupt distributors pay their monthly rates\n for (Distributor d : listOfDistributors.getList()) {\n if (d.isBankrupt()) {\n continue;\n }\n d.reduceBudget();\n // Those who cannot, go bankrupt\n if (d.getBudget() < 0) {\n d.setBankrupt(true);\n }\n }\n\n this.roundsAdjustments(i);\n }\n }", "@Test\r\n\tpublic void testPositiveGenerateSignedDecimalFractions_4() {\n\t\tint i = 1;\r\n\t\tfor (RandomOrgClient roc : rocs) {\r\n\t\t\ttry {\r\n\t\t\t\tString ticketId = roc.createTickets(1, true)[0].get(\"ticketId\").getAsString();\r\n\t\t\t\tHashMap<String,Object> o = roc.generateSignedDecimalFractions(10, 5, false, \r\n\t\t\t\t\t\tuserData, ticketId);\r\n\t\t\t\t\r\n\t\t\t\tthis.signedValueTester(roc, i, o, double[].class, true, ticketId);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tcollector.addError(new Error(errorMessage(i, e, true)));\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "public PaxosRound getRound(int a_round)\n {\n PaxosRound result = (PaxosRound) m_rounds.get(new Integer(a_round));\n return result;\n }", "double roundTwoDecimals(double d) { \n DecimalFormat twoDForm = new DecimalFormat(\"#.##\"); \n return Double.valueOf(twoDForm.format(d));\n }", "public ArrayList<Float> getRandomZlotyPrices(int size){\n ArrayList<Float> prices = new ArrayList<>();\n for(int i = 0; i < size; i++){\n prices.add(generator.nextFloat() * 10);\n }\n return prices;\n }", "double roundOff (double value) {\n\t\treturn Math.floor((value + EPSILON) * 100) / 100;\n\t}", "public BigDecimal getPercentageProfitPList();", "public static List<Integer> doubling(List<Integer> list) {\n\t\treturn list.stream().map(n -> (n * 2))\n\t\t\t\t\t\t\t.collect(Collectors.toList());\n\t}", "public int getPointsGainedLastRound(){return pointsGainedLastRound;}", "public static void main(String[] args) {\n List<Double> priceList = new ArrayList<>();\n priceList.add(9.99);\n priceList.add(12.99);\n priceList.add(2.39);\n priceList.add(3.95);\n priceList.add(11.29);\n priceList.add(1.2);\n priceList.add(3.99);\n priceList.add(65.59);\n priceList.add(999.99);\n\n System.out.println(\"priceList = \" + priceList);\n // change the third price to 10 $\n\n priceList.set(2,10D);\n System.out.println(\"priceList 3rd item = \" + priceList);\n // Add 4 dollar to first price\n priceList.set(0,priceList.get(0)+4D);\n System.out.println(\"priceList add $4 ro the first item = \" + priceList);\n\n //change last price to sum of first and second price\n priceList.set(priceList.size()-1,priceList.get(0)+priceList.get(1));\n System.out.println(\"change last price to sum of first and second price \"+priceList);\n\n //give 40% off to second price\n priceList.set(1,priceList.get(1)*0.6);\n System.out.println(\"priceList 40% off = \" + priceList);\n \n \n //DOUBLE THE VALUE OF EACH AND EVERY PRICE IN THE LAST:\n\n for (int i = 0; i <priceList.size() ; i++) {\n priceList.set(i,priceList.get(i)*2);\n \n }\n\n System.out.println(\"priceList doubled= \" + priceList);\n \n // cut the price into half if the price is more than $20\n for (int i = 0; i <priceList.size() ; i++) {\n double eachPrice=priceList.get(i);\n if(eachPrice>=20){\n priceList.set(i,eachPrice/2);\n }\n }\n System.out.println(\"price list after cutting half the prices more than 20: \\n\\t\"+priceList);\n\n int lastIndex=priceList.size()-1;\n //swap the first value with the last value\n Double temp=priceList.get(0);\n priceList.set(0,priceList.get(lastIndex));\n priceList.set(lastIndex,temp);\n\n System.out.println(\"price list after swapping first and last value: \\n\\t\" +priceList);\n\n }", "public int[] round_up(int[] array_of_notes) {\r\n int[] array_of_notes1 = array_of_notes.clone();\r\n for (int i = 0; i < array_of_notes1.length; i++) {\r\n if ((array_of_notes1[i] + 1) % 5 == 0)\r\n array_of_notes1[i] = array_of_notes1[i] + 1;\r\n else if ((array_of_notes1[i] + 2) % 5 == 0)\r\n array_of_notes1[i] = array_of_notes1[i] + 2;\r\n }\r\n return array_of_notes1;\r\n }", "public BigDecimal getPriceListWTax();", "public void roundValues(int dp) {\n /*\n * rounds values to the specified decimal places (dp)\n * in place\n * */\n\n if (dp < 1) {\n return;\n }\n\n dp *= 10;\n realPart = Math.round(realPart * dp) / (double) dp;\n imaginaryPart = Math.round(imaginaryPart * dp) / (double) dp;\n }", "private RoundTable( IntSList knsBefore, IntSList knsAfter, int n ) {\n \n //knights = kns;\n numeroCompl = n;\n knightsBefore = knsBefore;\n knightsAfter = knsAfter;\n lunghezza = knsBefore.length();\n \n }", "private void fillInList(int roundCount){\r\n\r\n\t\t//Displays all of the stats to the screen by using a list of hash maps\r\n\t\tList<HashMap<String, String>> fillMaps = null;\r\n\t\t\r\n\t\tString[] from = new String[] {\"col_1\", \"col_2\", \"col_3\"};\r\n\t\tint[] to = new int[] {R.id.statisticsitem1, R.id.statisticsitem2, R.id.statisticsitem3};\r\n\t\t\r\n\t\tfillMaps = new ArrayList<HashMap<String, String>>();\r\n\t\t\r\n\t\tHashMap<String, String> map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Overall\");\r\n map.put(\"col_2\", \"Average\");\r\n map.put(\"col_3\", \"+/-\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Total Score\");\r\n map.put(\"col_2\", \"\"+df.format(averageScore));\r\n map.put(\"col_3\", averageScore == 0 ? \"-\" : \"\" + df.format(averagePlusMinus));\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Front 9\");\r\n map.put(\"col_2\", \"\"+df.format(averageFront9Score));\r\n map.put(\"col_3\", averageFront9Score == 0 ? \"-\" : \"\" + df.format(averageFront9PlusMinus));\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Back 9\");\r\n map.put(\"col_2\", \"\"+df.format(averageBack9Score));\r\n map.put(\"col_3\", averageBack9Score == 0 ? \"-\" : \"\" + df.format(averageBack9PlusMinus));\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Score Per Hole\");\r\n map.put(\"col_2\", \"\"+df.format(averageHoleScore));\r\n map.put(\"col_3\", averageHoleScore == 0 ? \"-\" : \"\" + df.format(averageHolePlusMinus));\r\n fillMaps.add(map);\r\n\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Hole Stats\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", \"\");\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Fairways\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", numberOfHoles == 0 ? \"-\" : \"\" + df.format(fairways) + \"%\");\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"GIR\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", numberOfHoles == 0 ? \"-\" : \"\" + df.format(girs) + \"%\");\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Putts / Hole\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", numberOfHoles == 0 ? \"-\" : \"\" + df.format(putts));\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Chips / Hole\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", numberOfHoles == 0 ? \"-\" : \"\" + df.format(chips));\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Penalties / Round\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", numberOfHoles == 0 ? \"-\" : \"\" + df.format(penalties));\r\n fillMaps.add(map);\r\n\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Scoring Breakdown\");\r\n map.put(\"col_2\", \"Total\");\r\n map.put(\"col_3\", \"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Albatross\");\r\n map.put(\"col_2\", \"\"+df.format(albatrossCount));\r\n map.put(\"col_3\", albatrossCount == 0 ? \"-\" : \"\" + df.format(albatrossCount / numberOfHoles * 100) + \"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Eagle\");\r\n map.put(\"col_2\", \"\"+df.format(eagleCount));\r\n map.put(\"col_3\", eagleCount == 0 ? \"-\" : \"\" + df.format(eagleCount / numberOfHoles * 100) + \"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Birdie\");\r\n map.put(\"col_2\", \"\"+df.format(birdieCount));\r\n map.put(\"col_3\", birdieCount == 0 ? \"-\" : \"\" + df.format(birdieCount / numberOfHoles * 100) + \"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Par\");\r\n map.put(\"col_2\", \"\"+df.format(parCount));\r\n map.put(\"col_3\", parCount == 0 ? \"-\" : \"\" + df.format(parCount / numberOfHoles * 100) + \"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Bogey\");\r\n map.put(\"col_2\", \"\"+df.format(bogeyCount));\r\n map.put(\"col_3\", bogeyCount == 0 ? \"-\" : \"\" + df.format(bogeyCount / numberOfHoles * 100) + \"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Double\");\r\n map.put(\"col_2\", \"\"+df.format(doubleBogeyCount));\r\n map.put(\"col_3\", doubleBogeyCount == 0 ? \"-\" : \"\" + df.format(doubleBogeyCount / numberOfHoles * 100) + \"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Triple\");\r\n map.put(\"col_2\", \"\"+df.format(tripleBogeyCount));\r\n map.put(\"col_3\", tripleBogeyCount == 0 ? \"-\" : \"\" + df.format(tripleBogeyCount / numberOfHoles * 100) + \"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Quadruple or Worse\");\r\n map.put(\"col_2\", \"\"+df.format(quadBogeyPlusCount));\r\n map.put(\"col_3\", quadBogeyPlusCount == 0 ? \"-\" : \"\" + df.format(quadBogeyPlusCount / numberOfHoles * 100) + \"%\");\r\n fillMaps.add(map);\r\n \r\n\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Par 3\");\r\n map.put(\"col_2\", \"Total\");\r\n map.put(\"col_3\", \"%\");\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"GIR\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", numberOfPar3Holes == 0 ? \"-\" : \"\" + df.format(par3Girs) + \"%\");\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Putts / Hole\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", numberOfPar3Holes == 0 ? \"-\" : \"\" + df.format(par3Putts) );\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Chips / Hole\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", numberOfPar3Holes == 0 ? \"-\" : \"\" + df.format(par3Chips) );\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Penalties / Hole\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", numberOfPar3Holes == 0 ? \"-\" : \"\" + df.format(par3Penalties) );\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Hole In One\");\r\n map.put(\"col_2\", \"\"+df.format(par3EagleCount));\r\n if (par3EagleCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par3EagleCount/numberOfPar3Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Birdie\");\r\n map.put(\"col_2\", \"\"+df.format(par3BirdieCount));\r\n if (par3BirdieCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par3BirdieCount/numberOfPar3Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Par\");\r\n map.put(\"col_2\", \"\"+df.format(par3ParCount));\r\n if (par3ParCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par3ParCount/numberOfPar3Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Bogey\");\r\n map.put(\"col_2\", \"\"+df.format(par3BogeyCount));\r\n if (par3BogeyCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par3BogeyCount/numberOfPar3Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Double\");\r\n map.put(\"col_2\", \"\"+df.format(par3DoubleBogeyCount));\r\n if (par3DoubleBogeyCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par3DoubleBogeyCount/numberOfPar3Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Triple\");\r\n map.put(\"col_2\", \"\"+df.format(par3TripleBogeyCount));\r\n if (par3TripleBogeyCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par3TripleBogeyCount/numberOfPar3Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Quadruple or Worse\");\r\n map.put(\"col_2\", \"\"+df.format(par3QuadBogeyPlusCount));\r\n if (par3QuadBogeyPlusCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par3QuadBogeyPlusCount/numberOfPar3Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n\r\n\r\n\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Par 4\");\r\n map.put(\"col_2\", \"Total\");\r\n map.put(\"col_3\", \"%\");\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Fairways\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", numberOfPar4Holes == 0 ? \"-\" : \"\" + df.format(par4Fairways) + \"%\");\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"GIR\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", numberOfPar4Holes == 0 ? \"-\" : \"\" + df.format(par4Girs) + \"%\");\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Putts / Hole\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", numberOfPar4Holes == 0 ? \"-\" : \"\" + df.format(par4Putts) );\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Chips / Hole\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", numberOfPar4Holes == 0 ? \"-\" : \"\" + df.format(par4Chips) );\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Penalties / Hole\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", numberOfPar4Holes == 0 ? \"-\" : \"\" + df.format(par4Penalties) );\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Hole In One\");\r\n map.put(\"col_2\", \"\"+df.format(par4AlbatrossCount));\r\n if (par4AlbatrossCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par4AlbatrossCount/numberOfPar4Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Eagle\");\r\n map.put(\"col_2\", \"\"+df.format(par4EagleCount));\r\n if (par4EagleCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par4EagleCount/numberOfPar4Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Birdie\");\r\n map.put(\"col_2\", \"\"+df.format(par4BirdieCount));\r\n if (par4BirdieCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par4BirdieCount/numberOfPar4Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Par\");\r\n map.put(\"col_2\", \"\"+df.format(par4ParCount));\r\n if (par4ParCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par4ParCount/numberOfPar4Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Bogey\");\r\n map.put(\"col_2\", \"\"+df.format(par4BogeyCount));\r\n if (par4BogeyCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par4BogeyCount/numberOfPar4Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Double\");\r\n map.put(\"col_2\", \"\"+df.format(par4DoubleBogeyCount));\r\n if (par4DoubleBogeyCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par4DoubleBogeyCount/numberOfPar4Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Triple\");\r\n map.put(\"col_2\", \"\"+df.format(par4TripleBogeyCount));\r\n if (par4TripleBogeyCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par4TripleBogeyCount/numberOfPar4Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Quadruple or Worse\");\r\n map.put(\"col_2\", \"\"+df.format(par4QuadBogeyPlusCount));\r\n if (par4QuadBogeyPlusCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par4QuadBogeyPlusCount/numberOfPar4Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Par 5\");\r\n map.put(\"col_2\", \"Total\");\r\n map.put(\"col_3\", \"%\");\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Fairways\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", numberOfPar5Holes == 0 ? \"-\" : \"\" + df.format(par5Fairways) + \"%\");\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"GIR\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", numberOfPar5Holes == 0 ? \"-\" : \"\" + df.format(par5Girs) + \"%\");\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Putts / Hole\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", numberOfPar5Holes == 0 ? \"-\" : \"\" + df.format(par5Putts) );\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Chips / Hole\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", numberOfPar5Holes == 0 ? \"-\" : \"\" + df.format(par5Chips) );\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Penalties / Hole\");\r\n map.put(\"col_2\", \"\");\r\n map.put(\"col_3\", numberOfPar5Holes == 0 ? \"-\" : \"\" + df.format(par5Penalties) );\r\n fillMaps.add(map);\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Albatross\");\r\n map.put(\"col_2\", \"\"+df.format(par5AlbatrossCount));\r\n if (par5AlbatrossCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par5AlbatrossCount/numberOfPar5Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Eagle\");\r\n map.put(\"col_2\", \"\"+df.format(par5EagleCount));\r\n if (par5EagleCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par5EagleCount/numberOfPar5Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Birdie\");\r\n map.put(\"col_2\", \"\"+df.format(par5BirdieCount));\r\n if (par5BirdieCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par5BirdieCount/numberOfPar5Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Par\");\r\n map.put(\"col_2\", \"\"+df.format(par5ParCount));\r\n if (par5ParCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par5ParCount/numberOfPar5Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Bogey\");\r\n map.put(\"col_2\", \"\"+df.format(par5BogeyCount));\r\n if (par5BogeyCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par5BogeyCount/numberOfPar5Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Double\");\r\n map.put(\"col_2\", \"\"+df.format(par5DoubleBogeyCount));\r\n if (par5DoubleBogeyCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par5DoubleBogeyCount/numberOfPar5Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Triple\");\r\n map.put(\"col_2\", \"\"+df.format(par5TripleBogeyCount));\r\n if (par5TripleBogeyCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par5TripleBogeyCount/numberOfPar5Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n \r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Quadruple or Worse\");\r\n map.put(\"col_2\", \"\"+df.format(par5QuadBogeyPlusCount));\r\n if (par5QuadBogeyPlusCount == 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\"+df.format(par5QuadBogeyPlusCount/numberOfPar5Holes*100)+\"%\");\r\n fillMaps.add(map);\r\n\r\n\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"Club\");\r\n map.put(\"col_2\", \"Avg. Dist.\");\r\n map.put(\"col_3\", \"Accuracy\");\r\n fillMaps.add(map);\r\n\r\n for(Club club : clubs) {\r\n map = new HashMap<String, String>();\r\n map.put(\"col_1\", \"\" + club.getClub());\r\n map.put(\"col_2\", club.getAvgDist() <= 0 ? \"-\" : \"\" + df.format(club.getAvgDist()));\r\n if (club.getAccuracy() <= 0 && club.getAvgDist() <= 0)\r\n map.put(\"col_3\", \"-\");\r\n else\r\n map.put(\"col_3\", \"\" + df.format(club.getAccuracy()) + \"%\");\r\n fillMaps.add(map);\r\n }\r\n\r\n\r\n\r\n\r\n ListView lv = getListView();\t\r\n \r\n //Sets a fading design as the divider line\r\n int[] colors = {0, 0xff347c12, 0};\r\n lv.setDivider(new GradientDrawable(Orientation.RIGHT_LEFT, colors));\r\n lv.setDividerHeight(1);\r\n \r\n //Displays the list using a special adapter\r\n\t\tSpecialAdapter adapter = new SpecialAdapter(Statistics.this, fillMaps, R.layout.statisticsgrid, from, to);\r\n\t\tlv.setAdapter(adapter);\r\n\t}", "public static ArrayList<Symbol> spin(){\n Symbol s1=new Symbol(6,new Image(\"Images/bell.png\")); //bell payout credit is 6\n Symbol s2=new Symbol(2,new Image(\"Images/cherry.png\")); //cherry payout credit is 2\n Symbol s3=new Symbol(3,new Image(\"Images/lemon.png\")); //lemon payout credit is 3\n Symbol s4=new Symbol(4,new Image(\"Images/plum.png\")); //plum payout credit is 4\n Symbol s5=new Symbol(7,new Image(\"Images/redseven.png\")); //seven payout credit is 7\n Symbol s6=new Symbol(5,new Image(\"Images/watermelon.png\"));//watermelon payout credit is 5\n\n //add symbols to the arraylist by adding the objects\n symbolList.add(s1);\n symbolList.add(s2);\n symbolList.add(s3);\n symbolList.add(s4);\n symbolList.add(s5);\n symbolList.add(s6);\n\n //shuffle the arraylist to get random symbols/images\n Collections.shuffle(symbolList);\n return symbolList;\n }", "public IconBuilder round() {\n\t\tthis.shape = IconShape.ROUND;\n\t\treturn this;\n\t}", "public BigDecimal divideNumbers(List<Integer> numbers) throws Exception;", "List<BigDecimal> computeSol();", "protected static ArrayList<String> GenNumber() {\n\n ArrayList<String> initialList = new ArrayList<>();\n\n initialList.add(\"1\"); //Add element\n initialList.add(\"2\");\n initialList.add(\"3\");\n initialList.add(\"4\");\n initialList.add(\"5\");\n initialList.add(\"6\");\n initialList.add(\"7\");\n initialList.add(\"8\");\n initialList.add(\"9\");\n\n Collections.shuffle(initialList); //Random the position\n\n return initialList;\n }", "public List<Integer> getSortedPriceOfAllUnit(String unitSize){\r\n\t\tList<Integer> allUnitPrice=new ArrayList<Integer>();\r\n\t\tList<CateredWebElement> allUnitElements=new ArrayList<CateredWebElement>();\r\n\t\tString[] singleSizePrices;\r\n\t\t\r\n\t\tswitch(unitSize){\r\n\t\tcase \"Small\":\r\n\t\tallUnitElements=webAppDriver.findAllElementsByXpath(lbAllSmallPricesXpath);\r\n\t\tsingleSizePrices=new String[allUnitElements.size()];\r\n\t\tfor (int i=0;i<allUnitElements.size();i++){\r\n\t\t\tsingleSizePrices[i]=allUnitElements.get(i).getText().replace(\"$\", \"\");\r\n\t\t\tsingleSizePrices[i]=singleSizePrices[i].replace(\"/mo.\", \"\").trim();\r\n\t\t\tallUnitPrice.add(Integer.parseInt(singleSizePrices[i]));\t\t\t\r\n\t\t}\r\n\t\tCollections.sort(allUnitPrice);\r\n\t\treturn allUnitPrice;\r\n\t\tcase \"Medium\":\r\n\t\t\tallUnitElements=webAppDriver.findAllElementsByXpath(lbAllMediumPricesXpath);\r\n\t\t\tsingleSizePrices=new String[allUnitElements.size()];\r\n\t\t\tfor (int i=0;i<allUnitElements.size();i++){\r\n\t\t\t\tsingleSizePrices[i]=allUnitElements.get(i).getText().replace(\"$\", \"\");\r\n\t\t\t\tsingleSizePrices[i]=singleSizePrices[i].replace(\"/mo.\", \"\").trim();\r\n\t\t\t\tallUnitPrice.add(Integer.parseInt(singleSizePrices[i]));\t\r\n\t\t\t}\r\n\t\t\tCollections.sort(allUnitPrice);\r\n\t\t\treturn allUnitPrice;\r\n\t\tcase \"Large\":\r\n\t\t\tallUnitElements=webAppDriver.findAllElementsByXpath(lbAllLargePricesXpath);\r\n\t\t\tsingleSizePrices=new String[allUnitElements.size()];\r\n\t\t\tfor (int i=0;i<allUnitElements.size();i++){\r\n\t\t\t\tsingleSizePrices[i]=allUnitElements.get(i).getText().replace(\"$\", \"\");\r\n\t\t\t\tsingleSizePrices[i]=singleSizePrices[i].replace(\"/mo.\", \"\").trim();\r\n\t\t\t\tallUnitPrice.add(Integer.parseInt(singleSizePrices[i]));\t\r\n\t\t\t}\r\n\t\t\tCollections.sort(allUnitPrice);\r\n\t\t\treturn allUnitPrice;\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\tCollections.sort(allUnitPrice);\r\n\t\treturn allUnitPrice;\r\n\t}", "private static int newNumber()\n\t{\n\t\tdouble initial = Math.random();\n\t\tdouble rangeAdjusted = initial * (10000 - 1001) + 1000;\n\t\tint rounded = (int)Math.round(rangeAdjusted);\n\t\treturn rounded;\n\t}", "public void logRound(int round){\n\t\tcountRounds++;\n\t\tlog += String.format(\"ROUND %d\", round);\n\t\tlineBreak();\n\t}", "public List<BigDecimal> getEarningsList(){\n return earningsList;\n }", "public BigDecimal getPriceListOld();" ]
[ "0.59008217", "0.58853835", "0.5706817", "0.56259894", "0.55735636", "0.5537066", "0.54751784", "0.54485786", "0.5413556", "0.5384461", "0.5282443", "0.525479", "0.52427566", "0.5216571", "0.51731426", "0.5168683", "0.51591635", "0.5139736", "0.5081381", "0.5078396", "0.5069444", "0.50682473", "0.50671774", "0.5066158", "0.50618607", "0.504787", "0.503911", "0.5028877", "0.50284845", "0.5026554", "0.50253415", "0.50129426", "0.50056887", "0.49992993", "0.49976873", "0.49877053", "0.49869522", "0.49750945", "0.49749509", "0.49646443", "0.4899152", "0.48955017", "0.48841214", "0.48750177", "0.48712668", "0.48525453", "0.48494437", "0.48470503", "0.48299062", "0.48237348", "0.48201844", "0.48115295", "0.48069203", "0.48007488", "0.4790293", "0.4786908", "0.47856113", "0.47719216", "0.4747149", "0.474714", "0.47452945", "0.47442958", "0.47343117", "0.47166577", "0.47036532", "0.47031474", "0.46997616", "0.46951553", "0.469313", "0.46896273", "0.4687118", "0.46868336", "0.46834853", "0.4681721", "0.46662", "0.4663282", "0.46621808", "0.46509403", "0.46492356", "0.4643322", "0.46422523", "0.46409318", "0.463818", "0.4636729", "0.46232325", "0.46065482", "0.4605728", "0.46055803", "0.45987186", "0.45958772", "0.45864773", "0.45835704", "0.4577643", "0.4571911", "0.45710868", "0.45641539", "0.45625633", "0.4555362", "0.45512393", "0.45488742" ]
0.73247117
0
Method that rounds a random number
public static int randomRound(){ int max = 1000; int min = 0; int range = max-min+1; int randNum = (int)(Math.random()*range) + min; return randNum; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static int newNumber()\n\t{\n\t\tdouble initial = Math.random();\n\t\tdouble rangeAdjusted = initial * (10000 - 1001) + 1000;\n\t\tint rounded = (int)Math.round(rangeAdjusted);\n\t\treturn rounded;\n\t}", "static int roll() {\n\t\tRandom rand = new Random();\t\t\t\t//get large random number\n\t\tint num2 = rand.nextInt();\t\t\t\t//convert from long to int\n\t\treturn Math.abs(num2%6)+1;\t\t\t\t//num between 1 and 6\n\t}", "public static int rollDice(){\n return (int)(Math.random()*6) + 1;\n // Math.random returns a double number >=0.0 and <1.0\n }", "public static int randomNumberRatio(){\r\n int max = 10;\r\n int min = 1;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n return randNum;\r\n }", "public int roll()\n {\n int r = (int)(Math.random() * sides) + 1;\n return r;\n }", "public int rollResult(){\r\n return rand.nextInt(6) + 1;\r\n }", "int RollDice ()\n {\n\tint roll = (int) (Math.random () * 6) + 1;\n\treturn roll;\n }", "public static double randomNum(Random g)\n\t{\n\t\treturn -5+g.nextDouble()*10;\n\t}", "public int roll_the_dice() {\n Random r = new Random();\n int number = r.nextInt(6) + 1;\n\n return number;\n }", "public int roll() {\n return random.nextInt(6) + 1;\n }", "public void roll(){\n currentValue = rand.nextInt(6)+1;\n }", "public void roll()\r\n\t{\r\n\t\tthis.value = rnd.nextInt(6) + 1;\r\n\t}", "private double getRandomNumber(){\n double rand = Math.random();//produce a number between 0 and 1\n rand = rand - 0.5;\n return rand;\n }", "public static void main(String[] args) {\n// System.out.println(Math.floor(12.34));/\n// System.out.println(Math.(12.34));/\n// System.out.println(Math.ceil(12.34));/\n// System.out.println(Math.ceil(12.34));/\n int start=5;\n int end=66;\n int i=start+(int)(Math.round(Math.random()*(end-start)) );\n System.out.println(i);\n }", "public int roll3D6()\n {\n Random random1 = new Random();\n int r = random1.nextInt(6) +1;\n r += random1.nextInt(6) +1;\n r += random1.nextInt(6) +1;\n return r;\n }", "public static int rollDice()\n\t{\n\t\tint roll = (int)(Math.random()*6)+1;\n\t\t\n\t\treturn roll;\n\n\t}", "public static int diceRoll() {\n Random roller = new Random();//Create a random number generator\r\n return roller.nextInt(6) + 1;//Generate a number between 0-5 and add 1 to it\r\n }", "public int randomNum() {\n\t\treturn 1 + (int) (Math.random() * 3); // randomNum = minimum + (int)(Math.random() * maximum);\n\t}", "public static int randomNumberAlg(){\r\n int max = 10;\r\n int min = 1;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n return randNum;\r\n }", "public int roll() {\n Random r;\n if (hasSeed) {\n r = new Random();\n }\n else {\n r = new Random();\n }\n prevRoll = r.nextInt(range) + 1;\n return prevRoll;\n }", "public int roll() {\n this.assuerNN_random();\n //Roll once\n int result = random.nextInt(this.sides)+1;\n //TODO Save the roll somewhere\n\n //Return the roll\n return result;\n }", "private int randomNum() {\r\n\t return((int)(Math.random() * 100));\r\n\t }", "private int generateRandomNumber() {\n\t\treturn (int) Math.floor(Math.random() * Constants.RANDOM_NUMBER_GENERATOR_LIMIT);\n\t}", "@Override\n\tpublic double compete() {\n\t\tdouble result=MyTools.getRandomNum(10, 20); \t\n\t\tsetThisResult(result);\n\t\treturn result;\n\t}", "public static int randomNumber(){\r\n int max = 10;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n return randNum;\r\n }", "private int randomWeight()\n {\n return dice.nextInt(1000000);\n }", "private int generateRandomNumber() {\n\t\treturn new SplittableRandom().nextInt(0, 3);\n\t}", "public int rollDice() {\n\t\td1 = (int)rand.nextInt(6)+1;\n\t\td2 = (int)rand.nextInt(6)+1;\n\t\treturn d1+d2;\n\t}", "public float randomize() {\n return nextFloat(this.min, this.max);\n }", "public int generateRandom() {\n\t\tint random = (int)(Math.random()*((6-1)+1))+1;\n\t\treturn random;\n\t}", "private int diceRoll(int sides) {\n return (int) ((Math.random() * sides) + 1);\n }", "public static int diceRoll() {\n int max = 20;\n int min = 1;\n int range = max - min + 1;\n int rand = (int) (Math.random() * range) + min;\n return rand;\n }", "public void roll()\r\n\t{\r\n\t\tRandom rand = new Random();\r\n\r\n\t\trollNumber = rand.nextInt(numOfSides) + 1;\r\n\t}", "public int randomDP() {\n\t\treturn(getRandomInteger(10,250));\n\t}", "private void roll() {\n value = (int) (Math.random() * MAXVALUE) + 1;\n }", "public double getRandom() {\n return 20*Math.random() - 10;\n }", "int randomPoint() { return 1 + (int)Math.round((Math.random()*20) % (size - 2)); }", "public static int randInt() {\n\t\tint min = 10;\n\t\tint max = 99999999;\n\t\tRandom rand = new Random();\n\t\tint randomNum = (rand.nextInt((max - min) + 1) + rand.nextInt((max - min) + 1)) / 2;\n\t\treturn randomNum;\n\t}", "private static void roll()\n {\n rand = (int)(((Math.random())*6)+1); // dice roll #1\n rand2 = (int)(((Math.random())*6)+1);// dice roll #2\n }", "public int generateRoll() {\n\t\tint something = (int) (Math.random() * 100) + 1;\n\t\tif (something <= 80) {\n\t\t\tint allNumRoll = (int) (Math.random() * getNumSides()) + 1;\n\t\t\tint roll = allNumRoll * 2 - 1;\n\t\t\treturn roll;\n\t\t} else {\n\t\t\tint allNumRoll = (int) (Math.random() * getNumSides()) + 1;\n\t\t\tint roll = allNumRoll * 2;\t\t\n\t\t\treturn roll;\n\t\t}\n\t}", "public int roll() {\n Random random = new Random();\n faceValue = random.nextInt(sides)+1;\n return faceValue;\n }", "private int randomValue() {\r\n\t\tRandom rand = new Random();\r\n\t\tint val = rand.nextInt(10);\r\n\t\tif(val == 9)\r\n\t\t\treturn 4;\r\n\t\telse\r\n\t\t\treturn 2;\r\n\t}", "public static int getRandomNumber(){\n int random = 0; // set variable to 0\r\n random = (int)(Math.random()*10) + 1; //generate random number between 1 and 10\r\n return random; //return random number\r\n }", "private static int getRandomNumberOfRooms(){\r\n return r.nextInt(50)+1;\r\n }", "public static double genRandomRestNumber() {\n return Simulator.randomGenerator.genRandomRest();\n }", "public int throwDice() {\n //create new random number between 1 and 6\n int nr = ThreadLocalRandom.current().nextInt(1, 6 + 1);\n //throw the number\n throwDice(nr);\n //return number\n return nr;\n }", "public static int rollStrength(){\n num1 = (int)(Math.random()*(20-0+1)+0);\n return num1;\n }", "private double randn(){\r\n\t\t//* http://www.mathworks.com/access/helpdesk/help/techdoc/matlab.html\r\n\t\t//RandomNumber rnd = new RandomNumber(System.currentTimeMillis());\r\n\t\t//return rnd.normal();\r\n\t\treturn rnd.nextGaussian();\r\n\t\t//return 0;\r\n\t}", "private int newSpeed() {\n //makes a random speed for the ball in (-50,-15)U(15,50)\n int n = r.nextInt(71) - 35;\n if (n < 0) {\n n = n - 15;\n } else {\n n = n + 15;\n }\n return n;\n }", "public int roll(){\r\n myFaceValue = (int)(Math.random() * myNumSides) + 1;\r\n return myFaceValue;\r\n }", "public static int customRandom(int range)\n {\n \tint random = (int)(Math.random()*10)%range;\n\t\n\treturn random;\n }", "public static long kRounding(){\n\t\tScanner kbd = new Scanner(System.in); //see fairgame\n\t\tint input = kbd.nextInt();\n\t\tint Nput = input;\n\t\tint rounding = kbd.nextInt();\n\n\t\tint div2 = 0;\n\t\tint div5 = 0;\n\n\t\twhile (input % 2 == 0){\n\t\t\tdiv2++;\n\t\t\tinput = input/2;\n\t\t}\n\t\twhile (input % 5 == 0){\n\t\t\tdiv5++;\n\t\t\tinput = input/5;\n\t\t}\n\n\t\tint multiplierTwo = 1;\n\t\tint multiplierFive = 1;\n\t\tif(rounding - div2 > 0){\n\t\t\tmultiplierTwo = (int) Math.pow(2, rounding - div2);\n\t\t}\n\t\tif(rounding - div5 > 0){\n\t\t\tmultiplierFive = (int) Math.pow(5, rounding - div5)\n\t\t}\n\n\t\treturn multiplierTwo*(long)multiplierFive*(long)Nput;\n\t}", "public static double getRandomRating() {\n return (double) (RandomNumberGenerator.getRandomInt(0, 10) / 2d);\n }", "public void roll() {\n\t\tthis.currentValue = ThreadLocalRandom.current().nextInt(1, this.numSides + 1);\n\t}", "@Override\n\tpublic double compete() {\n\t\tdouble result=MyTools.getRandomNum(500, 800);\n\t\tsetThisResult(result);\n\t\treturn result;\n\t}", "public int randomNum()\r\n {\r\n Random rand = new Random();\r\n int n = rand.nextInt(52)+1;\r\n return n;\r\n }", "int randInt(int n) {\r\n return _randomSource.nextInt(n);\r\n }", "public static double random()\n {\n return _prng2.nextDouble();\n }", "public static double random() {\r\n return uniform();\r\n }", "private int randomHelper() {\n\t\tRandom rand = new Random();\n\t\tint randomNum = rand.nextInt((10000 - 1) + 1) + 1;\n\t\treturn randomNum;\n\t}", "public int randomGQ() {\n\t\treturn(getRandomInteger(10,100));\n\t}", "public static int getRandomBalance(){\n return rand.nextInt(1000000);\n }", "public static int randNum() {\r\n\t\tint rand = (int)(Math.random()*((100)+1)); // Num generated between [0, 100]\r\n\t\treturn rand;\r\n\t}", "public static int randomNumber(int start, int end) {\n long range = (long) end - (long) start + 1;\n // compute a fraction of the range, 0 <= frac < range\n long fraction = (long) (range * RANDOM.nextDouble());\n return (int) (fraction + start);\n }", "public int getRoundNum(){\n return gameRounds;\n }", "public int getRandomsNumber(){\n Random random = new Random();\n int number = random.nextInt(12) + 1;\n return number;\n }", "public static int randInt() {\n Random rand = new Random();\n\n // nextInt is normally exclusive of the top value,\n // so add 1 to make it inclusive\n int randomNum = rand.nextInt((20 - 10) + 1) + 10;\n\n return randomNum;\n }", "int randInt(int n) {\n return _randomSource.nextInt(n);\n }", "public int getRound()\r\n\t{\r\n\t\treturn this.round;\r\n\t}", "private int rand() {\n return (int)(Math.random()*(RAND_MAX + 1));\n }", "public int rollNumber() throws ClientException{\n\t\t//if(canRollNumber()){\n\t\t\thasRolled = true;\n\t\t\tRandom rand = new Random();\n\t\t\tint roll = rand.nextInt(6)+1;\n\t\t\troll += rand.nextInt(6)+1;\n\t\t\treturn roll == 7 ? 6:roll;\n\n\t}", "private void setRand(){\n rand = generator.nextInt(9) + 1;\n }", "int random(int m)\n {\n return (int) (1 + Math.random()%m);\n }", "@Override\n public int orinar() {\n\n return (int) (Math.random() * 400) + 400;\n }", "public static int diceRoll() {\n\t\t\n\t\t//the outcome of the die is stored as an integer and returned\n\t\t\n\t\tint diceNumber = (int)((6 * (Math.random())) + 1);\n\t\treturn diceNumber;\n\t}", "private double getRandom() {\n return 2*Math.random() - 1;\n }", "private void randomizeNum() {\n randomNums.clear();\n for (int i = 0; i < 4; i++) {\n Integer rndNum = rnd.nextInt(10);\n randomNums.add(rndNum);\n }\n }", "public int roll() {\n int result = ThreadLocalRandom.current().nextInt(SIDES+1) + 1;// standard 1-7\n if(result == 7){ //LoadedDie 6 occurs twice as often\n return 6;\n } else{\n return result;\n }\n }", "public int rollDice() {\n\t\td1 = r.nextInt(6) + 1;\n\t\td2 = r.nextInt(6) + 1;\n\t\trepaint();\n\t\treturn d1 + d2;\n\t}", "static int random(int mod)\n {\n Random rand = new Random();\n int l= (rand.nextInt());\n if(l<0)\n l=l*-1;\n l=l%mod;\n return l;\n }", "public static int randomNumber50(){\r\n int max = 50;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n return randNum;\r\n }", "public static int getRndSalary() {\n return ThreadLocalRandom.current().nextInt(10, 100000 + 1);\n }", "public static int getRandomAmount(){\n return rand.nextInt(1000);\n }", "public int compete() {\r\n\t\tint max = 20;\r\n\t\tint min = 10;\r\n\t\tRandom Rand = new Random();\r\n\t\tint ranNum = Rand.nextInt(max - min) + min;\r\n\t\treturn ranNum;\r\n\t}", "public static int getRandom() \n\t{\n\t\treturn rGenerator.nextInt();\n\t}", "public int randomAmount() {\n return Util.random(getMinAmount(), getMaxAmount());\n }", "private static int addRandomScore() {\n Random ran = new Random();\n return ran.nextInt(201) + 400;\n }", "public static int getRandom(int n){\n\t\treturn rg.nextInt(n); \n\t}", "public int tossDice(){\n\t\tRandom r = new Random();\n\t\tdiceValue = r.nextInt(6)+1;\n\t\tdiceTossed = true;\n\t\treturn diceValue;\n\t}", "public Rng(int sides, long seed) {\n\t\tthis.sides = sides;\n\t\tr = new Random(seed);\n\t}", "public static String generateRandomInteger() {\n SecureRandom random = new SecureRandom();\n int aStart = 1;\n long aEnd = 999999999;\n long range = aEnd - (long) aStart + 1;\n long fraction = (long) (range * random.nextDouble());\n long randomNumber = fraction + (long) aStart;\n return String.valueOf(randomNumber);\n }", "public static int generateRandomNumber()\n\t{\n\t\tRandom r = new Random();\n\t\treturn r.nextInt();\n\t}", "public static double rand() {\n return (new Random()).nextDouble();\n }", "public void Diceroll()\n\t{\n\t\tdice1 = rand.nextInt(6)+1;\n\t\tdice2 = rand.nextInt(6)+1;\n\t\ttotal = dice1+dice2;\n\t}", "public int rollDie() {\n\t\treturn (int) (Math.random()*6)+1;\n\t}", "public final void rand() {\n\t\tpush(randomNumberGenerator.nextDouble());\n\t}", "public int roll() {\n if(!debug)\n this.result = random.nextInt(6) + 1;\n else{\n scanner = new Scanner(showInputDialog(\"Enter dice value (1-6):\"));\n try{int res = scanner.nextInt()%7;\n this.result = res!=0? res:6;\n }\n catch(NoSuchElementException ne){this.result=6;} \n }\n return this.result;\n }", "public int randomMove()\r\n {\r\n r = new Random();\r\n x = r.nextInt(7);\r\n return x;\r\n }", "public int getRound() {\n return round;\n }", "int getRandom(int max);" ]
[ "0.67516226", "0.6726924", "0.6708698", "0.6654405", "0.66435957", "0.6537136", "0.64997625", "0.64682037", "0.6435357", "0.6431804", "0.64173096", "0.64051646", "0.63703823", "0.63243026", "0.62757987", "0.626686", "0.62595135", "0.6250971", "0.6246489", "0.6212774", "0.61758506", "0.6164318", "0.6138677", "0.61191446", "0.6111947", "0.61031795", "0.60999936", "0.60529554", "0.60504323", "0.6032977", "0.6021971", "0.5987685", "0.5980272", "0.59783226", "0.59685034", "0.59476197", "0.59394956", "0.5933911", "0.5931347", "0.5926745", "0.5926196", "0.59229094", "0.59210026", "0.5917055", "0.59142774", "0.5896471", "0.5890391", "0.5882126", "0.58767515", "0.58736587", "0.5864234", "0.5863857", "0.5852951", "0.5834602", "0.5826794", "0.5826253", "0.5825131", "0.5825084", "0.58199716", "0.58181375", "0.5804187", "0.57894677", "0.57889783", "0.57874507", "0.5784832", "0.57824045", "0.5780132", "0.5779804", "0.5769806", "0.5754257", "0.5750214", "0.57488436", "0.5744517", "0.57275224", "0.5718285", "0.57130843", "0.5712033", "0.57115304", "0.5710967", "0.57043403", "0.5701864", "0.57004005", "0.56998754", "0.56886894", "0.56886804", "0.568687", "0.5685749", "0.56810266", "0.5674359", "0.56737256", "0.5673711", "0.56704015", "0.5666359", "0.5659689", "0.5657411", "0.56533694", "0.56459117", "0.5645246", "0.56375366", "0.5633104" ]
0.7327513
0
Method that generates a random decimal
public static Double randomDecimal(){ int max = 1000; int min = 0; int range = max-min+1; int randNum = (int)(Math.random()*range) + min; double randDec = (randNum/100.0); return randDec; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private double getRandomNumber(){\n double rand = Math.random();//produce a number between 0 and 1\n rand = rand - 0.5;\n return rand;\n }", "public double getRandom(){\n\t\treturn random.nextDouble();\n\t}", "public double getRandom() {\n return 20*Math.random() - 10;\n }", "public static double random()\n {\n return _prng2.nextDouble();\n }", "public static double rand() {\n return (new Random()).nextDouble();\n }", "private double getRandom() {\n return 2*Math.random() - 1;\n }", "public static double randomNum(Random g)\n\t{\n\t\treturn -5+g.nextDouble()*10;\n\t}", "private float randomPrice() {\n float price = floatRandom(this.maxRandomPrice);\n return price;\n }", "public static double random() {\r\n return uniform();\r\n }", "public static int getRandomBalance(){\n return rand.nextInt(1000000);\n }", "private double randn(){\r\n\t\t//* http://www.mathworks.com/access/helpdesk/help/techdoc/matlab.html\r\n\t\t//RandomNumber rnd = new RandomNumber(System.currentTimeMillis());\r\n\t\t//return rnd.normal();\r\n\t\treturn rnd.nextGaussian();\r\n\t\t//return 0;\r\n\t}", "public static double random()\n {\n final int MAX_INT = 2147483647;\n int n = MAX_INT;\n \n // Just to ensure it does not return 1.0\n while(n == MAX_INT)\n \tn = abs (RAND.nextInt());\n \n return n * (1.0 / MAX_INT);\n }", "public static int getRandomAmount(){\n return rand.nextInt(1000);\n }", "private int randomNum() {\r\n\t return((int)(Math.random() * 100));\r\n\t }", "public float randomize() {\n return nextFloat(this.min, this.max);\n }", "public Double generateRandomDouble() {\n\t\tRandom rand = new Random(Double.doubleToLongBits(Math.random()));\n\t\treturn rand.nextDouble();\n\t}", "public static String generateRandomInteger() {\n SecureRandom random = new SecureRandom();\n int aStart = 1;\n long aEnd = 999999999;\n long range = aEnd - (long) aStart + 1;\n long fraction = (long) (range * random.nextDouble());\n long randomNumber = fraction + (long) aStart;\n return String.valueOf(randomNumber);\n }", "private double genMultiplier() {\n return (random.nextInt(81) + 60)/100.0;\n }", "public int randomDP() {\n\t\treturn(getRandomInteger(10,250));\n\t}", "private int generateRandomNumber() {\n\t\treturn new SplittableRandom().nextInt(0, 3);\n\t}", "public static double uniform() {\r\n return random.nextDouble();\r\n }", "public static double uniform() {\n return random.nextDouble();\n }", "public static double random(double input){\n\t\treturn Math.random()*input;\n\t}", "public double generateMoneyGoal() {\n\t\tdouble moneyGoal = Math.random()*(10000 -100)+100; \n\t\t\n\t\treturn moneyGoal;\n\t}", "public static int randomNext() { return 0; }", "public static int generateDigit() {\n\t\t\n\t\treturn (int)(Math.random() * 10);\n\t}", "public void generateNewSecret() {\r\n \r\n //Get Random Number With Correct Digits\r\n int intRand = randomNumberGenerator.nextInt((int)(Math.pow(10, numDigits) - Math.pow(10, numDigits - 1))) + (int)Math.pow(10, numDigits - 1);\r\n \r\n //Set To String\r\n String strRand = String.valueOf(intRand);\r\n \r\n //Set Value\r\n secretNumber = convertNumToDigitArray(strRand);\r\n \r\n }", "public static void test1() {\n BigDecimal value = new BigDecimal(0);\n Random rn = new Random();\n\n for (int i = 0; i < 10; i++) {\n int randomNumber = rn.nextInt(1000) + 1;\n value = value.add(new BigDecimal(randomNumber));\n System.out.println(\"value = \" + value.abs());\n }\n }", "@Override\n\tpublic double compete() {\n\t\tdouble result=MyTools.getRandomNum(10, 20); \t\n\t\tsetThisResult(result);\n\t\treturn result;\n\t}", "public static String randomFraction(){\r\n int denom = randomNumber();\r\n int numer = randomNumber();\r\n String fraction = \"\";\r\n \r\n if (numer>denom){\r\n fraction = numer+\"/\"+denom;\r\n }\r\n else {\r\n fraction = denom+\"/\"+numer;\r\n }\r\n \r\n return fraction;\r\n }", "public double nextDouble(){\r\n\t\tlong rand = nextLong();\r\n\t\treturn (double)(rand & 0x000fffffffffffffL)/((double)0x000fffffffffffffL);\r\n\t}", "private double generateRandomValue(int min, int max) {\n\t\tdouble number = (Math.random() * max * 100) / 100 + min;\n\t\treturn number;\n\t}", "public int eDmg(){\r\n eDmg = rand.nextInt(13);\r\n return eDmg;\r\n }", "public double randomValue(){\n\t\treturn _randomValue() + _randomValue() + _randomValue();\n\t}", "public final void rand() {\n\t\tpush(randomNumberGenerator.nextDouble());\n\t}", "public float nextFloat(){\r\n\t\tint rand = nextInt();\r\n\t\treturn (float)(rand & 0x007fffff)/((float) 0x007fffff);\r\n\t}", "public static double genRandomRestNumber() {\n return Simulator.randomGenerator.genRandomRest();\n }", "public static int randomNumberRatio(){\r\n int max = 10;\r\n int min = 1;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n return randNum;\r\n }", "public static int randomRound(){\r\n int max = 1000;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n return randNum;\r\n }", "private static double randomGenerator(double min, double max) {\n return (double)java.lang.Math.random() * (max - min +1) + min;\n }", "public static int randNum() {\r\n\t\tint rand = (int)(Math.random()*((100)+1)); // Num generated between [0, 100]\r\n\t\treturn rand;\r\n\t}", "public static double fastRandomDouble(){\n\t\treturn rdm.nextDouble();\n\t\t//return rdm.nextDoubleFast();\n\t\t//return ((double)(fastRandomInt()) - ((double)Integer.MIN_VALUE)) / (-(Integer.MIN_VALUE * 2.0));\n\t}", "float getRandomValue(float min, float max)\r\n\t{\n\t\tRandom r = new Random(/*SEED!!!*/);\r\n\t\t//get a float between 0 and 1 then multiply it by the min/max difference.\r\n\t\tfloat num = r.nextFloat();\r\n\t\tnum = num * (max-min) + min;\r\n\t\treturn num;\r\n\t}", "private int generateRandomNumber() {\n\t\treturn (int) Math.floor(Math.random() * Constants.RANDOM_NUMBER_GENERATOR_LIMIT);\n\t}", "public float gaussianRandom() {\n\t\treturn (CCMath.constrain((float)nextGaussian() / 4,-1 ,1 ) + 1) / 2;\n\t}", "public static int getRandomNumber(){\n int random = 0; // set variable to 0\r\n random = (int)(Math.random()*10) + 1; //generate random number between 1 and 10\r\n return random; //return random number\r\n }", "public int generarDE(){\n int ts;\n float rnd=(float)Math.random();\n \n if(rnd<=0.35){ts=1;}\n else if(rnd<=0.75){ts=2;}\n else {ts=3;}\n \n return ts;\n }", "public int randomGQ() {\n\t\treturn(getRandomInteger(10,100));\n\t}", "private double m9971g() {\n return (new Random().nextDouble() * 0.4d) - 22.4d;\n }", "public static int generateRandomNumber()\n\t{\n\t\tRandom r = new Random();\n\t\treturn r.nextInt();\n\t}", "private float genX(float x) {\r\n return (_rand.nextFloat() * 40) - 20;\r\n }", "public int generateRandom() {\n\t\tint random = (int)(Math.random()*((6-1)+1))+1;\n\t\treturn random;\n\t}", "public String randomIncorrectPrice() {\n return new BigInteger(130, random).toString(32);\n }", "@Override\n\tpublic double compete() {\n\t\tdouble result=MyTools.getRandomNum(500, 800);\n\t\tsetThisResult(result);\n\t\treturn result;\n\t}", "public Double randomDouble() {\n\n final Random random = new Random();\n return random.nextInt(100) / 100.0;\n }", "@Override\n\t\t\tpublic double getAsDouble() {\n\t\t\t\treturn Math.random();\n\t\t\t}", "public float generarTE(){\n float ts;\n float rnd=(float)Math.random();\n \n if(rnd<=0.20){ts=1;}\n else if(rnd<=0.50){ts=2;}\n else if(rnd<=0.85){ts=3;}\n else {ts=4;}\n \n return ts;\n }", "public int getRandomsNumber(){\n Random random = new Random();\n int number = random.nextInt(12) + 1;\n return number;\n }", "int randomPoint() { return 1 + (int)Math.round((Math.random()*20) % (size - 2)); }", "private void getRandomNumber() {\n\t\tRandom random = new Random();\n\t\tint randomCount = 255;\n\t\tint randNum = 0; \n\t\tfor(int i = 0; i < numberAmt; i++) {\n\t\t\trandNum = random.nextInt(randomCount);\n\t\t\tswitch (numberType) {\n\t\t\tcase 1:\n\t\t\t\trandomNumbers.add(Integer.toString(randNum));\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tif(randNum > 15)\n\t\t\t\t\trandomNumbers.add(String.format(\"%8s\", Integer.toBinaryString(randNum)).replace(\" \", \"0\"));\n\t\t\t\telse\n\t\t\t\t\trandomNumbers.add(String.format(\"%4s\", Integer.toBinaryString(randNum)).replace(\" \", \"0\"));\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\trandomNumbers.add(Integer.toHexString(randNum));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n public Double getValue() {\r\n return Math.random()*Integer.MAX_VALUE;\r\n \r\n }", "private int randomWeight()\n {\n return dice.nextInt(1000000);\n }", "public static double getRandomRating() {\n return (double) (RandomNumberGenerator.getRandomInt(0, 10) / 2d);\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(Math.random());//大于等于 0.0 且小于 1.0。\n\t\tSystem.out.println(Math.round(1.5));\n\t\tSystem.out.println(Math.round(-1.5));\n\t\tSystem.out.println(Math.abs(-1.1));\n\t\tSystem.out.println(MyMath.round(10.234, 2));\n\t\t\n\t\tchar[] s = new char[]{'a','b','c','d','e'};\n\t\tRandom r= new Random();\n\t\tfor(int x=0;x<3;x++){\n\t\t\tSystem.out.print(s[r.nextInt(s.length)]);\n\t\t}\n\t\tdouble dd = 2323432412323233.23;\n\t\tBigDecimal bd = new BigDecimal(dd).pow(12);//占用资源\n\t\tSystem.out.println(bd);\n\t}", "public static void main(String[] args) {\n\r\n\t\tRandom rr=new Random();\r\n\t\t\r\n\t\tSystem.out.println(Math.random());//[0,1)\r\n\t\t \r\n\t\t// 第一种情况 int(强转之后最终的值一定是0)\r\n\t\t// 第二种情况 int(强转之后将小数点舍去 1-5)\r\n\t\tSystem.out.println((int)Math.random()*5);//0.99*5永远到不了5\r\n\t\tSystem.out.println((int)(Math.random()*5+1));//[1,5.)\r\n\t\t\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\t\r\n\t\tfor(int i=0;i<=20;i++){\r\n\t\t\tSystem.out.print(i%7+\"-\");\r\n\t\t\t\r\n\t\t}\r\n\t\t//1-M的随机产生\r\n\t\t//(int)(Math.random()*M+1)\r\n\t\t\r\n\t\t\r\n\t\t//产生0 1的概率不同 Math.random()<p?0:1\r\n\t\tSystem.out.println(\"----\"+rr.rand01p());\r\n\t\tSystem.out.println(\"----\"+rr.rand01());\r\n\t\tfor(int i=0;i<=11;i++){\r\n\t\t\tSystem.out.print(i%6+\"-\");\r\n\t\t \t\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(rr.rand106());\r\n\t}", "public static double randomDouble() {\n return randomDouble(-Double.MAX_VALUE, Double.MAX_VALUE);\n }", "private static String RandomCash() {\n\t\tint max = 0;\n\t\tint min = 100000;\n\t\tint range = max - min + 1;\n\t\t\n\t\tString text=null;\n\t\ttry {\n\t\t\t\n\t\t\tint random = (int) (Math.random() * (range) + min);\n\t\t\ttext = formatted(\"###,###\", random)+\" VNĐ\";\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn text;\n\t}", "public static int getRandom() \n\t{\n\t\treturn rGenerator.nextInt();\n\t}", "private int randomHelper() {\n\t\tRandom rand = new Random();\n\t\tint randomNum = rand.nextInt((10000 - 1) + 1) + 1;\n\t\treturn randomNum;\n\t}", "int getRandom(int max);", "private static int newNumber()\n\t{\n\t\tdouble initial = Math.random();\n\t\tdouble rangeAdjusted = initial * (10000 - 1001) + 1000;\n\t\tint rounded = (int)Math.round(rangeAdjusted);\n\t\treturn rounded;\n\t}", "public Random getRandomNumberGenerator() { return randomNumberGenerator; }", "static double randomDouble(int maxExponent) {\n double result = RANDOM_SOURCE.nextDouble();\n result = Math.scalb(result, RANDOM_SOURCE.nextInt(maxExponent + 1));\n return RANDOM_SOURCE.nextBoolean() ? result : -result;\n }", "public static double doubleSample() {\n return random_.nextDouble();\n }", "private String generateRandomHexString(){\n return Long.toHexString(Double.doubleToLongBits(Math.random()));\n }", "static int random(int mod)\n {\n Random rand = new Random();\n int l= (rand.nextInt());\n if(l<0)\n l=l*-1;\n l=l%mod;\n return l;\n }", "private Random rand()\n\t{\n\t\treturn new Random();\n\t}", "private int randomValue() {\r\n\t\tRandom rand = new Random();\r\n\t\tint val = rand.nextInt(10);\r\n\t\tif(val == 9)\r\n\t\t\treturn 4;\r\n\t\telse\r\n\t\t\treturn 2;\r\n\t}", "public static String randomNumberGenerator() {\r\n\t\tint max = 999999999; // e.g. 714053349 (9 digits)\r\n\t\tRandom rand = new Random();\r\n\t\tint min = 0;\r\n\t\tint randomNum = rand.nextInt(max - min + 1) + min;\r\n\t\treturn Integer.toString(randomNum);\r\n\t}", "private static double randomizePrice(double start) {\n start += (0.5 * Math.random()) * (Math.random() > 0.5 ? 1 : -1);\n start *= 1000;\n int result = (int) start;\n return result / 1000.0;\n }", "int random(int m)\n {\n return (int) (1 + Math.random()%m);\n }", "private String getRandomSeed() {\n long newSeed = 0;\n Random randBoolean = new Random(randomSeed);\n for (int i = 0; i < 48; i++) {\n if (randBoolean.nextBoolean()) {\n newSeed += 1 << i;\n }\n }\n if (newSeed < 0) {\n newSeed = Math.abs(newSeed);\n }\n\n String s = \"\";\n if (newSeed == 0) {\n s += \"0\";\n } else {\n while (newSeed != 0) {\n long num = (newSeed & (0xF));\n if (num < 10) {\n s = num + s;\n } else {\n s = ((char) (num + 55)) + s;\n }\n newSeed = newSeed >> 4;\n }\n }\n return s;\n }", "public double doubleRandomNegativeNumbers() {\n\t\tdouble result = 0.0;\n\t\tresult = rnd.nextDouble() * (-10);\n\t\treturn result;\n\t}", "public int getRandomPositiveInt(){\r\n long gen = (a*seed+c)%m;\r\n seed = gen;\r\n return (int)gen;\r\n }", "private void setRand(){\n rand = generator.nextInt(9) + 1;\n }", "public int randomNum() {\n\t\treturn 1 + (int) (Math.random() * 3); // randomNum = minimum + (int)(Math.random() * maximum);\n\t}", "protected Random get_rand_value()\n {\n return rand;\n }", "public float randFloat() {\n Random rand = new Random();\n float result = rand.nextFloat() * (size - 1) + 1;\n return result;\n }", "float genChance();", "private static double randomDouble(final Random rnd) {\n return randomDouble(Double.MIN_EXPONENT, Double.MAX_EXPONENT, rnd);\n }", "public static double genRandomRestPeriod() {\n return Simulator.randomGenerator.genRestPeriod();\n }", "public static double randomadec(int a, int b, int semilla){ \n Random r = new Random(semilla);\n Double ri = b + ( a - b ) * r.nextDouble(); \n return ri;\n }", "public void generateR(){\n\t\t\tdo{\n\t\t\t\tr = new BigInteger(80, new Random());\n\t\t\t}while(!(q.gcd(r).equals(BigInteger.ONE)&&r.compareTo(q)<0&&r.compareTo(BigInteger.ONE)>=0));\n\t}", "static int getRandomDelta() {\n int d = rand.nextInt(100);\n if (d < 50) {\n return -1;\n } else {\n return 1;\n }\n }", "public int calcTraderPrice() {\r\n Random r = new Random();\r\n return rtl + r.nextInt(rth - rtl);\r\n }", "public static void test2() {\n\n LargerRandomNumberBigDecimal value = new LargerRandomNumberBigDecimal();\n\n for (int i = 0; i < 50; i++) {\n\n System.out.println(\"value = \" + value.getNextLargerRand());\n }\n }", "public static float fastRandomFloat(){\n\t\treturn rdm.nextFloat();\n\t\t//return ((double)(fastRandomInt()) - ((double)Integer.MIN_VALUE)) / (-(Integer.MIN_VALUE * 2.0));\n\t}", "public static double URV() {\r\n\t\tRandom randomGenerator = new Random();\r\n\t\treturn randomGenerator.nextDouble();\r\n\t}", "public static String randomNumberString() {\n\r\n Random random = new Random();\r\n int i = random.nextInt(999999);\r\n\r\n\r\n return String.format(\"%06d\", i);\r\n }", "public static int getRndSalary() {\n return ThreadLocalRandom.current().nextInt(10, 100000 + 1);\n }" ]
[ "0.75960004", "0.7270771", "0.7261203", "0.7230179", "0.7226467", "0.7183129", "0.717857", "0.7112714", "0.705131", "0.7050413", "0.69734955", "0.6969709", "0.69351006", "0.6907985", "0.6907339", "0.6879504", "0.68721247", "0.6818873", "0.6809656", "0.6734499", "0.6724497", "0.666031", "0.66519123", "0.6641841", "0.66351914", "0.663005", "0.6603639", "0.6597905", "0.6567841", "0.65526915", "0.652625", "0.6503747", "0.64903784", "0.6461179", "0.64491844", "0.6414121", "0.64076316", "0.63907474", "0.6384012", "0.63824344", "0.63788533", "0.63690025", "0.6361671", "0.6354488", "0.63521993", "0.63507575", "0.6343132", "0.6341166", "0.63386756", "0.6325322", "0.632024", "0.63128614", "0.6311803", "0.629994", "0.629863", "0.62664795", "0.62611026", "0.6259947", "0.62373906", "0.6225673", "0.62211204", "0.6218068", "0.6204478", "0.6192804", "0.6185723", "0.61836076", "0.6182563", "0.61824036", "0.61693966", "0.616442", "0.6107939", "0.6092343", "0.60898", "0.60875535", "0.6086314", "0.60845447", "0.6084003", "0.60833555", "0.6082357", "0.6076815", "0.6074239", "0.6068312", "0.6066536", "0.60600275", "0.605913", "0.6050798", "0.60478044", "0.60448235", "0.60413736", "0.60348725", "0.6027806", "0.6015916", "0.60125", "0.600088", "0.5997121", "0.59928274", "0.5986613", "0.5977231", "0.5973472", "0.5965582" ]
0.83210343
0
Method that generates a random fraction
public static String randomFraction(){ int denom = randomNumber(); int numer = randomNumber(); String fraction = ""; if (numer>denom){ fraction = numer+"/"+denom; } else { fraction = denom+"/"+numer; } return fraction; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private double getRandomNumber(){\n double rand = Math.random();//produce a number between 0 and 1\n rand = rand - 0.5;\n return rand;\n }", "public static int randomNumberRatio(){\r\n int max = 10;\r\n int min = 1;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n return randNum;\r\n }", "public static double random() {\r\n return uniform();\r\n }", "private double genMultiplier() {\n return (random.nextInt(81) + 60)/100.0;\n }", "private double getRandom() {\n return 2*Math.random() - 1;\n }", "public float gaussianRandom() {\n\t\treturn (CCMath.constrain((float)nextGaussian() / 4,-1 ,1 ) + 1) / 2;\n\t}", "public void generateR(){\n\t\t\tdo{\n\t\t\t\tr = new BigInteger(80, new Random());\n\t\t\t}while(!(q.gcd(r).equals(BigInteger.ONE)&&r.compareTo(q)<0&&r.compareTo(BigInteger.ONE)>=0));\n\t}", "public static double randomNum(Random g)\n\t{\n\t\treturn -5+g.nextDouble()*10;\n\t}", "private double randn(){\r\n\t\t//* http://www.mathworks.com/access/helpdesk/help/techdoc/matlab.html\r\n\t\t//RandomNumber rnd = new RandomNumber(System.currentTimeMillis());\r\n\t\t//return rnd.normal();\r\n\t\treturn rnd.nextGaussian();\r\n\t\t//return 0;\r\n\t}", "public static double uniform() {\r\n return random.nextDouble();\r\n }", "public double getRandom() {\n return 20*Math.random() - 10;\n }", "public static double uniform() {\n return random.nextDouble();\n }", "public static double random()\n {\n return _prng2.nextDouble();\n }", "public static double genRandomRestPeriod() {\n return Simulator.randomGenerator.genRestPeriod();\n }", "public double getRandom(){\n\t\treturn random.nextDouble();\n\t}", "public float randomize() {\n return nextFloat(this.min, this.max);\n }", "public int randomGQ() {\n\t\treturn(getRandomInteger(10,100));\n\t}", "public static String generateRandomInteger() {\n SecureRandom random = new SecureRandom();\n int aStart = 1;\n long aEnd = 999999999;\n long range = aEnd - (long) aStart + 1;\n long fraction = (long) (range * random.nextDouble());\n long randomNumber = fraction + (long) aStart;\n return String.valueOf(randomNumber);\n }", "public static double genRandomRestNumber() {\n return Simulator.randomGenerator.genRandomRest();\n }", "public static double rand() {\n return (new Random()).nextDouble();\n }", "public static Double randomDecimal(){\r\n int max = 1000;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n double randDec = (randNum/100.0);\r\n \r\n return randDec;\r\n \r\n }", "@java.lang.Override\n public io.envoyproxy.envoy.type.v3.FractionalPercent getRandomSampling() {\n return randomSampling_ == null ? io.envoyproxy.envoy.type.v3.FractionalPercent.getDefaultInstance() : randomSampling_;\n }", "public int generarDE(){\n int ts;\n float rnd=(float)Math.random();\n \n if(rnd<=0.35){ts=1;}\n else if(rnd<=0.75){ts=2;}\n else {ts=3;}\n \n return ts;\n }", "public io.envoyproxy.envoy.type.v3.FractionalPercent getRandomSampling() {\n if (randomSamplingBuilder_ == null) {\n return randomSampling_ == null ? io.envoyproxy.envoy.type.v3.FractionalPercent.getDefaultInstance() : randomSampling_;\n } else {\n return randomSamplingBuilder_.getMessage();\n }\n }", "private double m9971g() {\n return (new Random().nextDouble() * 0.4d) - 22.4d;\n }", "public final void rand() {\n\t\tpush(randomNumberGenerator.nextDouble());\n\t}", "public static double getRandomRating() {\n return (double) (RandomNumberGenerator.getRandomInt(0, 10) / 2d);\n }", "public int randomDP() {\n\t\treturn(getRandomInteger(10,250));\n\t}", "private float genX(float x) {\r\n return (_rand.nextFloat() * 40) - 20;\r\n }", "int randomPoint() { return 1 + (int)Math.round((Math.random()*20) % (size - 2)); }", "private int randomNum() {\r\n\t return((int)(Math.random() * 100));\r\n\t }", "@Override\n\tpublic double compete() {\n\t\tdouble result=MyTools.getRandomNum(10, 20); \t\n\t\tsetThisResult(result);\n\t\treturn result;\n\t}", "public static double nextGaussian() {\n return randGen.nextGaussian();\n }", "static int random(int mod)\n {\n Random rand = new Random();\n int l= (rand.nextInt());\n if(l<0)\n l=l*-1;\n l=l%mod;\n return l;\n }", "public static int getRandomBalance(){\n return rand.nextInt(1000000);\n }", "float genChance();", "public static double random(double input){\n\t\treturn Math.random()*input;\n\t}", "public static double random()\n {\n final int MAX_INT = 2147483647;\n int n = MAX_INT;\n \n // Just to ensure it does not return 1.0\n while(n == MAX_INT)\n \tn = abs (RAND.nextInt());\n \n return n * (1.0 / MAX_INT);\n }", "private int generateRandomNumber() {\n\t\treturn new SplittableRandom().nextInt(0, 3);\n\t}", "int random(int m)\n {\n return (int) (1 + Math.random()%m);\n }", "@Override\n\tpublic double compete() {\n\t\tdouble result=MyTools.getRandomNum(500, 800);\n\t\tsetThisResult(result);\n\t\treturn result;\n\t}", "public static void main(String[] args) {\n\r\n\t\tRandom rr=new Random();\r\n\t\t\r\n\t\tSystem.out.println(Math.random());//[0,1)\r\n\t\t \r\n\t\t// 第一种情况 int(强转之后最终的值一定是0)\r\n\t\t// 第二种情况 int(强转之后将小数点舍去 1-5)\r\n\t\tSystem.out.println((int)Math.random()*5);//0.99*5永远到不了5\r\n\t\tSystem.out.println((int)(Math.random()*5+1));//[1,5.)\r\n\t\t\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\t\r\n\t\tfor(int i=0;i<=20;i++){\r\n\t\t\tSystem.out.print(i%7+\"-\");\r\n\t\t\t\r\n\t\t}\r\n\t\t//1-M的随机产生\r\n\t\t//(int)(Math.random()*M+1)\r\n\t\t\r\n\t\t\r\n\t\t//产生0 1的概率不同 Math.random()<p?0:1\r\n\t\tSystem.out.println(\"----\"+rr.rand01p());\r\n\t\tSystem.out.println(\"----\"+rr.rand01());\r\n\t\tfor(int i=0;i<=11;i++){\r\n\t\t\tSystem.out.print(i%6+\"-\");\r\n\t\t \t\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(rr.rand106());\r\n\t}", "public float nextFloat(){\r\n\t\tint rand = nextInt();\r\n\t\treturn (float)(rand & 0x007fffff)/((float) 0x007fffff);\r\n\t}", "public static int randomNext() { return 0; }", "public Double generateRandomDouble() {\n\t\tRandom rand = new Random(Double.doubleToLongBits(Math.random()));\n\t\treturn rand.nextDouble();\n\t}", "static int randomDelta(int average)\n\t{\n\t\treturn rand.nextInt(4*average + 1) - 2*average;\n\t}", "private static double randomGenerator(double min, double max) {\n return (double)java.lang.Math.random() * (max - min +1) + min;\n }", "private void random() {\n\n\t}", "static int getRandomDelta() {\n int d = rand.nextInt(100);\n if (d < 50) {\n return -1;\n } else {\n return 1;\n }\n }", "public float randomQual() {\n\t\treturn((float) getRandomInteger(30,250));\n\t}", "public static int getRandomAmount(){\n return rand.nextInt(1000);\n }", "public float generarTE(){\n float ts;\n float rnd=(float)Math.random();\n \n if(rnd<=0.20){ts=1;}\n else if(rnd<=0.50){ts=2;}\n else if(rnd<=0.85){ts=3;}\n else {ts=4;}\n \n return ts;\n }", "public float randFloat() {\n Random rand = new Random();\n float result = rand.nextFloat() * (size - 1) + 1;\n return result;\n }", "Boolean getRandomize();", "public static double doubleSample() {\n return random_.nextDouble();\n }", "Randomizer getRandomizer();", "public double simulate(){\n\t\tdouble r = Math.sqrt(-2 * Math.log(Math.random()));\n\t\tdouble theta = 2 * Math.PI * Math.random();\n\t\treturn Math.exp(location + scale * r * Math.cos(theta));\n\t}", "private static int randomHeight(double p)\n {\n\tint h = 1;\n\twhile (r.nextDouble() < p) {\n\t // make it higher!\n\t h++;\n\t}\n\treturn h;\n }", "public abstract void randomize();", "public static double URV() {\r\n\t\tRandom randomGenerator = new Random();\r\n\t\treturn randomGenerator.nextDouble();\r\n\t}", "private int randomWeight()\n {\n return dice.nextInt(1000000);\n }", "public static double fastRandomDouble(){\n\t\treturn rdm.nextDouble();\n\t\t//return rdm.nextDoubleFast();\n\t\t//return ((double)(fastRandomInt()) - ((double)Integer.MIN_VALUE)) / (-(Integer.MIN_VALUE * 2.0));\n\t}", "float getRandomValue(float min, float max)\r\n\t{\n\t\tRandom r = new Random(/*SEED!!!*/);\r\n\t\t//get a float between 0 and 1 then multiply it by the min/max difference.\r\n\t\tfloat num = r.nextFloat();\r\n\t\tnum = num * (max-min) + min;\r\n\t\treturn num;\r\n\t}", "public int eDmg(){\r\n eDmg = rand.nextInt(13);\r\n return eDmg;\r\n }", "public double nextDouble(){\r\n\t\tlong rand = nextLong();\r\n\t\treturn (double)(rand & 0x000fffffffffffffL)/((double)0x000fffffffffffffL);\r\n\t}", "private static int bernoulli(long result, long fractionOfExponent, double[][] exponentialDistribution)\n {\n\n /* *\n * Computes the Actual Bernoulli Parameter = exp (-t / f)\n * Yields A Fraction of 2^62, to Keep Only 62 Bits of Precision in This Implementation\n * */\n double bernoulliParameter = 4611686018427387904.0;\n\n for (long i = 0, j = fractionOfExponent; i < 3; i++, j >>= 5)\n {\n\n bernoulliParameter *= exponentialDistribution[(int)i][(int)(j & 31)];\n\n }\n\n /* Sample from Bernoulli of bernoulliParameter */\n return (int)(((result & 0x3FFFFFFFFFFFFFFFL) - Math.round(bernoulliParameter)) >>> 63);\n\n }", "public Double randomDouble() {\n\n final Random random = new Random();\n return random.nextInt(100) / 100.0;\n }", "private double generateRandomValue(int min, int max) {\n\t\tdouble number = (Math.random() * max * 100) / 100 + min;\n\t\treturn number;\n\t}", "public static int randomRound(){\r\n int max = 1000;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n return randNum;\r\n }", "private float randomPrice() {\n float price = floatRandom(this.maxRandomPrice);\n return price;\n }", "Multiplication createRandomMultiplication();", "Multiplication createRandomMultiplication();", "public double randomValue(){\n\t\treturn _randomValue() + _randomValue() + _randomValue();\n\t}", "public static int randomNumber(int start, int end) {\n long range = (long) end - (long) start + 1;\n // compute a fraction of the range, 0 <= frac < range\n long fraction = (long) (range * RANDOM.nextDouble());\n return (int) (fraction + start);\n }", "public static double gaussian() {\n // use the polar form of the Box-Muller transform\n double r, x, y;\n do {\n x = uniform( -1.0, 1.0 );\n y = uniform( -1.0, 1.0 );\n r = x*x + y*y;\n } while ( r >= 1 || r == 0 );\n \n return x * Math.sqrt(-2 * Math.log(r) / r);\n\n // Remark: y * Math.sqrt(-2 * Math.log(r) / r)\n // is an independent random gaussian\n }", "@Override\n\t\t\tpublic double getAsDouble() {\n\t\t\t\treturn Math.random();\n\t\t\t}", "private Random rand()\n\t{\n\t\treturn new Random();\n\t}", "public static float fastRandomFloat(){\n\t\treturn rdm.nextFloat();\n\t\t//return ((double)(fastRandomInt()) - ((double)Integer.MIN_VALUE)) / (-(Integer.MIN_VALUE * 2.0));\n\t}", "private int genRandomWaveNum(int min, int max){\n int m = genRandomInt(min, max);\n return m;\n }", "public Builder setRandomSampling(io.envoyproxy.envoy.type.v3.FractionalPercent value) {\n if (randomSamplingBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n randomSampling_ = value;\n onChanged();\n } else {\n randomSamplingBuilder_.setMessage(value);\n }\n\n return this;\n }", "private static double randomDouble(final Random rnd) {\n return randomDouble(Double.MIN_EXPONENT, Double.MAX_EXPONENT, rnd);\n }", "private int genRandomWaveNum(int waveNum){\n return genRandomWaveNum(1, waveNum);\n }", "public double generateMoneyGoal() {\n\t\tdouble moneyGoal = Math.random()*(10000 -100)+100; \n\t\t\n\t\treturn moneyGoal;\n\t}", "final public static int d( int num, int sides ) \n { \n // Input validation \n if( num <= 0 ) \n num = 1; \n if( sides <= 0 ) \n sides = 1; \n // Generate and return a result \n int total = 0; \n for( ; num > 0; num-- ) \n total += random.nextInt(sides) + 1; \n return total; \n }", "int getRandom(int max);", "public abstract double getGen(int i);", "public static double generateDensity() {\n double lower = config.getDensityLowerBound();\n double upper = config.getDensityUpperBound();\n\n Random random = new Random();\n return lower + (upper - lower) * random.nextDouble();\n }", "private static BigInteger generateAFactor(Random randomSeed, BigInteger p, BigInteger q) {\n long time = System.nanoTime();\n BigInteger a = null, h = MathUtils.random(p.subtract(BigInteger.ONE), randomSeed);\n int step = 0;\n while ((step++) < MAX_STEPS) {\n a = MathUtils.powModFast(h, p.subtract(BigInteger.ONE).divide(q), p);\n if (a.compareTo(BigInteger.ONE) != 0) {\n LOGGER.info(\n String.format(\n \"Generated a number, took=%dms\\nq=%s\",\n TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - time),\n a.toString(RADIX)\n )\n );\n break;\n }\n h = h.add(BigInteger.ONE);\n }\n return a;\n }", "public int randomNum() {\n\t\treturn 1 + (int) (Math.random() * 3); // randomNum = minimum + (int)(Math.random() * maximum);\n\t}", "private void setRand(){\n rand = generator.nextInt(9) + 1;\n }", "public Random getRandomNumberGenerator() { return randomNumberGenerator; }", "public void generateNewSecret() {\r\n \r\n //Get Random Number With Correct Digits\r\n int intRand = randomNumberGenerator.nextInt((int)(Math.pow(10, numDigits) - Math.pow(10, numDigits - 1))) + (int)Math.pow(10, numDigits - 1);\r\n \r\n //Set To String\r\n String strRand = String.valueOf(intRand);\r\n \r\n //Set Value\r\n secretNumber = convertNumToDigitArray(strRand);\r\n \r\n }", "public io.envoyproxy.envoy.type.v3.FractionalPercentOrBuilder getRandomSamplingOrBuilder() {\n if (randomSamplingBuilder_ != null) {\n return randomSamplingBuilder_.getMessageOrBuilder();\n } else {\n return randomSampling_ == null ?\n io.envoyproxy.envoy.type.v3.FractionalPercent.getDefaultInstance() : randomSampling_;\n }\n }", "public io.envoyproxy.envoy.type.v3.FractionalPercent.Builder getRandomSamplingBuilder() {\n \n onChanged();\n return getRandomSamplingFieldBuilder().getBuilder();\n }", "public static int uniform(int N) {\r\n return random.nextInt(N);\r\n }", "public Rng() {\n\t\tr = new Random();\n\t}", "public static int getRandom(int n){\n\t\treturn rg.nextInt(n); \n\t}", "public static double rangedRandom(double a){\n\t\treturn -a + Calc.random(a * 2);\n\t}", "public String get_fraction_part();", "public int getRandomDegree()\n\t{\n\t\t//TODO: Do this in cleverer, faster way!\n\t\tint pd = 0;\n\t\tdouble ra = random.nextDouble();\n\t\tdouble total = 0;\n\t\tfor(int i=0;i< length;i++)\n\t\t{\n\t\t\ttotal = total + pDist[i];\n\t\t\tif(total >= ra)\n\t\t\t{\n\t\t\t\tpd = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tpd = length-1;\n\t\t\t\n\t\t}\n\t\t\n\t\treturn pd;\n\t}" ]
[ "0.70081776", "0.6856176", "0.6848048", "0.68462133", "0.6822212", "0.6818662", "0.6728477", "0.672168", "0.67101777", "0.67006123", "0.6659236", "0.66544235", "0.6633776", "0.66129804", "0.6547322", "0.6515441", "0.6445296", "0.64123034", "0.6405008", "0.63901895", "0.6366186", "0.6341692", "0.6329621", "0.629493", "0.6269826", "0.62600785", "0.6254325", "0.6238265", "0.6221618", "0.62213284", "0.61775464", "0.6170394", "0.6152936", "0.6138135", "0.6120728", "0.6107564", "0.60818535", "0.6074836", "0.6051256", "0.6039844", "0.6027616", "0.6019908", "0.601375", "0.60126925", "0.5963702", "0.5956702", "0.59469527", "0.59282357", "0.592693", "0.59127325", "0.5903916", "0.5897045", "0.5883654", "0.588065", "0.58742803", "0.5848962", "0.5844201", "0.5820756", "0.58126587", "0.58123213", "0.5804048", "0.5795589", "0.5791136", "0.57889074", "0.577387", "0.5769605", "0.57612056", "0.5756792", "0.5734093", "0.5715066", "0.56853324", "0.56853324", "0.5682582", "0.5673727", "0.5664299", "0.56637007", "0.56629205", "0.56418675", "0.56256676", "0.5623299", "0.5620341", "0.56202686", "0.56191427", "0.56120926", "0.56085986", "0.56024617", "0.558755", "0.5586769", "0.5579902", "0.55767006", "0.5576285", "0.55703354", "0.55652577", "0.5562825", "0.55617124", "0.55565184", "0.5555963", "0.5554799", "0.5551997", "0.55424356" ]
0.80845785
0
Method that generates a random number to be used between 010
public static int randomNumber(){ int max = 10; int min = 0; int range = max-min+1; int randNum = (int)(Math.random()*range) + min; return randNum; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int generateDigit() {\n\t\t\n\t\treturn (int)(Math.random() * 10);\n\t}", "public static int randomNumberAlg(){\r\n int max = 10;\r\n int min = 1;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n return randNum;\r\n }", "public static int getRandomNumber(){\n int random = 0; // set variable to 0\r\n random = (int)(Math.random()*10) + 1; //generate random number between 1 and 10\r\n return random; //return random number\r\n }", "private int generateRandomNumber() {\n\t\treturn (int) Math.floor(Math.random() * Constants.RANDOM_NUMBER_GENERATOR_LIMIT);\n\t}", "private int generateRandomNumber() {\n\t\treturn new SplittableRandom().nextInt(0, 3);\n\t}", "public static int generateRandomNumber()\n\t{\n\t\tRandom r = new Random();\n\t\treturn r.nextInt();\n\t}", "public static int customRandom(int range)\n {\n \tint random = (int)(Math.random()*10)%range;\n\t\n\treturn random;\n }", "private int randomNum() {\r\n\t return((int)(Math.random() * 100));\r\n\t }", "public static int randNum() {\r\n\t\tint rand = (int)(Math.random()*((100)+1)); // Num generated between [0, 100]\r\n\t\treturn rand;\r\n\t}", "public static String generateRandomInteger() {\n SecureRandom random = new SecureRandom();\n int aStart = 1;\n long aEnd = 999999999;\n long range = aEnd - (long) aStart + 1;\n long fraction = (long) (range * random.nextDouble());\n long randomNumber = fraction + (long) aStart;\n return String.valueOf(randomNumber);\n }", "public static String randomNumberGenerator() {\r\n\t\tint max = 999999999; // e.g. 714053349 (9 digits)\r\n\t\tRandom rand = new Random();\r\n\t\tint min = 0;\r\n\t\tint randomNum = rand.nextInt(max - min + 1) + min;\r\n\t\treturn Integer.toString(randomNum);\r\n\t}", "public static int randomNumber100(){\r\n int max = 100;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n return randNum;\r\n }", "public static int randomNext() { return 0; }", "private int randomValue() {\r\n\t\tRandom rand = new Random();\r\n\t\tint val = rand.nextInt(10);\r\n\t\tif(val == 9)\r\n\t\t\treturn 4;\r\n\t\telse\r\n\t\t\treturn 2;\r\n\t}", "private void setRand(){\n rand = generator.nextInt(9) + 1;\n }", "int RandomGenerator0To29 (){\n\t\t int randomInt2 = 0;\n\t\t Random randomGenerator2 = new Random();\n\t\t for (int idx2 = 1; idx2 <= 10; ++idx2) {\n\t\t\t randomInt2 = randomGenerator2.nextInt(30);\n\t\t }\n\t\t return randomInt2;\n\t }", "int RandomGeneratorZeroToThree (){\n\t\t int randomInt = 0;\n\t\t Random randomGenerator = new Random();\n\t\t for (int idx = 1; idx <= 10; ++idx) {\n\t\t\t randomInt = randomGenerator.nextInt(4);\n\n\t\t }\n\t\t return randomInt;\n\t }", "public static int randInt() {\n Random rand = new Random();\n\n // nextInt is normally exclusive of the top value,\n // so add 1 to make it inclusive\n int randomNum = rand.nextInt((20 - 10) + 1) + 10;\n\n return randomNum;\n }", "public int generateRandom() {\n\t\tint random = (int)(Math.random()*((6-1)+1))+1;\n\t\treturn random;\n\t}", "public static int randomRound(){\r\n int max = 1000;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n return randNum;\r\n }", "int getRandom(int max);", "public int getRandomPositiveInt(){\r\n long gen = (a*seed+c)%m;\r\n seed = gen;\r\n return (int)gen;\r\n }", "private double getRandomNumber(){\n double rand = Math.random();//produce a number between 0 and 1\n rand = rand - 0.5;\n return rand;\n }", "public int getRandomsNumber(){\n Random random = new Random();\n int number = random.nextInt(12) + 1;\n return number;\n }", "public int RandomNegativeNumbers() {\n\t\tint result = 0;\n\t\tresult = rnd.nextInt(10) - 10;\n\t\treturn result;\n\t}", "public int randomNum()\r\n {\r\n Random rand = new Random();\r\n int n = rand.nextInt(52)+1;\r\n return n;\r\n }", "public static int getRandom() \n\t{\n\t\treturn rGenerator.nextInt();\n\t}", "public int compete() {\r\n\t\tint max = 20;\r\n\t\tint min = 10;\r\n\t\tRandom Rand = new Random();\r\n\t\tint ranNum = Rand.nextInt(max - min) + min;\r\n\t\treturn ranNum;\r\n\t}", "public double getRandom() {\n return 20*Math.random() - 10;\n }", "public static int getRandomAmount(){\n return rand.nextInt(1000);\n }", "public static int randInt() {\n\t\tint min = 10;\n\t\tint max = 99999999;\n\t\tRandom rand = new Random();\n\t\tint randomNum = (rand.nextInt((max - min) + 1) + rand.nextInt((max - min) + 1)) / 2;\n\t\treturn randomNum;\n\t}", "public static String randomNumberString() {\n\r\n Random random = new Random();\r\n int i = random.nextInt(999999);\r\n\r\n\r\n return String.format(\"%06d\", i);\r\n }", "public static double randomNum(Random g)\n\t{\n\t\treturn -5+g.nextDouble()*10;\n\t}", "private static int get() { \r\n Random r = new Random();\r\n return (r.nextInt(9));\r\n }", "public int randomNum() {\n\t\treturn 1 + (int) (Math.random() * 3); // randomNum = minimum + (int)(Math.random() * maximum);\n\t}", "private static int newNumber()\n\t{\n\t\tdouble initial = Math.random();\n\t\tdouble rangeAdjusted = initial * (10000 - 1001) + 1000;\n\t\tint rounded = (int)Math.round(rangeAdjusted);\n\t\treturn rounded;\n\t}", "public int pickNumber() {\n\t\t\n\t\tint max=10;\n\t\t\n\t\tint i = (int) Math.floor((Math.random()*max)+1);\n\t\treturn i;\n\t\t\n\t}", "private int randomHelper() {\n\t\tRandom rand = new Random();\n\t\tint randomNum = rand.nextInt((10000 - 1) + 1) + 1;\n\t\treturn randomNum;\n\t}", "public static String randInt(){\n return String.valueOf(rand.nextInt(10));\n }", "public static String getRandomNumberString() {\n Random rnd = new Random();\n int number = rnd.nextInt(9999999);\n\n // this will convert any number sequence into 6 character.\n return String.format(\"%07d\", number);\n }", "public static int randomNumber50(){\r\n int max = 50;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n return randNum;\r\n }", "public static int getRandom(int n){\n\t\treturn rg.nextInt(n); \n\t}", "public static int randomNumber() {\n //Random rndNumbers = new Random();\n //for(int i = 0; i < 100; i++) {\n // int rndNumber = rndNumbers.nextInt();\n // System.out.println(rndNumber);\n int rand = (int) (Math.random() * 100);\n System.out.println(rand);\n if (rand > 50) {\n return rand;\n } else {\n System.out.println(\"-1\");\n }\n return rand;\n }", "public String getRandomNumberString() {\n Random rnd = new Random();\n int number = rnd.nextInt(899999) + 100000;\n\n // this will convert any number sequence into 6 character.\n String formatted_code = String.format(\"%06d\", number);\n\n return formatted_code;\n }", "public void generateNewSecret() {\r\n \r\n //Get Random Number With Correct Digits\r\n int intRand = randomNumberGenerator.nextInt((int)(Math.pow(10, numDigits) - Math.pow(10, numDigits - 1))) + (int)Math.pow(10, numDigits - 1);\r\n \r\n //Set To String\r\n String strRand = String.valueOf(intRand);\r\n \r\n //Set Value\r\n secretNumber = convertNumToDigitArray(strRand);\r\n \r\n }", "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}", "public static String generateMobNum() {\n\t\tString number = RandomStringUtils.randomNumeric(10);\t\n\t\treturn (number);\n\t}", "private void getRandomNumber() {\n\t\tRandom generator = new Random();\n\t\trandomNumber = generator.nextInt(POSSIBLE_CHOICE.length);\n\t}", "public int randInt(int min, int max) {\n Random rand = new Random();\n\n // nextInt is normally exclusive of the top value,\n // so add 1 to make it inclusive\n int randomNum = rand.nextInt((max - min) + 1) + min;\n\n return randomNum;\n}", "private int randomNumber(int high, int low){\n \t\t Random r = new Random();\n \t\t return (r.nextInt(high-low) + low);\n \t }", "public int generateNumber(int difficulty) {\n Random generator = new Random();\n return 1 + generator.nextInt((int) Math.pow(10, difficulty));\n }", "public int randomGQ() {\n\t\treturn(getRandomInteger(10,100));\n\t}", "private int getRandomNumber(int limit) {\n\t\tlong seed = System.currentTimeMillis();\n\t\tRandom rand = new Random(seed);\n\t\treturn rand.nextInt(limit) + 1;\n\t}", "public static int randomInt() {\n return randomInt(Integer.MIN_VALUE, Integer.MAX_VALUE);\n }", "private int rand() {\n return (int)(Math.random()*(RAND_MAX + 1));\n }", "public static int RandomNumber(int min, int max){\n Random random = new Random();\n int randomNum = random.nextInt((max - min)+1)+min;\n return randomNum;\n }", "void setRandomNo() {\n\t\tno = 10000000 + (int) (Math.random() * 90000000);\n\t}", "public static int getRandomInt()\n {\n return ThreadLocalRandom.current().nextInt(1000000000, 2147483647);\n }", "public static int getRandomBalance(){\n return rand.nextInt(1000000);\n }", "private void getRandomNumber() {\n\t\tRandom random = new Random();\n\t\tint randomCount = 255;\n\t\tint randNum = 0; \n\t\tfor(int i = 0; i < numberAmt; i++) {\n\t\t\trandNum = random.nextInt(randomCount);\n\t\t\tswitch (numberType) {\n\t\t\tcase 1:\n\t\t\t\trandomNumbers.add(Integer.toString(randNum));\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tif(randNum > 15)\n\t\t\t\t\trandomNumbers.add(String.format(\"%8s\", Integer.toBinaryString(randNum)).replace(\" \", \"0\"));\n\t\t\t\telse\n\t\t\t\t\trandomNumbers.add(String.format(\"%4s\", Integer.toBinaryString(randNum)).replace(\" \", \"0\"));\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\trandomNumbers.add(Integer.toHexString(randNum));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "int random(int m)\n {\n return (int) (1 + Math.random()%m);\n }", "public static int randomNumberRatio(){\r\n int max = 10;\r\n int min = 1;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n return randNum;\r\n }", "private int randomGen(int upperBound) {\n\t\tRandom r = new Random();\n\t\treturn r.nextInt(upperBound);\n\t}", "public static void randomInit(int r) { }", "int getRandom(int limit){\n Random rand = new Random();\n int upperBound = limit;\n return rand.nextInt(upperBound) + 1;\n }", "private static int generateRandomNumber(int min, int max) {\n return (int)Math.floor(Math.random() * (max - min + 1)) + min;\n }", "int randInt(int n) {\r\n return _randomSource.nextInt(n);\r\n }", "public int getRandomNumber() {\n int Random;\n Random randomize = new Random();\n Random = randomize.nextInt(3);\n return new Integer(Random);\n }", "public static int randomGet() { return 0; }", "public static double random()\n {\n final int MAX_INT = 2147483647;\n int n = MAX_INT;\n \n // Just to ensure it does not return 1.0\n while(n == MAX_INT)\n \tn = abs (RAND.nextInt());\n \n return n * (1.0 / MAX_INT);\n }", "private Integer randomBilirrubina(){\n\t\t\tint Min = 0, Max = 14;\n\t\t\treturn Min + (int)(Math.random() * ((Max - Min) + 1));\n\t\t}", "public static int getRandomNum() {\n\t\tRandom rand = new Random();\n\t\tint num = rand.nextInt(3)+1;\n\t\treturn num;\n\t}", "private int randomAge() {\n \tint low = 18;\n \tint high = 100;\n \tint offset = high - low;\n \tRandom r = new Random();\n \treturn r.nextInt(offset) + low;\n \t\n }", "public static double random() {\r\n return uniform();\r\n }", "public int originalgetRandomPositiveInt(int min, int max){\r\n int number = getRandomPositiveInt(); \r\n return (int)number%(max - min + 1)+min;\r\n }", "public int randomDP() {\n\t\treturn(getRandomInteger(10,250));\n\t}", "@Override\n\tpublic double compete() {\n\t\tdouble result=MyTools.getRandomNum(10, 20); \t\n\t\tsetThisResult(result);\n\t\treturn result;\n\t}", "public void randomNumberTest() {\n //Generating streams of random numbers\n Random random = new Random();\n random.ints(5)//(long streamSize, double randomNumberOrigin, double randomNumberBound)\n .sorted()\n .forEach(System.out::println);\n /*\n -1622707470\n -452508309\n 1346762415\n 1456878623\n 1783692417\n */\n }", "private static String accountNumberGenerator() {\n char[] chars = new char[10];\n for (int i = 0; i < 10; i++) {\n chars[i] = Character.forDigit(rnd.nextInt(10), 10);\n }\n return new String(chars);\n }", "public int getRandomNumberInInterval() {\n\t\treturn getRandomNumberUsingNextInt(min, max);\n\t}", "public static int RandomNum(){\n\n Random random = new Random();\n int ItemPicker = random.nextInt(16);\n return(ItemPicker);\n }", "public static int getRand(int n) {\r\n return rand.nextInt(n);\r\n }", "int randInt(int n) {\n return _randomSource.nextInt(n);\n }", "public int getRandom(int bound) {\n return ThreadLocalRandom.current().nextInt(bound);\n }", "private static int newSecretNumber(int min, int max)\n {\n Random rnd = new Random();\n return rnd.nextInt((max + 1 - min) + min);\n }", "private static int generateRandom(int min, int max) {\n // max - min + 1 will create a number in the range of min and max, including max. If you don´t want to include it, just delete the +1.\n // adding min to it will finally create the number in the range between min and max\n return r.nextInt(max-min+1) + min;\n }", "private static int getRandomNumber(int min, int max) \n { //generates a random number within a range\n return (min + rand.nextInt((max - min) + 1));\n }", "public static int randomNumber(int start, int end) {\n long range = (long) end - (long) start + 1;\n // compute a fraction of the range, 0 <= frac < range\n long fraction = (long) (range * RANDOM.nextDouble());\n return (int) (fraction + start);\n }", "public static int getRandomNumberString() {\n // It will generate 6 digit random Number.\n // from 0 to 999999\n Random rnd = new Random();\n int number = rnd.nextInt(999999);\n\n // this will convert any number sequence into 6 character.\n return number;\n }", "private int random(int from, int to) {\n return from + (int) (Math.random() * (to - from + 1));\n }", "public void generateR(){\n\t\t\tdo{\n\t\t\t\tr = new BigInteger(80, new Random());\n\t\t\t}while(!(q.gcd(r).equals(BigInteger.ONE)&&r.compareTo(q)<0&&r.compareTo(BigInteger.ONE)>=0));\n\t}", "private double getRandom() {\n return 2*Math.random() - 1;\n }", "private int _randomCode () {\n Random random = new Random();\n code = random.nextInt(999999);\n return code;\n }", "public int randomNumber(int maxValue) {\n\t\tRandom rndNumbers = new Random();\n\t\tint rndNumber = 0;\n\t\trndNumber = rndNumbers.nextInt(maxValue);\n\t\treturn rndNumber;\n\n\t}", "public String generateNumber(int length) {\n int maxNumber = Integer.parseInt(new String(new char[length]).replace(\"\\0\", \"9\"));\n int intAccountNumber = ThreadLocalRandom.current().nextInt(0, maxNumber + 1);\n int accountNumberLength = String.valueOf(intAccountNumber).length();\n StringBuilder stringBuilder = new StringBuilder();\n if (accountNumberLength < length) {\n stringBuilder.append(new String(new char[length - accountNumberLength]).replace(\"\\0\", \"0\"));\n }\n stringBuilder.append(intAccountNumber);\n return stringBuilder.toString();\n }", "private double randn(){\r\n\t\t//* http://www.mathworks.com/access/helpdesk/help/techdoc/matlab.html\r\n\t\t//RandomNumber rnd = new RandomNumber(System.currentTimeMillis());\r\n\t\t//return rnd.normal();\r\n\t\treturn rnd.nextGaussian();\r\n\t\t//return 0;\r\n\t}", "public static int randNum(int min, int max) {\r\n\t\treturn ThreadLocalRandom.current().nextInt(min, max + 1);\r\n\t}", "public Random getRandomNumberGenerator() { return randomNumberGenerator; }", "public static int getRandomNumber(int min, int max){\r\n Random r = new Random();\r\n return r.nextInt((max - min) +1) + min;\r\n }", "private static int randInt(int max) {\n\t\tRandom rand = new Random(System.currentTimeMillis());\n\t\treturn rand.nextInt(max + 1);\n\t}" ]
[ "0.7672671", "0.76490986", "0.7608601", "0.7503647", "0.73833853", "0.7377629", "0.7326295", "0.73082834", "0.724553", "0.7185869", "0.7184835", "0.7138969", "0.7105648", "0.7094895", "0.7088422", "0.70770466", "0.7056682", "0.7047008", "0.7039003", "0.69912946", "0.6987575", "0.6983153", "0.6976229", "0.69704884", "0.696826", "0.6952249", "0.6950669", "0.6937088", "0.6922046", "0.690669", "0.69061756", "0.6894012", "0.6856234", "0.68392944", "0.68335634", "0.68265235", "0.67708325", "0.675432", "0.6738007", "0.67247295", "0.67212045", "0.67162937", "0.66930133", "0.6662146", "0.66363305", "0.6634325", "0.6619748", "0.6605768", "0.66049415", "0.6590355", "0.6587057", "0.6581252", "0.6570462", "0.65696585", "0.6566959", "0.6541888", "0.65295255", "0.6523091", "0.65220326", "0.6507947", "0.65018064", "0.64965665", "0.64821935", "0.64796287", "0.6470783", "0.64532447", "0.643694", "0.64336574", "0.6429273", "0.64246094", "0.6416058", "0.64015484", "0.63917834", "0.63903254", "0.6390325", "0.6389126", "0.638671", "0.6382507", "0.6382333", "0.63776815", "0.6377562", "0.63727504", "0.63623124", "0.6357826", "0.6357126", "0.6347177", "0.6346743", "0.6346543", "0.63220656", "0.6300071", "0.6294762", "0.6290178", "0.6288558", "0.6283778", "0.62818515", "0.6275868", "0.62697345", "0.62595123", "0.6249626", "0.62468547" ]
0.7933081
0
Method that generates a random number between 010
public static int randomNumberRatio(){ int max = 10; int min = 1; int range = max-min+1; int randNum = (int)(Math.random()*range) + min; return randNum; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int randomNumber(){\r\n int max = 10;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n return randNum;\r\n }", "public static int randomNumberAlg(){\r\n int max = 10;\r\n int min = 1;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n return randNum;\r\n }", "public static int generateDigit() {\n\t\t\n\t\treturn (int)(Math.random() * 10);\n\t}", "public static int getRandomNumber(){\n int random = 0; // set variable to 0\r\n random = (int)(Math.random()*10) + 1; //generate random number between 1 and 10\r\n return random; //return random number\r\n }", "private int generateRandomNumber() {\n\t\treturn (int) Math.floor(Math.random() * Constants.RANDOM_NUMBER_GENERATOR_LIMIT);\n\t}", "private int generateRandomNumber() {\n\t\treturn new SplittableRandom().nextInt(0, 3);\n\t}", "private int randomNum() {\r\n\t return((int)(Math.random() * 100));\r\n\t }", "public static int customRandom(int range)\n {\n \tint random = (int)(Math.random()*10)%range;\n\t\n\treturn random;\n }", "public static int generateRandomNumber()\n\t{\n\t\tRandom r = new Random();\n\t\treturn r.nextInt();\n\t}", "public static int randomNext() { return 0; }", "public static int randNum() {\r\n\t\tint rand = (int)(Math.random()*((100)+1)); // Num generated between [0, 100]\r\n\t\treturn rand;\r\n\t}", "public int RandomNegativeNumbers() {\n\t\tint result = 0;\n\t\tresult = rnd.nextInt(10) - 10;\n\t\treturn result;\n\t}", "public static int randomNumber100(){\r\n int max = 100;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n return randNum;\r\n }", "int RandomGeneratorZeroToThree (){\n\t\t int randomInt = 0;\n\t\t Random randomGenerator = new Random();\n\t\t for (int idx = 1; idx <= 10; ++idx) {\n\t\t\t randomInt = randomGenerator.nextInt(4);\n\n\t\t }\n\t\t return randomInt;\n\t }", "private void setRand(){\n rand = generator.nextInt(9) + 1;\n }", "public double getRandom() {\n return 20*Math.random() - 10;\n }", "public static String generateRandomInteger() {\n SecureRandom random = new SecureRandom();\n int aStart = 1;\n long aEnd = 999999999;\n long range = aEnd - (long) aStart + 1;\n long fraction = (long) (range * random.nextDouble());\n long randomNumber = fraction + (long) aStart;\n return String.valueOf(randomNumber);\n }", "int RandomGenerator0To29 (){\n\t\t int randomInt2 = 0;\n\t\t Random randomGenerator2 = new Random();\n\t\t for (int idx2 = 1; idx2 <= 10; ++idx2) {\n\t\t\t randomInt2 = randomGenerator2.nextInt(30);\n\t\t }\n\t\t return randomInt2;\n\t }", "int getRandom(int max);", "public static String randomNumberGenerator() {\r\n\t\tint max = 999999999; // e.g. 714053349 (9 digits)\r\n\t\tRandom rand = new Random();\r\n\t\tint min = 0;\r\n\t\tint randomNum = rand.nextInt(max - min + 1) + min;\r\n\t\treturn Integer.toString(randomNum);\r\n\t}", "public static int randInt() {\n Random rand = new Random();\n\n // nextInt is normally exclusive of the top value,\n // so add 1 to make it inclusive\n int randomNum = rand.nextInt((20 - 10) + 1) + 10;\n\n return randomNum;\n }", "private double getRandomNumber(){\n double rand = Math.random();//produce a number between 0 and 1\n rand = rand - 0.5;\n return rand;\n }", "public static int randomRound(){\r\n int max = 1000;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n return randNum;\r\n }", "public int generateRandom() {\n\t\tint random = (int)(Math.random()*((6-1)+1))+1;\n\t\treturn random;\n\t}", "public int getRandomPositiveInt(){\r\n long gen = (a*seed+c)%m;\r\n seed = gen;\r\n return (int)gen;\r\n }", "public static double randomNum(Random g)\n\t{\n\t\treturn -5+g.nextDouble()*10;\n\t}", "public int compete() {\r\n\t\tint max = 20;\r\n\t\tint min = 10;\r\n\t\tRandom Rand = new Random();\r\n\t\tint ranNum = Rand.nextInt(max - min) + min;\r\n\t\treturn ranNum;\r\n\t}", "public static int getRandomAmount(){\n return rand.nextInt(1000);\n }", "private int randomValue() {\r\n\t\tRandom rand = new Random();\r\n\t\tint val = rand.nextInt(10);\r\n\t\tif(val == 9)\r\n\t\t\treturn 4;\r\n\t\telse\r\n\t\t\treturn 2;\r\n\t}", "public static int getRandom() \n\t{\n\t\treturn rGenerator.nextInt();\n\t}", "public int getRandomsNumber(){\n Random random = new Random();\n int number = random.nextInt(12) + 1;\n return number;\n }", "public static int randInt() {\n\t\tint min = 10;\n\t\tint max = 99999999;\n\t\tRandom rand = new Random();\n\t\tint randomNum = (rand.nextInt((max - min) + 1) + rand.nextInt((max - min) + 1)) / 2;\n\t\treturn randomNum;\n\t}", "public int randomNum()\r\n {\r\n Random rand = new Random();\r\n int n = rand.nextInt(52)+1;\r\n return n;\r\n }", "public static int getRandom(int n){\n\t\treturn rg.nextInt(n); \n\t}", "private static int get() { \r\n Random r = new Random();\r\n return (r.nextInt(9));\r\n }", "public static int randomNumber() {\n //Random rndNumbers = new Random();\n //for(int i = 0; i < 100; i++) {\n // int rndNumber = rndNumbers.nextInt();\n // System.out.println(rndNumber);\n int rand = (int) (Math.random() * 100);\n System.out.println(rand);\n if (rand > 50) {\n return rand;\n } else {\n System.out.println(\"-1\");\n }\n return rand;\n }", "public static int randomNumber50(){\r\n int max = 50;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n return randNum;\r\n }", "public int randomNum() {\n\t\treturn 1 + (int) (Math.random() * 3); // randomNum = minimum + (int)(Math.random() * maximum);\n\t}", "public static String randomNumberString() {\n\r\n Random random = new Random();\r\n int i = random.nextInt(999999);\r\n\r\n\r\n return String.format(\"%06d\", i);\r\n }", "public static String randInt(){\n return String.valueOf(rand.nextInt(10));\n }", "private static int newNumber()\n\t{\n\t\tdouble initial = Math.random();\n\t\tdouble rangeAdjusted = initial * (10000 - 1001) + 1000;\n\t\tint rounded = (int)Math.round(rangeAdjusted);\n\t\treturn rounded;\n\t}", "int random(int m)\n {\n return (int) (1 + Math.random()%m);\n }", "public int randomGQ() {\n\t\treturn(getRandomInteger(10,100));\n\t}", "private int randomHelper() {\n\t\tRandom rand = new Random();\n\t\tint randomNum = rand.nextInt((10000 - 1) + 1) + 1;\n\t\treturn randomNum;\n\t}", "public int pickNumber() {\n\t\t\n\t\tint max=10;\n\t\t\n\t\tint i = (int) Math.floor((Math.random()*max)+1);\n\t\treturn i;\n\t\t\n\t}", "public static void randomInit(int r) { }", "public int randInt(int min, int max) {\n Random rand = new Random();\n\n // nextInt is normally exclusive of the top value,\n // so add 1 to make it inclusive\n int randomNum = rand.nextInt((max - min) + 1) + min;\n\n return randomNum;\n}", "public static String getRandomNumberString() {\n Random rnd = new Random();\n int number = rnd.nextInt(9999999);\n\n // this will convert any number sequence into 6 character.\n return String.format(\"%07d\", number);\n }", "public void randomNumberTest() {\n //Generating streams of random numbers\n Random random = new Random();\n random.ints(5)//(long streamSize, double randomNumberOrigin, double randomNumberBound)\n .sorted()\n .forEach(System.out::println);\n /*\n -1622707470\n -452508309\n 1346762415\n 1456878623\n 1783692417\n */\n }", "int getRandom(int limit){\n Random rand = new Random();\n int upperBound = limit;\n return rand.nextInt(upperBound) + 1;\n }", "private int rand() {\n return (int)(Math.random()*(RAND_MAX + 1));\n }", "private int getRandomNumber(int limit) {\n\t\tlong seed = System.currentTimeMillis();\n\t\tRandom rand = new Random(seed);\n\t\treturn rand.nextInt(limit) + 1;\n\t}", "public static int getRandomBalance(){\n return rand.nextInt(1000000);\n }", "private int randomNumber(int high, int low){\n \t\t Random r = new Random();\n \t\t return (r.nextInt(high-low) + low);\n \t }", "int randInt(int n) {\r\n return _randomSource.nextInt(n);\r\n }", "public static int randomInt() {\n return randomInt(Integer.MIN_VALUE, Integer.MAX_VALUE);\n }", "public static int RandomNumber(int min, int max){\n Random random = new Random();\n int randomNum = random.nextInt((max - min)+1)+min;\n return randomNum;\n }", "private void getRandomNumber() {\n\t\tRandom generator = new Random();\n\t\trandomNumber = generator.nextInt(POSSIBLE_CHOICE.length);\n\t}", "public void generateNewSecret() {\r\n \r\n //Get Random Number With Correct Digits\r\n int intRand = randomNumberGenerator.nextInt((int)(Math.pow(10, numDigits) - Math.pow(10, numDigits - 1))) + (int)Math.pow(10, numDigits - 1);\r\n \r\n //Set To String\r\n String strRand = String.valueOf(intRand);\r\n \r\n //Set Value\r\n secretNumber = convertNumToDigitArray(strRand);\r\n \r\n }", "private int randomGen(int upperBound) {\n\t\tRandom r = new Random();\n\t\treturn r.nextInt(upperBound);\n\t}", "public static int getRandomInt()\n {\n return ThreadLocalRandom.current().nextInt(1000000000, 2147483647);\n }", "public int randomDP() {\n\t\treturn(getRandomInteger(10,250));\n\t}", "public static double random() {\r\n return uniform();\r\n }", "public static double random()\n {\n final int MAX_INT = 2147483647;\n int n = MAX_INT;\n \n // Just to ensure it does not return 1.0\n while(n == MAX_INT)\n \tn = abs (RAND.nextInt());\n \n return n * (1.0 / MAX_INT);\n }", "public String getRandomNumberString() {\n Random rnd = new Random();\n int number = rnd.nextInt(899999) + 100000;\n\n // this will convert any number sequence into 6 character.\n String formatted_code = String.format(\"%06d\", number);\n\n return formatted_code;\n }", "private double randn(){\r\n\t\t//* http://www.mathworks.com/access/helpdesk/help/techdoc/matlab.html\r\n\t\t//RandomNumber rnd = new RandomNumber(System.currentTimeMillis());\r\n\t\t//return rnd.normal();\r\n\t\treturn rnd.nextGaussian();\r\n\t\t//return 0;\r\n\t}", "int randInt(int n) {\n return _randomSource.nextInt(n);\n }", "@Override\n\tpublic double compete() {\n\t\tdouble result=MyTools.getRandomNum(10, 20); \t\n\t\tsetThisResult(result);\n\t\treturn result;\n\t}", "void setRandomNo() {\n\t\tno = 10000000 + (int) (Math.random() * 90000000);\n\t}", "private static int generateRandomNumber(int min, int max) {\n return (int)Math.floor(Math.random() * (max - min + 1)) + min;\n }", "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}", "private static int generateRandom(int min, int max) {\n // max - min + 1 will create a number in the range of min and max, including max. If you don´t want to include it, just delete the +1.\n // adding min to it will finally create the number in the range between min and max\n return r.nextInt(max-min+1) + min;\n }", "private void getRandomNumber() {\n\t\tRandom random = new Random();\n\t\tint randomCount = 255;\n\t\tint randNum = 0; \n\t\tfor(int i = 0; i < numberAmt; i++) {\n\t\t\trandNum = random.nextInt(randomCount);\n\t\t\tswitch (numberType) {\n\t\t\tcase 1:\n\t\t\t\trandomNumbers.add(Integer.toString(randNum));\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tif(randNum > 15)\n\t\t\t\t\trandomNumbers.add(String.format(\"%8s\", Integer.toBinaryString(randNum)).replace(\" \", \"0\"));\n\t\t\t\telse\n\t\t\t\t\trandomNumbers.add(String.format(\"%4s\", Integer.toBinaryString(randNum)).replace(\" \", \"0\"));\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\trandomNumbers.add(Integer.toHexString(randNum));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public int originalgetRandomPositiveInt(int min, int max){\r\n int number = getRandomPositiveInt(); \r\n return (int)number%(max - min + 1)+min;\r\n }", "private Integer randomBilirrubina(){\n\t\t\tint Min = 0, Max = 14;\n\t\t\treturn Min + (int)(Math.random() * ((Max - Min) + 1));\n\t\t}", "public int getRandomNumberInInterval() {\n\t\treturn getRandomNumberUsingNextInt(min, max);\n\t}", "public static int getRand(int n) {\r\n return rand.nextInt(n);\r\n }", "int randomPoint() { return 1 + (int)Math.round((Math.random()*20) % (size - 2)); }", "public static String generateMobNum() {\n\t\tString number = RandomStringUtils.randomNumeric(10);\t\n\t\treturn (number);\n\t}", "public static int randomGet() { return 0; }", "public int getRandom(int bound) {\n return ThreadLocalRandom.current().nextInt(bound);\n }", "public void generateR(){\n\t\t\tdo{\n\t\t\t\tr = new BigInteger(80, new Random());\n\t\t\t}while(!(q.gcd(r).equals(BigInteger.ONE)&&r.compareTo(q)<0&&r.compareTo(BigInteger.ONE)>=0));\n\t}", "private Random rand()\n\t{\n\t\treturn new Random();\n\t}", "private static int getRandomNumber(int min, int max) \n { //generates a random number within a range\n return (min + rand.nextInt((max - min) + 1));\n }", "private double getRandom() {\n return 2*Math.random() - 1;\n }", "public int generateNumber(int difficulty) {\n Random generator = new Random();\n return 1 + generator.nextInt((int) Math.pow(10, difficulty));\n }", "public int getRandomNumber() {\n int Random;\n Random randomize = new Random();\n Random = randomize.nextInt(3);\n return new Integer(Random);\n }", "private int randomAge() {\n \tint low = 18;\n \tint high = 100;\n \tint offset = high - low;\n \tRandom r = new Random();\n \treturn r.nextInt(offset) + low;\n \t\n }", "private int random(int from, int to) {\n return from + (int) (Math.random() * (to - from + 1));\n }", "public int drawpseudocard(){\n Random random = new Random();\n return random.nextInt(9)+1;\n }", "public static int getRandomNumber(int min, int max){\r\n Random r = new Random();\r\n return r.nextInt((max - min) +1) + min;\r\n }", "public Random getRandomNumberGenerator() { return randomNumberGenerator; }", "private static String accountNumberGenerator() {\n char[] chars = new char[10];\n for (int i = 0; i < 10; i++) {\n chars[i] = Character.forDigit(rnd.nextInt(10), 10);\n }\n return new String(chars);\n }", "public static int randomNumber(int start, int end) {\n long range = (long) end - (long) start + 1;\n // compute a fraction of the range, 0 <= frac < range\n long fraction = (long) (range * RANDOM.nextDouble());\n return (int) (fraction + start);\n }", "public static int getRandomNum() {\n\t\tRandom rand = new Random();\n\t\tint num = rand.nextInt(3)+1;\n\t\treturn num;\n\t}", "private static int randomBetween(Random r, int min, int max) {\n return r.nextInt(max - min) + min;\n }", "static int getRandomDelta() {\n int d = rand.nextInt(100);\n if (d < 50) {\n return -1;\n } else {\n return 1;\n }\n }", "public int randInt(int limit) {\n\t\treturn (_generator.nextInt(limit));\n\t}", "private int randomInteger(int n) {\n return (int) (randGen.random() * (n - 1));\n }", "public static double genRandomRestNumber() {\n return Simulator.randomGenerator.genRandomRest();\n }" ]
[ "0.7865234", "0.75922817", "0.75691956", "0.7548745", "0.73768103", "0.72881037", "0.72848874", "0.7256092", "0.72526604", "0.7143885", "0.71081054", "0.7105014", "0.7093621", "0.70762086", "0.7062635", "0.70581305", "0.7029453", "0.7028187", "0.70261234", "0.70197785", "0.697881", "0.6975693", "0.6974023", "0.6948542", "0.6946661", "0.693863", "0.6934922", "0.69325393", "0.6910241", "0.6906663", "0.6894044", "0.68488497", "0.6820969", "0.67756003", "0.6739424", "0.67241704", "0.67172366", "0.67156196", "0.6713613", "0.6647328", "0.66126335", "0.66019005", "0.65958005", "0.65916467", "0.65847677", "0.6582874", "0.65816003", "0.657529", "0.65715563", "0.6560862", "0.6558425", "0.6556439", "0.6551181", "0.6520284", "0.6511929", "0.6504659", "0.6501198", "0.64986634", "0.64940053", "0.6489963", "0.6481365", "0.6466791", "0.6463927", "0.6460553", "0.64478546", "0.64363056", "0.6435846", "0.6422042", "0.6420542", "0.6409219", "0.6395413", "0.6393531", "0.6392455", "0.6384907", "0.6379131", "0.63786405", "0.63745123", "0.637163", "0.63687", "0.6359168", "0.6359138", "0.6358411", "0.63482827", "0.6347762", "0.6338104", "0.6329735", "0.63118124", "0.6300657", "0.62929", "0.6287939", "0.62671524", "0.62524635", "0.6239237", "0.6238656", "0.622688", "0.62268126", "0.62242234", "0.6218715", "0.62080735", "0.62072796" ]
0.6512597
54
Method that generates a random number to be used between 110
public static int randomNumberAlg(){ int max = 10; int min = 1; int range = max-min+1; int randNum = (int)(Math.random()*range) + min; return randNum; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int randomNumber100(){\r\n int max = 100;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n return randNum;\r\n }", "private int randomNum() {\r\n\t return((int)(Math.random() * 100));\r\n\t }", "private int generateRandomNumber() {\n\t\treturn (int) Math.floor(Math.random() * Constants.RANDOM_NUMBER_GENERATOR_LIMIT);\n\t}", "public static int randNum() {\r\n\t\tint rand = (int)(Math.random()*((100)+1)); // Num generated between [0, 100]\r\n\t\treturn rand;\r\n\t}", "public static int randomNumber(){\r\n int max = 10;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n return randNum;\r\n }", "private int generateRandomNumber() {\n\t\treturn new SplittableRandom().nextInt(0, 3);\n\t}", "public static int customRandom(int range)\n {\n \tint random = (int)(Math.random()*10)%range;\n\t\n\treturn random;\n }", "public static int generateDigit() {\n\t\t\n\t\treturn (int)(Math.random() * 10);\n\t}", "public static String generateRandomInteger() {\n SecureRandom random = new SecureRandom();\n int aStart = 1;\n long aEnd = 999999999;\n long range = aEnd - (long) aStart + 1;\n long fraction = (long) (range * random.nextDouble());\n long randomNumber = fraction + (long) aStart;\n return String.valueOf(randomNumber);\n }", "public static int generateRandomNumber()\n\t{\n\t\tRandom r = new Random();\n\t\treturn r.nextInt();\n\t}", "public static int getRandomNumber(){\n int random = 0; // set variable to 0\r\n random = (int)(Math.random()*10) + 1; //generate random number between 1 and 10\r\n return random; //return random number\r\n }", "public static String randomNumberGenerator() {\r\n\t\tint max = 999999999; // e.g. 714053349 (9 digits)\r\n\t\tRandom rand = new Random();\r\n\t\tint min = 0;\r\n\t\tint randomNum = rand.nextInt(max - min + 1) + min;\r\n\t\treturn Integer.toString(randomNum);\r\n\t}", "public static int getRandomAmount(){\n return rand.nextInt(1000);\n }", "public static int randomNumber50(){\r\n int max = 50;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n return randNum;\r\n }", "public int generateRandom() {\n\t\tint random = (int)(Math.random()*((6-1)+1))+1;\n\t\treturn random;\n\t}", "public static int randomRound(){\r\n int max = 1000;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n return randNum;\r\n }", "int RandomGenerator0To29 (){\n\t\t int randomInt2 = 0;\n\t\t Random randomGenerator2 = new Random();\n\t\t for (int idx2 = 1; idx2 <= 10; ++idx2) {\n\t\t\t randomInt2 = randomGenerator2.nextInt(30);\n\t\t }\n\t\t return randomInt2;\n\t }", "public int getRandomsNumber(){\n Random random = new Random();\n int number = random.nextInt(12) + 1;\n return number;\n }", "public int randomNum()\r\n {\r\n Random rand = new Random();\r\n int n = rand.nextInt(52)+1;\r\n return n;\r\n }", "private int randomNumber(int high, int low){\n \t\t Random r = new Random();\n \t\t return (r.nextInt(high-low) + low);\n \t }", "public static int randomNumber() {\n //Random rndNumbers = new Random();\n //for(int i = 0; i < 100; i++) {\n // int rndNumber = rndNumbers.nextInt();\n // System.out.println(rndNumber);\n int rand = (int) (Math.random() * 100);\n System.out.println(rand);\n if (rand > 50) {\n return rand;\n } else {\n System.out.println(\"-1\");\n }\n return rand;\n }", "private static int newNumber()\n\t{\n\t\tdouble initial = Math.random();\n\t\tdouble rangeAdjusted = initial * (10000 - 1001) + 1000;\n\t\tint rounded = (int)Math.round(rangeAdjusted);\n\t\treturn rounded;\n\t}", "public int getRandomPositiveInt(){\r\n long gen = (a*seed+c)%m;\r\n seed = gen;\r\n return (int)gen;\r\n }", "public int generateNumber(int difficulty) {\n Random generator = new Random();\n return 1 + generator.nextInt((int) Math.pow(10, difficulty));\n }", "public static int getRandomBalance(){\n return rand.nextInt(1000000);\n }", "public void generateNewSecret() {\r\n \r\n //Get Random Number With Correct Digits\r\n int intRand = randomNumberGenerator.nextInt((int)(Math.pow(10, numDigits) - Math.pow(10, numDigits - 1))) + (int)Math.pow(10, numDigits - 1);\r\n \r\n //Set To String\r\n String strRand = String.valueOf(intRand);\r\n \r\n //Set Value\r\n secretNumber = convertNumToDigitArray(strRand);\r\n \r\n }", "int getRandom(int max);", "public int compete() {\r\n\t\tint max = 20;\r\n\t\tint min = 10;\r\n\t\tRandom Rand = new Random();\r\n\t\tint ranNum = Rand.nextInt(max - min) + min;\r\n\t\treturn ranNum;\r\n\t}", "public int randomNum() {\n\t\treturn 1 + (int) (Math.random() * 3); // randomNum = minimum + (int)(Math.random() * maximum);\n\t}", "private void getRandomNumber() {\n\t\tRandom random = new Random();\n\t\tint randomCount = 255;\n\t\tint randNum = 0; \n\t\tfor(int i = 0; i < numberAmt; i++) {\n\t\t\trandNum = random.nextInt(randomCount);\n\t\t\tswitch (numberType) {\n\t\t\tcase 1:\n\t\t\t\trandomNumbers.add(Integer.toString(randNum));\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tif(randNum > 15)\n\t\t\t\t\trandomNumbers.add(String.format(\"%8s\", Integer.toBinaryString(randNum)).replace(\" \", \"0\"));\n\t\t\t\telse\n\t\t\t\t\trandomNumbers.add(String.format(\"%4s\", Integer.toBinaryString(randNum)).replace(\" \", \"0\"));\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\trandomNumbers.add(Integer.toHexString(randNum));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "private int randomHelper() {\n\t\tRandom rand = new Random();\n\t\tint randomNum = rand.nextInt((10000 - 1) + 1) + 1;\n\t\treturn randomNum;\n\t}", "private double getRandomNumber(){\n double rand = Math.random();//produce a number between 0 and 1\n rand = rand - 0.5;\n return rand;\n }", "private static int newSecretNumber(int min, int max)\n {\n Random rnd = new Random();\n return rnd.nextInt((max + 1 - min) + min);\n }", "public static int getRandom() \n\t{\n\t\treturn rGenerator.nextInt();\n\t}", "public String getRandomNumberString() {\n Random rnd = new Random();\n int number = rnd.nextInt(899999) + 100000;\n\n // this will convert any number sequence into 6 character.\n String formatted_code = String.format(\"%06d\", number);\n\n return formatted_code;\n }", "private void setRand(){\n rand = generator.nextInt(9) + 1;\n }", "private static int getSecretNum(int arg1) {\n Random rand = new Random();\n return rand.nextInt(UPPERBOUND)+1; //make range 1-100\n }", "private int randomGen(int upperBound) {\n\t\tRandom r = new Random();\n\t\treturn r.nextInt(upperBound);\n\t}", "public static int getRandom(int n){\n\t\treturn rg.nextInt(n); \n\t}", "public static int randInt() {\n Random rand = new Random();\n\n // nextInt is normally exclusive of the top value,\n // so add 1 to make it inclusive\n int randomNum = rand.nextInt((20 - 10) + 1) + 10;\n\n return randomNum;\n }", "public int randomGQ() {\n\t\treturn(getRandomInteger(10,100));\n\t}", "private int randomValue() {\r\n\t\tRandom rand = new Random();\r\n\t\tint val = rand.nextInt(10);\r\n\t\tif(val == 9)\r\n\t\t\treturn 4;\r\n\t\telse\r\n\t\t\treturn 2;\r\n\t}", "public static int randomNext() { return 0; }", "public int generateStrength() {\n\t\tRandom rand = new Random();\n\t\tint strength = rand.nextInt(41) - 10;\n\t\treturn strength;\n\t}", "private int _randomCode () {\n Random random = new Random();\n code = random.nextInt(999999);\n return code;\n }", "private int rand(int lower, int higher) {\n\t\treturn lower + (int) ((higher - lower + 1) * Math.random());\n\t\t\n\t}", "public static double randomNum(Random g)\n\t{\n\t\treturn -5+g.nextDouble()*10;\n\t}", "public static String randomNumberString() {\n\r\n Random random = new Random();\r\n int i = random.nextInt(999999);\r\n\r\n\r\n return String.format(\"%06d\", i);\r\n }", "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}", "int RandomGeneratorZeroToThree (){\n\t\t int randomInt = 0;\n\t\t Random randomGenerator = new Random();\n\t\t for (int idx = 1; idx <= 10; ++idx) {\n\t\t\t randomInt = randomGenerator.nextInt(4);\n\n\t\t }\n\t\t return randomInt;\n\t }", "public static String getRandomNumberString() {\n Random rnd = new Random();\n int number = rnd.nextInt(9999999);\n\n // this will convert any number sequence into 6 character.\n return String.format(\"%07d\", number);\n }", "private Integer randomBilirrubina(){\n\t\t\tint Min = 0, Max = 14;\n\t\t\treturn Min + (int)(Math.random() * ((Max - Min) + 1));\n\t\t}", "private int getRandomNumberInRange(int min, int max) {\r\n\r\n\t\tRandom r = new Random();\r\n\t\treturn ((r.nextInt(max - min) + 1) + min)*40;\r\n\t}", "private int getRandomNumber(int limit) {\n\t\tlong seed = System.currentTimeMillis();\n\t\tRandom rand = new Random(seed);\n\t\treturn rand.nextInt(limit) + 1;\n\t}", "public static int RandomNumber(int min, int max){\n Random random = new Random();\n int randomNum = random.nextInt((max - min)+1)+min;\n return randomNum;\n }", "private static int generateRandomNumber(int min, int max) {\n return (int)Math.floor(Math.random() * (max - min + 1)) + min;\n }", "private static String accountNumberGenerator() {\n char[] chars = new char[10];\n for (int i = 0; i < 10; i++) {\n chars[i] = Character.forDigit(rnd.nextInt(10), 10);\n }\n return new String(chars);\n }", "public int generateRoll() {\n\t\tint something = (int) (Math.random() * 100) + 1;\n\t\tif (something <= 80) {\n\t\t\tint allNumRoll = (int) (Math.random() * getNumSides()) + 1;\n\t\t\tint roll = allNumRoll * 2 - 1;\n\t\t\treturn roll;\n\t\t} else {\n\t\t\tint allNumRoll = (int) (Math.random() * getNumSides()) + 1;\n\t\t\tint roll = allNumRoll * 2;\t\t\n\t\t\treturn roll;\n\t\t}\n\t}", "public static int generateRandomNumber(int topBoundary)\n\t{\n\t\tRandom r = new Random();\n\t\treturn r.nextInt(topBoundary);\n\t}", "public int pickNumber() {\n\t\t\n\t\tint max=10;\n\t\t\n\t\tint i = (int) Math.floor((Math.random()*max)+1);\n\t\treturn i;\n\t\t\n\t}", "public double getRandom() {\n return 20*Math.random() - 10;\n }", "public int generateRandomNumber(Integer low, Integer high) {\n\t\tRandom r = new Random();\n\t\treturn r.nextInt(high - low) + low;\n\t}", "private void getRandomNumber() {\n\t\tRandom generator = new Random();\n\t\trandomNumber = generator.nextInt(POSSIBLE_CHOICE.length);\n\t}", "private static int getRandomNumberOfRooms(){\r\n return r.nextInt(50)+1;\r\n }", "public int getRandomNumberInInterval() {\n\t\treturn getRandomNumberUsingNextInt(min, max);\n\t}", "private int randomAge() {\n \tint low = 18;\n \tint high = 100;\n \tint offset = high - low;\n \tRandom r = new Random();\n \treturn r.nextInt(offset) + low;\n \t\n }", "public int RandomNegativeNumbers() {\n\t\tint result = 0;\n\t\tresult = rnd.nextInt(10) - 10;\n\t\treturn result;\n\t}", "public int randInt(int min, int max) {\n Random rand = new Random();\n\n // nextInt is normally exclusive of the top value,\n // so add 1 to make it inclusive\n int randomNum = rand.nextInt((max - min) + 1) + min;\n\n return randomNum;\n}", "public int randomDP() {\n\t\treturn(getRandomInteger(10,250));\n\t}", "public static int randInt() {\n\t\tint min = 10;\n\t\tint max = 99999999;\n\t\tRandom rand = new Random();\n\t\tint randomNum = (rand.nextInt((max - min) + 1) + rand.nextInt((max - min) + 1)) / 2;\n\t\treturn randomNum;\n\t}", "private static int get() { \r\n Random r = new Random();\r\n return (r.nextInt(9));\r\n }", "void setRandomNo() {\n\t\tno = 10000000 + (int) (Math.random() * 90000000);\n\t}", "public void generateR(){\n\t\t\tdo{\n\t\t\t\tr = new BigInteger(80, new Random());\n\t\t\t}while(!(q.gcd(r).equals(BigInteger.ONE)&&r.compareTo(q)<0&&r.compareTo(BigInteger.ONE)>=0));\n\t}", "private double genMultiplier() {\n return (random.nextInt(81) + 60)/100.0;\n }", "public int originalgetRandomPositiveInt(int min, int max){\r\n int number = getRandomPositiveInt(); \r\n return (int)number%(max - min + 1)+min;\r\n }", "public int randomNumber(int maxValue) {\n\t\tRandom rndNumbers = new Random();\n\t\tint rndNumber = 0;\n\t\trndNumber = rndNumbers.nextInt(maxValue);\n\t\treturn rndNumber;\n\n\t}", "@Override\n\tpublic double compete() {\n\t\tdouble result=MyTools.getRandomNum(10, 20); \t\n\t\tsetThisResult(result);\n\t\treturn result;\n\t}", "private static int getRandomNumber(int min, int max) \n { //generates a random number within a range\n return (min + rand.nextInt((max - min) + 1));\n }", "private int generatePiece()\n\t{\n\t\tint toReturn = 0;\n\t\tint max = 1;\n\t\tint min = -1;\n\t\t\n\t\twhile(toReturn == 0)\n\t\t{\n\t\t\ttoReturn = r.nextInt((max - min) + 1) + min;\n\t\t}\n\t\tSystem.out.println(toReturn);\n\t\treturn toReturn;\n\t}", "private static int addRandomScore() {\n Random ran = new Random();\n return ran.nextInt(201) + 400;\n }", "int getRandom(int limit){\n Random rand = new Random();\n int upperBound = limit;\n return rand.nextInt(upperBound) + 1;\n }", "int random(int m)\n {\n return (int) (1 + Math.random()%m);\n }", "public String generateNumber(int length) {\n int maxNumber = Integer.parseInt(new String(new char[length]).replace(\"\\0\", \"9\"));\n int intAccountNumber = ThreadLocalRandom.current().nextInt(0, maxNumber + 1);\n int accountNumberLength = String.valueOf(intAccountNumber).length();\n StringBuilder stringBuilder = new StringBuilder();\n if (accountNumberLength < length) {\n stringBuilder.append(new String(new char[length - accountNumberLength]).replace(\"\\0\", \"0\"));\n }\n stringBuilder.append(intAccountNumber);\n return stringBuilder.toString();\n }", "private int generateWholoeNumInRange( int min, int max ) {\r\n\r\n // Evaluate random number from min to max including min and max\r\n return (int)(Math.random()*(max - min + 1) + min);\r\n\r\n }", "public static String generateMobNum() {\n\t\tString number = RandomStringUtils.randomNumeric(10);\t\n\t\treturn (number);\n\t}", "public static int getRandomNum() {\n\t\tRandom rand = new Random();\n\t\tint num = rand.nextInt(3)+1;\n\t\treturn num;\n\t}", "public static int RandomNum(){\n\n Random random = new Random();\n int ItemPicker = random.nextInt(16);\n return(ItemPicker);\n }", "private double generateRandomValue(int min, int max) {\n\t\tdouble number = (Math.random() * max * 100) / 100 + min;\n\t\treturn number;\n\t}", "public static long generateCode() {\n long code = (long) (100000 + Math.random() * 899999l);\n return code;\n }", "public static int getRandomNumberString() {\n // It will generate 6 digit random Number.\n // from 0 to 999999\n Random rnd = new Random();\n int number = rnd.nextInt(999999);\n\n // this will convert any number sequence into 6 character.\n return number;\n }", "public static int randomNumberRatio(){\r\n int max = 10;\r\n int min = 1;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n return randNum;\r\n }", "public static Double randomDecimal(){\r\n int max = 1000;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n double randDec = (randNum/100.0);\r\n \r\n return randDec;\r\n \r\n }", "private int rand(int lower, int upper) {\n return lower + (int)(Math.random() * ((upper - lower) + 1));\n }", "public int generatePolicyNum(){\n\t\tRandom rnd = new Random();\n\t\tint polNum = rnd.nextInt(899999) + 100000; \t\n\t\t\n\t\treturn polNum;\t\t\t\n\t}", "private static int generateRandom(int min, int max) {\n // max - min + 1 will create a number in the range of min and max, including max. If you don´t want to include it, just delete the +1.\n // adding min to it will finally create the number in the range between min and max\n return r.nextInt(max-min+1) + min;\n }", "public static long randomTime() {\n return (random.nextInt(11) + 25)*1000;\n }", "int randInt(int n) {\r\n return _randomSource.nextInt(n);\r\n }", "private String getRandomPIN(int num) {\n\t\tStringBuilder randomPIN = new StringBuilder();\n\t\tfor (int i = 0; i < num; i++) {\n\t\t\trandomPIN.append((int) (Math.random() * 10));\n\t\t}\n\t\treturn randomPIN.toString();\n\t}", "public int randomGenerator(int min, int max) {\n int random = (int) ((Math.random()*((max-min)+1))+min);\n return random;\n }", "private static int myRandom(int low, int high) {\n return (int) (Math.random() * (high + 1 - low) + low);\n }" ]
[ "0.7606101", "0.7517959", "0.7446848", "0.7443721", "0.7340593", "0.7284889", "0.7201321", "0.71942127", "0.71662885", "0.71558243", "0.70714074", "0.70700294", "0.70617497", "0.70594674", "0.70296705", "0.7013981", "0.70062774", "0.6951381", "0.6939456", "0.6919577", "0.69178474", "0.6901102", "0.6898803", "0.68842286", "0.68568337", "0.6823495", "0.6815304", "0.68115586", "0.67752284", "0.6772028", "0.67291534", "0.672877", "0.66947585", "0.6691246", "0.6677325", "0.6675138", "0.66281074", "0.66272086", "0.66213703", "0.6610594", "0.6591088", "0.65723133", "0.6567648", "0.65663946", "0.65595186", "0.6557668", "0.6547092", "0.6546785", "0.65411526", "0.65280104", "0.651721", "0.6514933", "0.6509073", "0.6499536", "0.648737", "0.6482915", "0.64712054", "0.64706975", "0.6464303", "0.6461778", "0.64472395", "0.6436355", "0.64338213", "0.64280576", "0.641749", "0.64162415", "0.6408912", "0.6407806", "0.6395329", "0.6392772", "0.63910717", "0.63842314", "0.6382825", "0.6379995", "0.6375454", "0.63744235", "0.63721377", "0.6369964", "0.63679427", "0.6366696", "0.63648087", "0.6361243", "0.6358191", "0.6357336", "0.6352995", "0.6346973", "0.63422585", "0.6342213", "0.63369954", "0.63306874", "0.63210416", "0.6300744", "0.62898576", "0.6285302", "0.62824935", "0.6267338", "0.6265321", "0.62610143", "0.62506646", "0.624565" ]
0.7313273
5
Method that generates a random number to be used between 14 to be used to generate the locations of the answers in the second game
public static int randomPosition(){ int max = 4; int min = 1; int range = max-min+1; int randNum = (int)(Math.random()*range) + min; int pos = randNum; return pos; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int RandomGenerator0To29 (){\n\t\t int randomInt2 = 0;\n\t\t Random randomGenerator2 = new Random();\n\t\t for (int idx2 = 1; idx2 <= 10; ++idx2) {\n\t\t\t randomInt2 = randomGenerator2.nextInt(30);\n\t\t }\n\t\t return randomInt2;\n\t }", "private void getRandomNumber() {\n\t\tRandom generator = new Random();\n\t\trandomNumber = generator.nextInt(POSSIBLE_CHOICE.length);\n\t}", "public int getRandomsNumber(){\n Random random = new Random();\n int number = random.nextInt(12) + 1;\n return number;\n }", "private void setRand(){\n rand = generator.nextInt(9) + 1;\n }", "private int generateRandomNumber() {\n\t\treturn new SplittableRandom().nextInt(0, 3);\n\t}", "int randomPoint() { return 1 + (int)Math.round((Math.random()*20) % (size - 2)); }", "public int generateRandom() {\n\t\tint random = (int)(Math.random()*((6-1)+1))+1;\n\t\treturn random;\n\t}", "public void generateNumbers() {\n number1 = (int) (Math.random() * 10) + 1;\n number2 = (int) (Math.random() * 10) + 1;\n operator = (int) (Math.random() * 4) + 1;\n //50% chance whether the displayed answer will be right or wrong\n rightOrWrong = (int) (Math.random() * 2) + 1;\n //calculate the offset of displayed answer for a wrong equation (Error)\n error = (int) (Math.random() * 4) + 1;\n generateEquation();\n }", "public int drawpseudocard(){\n Random random = new Random();\n return random.nextInt(9)+1;\n }", "private static int getRandomNumberOfRooms(){\r\n return r.nextInt(50)+1;\r\n }", "private int randomNum() {\r\n\t return((int)(Math.random() * 100));\r\n\t }", "public static void Random() {\n\t\tRandom ran =new Random();\r\n\t\trandom=ran.nextInt(6)+1;\r\n\t\t//random=1;\r\n\t\twho=A1063307_GUI.who2;\r\n\t\tif((ch[who].status)>0) {\r\n\t\t\tch[who].location=(ch[who].location)+random;\r\n\t\t\tch[who].status=(ch[who].status)-1;\r\n\t\t\t\r\n\t\t}else {\r\n\t\t\t\treturn;\r\n\t\t\t}\t\t\r\n\t}", "public static int RandomNum(){\n\n Random random = new Random();\n int ItemPicker = random.nextInt(16);\n return(ItemPicker);\n }", "public void newGame() {\n\t\ttheNumber = (int)(Math.random()* 100 + 1);\r\n\t\t\r\n\t}", "public static int getRandomAmount(){\n return rand.nextInt(1000);\n }", "public void generateNewSecret() {\r\n \r\n //Get Random Number With Correct Digits\r\n int intRand = randomNumberGenerator.nextInt((int)(Math.pow(10, numDigits) - Math.pow(10, numDigits - 1))) + (int)Math.pow(10, numDigits - 1);\r\n \r\n //Set To String\r\n String strRand = String.valueOf(intRand);\r\n \r\n //Set Value\r\n secretNumber = convertNumToDigitArray(strRand);\r\n \r\n }", "private int randomHelper() {\n\t\tRandom rand = new Random();\n\t\tint randomNum = rand.nextInt((10000 - 1) + 1) + 1;\n\t\treturn randomNum;\n\t}", "public void generateRandomPosition() {\n\t\tx.set((int)(Math.floor(Math.random()*23+1)));\n\t\ty.set((int)(Math.floor(Math.random()*23+1)));\n\n\t}", "public int randomMove()\r\n {\r\n r = new Random();\r\n x = r.nextInt(7);\r\n return x;\r\n }", "private Integer randomBilirrubina(){\n\t\t\tint Min = 0, Max = 14;\n\t\t\treturn Min + (int)(Math.random() * ((Max - Min) + 1));\n\t\t}", "public int randomNum()\r\n {\r\n Random rand = new Random();\r\n int n = rand.nextInt(52)+1;\r\n return n;\r\n }", "public static int randomNext() { return 0; }", "public static int getRandomNumber(){\n int random = 0; // set variable to 0\r\n random = (int)(Math.random()*10) + 1; //generate random number between 1 and 10\r\n return random; //return random number\r\n }", "public static int randomNumber() {\n //Random rndNumbers = new Random();\n //for(int i = 0; i < 100; i++) {\n // int rndNumber = rndNumbers.nextInt();\n // System.out.println(rndNumber);\n int rand = (int) (Math.random() * 100);\n System.out.println(rand);\n if (rand > 50) {\n return rand;\n } else {\n System.out.println(\"-1\");\n }\n return rand;\n }", "private void getRandomNumber() {\n\t\tRandom random = new Random();\n\t\tint randomCount = 255;\n\t\tint randNum = 0; \n\t\tfor(int i = 0; i < numberAmt; i++) {\n\t\t\trandNum = random.nextInt(randomCount);\n\t\t\tswitch (numberType) {\n\t\t\tcase 1:\n\t\t\t\trandomNumbers.add(Integer.toString(randNum));\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tif(randNum > 15)\n\t\t\t\t\trandomNumbers.add(String.format(\"%8s\", Integer.toBinaryString(randNum)).replace(\" \", \"0\"));\n\t\t\t\telse\n\t\t\t\t\trandomNumbers.add(String.format(\"%4s\", Integer.toBinaryString(randNum)).replace(\" \", \"0\"));\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\trandomNumbers.add(Integer.toHexString(randNum));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic double compete() {\n\t\tdouble result=MyTools.getRandomNum(10, 20); \t\n\t\tsetThisResult(result);\n\t\treturn result;\n\t}", "private int generateRandomNumber() {\n\t\treturn (int) Math.floor(Math.random() * Constants.RANDOM_NUMBER_GENERATOR_LIMIT);\n\t}", "private static int get() { \r\n Random r = new Random();\r\n return (r.nextInt(9));\r\n }", "int RandomGeneratorZeroToThree (){\n\t\t int randomInt = 0;\n\t\t Random randomGenerator = new Random();\n\t\t for (int idx = 1; idx <= 10; ++idx) {\n\t\t\t randomInt = randomGenerator.nextInt(4);\n\n\t\t }\n\t\t return randomInt;\n\t }", "public static int getRandom() \n\t{\n\t\treturn rGenerator.nextInt();\n\t}", "public static int rand7() {\n while (true) {\n int number = 5 * rand5() + rand5();\n if (number < 21) {\n return number % 7;\n }\n }\n }", "private int randomValue() {\r\n\t\tRandom rand = new Random();\r\n\t\tint val = rand.nextInt(10);\r\n\t\tif(val == 9)\r\n\t\t\treturn 4;\r\n\t\telse\r\n\t\t\treturn 2;\r\n\t}", "private double getRandom() {\n return 2*Math.random() - 1;\n }", "public int randomGQ() {\n\t\treturn(getRandomInteger(10,100));\n\t}", "private double getRandomNumber(){\n double rand = Math.random();//produce a number between 0 and 1\n rand = rand - 0.5;\n return rand;\n }", "public int compete() {\r\n\t\tint max = 20;\r\n\t\tint min = 10;\r\n\t\tRandom Rand = new Random();\r\n\t\tint ranNum = Rand.nextInt(max - min) + min;\r\n\t\treturn ranNum;\r\n\t}", "void random(){\r\n Random dice = new Random ();\r\n int number;\r\n \r\n for (int counter=1; counter<=10;counter++);\r\n number = 10000+dice.nextInt(100000);\r\n \r\n String hasil = TF3.getText();\r\n isi4.setText(number + \" \");\r\n }", "private int aleatorizarNaipe() {\n\t\tint aux;\n\t\taux = r.getIntRand(4);\n\t\treturn aux;\n\t}", "public double getRandom() {\n return 20*Math.random() - 10;\n }", "private synchronized static String getNextNumber() {\n String toReturn;\n String number = String.valueOf(Math.round(Math.random() * 89999) + 10000);\n if(meetings.containsKey(number)) {\n toReturn = getNextNumber();\n } else {\n toReturn = number;\n }\n return toReturn;\n }", "private int evaluate() {\n return (int) (Math.random() * 8);\n }", "@Override\n\tpublic double compete() {\n\t\tdouble result=MyTools.getRandomNum(500, 800);\n\t\tsetThisResult(result);\n\t\treturn result;\n\t}", "public int randomDP() {\n\t\treturn(getRandomInteger(10,250));\n\t}", "public int NewMonster(){\n int r = (int) (Math.random() * (9 - 2 + 1) + 2);\n return r;\n }", "private String RandomGoal() {\n\t\tList<String> list = Arrays.asList(\"m\", \"m\", \"m\", \"m\", \"m\", \"m\", \"m\", \"m\", \"t\", \"t\");\n\t\tRandom rand = new Random();\n\t\tString randomgoal = list.get(rand.nextInt(list.size()));\n\n\t\treturn randomgoal;\n\t}", "private int rand() {\n return (int)(Math.random()*(RAND_MAX + 1));\n }", "private int randomAge() {\n \tint low = 18;\n \tint high = 100;\n \tint offset = high - low;\n \tRandom r = new Random();\n \treturn r.nextInt(offset) + low;\n \t\n }", "private Integer randomHemoglobina(){\n\t\t\tint Min = 9, Max = 23;\n\t\t\treturn Min + (int)(Math.random() * ((Max - Min) + 1));\n\t\t}", "public int generateNumber(int difficulty) {\n Random generator = new Random();\n return 1 + generator.nextInt((int) Math.pow(10, difficulty));\n }", "@Override\n public Integer pee() {\n return (int) (random() * 8);\n }", "public static int generateRandomNumber()\n\t{\n\t\tRandom r = new Random();\n\t\treturn r.nextInt();\n\t}", "private int randomNumber(int high, int low){\n \t\t Random r = new Random();\n \t\t return (r.nextInt(high-low) + low);\n \t }", "public int eDmg(){\r\n eDmg = rand.nextInt(13);\r\n return eDmg;\r\n }", "private void random() {\n\n\t}", "public void randomDestino(){\n\t\tRandom aleatorio = new Random();\n\t\tint numero = aleatorio.nextInt(2);\n\t\tif (numero == 0)\n\t\t\tsetGiro(90);\n\t\telse \n\t\t\tsetGiro(270);\n\t}", "private static int addRandomScore() {\n Random ran = new Random();\n return ran.nextInt(201) + 400;\n }", "public static int getRandom(int n){\n\t\treturn rg.nextInt(n); \n\t}", "private int randomAddress() {\n\t\tint randomAddressId = (int) (Math.random() * 603);\n\t\treturn randomAddressId;\n\t}", "public int generateEvent(){\r\n\t\tif (Event()){\r\n\t\t\treturn random.nextInt(12);\r\n\t\t} else {\r\n\t\t\treturn 4;\r\n\t\t}\r\n\t}", "public void random(){\r\n\t\tRandom rand = new Random();\r\n\t\trandArray = new int[6];\r\n\t\tfor (int i = 0; i < 6; i++){\r\n\t\t\t//Randomly generated number from zero to nine\r\n\t\t\trandom = rand.nextInt(10);\r\n\t\t\t//Random values stored into the array\r\n\t\t\trandArray[i] = random;\r\n\t\t\tif(i == 0){\r\n\t\t\t\ta = random;\r\n\t\t\t}\r\n\t\t\tif(i == 1){\r\n\t\t\t\tb = random;\r\n\t\t\t}\r\n\t\t\tif(i == 2){\r\n\t\t\t\tc = random;\r\n\t\t\t}\r\n\t\t\tif(i == 3){\r\n\t\t\t\td = random;\r\n\t\t\t}\r\n\t\t\tif(i == 4){\r\n\t\t\t\tf = random;\r\n\t\t\t}\r\n\t\t\tif(i == 5){\r\n\t\t\t\tg = random;\r\n\t\t\t}\r\n\t\t\t//Random values outputted\r\n\t\t\t//Prints out if the hint was not used.\r\n\t\t\tif (executed == false || guessed == true ){\r\n\t\t\t\tprint(randArray[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Prints out if the hint was not used.\r\n\t\tif (executed == false || guessed == true){\r\n\t\t\tprintln(\" Randomly Generated Value\");\r\n\t\t}\r\n\t}", "public int randomNum() {\n\t\treturn 1 + (int) (Math.random() * 3); // randomNum = minimum + (int)(Math.random() * maximum);\n\t}", "int lanzar(int n){\n int result = (int) (Math.random()* 6) + 1;\r\n if(result !=n ) result = (int) (Math.random()* 6) + 1;\r\n return result;\r\n \r\n /*\r\n * int result = (int) (Math.random()*9)+1;\r\n * if (result > 0 && result < 7) return result;\r\n * else if(result > 6 && result < 9) return n;\r\n * else return (int) (Math.random()*6)+1;\r\n *\r\n *\r\n */\r\n }", "void setRandomNo() {\n\t\tno = 10000000 + (int) (Math.random() * 90000000);\n\t}", "public static double randomNum(Random g)\n\t{\n\t\treturn -5+g.nextDouble()*10;\n\t}", "private void createRandomGame() {\n ArrayList<int[]> usedCoordinates = new ArrayList<>();\n\n // make sure the board is empty\n emptyBoard();\n\n //find different coordinates\n while (usedCoordinates.size() < 25) {\n int[] temp = new int[]{randomNumberGenerator.generateInteger(size), randomNumberGenerator.generateInteger(size)};\n\n // default contains(arraylist) doesn't work because it compares hashcodes\n if (! contains(usedCoordinates, temp)) {\n usedCoordinates.add(temp);\n }\n }\n\n for (int[] usedCoordinate : usedCoordinates) {\n board.setSquare(usedCoordinate[0], usedCoordinate[1], randomNumberGenerator.generateInteger(size) + 1);\n }\n\n //save start locations\n startLocations = usedCoordinates;\n }", "public int generateHour() {\n Random random = new Random();\n int hour = random.nextInt(8);\n\n return hour;\n }", "private int _randomCode () {\n Random random = new Random();\n code = random.nextInt(999999);\n return code;\n }", "public void placeRandomNumbers() {\n\t\t\n\t\tArrayList<HexLocation> locations = getShuffledLocations();\n\t\tint[] possibleNumbers = new int[] {2, 3, 3, 4, 4, 5, 5, 6, 6, 8, 8, 9, 9, 10, 10, 11, 11, 12};\n\t\t\n\t\tfor (int i = 0; i < possibleNumbers.length; i++)\n\t\t\tnumbers.get(possibleNumbers[i]).add(locations.get(i));\n\t}", "private static int getSecretNum(int arg1) {\n Random rand = new Random();\n return rand.nextInt(UPPERBOUND)+1; //make range 1-100\n }", "public static int randNum() {\r\n\t\tint rand = (int)(Math.random()*((100)+1)); // Num generated between [0, 100]\r\n\t\treturn rand;\r\n\t}", "public String generateTrackingNumber() {\n String randChars = \"ABCDEFGHIJ0123456789\";\n StringBuilder trackingNumber = new StringBuilder();\n Random rand = new Random();\n \n while(trackingNumber.length() < 12) {\n int i = (int) (rand.nextFloat() * randChars.length());\n trackingNumber.append(randChars.charAt(i));\n }\n String trackingNum = trackingNumber.toString();\n return trackingNum;\n }", "public int randNums() {\n //Create a random number between 0-16\n int randNum = (int)(Math.random() * 16);\n\n //Go to the random number's index in the number array. Pull the random number\n //and set the index value to zero. Return the random number\n if(numsArray[randNum] != 0){\n numsArray[randNum] = 0;\n return randNum + 1;\n }\n\n //If the index value is zero then it was already chosen. Recursively try again\n else{\n return randNum = randNums();\n }\n }", "private int getRandomPiece() {\r\n return new Random().nextInt(Constants.NUM_PIECES);\r\n }", "public int decideRandomMove() {\n return (int) (Math.random() * 4);\n }", "private Random rand()\n\t{\n\t\treturn new Random();\n\t}", "public static int randomNumber(){\r\n int max = 10;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n return randNum;\r\n }", "public void randomize(){\r\n Num1.setText(\"\"+((int) (Math.random() * 10 + 1)));\r\n Num2.setText(\"\"+((int) (Math.random() * 10 + 1)));\r\n Num3.setText(\"\"+((int) (Math.random() * 10 + 1)));\r\n }", "public static int customRandom(int range)\n {\n \tint random = (int)(Math.random()*10)%range;\n\t\n\treturn random;\n }", "public Random getRandomNumberGenerator() { return randomNumberGenerator; }", "private RandomLocationGen() {}", "public static TradeGood getRandom() {\n TradeGood[] options = new TradeGood[] {WATER, FURS, ORE, FOOD, GAMES, FIREARMS,\n MEDICINE, NARCOTICS, ROBOTS, MACHINES};\n int index = GameState.getState().rng.nextInt(10);\n return options[index];\n }", "private int generatePiece()\n\t{\n\t\tint toReturn = 0;\n\t\tint max = 1;\n\t\tint min = -1;\n\t\t\n\t\twhile(toReturn == 0)\n\t\t{\n\t\t\ttoReturn = r.nextInt((max - min) + 1) + min;\n\t\t}\n\t\tSystem.out.println(toReturn);\n\t\treturn toReturn;\n\t}", "public void generateComputerChoice() {\n\t\tgetRandomNumber();\n\t\tsetComputerChoice();\n\t}", "@Override\r\n public int positionRandom() {\r\n int random = ((int) (Math.random() * arrayWords.length - 1) + 1);//define a random number with lengt more one for not getout the number zero\r\n return random;\r\n }", "private Set<Integer> generateWinningNumbers()\r\n\t{\r\n\t\tSet<Integer> winningNumbers = new HashSet<Integer>();\r\n\t\t\r\n\t\tint i=0;\r\n\t\twhile(i<6)\r\n\t\t{\r\n\t\t\tboolean added = winningNumbers.add(random.nextInt(lotteryMax + 1));\r\n\t\t\tif(added) i++;\r\n\t\t}\r\n\t\treturn winningNumbers;\r\n\t}", "public static int getRandomBalance(){\n return rand.nextInt(1000000);\n }", "public static int computerChoice(Random generator){\n int randNumber;\n \n randNumber = generator.nextInt(5);\n return randNumber;\n }", "public void questionGenerator()\n\t{\n\t\t//creates questions\n\t\toperation = rand.nextInt(3) + min;\n\t\t\n\t\t//makes max # 10 to make it easier for user if random generator picks multiplication problem\n\t\tif (operation == 3)\n\t\t\tmax = 10; \n\t\t\n\t\t//sets random for number1 & number2\n\t\tnumber1 = rand.nextInt(max) + min; //random number max and min\n\t\tnumber2 = rand.nextInt(max) + min; \n\t\t\t\t\n\t\t//ensures final answer of problem is not negative by switching #'s if random generator picks subtraction problem\n\t\tif (operation == 2 && number1 < number2)\n\t\t{\n\t\t\tint tempNum = number1;\n\t\t\tnumber1 = number2;\n\t\t\tnumber2 = tempNum;\n\t\t}\n\t\tanswer = 0;\n\t\t\n\t\t//randomizes operator to randomize question types\n\t\tif (operation == 1)\n\t\t{\n\t\t\toperator = '+';\n\t\t\tanswer = number1 + number2;\n\t\t}\n\t\tif (operation == 2)\n\t\t{\n\t\t\toperator = '-';\n\t\t\tanswer = number1 - number2;\n\t\t}\n\t\tif (operation == 3)\n\t\t{\n\t\t\toperator = '*';\n\t\t\tanswer = number1 * number2;\n\t\t}\n\t\t\t\n\t\t//prints question\n\t\tlabel2.setText(\"Question: \" + number1 + \" \" + operator + \" \" + number2 + \" = ?\");\n\t}", "public int pickNumber() {\n\t\t\n\t\tint max=10;\n\t\t\n\t\tint i = (int) Math.floor((Math.random()*max)+1);\n\t\treturn i;\n\t\t\n\t}", "private int choose(){\n\t\tdouble temp = 10 * Math.random();\n\t\tint i = (int)temp;\n\t\treturn i;\n\t}", "public int rollResult(){\r\n return rand.nextInt(6) + 1;\r\n }", "private int randomWeight()\n {\n return dice.nextInt(1000000);\n }", "public static String generateRandomInteger() {\n SecureRandom random = new SecureRandom();\n int aStart = 1;\n long aEnd = 999999999;\n long range = aEnd - (long) aStart + 1;\n long fraction = (long) (range * random.nextDouble());\n long randomNumber = fraction + (long) aStart;\n return String.valueOf(randomNumber);\n }", "private int aleatorizarNumero() {\n\t\tint aux;\n\t\taux = r.getIntRand(13) + 1;\n\t\treturn aux;\n\t}", "int getRandom(int max);", "private String generateAnswer() throws IOException {\n int j = lineNumber();\n int i = 0;\n String result = \"\";\n Random rnd = new Random();\n int rndNumber = rnd.nextInt(j);\n File answers = new File(this.settings.getValue(\"botAnswerFile\"));\n try (RandomAccessFile raf = new RandomAccessFile(answers, \"r\")) {\n while (raf.getFilePointer() != raf.length()) {\n result = raf.readLine();\n i++;\n if ((i - 1) == rndNumber) {\n break;\n }\n }\n }\n return result;\n }", "protected int pathDrawLots(int bound)\n {\n Random r= new Random();\n int num = r.nextInt(bound);\n return num;\n\n\n }", "public static void main(String[] args) {\n\r\n\t\tRandom rr=new Random();\r\n\t\t\r\n\t\tSystem.out.println(Math.random());//[0,1)\r\n\t\t \r\n\t\t// 第一种情况 int(强转之后最终的值一定是0)\r\n\t\t// 第二种情况 int(强转之后将小数点舍去 1-5)\r\n\t\tSystem.out.println((int)Math.random()*5);//0.99*5永远到不了5\r\n\t\tSystem.out.println((int)(Math.random()*5+1));//[1,5.)\r\n\t\t\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\t\r\n\t\tfor(int i=0;i<=20;i++){\r\n\t\t\tSystem.out.print(i%7+\"-\");\r\n\t\t\t\r\n\t\t}\r\n\t\t//1-M的随机产生\r\n\t\t//(int)(Math.random()*M+1)\r\n\t\t\r\n\t\t\r\n\t\t//产生0 1的概率不同 Math.random()<p?0:1\r\n\t\tSystem.out.println(\"----\"+rr.rand01p());\r\n\t\tSystem.out.println(\"----\"+rr.rand01());\r\n\t\tfor(int i=0;i<=11;i++){\r\n\t\t\tSystem.out.print(i%6+\"-\");\r\n\t\t \t\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(rr.rand106());\r\n\t}", "private String getRandomResponse() {\n\t\tfinal int NUMBER_OF_RESPONSES = 6;\n\t\tdouble r = Math.random();\n\t\tint whichResponse = (int) (r * NUMBER_OF_RESPONSES);\n\t\tString response = \"\";\n\n\t\tif (whichResponse == 0) {\n\t\t\tresponse = \"Interesting, tell me more.\";\n\t\t} else if (whichResponse == 1) {\n\t\t\tresponse = \"Hmmm.\";\n\t\t} else if (whichResponse == 2) {\n\t\t\tresponse = \"Do you really think so?\";\n\t\t} else if (whichResponse == 3) {\n\t\t\tresponse = \"You don't say.\";\n\t\t} else if(whichResponse == 4) {\n\t\t\tresponse = \"Well, that's right.\";\n\t\t} else if(whichResponse == 5) {\n\t\t\tresponse = \"Can we switch the topic?\";\n\t\t}\n\n\t\treturn response;\n\t}", "public int rand(int idT){\r\n Random r = new Random(); \r\n int Low = ((idT*2) + (idT-2));\r\n int High = idT*3;\r\n \r\n int R = r.nextInt ((High+1)-Low) + Low;\r\n System.out.print(\"Low :\"+Low+\",\"+\" high :\"+High+ \" \");\r\n return R;\r\n }" ]
[ "0.7531029", "0.71681273", "0.711703", "0.70891577", "0.6983312", "0.6954498", "0.69418466", "0.6917514", "0.68666375", "0.686495", "0.68413574", "0.6829387", "0.6802271", "0.67591554", "0.6754924", "0.6700273", "0.6689408", "0.66824883", "0.66626674", "0.66084313", "0.6597403", "0.65766823", "0.6539212", "0.6535503", "0.6515023", "0.6503579", "0.64938575", "0.64906543", "0.64868927", "0.6485152", "0.6478119", "0.6476813", "0.64630675", "0.64482605", "0.64348257", "0.6427268", "0.6423207", "0.6418249", "0.6411026", "0.64092475", "0.63972837", "0.6387136", "0.6387073", "0.6371018", "0.6358897", "0.6354616", "0.63459927", "0.6328857", "0.6308258", "0.6305531", "0.63031214", "0.62989056", "0.62768435", "0.62762123", "0.6270045", "0.6264052", "0.62623644", "0.62489027", "0.62378365", "0.62148744", "0.62147725", "0.62085897", "0.62068355", "0.6205417", "0.6200506", "0.6194675", "0.6190521", "0.6185936", "0.61794126", "0.617593", "0.6174315", "0.6167506", "0.6164108", "0.6163917", "0.6163424", "0.6152557", "0.6142281", "0.614222", "0.6137609", "0.61300045", "0.61210793", "0.6118859", "0.61179286", "0.61152905", "0.61139023", "0.61106515", "0.610455", "0.60957646", "0.6092905", "0.6089339", "0.608763", "0.6083797", "0.6083261", "0.60817856", "0.60809326", "0.60808057", "0.6079209", "0.6079124", "0.606995", "0.60690033" ]
0.61851954
68
Method that generates a random number to be used between 0100
public static int randomNumber100(){ int max = 100; int min = 0; int range = max-min+1; int randNum = (int)(Math.random()*range) + min; return randNum; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int randomNum() {\r\n\t return((int)(Math.random() * 100));\r\n\t }", "public static int randNum() {\r\n\t\tint rand = (int)(Math.random()*((100)+1)); // Num generated between [0, 100]\r\n\t\treturn rand;\r\n\t}", "public static int getRandomAmount(){\n return rand.nextInt(1000);\n }", "private int generateRandomNumber() {\n\t\treturn (int) Math.floor(Math.random() * Constants.RANDOM_NUMBER_GENERATOR_LIMIT);\n\t}", "public static int customRandom(int range)\n {\n \tint random = (int)(Math.random()*10)%range;\n\t\n\treturn random;\n }", "public static int randomNumber() {\n //Random rndNumbers = new Random();\n //for(int i = 0; i < 100; i++) {\n // int rndNumber = rndNumbers.nextInt();\n // System.out.println(rndNumber);\n int rand = (int) (Math.random() * 100);\n System.out.println(rand);\n if (rand > 50) {\n return rand;\n } else {\n System.out.println(\"-1\");\n }\n return rand;\n }", "private int generateRandomNumber() {\n\t\treturn new SplittableRandom().nextInt(0, 3);\n\t}", "public static int generateRandomNumber()\n\t{\n\t\tRandom r = new Random();\n\t\treturn r.nextInt();\n\t}", "public static int randomNumber(){\r\n int max = 10;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n return randNum;\r\n }", "public static int randomNext() { return 0; }", "public int getRandomPositiveInt(){\r\n long gen = (a*seed+c)%m;\r\n seed = gen;\r\n return (int)gen;\r\n }", "public static int randomNumber50(){\r\n int max = 50;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n return randNum;\r\n }", "int getRandom(int max);", "public static String generateRandomInteger() {\n SecureRandom random = new SecureRandom();\n int aStart = 1;\n long aEnd = 999999999;\n long range = aEnd - (long) aStart + 1;\n long fraction = (long) (range * random.nextDouble());\n long randomNumber = fraction + (long) aStart;\n return String.valueOf(randomNumber);\n }", "public static int getRandomNumber(){\n int random = 0; // set variable to 0\r\n random = (int)(Math.random()*10) + 1; //generate random number between 1 and 10\r\n return random; //return random number\r\n }", "public static int generateDigit() {\n\t\t\n\t\treturn (int)(Math.random() * 10);\n\t}", "public static int randomNumberAlg(){\r\n int max = 10;\r\n int min = 1;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n return randNum;\r\n }", "public static String randomNumberGenerator() {\r\n\t\tint max = 999999999; // e.g. 714053349 (9 digits)\r\n\t\tRandom rand = new Random();\r\n\t\tint min = 0;\r\n\t\tint randomNum = rand.nextInt(max - min + 1) + min;\r\n\t\treturn Integer.toString(randomNum);\r\n\t}", "private double getRandomNumber(){\n double rand = Math.random();//produce a number between 0 and 1\n rand = rand - 0.5;\n return rand;\n }", "public static int randomRound(){\r\n int max = 1000;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n return randNum;\r\n }", "private int randomHelper() {\n\t\tRandom rand = new Random();\n\t\tint randomNum = rand.nextInt((10000 - 1) + 1) + 1;\n\t\treturn randomNum;\n\t}", "public static int getRandomBalance(){\n return rand.nextInt(1000000);\n }", "public int randomNum()\r\n {\r\n Random rand = new Random();\r\n int n = rand.nextInt(52)+1;\r\n return n;\r\n }", "public static int getRandom() \n\t{\n\t\treturn rGenerator.nextInt();\n\t}", "public static Double randomDecimal(){\r\n int max = 1000;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n double randDec = (randNum/100.0);\r\n \r\n return randDec;\r\n \r\n }", "public int generateRandom() {\n\t\tint random = (int)(Math.random()*((6-1)+1))+1;\n\t\treturn random;\n\t}", "public double generateMoneyGoal() {\n\t\tdouble moneyGoal = Math.random()*(10000 -100)+100; \n\t\t\n\t\treturn moneyGoal;\n\t}", "public int getRandomsNumber(){\n Random random = new Random();\n int number = random.nextInt(12) + 1;\n return number;\n }", "public static int getRandom(int n){\n\t\treturn rg.nextInt(n); \n\t}", "private double generateRandomValue(int min, int max) {\n\t\tdouble number = (Math.random() * max * 100) / 100 + min;\n\t\treturn number;\n\t}", "public int randomGQ() {\n\t\treturn(getRandomInteger(10,100));\n\t}", "private int randomNumber(int high, int low){\n \t\t Random r = new Random();\n \t\t return (r.nextInt(high-low) + low);\n \t }", "public int randomNum() {\n\t\treturn 1 + (int) (Math.random() * 3); // randomNum = minimum + (int)(Math.random() * maximum);\n\t}", "private static int newNumber()\n\t{\n\t\tdouble initial = Math.random();\n\t\tdouble rangeAdjusted = initial * (10000 - 1001) + 1000;\n\t\tint rounded = (int)Math.round(rangeAdjusted);\n\t\treturn rounded;\n\t}", "public int randomNumber(int maxValue) {\n\t\tRandom rndNumbers = new Random();\n\t\tint rndNumber = 0;\n\t\trndNumber = rndNumbers.nextInt(maxValue);\n\t\treturn rndNumber;\n\n\t}", "private int randomGen(int upperBound) {\n\t\tRandom r = new Random();\n\t\treturn r.nextInt(upperBound);\n\t}", "public int compete() {\r\n\t\tint max = 20;\r\n\t\tint min = 10;\r\n\t\tRandom Rand = new Random();\r\n\t\tint ranNum = Rand.nextInt(max - min) + min;\r\n\t\treturn ranNum;\r\n\t}", "public static final BigInteger generateRandomNumber(BigInteger maxValue, Random random)\r\n\t{\r\n\t\tBigInteger testValue;\r\n\t\tdo{\r\n\t\t\ttestValue = new BigInteger(maxValue.bitLength(), random);\r\n\t\t}while(testValue.compareTo(maxValue) >= 0);\r\n\t\t\r\n\t\treturn testValue;\r\n\t}", "public static String randomNumberString() {\n\r\n Random random = new Random();\r\n int i = random.nextInt(999999);\r\n\r\n\r\n return String.format(\"%06d\", i);\r\n }", "public double getRandom() {\n return 20*Math.random() - 10;\n }", "private void setRand(){\n rand = generator.nextInt(9) + 1;\n }", "int RandomGenerator0To29 (){\n\t\t int randomInt2 = 0;\n\t\t Random randomGenerator2 = new Random();\n\t\t for (int idx2 = 1; idx2 <= 10; ++idx2) {\n\t\t\t randomInt2 = randomGenerator2.nextInt(30);\n\t\t }\n\t\t return randomInt2;\n\t }", "public static double randomNum(Random g)\n\t{\n\t\treturn -5+g.nextDouble()*10;\n\t}", "private int _randomCode () {\n Random random = new Random();\n code = random.nextInt(999999);\n return code;\n }", "int RandomGeneratorZeroToThree (){\n\t\t int randomInt = 0;\n\t\t Random randomGenerator = new Random();\n\t\t for (int idx = 1; idx <= 10; ++idx) {\n\t\t\t randomInt = randomGenerator.nextInt(4);\n\n\t\t }\n\t\t return randomInt;\n\t }", "int getRandom(int limit){\n Random rand = new Random();\n int upperBound = limit;\n return rand.nextInt(upperBound) + 1;\n }", "public static double random()\n {\n final int MAX_INT = 2147483647;\n int n = MAX_INT;\n \n // Just to ensure it does not return 1.0\n while(n == MAX_INT)\n \tn = abs (RAND.nextInt());\n \n return n * (1.0 / MAX_INT);\n }", "private static int getSecretNum(int arg1) {\n Random rand = new Random();\n return rand.nextInt(UPPERBOUND)+1; //make range 1-100\n }", "private int getRandomNumber(int limit) {\n\t\tlong seed = System.currentTimeMillis();\n\t\tRandom rand = new Random(seed);\n\t\treturn rand.nextInt(limit) + 1;\n\t}", "void setRandomNo() {\n\t\tno = 10000000 + (int) (Math.random() * 90000000);\n\t}", "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}", "private double randn(){\r\n\t\t//* http://www.mathworks.com/access/helpdesk/help/techdoc/matlab.html\r\n\t\t//RandomNumber rnd = new RandomNumber(System.currentTimeMillis());\r\n\t\t//return rnd.normal();\r\n\t\treturn rnd.nextGaussian();\r\n\t\t//return 0;\r\n\t}", "private int randomValue() {\r\n\t\tRandom rand = new Random();\r\n\t\tint val = rand.nextInt(10);\r\n\t\tif(val == 9)\r\n\t\t\treturn 4;\r\n\t\telse\r\n\t\t\treturn 2;\r\n\t}", "private void getRandomNumber() {\n\t\tRandom random = new Random();\n\t\tint randomCount = 255;\n\t\tint randNum = 0; \n\t\tfor(int i = 0; i < numberAmt; i++) {\n\t\t\trandNum = random.nextInt(randomCount);\n\t\t\tswitch (numberType) {\n\t\t\tcase 1:\n\t\t\t\trandomNumbers.add(Integer.toString(randNum));\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tif(randNum > 15)\n\t\t\t\t\trandomNumbers.add(String.format(\"%8s\", Integer.toBinaryString(randNum)).replace(\" \", \"0\"));\n\t\t\t\telse\n\t\t\t\t\trandomNumbers.add(String.format(\"%4s\", Integer.toBinaryString(randNum)).replace(\" \", \"0\"));\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\trandomNumbers.add(Integer.toHexString(randNum));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "static int getRandomDelta() {\n int d = rand.nextInt(100);\n if (d < 50) {\n return -1;\n } else {\n return 1;\n }\n }", "public String getRandomNumberString() {\n Random rnd = new Random();\n int number = rnd.nextInt(899999) + 100000;\n\n // this will convert any number sequence into 6 character.\n String formatted_code = String.format(\"%06d\", number);\n\n return formatted_code;\n }", "public int randInt(int min, int max) {\n Random rand = new Random();\n\n // nextInt is normally exclusive of the top value,\n // so add 1 to make it inclusive\n int randomNum = rand.nextInt((max - min) + 1) + min;\n\n return randomNum;\n}", "public static int randomGet() { return 0; }", "private int rand() {\n return (int)(Math.random()*(RAND_MAX + 1));\n }", "public static double random() {\r\n return uniform();\r\n }", "private void getRandomNumber() {\n\t\tRandom generator = new Random();\n\t\trandomNumber = generator.nextInt(POSSIBLE_CHOICE.length);\n\t}", "int random(int m)\n {\n return (int) (1 + Math.random()%m);\n }", "public static int RandomNumber(int min, int max){\n Random random = new Random();\n int randomNum = random.nextInt((max - min)+1)+min;\n return randomNum;\n }", "int randInt(int n) {\r\n return _randomSource.nextInt(n);\r\n }", "private double getRandom() {\n return 2*Math.random() - 1;\n }", "public static int getRandomInt()\n {\n return ThreadLocalRandom.current().nextInt(1000000000, 2147483647);\n }", "public int originalgetRandomPositiveInt(int min, int max){\r\n int number = getRandomPositiveInt(); \r\n return (int)number%(max - min + 1)+min;\r\n }", "public static int uniform(int N) {\r\n return random.nextInt(N);\r\n }", "private static int generateRandomNumber(int min, int max) {\n return (int)Math.floor(Math.random() * (max - min + 1)) + min;\n }", "@Override\n\tpublic double compete() {\n\t\tdouble result=MyTools.getRandomNum(500, 800);\n\t\tsetThisResult(result);\n\t\treturn result;\n\t}", "public static int randInt() {\n Random rand = new Random();\n\n // nextInt is normally exclusive of the top value,\n // so add 1 to make it inclusive\n int randomNum = rand.nextInt((20 - 10) + 1) + 10;\n\n return randomNum;\n }", "private int randomAge() {\n \tint low = 18;\n \tint high = 100;\n \tint offset = high - low;\n \tRandom r = new Random();\n \treturn r.nextInt(offset) + low;\n \t\n }", "public static String getRandomNumberString() {\n Random rnd = new Random();\n int number = rnd.nextInt(9999999);\n\n // this will convert any number sequence into 6 character.\n return String.format(\"%07d\", number);\n }", "public int RandomNegativeNumbers() {\n\t\tint result = 0;\n\t\tresult = rnd.nextInt(10) - 10;\n\t\treturn result;\n\t}", "private static int get() { \r\n Random r = new Random();\r\n return (r.nextInt(9));\r\n }", "int randInt(int n) {\n return _randomSource.nextInt(n);\n }", "public static int randomNumber(int start, int end) {\n long range = (long) end - (long) start + 1;\n // compute a fraction of the range, 0 <= frac < range\n long fraction = (long) (range * RANDOM.nextDouble());\n return (int) (fraction + start);\n }", "public static int getRand(int n) {\r\n return rand.nextInt(n);\r\n }", "@Override\n\tpublic double compete() {\n\t\tdouble result=MyTools.getRandomNum(10, 20); \t\n\t\tsetThisResult(result);\n\t\treturn result;\n\t}", "public static int getRandomNum() {\n\t\tRandom rand = new Random();\n\t\tint num = rand.nextInt(3)+1;\n\t\treturn num;\n\t}", "public int randomDP() {\n\t\treturn(getRandomInteger(10,250));\n\t}", "public static int genID(){\n Random rand = new Random();\n\n int theID = rand.nextInt(999)+1;\n\n return theID;\n\n }", "public void generateNewSecret() {\r\n \r\n //Get Random Number With Correct Digits\r\n int intRand = randomNumberGenerator.nextInt((int)(Math.pow(10, numDigits) - Math.pow(10, numDigits - 1))) + (int)Math.pow(10, numDigits - 1);\r\n \r\n //Set To String\r\n String strRand = String.valueOf(intRand);\r\n \r\n //Set Value\r\n secretNumber = convertNumToDigitArray(strRand);\r\n \r\n }", "private static int getRandomNumber(int min, int max) \n { //generates a random number within a range\n return (min + rand.nextInt((max - min) + 1));\n }", "public int randomGenerator(int min, int max) {\n int random = (int) ((Math.random()*((max-min)+1))+min);\n return random;\n }", "private static int newSecretNumber(int min, int max)\n {\n Random rnd = new Random();\n return rnd.nextInt((max + 1 - min) + min);\n }", "public static int randInt() {\n\t\tint min = 10;\n\t\tint max = 99999999;\n\t\tRandom rand = new Random();\n\t\tint randomNum = (rand.nextInt((max - min) + 1) + rand.nextInt((max - min) + 1)) / 2;\n\t\treturn randomNum;\n\t}", "private int generateWholoeNumInRange( int min, int max ) {\r\n\r\n // Evaluate random number from min to max including min and max\r\n return (int)(Math.random()*(max - min + 1) + min);\r\n\r\n }", "public int generateNumber(int difficulty) {\n Random generator = new Random();\n return 1 + generator.nextInt((int) Math.pow(10, difficulty));\n }", "public void newGame() {\n\t\ttheNumber = (int)(Math.random()* 100 + 1);\r\n\t\t\r\n\t}", "public int getRandom(int bound) {\n return ThreadLocalRandom.current().nextInt(bound);\n }", "private static String RandomCash() {\n\t\tint max = 0;\n\t\tint min = 100000;\n\t\tint range = max - min + 1;\n\t\t\n\t\tString text=null;\n\t\ttry {\n\t\t\t\n\t\t\tint random = (int) (Math.random() * (range) + min);\n\t\t\ttext = formatted(\"###,###\", random)+\" VNĐ\";\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn text;\n\t}", "private static int randInt(int max) {\n\t\tRandom rand = new Random(System.currentTimeMillis());\n\t\treturn rand.nextInt(max + 1);\n\t}", "int randomPoint() { return 1 + (int)Math.round((Math.random()*20) % (size - 2)); }", "private static int generateRandom(int min, int max) {\n // max - min + 1 will create a number in the range of min and max, including max. If you don´t want to include it, just delete the +1.\n // adding min to it will finally create the number in the range between min and max\n return r.nextInt(max-min+1) + min;\n }", "private static int addRandomScore() {\n Random ran = new Random();\n return ran.nextInt(201) + 400;\n }", "public int eDmg(){\r\n eDmg = rand.nextInt(13);\r\n return eDmg;\r\n }", "public void generateR(){\n\t\t\tdo{\n\t\t\t\tr = new BigInteger(80, new Random());\n\t\t\t}while(!(q.gcd(r).equals(BigInteger.ONE)&&r.compareTo(q)<0&&r.compareTo(BigInteger.ONE)>=0));\n\t}", "private Random rand()\n\t{\n\t\treturn new Random();\n\t}", "public int getRandomNumberInInterval() {\n\t\treturn getRandomNumberUsingNextInt(min, max);\n\t}" ]
[ "0.8048439", "0.7879681", "0.75369316", "0.7364873", "0.7362655", "0.73195887", "0.7308104", "0.72965384", "0.72097397", "0.71664816", "0.7127398", "0.7127089", "0.71267754", "0.71178114", "0.7109681", "0.7066092", "0.702046", "0.700472", "0.70000064", "0.69992673", "0.6998305", "0.6924366", "0.6910612", "0.69013035", "0.68502134", "0.68374985", "0.68320215", "0.6790602", "0.67793405", "0.67597365", "0.67555207", "0.67457795", "0.6710295", "0.6709385", "0.66961765", "0.6652052", "0.6647372", "0.6642123", "0.66299236", "0.66243565", "0.66218096", "0.661845", "0.6616777", "0.6609934", "0.6608473", "0.6592601", "0.6574643", "0.65727216", "0.65681773", "0.6565193", "0.65641576", "0.6553082", "0.6547174", "0.65471", "0.6542366", "0.6538703", "0.6521777", "0.6519416", "0.65132624", "0.6512939", "0.65070146", "0.64969814", "0.6492826", "0.64903164", "0.6474747", "0.64657205", "0.64597607", "0.64576507", "0.64436245", "0.6439904", "0.64387244", "0.6435078", "0.64315486", "0.6407868", "0.6404198", "0.64001006", "0.63937914", "0.6383177", "0.6379299", "0.6367714", "0.6367396", "0.6365484", "0.6364415", "0.636439", "0.6358522", "0.63582206", "0.634723", "0.63406974", "0.63309616", "0.63236964", "0.6313547", "0.63106203", "0.63008505", "0.6300731", "0.6300163", "0.62976664", "0.6290283", "0.62876445", "0.62803364", "0.62715715" ]
0.8246326
0
Method that generates a random number to be used between 050
public static int randomNumber50(){ int max = 50; int min = 0; int range = max-min+1; int randNum = (int)(Math.random()*range) + min; return randNum; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int getRandomAmount(){\n return rand.nextInt(1000);\n }", "private int randomNum() {\r\n\t return((int)(Math.random() * 100));\r\n\t }", "public static int randomNumber() {\n //Random rndNumbers = new Random();\n //for(int i = 0; i < 100; i++) {\n // int rndNumber = rndNumbers.nextInt();\n // System.out.println(rndNumber);\n int rand = (int) (Math.random() * 100);\n System.out.println(rand);\n if (rand > 50) {\n return rand;\n } else {\n System.out.println(\"-1\");\n }\n return rand;\n }", "public static int randomNumber100(){\r\n int max = 100;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n return randNum;\r\n }", "public static int randNum() {\r\n\t\tint rand = (int)(Math.random()*((100)+1)); // Num generated between [0, 100]\r\n\t\treturn rand;\r\n\t}", "int getRandom(int max);", "private double getRandomNumber(){\n double rand = Math.random();//produce a number between 0 and 1\n rand = rand - 0.5;\n return rand;\n }", "public int randomNum()\r\n {\r\n Random rand = new Random();\r\n int n = rand.nextInt(52)+1;\r\n return n;\r\n }", "public static int randomNext() { return 0; }", "public static int getRandomBalance(){\n return rand.nextInt(1000000);\n }", "private int generateRandomNumber() {\n\t\treturn (int) Math.floor(Math.random() * Constants.RANDOM_NUMBER_GENERATOR_LIMIT);\n\t}", "private int generateRandomNumber() {\n\t\treturn new SplittableRandom().nextInt(0, 3);\n\t}", "public static int randomRound(){\r\n int max = 1000;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n return randNum;\r\n }", "public static int randomNumber(){\r\n int max = 10;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n return randNum;\r\n }", "public int getRandomPositiveInt(){\r\n long gen = (a*seed+c)%m;\r\n seed = gen;\r\n return (int)gen;\r\n }", "public int randomGQ() {\n\t\treturn(getRandomInteger(10,100));\n\t}", "public double generateMoneyGoal() {\n\t\tdouble moneyGoal = Math.random()*(10000 -100)+100; \n\t\t\n\t\treturn moneyGoal;\n\t}", "public static int generateRandomNumber()\n\t{\n\t\tRandom r = new Random();\n\t\treturn r.nextInt();\n\t}", "public static int getRandomNumber(){\n int random = 0; // set variable to 0\r\n random = (int)(Math.random()*10) + 1; //generate random number between 1 and 10\r\n return random; //return random number\r\n }", "int RandomGenerator0To29 (){\n\t\t int randomInt2 = 0;\n\t\t Random randomGenerator2 = new Random();\n\t\t for (int idx2 = 1; idx2 <= 10; ++idx2) {\n\t\t\t randomInt2 = randomGenerator2.nextInt(30);\n\t\t }\n\t\t return randomInt2;\n\t }", "public double getRandom() {\n return 20*Math.random() - 10;\n }", "public static int customRandom(int range)\n {\n \tint random = (int)(Math.random()*10)%range;\n\t\n\treturn random;\n }", "public int generateRandom() {\n\t\tint random = (int)(Math.random()*((6-1)+1))+1;\n\t\treturn random;\n\t}", "static int getRandomDelta() {\n int d = rand.nextInt(100);\n if (d < 50) {\n return -1;\n } else {\n return 1;\n }\n }", "private int randomNumber(int high, int low){\n \t\t Random r = new Random();\n \t\t return (r.nextInt(high-low) + low);\n \t }", "public static double randomNum(Random g)\n\t{\n\t\treturn -5+g.nextDouble()*10;\n\t}", "public static int randomNumberAlg(){\r\n int max = 10;\r\n int min = 1;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n return randNum;\r\n }", "private int randomGen(int upperBound) {\n\t\tRandom r = new Random();\n\t\treturn r.nextInt(upperBound);\n\t}", "private double randn(){\r\n\t\t//* http://www.mathworks.com/access/helpdesk/help/techdoc/matlab.html\r\n\t\t//RandomNumber rnd = new RandomNumber(System.currentTimeMillis());\r\n\t\t//return rnd.normal();\r\n\t\treturn rnd.nextGaussian();\r\n\t\t//return 0;\r\n\t}", "public static String generateRandomInteger() {\n SecureRandom random = new SecureRandom();\n int aStart = 1;\n long aEnd = 999999999;\n long range = aEnd - (long) aStart + 1;\n long fraction = (long) (range * random.nextDouble());\n long randomNumber = fraction + (long) aStart;\n return String.valueOf(randomNumber);\n }", "public static int getRandom() \n\t{\n\t\treturn rGenerator.nextInt();\n\t}", "public int randomDP() {\n\t\treturn(getRandomInteger(10,250));\n\t}", "@Override\n\tpublic double compete() {\n\t\tdouble result=MyTools.getRandomNum(500, 800);\n\t\tsetThisResult(result);\n\t\treturn result;\n\t}", "public int getRandomsNumber(){\n Random random = new Random();\n int number = random.nextInt(12) + 1;\n return number;\n }", "private int randomHelper() {\n\t\tRandom rand = new Random();\n\t\tint randomNum = rand.nextInt((10000 - 1) + 1) + 1;\n\t\treturn randomNum;\n\t}", "private int rand() {\n return (int)(Math.random()*(RAND_MAX + 1));\n }", "public int randomNumber(int maxValue) {\n\t\tRandom rndNumbers = new Random();\n\t\tint rndNumber = 0;\n\t\trndNumber = rndNumbers.nextInt(maxValue);\n\t\treturn rndNumber;\n\n\t}", "private void setRand(){\n rand = generator.nextInt(9) + 1;\n }", "private static int newNumber()\n\t{\n\t\tdouble initial = Math.random();\n\t\tdouble rangeAdjusted = initial * (10000 - 1001) + 1000;\n\t\tint rounded = (int)Math.round(rangeAdjusted);\n\t\treturn rounded;\n\t}", "Boolean getRandomize();", "public static double random() {\r\n return uniform();\r\n }", "private int randomValue() {\r\n\t\tRandom rand = new Random();\r\n\t\tint val = rand.nextInt(10);\r\n\t\tif(val == 9)\r\n\t\t\treturn 4;\r\n\t\telse\r\n\t\t\treturn 2;\r\n\t}", "public static void numRand() {\n System.out.println(\"Please enter a random number between 1 and 50? \");\n int randNum = sc.nextInt(); \n }", "int getRandom(int limit){\n Random rand = new Random();\n int upperBound = limit;\n return rand.nextInt(upperBound) + 1;\n }", "int RandomGeneratorZeroToThree (){\n\t\t int randomInt = 0;\n\t\t Random randomGenerator = new Random();\n\t\t for (int idx = 1; idx <= 10; ++idx) {\n\t\t\t randomInt = randomGenerator.nextInt(4);\n\n\t\t }\n\t\t return randomInt;\n\t }", "public int randomNum() {\n\t\treturn 1 + (int) (Math.random() * 3); // randomNum = minimum + (int)(Math.random() * maximum);\n\t}", "public int compete() {\r\n\t\tint max = 20;\r\n\t\tint min = 10;\r\n\t\tRandom Rand = new Random();\r\n\t\tint ranNum = Rand.nextInt(max - min) + min;\r\n\t\treturn ranNum;\r\n\t}", "@Override\n public int orinar() {\n\n return (int) (Math.random() * 400) + 400;\n }", "public static String randomNumberGenerator() {\r\n\t\tint max = 999999999; // e.g. 714053349 (9 digits)\r\n\t\tRandom rand = new Random();\r\n\t\tint min = 0;\r\n\t\tint randomNum = rand.nextInt(max - min + 1) + min;\r\n\t\treturn Integer.toString(randomNum);\r\n\t}", "public static int getRandom(int n){\n\t\treturn rg.nextInt(n); \n\t}", "private void getRandomNumber() {\n\t\tRandom generator = new Random();\n\t\trandomNumber = generator.nextInt(POSSIBLE_CHOICE.length);\n\t}", "int randomPoint() { return 1 + (int)Math.round((Math.random()*20) % (size - 2)); }", "private double getRandom() {\n return 2*Math.random() - 1;\n }", "public static int uniform(int N) {\r\n return random.nextInt(N);\r\n }", "int random(int m)\n {\n return (int) (1 + Math.random()%m);\n }", "public static int generateDigit() {\n\t\t\n\t\treturn (int)(Math.random() * 10);\n\t}", "private int getRandomNumber(int limit) {\n\t\tlong seed = System.currentTimeMillis();\n\t\tRandom rand = new Random(seed);\n\t\treturn rand.nextInt(limit) + 1;\n\t}", "@Override\n\tpublic double compete() {\n\t\tdouble result=MyTools.getRandomNum(10, 20); \t\n\t\tsetThisResult(result);\n\t\treturn result;\n\t}", "private int randomAge() {\n \tint low = 18;\n \tint high = 100;\n \tint offset = high - low;\n \tRandom r = new Random();\n \treturn r.nextInt(offset) + low;\n \t\n }", "private double generateRandomValue(int min, int max) {\n\t\tdouble number = (Math.random() * max * 100) / 100 + min;\n\t\treturn number;\n\t}", "private static int getSecretNum(int arg1) {\n Random rand = new Random();\n return rand.nextInt(UPPERBOUND)+1; //make range 1-100\n }", "private void getRandomNumber() {\n\t\tRandom random = new Random();\n\t\tint randomCount = 255;\n\t\tint randNum = 0; \n\t\tfor(int i = 0; i < numberAmt; i++) {\n\t\t\trandNum = random.nextInt(randomCount);\n\t\t\tswitch (numberType) {\n\t\t\tcase 1:\n\t\t\t\trandomNumbers.add(Integer.toString(randNum));\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tif(randNum > 15)\n\t\t\t\t\trandomNumbers.add(String.format(\"%8s\", Integer.toBinaryString(randNum)).replace(\" \", \"0\"));\n\t\t\t\telse\n\t\t\t\t\trandomNumbers.add(String.format(\"%4s\", Integer.toBinaryString(randNum)).replace(\" \", \"0\"));\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\trandomNumbers.add(Integer.toHexString(randNum));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public int eDmg(){\r\n eDmg = rand.nextInt(13);\r\n return eDmg;\r\n }", "public static int randomGet() { return 0; }", "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}", "private int _randomCode () {\n Random random = new Random();\n code = random.nextInt(999999);\n return code;\n }", "public static int randInt() {\n Random rand = new Random();\n\n // nextInt is normally exclusive of the top value,\n // so add 1 to make it inclusive\n int randomNum = rand.nextInt((20 - 10) + 1) + 10;\n\n return randomNum;\n }", "int randInt(int n) {\r\n return _randomSource.nextInt(n);\r\n }", "public String getRandomNumberString() {\n Random rnd = new Random();\n int number = rnd.nextInt(899999) + 100000;\n\n // this will convert any number sequence into 6 character.\n String formatted_code = String.format(\"%06d\", number);\n\n return formatted_code;\n }", "private static int randInt(int max) {\n\t\tRandom rand = new Random(System.currentTimeMillis());\n\t\treturn rand.nextInt(max + 1);\n\t}", "public int getRandomInt(int upper) {\n int retVal = myRandom.nextInt() % upper;\n if (retVal < 0) {\n retVal += upper;\n }\n return (retVal);\n }", "public void newGame() {\n\t\ttheNumber = (int)(Math.random()* 100 + 1);\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n Random r=new Random();\n int values[] = new int [50];\n\n\n for(int i=0;i< values.length;i++) {\n values[i] = r.nextInt(400);\n\n System.out.println(values[i]);\n }\n\n }", "public int originalgetRandomPositiveInt(int min, int max){\r\n int number = getRandomPositiveInt(); \r\n return (int)number%(max - min + 1)+min;\r\n }", "public static Double randomDecimal(){\r\n int max = 1000;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n double randDec = (randNum/100.0);\r\n \r\n return randDec;\r\n \r\n }", "public static double random()\n {\n final int MAX_INT = 2147483647;\n int n = MAX_INT;\n \n // Just to ensure it does not return 1.0\n while(n == MAX_INT)\n \tn = abs (RAND.nextInt());\n \n return n * (1.0 / MAX_INT);\n }", "private int getRandomNumberInRange(int min, int max) {\r\n\r\n\t\tRandom r = new Random();\r\n\t\treturn ((r.nextInt(max - min) + 1) + min)*40;\r\n\t}", "private static int addRandomScore() {\n Random ran = new Random();\n return ran.nextInt(201) + 400;\n }", "private int rand(int lower, int higher) {\n\t\treturn lower + (int) ((higher - lower + 1) * Math.random());\n\t\t\n\t}", "public static final BigInteger generateRandomNumber(BigInteger maxValue, Random random)\r\n\t{\r\n\t\tBigInteger testValue;\r\n\t\tdo{\r\n\t\t\ttestValue = new BigInteger(maxValue.bitLength(), random);\r\n\t\t}while(testValue.compareTo(maxValue) >= 0);\r\n\t\t\r\n\t\treturn testValue;\r\n\t}", "private int randomWeight()\n {\n return dice.nextInt(1000000);\n }", "private static String RandomCash() {\n\t\tint max = 0;\n\t\tint min = 100000;\n\t\tint range = max - min + 1;\n\t\t\n\t\tString text=null;\n\t\ttry {\n\t\t\t\n\t\t\tint random = (int) (Math.random() * (range) + min);\n\t\t\ttext = formatted(\"###,###\", random)+\" VNĐ\";\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn text;\n\t}", "private static int newSecretNumber(int min, int max)\n {\n Random rnd = new Random();\n return rnd.nextInt((max + 1 - min) + min);\n }", "@Test\n public void genRandom() {\n runAndWait(() -> genRandom(10_000, 500, 1), 32, 2000);\n runAndWait(() -> genRandom(10_000, 500, 100), 32, 2000);\n runAndWait(() -> genRandom(250_000, 4000, 50), 4, 5_000);\n }", "int randInt(int n) {\n return _randomSource.nextInt(n);\n }", "public void generateNewSecret() {\r\n \r\n //Get Random Number With Correct Digits\r\n int intRand = randomNumberGenerator.nextInt((int)(Math.pow(10, numDigits) - Math.pow(10, numDigits - 1))) + (int)Math.pow(10, numDigits - 1);\r\n \r\n //Set To String\r\n String strRand = String.valueOf(intRand);\r\n \r\n //Set Value\r\n secretNumber = convertNumToDigitArray(strRand);\r\n \r\n }", "public void randomNumberTest() {\n //Generating streams of random numbers\n Random random = new Random();\n random.ints(5)//(long streamSize, double randomNumberOrigin, double randomNumberBound)\n .sorted()\n .forEach(System.out::println);\n /*\n -1622707470\n -452508309\n 1346762415\n 1456878623\n 1783692417\n */\n }", "private int rand(int lower, int upper) {\n return lower + (int)(Math.random() * ((upper - lower) + 1));\n }", "public static String randomNumberString() {\n\r\n Random random = new Random();\r\n int i = random.nextInt(999999);\r\n\r\n\r\n return String.format(\"%06d\", i);\r\n }", "private Integer randomBilirrubina(){\n\t\t\tint Min = 0, Max = 14;\n\t\t\treturn Min + (int)(Math.random() * ((Max - Min) + 1));\n\t\t}", "private static int getRandomNumberOfRooms(){\r\n return r.nextInt(50)+1;\r\n }", "public static int randomizer(final int maxValue) {\n\t\treturn (int) (Math.random() * (maxValue));\n\t}", "public static int uniform( int N ) {\n return random.nextInt( N + 1 );\n }", "public static int random(int max) {\r\n\t\treturn random(0, max);\r\n\t}", "private static int get() { \r\n Random r = new Random();\r\n return (r.nextInt(9));\r\n }", "private int newSpeed() {\n //makes a random speed for the ball in (-50,-15)U(15,50)\n int n = r.nextInt(71) - 35;\n if (n < 0) {\n n = n - 15;\n } else {\n n = n + 15;\n }\n return n;\n }", "public static int RandomNumber(int min, int max){\n Random random = new Random();\n int randomNum = random.nextInt((max - min)+1)+min;\n return randomNum;\n }", "private float genX(float x) {\r\n return (_rand.nextFloat() * 40) - 20;\r\n }", "float genChance();", "void setRandomNo() {\n\t\tno = 10000000 + (int) (Math.random() * 90000000);\n\t}" ]
[ "0.7616795", "0.7606977", "0.7486603", "0.7422411", "0.73265487", "0.7224322", "0.71614534", "0.7145097", "0.7107325", "0.71044946", "0.708763", "0.7012995", "0.6964976", "0.69480443", "0.69338024", "0.6900959", "0.68944526", "0.688725", "0.68820447", "0.6867565", "0.6853905", "0.6849868", "0.68222165", "0.68156976", "0.6770953", "0.6749106", "0.67464954", "0.6739856", "0.6696887", "0.66881716", "0.6686072", "0.6678795", "0.6658266", "0.6643537", "0.6620697", "0.6604616", "0.6600373", "0.6593922", "0.65863925", "0.6586085", "0.65708643", "0.6566412", "0.6560978", "0.6555738", "0.65555364", "0.65540034", "0.65361017", "0.65351367", "0.65142035", "0.6509721", "0.6498533", "0.64979875", "0.6481963", "0.6481032", "0.6475785", "0.6475156", "0.6472859", "0.64723104", "0.6466493", "0.64603204", "0.6442032", "0.6412018", "0.6411815", "0.63986397", "0.6393469", "0.63898474", "0.6375917", "0.63538945", "0.6352133", "0.6336984", "0.63247705", "0.6320077", "0.6318917", "0.63128805", "0.63067454", "0.63047", "0.63015264", "0.62984675", "0.62900954", "0.62882936", "0.628245", "0.6266988", "0.6266352", "0.62654114", "0.6259208", "0.6255431", "0.62518835", "0.6245108", "0.62434614", "0.6240958", "0.6239132", "0.62333685", "0.6232991", "0.62309754", "0.6230756", "0.622583", "0.62218434", "0.6218176", "0.6211887", "0.62037456" ]
0.80709684
0
Method that calculates the highest common factor between two integers
public static int HCF(int a, int b){ int x, i, hcf = 0; for(i = 1; i<=a || i<=b; i++){ if(a%i == 0 && b%i == 0){ hcf = i; }} //System.out.print(hcf); return hcf; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int greatestCommonFactor(ArrayList<Integer> num1, ArrayList<Integer> num2)\n {\n //create an ArrayList to hold common factors\n ArrayList<Integer> commonFactors = new ArrayList<Integer>();\n int greatestFactor = 0;\n for(Integer i : num1)\n {\n if(num2.contains(i))\n {\n commonFactors.add(i);\n }\n }\n\n //find the greatest factor by looping through each element in the commonFactors list\n for(Integer a : commonFactors)\n {\n if(a > greatestFactor)\n {\n greatestFactor = a;\n }\n }\n return greatestFactor;\n }", "public static int findGCF(int a, int b) {\r\n\t\tint GCF = 1;\r\n\t\tfor (int i = 1; i <= Math.abs(a); i++) {\r\n\t\t\t// loop to find greatest common factor\r\n\t\t\tif (((a % i) == 0) && ((b % i) == 0)) {\r\n\t\t\t\tGCF = i;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn GCF;\r\n\t}", "static int lcm(int num1, int num2, int hcf){\n return (num1*num2)/hcf;\n }", "public static int lowestCommonFactor(int a, int b)\n\t{\n\t\treturn (a * b) / greatestCommonFactor(a, b);\n\t}", "public int getGreatestCommonDivisor(int first, int second) {\n\t\t// TODO Write an implementation for this method declaration\n\t\tint GCD = 0;\n\t\tboolean found = false;\n\t\tArrayList<Integer> firstDivisor = new ArrayList<Integer>();\n\t\tArrayList<Integer> secondDivisor = new ArrayList<Integer>();\n\t\tif(first < 10 || second < 10) {\n\t\t\tGCD = -1;\n\t\t}\n\t\telse {\n\t\t\tfor(int i = 1; i <= first; i++) {\n\t\t\t\tif(first % i == 0) {\n\t\t\t\t\tfirstDivisor.add(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 1; i <= second; i++) {\n\t\t\t\tif(second % i ==0) {\n\t\t\t\t\tsecondDivisor.add(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n//\t\t\tfor(Integer i: firstDivisor) {\n//\t\t\t\tSystem.out.println(i);\n//\t\t\t}\n//\t\t\tfor(Integer i: secondDivisor) {\n//\t\t\t\tSystem.out.println(i);\n//\t\t\t}\n\t\t\t\n\t\t\tif(firstDivisor.size() >= secondDivisor.size()) {\n\t\t\t\tGCD = firstDivisor.get(0);\n\t\t\t\tfor(int i =0; i < firstDivisor.size(); i++) {\n\t\t\t\t\tfor(int j =0; j < secondDivisor.size(); j++) {\n\t\t\t\t\t\tif(secondDivisor.get(j)==firstDivisor.get(i)) {\n\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(found == true) {\n\t\t\t\t\t\tif(firstDivisor.get(i) >= GCD) {\n\t\t\t\t\t\t\tGCD = firstDivisor.get(i);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfound = false;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(secondDivisor.size() >= firstDivisor.size()) {\n\t\t\t\tGCD = secondDivisor.get(0);\n\t\t\t\tfor(int i =0; i < secondDivisor.size(); i++) {\n\t\t\t\t\tfor(int j =0; j < firstDivisor.size(); j++) {\n\t\t\t\t\t\tif(firstDivisor.get(j)==secondDivisor.get(i)) {\n\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(found == true) {\n\t\t\t\t\t\tif(secondDivisor.get(i) >= GCD) {\n\t\t\t\t\t\t\tGCD = secondDivisor.get(i);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfound = false;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t\n\t\t}\n\t\t//System.out.println(GCD);\n\t\treturn GCD;\n\t}", "private static int greatestCommonDivisor(int alpha, int beta){\n\n\t\talpha = Math.abs(alpha); // take absolute values of operands\n\t\tbeta = Math.abs(beta);\n\t\n\t\tif (beta == 0) // base case\n\t \treturn alpha;\n\t\telse{ // induction step\n\t\t\tint remainder = alpha % beta;\n\t\t\n\t\t\treturn greatestCommonDivisor(beta, remainder);\n\t }\n }", "public static int greatestCommonDivisor(int inputOne, int inputTwo)\n {\n inputOne = Math.abs(inputOne);\t\t\n inputTwo = Math.abs(inputTwo);\t\t\n \t\t\n int smaller = Math.min(inputOne, inputTwo);\t\t\n int greatestCommonDivisor = 1;\n \t\t\n for (int index = 1; index <= smaller; index++)\t\n \tif ((inputOne % index) == 0 && (inputTwo % index) == 0)\n \t\tgreatestCommonDivisor = index;\n return greatestCommonDivisor;\t\t\n }", "public static int gcf(int num1, int num2) {\r\n\t\tint maxNumber = max(num1, num2);\r\n\t\tint minNumber = min(num1, num2);\r\n\t\tif (minNumber == 0) \r\n\t\t\treturn maxNumber;\r\n\t\tif (minNumber < 0)\r\n\t\t\tminNumber *= -1;\r\n\t\tSystem.out.println(maxNumber + \" \" + minNumber);\r\n\t\tfor (int i = minNumber; i > 0; i--) {\r\n\t\t\tboolean a = isDivisibleBy(maxNumber, i);\r\n\t\t\tboolean b = isDivisibleBy(minNumber, i);\r\n\t\t\tif (a == true && b == true) {\r\n\t\t\t\treturn i;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn 1;\r\n\t}", "static private long lcm(long x, long y) {\n\t\tif (x != 0 && y != 0) {\n\t\t\tlong firstValue = x;\n\t\t\tlong secondValue = y;\n\t\t\treturn (firstValue * secondValue) / hcf(x, y);\n\t\t} else\n\t\t\treturn 1;\n\n\t}", "static int hcf(int num1, int num2){\n int i = 1;\n int hcf = 0;\n\n while(i<=num1 || i<=num2){\n if (num1%i == 0 && num2%i==0){\n hcf = i;\n }\n i++;\n }\n return hcf;\n }", "private static int gcd (int a, int b) {\n int m = Math.max (Math.abs (a), Math.abs (b));\n if (m == 0) throw new ArithmeticException (\" zero in gcd \");\n int n = Math.min (Math.abs (a), Math.abs (b));\n while (n > 0) {\n a = m % n;\n m = n;\n n = a;\n }\n return m;\n }", "public static int gcd(int a, int b){\r\n return a>b ? lnko_ordered(a,b) : lnko_ordered(b,a);\r\n }", "public static int LCM(int a, int b){\r\n int lowest = a * b / GCD(a,b);\r\n //System.out.print(lowest);\r\n return lowest;\r\n }", "public static int gcf(int [] operand) {\r\n \t\tint count = 1;\r\n \t\tint factor = 1;\r\n \t\twhile (count <= Math.min(Math.abs(operand[0]), operand[1])) { \r\n \t\t\t//Java had sign problems here if the numerator was negative\r\n \t\t\tif (Math.abs(operand[0]%count) == 0 && Math.abs(operand[1]%count) ==0) {\r\n \t\t\t\tfactor = count; \r\n \t\t\t}\r\n \t\t\tcount++;\r\n \t\t}\r\n \t\treturn (factor);\r\n \t}", "static long lcm(long a, long b) \n\t\t{ \n\t\t\treturn (a*b)/gcd(a, b); \n\t\t}", "public static int lcm(int a, int b) {\r\n\t\treturn a * (b / gcd(a, b));\r\n\t}", "public int gcd(){\n\tint min;\n\tint max;\n\tint stor;\n\tif ((numerator == 0) || (denominator == 0)){\n\t return 0;\n\t}\n\telse {\n\t if ( numerator >= denominator ) {\n\t\tmax = numerator;\n\t\tmin = denominator;\n\t }\n\t else {\n\t\tmax = denominator;\n\t\tmin = numerator;\n\t }\n\t while (min != 0){\n\t stor = min;\n\t\tmin = max % min;\n\t\tmax = stor;\n\t }\n\t return max;\n\t}\n }", "public static int greatestCommonFactor(int m, int n)\n\t{\n\t\tif(n == 0)\n\t\t{\n\t\t\treturn m;\n\t\t}\n\t\t\n\t\treturn greatestCommonFactor(n, m%n);\n\t\t\n\t}", "public static int gcf(int num, int denom) {\n \tint number=1;\t//declare num to equal 1\t\r\n\t\tif(denom<0) { //if denom is negative, multiply by -1 to get a positive denom\r\n\t\t\tdenom *= -1;\r\n\t\t}\r\n\t\tif(num<0) {\t//if the num is negative multiply it by -1 to make it positive\r\n\t\t\tnum *= -1;\r\n\t\t}\r\n\t\tfor(int i = 1; i <= num && i <= denom; i++) {\t//make a for loop that will test to see if i <=x&y (iterate to lowest # possible) to find the gcd\r\n\t\t\tif (isDivisibleBy(num,i) == true && isDivisibleBy(denom,i)==true) { \t// add 1 to i each loop; uses the method to check if i is factor of both integers\r\n\t\t\t\tnumber = i;\t//make num equal to i\r\n\t\t\t}\t\r\n\t\t}\r\n\t\treturn number; //return the number\r\n\t}", "private RunGreatestCommonDivisor() {\r\n\t}", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int a = sc.nextInt();\n int b = sc.nextInt();\n int gcd = 1, lcm = 1;\n int temp = a;\n int temp2 = b;\n // int fact = 1;\n if (a > b) {\n\n for (int i = a; i < a * b;i+=a) {\n if ( i % b == 0) {\n lcm = i;\n break;\n // System.out.println(lcm);\n } \n }\n } else {\n for (int i = b; i < a * b; i+=b) {\n if ( i%a == 0) {\n lcm = i;\n break;\n // System.out.println(lcm);\n } \n }\n\n }\n gcd = (a * b) / lcm;\n System.out.println(gcd);\n System.out.println(lcm);\n }", "public Integer mostCommon() {\n Integer common = list.get(0);\n int commonCount = countOccurrence(common);\n\n for(Integer currentNumber : list) {\n int currentCount = countOccurrence(currentNumber);\n if (currentCount > commonCount) {\n common = currentNumber;\n commonCount = currentCount;\n }\n }\n\n\n return common;\n }", "public void reduce(){\r\n int num = numerator;\r\n int denom = denominator;\r\n int greatest;\r\n \r\n // Find the greater of numerator and denominator\r\n if(numerator < 0){\r\n num = -numerator;\r\n }\r\n if(num > denom){\r\n greatest = num;\r\n }\r\n else\r\n greatest = denom;\r\n \r\n // Find the GCD\r\n int gcd = 0;\r\n // starting from the largest\r\n for(int i = greatest; i > 1; i--){\r\n if((numerator % i == 0) && (denominator % i == 0)){\r\n gcd = i;\r\n break;\r\n }\r\n }\r\n // factor out the gcd in both the numerator and denominator\r\n if(gcd != 0){\r\n numerator /= gcd;\r\n denominator /= gcd;\r\n }\r\n }", "public static int gcd(int a, int b) {\n return BigInteger.valueOf(a).gcd(BigInteger.valueOf(b)).intValue();\n }", "static int gcd(int a, int b) {\r\n\t\tif (b == 0)\r\n\t\t\treturn a;\r\n\t\treturn gcd(b, a % b);\r\n\t}", "static long getGCD(long x, long y) {\n long a = Math.max(x, y);\n long b = Math.min(x, y);\n\n while (b != 0) {\n long r = a % b;\n a = b;\n b = r;\n }\n\n return a;\n }", "private int gcd(int a, int b){\r\n int r, temp;\r\n if( a<b ){ temp = a; a = b; b = temp; }\r\n while( b!=0 ){ r = a%b; a = b; b = r; }\r\n return a;\r\n }", "public static int findGCD(int int1, int int2) {\n\t\tint gcd = 1;\n\t\t\n\t\tfor (int i = 2; i <= int1 && i <= int2; i++) {\n\t\t\tif (int1 % i == 0 && int2 % i == 0)\n\t\t\t\tgcd = i;\n\t\t}\n\t\t\n\t\treturn gcd;\n\t}", "private static int findLCM(int a, int b) {\n return a * (b / findGCD(a, b));\n }", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n System.out.print(\"Enter num1: \");\n int num1 = sc.nextInt();\n System.out.print(\"Enter num2: \");\n int num2 = sc.nextInt();\n\n int hcf = hcf(num1, num2);\n int lcm = lcm(num1, num2, hcf);\n\n System.out.println(\"the lcm is: \" + lcm);\n\n }", "private static int gcd(int n1,int n2){\n int a = n1>n2?n1:n2;\r\n int b = n1>n2?n2:n1;\r\n int r = a%b;\r\n while(r!=0){\r\n a = b;\r\n b = r;\r\n r = a%b;\r\n }\r\n return b;\r\n }", "private static int gcd(int a, int b)\r\n\t{\r\n\t\tint remainder = a % b;\r\n\t\tif(remainder == 0)\r\n\t\t{\r\n\t\t\treturn b;\r\n\t\t}\r\n\t\treturn gcd(b, remainder);\r\n\t}", "@Test\r\n\tpublic void testGreatestCommonDivisorCalculation() {\r\n\r\n\t\tGreatestCommonDivisor testGcd = new GreatestCommonDivisor();\r\n\t\tint testGcdOne = testGcd.greatestCommonDivisorCalculation(21, 180);\r\n\t\tint testGcdTwo = testGcd.greatestCommonDivisorCalculation(5, 10);\r\n\t\tint testGcdTree = testGcd.greatestCommonDivisorCalculation(37, 77);\r\n\t\tint testGcdFour = testGcd.greatestCommonDivisorCalculation(30, 77);\r\n\r\n\t\tAssert.assertEquals(3, testGcdOne);\r\n\t\tAssert.assertEquals(5, testGcdTwo);\r\n\t\tAssert.assertEquals(1, testGcdTree);\r\n\t\tAssert.assertNotEquals(4, testGcdFour);\r\n\t}", "private static int calculateLCM(int a, int b){\n\t\tint gcd = calculateGCD(a, b);\n\t\tint lcm = (a/gcd)*b; //same as a*b/gcd but a*b could be very large number so avoiding that\n\t\treturn lcm;\n\t}", "int gcd(int x,int y)\n\t{\n\t\tif(x>0 && y>0)\n\t\t{\n\t\t\twhile(x!=y)\n\t\t\t{\n\t\t\t\tif(x>y) //If number1>number2\n\t\t\t\t\treturn(gcd(x-y,y)); \n\t\t\t\telse //If number2>number1 \n\t\t\t\t\treturn(gcd(y-x,x));\n\t\t\t}\n\t\t\treturn x; //Return final calculated GCD\n\t\t}\n\t\telse\n\t\t\treturn -1; //If user input is a negative number\n\t}", "private static int gcd(int a, int b) {\n\t\tif(a==0){\n\t\t\treturn b;\n\t\t}\n\t\treturn gcd(b%a,a);\n\t}", "private static Integer mostCommonElement(List<Integer> list) {\n HashMap<Integer, Integer> map = new HashMap<Integer, Integer>();\n for(int i=0; i< list.size(); i++) {\n Integer frequency = map.get(list.get(i));\n\n if(frequency == null) {\n map.put(list.get(i), 1);\n } else {\n map.put(list.get(i), frequency+1);\n }\n }\n int mostCommonKey = 0;\n int maxValue = -1;\n for(HashMap.Entry<Integer, Integer> entry: map.entrySet()) {\n if(entry.getValue() > maxValue) {\n mostCommonKey = entry.getKey();\n maxValue = entry.getValue();\n }\n }\n\n return mostCommonKey;\n }", "public static int gcd(int a, int b) {\n int t = 0;\n while (b != 0) {\n t = b;\n b = a % b;\n a = t;\n }\n return Math.abs(a);\n }", "private int majority(int x, int y, int z){\n return (x & y) | (x & z) | (y & z);\n }", "private int gcd(int x, int y) {\n if (y == 0) {\n return x;\n }\n return gcd(y, x % y);\n }", "private int gcd(int a, int b) {\n // Note that the loop below, as-is, will time out on negative inputs.\n // The gcd should always be a positive number.\n // Add code here to pre-process the inputs so this doesn't happen.\n if ( a < 0 ) {\n a = - a;\n }\n if ( b < 0 ) {\n b = - b;\n }\n\n \twhile (a != b)\n \t if (a > b)\n \t\t a = a - b;\n \t else\n \t\t b = b - a;\n \treturn a;\n }", "static long gcd(long a, long b) {\n\t\ta = Math.abs(a); b = Math.abs(b);\n\t\tif(a < b) return gcd(b,a);\n\t\tif(b == 0) return a;\n\t\treturn gcd(a%b, b);\n\t}", "public int findMax(int num1, int num2) {\n return 0;\n }", "public static int gcd(int a, int b){\n int tmp = a;\r\n a = Math.max(a,b);\r\n b = Math.min(tmp,b);\r\n \r\n //write GCD\r\n int remainder;\r\n do{\r\n remainder = a%b;\r\n a = b;\r\n b = remainder;\r\n } while(remainder !=0);\r\n \r\n return a;\r\n }", "private BigInteger lcm(BigInteger input1, BigInteger input2) {\n return input1.multiply(input2).divide(input1.gcd(input2));\n }", "private static int findGcd(int a, int b) {\n\n\t\tint low = a < b ? a : b;\n\t\tint high = a < b ? b : a;\n\n\t\tif (high % low == 0) {\n\t\t\treturn low;\n\t\t} else {\n\t\t\treturn findGcd(high, high % low);\n\t\t}\n\t}", "public static int gcd(int n1, int n2) {\n BigInteger n1_big = BigInteger.valueOf(n1);\n BigInteger n2_big = BigInteger.valueOf(n2);\n return n1_big.gcd(n2_big).intValue();\n }", "int gcd(int a, int b) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\t int x,y,r=1;\r\n\t\t if(a<b)\r\n\t\t {\r\n\t\t\t x = b;\r\n\t\t\t y = a;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\t x = a;\r\n\t\t\t y = b;\r\n\t\t }\r\n\t\t while(r!=0)\r\n\t\t {\r\n\t\t r = x%y;\r\n\t\t if(r==0)\r\n\t\t\t break;\r\n\t\t x = y;\r\n\t\t y = r;\r\n\t\t }\r\n\t\t// System.out.println(\"====\"+y);\r\n\t\treturn y;\r\n\t}", "public static int gcd(int a, int b) {\r\n\t\twhile(b > 0) {\r\n\t\t\tint temp = b;\r\n\t\t\tb = a % b;\r\n\t\t\ta = temp;\r\n\t\t}\r\n\t\t\r\n\t\treturn a;\r\n\t}", "static int greatestDenominator(int a, int b) {\n int denominator = 0;\n\n // Loops from 0 to max(a, b) to test denominators\n for (int i = 1; i < Math.max(a, b); i++) {\n if (a % i == 0 && b % i == 0) {\n denominator = i;\n }\n }\n\n return denominator;\n }", "private static int pair_GCF(int a, int b) {\n int t;\n while (b != 0) {\n t = a;\n a = b;\n b = t % b;\n }\n return a;\n }", "private int getGCD(int a, int b) {\n \n /** This ensures the larger of the two numbers is in a */\n if(a < b){\n /** Temp variable used for swapping two variables */\n int temp = a;\n a = b;\n b = temp;\n }\n\n /** The remainder needs to be stored to recursively find the gcd */\n int remainder;\n if((remainder = a % b) == 0) {\n return b;\n } else {\n return getGCD(b, remainder);\n }\n }", "public int gcd(int x, int y) {\n if (x < y) return gcd(y, x);\n return y == 0 ? x : gcd(y, x % y);\n }", "BigInteger getMax_freq();", "static int findGreatestValue(int x, int y) {\r\n\t\t\r\n\t\tif(x>y)\r\n\t\t\treturn x;\r\n\t\telse\r\n\t\t return y;\r\n\t}", "public int gcd(int a, int b) {\n\t\tint result;\n\t\tif (a > 0) {\n\t\t\tresult = gcd(b % a, a);\n\t\t} else {\n\t\t\tresult = b;\n\t\t}\n\n\t\treturn result;\n\t}", "public int compare(Integer a,Integer b)\n\t{\n\t\treturn a%2-b%2;\n\t}", "private static long gcd(long n, long d) {\n\t long n1 = Math.abs(n);\n\t long n2 = Math.abs(d);\n\t int gcd = 1;\n\t \n\t for (int k = 1; k <= n1 && k <= n2; k++) {\n\t if (n1 % k == 0 && n2 % k == 0) \n\t gcd = k;\n\t }\n\n\t return gcd;\n\t }", "public static int findCandiate(int a[]) {\r\n\t\tint max_index = 0;\r\n\t\tint count = 1;\r\n\t\tfor(int i = 1; i < a.length; ++i){\r\n\t\t\tif(a[i] == a[max_index]){\r\n\t\t\t\tcount++;\r\n\t\t\t} else {\r\n\t\t\t\tcount--;\r\n\t\t\t}\r\n\t\t\tif(count == 0){\r\n\t\t\t\tmax_index = i;\r\n\t\t\t\tcount = 1;\r\n\t\t\t}\r\n\t\t}\t\r\n\t\treturn max_index;\r\n\t}", "public int gcd(int a, int b) {\n // write your code here\n if (b != 0) {\n return gcd(b, a % b);\n }\n else\n return a;\n }", "public static BigInteger lcm(String a, String b) \n\t\t{\n\t\t\tBigInteger s = new BigInteger(a); \n\t\t\tBigInteger s1 = new BigInteger(b); \n\n\t\t\t// calculate multiplication of two bigintegers \n\t\t\tBigInteger mul = s.multiply(s1); \n\n\t\t\t// calculate gcd of two bigintegers \n\t\t\tBigInteger gcd = s.gcd(s1); \n\n\t\t\t// calculate lcm using formula: lcm * gcd = x * y \n\t\t\tBigInteger lcm = mul.divide(gcd); \n\t\t\treturn lcm; \n\t\t}", "public static int gcd(int a, int b) {\n\t\t// take absolute values\n\t\tif (a < 0) {\n\t\t\ta *= -1;\n\t\t}\n\t\tif (b < 0) {\n\t\t\tb *= -1;\n\t\t}\n\n\t\t// ensure a > b\n\t\tif (a < b) {\n\t\t\tint temp = a;\n\t\t\ta = b;\n\t\t\tb = temp;\n\t\t}\n\t\t// a = b * (a / b) + (a % b)\n\t\t// then b = (a % b) * ((a % b) / b) + (a % b) % b\n\t\t// by the division algorithm. Execute until some\n\t\t// such product has no remainder, the remainder of\n\t\t// the previous equation is GCD(a, b).\n\t\twhile (b > 0) {\n\t\t\tint temp = b;\n\t\t\tb = a % b;\n\t\t\ta = temp;\n\t\t}\n\t\treturn a;\n\t}", "int max(int a, int b);", "private static BigInteger comprime(BigInteger input) {\n \t\n \t//krenemo od dva\n BigInteger candidate = BigInteger.valueOf(2);\n while (true) {\n \t\n \t//kada nadjemo odgovarajuci vratimo ga\n if (input.gcd(candidate).equals(BigInteger.ONE)) {\n return candidate;\n }\n candidate = candidate.add(BigInteger.ONE);\n }\n }", "public static int findCommon4(int[] in1, int[] in2) {\r\n\t\tint common = 0;\r\n\t\t//mlogn\r\n\t\tArrays.sort(in1);\r\n\t\t//nlogn\r\n\t\tArrays.sort(in2);\r\n\t\t//m+n-1 (as one element will remain uncompared in the end)\r\n\t\tint i=0,j=0;\r\n\t\twhile (i < in1.length && j < in2.length) {\r\n\t\t\tif (in1[i] == in2[j]) {\r\n\t\t\t\t++common;\r\n\t\t\t\t++i;\r\n\t\t\t\t++j;\r\n\t\t\t} else if (in1[i] < in2[j]) {\r\n\t\t\t\t++i;\r\n\t\t\t} else {\r\n\t\t\t\t++j;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn common;\r\n\t}", "public static void main(String[] args) {\n\r\n\t\tlong ln= 6008514751431L;\r\n\t\tint max=0;\r\n\t\tfor (int i=2; i<= ln;i++)\r\n\t\t\twhile (ln % i == 0)\r\n\t\t\t{\r\n\t\t\t\tif(i>max)\r\n\t\t\t\tmax=i;\r\n\t\t\t\tln/=i;\r\n\t\t\t}\t\r\n\t\tSystem.out.println(\"the greatest prime factor of the given number is :\"+max);\r\n\t\t}", "static int combination(int num1,int num2){\n\t return (fact(num1)/(fact(num2)*fact(num1-num2)));\n\t}", "public static int findCommon1(int[] in1, int[] in2) {\r\n\t\tint common = 0;\r\n\t\t//n*m Comparisions\r\n\t\tfor (int i = 0; i < in1.length; i++) {\r\n\t\t\tfor (int j = 0; j < in2.length; j++) {\r\n\t\t\t\tif(in1[i] == in2[j]) {\r\n\t\t\t\t\t++common;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn common;\r\n\t}", "private int getGCD(int a, int b) {\r\n if ( b == 0 ) {\r\n return a;\r\n } else {\r\n return getGCD(b, a % b);\r\n }\r\n }", "static int comb(int big, int smal) \n\t{ \n\t\treturn (int) ((long) fact[big] * invfact[smal] % mod \n\t\t\t\t* invfact[big - smal] % mod); \n\t}", "private long largestPrimeFactor(long number)\n\t{\n\t\tfor(int i = 2; i<=number; i++)\n\t\t{\n\t\t\tif(number % i == 0 && number > i)\n\t\t\t{\n\t\t\t\twhile(number % i == 0)\n\t\t\t\t{\n\t\t\t\t\tnumber = number / i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(i >= number)\n\t\t\t\treturn i;\n\t\t}\n\t\treturn 0;\n\t}", "public int getHighestChromID();", "public int best(){\n List<Integer> points = count();\n Integer max = 0;\n for (Integer p: points){\n if (p <= 21 && max < p){\n max = p;\n }\n }\n return max;\n }", "public static int GCD(int a, int b){\r\n if (b == 0){\r\n return a;\r\n }\r\n return GCD(b,a%b);\r\n }", "private int findGCD(int n1, int n2) {\n //n1 and n2 must always be positive for this GCD algorithm\n n1 = Math.abs(n1);\n n2 = Math.abs(n2);\n\n //continue through the loop if n2 is greater than 0\n while (n2 > 0) {\n int remainder = n1 % n2;\n //n1 will keep track of the GCD value\n n1 = n2;\n //n2 will keep track of the remainder\n n2 = remainder;\n }\n //setting n1 is the gcd value\n return n1;\n }", "private static @Nullable Integer commonMax(List<ArgumentCount> counts) {\n // max=5, max=3, max=0 -> max=5\n // max=5, max=3, max=0, max=null -> max=null\n int commonMax = Integer.MIN_VALUE;\n for (ArgumentCount count : counts) {\n final Optional<Integer> max = count.getMaxCount();\n if (!max.isPresent()) {\n return null;\n }\n commonMax = Math.max(commonMax, max.get());\n }\n if (commonMax == Integer.MIN_VALUE) {\n return null;\n }\n return commonMax;\n }", "private static int findGCD(int number1, int number2) {\r\n\t\t// base case\r\n\t\tif (number2 == 0) {\r\n\t\t\treturn number1;\r\n\t\t}\r\n\t\treturn findGCD(number2, number1 % number2);\r\n\t}", "public static int findCommon2(int[] in1, int[] in2) {\r\n\t\tint common = 0;\r\n\t\t//iterate through the shorter array and do a binary search for every element of short array in big array\r\n\t\tif (in2.length > in1.length) {\r\n\t\t\tfindCommon2(in2, in1);\r\n\t\t}\r\n\t\t//nlogn\r\n\t\tArrays.sort(in2);\r\n\t\t//mlogn\r\n\t\tfor (int i = 0; i < in1.length; i++) {\r\n\t\t\tif(Arrays.binarySearch(in2, in1[i]) > 0) {\r\n\t\t\t\t++common;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn common;\r\n\t}", "public static int max() {\r\n\r\n\t\tint[] arr1 = ArrayMethods.get5();\r\n\t\tint[] arr2 = ArrayMethods.get5();\r\n\r\n\t\tint sum1 = 0;\r\n\t\tint sum2 = 0;\r\n\r\n\t\tint max = 0;\r\n\r\n\t\tfor (int num : arr1) {\r\n\t\t\tsum1 += num;\r\n\t\t}\r\n\t\tfor (int num : arr2) {\r\n\t\t\tsum2 += num;\r\n\t\t}\r\n\r\n\t\tif (sum1 > sum2) {\r\n\r\n\t\t\tmax = sum1;\r\n\r\n\t\t} else if (sum1 == sum2) {\r\n\r\n\t\t\tmax = sum1;\r\n\r\n\t\t} else {\r\n\r\n\t\t\tmax = sum2;\r\n\t\t}\r\n\t\treturn max;\r\n\t}", "public int majorityElement2(int[] nums) {\n Arrays.sort(nums);\n return nums[nums.length/2];\n }", "public static int findCommon3(int[] in1, int[] in2) {\r\n\t\tint common = 0;\r\n\t\tHashSet<Integer> hSet = new HashSet<Integer>();\r\n\t\t\r\n\t\t//Check the smaller array and insert into Hashset\r\n\t\tif (in1.length > in2.length) {\r\n\t\t\tfindCommon3(in2, in1);\r\n\t\t}\r\n\t\t//m*c --> insert\r\n\t\tfor (int i = 0; i < in1.length; i++) {\r\n\t\t\thSet.add(in1[i]);\r\n\t\t}\r\n\t\t//n*c --> retrive\r\n\t\tfor (int i = 0; i < in2.length; i++) {\r\n\t\t\tif (hSet.contains(in2[i])) {\r\n\t\t\t\t++common;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn common;\r\n\t}", "public int GetMaxVal();", "public static int GCF(int... ints) {\n int gcd = pair_GCF(ints[0], ints[1]);\n for (int i = 2, n = ints.length; i < n; i++) {\n gcd = pair_GCF(ints[2], gcd);\n }\n return gcd;\n }", "public int majorityNumber(List<Integer> nums, int k) {\n HashMap<Integer, Integer> hash = \n new HashMap();\n double size = (double) nums.size();\n for(int i =0; i<nums.size(); i++) {\n if(hash.containsKey(nums.get(i) )) {\n hash.put(nums.get(i), hash.get(nums.get(i)) + 1);\n }\n else{\n hash.put(nums.get(i), 1);\n }\n if(hash.get(nums.get(i)) > size /(double)k){\n return nums.get(i);\n }\n }\n \n \n return -1;\n \n }", "private int largestPowerOf2(int n) { \n\t\tint res = 2;\n\t\twhile (res < n) {\n\t\t\tint rem = res;\n\t\t\tres = (int) Math.pow(res, 2);\n\t\t\tif (res > n)\n\t\t\t\treturn rem;\n\t\t}\n\t\treturn res;\n\t}", "public static int largestMultipleOfXLeqY(int x, int y) {\n\treturn (y / x) * x;\n }", "public int selectionFunctionBiggestCoin(MyList<Integer> candidates){\n\n\t\t//-----------------------------\n\t\t//Output Variable --> InitialValue\n\t\t//-----------------------------\n\t\tint res = -1;\n\n\t\t//-----------------------------\n\t\t//SET OF OPS\n\t\t//-----------------------------\n\t\tint maxWeight = Integer.MIN_VALUE;\n\t\tint index = candidates.length() - 1;\n\n\n\t\twhile (index >= 0) {\n\t\t\t// OP1.1. Auxiliary variables:\n\t\t\t// We use 'e0' to compute the first item of 'candidate' just once.\n\t\t\tint e0 = candidates.getElement(index);\n\n\t\t\t// OP1.1. If a not previously considered item improves minWeight, we\n\t\t\t// update 'res' and 'minWeight'\n\t\t\tif (e0 > maxWeight) {\n\t\t\t\tres = index;\n\t\t\t\tmaxWeight = e0;\n\t\t\t}\n\n\t\t\t// OP1.2. We decrease 'index' so as to try the previous item of\n\t\t\t// 'candidates'\n\t\t\tindex--;\n\t\t}\n\n\t\t//-----------------------------\n\t\t//Output Variable --> Return FinalValue\n\t\t//-----------------------------\t\t\n\t\treturn res;\t\t\n\t}", "public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n int a, b;\n\n System.out.println(\"Please input two integers.\");\n a = input.nextInt();\n b = input.nextInt();\n\n System.out.println(\"Greatest common denominator is: \");\n System.out.println(greatestDenominator(a, b));\n\n }", "int max();", "public int majorityElement(int[] nums) {\n int half = nums.length / 2;\n Map<Integer, Integer> numCountMap = new HashMap<>();\n for (int i = 0; i < nums.length; i++) {\n boolean b = numCountMap.containsKey(nums[i]);\n if (b) {\n Integer count = numCountMap.get(nums[i]);\n numCountMap.put(nums[i], count + 1);\n } else {\n numCountMap.put(nums[i], 1);\n }\n }\n for (Map.Entry<Integer, Integer> entry : numCountMap.entrySet()) {\n if (entry.getValue() > half) {\n return entry.getKey();\n }\n }\n return 1;\n }", "public static int majorityIn2N(int[] a)\n {\n int i=0;\n //case1: check if the array is like this: 1, 1, 2, 3, 4, 1...\n //this case is the opposite one to the second one\n for(; i<a.length-1; i++)\n {\n if(a[i]==a[i+1])\n return a[i];\n }\n //case2: if we get here, the array must be like 1, 3, 1, 4, 1, 5\n for(i=0; i<a.length-2; i++)\n {\n if(a[i]==a[i+2])\n return a[i];\n }\n return Integer.MIN_VALUE;\n }", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int l = sc.nextInt();\n int r = sc.nextInt();\n int max = 0;\n for(int i=l;i<=r;i++){\n for(int j=l;j<=r;j++){\n int res = i^j;\n if(res>max){\n max = res;\n }\n }\n }\n System.out.println(max);\n }", "int getMax();", "int getMaximum();", "public int getOptimalNumNearest();", "public static int findLCM(int num1, int num2) {\n\t\t// return lcm of two numbers\n\t\treturn lcm(num1, num2, 2);\n\t}", "Integer getMaximumResults();", "@Test\n\tpublic void gcdOfFiboNumsTest() {\n\n\t\tAssert.assertTrue(ifn.gcdOfFiboNums(3, 12) == 2);\n\t}", "public List<Integer> majorityElement(int[] nums) {\n List<Integer> result = new ArrayList<>();\n if (nums == null || nums.length == 0) {\n return result;\n }\n int count1 = 0;\n int count2 = 0;\n int candidate1 = 0;\n int candidate2 = 1;\n for (int num : nums) {\n if (num == candidate1) {\n count1++;\n } else if (num == candidate2) {\n count2++;\n } else if (count1 == 0) {\n candidate1 = num;\n count1 = 1;\n } else if (count2 == 0) {\n candidate2 = num;\n count2 = 1;\n } else {\n count1--;\n count2--;\n }\n }\n count1 = 0;\n count2 = 0;\n for (int num : nums) {\n if (num == candidate1) {\n count1++;\n } else if (num == candidate2) {\n count2++;\n }\n }\n if (count1 > nums.length / 3) {\n result.add(candidate1);\n }\n if (count2 > nums.length / 3) {\n result.add(candidate2);\n }\n return result;\n }", "static int lcmhelp(int j,int k, int n) {\n\t\tif ((n % j == 0) && (n % k == 0)) {\t\t\n\t\t\treturn n; // n is the lowest number\n\t\t}\n\t\telse \n\t\t\treturn lcmhelp(j,k,n+1); // try again with the next-largest number\n\t}" ]
[ "0.7453595", "0.7282699", "0.70738965", "0.685008", "0.6798704", "0.67498255", "0.67274255", "0.6644003", "0.6576344", "0.6558682", "0.65374297", "0.651723", "0.64941907", "0.6470692", "0.63923955", "0.63708234", "0.63535404", "0.63028723", "0.62757665", "0.6272185", "0.6262393", "0.62160677", "0.621595", "0.62104803", "0.6208187", "0.6198565", "0.6180842", "0.61703855", "0.6144163", "0.6111522", "0.611051", "0.609777", "0.60893506", "0.6082605", "0.6080515", "0.6076706", "0.6057863", "0.60485584", "0.6031964", "0.6016486", "0.60152656", "0.600145", "0.59971", "0.5995448", "0.59836024", "0.5969028", "0.59617364", "0.59528995", "0.59439826", "0.59265494", "0.58911145", "0.58813924", "0.5857791", "0.58532995", "0.58517957", "0.5833822", "0.5832816", "0.58303666", "0.5829396", "0.5824953", "0.58097464", "0.5805624", "0.5790855", "0.5789119", "0.57890314", "0.57867676", "0.5755377", "0.57521296", "0.5751526", "0.57452834", "0.56947464", "0.568236", "0.56755507", "0.566503", "0.56636995", "0.5631976", "0.56290495", "0.5628175", "0.562371", "0.5623546", "0.56178707", "0.55981404", "0.5592003", "0.5587929", "0.558547", "0.5585269", "0.5583644", "0.5578314", "0.5578259", "0.55636334", "0.55594057", "0.55556524", "0.55498993", "0.5548944", "0.55441713", "0.55363065", "0.5536199", "0.55283606", "0.5527878", "0.5527342" ]
0.62848824
18
Method that calculates the lowest common multiple between two integers
public static int LCM(int a, int b){ int lowest = a * b / GCD(a,b); //System.out.print(lowest); return lowest; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int lowestCommonFactor(int a, int b)\n\t{\n\t\treturn (a * b) / greatestCommonFactor(a, b);\n\t}", "static int lcm(int num1, int num2, int hcf){\n return (num1*num2)/hcf;\n }", "static long lcm(long a, long b) \n\t\t{ \n\t\t\treturn (a*b)/gcd(a, b); \n\t\t}", "static private long lcm(long x, long y) {\n\t\tif (x != 0 && y != 0) {\n\t\t\tlong firstValue = x;\n\t\t\tlong secondValue = y;\n\t\t\treturn (firstValue * secondValue) / hcf(x, y);\n\t\t} else\n\t\t\treturn 1;\n\n\t}", "public static int lcm(int a, int b) {\r\n\t\treturn a * (b / gcd(a, b));\r\n\t}", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int a = sc.nextInt();\n int b = sc.nextInt();\n int gcd = 1, lcm = 1;\n int temp = a;\n int temp2 = b;\n // int fact = 1;\n if (a > b) {\n\n for (int i = a; i < a * b;i+=a) {\n if ( i % b == 0) {\n lcm = i;\n break;\n // System.out.println(lcm);\n } \n }\n } else {\n for (int i = b; i < a * b; i+=b) {\n if ( i%a == 0) {\n lcm = i;\n break;\n // System.out.println(lcm);\n } \n }\n\n }\n gcd = (a * b) / lcm;\n System.out.println(gcd);\n System.out.println(lcm);\n }", "@ApiOperation(\"Find the Least Common Multiple\")\n @GetMapping(value = UrlPath.URL_LCM, produces = {MediaType.APPLICATION_JSON_VALUE})\n public int getLeastCommonMultiple(@PathVariable int number1, @PathVariable int number2) {\n return commonNumberService.computeLeastCommonMultiple(number1, number2);\n }", "private static int calculateLCM(int a, int b){\n\t\tint gcd = calculateGCD(a, b);\n\t\tint lcm = (a/gcd)*b; //same as a*b/gcd but a*b could be very large number so avoiding that\n\t\treturn lcm;\n\t}", "private BigInteger lcm(BigInteger input1, BigInteger input2) {\n return input1.multiply(input2).divide(input1.gcd(input2));\n }", "public static int gcd(int a, int b){\r\n return a>b ? lnko_ordered(a,b) : lnko_ordered(b,a);\r\n }", "private static int gcd (int a, int b) {\n int m = Math.max (Math.abs (a), Math.abs (b));\n if (m == 0) throw new ArithmeticException (\" zero in gcd \");\n int n = Math.min (Math.abs (a), Math.abs (b));\n while (n > 0) {\n a = m % n;\n m = n;\n n = a;\n }\n return m;\n }", "public static int gcf(int num1, int num2) {\r\n\t\tint maxNumber = max(num1, num2);\r\n\t\tint minNumber = min(num1, num2);\r\n\t\tif (minNumber == 0) \r\n\t\t\treturn maxNumber;\r\n\t\tif (minNumber < 0)\r\n\t\t\tminNumber *= -1;\r\n\t\tSystem.out.println(maxNumber + \" \" + minNumber);\r\n\t\tfor (int i = minNumber; i > 0; i--) {\r\n\t\t\tboolean a = isDivisibleBy(maxNumber, i);\r\n\t\t\tboolean b = isDivisibleBy(minNumber, i);\r\n\t\t\tif (a == true && b == true) {\r\n\t\t\t\treturn i;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn 1;\r\n\t}", "public static int greatestCommonDivisor(int inputOne, int inputTwo)\n {\n inputOne = Math.abs(inputOne);\t\t\n inputTwo = Math.abs(inputTwo);\t\t\n \t\t\n int smaller = Math.min(inputOne, inputTwo);\t\t\n int greatestCommonDivisor = 1;\n \t\t\n for (int index = 1; index <= smaller; index++)\t\n \tif ((inputOne % index) == 0 && (inputTwo % index) == 0)\n \t\tgreatestCommonDivisor = index;\n return greatestCommonDivisor;\t\t\n }", "public static int findSmallestMultiple(int dividend, int divisor)\n {\n float temp = ((float) dividend / (float) divisor) + (float) 0.5;\n return Math.round(temp) * divisor;\n\n }", "@Test\n\tpublic void intersection() {\n\n\t\tlong n = 105;\n\t\tlong m = 100;\n\t\tfor(long i = n - 1; i > 1; i--){\n\t\t\tn = n * i;\n\t\t\tfor(long j = getZero(n); j > 0; j--){\n\t\t\t\tm = m * 10;\n\t\t\t}\n\t\t\tn = n % m;\n\t\t\tm = 100;\n\n\t\t\tSystem.out.println(n+\" \"+i);\n\n\t\t}\n\n\n\n\n\n\t}", "private static int findLCM(int a, int b) {\n return a * (b / findGCD(a, b));\n }", "public int getGreatestCommonDivisor(int first, int second) {\n\t\t// TODO Write an implementation for this method declaration\n\t\tint GCD = 0;\n\t\tboolean found = false;\n\t\tArrayList<Integer> firstDivisor = new ArrayList<Integer>();\n\t\tArrayList<Integer> secondDivisor = new ArrayList<Integer>();\n\t\tif(first < 10 || second < 10) {\n\t\t\tGCD = -1;\n\t\t}\n\t\telse {\n\t\t\tfor(int i = 1; i <= first; i++) {\n\t\t\t\tif(first % i == 0) {\n\t\t\t\t\tfirstDivisor.add(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 1; i <= second; i++) {\n\t\t\t\tif(second % i ==0) {\n\t\t\t\t\tsecondDivisor.add(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n//\t\t\tfor(Integer i: firstDivisor) {\n//\t\t\t\tSystem.out.println(i);\n//\t\t\t}\n//\t\t\tfor(Integer i: secondDivisor) {\n//\t\t\t\tSystem.out.println(i);\n//\t\t\t}\n\t\t\t\n\t\t\tif(firstDivisor.size() >= secondDivisor.size()) {\n\t\t\t\tGCD = firstDivisor.get(0);\n\t\t\t\tfor(int i =0; i < firstDivisor.size(); i++) {\n\t\t\t\t\tfor(int j =0; j < secondDivisor.size(); j++) {\n\t\t\t\t\t\tif(secondDivisor.get(j)==firstDivisor.get(i)) {\n\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(found == true) {\n\t\t\t\t\t\tif(firstDivisor.get(i) >= GCD) {\n\t\t\t\t\t\t\tGCD = firstDivisor.get(i);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfound = false;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(secondDivisor.size() >= firstDivisor.size()) {\n\t\t\t\tGCD = secondDivisor.get(0);\n\t\t\t\tfor(int i =0; i < secondDivisor.size(); i++) {\n\t\t\t\t\tfor(int j =0; j < firstDivisor.size(); j++) {\n\t\t\t\t\t\tif(firstDivisor.get(j)==secondDivisor.get(i)) {\n\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(found == true) {\n\t\t\t\t\t\tif(secondDivisor.get(i) >= GCD) {\n\t\t\t\t\t\t\tGCD = secondDivisor.get(i);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfound = false;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t\n\t\t}\n\t\t//System.out.println(GCD);\n\t\treturn GCD;\n\t}", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n System.out.print(\"Enter num1: \");\n int num1 = sc.nextInt();\n System.out.print(\"Enter num2: \");\n int num2 = sc.nextInt();\n\n int hcf = hcf(num1, num2);\n int lcm = lcm(num1, num2, hcf);\n\n System.out.println(\"the lcm is: \" + lcm);\n\n }", "static int gcd(int a, int b) {\r\n\t\tif (b == 0)\r\n\t\t\treturn a;\r\n\t\treturn gcd(b, a % b);\r\n\t}", "private int gcd(int a, int b){\r\n int r, temp;\r\n if( a<b ){ temp = a; a = b; b = temp; }\r\n while( b!=0 ){ r = a%b; a = b; b = r; }\r\n return a;\r\n }", "static long gcd(long a, long b) {\n\t\ta = Math.abs(a); b = Math.abs(b);\n\t\tif(a < b) return gcd(b,a);\n\t\tif(b == 0) return a;\n\t\treturn gcd(a%b, b);\n\t}", "private static int gcd(int a, int b)\r\n\t{\r\n\t\tint remainder = a % b;\r\n\t\tif(remainder == 0)\r\n\t\t{\r\n\t\t\treturn b;\r\n\t\t}\r\n\t\treturn gcd(b, remainder);\r\n\t}", "static int hcf(int num1, int num2){\n int i = 1;\n int hcf = 0;\n\n while(i<=num1 || i<=num2){\n if (num1%i == 0 && num2%i==0){\n hcf = i;\n }\n i++;\n }\n return hcf;\n }", "static int min(int a, int b) {\n return Math.min(a, b);\n }", "public static void calcIntegersDivBy()\r\n\t{\r\n\t\tint x = 5;\r\n\t\tint y = 20;\r\n\t\tint p = 3;\r\n\t\tint result = 0;\r\n\t\tif (x % p == 0)\r\n\t\t\tresult = (y / p - x / p + 1);\r\n\t\telse\r\n\t\t\tresult = (y / p - x / p);\r\n\t\tSystem.out.println(result);\r\n\t}", "private static int gcd(int a, int b) {\n\t\tif(a==0){\n\t\t\treturn b;\n\t\t}\n\t\treturn gcd(b%a,a);\n\t}", "java.math.BigDecimal getMultipleBetMinimum();", "private static int minimum(int a, int b, int c)\n {\n return Math.min(a, Math.min(b,c));\n }", "private int gcd(int x, int y) {\n if (y == 0) {\n return x;\n }\n return gcd(y, x % y);\n }", "public static BigInteger lcm(String a, String b) \n\t\t{\n\t\t\tBigInteger s = new BigInteger(a); \n\t\t\tBigInteger s1 = new BigInteger(b); \n\n\t\t\t// calculate multiplication of two bigintegers \n\t\t\tBigInteger mul = s.multiply(s1); \n\n\t\t\t// calculate gcd of two bigintegers \n\t\t\tBigInteger gcd = s.gcd(s1); \n\n\t\t\t// calculate lcm using formula: lcm * gcd = x * y \n\t\t\tBigInteger lcm = mul.divide(gcd); \n\t\t\treturn lcm; \n\t\t}", "public static int gcd(int a, int b) {\n return BigInteger.valueOf(a).gcd(BigInteger.valueOf(b)).intValue();\n }", "public static int findGCF(int a, int b) {\r\n\t\tint GCF = 1;\r\n\t\tfor (int i = 1; i <= Math.abs(a); i++) {\r\n\t\t\t// loop to find greatest common factor\r\n\t\t\tif (((a % i) == 0) && ((b % i) == 0)) {\r\n\t\t\t\tGCF = i;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn GCF;\r\n\t}", "public int gcd(){\n\tint min;\n\tint max;\n\tint stor;\n\tif ((numerator == 0) || (denominator == 0)){\n\t return 0;\n\t}\n\telse {\n\t if ( numerator >= denominator ) {\n\t\tmax = numerator;\n\t\tmin = denominator;\n\t }\n\t else {\n\t\tmax = denominator;\n\t\tmin = numerator;\n\t }\n\t while (min != 0){\n\t stor = min;\n\t\tmin = max % min;\n\t\tmax = stor;\n\t }\n\t return max;\n\t}\n }", "public static int getTotalX(List<Integer> a, List<Integer> b) {\n\t List<Integer> num=new ArrayList<>();\n\t for(int ind=a.get(a.size()-1);ind<=b.get(0);ind++){\n\t int count=0;\n\t for(int ind1=0;ind1<a.size();ind1++){\n\t if(ind%a.get(ind1)==0){\n\t count++;\n\t }else{\n\t break;\n\t }\n\t }if(count==a.size()){\n\t num.add(ind);\n\t }\n\t }\n\t for(int ind=0;ind<num.size();ind++){\n\t for(int ind1=0;ind1<b.size();ind1++){\n\t if(b.get(ind1)%num.get(ind)!=0){\n\t num.remove(ind);\n\t break;\n\t }\n\t }\n\t }\n\t System.out.println(num);\n\t return num.size();\n\n\t }", "public static int gcd(int a, int b) {\r\n\t\twhile(b > 0) {\r\n\t\t\tint temp = b;\r\n\t\t\tb = a % b;\r\n\t\t\ta = temp;\r\n\t\t}\r\n\t\t\r\n\t\treturn a;\r\n\t}", "public static int gcd(int a, int b) {\n int t = 0;\n while (b != 0) {\n t = b;\n b = a % b;\n a = t;\n }\n return Math.abs(a);\n }", "public static int gcf(int [] operand) {\r\n \t\tint count = 1;\r\n \t\tint factor = 1;\r\n \t\twhile (count <= Math.min(Math.abs(operand[0]), operand[1])) { \r\n \t\t\t//Java had sign problems here if the numerator was negative\r\n \t\t\tif (Math.abs(operand[0]%count) == 0 && Math.abs(operand[1]%count) ==0) {\r\n \t\t\t\tfactor = count; \r\n \t\t\t}\r\n \t\t\tcount++;\r\n \t\t}\r\n \t\treturn (factor);\r\n \t}", "static long getGCD(long x, long y) {\n long a = Math.max(x, y);\n long b = Math.min(x, y);\n\n while (b != 0) {\n long r = a % b;\n a = b;\n b = r;\n }\n\n return a;\n }", "private int gcd(int a, int b) {\n // Note that the loop below, as-is, will time out on negative inputs.\n // The gcd should always be a positive number.\n // Add code here to pre-process the inputs so this doesn't happen.\n if ( a < 0 ) {\n a = - a;\n }\n if ( b < 0 ) {\n b = - b;\n }\n\n \twhile (a != b)\n \t if (a > b)\n \t\t a = a - b;\n \t else\n \t\t b = b - a;\n \treturn a;\n }", "static int getTotalX(int[] aryA, int[] aryB){\n int maxA = getMax(aryA);\n int minA = getMin(aryA);\n int maxB = getMax(aryB);\n int minB = getMin(aryB);\n // identify the range of values we need to check\n int min = Math.max(minA, maxA);\n int max = Math.min(minB, maxB);\n int nBetweenAB = 0; // the number of integers \"between\" set A and B\n\n boolean allA_divides_x;\n boolean xDividesAllB;\n // test each candidate and determin if it is \"between\" set A and B\n for(int x=min; x<=max; x++) {\n // check to see if all A | x\n allA_divides_x = true; // default to true, will trigger false if it occurs and break\n for(int idx=0; idx<aryA.length; idx++) {\n if(x % aryA[idx] != 0){\n allA_divides_x = false;\n break;\n }\n } // for\n\n // check to see if x | all B\n xDividesAllB = true;\n for(int idx=0; idx<aryB.length; idx++) {\n if(aryB[idx] % x != 0) {\n xDividesAllB = false;\n continue;\n }\n }\n // count if all conditions are met\n if( allA_divides_x && xDividesAllB )\n nBetweenAB++;\n } // for x\n return nBetweenAB;\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 }", "public static void main(String[] args) {\n\t\t Scanner sc=new Scanner(System.in);\n\n\t\tint a = 336;\n\t\tint c;\n\t\tint d=sc.nextInt();\n\t\tint b = 224;\n\t\t//int a = 336;\n\n\t\tint lcm=0;\n\t\t\n\t\tfor(int i=b;i<=a*b;i++){\n\t\t\tif(i%a==0 && i%b==0){\n\t\t\t\tSystem.out.println(i);\n\t\t\t\t}\n\t\t}\n\t\t\t\t\n\t\t//System.out.println(lcm);\n\t\t\n\t}", "private static int gcd(int n1,int n2){\n int a = n1>n2?n1:n2;\r\n int b = n1>n2?n2:n1;\r\n int r = a%b;\r\n while(r!=0){\r\n a = b;\r\n b = r;\r\n r = a%b;\r\n }\r\n return b;\r\n }", "private static int greatestCommonDivisor(int alpha, int beta){\n\n\t\talpha = Math.abs(alpha); // take absolute values of operands\n\t\tbeta = Math.abs(beta);\n\t\n\t\tif (beta == 0) // base case\n\t \treturn alpha;\n\t\telse{ // induction step\n\t\t\tint remainder = alpha % beta;\n\t\t\n\t\t\treturn greatestCommonDivisor(beta, remainder);\n\t }\n }", "public static int largestMultipleOfXLeqY(int x, int y) {\n\treturn (y / x) * x;\n }", "private static int lcm(int num1, int num2, int k) {\n\t\t// If either of the two numbers\n\t\t// is 1, return their product\n\t\tif (num1 == 1 || num2 == 1)\n\t\t\treturn num1 * num2;\n\n\t\t// If both the numbers are equal\n\t\tif (num1 == num2)\n\t\t\treturn num1;\n\n\t\t// If k is smaller than the\n\t\t// minimum of the two numbers\n\t\tif (k <= Min(num1, num2)) {\n\n\t\t\t// Checks if both numbers are\n\t\t\t// divisible by k or not\n\t\t\tif (num1 % k == 0 && num2 % k == 0) {\n\n\t\t\t\t// Recursively call LCM() function\n\t\t\t\treturn k * lcm(num1 / k, num2 / k, 2);\n\t\t\t}\n\n\t\t\t// Otherwise\n\t\t\telse\n\t\t\t\treturn lcm(num1, num2, k + 1);\n\t\t}\n\n\t\t// If k exceeds minimum\n\t\telse\n\t\t\treturn num1 * num2;\n\t}", "private static long calc1()\n {\n final int min = 1000;\n final int max = 10000;\n\n // initialize\n List<List<Integer>> m = new ArrayList<>();\n for (int k = 0; k < end; k++) {\n List<Integer> list = new ArrayList<Integer>();\n int n = 1;\n while (k >= start) {\n int p = pkn(k, n);\n if (p >= max) {\n break;\n }\n if (p >= min) {\n list.add(p);\n }\n n++;\n }\n m.add(list);\n }\n\n boolean[] arr = new boolean[end];\n arr[start] = true;\n\n List<Integer> solutions = new ArrayList<>();\n List<Integer> list = m.get(start);\n for (Integer first : list) {\n LinkedList<Integer> values = new LinkedList<>();\n values.add(first);\n f(m, arr, values, 1, solutions);\n // we stop at the first solution found\n if (!solutions.isEmpty()) {\n break;\n }\n }\n\n // solutions.stream().forEach(System.out::println);\n int res = solutions.stream().reduce(0, Integer::sum);\n return res;\n }", "public int gcd(int a, int b) {\n // write your code here\n if (b != 0) {\n return gcd(b, a % b);\n }\n else\n return a;\n }", "static int min(int a, int b) { return a < b ? a : b; }", "public static int gcd(int a, int b) {\n\t\t// take absolute values\n\t\tif (a < 0) {\n\t\t\ta *= -1;\n\t\t}\n\t\tif (b < 0) {\n\t\t\tb *= -1;\n\t\t}\n\n\t\t// ensure a > b\n\t\tif (a < b) {\n\t\t\tint temp = a;\n\t\t\ta = b;\n\t\t\tb = temp;\n\t\t}\n\t\t// a = b * (a / b) + (a % b)\n\t\t// then b = (a % b) * ((a % b) / b) + (a % b) % b\n\t\t// by the division algorithm. Execute until some\n\t\t// such product has no remainder, the remainder of\n\t\t// the previous equation is GCD(a, b).\n\t\twhile (b > 0) {\n\t\t\tint temp = b;\n\t\t\tb = a % b;\n\t\t\ta = temp;\n\t\t}\n\t\treturn a;\n\t}", "private RunGreatestCommonDivisor() {\r\n\t}", "private static int getResult(int x, int y) {\n\t\tint startx=0;\r\n\t\tint starty=0;\r\n\t\tint num=1;\r\n\t\tif(startx==x&&starty==y){\r\n\t\t\treturn num;\r\n\t\t}\r\n\t\tfor(int z=1;z<105;z++){\r\n\t\t\tfor(int i=1;i<=2*z-1;i++){\r\n\t\t\t\tstartx=startx+1;\r\n\t\t\t\tnum++;\r\n//\t\t\t\tSystem.out.println(num);\r\n\t\t\t\tif(startx==x&&starty==y){\r\n\t\t\t\t\treturn num;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor(int i=1;i<=2*z-1;i++){\r\n\t\t\t\tstarty=starty+1;\r\n\t\t\t\tnum++;\r\n//\t\t\t\tSystem.out.println(num);\r\n\t\t\t\tif(startx==x&&starty==y){\r\n\t\t\t\t\treturn num;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor(int i=1;i<=2*z;i++){\r\n\t\t\t\tstartx=startx-1;\r\n\t\t\t\tnum++;\r\n//\t\t\t\tSystem.out.println(num);\r\n\t\t\t\tif(startx==x&&starty==y){\r\n\t\t\t\t\treturn num;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor(int i=1;i<=2*z;i++){\r\n\t\t\t\tstarty=starty-1;\r\n\t\t\t\tnum++;\r\n//\t\t\t\tSystem.out.println(num);\r\n\t\t\t\tif(startx==x&&starty==y){\r\n\t\t\t\t\treturn num;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn num;\r\n\t}", "private static long gcd(long n, long d) {\n\t long n1 = Math.abs(n);\n\t long n2 = Math.abs(d);\n\t int gcd = 1;\n\t \n\t for (int k = 1; k <= n1 && k <= n2; k++) {\n\t if (n1 % k == 0 && n2 % k == 0) \n\t gcd = k;\n\t }\n\n\t return gcd;\n\t }", "int min();", "public static int gcd(int a, int b){\n int tmp = a;\r\n a = Math.max(a,b);\r\n b = Math.min(tmp,b);\r\n \r\n //write GCD\r\n int remainder;\r\n do{\r\n remainder = a%b;\r\n a = b;\r\n b = remainder;\r\n } while(remainder !=0);\r\n \r\n return a;\r\n }", "public static int minProduct(int min, int max) {\n if(min == 0) {\n return 0;\n }\n if(min == 1) {\n return max;\n }\n int s = min >> 1;\n int half = minProduct(s, max);\n\n if(min % 2 == 0) {\n return half + half;\n }\n return half + half + max;\n }", "public int gcd(int a, int b) {\n\t\tint result;\n\t\tif (a > 0) {\n\t\t\tresult = gcd(b % a, a);\n\t\t} else {\n\t\t\tresult = b;\n\t\t}\n\n\t\treturn result;\n\t}", "public void smallestMultiple(){\n outerLoop: for( int i = 2; i < Integer.MAX_VALUE; i++ ){\n for( int j = 3; j <= 20; j++ )\n if( i % j != 0 )\n continue outerLoop;\n System.out.println( i );\n break;\n }\n }", "private static int min(int one, int two, int three){\n\t\tif (two<one){\n\t\t\tone = two;\n\t\t}\n\t\tif (three<one){\n\t\t\tone = three;\n\t\t}\n\t\treturn one;\n\t}", "private static @Nullable Integer commonMin(List<ArgumentCount> counts) {\n // min=5, min=3, min=0 -> min=0\n // min=5, min=3, min=0, min=null -> min=null\n int commonMin = Integer.MAX_VALUE;\n for (ArgumentCount count : counts) {\n final Optional<Integer> min = count.getMinCount();\n if (!min.isPresent()) {\n return null;\n }\n commonMin = Math.min(commonMin, min.get());\n }\n if (commonMin == Integer.MAX_VALUE) {\n return null;\n }\n return commonMin;\n }", "static int lcmhelp(int j,int k, int n) {\n\t\tif ((n % j == 0) && (n % k == 0)) {\t\t\n\t\t\treturn n; // n is the lowest number\n\t\t}\n\t\telse \n\t\t\treturn lcmhelp(j,k,n+1); // try again with the next-largest number\n\t}", "public static int findCommon1(int[] in1, int[] in2) {\r\n\t\tint common = 0;\r\n\t\t//n*m Comparisions\r\n\t\tfor (int i = 0; i < in1.length; i++) {\r\n\t\t\tfor (int j = 0; j < in2.length; j++) {\r\n\t\t\t\tif(in1[i] == in2[j]) {\r\n\t\t\t\t\t++common;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn common;\r\n\t}", "public int gcd(int x, int y) {\n if (x < y) return gcd(y, x);\n return y == 0 ? x : gcd(y, x % y);\n }", "public static int findCommon3(int[] in1, int[] in2) {\r\n\t\tint common = 0;\r\n\t\tHashSet<Integer> hSet = new HashSet<Integer>();\r\n\t\t\r\n\t\t//Check the smaller array and insert into Hashset\r\n\t\tif (in1.length > in2.length) {\r\n\t\t\tfindCommon3(in2, in1);\r\n\t\t}\r\n\t\t//m*c --> insert\r\n\t\tfor (int i = 0; i < in1.length; i++) {\r\n\t\t\thSet.add(in1[i]);\r\n\t\t}\r\n\t\t//n*c --> retrive\r\n\t\tfor (int i = 0; i < in2.length; i++) {\r\n\t\t\tif (hSet.contains(in2[i])) {\r\n\t\t\t\t++common;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn common;\r\n\t}", "int gcd(int a, int b) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\t int x,y,r=1;\r\n\t\t if(a<b)\r\n\t\t {\r\n\t\t\t x = b;\r\n\t\t\t y = a;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\t x = a;\r\n\t\t\t y = b;\r\n\t\t }\r\n\t\t while(r!=0)\r\n\t\t {\r\n\t\t r = x%y;\r\n\t\t if(r==0)\r\n\t\t\t break;\r\n\t\t x = y;\r\n\t\t y = r;\r\n\t\t }\r\n\t\t// System.out.println(\"====\"+y);\r\n\t\treturn y;\r\n\t}", "public static int findGCD(int int1, int int2) {\n\t\tint gcd = 1;\n\t\t\n\t\tfor (int i = 2; i <= int1 && i <= int2; i++) {\n\t\t\tif (int1 % i == 0 && int2 % i == 0)\n\t\t\t\tgcd = i;\n\t\t}\n\t\t\n\t\treturn gcd;\n\t}", "public static int findLCM(int num1, int num2) {\n\t\t// return lcm of two numbers\n\t\treturn lcm(num1, num2, 2);\n\t}", "public int solve(int A, int B, int C) {\n int lcm = (B * C) / gcd(B, C);\n return A / lcm;\n }", "public static int min(int a, int b) {\n return b + ((a - b) & (a - b) >> 31);\n }", "static ArrayList DP_min_operation(int input_integer){\n\t\tArrayList<Integer> DP_min_cal_arry=new ArrayList();\n\t\tint index_n_cal_done=2;\n\t\tDP_min_cal_arry.add(0);\n\t\tDP_min_cal_arry.add(0);\n\t\tint [] val_DP_min=new int[3];\n\t\t\n\t\tif(input_integer<2){\n\t\t\treturn DP_min_cal_arry;\n\t\t\t\n\t\t}\n\t\t\n\t\twhile (index_n_cal_done<=input_integer){\n\t\t\tval_DP_min[0]=Integer.MAX_VALUE;\n\t\t\tval_DP_min[1]=Integer.MAX_VALUE;\n\t\t\tval_DP_min[2]=Integer.MAX_VALUE;\n\t\t\t\n\t\t\tif (index_n_cal_done-1>=0){\n\t\t\t\tval_DP_min[0]=DP_min_cal_arry.get(index_n_cal_done-1);\n\t\t\t\tval_DP_min[0]+=1;\n\t\t\t}\n\t\t\tif((index_n_cal_done/2>=1)&&(index_n_cal_done%2==0)){\n\t\t\t\tval_DP_min[1]=DP_min_cal_arry.get(index_n_cal_done/2);\n\t\t\t\tval_DP_min[1]+=1;\n\t\t\t}\n\t\t\tif((index_n_cal_done/3>=1)&&(index_n_cal_done%3==0)){\n\t\t\t\tval_DP_min[2]=DP_min_cal_arry.get(index_n_cal_done/3);\n\t\t\t\tval_DP_min[2]+=1;\n\t\t\t}\n\t\t\tint result_min_val=Integer.MAX_VALUE;\n\t\t\tfor (int i=0;i<3;i++){\n\t\t\t\tif (result_min_val>val_DP_min[i]){\n\t\t\t\t\tresult_min_val=val_DP_min[i];\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\tDP_min_cal_arry.add(result_min_val);\t\t\t\n\t\t\tindex_n_cal_done+=1;\n\t\t}\n\t\t\n\t\treturn DP_min_cal_arry;\n\t}", "static int lcm(int j, int k) {\n\t\tint start;\n\t\tif (j<k)\n\t\t\tstart= j;\n\t\telse start = k; // Breaks ties with k\n\t\treturn lcmhelp(j,k,start);\n\t}", "public int findMinII(int[] nums) {\n int n = nums.length;\n int l = 0;\n int r = n - 1;\n int m;\n while (l + 1 < r) {\n while (r > 0 && nums[r] == nums[r-1]) r --;\n while (l < n-1 && nums[l] == nums[l+1]) l ++;\n m = (l + r) / 2;\n if (nums[m] > nums[l]) {\n l = m;\n }\n else if (nums[m] < nums[r]) {\n r = m;\n }\n }\n return Math.min(nums[0], Math.min(nums[l], nums[r]));\n }", "private long function(long a, long b) {\n if (a == UNIQUE) return b;\n else if (b == UNIQUE) return a;\n\n // return a + b; // sum over a range\n // return (a > b) ? a : b; // maximum value over a range\n return (a < b) ? a : b; // minimum value over a range\n // return a * b; // product over a range (watch out for overflow!)\n }", "org.apache.xmlbeans.XmlDecimal xgetMultipleBetMinimum();", "private static int findGcd(int a, int b) {\n\n\t\tint low = a < b ? a : b;\n\t\tint high = a < b ? b : a;\n\n\t\tif (high % low == 0) {\n\t\t\treturn low;\n\t\t} else {\n\t\t\treturn findGcd(high, high % low);\n\t\t}\n\t}", "private static int searchSmallest(List<Integer> input) {\n\t\tint left = 0;\n\t\tint right = input.size()-1;\n\t\t\n\t\twhile(left < right) {\n\t\t\tint mid = left + (right-left)/2 + 1; System.out.println(\"mid=\" + mid);\n\t\t\t\n\t\t\tif(input.get(left) > input.get(mid)) {//smallest in left half\n\t\t\t\tright = mid-1;\n\t\t\t}else {\n\t\t\t\tleft = mid+1;\n\t\t\t}\n\t\t}\n\t\treturn left;//left=right now\n\t}", "public static int HCF(int a, int b){\r\n int x, i, hcf = 0;\r\n \r\n for(i = 1; i<=a || i<=b; i++){\r\n if(a%i == 0 && b%i == 0){\r\n hcf = i;\r\n }} \r\n //System.out.print(hcf);\r\n return hcf;\r\n }", "private static BigInteger comprime(BigInteger input) {\n \t\n \t//krenemo od dva\n BigInteger candidate = BigInteger.valueOf(2);\n while (true) {\n \t\n \t//kada nadjemo odgovarajuci vratimo ga\n if (input.gcd(candidate).equals(BigInteger.ONE)) {\n return candidate;\n }\n candidate = candidate.add(BigInteger.ONE);\n }\n }", "private static int calculate(int limit) {\n\t\tPrimeGenerator primeGenerator = new PrimeGenerator((int) Math.floor(Math.sqrt(limit)) + 10);\n\n\t\t// BitSet is used to set a given number/index if it can be produced as p1^2 + p2^3 + p4^4\n\t\t// because there are numbers that can be produced more than once\n\t\tBitSet numbers = new BitSet(limit);\n\t\tnumbers.set(0, limit, false);\n\n\t\tList<Integer> list = primeGenerator.getPrimeList();\n\n\t\tfor (int a : list) {\n\t\t\tint powera = a * a;\n\t\t\tsearchB: for (int b : list) {\n\t\t\t\tint powerb = b * b * b;\n\t\t\t\tif (powera + powerb > limit) {\n\t\t\t\t\tbreak searchB;\n\t\t\t\t}\n\n\t\t\t\tsearchC: for (int c : list) {\n\t\t\t\t\tint powerc = c * c * c * c;\n\t\t\t\t\tint sum = powera + powerb + powerc;\n\t\t\t\t\tif (sum > limit) {\n\t\t\t\t\t\tbreak searchC;\n\t\t\t\t\t}\n\t\t\t\t\t// Set the index - the number is passed\n\t\t\t\t\tnumbers.set(sum);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Set the number of set bit - the solution\n\t\treturn numbers.cardinality();\n\t}", "public int find(List<Integer> numbers) {\n int count = 0;\n for (Integer n : numbers) {\n int x = 1;\n do {\n if (x * (x + 1) == n) {\n count++;\n }\n x++;\n } while (x < Math.sqrt(n));\n }\n return count;\n }", "public static void main(String[] args) {\n\t\tScanner s=new Scanner(System.in);\r\n\t\tint m=0;\r\n\t\tSystem.out.println(\"Enter 2 numbers\");\r\n\t\tint a=s.nextInt();\r\n\t\tint b=s.nextInt();\r\n\t\tm=a>b?a:b;\r\n\t\tint lcm=0;\r\n\t\twhile(a!=0)\r\n\t\t{\r\n\t\tif(m%a==0 && m%b==0)\r\n\t\t{\r\n\t\t\tlcm=m;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tm++;\r\n\t\t}\r\n\t\tSystem.out.println(\"LCM is \"+lcm);\r\n\t\t\t\r\n\t\t}", "private static long f(long m) {\n\t\tlong k = 1;\r\n\t\tfor (long i=1; i<=m; i++){\r\n\t\t\tk *= i;\r\n\t\t}\r\n\t\treturn k;\r\n\t}", "public void findMinimumChocolateLeft() {\n double k;\n int ceiled_k;\n int floored_k;\n int sumWith_ceiled_k = 0;\n int sumWith_floored_k = 0;\n int minChocolateWith_floored_k = 0;\n int minChocolateWith_ceiled_k = 0;\n \n //this equation finds the value of k which is the \n k = ((2 * this.noOfChocolate / this.noOfStudents) + 1 - this.noOfStudents) / 2.0;\n \n \n if (k < 1.0) //if k is less than 1 then it is not possible to distribute among all students\n {\n setMinimumChocolateLeft(this.noOfChocolate);\n }\n else \n {\n //get the ceiling value of k \n ceiled_k = (int) Math.ceil(k);\n //get the floor value of k \n floored_k = (int) Math.floor(k);\n\n //Get sum of consicutively distributed chocolate using both floor value and ceiling value of k\n for (int i = 0; i < 3; i++) \n {\n sumWith_ceiled_k = sumWith_ceiled_k + ceiled_k + i;\n sumWith_floored_k = sumWith_floored_k + floored_k + i;\n }\n\n //finding out minimum no. of chocolate left using both floor value and ceiling value of k \n minChocolateWith_ceiled_k = this.noOfChocolate - sumWith_ceiled_k;\n minChocolateWith_floored_k = this.noOfChocolate - sumWith_floored_k;\n\n /*\n if minimum number of chocolate left using floor or ceiling\n is negative then we will consider vise-a-versa.\n \n if given condition is wrong then we will find minimum\n value from minimum chocolate using floor value and\n minimum chocolate using ceil value\n \n */\n if (minChocolateWith_ceiled_k < 0) {\n setMinimumChocolateLeft(minChocolateWith_floored_k);\n } else if (minChocolateWith_floored_k < 0) {\n setMinimumChocolateLeft(minChocolateWith_ceiled_k);\n } else {\n setMinimumChocolateLeft(Math.min(minChocolateWith_ceiled_k, minChocolateWith_floored_k));\n }\n }\n\n //print the final minimum no. of chocolate\n System.out.println(minimumChocolateLeft);\n\n }", "private static int pair_GCF(int a, int b) {\n int t;\n while (b != 0) {\n t = a;\n a = b;\n b = t % b;\n }\n return a;\n }", "private static long minDotProduct(int[] a, int[] b) {\n long result = 0;\n\n int n = a.length;\n\n if (n != 0) {\n // get boundary values in a and b\n int minA = a[0];\n int maxA = a[0];\n int minB = b[0];\n int maxB = b[0];\n for (int i = 0; i < n; i++) {\n int ai = a[i];\n int bi = b[i];\n\n if (ai < minA) {\n minA = ai;\n }\n if (ai > maxA) {\n maxA = ai;\n }\n if (bi < minB) {\n minB = bi;\n }\n if (bi > maxB) {\n maxB = bi;\n }\n }\n // These are the flag values.\n // Encountering them in an array means\n // the value at this position was already used.\n int maxmaxA = maxA + 1;\n int minminB = minB - 1;\n\n // These are the initialization values.\n int minminA = minA - 1;\n int maxmaxB = maxB + 1;\n\n for (int i = 0; i < n; i++) {\n maxA = minminA;\n minB = maxmaxB;\n\n int indexMaxA = -1;\n int indexMinB = -1;\n\n for (int j = 0; j < n; j++) {\n int aj = a[j];\n int bj = b[j];\n\n if ((aj != maxmaxA) && (aj > maxA)) {\n indexMaxA = j;\n maxA = aj;\n }\n if ((bj != minminB) && (bj < minB)) {\n indexMinB = j;\n minB = bj;\n }\n }\n\n if ((indexMaxA != -1) && (indexMinB != -1)) {\n result += (long)a[indexMaxA] * b[indexMinB];\n\n a[indexMaxA] = maxmaxA;\n b[indexMinB] = minminB;\n }\n }\n }\n return result;\n }", "private int count(int val , int m , int n){\n int res = 0;\n for(int i = 1 ; i <= m ; i++){\n res += Math.min( val / i , n);\n }\n return res;\n }", "public static double smallest(int num1, int num2, int num3) {\n\r\n\t\tdouble lowestnum = Math.min(Math.min(num1, num2), num3); // This finds the smallest of the three parameters.\r\n\r\n\t\treturn lowestnum; // Returns the double value calculated above.\r\n\t}", "public int getOptimalNumNearest();", "public int minimumSizeOfSubsetWhoseGCDDivisibleBy(int x) {\n if (dp == null) {\n dp = new int[m + 1];\n Arrays.fill(dp, INF);\n for (int e : seq) {\n dp[e] = 1;\n }\n for (int i = m; i >= 1; i--) {\n for (int j = i + i; j <= m; j += i) {\n if (coprime(j / i) > 0) {\n dp[i] = Math.min(dp[i], dp[j] + 1);\n }\n }\n }\n }\n return dp[x];\n }", "private static int cprModFunction(int a, int b) {\n\t\tint res = a % b;\n\t\tif (res < 0)\n\t\t\tres += b;\n\t\treturn res;\n\t}", "int getMin( int min );", "public static int findCommon4(int[] in1, int[] in2) {\r\n\t\tint common = 0;\r\n\t\t//mlogn\r\n\t\tArrays.sort(in1);\r\n\t\t//nlogn\r\n\t\tArrays.sort(in2);\r\n\t\t//m+n-1 (as one element will remain uncompared in the end)\r\n\t\tint i=0,j=0;\r\n\t\twhile (i < in1.length && j < in2.length) {\r\n\t\t\tif (in1[i] == in2[j]) {\r\n\t\t\t\t++common;\r\n\t\t\t\t++i;\r\n\t\t\t\t++j;\r\n\t\t\t} else if (in1[i] < in2[j]) {\r\n\t\t\t\t++i;\r\n\t\t\t} else {\r\n\t\t\t\t++j;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn common;\r\n\t}", "public int minOperations(int n) {\n\t\tint count = 0;\n\t\twhile (n != 1) {\n\t\t\tn = n - 1;\n\t\t\tif (n % 2 == 0) {\n\t\t\t\tn = n / 2;\n\t\t\t} else if (n % 3 == 0) {\n\t\t\t\tn = n / 3;\n\t\t\t}\n\t\t\tcount++;\n\t\t}\n\n\t\treturn count;\n\t}", "public static int min(int number1, int number2) {\n\t\tif(number1 < number2) {\r\n\t\t\treturn(number1);\r\n\t\t} \r\n\t\treturn(number2);\r\n\t}", "private static int minCoins_my_way_infinite_coins_of_one_value_case(int[] coins, int startIndex, int endIndex, int amount) {\n\n if (coins.length == 0) return 0;\n\n if (startIndex == endIndex) {\n int currentCoin = coins[startIndex];\n\n if (currentCoin == amount) {// coins=(8) amount=8\n return 1;\n }\n if (currentCoin > amount) {// coins=(9) amount=8\n return 0;\n }\n if (currentCoin < amount) {\n // IMPORTANT: This code assumes that you can use only 1 coin of the same value (you can't use infinite number of coins of the same value).\n //return 0;\n\n // This code assumes that you can use infinite number of coins of the same value.\n // e.g. currentCoin=1 and amount=8, then 8 coins of 1s can be used\n if (amount % currentCoin == 0) { // coins=(1) amount=8 should return 8 because you can use 8 coins of value 1 to make amount=8\n return amount / currentCoin;\n }\n return 0; // coins=(3) amount=8 should return 0 because you can't use 1 or more coins of value 3 to make amount=8\n }\n }\n\n // IMPORTANT\n // You don't need any coin to make amount=0\n // By seeing recursive call, you will figure out that amount can reach to 0. So, you need an exit condition for amount==0\n if (amount == 0) {\n return 0;\n }\n\n int currentCoin = coins[startIndex];\n\n int minUsingCurrentCoin = 0;\n\n if (currentCoin == amount) {\n minUsingCurrentCoin = 1;\n } else if (currentCoin > amount) {\n minUsingCurrentCoin = 0;\n } else {\n /*\n if currentCoin=1 and amount=8, then maxNumberOfCoinsThatCanBeUsedToMakeAmount will be 8.\n if currentCoin=3 and amount=8, then maxNumberOfCoinsThatCanBeUsedToMakeAmount be 2\n you need to consider both these situations for coming up with the correct code\n\n Case 1:\n coins = (1,6) amount=8\n currentCoin=1. So, maxNumberOfCoinsThatCanBeUsedToMakeAmount = 8\n\n coin numberOfCurrentCoins(i) amountConsumedByCurrentCoin coinsUsedFromRemaining totalCoinsUsed\n remaining coins amount\n 1 1 1 (6) 7 = 0 0 (when you cannot make remaining amount using remaining coins, then you cannot make total amount including current coin also)\n 1 2 2 (6) 6 = 1 2+1=3\n 1 3 3 (6) 5 = 0 0\n 1 4 4 (6) 4 = 0 0\n 1 5 5 (6) 3 = 0 0\n 1 6 6 (6) 2 = 0 0\n 1 7 7 (6) 1 = 0 0\n 1 8 8 (6) 0 = 0 8 (special condition - even though you could not make remaining amount using remaining coins, you could make total amount using current coin)\n\n Case 2:\n coins = (3,6) amount=8\n currentCoin=3. So, maxNumberOfCoinsThatCanBeUsedToMakeAmount = 2\n\n coin numberOfCurrentCoins(i) amountConsumedByCurrentCoin coinsUsedFromRemaining totalCoinsUsed\n remaining coins amount\n 3 1 3 (6) 3 = 0 0 (when you cannot make remaining amount using remaining coins, then you cannot make total amount including current coin also)\n 3 2 6 (6) 2 = 0 0\n\n */\n int maxNumberOfCoinsThatCanBeUsedToMakeAmount = amount / currentCoin;\n\n int min = 0;\n\n for (int i = 1; i <= maxNumberOfCoinsThatCanBeUsedToMakeAmount; i++) {\n int amountConsumedByCurrentCoin = i * currentCoin;\n\n int minFromRemaining = minCoins_my_way_infinite_coins_of_one_value_case(coins, startIndex + 1, endIndex, amount - amountConsumedByCurrentCoin);\n\n if (minFromRemaining == 0) {// If I could not make remaining amount using remaining coins, then I cannot make total amount including current coin (except one special condition)\n if (amountConsumedByCurrentCoin == amount) {// special condition - even though you could not make remaining amount using remaining coins, you could make total amount using current coin\n min = i;\n } else {\n min = 0;\n }\n } else {\n min = i + minFromRemaining;\n }\n\n if (minUsingCurrentCoin == 0 && min > 0) {\n minUsingCurrentCoin = min;\n } else if (minUsingCurrentCoin > 0 && min == 0) {\n // don't change minUsingCurrentCoin\n } else {\n if (min < minUsingCurrentCoin) {\n minUsingCurrentCoin = min;\n }\n }\n }\n }\n\n int minWaysUsingRestOfTheCoins = minCoins_my_way_infinite_coins_of_one_value_case(coins, startIndex + 1, endIndex, amount);\n\n if (minWaysUsingRestOfTheCoins == 0 && minUsingCurrentCoin > 0) {\n return minUsingCurrentCoin;\n } else if (minWaysUsingRestOfTheCoins > 0 && minUsingCurrentCoin == 0) {\n return minWaysUsingRestOfTheCoins;\n }\n return Math.min(minUsingCurrentCoin, minWaysUsingRestOfTheCoins);\n\n }", "public static long findNum(long m) {\n if (m > 0 && m < Long.MAX_VALUE) {\n /**\n * Algo:\n *\n * (1 pow 3) = 1 ---> this will be the case, if input \"m\" is 1 (then result \"n\" = 1)\n * (2 pow 3) + (1 pow 3) = 9 ---> if input \"m\" is 9 (then result \"n\" = 2)\n * (3 pow 3) + (2 pow 3) + (1 pow 3) = 36 ---> if input \"m\" is 36 (then result \"n\" = 3)\n * (4 pow 3) + (3 pow 3) + (2 pow 3) + (1 pow 3) = 100 ---> if input \"m\" is 100 (then result \"n\" = 4)\n *\n *\n * Let's start with counter i = 1;\n * calculate m - (i pow 3), then if result is 0 then n = i\n *\n * Example, consider m = 9,\n * store m in some variable ---> result = 9\n * calculate result - (1 pow 3) = 8, then return i if result = 0, if not increment i\n * calculate result - (2 pow 3) = 0, then return i if result = 0, if not increment i\n *\n * continue this loop until result = 0, in any step if result < 0, then exit from loop and return -1\n */\n\n long result = m;\n for (int i = 1; i < Integer.MAX_VALUE; i++) {\n result = result - ((long) Math.pow(i, 3));\n if (result < 0) {\n break;\n } else if (result == 0) {\n return i;\n }\n }\n\n }\n return -1;\n }", "public static void main(String[] args) {\n Scanner scan=new Scanner(System.in);\n int t= scan.nextInt();\n int min[] = new int[10001];\n Arrays.fill(min,89898);\n min[0] = 0;\n int pn[] = new int[10001];\n boolean p[] = new boolean[10001];\n for(int i=2;i<101;++i)\n {\n if(!p[i])\n for(int j=i*i;j<10001;j+=i)\n p[j] = true;\n }\n int index = 0;\n for(int i=2;i<10001;++i)\n if(!p[i])\n pn[index++] = i;\n int last = index-1;\n for(int i=0;i<=last;++i)\n {\n int temp = (int)Math.pow(pn[i], pn[i]);\n if(temp<10001)\n pn[index++] = temp;\n else break;\n }\n pn[index++] = 898989;\n Arrays.sort(pn,0,index);\n for(int i=2;i<10001;++i)\n {\n for(int j=0;pn[j]<=i;++j)\n if(min[i]>1+min[i-pn[j]])\n min[i] = 1+min[i-pn[j]];\n }\n\n StringBuilder sb = new StringBuilder(\"\");\n while(t-->0)\n {\n sb.append(min[scan.nextInt()]+\"\\n\");\n }\n System.out.println(sb);\n }", "private static int Min(int num1, int num2) {\n\t\treturn num1 >= num2 ? num2 : num1;\n\t}", "public static int gcd(int n1, int n2) {\n BigInteger n1_big = BigInteger.valueOf(n1);\n BigInteger n2_big = BigInteger.valueOf(n2);\n return n1_big.gcd(n2_big).intValue();\n }", "public int compare(Integer a,Integer b)\n\t{\n\t\treturn a%2-b%2;\n\t}" ]
[ "0.7056201", "0.70101666", "0.6870356", "0.6769448", "0.6594628", "0.6413911", "0.6395736", "0.6361192", "0.6335278", "0.62986296", "0.6274686", "0.62301874", "0.6205107", "0.61968786", "0.61862546", "0.61826086", "0.6147323", "0.6122457", "0.60704964", "0.6043215", "0.6031213", "0.5993395", "0.59724545", "0.5972066", "0.5946918", "0.59420455", "0.5918444", "0.5906855", "0.5901347", "0.589924", "0.588153", "0.586476", "0.58633655", "0.5850452", "0.58392745", "0.5836659", "0.5833622", "0.5820507", "0.58113855", "0.5799653", "0.57929283", "0.5787285", "0.57809544", "0.57770365", "0.5776779", "0.57745075", "0.5763953", "0.5743173", "0.57196516", "0.57150245", "0.5699348", "0.56992894", "0.5697724", "0.5695777", "0.5692609", "0.5687748", "0.5683765", "0.5678427", "0.5670006", "0.56569266", "0.5651443", "0.56502616", "0.5648277", "0.5635625", "0.5629323", "0.5625978", "0.56242496", "0.5621107", "0.5617034", "0.56085354", "0.5603094", "0.55996287", "0.55946934", "0.5585324", "0.55736625", "0.5561941", "0.5551775", "0.5545329", "0.5542345", "0.554129", "0.5535681", "0.55328405", "0.55259687", "0.552525", "0.55156213", "0.551038", "0.550844", "0.55077976", "0.5505529", "0.55044264", "0.5499897", "0.54962116", "0.54936767", "0.54936004", "0.5481591", "0.54808044", "0.54735565", "0.54668427", "0.5465624", "0.5457353" ]
0.69937
2
Method that calculates the greatest common divisor between two integers
public static int GCD(int a, int b){ if (b == 0){ return a; } return GCD(b,a%b); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int greatestCommonDivisor(int inputOne, int inputTwo)\n {\n inputOne = Math.abs(inputOne);\t\t\n inputTwo = Math.abs(inputTwo);\t\t\n \t\t\n int smaller = Math.min(inputOne, inputTwo);\t\t\n int greatestCommonDivisor = 1;\n \t\t\n for (int index = 1; index <= smaller; index++)\t\n \tif ((inputOne % index) == 0 && (inputTwo % index) == 0)\n \t\tgreatestCommonDivisor = index;\n return greatestCommonDivisor;\t\t\n }", "public int getGreatestCommonDivisor(int first, int second) {\n\t\t// TODO Write an implementation for this method declaration\n\t\tint GCD = 0;\n\t\tboolean found = false;\n\t\tArrayList<Integer> firstDivisor = new ArrayList<Integer>();\n\t\tArrayList<Integer> secondDivisor = new ArrayList<Integer>();\n\t\tif(first < 10 || second < 10) {\n\t\t\tGCD = -1;\n\t\t}\n\t\telse {\n\t\t\tfor(int i = 1; i <= first; i++) {\n\t\t\t\tif(first % i == 0) {\n\t\t\t\t\tfirstDivisor.add(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 1; i <= second; i++) {\n\t\t\t\tif(second % i ==0) {\n\t\t\t\t\tsecondDivisor.add(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n//\t\t\tfor(Integer i: firstDivisor) {\n//\t\t\t\tSystem.out.println(i);\n//\t\t\t}\n//\t\t\tfor(Integer i: secondDivisor) {\n//\t\t\t\tSystem.out.println(i);\n//\t\t\t}\n\t\t\t\n\t\t\tif(firstDivisor.size() >= secondDivisor.size()) {\n\t\t\t\tGCD = firstDivisor.get(0);\n\t\t\t\tfor(int i =0; i < firstDivisor.size(); i++) {\n\t\t\t\t\tfor(int j =0; j < secondDivisor.size(); j++) {\n\t\t\t\t\t\tif(secondDivisor.get(j)==firstDivisor.get(i)) {\n\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(found == true) {\n\t\t\t\t\t\tif(firstDivisor.get(i) >= GCD) {\n\t\t\t\t\t\t\tGCD = firstDivisor.get(i);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfound = false;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(secondDivisor.size() >= firstDivisor.size()) {\n\t\t\t\tGCD = secondDivisor.get(0);\n\t\t\t\tfor(int i =0; i < secondDivisor.size(); i++) {\n\t\t\t\t\tfor(int j =0; j < firstDivisor.size(); j++) {\n\t\t\t\t\t\tif(firstDivisor.get(j)==secondDivisor.get(i)) {\n\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(found == true) {\n\t\t\t\t\t\tif(secondDivisor.get(i) >= GCD) {\n\t\t\t\t\t\t\tGCD = secondDivisor.get(i);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfound = false;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t\n\t\t}\n\t\t//System.out.println(GCD);\n\t\treturn GCD;\n\t}", "private static int gcd (int a, int b) {\n int m = Math.max (Math.abs (a), Math.abs (b));\n if (m == 0) throw new ArithmeticException (\" zero in gcd \");\n int n = Math.min (Math.abs (a), Math.abs (b));\n while (n > 0) {\n a = m % n;\n m = n;\n n = a;\n }\n return m;\n }", "public int gcd(){\n\tint min;\n\tint max;\n\tint stor;\n\tif ((numerator == 0) || (denominator == 0)){\n\t return 0;\n\t}\n\telse {\n\t if ( numerator >= denominator ) {\n\t\tmax = numerator;\n\t\tmin = denominator;\n\t }\n\t else {\n\t\tmax = denominator;\n\t\tmin = numerator;\n\t }\n\t while (min != 0){\n\t stor = min;\n\t\tmin = max % min;\n\t\tmax = stor;\n\t }\n\t return max;\n\t}\n }", "private int gcd(int a, int b){\r\n int r, temp;\r\n if( a<b ){ temp = a; a = b; b = temp; }\r\n while( b!=0 ){ r = a%b; a = b; b = r; }\r\n return a;\r\n }", "static int gcd(int a, int b) {\r\n\t\tif (b == 0)\r\n\t\t\treturn a;\r\n\t\treturn gcd(b, a % b);\r\n\t}", "private static int greatestCommonDivisor(int alpha, int beta){\n\n\t\talpha = Math.abs(alpha); // take absolute values of operands\n\t\tbeta = Math.abs(beta);\n\t\n\t\tif (beta == 0) // base case\n\t \treturn alpha;\n\t\telse{ // induction step\n\t\t\tint remainder = alpha % beta;\n\t\t\n\t\t\treturn greatestCommonDivisor(beta, remainder);\n\t }\n }", "private static int gcd(int a, int b)\r\n\t{\r\n\t\tint remainder = a % b;\r\n\t\tif(remainder == 0)\r\n\t\t{\r\n\t\t\treturn b;\r\n\t\t}\r\n\t\treturn gcd(b, remainder);\r\n\t}", "static long getGCD(long x, long y) {\n long a = Math.max(x, y);\n long b = Math.min(x, y);\n\n while (b != 0) {\n long r = a % b;\n a = b;\n b = r;\n }\n\n return a;\n }", "public static int gcd(int a, int b) {\n return BigInteger.valueOf(a).gcd(BigInteger.valueOf(b)).intValue();\n }", "public static int gcd(int a, int b) {\r\n\t\twhile(b > 0) {\r\n\t\t\tint temp = b;\r\n\t\t\tb = a % b;\r\n\t\t\ta = temp;\r\n\t\t}\r\n\t\t\r\n\t\treturn a;\r\n\t}", "static int greatestDenominator(int a, int b) {\n int denominator = 0;\n\n // Loops from 0 to max(a, b) to test denominators\n for (int i = 1; i < Math.max(a, b); i++) {\n if (a % i == 0 && b % i == 0) {\n denominator = i;\n }\n }\n\n return denominator;\n }", "public static int gcd(int a, int b){\n int tmp = a;\r\n a = Math.max(a,b);\r\n b = Math.min(tmp,b);\r\n \r\n //write GCD\r\n int remainder;\r\n do{\r\n remainder = a%b;\r\n a = b;\r\n b = remainder;\r\n } while(remainder !=0);\r\n \r\n return a;\r\n }", "public static int gcd(int a, int b) {\n\t\t// take absolute values\n\t\tif (a < 0) {\n\t\t\ta *= -1;\n\t\t}\n\t\tif (b < 0) {\n\t\t\tb *= -1;\n\t\t}\n\n\t\t// ensure a > b\n\t\tif (a < b) {\n\t\t\tint temp = a;\n\t\t\ta = b;\n\t\t\tb = temp;\n\t\t}\n\t\t// a = b * (a / b) + (a % b)\n\t\t// then b = (a % b) * ((a % b) / b) + (a % b) % b\n\t\t// by the division algorithm. Execute until some\n\t\t// such product has no remainder, the remainder of\n\t\t// the previous equation is GCD(a, b).\n\t\twhile (b > 0) {\n\t\t\tint temp = b;\n\t\t\tb = a % b;\n\t\t\ta = temp;\n\t\t}\n\t\treturn a;\n\t}", "private RunGreatestCommonDivisor() {\r\n\t}", "public static int gcd(int a, int b) {\n int t = 0;\n while (b != 0) {\n t = b;\n b = a % b;\n a = t;\n }\n return Math.abs(a);\n }", "private static int gcd(int a, int b) {\n\t\tif(a==0){\n\t\t\treturn b;\n\t\t}\n\t\treturn gcd(b%a,a);\n\t}", "public static int gcd(int a, int b){\r\n return a>b ? lnko_ordered(a,b) : lnko_ordered(b,a);\r\n }", "static long gcd(long a, long b) {\n\t\ta = Math.abs(a); b = Math.abs(b);\n\t\tif(a < b) return gcd(b,a);\n\t\tif(b == 0) return a;\n\t\treturn gcd(a%b, b);\n\t}", "private int gcd(int a, int b) {\n // Note that the loop below, as-is, will time out on negative inputs.\n // The gcd should always be a positive number.\n // Add code here to pre-process the inputs so this doesn't happen.\n if ( a < 0 ) {\n a = - a;\n }\n if ( b < 0 ) {\n b = - b;\n }\n\n \twhile (a != b)\n \t if (a > b)\n \t\t a = a - b;\n \t else\n \t\t b = b - a;\n \treturn a;\n }", "static int lcm(int num1, int num2, int hcf){\n return (num1*num2)/hcf;\n }", "private static int gcd(int n1,int n2){\n int a = n1>n2?n1:n2;\r\n int b = n1>n2?n2:n1;\r\n int r = a%b;\r\n while(r!=0){\r\n a = b;\r\n b = r;\r\n r = a%b;\r\n }\r\n return b;\r\n }", "private int gcd(int x, int y) {\n if (y == 0) {\n return x;\n }\n return gcd(y, x % y);\n }", "private int getGCD(int a, int b) {\n \n /** This ensures the larger of the two numbers is in a */\n if(a < b){\n /** Temp variable used for swapping two variables */\n int temp = a;\n a = b;\n b = temp;\n }\n\n /** The remainder needs to be stored to recursively find the gcd */\n int remainder;\n if((remainder = a % b) == 0) {\n return b;\n } else {\n return getGCD(b, remainder);\n }\n }", "public int gcd(int a, int b) {\n\t\tint result;\n\t\tif (a > 0) {\n\t\t\tresult = gcd(b % a, a);\n\t\t} else {\n\t\t\tresult = b;\n\t\t}\n\n\t\treturn result;\n\t}", "public static int findGCD(int int1, int int2) {\n\t\tint gcd = 1;\n\t\t\n\t\tfor (int i = 2; i <= int1 && i <= int2; i++) {\n\t\t\tif (int1 % i == 0 && int2 % i == 0)\n\t\t\t\tgcd = i;\n\t\t}\n\t\t\n\t\treturn gcd;\n\t}", "public static int findGCF(int a, int b) {\r\n\t\tint GCF = 1;\r\n\t\tfor (int i = 1; i <= Math.abs(a); i++) {\r\n\t\t\t// loop to find greatest common factor\r\n\t\t\tif (((a % i) == 0) && ((b % i) == 0)) {\r\n\t\t\t\tGCF = i;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn GCF;\r\n\t}", "int gcd(int x,int y)\n\t{\n\t\tif(x>0 && y>0)\n\t\t{\n\t\t\twhile(x!=y)\n\t\t\t{\n\t\t\t\tif(x>y) //If number1>number2\n\t\t\t\t\treturn(gcd(x-y,y)); \n\t\t\t\telse //If number2>number1 \n\t\t\t\t\treturn(gcd(y-x,x));\n\t\t\t}\n\t\t\treturn x; //Return final calculated GCD\n\t\t}\n\t\telse\n\t\t\treturn -1; //If user input is a negative number\n\t}", "public static int LCM(int a, int b){\r\n int lowest = a * b / GCD(a,b);\r\n //System.out.print(lowest);\r\n return lowest;\r\n }", "int gcd(int a, int b) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\t int x,y,r=1;\r\n\t\t if(a<b)\r\n\t\t {\r\n\t\t\t x = b;\r\n\t\t\t y = a;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\t x = a;\r\n\t\t\t y = b;\r\n\t\t }\r\n\t\t while(r!=0)\r\n\t\t {\r\n\t\t r = x%y;\r\n\t\t if(r==0)\r\n\t\t\t break;\r\n\t\t x = y;\r\n\t\t y = r;\r\n\t\t }\r\n\t\t// System.out.println(\"====\"+y);\r\n\t\treturn y;\r\n\t}", "public int gcd(int a, int b) {\n // write your code here\n if (b != 0) {\n return gcd(b, a % b);\n }\n else\n return a;\n }", "public static int gcf(int num1, int num2) {\r\n\t\tint maxNumber = max(num1, num2);\r\n\t\tint minNumber = min(num1, num2);\r\n\t\tif (minNumber == 0) \r\n\t\t\treturn maxNumber;\r\n\t\tif (minNumber < 0)\r\n\t\t\tminNumber *= -1;\r\n\t\tSystem.out.println(maxNumber + \" \" + minNumber);\r\n\t\tfor (int i = minNumber; i > 0; i--) {\r\n\t\t\tboolean a = isDivisibleBy(maxNumber, i);\r\n\t\t\tboolean b = isDivisibleBy(minNumber, i);\r\n\t\t\tif (a == true && b == true) {\r\n\t\t\t\treturn i;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn 1;\r\n\t}", "public static int lcm(int a, int b) {\r\n\t\treturn a * (b / gcd(a, b));\r\n\t}", "static long lcm(long a, long b) \n\t\t{ \n\t\t\treturn (a*b)/gcd(a, b); \n\t\t}", "public static int GCD(int a, int b){\n\t\tif(b == 0) return a;\n\t\treturn GCD(b, a%b);\n\t}", "private int getGCD(int a, int b) {\r\n if ( b == 0 ) {\r\n return a;\r\n } else {\r\n return getGCD(b, a % b);\r\n }\r\n }", "private static int findGcd(int a, int b) {\n\n\t\tint low = a < b ? a : b;\n\t\tint high = a < b ? b : a;\n\n\t\tif (high % low == 0) {\n\t\t\treturn low;\n\t\t} else {\n\t\t\treturn findGcd(high, high % low);\n\t\t}\n\t}", "public int gcd(int x, int y) {\n if (x < y) return gcd(y, x);\n return y == 0 ? x : gcd(y, x % y);\n }", "public void reduce(){\r\n int num = numerator;\r\n int denom = denominator;\r\n int greatest;\r\n \r\n // Find the greater of numerator and denominator\r\n if(numerator < 0){\r\n num = -numerator;\r\n }\r\n if(num > denom){\r\n greatest = num;\r\n }\r\n else\r\n greatest = denom;\r\n \r\n // Find the GCD\r\n int gcd = 0;\r\n // starting from the largest\r\n for(int i = greatest; i > 1; i--){\r\n if((numerator % i == 0) && (denominator % i == 0)){\r\n gcd = i;\r\n break;\r\n }\r\n }\r\n // factor out the gcd in both the numerator and denominator\r\n if(gcd != 0){\r\n numerator /= gcd;\r\n denominator /= gcd;\r\n }\r\n }", "public int findGCD(int num1, int num2)\n {\n if (num1 < num2)\n {\n //calls findGCD with the numbers reversed\n findGCD(num2, num1);\n }\n //if num2 is equal to 0\n else if (num2 == 0)\n {\n //the GCD is num1\n divisor = num1;\n } \n else\n {\n //calls GCD with num2 and the remainder of num1 and num2\n findGCD(num2, (num1%num2)); \n }\n \n //returns the divisor\n return divisor;\n }", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int a = sc.nextInt();\n int b = sc.nextInt();\n int gcd = 1, lcm = 1;\n int temp = a;\n int temp2 = b;\n // int fact = 1;\n if (a > b) {\n\n for (int i = a; i < a * b;i+=a) {\n if ( i % b == 0) {\n lcm = i;\n break;\n // System.out.println(lcm);\n } \n }\n } else {\n for (int i = b; i < a * b; i+=b) {\n if ( i%a == 0) {\n lcm = i;\n break;\n // System.out.println(lcm);\n } \n }\n\n }\n gcd = (a * b) / lcm;\n System.out.println(gcd);\n System.out.println(lcm);\n }", "public static int gcd(int n1, int n2) {\n BigInteger n1_big = BigInteger.valueOf(n1);\n BigInteger n2_big = BigInteger.valueOf(n2);\n return n1_big.gcd(n2_big).intValue();\n }", "private long maxDivide(long a, long b) {\n\t\twhile (a % b == 0) {\n\t\t\ta = a / b;\n\t\t}\n\t\treturn a;\n\t}", "@Test\r\n\tpublic void testGreatestCommonDivisorCalculation() {\r\n\r\n\t\tGreatestCommonDivisor testGcd = new GreatestCommonDivisor();\r\n\t\tint testGcdOne = testGcd.greatestCommonDivisorCalculation(21, 180);\r\n\t\tint testGcdTwo = testGcd.greatestCommonDivisorCalculation(5, 10);\r\n\t\tint testGcdTree = testGcd.greatestCommonDivisorCalculation(37, 77);\r\n\t\tint testGcdFour = testGcd.greatestCommonDivisorCalculation(30, 77);\r\n\r\n\t\tAssert.assertEquals(3, testGcdOne);\r\n\t\tAssert.assertEquals(5, testGcdTwo);\r\n\t\tAssert.assertEquals(1, testGcdTree);\r\n\t\tAssert.assertNotEquals(4, testGcdFour);\r\n\t}", "private static int calculateLCM(int a, int b){\n\t\tint gcd = calculateGCD(a, b);\n\t\tint lcm = (a/gcd)*b; //same as a*b/gcd but a*b could be very large number so avoiding that\n\t\treturn lcm;\n\t}", "private static boolean gcd(int a, int b) {\n while (b > 0) {\n int temp = b;\n b = a % b;\n a = temp;\n }\n return a == 1;\n }", "private int findGCD(int n1, int n2) {\n //n1 and n2 must always be positive for this GCD algorithm\n n1 = Math.abs(n1);\n n2 = Math.abs(n2);\n\n //continue through the loop if n2 is greater than 0\n while (n2 > 0) {\n int remainder = n1 % n2;\n //n1 will keep track of the GCD value\n n1 = n2;\n //n2 will keep track of the remainder\n n2 = remainder;\n }\n //setting n1 is the gcd value\n return n1;\n }", "private static int findLCM(int a, int b) {\n return a * (b / findGCD(a, b));\n }", "static private long lcm(long x, long y) {\n\t\tif (x != 0 && y != 0) {\n\t\t\tlong firstValue = x;\n\t\t\tlong secondValue = y;\n\t\t\treturn (firstValue * secondValue) / hcf(x, y);\n\t\t} else\n\t\t\treturn 1;\n\n\t}", "private static long gcd(long n, long d) {\n\t long n1 = Math.abs(n);\n\t long n2 = Math.abs(d);\n\t int gcd = 1;\n\t \n\t for (int k = 1; k <= n1 && k <= n2; k++) {\n\t if (n1 % k == 0 && n2 % k == 0) \n\t gcd = k;\n\t }\n\n\t return gcd;\n\t }", "static int hcf(int num1, int num2){\n int i = 1;\n int hcf = 0;\n\n while(i<=num1 || i<=num2){\n if (num1%i == 0 && num2%i==0){\n hcf = i;\n }\n i++;\n }\n return hcf;\n }", "public static int GCD(int A, int B) {\n while (B != 0) {\n int remainder = A % B;\n A = B;\n B = remainder;\n }\n\n return A;\n }", "private static int findGCD(int number1, int number2) {\r\n\t\t// base case\r\n\t\tif (number2 == 0) {\r\n\t\t\treturn number1;\r\n\t\t}\r\n\t\treturn findGCD(number2, number1 % number2);\r\n\t}", "public static void launchEuclidAlgorithmForGCD(int a, int b) {\n int number = Math.max(a, b);\n int divisor = Math.min(a, b);\n int quot = number / divisor;\n int rem = number - (divisor * quot);\n while (rem != 0) {\n System.out.println(number+\" = \"+divisor+\"(\"+quot+\") + \"+rem);\n number = divisor;\n divisor = rem;\n quot = number / divisor;\n rem = number - (divisor * quot);\n }\n System.out.println(number+\" = \"+divisor+\"(\"+quot+\") + \"+rem);\n System.out.println(\" \\u2234 gcd(\"+a+\", \"+b+\") = \"+divisor);\n }", "public static int gcf(int num, int denom) {\n \tint number=1;\t//declare num to equal 1\t\r\n\t\tif(denom<0) { //if denom is negative, multiply by -1 to get a positive denom\r\n\t\t\tdenom *= -1;\r\n\t\t}\r\n\t\tif(num<0) {\t//if the num is negative multiply it by -1 to make it positive\r\n\t\t\tnum *= -1;\r\n\t\t}\r\n\t\tfor(int i = 1; i <= num && i <= denom; i++) {\t//make a for loop that will test to see if i <=x&y (iterate to lowest # possible) to find the gcd\r\n\t\t\tif (isDivisibleBy(num,i) == true && isDivisibleBy(denom,i)==true) { \t// add 1 to i each loop; uses the method to check if i is factor of both integers\r\n\t\t\t\tnumber = i;\t//make num equal to i\r\n\t\t\t}\t\r\n\t\t}\r\n\t\treturn number; //return the number\r\n\t}", "public static int gcf(int [] operand) {\r\n \t\tint count = 1;\r\n \t\tint factor = 1;\r\n \t\twhile (count <= Math.min(Math.abs(operand[0]), operand[1])) { \r\n \t\t\t//Java had sign problems here if the numerator was negative\r\n \t\t\tif (Math.abs(operand[0]%count) == 0 && Math.abs(operand[1]%count) ==0) {\r\n \t\t\t\tfactor = count; \r\n \t\t\t}\r\n \t\t\tcount++;\r\n \t\t}\r\n \t\treturn (factor);\r\n \t}", "public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n int a, b;\n\n System.out.println(\"Please input two integers.\");\n a = input.nextInt();\n b = input.nextInt();\n\n System.out.println(\"Greatest common denominator is: \");\n System.out.println(greatestDenominator(a, b));\n\n }", "public static long PGCD (int a, int b) {\r\n\r\n\t\tlong pgcd = 0;\r\n\t\tint r = 0;\r\n\r\n\t\ta = Math.abs(a);\r\n\t\tb = Math.abs(b);\r\n\r\n\t\twhile(true){\r\n\t\t\tif (b == 0) {\r\n\t\t\t\tpgcd = a;\r\n\t\t\t\tbreak;\r\n\t\t\t} else {\r\n\t\t\t\tr = a % b;\r\n\t\t\t\ta = b;\r\n\t\t\t\tb = r;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn pgcd;\r\n\r\n\t}", "private static int gcd(int m, int n)\n {\n int mx = Math.max(m, n);\n int mn = Math.min(m, n);\n int remainder = 1;\n while (remainder != 0)\n {\n remainder = mx % mn;\n mx = mn;\n mn = remainder;\n }\n return mx;\n }", "private BigInteger lcm(BigInteger input1, BigInteger input2) {\n return input1.multiply(input2).divide(input1.gcd(input2));\n }", "public static int lowestCommonFactor(int a, int b)\n\t{\n\t\treturn (a * b) / greatestCommonFactor(a, b);\n\t}", "public static int HCF(int a, int b){\r\n int x, i, hcf = 0;\r\n \r\n for(i = 1; i<=a || i<=b; i++){\r\n if(a%i == 0 && b%i == 0){\r\n hcf = i;\r\n }} \r\n //System.out.print(hcf);\r\n return hcf;\r\n }", "public static int greatestCommonFactor(ArrayList<Integer> num1, ArrayList<Integer> num2)\n {\n //create an ArrayList to hold common factors\n ArrayList<Integer> commonFactors = new ArrayList<Integer>();\n int greatestFactor = 0;\n for(Integer i : num1)\n {\n if(num2.contains(i))\n {\n commonFactors.add(i);\n }\n }\n\n //find the greatest factor by looping through each element in the commonFactors list\n for(Integer a : commonFactors)\n {\n if(a > greatestFactor)\n {\n greatestFactor = a;\n }\n }\n return greatestFactor;\n }", "public static BigInteger lcm(String a, String b) \n\t\t{\n\t\t\tBigInteger s = new BigInteger(a); \n\t\t\tBigInteger s1 = new BigInteger(b); \n\n\t\t\t// calculate multiplication of two bigintegers \n\t\t\tBigInteger mul = s.multiply(s1); \n\n\t\t\t// calculate gcd of two bigintegers \n\t\t\tBigInteger gcd = s.gcd(s1); \n\n\t\t\t// calculate lcm using formula: lcm * gcd = x * y \n\t\t\tBigInteger lcm = mul.divide(gcd); \n\t\t\treturn lcm; \n\t\t}", "public int gcd() {\n return BigInteger.valueOf(row)\n .gcd(BigInteger.valueOf(column)).intValue();\n }", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n System.out.print(\"Enter num1: \");\n int num1 = sc.nextInt();\n System.out.print(\"Enter num2: \");\n int num2 = sc.nextInt();\n\n int hcf = hcf(num1, num2);\n int lcm = lcm(num1, num2, hcf);\n\n System.out.println(\"the lcm is: \" + lcm);\n\n }", "public int pgcdByDE(int a, int b) throws Exception{\n if(a <1 || b <1){\n throw new Exception(\"a et b doivent etre >= 1\");\n }\n int reste = a > b ? a % b : b % a;\n if(reste == 0)\n return a > b ? b : a;\n if(a > b){\n a = reste;\n }else b = reste;\n return pgcdByDE(a,b);\n }", "private static int pair_GCF(int a, int b) {\n int t;\n while (b != 0) {\n t = a;\n a = b;\n b = t % b;\n }\n return a;\n }", "private int gcd(int m, int n) {\n\t\tint r;\n\t\twhile(n != 0) {\n\t\t\tr = m % n;\n\t\t\tm = n;\n\t\t\tn = r;\n\t\t}\n\t\treturn m;\n\t}", "private int getGCD(int[] a) {\r\n\r\n int gcd = a[0];\r\n\r\n for (int i = 1; i < a.length; i++) {\r\n gcd = getGCD(gcd, a[i]);\r\n }\r\n return gcd;\r\n }", "public int solve(int A, int B, int C) {\n int lcm = (B * C) / gcd(B, C);\n return A / lcm;\n }", "private static int cprModFunction(int a, int b) {\n\t\tint res = a % b;\n\t\tif (res < 0)\n\t\t\tres += b;\n\t\treturn res;\n\t}", "public int getGCD(int numerator, int denominator)\n\t{\n\t\tif (denominator == 0)\n\t\t{\n\t\t\treturn numerator;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn getGCD(denominator, numerator % denominator);\n\t\t}\n\t}", "public static int gcd(int m,int n) {\n\t\tint p=m,q=n;\n\t\twhile(p%q!=0) {\n\t\t\tint r=p%q;\n\t\t\tp=q;\n\t\t\tq=r;\n\t\t}\n\t\treturn q;\n\t}", "public static int MCD_recursivo(int num1, int num2) {\n if (num2 == 0) {\r\n return num1;\r\n //como el if solo esta impriemindo el resultado aqui tenemos que volver a llamar la funcion recursiva las veces que sea necesario para encontra el maximon comun divisor\r\n } else {\r\n return MCD_recursivo(num2, num1 % num2);\r\n }\r\n }", "private static int gcd(int m, int n) {\n if (n == 0)\n return m;\n else\n return gcd(n, m % n);\n }", "@Test\n\tpublic void gcdOfFiboNumsTest() {\n\n\t\tAssert.assertTrue(ifn.gcdOfFiboNums(3, 12) == 2);\n\t}", "private int getLCD(int a, int b){\n return ( (a * b) / getGCD(a, b) ); \n }", "int div(int num1, int num2) {\n\t\treturn num1/num2;\n\t}", "static int findGreatestValue(int x, int y) {\r\n\t\t\r\n\t\tif(x>y)\r\n\t\t\treturn x;\r\n\t\telse\r\n\t\t return y;\r\n\t}", "public static void main(String[] args) {\r\n\t\tScanner kb = new Scanner(System.in);\r\n\t\tSystem.out.print(\"Enter two non-negative integers: \");\r\n\t\tint num1 = kb.nextInt();\r\n\t\tint num2 = kb.nextInt();\r\n\t\tkb.close();\r\n\r\n\t\tif (num1 < 0 || num2 < 0) {\r\n\t\t\tSystem.err.println(\"Fatal error: Cannot compute the greatest\" +\r\n\t\t\t\t\t\" common divisor of negative integers!\");\r\n\t\t\tSystem.exit(1); // Exit with error status code\r\n\t\t}\r\n\t\tSystem.out.println(\"Iteration: Greatest common divisor is \" +\r\n\t\t\t\tIteration.gcd(num1, num2));\r\n\t\tSystem.out.println(\"Recursion: Greatest common divisor is \" +\r\n\t\t\t\tRecursion.gcd(num1, num2));\r\n\t}", "static int gcd2(int m, int n) {\n if (m==0) return n;\n else return gcd2(n%m,m);\n }", "public static int largestMultipleOfXLeqY(int x, int y) {\n\treturn (y / x) * x;\n }", "public static int MCD_iterativo(int n1, int n2) {\n if (n1 > n2) {\r\n a = n1;\r\n b = n2;\r\n } else {\r\n a = n2;\r\n b = n1;\r\n }\r\n /*Calculamos el maximo comun divisior mediante un ciclo iterativo en el cual nos guiamos con el residuo de dividir el numero mayor entre el menor\r\n y retornamos el valor \r\n */\r\n do {\r\n aux = b;\r\n b = a % b;\r\n a = aux;\r\n } while (b != 0);\r\n return aux;\r\n }", "public static Integer gcd(Integer p, Integer q) {\n\t\tif (q == 0) {\n\t\t return p;\n\t\t}\n\t\treturn gcd(q, p % q);\n\t}", "private BigInteger gcd(BigInteger n, BigInteger d)\n\t\t{\n\t\t\t// Returns the absolute values of the BigInteger\n\t\t\tBigInteger n1 = n.abs();\n\t\t\tBigInteger n2 = d.abs();\n\t\t\t\n\t\t\t// If n2 equals 0 return n1\n\t\t\tif(n2.equals(BigInteger.ZERO)){\n\t\t\t\treturn n1;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t// else recursively return the gcd of n2 and n1%n2\n\t\t\t\treturn gcd(n2,n1.mod(n2));\n\t\t\t}\n\t\t}", "private static int gcd(int m, int n) {\r\n\t\tif (m % n == 0)\r\n\t\t\treturn n; // Base case\r\n\t\telse // Recursive call\r\n\t\t\treturn gcd(n, m % n);\r\n\t}", "private void reduce()\r\n {\r\n int lowest, highest, temp;\r\n if(Math.abs(numerator) >= Math.abs(denominator))\r\n { \r\n lowest = Math.abs(denominator);\r\n highest = Math.abs(numerator);\r\n }\r\n else\r\n {\r\n lowest = Math.abs(numerator);\r\n highest = Math.abs(denominator);\r\n }\r\n while(lowest != 0)\r\n {\r\n temp = lowest;\r\n lowest = highest % lowest;\r\n highest = temp;\r\n } \r\n numerator = numerator / highest;\r\n denominator = denominator / highest; \r\n \r\n if(denominator < 0)\r\n {\r\n numerator = numerator * (-1);\r\n denominator = denominator * (-1); \r\n } \r\n }", "private static long calc2(int max)\n {\n long sum = 1; // \"1\" is valid (1 + 1/1 = 2)\n boolean[] primes = PrimeUtils.isPrimeSoE(max + 1);\n\n // we skip odd values (1 + n/1 is even if n is odd)\n for (int n = 2; n <= max; n = n + 2) {\n // test special case: 1\n if (!primes[n + 1]) {\n continue;\n }\n int sqrt = (int) Math.sqrt(n);\n // skip squares\n if (sqrt * sqrt == n) {\n continue;\n }\n boolean flag = true;\n for (int d = 2; d <= sqrt; d++) {\n if (n % d != 0) {\n continue;\n }\n int e = n / d;\n if (!primes[d + e]) {\n flag = false;\n break;\n }\n }\n if (flag) {\n sum += n;\n // System.out.println(n);\n }\n }\n return sum;\n }", "public static int gcd(int m, int n) {\n\t\tif(n==0) return m;\r\n\t\telse{\r\n\t\t\treturn gcd(n,m%n);\r\n\t\t}\r\n\t}", "public static int reduceNumerator(int numerator, int denominator) {\n int start;\n int greatestCommonFactor = 1;\n if (numerator > denominator) {\n start = numerator;\n } else {\n start = denominator;\n }\n if (start != 0) {\n while (greatestCommonFactor != start) {\n if (numerator % start == 0 && denominator % start == 0) {\n greatestCommonFactor = start;\n start++;\n }\n start--;\n }\n }\n return numerator / greatestCommonFactor;\n }", "public static int greatestCommonFactor(int m, int n)\n\t{\n\t\tif(n == 0)\n\t\t{\n\t\t\treturn m;\n\t\t}\n\t\t\n\t\treturn greatestCommonFactor(n, m%n);\n\t\t\n\t}", "public int div(int a, int b) {\n\t\t\treturn compute(a, b, OPER_DIV);\n\t\t}", "public int division(int a, int b) {\n return a / b;\n }", "public int findMax(int num1, int num2) {\n return 0;\n }", "public static void calcIntegersDivBy()\r\n\t{\r\n\t\tint x = 5;\r\n\t\tint y = 20;\r\n\t\tint p = 3;\r\n\t\tint result = 0;\r\n\t\tif (x % p == 0)\r\n\t\t\tresult = (y / p - x / p + 1);\r\n\t\telse\r\n\t\t\tresult = (y / p - x / p);\r\n\t\tSystem.out.println(result);\r\n\t}", "public static void gcd (int a[], int b[], int gcd[]) {\n\t\tif (isZero(a)) { assign (gcd, a); return; }\n\t\tif (isZero(b)) { assign (gcd, b); return; }\n\t\t\n\t\ta = copy (a); // Make copies to ensure\n\t\tb = copy (b); // that a and b are not modified.\n\t\t\n\t\twhile (!isZero(b)) {\n\t\t\t// last argument to subtract represents sign of result which\n\t\t\t// we can ignore since we only subtract smaller from larger.\n\t\t\t// Note compareTo (a, b) is positive if a > b.\n\t\t\tif (compareTo(a, b) > 0) {\n\t\t\t\tsubtract (a, b, gcd, new int[1]);\n\t\t\t\tassign (a, gcd);\n\t\t\t} else {\n\t\t\t\tsubtract (b, a, gcd, new int[1]);\n\t\t\t\tassign (b, gcd);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// value held in a is the computed gcd of original (a,b).\n\t\tassign (gcd, a);\n\t}", "public static void main(String[] args) {\n\t\tint a=ArithmeticUtils.gcd(361,285);\n\t\tSystem.out.println(a);\n\t}", "public int compare(Integer a,Integer b)\n\t{\n\t\treturn a%2-b%2;\n\t}", "private void simplify(){\n\n\t\tint gcd;\n\t\twhile(true){ \n\t \tgcd = greatestCommonDivisor(myNumerator, myDenominator);\n\t \tif (gcd ==1) return;\n\t \tmyNumerator = myNumerator / gcd;\n\t \tmyDenominator = myDenominator / gcd;\n\t\t}\n }" ]
[ "0.79863614", "0.76833254", "0.7663785", "0.76115954", "0.7441948", "0.733521", "0.733034", "0.7300575", "0.729147", "0.72872823", "0.72812617", "0.7269814", "0.7264507", "0.7235496", "0.7227425", "0.72238314", "0.7200049", "0.71814", "0.7142658", "0.7131085", "0.7105739", "0.70881534", "0.70809764", "0.70688766", "0.7068209", "0.7045871", "0.7043548", "0.7038832", "0.7012542", "0.699671", "0.696886", "0.69626886", "0.6943645", "0.69074947", "0.68971753", "0.68882424", "0.68461245", "0.68305594", "0.681328", "0.6771527", "0.67474544", "0.6744605", "0.67377776", "0.6706416", "0.6680588", "0.6641896", "0.66388", "0.6637901", "0.6601575", "0.65784997", "0.6571824", "0.65697914", "0.6500655", "0.64498395", "0.64491487", "0.642478", "0.64048594", "0.638516", "0.63128096", "0.6309314", "0.62891126", "0.6204923", "0.6197482", "0.6134784", "0.61044115", "0.609485", "0.6084208", "0.6080257", "0.60769695", "0.6033667", "0.60251", "0.60155123", "0.5979679", "0.5972284", "0.5954808", "0.59476596", "0.593525", "0.59204745", "0.59202415", "0.5914178", "0.5906739", "0.5902182", "0.5894824", "0.5893862", "0.58877987", "0.5867957", "0.5809463", "0.578642", "0.57851094", "0.5781714", "0.578097", "0.5768211", "0.57390535", "0.57316977", "0.5726204", "0.56975925", "0.56901056", "0.56837475", "0.5675775", "0.5670597" ]
0.6992382
30
Method to generate random questions for the game to use
public static ArrayList<String> generateQ(int num, String op){ //Calls the RandomQuestion from the KeyFunctions Class //Rounding -> "^" //Algebra -> "Alg" //Percentages -> "%" //Ratio -> ":" //Fraction -> "//" bothList = new ArrayList<String>(); if (op.equals("+")||op.equals("-")||op.equals("*")||op.equals("/")){ for (int i = 1; i <= num; i++){ String[] x = randomQuestionKS2(op); bothList.add(x[0]); bothList.add(x[1]); }} if (op.equals("^")||op.equals("Alg")||op.equals("%")||op.equals(":")||op.equals("//")){ for (int i = 1; i <= num; i++){ String[] x = randomQuestions(op); bothList.add(x[0]); bothList.add(x[1]); }} //System.out.print(questionList); //System.out.print(answerList); //System.out.print(bothList); return bothList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String generateQuestion(){\r\n qType = rand.nextInt(2);\r\n if (qType ==0)\r\n return \"Multiple choice question.\";\r\n else\r\n return \"Single choice question.\";\r\n }", "public void questionGenerator()\n\t{\n\t\t//creates questions\n\t\toperation = rand.nextInt(3) + min;\n\t\t\n\t\t//makes max # 10 to make it easier for user if random generator picks multiplication problem\n\t\tif (operation == 3)\n\t\t\tmax = 10; \n\t\t\n\t\t//sets random for number1 & number2\n\t\tnumber1 = rand.nextInt(max) + min; //random number max and min\n\t\tnumber2 = rand.nextInt(max) + min; \n\t\t\t\t\n\t\t//ensures final answer of problem is not negative by switching #'s if random generator picks subtraction problem\n\t\tif (operation == 2 && number1 < number2)\n\t\t{\n\t\t\tint tempNum = number1;\n\t\t\tnumber1 = number2;\n\t\t\tnumber2 = tempNum;\n\t\t}\n\t\tanswer = 0;\n\t\t\n\t\t//randomizes operator to randomize question types\n\t\tif (operation == 1)\n\t\t{\n\t\t\toperator = '+';\n\t\t\tanswer = number1 + number2;\n\t\t}\n\t\tif (operation == 2)\n\t\t{\n\t\t\toperator = '-';\n\t\t\tanswer = number1 - number2;\n\t\t}\n\t\tif (operation == 3)\n\t\t{\n\t\t\toperator = '*';\n\t\t\tanswer = number1 * number2;\n\t\t}\n\t\t\t\n\t\t//prints question\n\t\tlabel2.setText(\"Question: \" + number1 + \" \" + operator + \" \" + number2 + \" = ?\");\n\t}", "private void generateNewQuestion() {\n GameManager gameManager = new GameManager();\n long previousQuestionId = -1;\n try {\n previousQuestionId = mGameModel.getQuestion().getId();\n } catch (NullPointerException e) {\n previousQuestionId = -1;\n }\n mGameModel.setQuestion(gameManager.generateRandomQuestion(previousQuestionId));\n mGameModel.getGameMaster().setDidPlayerAnswer(false);\n mGameModel.getGameMaster().setPlayerAnswerCorrect(false);\n mGameModel.getGameSlave().setDidPlayerAnswer(false);\n mGameModel.getGameSlave().setPlayerAnswerCorrect(false);\n LOGD(TAG, \"New question generated\");\n }", "public void generateRandomQuestions(){\r\n numberHolder = new ArrayList<>(NUMBER_OF_QUESTIONS);\r\n for (int i = 0; i < NUMBER_OF_QUESTIONS; i++)\r\n numberHolder.add(i);\r\n\r\n Collections.shuffle(numberHolder);\r\n System.out.println(numberHolder);\r\n\r\n }", "public abstract void generateQuestion();", "public void randomize(){\r\n\t\tfor(int i = 0;i<this.myQuestions.size();i++){\r\n\t\t\tthis.myQuestions.get(i).randomize();\r\n\t\t}\r\n\t\tCollections.shuffle(this.myQuestions);\r\n\t}", "private ArrayList<String> getRandQuestion() \n\t{\t\n\t\tquestionUsed = true;\n\t\t\n\t\tRandom randomizer = new Random();\n\t\tint randIdx = 0;\n\t\t\n\t\tif(questionsUsed.isEmpty())\n\t\t\trandIdx = randomizer.nextInt(allQuestions.size());\n\t\telse\n\t\t{\n\t\t\twhile(questionUsed)\n\t\t\t{\n\t\t\t\trandIdx = randomizer.nextInt(allQuestions.size());\n\t\t\t\tcheckIfQuestionUsed(randIdx);\n\t\t\t}\n\t\t}\n\t\t\n\t\tquestionsUsed.add(randIdx);\n\t\t\n\t\treturn allQuestions.get(randIdx);\n\t}", "@GET\n @Path(\"/randomquestion\")\n public String getRandomQuestion() {\n return \"test\";\n //return map.keySet().toArray()[ThreadLocalRandom.current().nextInt(1, map.size())].toString();\n }", "public String printOutQuestion()\n\t{\n\t\tRandom rand = new Random();\n\t\tString[] answers = new String[4];\n\t\tString returnString;\n\t\tanswers[0] = answer;\n\t\tanswers[1] = falseAnswers[0];\n\t\tanswers[2] = falseAnswers[1];\n\t\tanswers[3] = falseAnswers[2];\n\t\tString firstAns = \"\", secondAns = \"\", thirdAns = \"\", fourthAns = \"\";\n\t\t\n\t\twhile(firstAns == secondAns || firstAns == thirdAns || firstAns == fourthAns || secondAns == thirdAns || secondAns == fourthAns || thirdAns == fourthAns)\n\t\t{\n\t\t\tfirstAns = answers[rand.nextInt(4)];\n\t\t//\tSystem.out.println(firstAns); Used for debugging\n\t\t\tsecondAns = answers[rand.nextInt(4)];\n\t\t//\tSystem.out.println(secondAns); Used for debugging\n\t\t\tthirdAns = answers[rand.nextInt(4)];\n\t\t//\tSystem.out.println(thirdAns); Used for debugging\n\t\t\tfourthAns = answers[rand.nextInt(4)];\n\t\t//\tSystem.out.println(fourthAns); Used for debugging\n\t\t}\n\t\t\n\t\tanswerA = firstAns;\n\t\tanswerB = secondAns;\n\t\tanswerC = thirdAns;\n\t\tanswerD = fourthAns;\n\t\t//System.out.println(questionString + \"Answer A: \" + firstAns + \"Answer B: \" + secondAns + \"Answer C: \" + thirdAns + \"Answer D: \" + fourthAns); Used for debugging\n\t\treturnString = questionString + \"?\"; \n\t\tSystem.out.println(\"Actual Answer is: \" + answer);\n\t\treturn returnString;\n\t}", "private void settingQuestion() {\n\n int[] setWord = {0, 0, 0, 0, 0};\n int[] setPos = {0, 0, 0, 0};\n int[] setBtn = {0, 0, 0, 0};\n\n Random ans = new Random();\n int wordNum = ans.nextInt(vocabularyLesson.size());\n //answer = vocabularyLesson.get(wordNum).getMean();\n word = vocabularyLesson.get(wordNum).getWord();\n vocabularyID = vocabularyLesson.get(wordNum).getId();\n answer = word;\n\n Practice practice = pc.getPracticeById(vocabularyID);\n if (practice != null) {\n Log.d(\"idVocabulary\", practice.getSentence());\n question.setText(practice.getSentence());\n }\n\n\n // Random position contain answer\n setWord[wordNum] = 1;\n Random p = new Random();\n int pos = p.nextInt(4);\n if (pos == 0) {\n word1.setText(word);\n setBtn[0] = 1;\n }\n if (pos == 1) {\n word2.setText(word);\n setBtn[1] = 1;\n }\n if (pos == 2) {\n word3.setText(word);\n setBtn[2] = 1;\n }\n if (pos == 3) {\n word4.setText(word);\n setBtn[3] = 1;\n }\n setPos[pos] = 1;\n\n // Random 3 position contain 3 answer\n for (int i = 0; i < 3; i++) {\n Random ques = new Random();\n int num = ques.nextInt(5);\n int p1 = ques.nextInt(4);\n while (setWord[num] == 1 || setPos[p1] == 1) {\n num = ques.nextInt(5);\n p1 = ques.nextInt(4);\n }\n String wordIncorrect = vocabularyLesson.get(num).getWord();\n setWord[num] = 1;\n setPos[p1] = 1;\n if (setBtn[p1] == 0 && p1 == 0) {\n word1.setText(wordIncorrect);\n setBtn[0] = 1;\n }\n if (setBtn[p1] == 0 && p1 == 1) {\n word2.setText(wordIncorrect);\n setBtn[1] = 1;\n }\n if (setBtn[p1] == 0 && p1 == 2) {\n word3.setText(wordIncorrect);\n setBtn[2] = 1;\n }\n if (setBtn[p1] == 0 && p1 == 3) {\n word4.setText(wordIncorrect);\n setBtn[3] = 1;\n }\n }\n\n }", "public void setQuestion(){\n Random rand = new Random();\n a = rand.nextInt(maxRange)+1;\n b = rand.nextInt(maxRange)+1;\n int res = rand.nextInt(4);\n equation.setText(a +\"+\"+ b);\n for(int i=0; i<4; i++){\n if(i == res)\n arr[i] = a+b;\n else {\n int answer = rand.nextInt(2*maxRange)+1;\n while(answer == a+b)\n answer = rand.nextInt(2*maxRange)+1;\n arr[i] = answer;\n }\n }\n for(int i=0; i<4; i++)\n buttons[i].setText(String.valueOf(arr[i]));\n }", "public Answer randomAnswer()\n\t{\n\t\tRandom random = new Random();\n\t\tint num = random.nextInt(answers.length);\n\t\treturn answers[num];\n\t}", "public MovieQuestion getQuestion() {\n\t\tMovieQuestion newQ = new MovieQuestion();\n\t\tint row;\n\t\tCursor c;\n\t\tboolean okToAdd = false;\n\n\t\t// Pick random question\n\t\tswitch ((int)(Math.random()*9)) {\n\t\tcase 0: // Who directed the movie %s?\n\t\t\tc = mDb.rawQuery(\"SELECT * FROM movies\", null);\n\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\tc.moveToPosition(row);\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[0], c.getString(1));\n\t\t\tnewQ.answers[0] = c.getString(3);\n\t\t\t\n\t\t\tLog.i(\"NewQuestion\", \"Correct:\" + c.getString(3));\n\t\t\t\n\t\t\t// Fill answers with unique wrong values\n\t\t\tfor(int i = 1; i < 4;) {\n\t\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\t\tc.moveToPosition(row);\n\t\t\t\tLog.i(\"NewQuestion\", \"Wrong:\" + c.getString(3));\n\t\t\t\t// i < 4, so we do not increment indefinitely.\n\t\t\t\tfor(int j = 0; j < i && i < 4; j++) {\n\t\t\t\t\tif(newQ.answers[j].equals(c.getString(3))) {\n\t\t\t\t\t\tokToAdd = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tokToAdd = true;\n\t\t\t\t}\n\t\t\t\tif(okToAdd)\n\t\t\t\t\tnewQ.answers[i++] = c.getString(3);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 1: // When was the movie %s released?\n\t\t\tc = mDb.rawQuery(\"SELECT * FROM movies\", null);\n\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\tc.moveToPosition(row);\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[1], c.getString(1));\n\t\t\tnewQ.answers[0] = c.getString(2);\n\n\t\t\t// Fill answers with unique wrong values\n\t\t\tfor(int i = 1; i < 4;) {\n\t\t\t\tint wrongYear = Integer.parseInt(newQ.answers[0]) + (int)((Math.random()-.5)*50); // +/- [1-25] years\n\t\t\t\tif (wrongYear <= 2014 && wrongYear != Integer.parseInt(newQ.answers[0]))\n\t\t\t\t\tnewQ.answers[i++] = \"\" + wrongYear;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 2: // Which star was in the movie %s?\n\t\t\tc = mDb.rawQuery(\"SELECT DISTINCT m.`title`, m.`director`, s.`first_name`, s.`last_name` FROM `movies` m, `stars` s, `stars_in_movies` sm WHERE m.id = sm.movie_id AND s.id = sm.star_id AND s.id GROUP BY m.`id`, s.`first_name`, s.`last_name` ORDER BY RANDOM() LIMIT 4\", null);\n\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\tc.moveToFirst(); // only 4 results are returned.\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[2], c.getString(0));\n\t\t\tnewQ.answers[0] = c.getString(2) +\" \"+ c.getString(3); \n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\tfor (int j = 1; j < 4; j++) {\n\t\t\t\tc.moveToNext();\n\t\t\t\tnewQ.answers[j] = c.getString(2) +\" \"+ c.getString(3);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 3: // Which star was not in the movie %s?\n\t\t\t// The lone star, the left out one...the answer\n\t\t\tString singleActorQuery = \"SELECT mov.`title`, star.`first_name`, star.`last_name`, star.`id` FROM `movies` mov, `stars` star, \"+\n\t\t\t\t\t\"(SELECT movie_id, star_id FROM `stars_in_movies` GROUP BY movie_id HAVING COUNT(star_id) <= 1 ORDER BY RANDOM() LIMIT 1) mult \"+ \n\t\t\t\t\t\"WHERE mov.`id` = mult.`movie_id` AND star.`id`= mult.`star_id`\";\n\t\t\tc = mDb.rawQuery(singleActorQuery, null);\n\t\t\tc.moveToFirst();\n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\tnewQ.answers[0] = c.getString(1) +\" \"+c.getString(2);\n\n\t\t\t// The cool kids: A group of actors in the same movie....excluding the lone star.\n//\t\t\tString starId = c.getString(3);\n\t\t\tString multipleActorQuery = \"SELECT mov.`title`, star.`first_name`, star.`last_name` \" +\n\t\t\t\t\t\"FROM `movies` mov, `stars` star, `stars_in_movies` sim, \" +\n\t\t\t\t\t\"(SELECT movie_id, star_id FROM `stars_in_movies` GROUP BY movie_id HAVING COUNT(star_id) > 2 ORDER BY RANDOM() LIMIT 1) mult\" +\n\t\t\t\t\t\" WHERE mov.`id` = mult.`movie_id` AND star.`id` = sim.`star_id` AND mult.`movie_id` = sim.`movie_id` \" +\n\t\t\t\t\t\"LIMIT 3\";\n\t\t\tc = mDb.rawQuery(multipleActorQuery, null);\n\t\t\tc.moveToFirst();\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[3], c.getString(0));\n\t\t\tfor (int i = 1; i < 4; i++) {\n\t\t\t\tnewQ.answers[i] = c.getString(1) +\" \"+c.getString(2);\n\t\t\t\tc.moveToNext();\n\t\t\t}\n\n\t\t\tbreak;\n\t\tcase 4: // In which movie do the stars %s and %s appear together?\n\t\t\t// Get a movie they both star in\n\t\t\tc = mDb.rawQuery(\"SELECT m.`title`, s.`first_name`, s.`last_name`, s2.`first_name`, s2.`last_name`\" +\n\t\t\t\t\t\"FROM `movies` m, `stars` s, `stars` s2, `stars_in_movies` sm, `stars_in_movies` sm2 \" +\n\t\t\t\t\t\"WHERE m.id = sm.movie_id AND m.id = sm2.movie_id AND s.id = sm.star_id AND s2.id = sm2.star_id AND s.id != s2.id \" +\n\t\t\t\t\t\"GROUP BY m.`id`, s.`first_name`, s.`last_name` ORDER BY RANDOM() LIMIT 4\", null);\n\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\tc.moveToFirst();\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[4], c.getString(1)+\" \"+c.getString(2), c.getString(3)+\" \"+c.getString(4));\n\t\t\tnewQ.answers[0] = c.getString(0); \n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\tfor (int j = 1; j < 4; j++) {\n\t\t\t\tc.moveToNext();\n\t\t\t\tnewQ.answers[j] = c.getString(0);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 5: // Who directed the star %s?\n\t\t\tc = mDb.rawQuery(\"SELECT DISTINCT m.`year`, m.`director`, s.`first_name`, s.`last_name` FROM `movies` m, `stars` s, `stars_in_movies` sm WHERE m.id = sm.movie_id AND s.id = sm.star_id AND s.id GROUP BY m.`id`, s.`first_name`, s.`last_name` ORDER BY RANDOM() LIMIT 4\", null);\n\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\tc.moveToFirst(); // only 4 results are returned.\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[5], c.getString(2) +\" \"+ c.getString(3));\n\t\t\tnewQ.answers[0] = c.getString(1); \n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\tfor (int j = 1; j < 4; j++) {\n\t\t\t\tc.moveToNext();\n\t\t\t\tnewQ.answers[j] = c.getString(1);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 6: // Which star appears in both movies %s and %s?\n\t\t\t// Get the 2 movies with the same actor...\n\t\t\tc = mDb.rawQuery(\"SELECT mov.`id`, mov.`title`, star.`first_name`, star.`last_name`, star.`id` FROM `movies` mov, `stars_in_movies` sim, `stars` star, (SELECT movie_id, star_id, COUNT(movie_id) as cnt FROM `stars_in_movies` GROUP BY star_id HAVING COUNT(movie_id) > 3 ORDER BY RANDOM() LIMIT 1) as popular WHERE sim.`movie_id` = mov.`id` AND popular.`star_id` = sim.`star_id` AND star.`id` = sim.`star_id` LIMIT 2\", null);\n\t\t\tc.moveToFirst();\n\t\t\tString id = c.getString(4);\n\t\t\t\n\t\t\tString[] movies = new String[2];\n\t\t\tmovies[0] = c.getString(1);\n\t\t\tc.moveToNext();\n\t\t\tmovies[1] = c.getString(1);\n\t\t\t\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[6], movies[0], movies[1]);\n\t\t\tnewQ.answers[0] = c.getString(2) +\" \"+ c.getString(3);\n\t\t\t\n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\t\n\t\t\t// Pick 3 alternatives...\n\t\t\tc = mDb.rawQuery(\"SELECT s.first_name, s.last_name FROM stars s WHERE s.id != \"+id+\" GROUP BY s.id ORDER BY RANDOM() LIMIT 3\", null);\n\t\t\tc.moveToFirst();\n\t\t\tfor (int i = 1; i < 4; i++) {\n\t\t\t\tnewQ.answers[i] = c.getString(0) +\" \"+ c.getString(1);\n\t\t\t\tc.moveToNext();\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 7: // Which star did not appear in the same movie with the star %s?\n\t\t\t// The lone star, the left out one...the answer\n\t\t\tString singleActorQueryII = \"SELECT mov.`title`, star.`first_name`, star.`last_name`, star.`id` FROM `movies` mov, `stars` star, \"+\n\t\t\t\t\t\"(SELECT movie_id, star_id FROM `stars_in_movies` GROUP BY movie_id HAVING COUNT(star_id) <= 1 ORDER BY RANDOM() LIMIT 1) mult \"+ \n\t\t\t\t\t\"WHERE mov.`id` = mult.`movie_id` AND star.`id`= mult.`star_id`\";\n\t\t\tc = mDb.rawQuery(singleActorQueryII, null);\n\t\t\tc.moveToFirst();\n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\tnewQ.answers[0] = c.getString(1) +\" \"+c.getString(2);\n\n\t\t\t// The cool kids: A group of actors in the same movie....excluding the lone star.\n\t\t\tString multipleActorQueryII = \"SELECT mov.`title`, star.`first_name`, star.`last_name` \" +\n\t\t\t\t\t\"FROM `movies` mov, `stars` star, `stars_in_movies` sim, \" +\n\t\t\t\t\t\"(SELECT movie_id, star_id FROM `stars_in_movies` GROUP BY movie_id HAVING COUNT(star_id) > 3 ORDER BY RANDOM() LIMIT 1) mult\" +\n\t\t\t\t\t\" WHERE mov.`id` = mult.`movie_id` AND star.`id` = sim.`star_id` AND mult.`movie_id` = sim.`movie_id` \" +\n\t\t\t\t\t\" GROUP BY star.`id`\"+\n\t\t\t\t\t\" LIMIT 4\";\n\t\t\tc = mDb.rawQuery(multipleActorQueryII, null);\n\t\t\tc.moveToFirst();\n\t\t\t// Take the first of the group and put his name in the question\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[7], c.getString(1) +\" \"+c.getString(2));\n\t\t\tc.moveToNext();\n\t\t\tfor (int i = 1; i < 4; i++) {\n\t\t\t\tnewQ.answers[i] = c.getString(1) +\" \"+c.getString(2);\n\t\t\t\tc.moveToNext();\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault: // Who directed the star %s in year %s?\n\t\t\tc = mDb.rawQuery(\"SELECT DISTINCT m.`year`, m.`director`, s.`first_name`, s.`last_name` FROM `movies` m, `stars` s, `stars_in_movies` sm WHERE m.id = sm.movie_id AND s.id = sm.star_id AND s.id GROUP BY m.`id`, s.`first_name`, s.`last_name` ORDER BY RANDOM() LIMIT 4\", null);\n\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\tc.moveToFirst(); // only 4 results are returned.\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[8], c.getString(2) +\" \"+ c.getString(3), c.getString(0));\n\t\t\tnewQ.answers[0] = c.getString(1); \n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\tfor (int j = 1; j < 4; j++) {\n\t\t\t\tc.moveToNext();\n\t\t\t\tnewQ.answers[j] = c.getString(1);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\treturn newQ;\n\t}", "private Answer generateAnswer(int numberOfPossibleAnswers, int numberOfCorrectAnswers) {\n\t\tAnswer answer = new Answer();\n\t\t//check to make sure that an impossible value cannot be passed\n\t\tif(numberOfPossibleAnswers > 9) {\n\t\t\tnumberOfPossibleAnswers = 9;\n\t\t}\n\t\t//check to make sure that an impossible value cannot be passed\n\t\tif(numberOfCorrectAnswers > 9) {\n\t\t\tnumberOfCorrectAnswers = 9;\n\t\t}\n\t\tRandom random = new Random();\n\t\t//if the question can only have one correct answer the student will only choose one answer at random\n\t\tif(numberOfCorrectAnswers == 1) {\n\t\t\tanswer.setAnswer(random.nextInt(numberOfPossibleAnswers));\n\t\t}\n\t\telse if(numberOfCorrectAnswers > 1) {\n\t\t\t//randomly chooses how many answers to give for the question\n\t\t\tint numberOfAnswers = random.nextInt(numberOfPossibleAnswers) + 1;\n\t\t\t//chooses at random which answers to choose\n\t\t\tfor(int i = 0; i < numberOfAnswers; i++) { \n\t\t\t\tint answerId = random.nextInt(numberOfPossibleAnswers);\n\t\t\t\t//if the answer has already been given by the student, the student will choose \n\t\t\t\t//another random answer until it has not already been chosen\n\t\t\t\twhile(answer.getAnswer(answerId)) {\n\t\t\t\t\tanswerId = random.nextInt(numberOfPossibleAnswers);\n\t\t\t\t}\n\t\t\t\tanswer.setAnswer(answerId);\n\t\t\t}\n\t\t}\n\t\treturn answer;\n\t}", "public void random(){\r\n\t\tRandom rand = new Random();\r\n\t\trandArray = new int[6];\r\n\t\tfor (int i = 0; i < 6; i++){\r\n\t\t\t//Randomly generated number from zero to nine\r\n\t\t\trandom = rand.nextInt(10);\r\n\t\t\t//Random values stored into the array\r\n\t\t\trandArray[i] = random;\r\n\t\t\tif(i == 0){\r\n\t\t\t\ta = random;\r\n\t\t\t}\r\n\t\t\tif(i == 1){\r\n\t\t\t\tb = random;\r\n\t\t\t}\r\n\t\t\tif(i == 2){\r\n\t\t\t\tc = random;\r\n\t\t\t}\r\n\t\t\tif(i == 3){\r\n\t\t\t\td = random;\r\n\t\t\t}\r\n\t\t\tif(i == 4){\r\n\t\t\t\tf = random;\r\n\t\t\t}\r\n\t\t\tif(i == 5){\r\n\t\t\t\tg = random;\r\n\t\t\t}\r\n\t\t\t//Random values outputted\r\n\t\t\t//Prints out if the hint was not used.\r\n\t\t\tif (executed == false || guessed == true ){\r\n\t\t\t\tprint(randArray[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Prints out if the hint was not used.\r\n\t\tif (executed == false || guessed == true){\r\n\t\t\tprintln(\" Randomly Generated Value\");\r\n\t\t}\r\n\t}", "static void generateQuestions(int numQuestions, int selection, String fileName, String points) {\n String finalAnswers = \"\";\n switch (selection) {\n case 1:\n for (int i = 0; i < numQuestions; i++) {\n finalAnswers += one(points);\n }\n break;\n case 2:\n for (int i = 0; i < numQuestions; i++) {\n finalAnswers += two(points);\n }\n break;\n case 3:\n for (int i = 0; i < numQuestions; i++) {\n finalAnswers += three(points);\n }\n break;\n case 4:\n for (int i = 0; i < numQuestions; i++) {\n finalAnswers += four(points);\n }\n break;\n default:\n System.out.println(\"Wrong selection. Please try again\");\n break;\n }\n writeAnswers(fileName, finalAnswers);\n }", "public static String[] randomQuestionKS2(String op){\r\n int part1 = randomNumber();\r\n int part2 = randomNumber();\r\n \r\n ArrayList<Integer> multiQs = new ArrayList<>(Arrays.asList(2,5,10));\r\n ArrayList<Integer> divQs = new ArrayList<>(Arrays.asList(5,10));\r\n \r\n \r\n if (op.equals(\"*\")){ \r\n int pos = multiQs.get(randomMulti());\r\n \r\n part1 = pos;\r\n } else if (op.equals(\"/\")){\r\n ArrayList <Integer> divide10 = new ArrayList<>(Arrays.asList(10,20,30,40,50,60,70,80,90,100));\r\n \r\n int pos = (randomNumber()) - 1;\r\n int pos2 = (randomDivide());\r\n \r\n part1 = divide10.get(pos);\r\n part2 = divQs.get(pos2); \r\n }\r\n \r\n String str1 = Integer.toString(part1);\r\n String str2 = Integer.toString(part2);\r\n \r\n String question = str1 + \" \" + op + \" \" + str2;\r\n int ans = 0;\r\n \r\n if (op.equals(\"+\")){\r\n part1 = randomNumber50();\r\n part2 = randomNumber50();\r\n ans = part1 + part2;\r\n str1 = Integer.toString(part1);\r\n str2 = Integer.toString(part2);\r\n question = str1 + \" \" + op + \" \" + str2;\r\n }\r\n else if (op.equals(\"-\")){\r\n part1 = randomNumber100();\r\n part2 = randomNumber50();\r\n if (part1 < part2){\r\n ans = part2 - part1;\r\n str1 = Integer.toString(part1);\r\n str2 = Integer.toString(part2);\r\n question = str2 + \" \" + op + \" \" + str1;\r\n }\r\n ans = part1 - part2;\r\n str1 = Integer.toString(part1);\r\n str2 = Integer.toString(part2);\r\n question = str1 + \" \" + op + \" \" + str2;\r\n }\r\n else if (op.equals(\"*\")){\r\n ans = part1 * part2;\r\n }\r\n else if (op.equals(\"/\")){\r\n ans = part1 / part2;\r\n }\r\n \r\n String ansStr = Integer.toString(ans);\r\n \r\n String x[] = new String[2];\r\n x[0] = question;\r\n x[1] = ansStr;\r\n \r\n return x;\r\n }", "protected void constructNewQuestion(){\n arabicWordScoreItem = wordScoreTable.whatWordToLearn();\n arabicWord = arabicWordScoreItem.word;\n correctAnswer = dictionary.get(arabicWord);\n\n for (int i=0;i<wrongAnswers.length;i++){\n int wrongAnswerId;\n String randomArabicWord;\n String wrongAnswer;\n do {\n wrongAnswerId = constructQuestionRandom.nextInt(next_word_index);\n randomArabicWord = dictionary_key_list.get(wrongAnswerId);\n wrongAnswer = dictionary.get(randomArabicWord);\n } while (wrongAnswer.equals(correctAnswer));\n wrongAnswers[i] = wrongAnswer;\n }\n }", "private String generateAnswer() throws IOException {\n int j = lineNumber();\n int i = 0;\n String result = \"\";\n Random rnd = new Random();\n int rndNumber = rnd.nextInt(j);\n File answers = new File(this.settings.getValue(\"botAnswerFile\"));\n try (RandomAccessFile raf = new RandomAccessFile(answers, \"r\")) {\n while (raf.getFilePointer() != raf.length()) {\n result = raf.readLine();\n i++;\n if ((i - 1) == rndNumber) {\n break;\n }\n }\n }\n return result;\n }", "public void shuffle () {\n this.lives = 6;\n this.attempts.clear();\n this.victory = false;\n this.lose = false;\n Random r = new Random ();\n this._word = _dictionary[r.nextInt(_dictionary.length)];\n // this._word = _dictionary[2]; // Testing purposes\n this.hint.setLength(0);\n for (int i = 0; i < _word.length(); i++) {\n this.hint.append(\"_ \");\n } \n }", "public void loadQuestion() {\r\n\r\n //getting the number of the question stored in variable r\r\n //making sure that a question is not loaded up if the count exceeds the number of total questions\r\n if(count <NUMBER_OF_QUESTIONS) {\r\n int r = numberHolder.get(count);\r\n //creating object that will access the QuestionStore class and retrieve values and passing the value of the random question number to the class\r\n QuestionStore qs = new QuestionStore(r);\r\n //calling methods in order to fill up question text and mutliple choices and load the answer\r\n qs.storeQuestions();\r\n qs.storeChoices();\r\n qs.storeAnswers();\r\n //setting the question and multiple choices\r\n\r\n q.setText(qs.getQuestion());\r\n c1.setText(qs.getChoice1());\r\n c2.setText(qs.getChoice2());\r\n c3.setText(qs.getChoice3());\r\n answer = qs.getAnswer();\r\n }\r\n else{\r\n endGame();\r\n }\r\n\r\n\r\n\r\n\r\n }", "public static String[] randomQuestions(String op){\r\n String question = \"\";\r\n String ansStr = \"\";\r\n \r\n int part1 = randomNumber();\r\n int part2 = randomNumber();\r\n int ans = 0;\r\n double roundAns = 0.0;\r\n \r\n if (op.equals(\"^\")){\r\n //Round to Closest Whole Number\r\n roundAns = (randomDecimal());\r\n double k = Math.round(roundAns);\r\n \r\n question = Double.toString(roundAns);\r\n ansStr = Double.toString(k);\r\n }\r\n else if (op.equals(\"Alg\")){\r\n //Algebraic Formula - Find x/y\r\n int coeff = randomNumberAlg();\r\n int layout = randomNumber();\r\n part1 = randomNumberAlg();\r\n part2 = randomNumberAlg();\r\n \r\n if (layout < 3){\r\n //?x = int\r\n ans = part1 * coeff;\r\n \r\n question = coeff+\"x = \"+ ans;\r\n ansStr = Integer.toString(part1);\r\n \r\n } else if (layout > 3 && layout <= 7){\r\n //?x+num = int || ?x-num = int\r\n if (layout == 4||layout == 5){\r\n ans = (part1 * coeff) + part2;\r\n \r\n question = coeff+\"x + \"+part2+\" = \"+ans;\r\n ansStr = Integer.toString(part1);\r\n } else if (layout == 6||layout == 7){\r\n ans = (part1 * coeff) - part2;\r\n \r\n question = coeff+\"x - \"+part2+\" = \"+ans;\r\n ansStr = Integer.toString(part1);\r\n } \r\n } else if (layout > 7 && layout <= 10){\r\n //?x/num = int \r\n ans = (part1 * coeff)/part2;\r\n \r\n question = coeff+\"x/\"+part2+\" = \"+ ans;\r\n ansStr = Integer.toString(part1);\r\n } \r\n }\r\n else if (op.equals(\"%\")){\r\n //Precentages - Covert Fraction to Percentage\r\n int div = HCF(part1, part2);\r\n int finalp1 = part1 % div;\r\n int finalp2 = part2 % div;\r\n \r\n if (finalp1 == 0){\r\n finalp1 = randomNumberRatio();\r\n }\r\n if (finalp2 == 0){\r\n finalp2 = randomNumberRatio();\r\n }\r\n \r\n double fract = finalp1/finalp2;\r\n \r\n if (finalp1>finalp2){\r\n fract = finalp1/finalp2;\r\n question = finalp1+\"/\"+finalp2;\r\n }\r\n else {\r\n fract = finalp2/finalp1;\r\n question = finalp2+\"/\"+finalp1;\r\n }\r\n \r\n double perc = fract * 100;\r\n \r\n ansStr = Double.toString(perc);\r\n \r\n }\r\n else if (op.equals(\":\")){\r\n //Ratio - Simplifying\r\n part1 = randomNumberRatio();\r\n part2 = randomNumberRatio();\r\n int div = HCF(part1, part2);\r\n int finalp1 = part1 / div;\r\n int finalp2 = part2 / div;\r\n \r\n question = part1+\":\"+part2;\r\n ansStr = finalp1+\":\"+finalp2;\r\n }\r\n\r\n else if (op.equals(\"//\")){\r\n //Fractions - Simplifying\r\n int div = HCF(part1, part2);\r\n int finalp1 = part1 % div;\r\n int finalp2 = part2 % div;\r\n \r\n question = part1+\"/\"+part2;\r\n ansStr = finalp1+\"/\"+finalp2;\r\n \r\n }\r\n \r\n String x[] = new String[2];\r\n x[0] = question;\r\n x[1] = ansStr;\r\n \r\n return x;\r\n }", "void setQuestion(){\n int numberRange = currentLevel * 3;\n Random randInt = new Random();\n\n int partA = randInt.nextInt(numberRange);\n partA++;//not zero\n\n int partB = randInt.nextInt(numberRange);\n partB++;//not zero\n\n correctAnswer = partA * partB;\n int wrongAnswer1 = correctAnswer-2;\n int wrongAnswer2 = correctAnswer+2;\n\n textObjectPartA.setText(\"\"+partA);\n textObjectPartB.setText(\"\"+partB);\n\n //set the multi choice buttons\n //A number between 0 and 2\n int buttonLayout = randInt.nextInt(3);\n switch (buttonLayout){\n case 0:\n buttonObjectChoice1.setText(\"\"+correctAnswer);\n buttonObjectChoice2.setText(\"\"+wrongAnswer1);\n buttonObjectChoice3.setText(\"\"+wrongAnswer2);\n break;\n\n case 1:\n buttonObjectChoice2.setText(\"\"+correctAnswer);\n buttonObjectChoice3.setText(\"\"+wrongAnswer1);\n buttonObjectChoice1.setText(\"\"+wrongAnswer2);\n break;\n\n case 2:\n buttonObjectChoice3.setText(\"\"+correctAnswer);\n buttonObjectChoice1.setText(\"\"+wrongAnswer1);\n buttonObjectChoice2.setText(\"\"+wrongAnswer2);\n break;\n }\n }", "public String checkNewQuestions() {\n\t\tint numAnswers = testGenerator.getNumAnswers(questionNo);\n\t\tString question = \"\";\n\n\t\tquestion += testGenerator.getQuestionText(questionNo);\n\t\tquestion += testGenerator.getAnswerText(questionNo, 1);\n\t\tquestion += testGenerator.getAnswerText(questionNo, 2);\n\n\t\tif(numAnswers >= 3) {\n\t\t\tquestion += testGenerator.getAnswerText(questionNo, 3);\n\t\t} \n\t\tif(numAnswers == 4) {\n\t\t\tquestion += testGenerator.getAnswerText(questionNo, 4);\n\t\t}\n\t\treturn question;\n\t}", "private void fillQuestionsTable() {\n Question q1 = new Question(\"Who is NOT a Master on the Jedi council?\", \"Anakin Skywalker\", \"Obi Wan Kenobi\", \"Mace Windu\", \"Yoda\", 1);\n Question q2 = new Question(\"Who was Anakin Skywalker's padawan?\", \"Kit Fisto\", \"Ashoka Tano\", \"Barris Ofee\", \"Jacen Solo\",2);\n Question q3 = new Question(\"What Separatist leader liked to make find additions to his collection?\", \"Pong Krell\", \"Count Dooku\", \"General Grevious\", \"Darth Bane\", 3);\n Question q4 = new Question(\"Choose the correct Response:\\n Hello There!\", \"General Kenobi!\", \"You are a bold one!\", \"You never should have come here!\", \"You turned her against me!\", 1);\n Question q5 = new Question(\"What ancient combat technique did Master Obi Wan Kenobi use to his advantage throughout the Clone Wars?\", \"Kendo arts\", \"The High ground\", \"Lightsaber Form VIII\", \"Force healing\", 2);\n Question q6 = new Question(\"What was the only surviving member of Domino squad?\", \"Fives\", \"Heavy\", \"Echo\", \"Jesse\", 3);\n Question q7 = new Question(\"What Jedi brutally murdered children as a part of his descent to become a Sith?\", \"Quinlan Vos\", \"Plo Koon\", \"Kit Fisto\", \"Anakin Skywalker\", 4);\n Question q8 = new Question(\"What Sith was the first to reveal himself to the Jedi after a millenia and was subsquently cut in half shortly after?\", \"Darth Plagieus\", \"Darth Maul\", \"Darth Bane\", \"Darth Cadeus\", 2);\n Question q9 = new Question(\"What 4 armed creature operates a diner on the upper levels of Coruscant?\", \"Dexter Jettster\", \"Cad Bane\", \"Aurua Sing\", \"Dorme Amidala\", 1);\n Question q10 = new Question(\"What ruler fell in love with an underage boy and subsequently married him once he became a Jedi?\", \"Aurua Sing\", \"Duttchess Satine\", \"Mara Jade\", \"Padme Amidala\", 4);\n\n // adds them to the list\n addQuestion(q1);\n addQuestion(q2);\n addQuestion(q3);\n addQuestion(q4);\n addQuestion(q5);\n addQuestion(q6);\n addQuestion(q7);\n addQuestion(q8);\n addQuestion(q9);\n addQuestion(q10);\n }", "private void newQuestion(int number) {\n bakeImageView.setImageResource(list.get(number - 1).getImage());\n\n //decide which button to place the correct answer\n int correct_answer = r.nextInt(4) + 1;\n\n int firstButton = number - 1;\n int secondButton;\n int thirdButton;\n int fourthButton;\n\n switch (correct_answer) {\n case 1:\n answer1Button.setText(list.get(firstButton).getName());\n\n do {\n secondButton = r.nextInt(list.size());\n } while (secondButton == firstButton);\n do {\n thirdButton = r.nextInt(list.size());\n } while (thirdButton == firstButton || thirdButton == secondButton);\n do {\n fourthButton = r.nextInt(list.size());\n } while (fourthButton == firstButton || fourthButton == secondButton || fourthButton == thirdButton);\n\n answer2Button.setText(list.get(secondButton).getName());\n answer3Button.setText(list.get(thirdButton).getName());\n answer4Button.setText(list.get(fourthButton).getName());\n\n break;\n\n case 2:\n answer2Button.setText(list.get(firstButton).getName());\n\n do {\n secondButton = r.nextInt(list.size());\n } while (secondButton == firstButton);\n do {\n thirdButton = r.nextInt(list.size());\n } while (thirdButton == firstButton || thirdButton == secondButton);\n do {\n fourthButton = r.nextInt(list.size());\n } while (fourthButton == firstButton || fourthButton == secondButton || fourthButton == thirdButton);\n\n answer1Button.setText(list.get(secondButton).getName());\n answer3Button.setText(list.get(thirdButton).getName());\n answer4Button.setText(list.get(fourthButton).getName());\n\n break;\n\n case 3:\n answer3Button.setText(list.get(firstButton).getName());\n\n do {\n secondButton = r.nextInt(list.size());\n } while (secondButton == firstButton);\n do {\n thirdButton = r.nextInt(list.size());\n } while (thirdButton == firstButton || thirdButton == secondButton);\n do {\n fourthButton = r.nextInt(list.size());\n } while (fourthButton == firstButton || fourthButton == secondButton || fourthButton == thirdButton);\n\n answer2Button.setText(list.get(secondButton).getName());\n answer1Button.setText(list.get(thirdButton).getName());\n answer4Button.setText(list.get(fourthButton).getName());\n\n\n break;\n\n case 4:\n answer4Button.setText(list.get(firstButton).getName());\n\n do {\n secondButton = r.nextInt(list.size());\n } while (secondButton == firstButton);\n do {\n thirdButton = r.nextInt(list.size());\n } while (thirdButton == firstButton || thirdButton == secondButton);\n do {\n fourthButton = r.nextInt(list.size());\n } while (fourthButton == firstButton || fourthButton == secondButton || fourthButton == thirdButton);\n\n answer2Button.setText(list.get(secondButton).getName());\n answer3Button.setText(list.get(thirdButton).getName());\n answer1Button.setText(list.get(fourthButton).getName());\n\n break;\n }\n }", "public void fillQuestionsTable() {\n\n //Hard Questions\n Questions q1 = new Questions(\"The redshift of a distant galaxy is 0·014. According to Hubble’s law, the distance of the galaxy from Earth is? \", \" 9·66 × 10e-12 m\", \" 9·32 × 10e27 m\", \"1·83 × 10e24 m\", \"1·30 × 10e26 m \", 3);\n addQuestion(q1);\n Questions q2 = new Questions(\"A ray of monochromatic light passes from air into water. The wavelength of this light in air is 589 nm. The speed of this light in water is? \", \" 2·56 × 10e2 m/s \", \"4·52 × 10e2 m/s\", \"4·78 × 10e2 m/s\", \"1·52 × 10e2 m/s\", 2);\n addQuestion(q2);\n Questions q3 = new Questions(\"A car is moving at a speed of 2·0 m s−1. The car now accelerates at 4·0 m s−2 until it reaches a speed of 14 m s−1. The distance travelled by the car during this acceleration is\", \"1.5m\", \"18m\", \"24m\", \"25m\", 3);\n addQuestion(q3);\n Questions q4 = new Questions(\"A spacecraft is travelling at 0·10c relative to a star. \\nAn observer on the spacecraft measures the speed of light emitted by the star to be?\", \"0.90c\", \"1.00c\", \"1.01c\", \"0.99c\", 2);\n addQuestion(q4);\n Questions q5 = new Questions(\"Measurements of the expansion rate of the Universe lead to the conclusion that the rate of expansion is increasing. Present theory proposes that this is due to? \", \"Redshift\", \"Dark Matter\", \"Dark Energy\", \"Gravity\", 3);\n addQuestion(q5);\n Questions q6 = new Questions(\"A block of wood slides with a constant velocity down a slope. The slope makes an angle of 30º with the horizontal axis. The mass of the block is 2·0 kg. The magnitude of the force of friction acting on the block is?\" , \"1.0N\", \"2.0N\", \"9.0N\", \"9.8N\", 4);\n addQuestion(q6);\n Questions q7 = new Questions(\"A planet orbits a star at a distance of 3·0 × 10e9 m. The star exerts a gravitational force of 1·6 × 10e27 N on the planet. The mass of the star is 6·0 × 10e30 kg. The mass of the planet is? \", \"2.4 x 10e14 kg\", \"3.6 x 10e25 kg\", \"1.2 x 10e16 kg\", \"1.6 x 10e26 kg\", 2);\n addQuestion(q7);\n Questions q8 = new Questions(\"Radiation of frequency 9·00 × 10e15 Hz is incident on a clean metal surface. The maximum kinetic energy of a photoelectron ejected from this surface is 5·70 × 10e−18 J. The work function of the metal is?\", \"2.67 x 10e-19 J\", \"9.10 x 10e-1 J\", \"1.60 x 10e-18 J\", \"4.80 x 10e-2 J\", 1);\n addQuestion(q8);\n Questions q9 = new Questions(\"The irradiance of light from a point source is 32 W m−2 at a distance of 4·0 m from the source. The irradiance of the light at a distance of 16 m from the source is? \", \"1.0 W m-2\", \"8.0 W m-2\", \"4.0 W m-2\", \"2.0 W m-2\", 4);\n addQuestion(q9);\n Questions q10 = new Questions(\"A person stands on a weighing machine in a lift. When the lift is at rest, the reading on the weighing machine is 700 N. The lift now descends and its speed increases at a constant rate. The reading on the weighing machine...\", \"Is a constant value higher than 700N. \", \"Is a constant value lower than 700N. \", \"Continually increases from 700 N. \", \"Continually decreases from 700 N. \", 2);\n addQuestion(q10);\n\n //Medium Questions\n Questions q11 = new Questions(\"What is Newtons Second Law of Motion?\", \"F = ma\", \"m = Fa\", \"F = a/m\", \"Every action has an equal and opposite reaction\", 1);\n addQuestion(q11);\n Questions q12 = new Questions(\"In s = vt, what does s stand for?\", \"Distance\", \"Speed\", \"Sin\", \"Displacement\", 4);\n addQuestion(q12);\n Questions q13 = new Questions(\"An object reaches terminal velocity when...\", \"Forward force is greater than the frictional force.\", \"All forces acting on that object are equal.\", \"Acceleration starts decreasing.\", \"Acceleration is greater than 0\", 2);\n addQuestion(q13);\n Questions q14 = new Questions(\"An Elastic Collision is where?\", \"There is no loss of Kinetic Energy.\", \"There is a small loss in Kinetic Energy.\", \"There is an increase in Kinetic Energy.\", \"Some Kinetic Energy is transferred to another type.\", 1);\n addQuestion(q14);\n Questions q15 = new Questions(\"The speed of light is?\", \"Different for all observers.\", \"The same for all observers. \", \"The same speed regardless of the medium it is travelling through. \", \"Equal to the speed of sound.\", 2);\n addQuestion(q15);\n Questions q16 = new Questions(\"What is redshift?\", \"Light moving to us, shifting to red. \", \"A dodgy gear change. \", \"Light moving away from us shifting to longer wavelengths.\", \"Another word for dark energy. \", 3);\n addQuestion(q16);\n Questions q17 = new Questions(\"Which law allows us to estimate the age of the universe?\", \"Newtons 3rd Law \", \"The Hubble-Lemaitre Law \", \"Planck's Law \", \"Wien's Law \", 2);\n addQuestion(q17);\n Questions q18 = new Questions(\"The standard model...\", \"Models how time interacts with space. \", \"Describes how entropy works. \", \"Is the 2nd Law of Thermodynamics. \", \"Describes the fundamental particles of the universe and how they interact\", 4);\n addQuestion(q18);\n Questions q19 = new Questions(\"The photoelectric effect gives evidence for?\", \"The wave model of light. \", \"The particle model of light. \", \"The speed of light. \", \"The frequency of light. \", 2);\n addQuestion(q19);\n Questions q20 = new Questions(\"AC is a current which...\", \"Doesn't change direction. \", \"Is often called variable current. \", \"Is sneaky. \", \"Changes direction and instantaneous value with time. \", 4);\n addQuestion(q20);\n\n //Easy Questions\n Questions q21 = new Questions(\"What properties does light display?\", \"Wave\", \"Particle\", \"Both\", \"Neither\", 3);\n addQuestion(q21);\n Questions q22 = new Questions(\"In V = IR, what does V stand for?\", \"Velocity\", \"Voltage\", \"Viscosity\", \"Volume\", 2);\n addQuestion(q22);\n Questions q23 = new Questions(\"The abbreviation rms typically stands for?\", \"Round mean sandwich. \", \"Random manic speed. \", \"Root manic speed. \", \"Root mean squared. \", 4);\n addQuestion(q23);\n Questions q24 = new Questions(\"Path Difference = \", \"= (m/λ) or (m + ½)/λ where m = 0,1,2…\", \"= mλ or (m + ½) λ where m = 0,1,2…\", \"= λ / m or (λ + ½) / m where m = 0,1,2…\", \" = mλ or (m + ½) λ where m = 0.5,1.5,2.5,…\", 2);\n addQuestion(q24);\n Questions q25 = new Questions(\"How many types of quark are there?\", \"6\", \"4 \", \"8\", \"2\", 1);\n addQuestion(q25);\n Questions q26 = new Questions(\"A neutrino is a type of?\", \"Baryon\", \"Gluon\", \"Lepton\", \"Quark\", 3);\n addQuestion(q26);\n Questions q27 = new Questions(\"A moving charge produces:\", \"A weak field\", \"An electric field\", \"A strong field\", \"Another moving charge\", 2);\n addQuestion(q27);\n Questions q28 = new Questions(\"What contains nuclear fusion reactors?\", \"A magnetic field\", \"An electric field\", \"A pool of water\", \"Large amounts of padding\", 1);\n addQuestion(q28);\n Questions q29 = new Questions(\"What is the critical angle of a surface?\", \"The incident angle where the angle of refraction is 45 degrees.\", \"The incident angle where the angle of refraction is 90 degrees.\", \"The incident angle where the angle of refraction is 135 degrees.\", \"The incident angle where the angle of refraction is 180 degrees.\", 2);\n addQuestion(q29);\n Questions q30 = new Questions(\"Which is not a type of Lepton?\", \"Electron\", \"Tau\", \"Gluon\", \"Muon\", 3);\n addQuestion(q30);\n }", "public static void generateQuizz(int size)\n {\n nb1 = new int[size];\n nb2 = new int[size];\n answer = new int[size];\n for(int i = 0; i<size; i++)\n {\n nb1[i] = (int)(Math.random()*50+1);\n nb2[i] = (int)(Math.random()*50+1);\n answer[i] = 0;\n }\n \n }", "public void generateNumbers() {\n number1 = (int) (Math.random() * 10) + 1;\n number2 = (int) (Math.random() * 10) + 1;\n operator = (int) (Math.random() * 4) + 1;\n //50% chance whether the displayed answer will be right or wrong\n rightOrWrong = (int) (Math.random() * 2) + 1;\n //calculate the offset of displayed answer for a wrong equation (Error)\n error = (int) (Math.random() * 4) + 1;\n generateEquation();\n }", "public void generateDemoQuiz() {\n Quiz demoQuiz = new Quiz(); //Instantiate a Quiz\n Category testCategory = makeCategory(); //Make some bs categories to attach the quiz\n Question question1 = new Question(); //Make some bs questions (just one for now)\n question1.setQuestion(\"Which of the following famous scientist cured Cat Cancer?\"); //Set the question ... of the question? IDK how to word this better\n\n //Make some funny cat names\n Answer a1 = new Answer(\"H. John Whiskers\");\n Answer a2 = new Answer(\"Bartolemeu Meowser\");\n Answer a3 = new Answer(\"Catalie Portman\");\n Answer a4 = new Answer(\"Anderson Pooper\");\n\n //Build an arraylist full of said cat names\n ArrayList<Answer> answerList = new ArrayList<Answer>();\n answerList.add(a1);\n answerList.add(a2);\n answerList.add(a3);\n answerList.add(a4);\n\n //Put those answers inside that question!\n question1.setAnswerChoices(answerList);\n question1.setCorrectAnswer(a1); //Everybody knows H John Whiskers cured kitty cancer\n\n //Build an arraylist full of the question(s) you just made, in our demo case there is only one question\n ArrayList<Question> questionList = new ArrayList<Question>();\n questionList.add(question1); //Put the questions inside your list\n\n\n //Put all the data you just made into a Quiz\n demoQuiz.setQuizName(\"Famous Cat Scientists\");\n demoQuiz.setQuizCategory(testCategory);\n demoQuiz.setQuizQuestions(questionList);\n\n }", "private void nextQuestion() {\n\n // increment current question index\n currentQuestionIndex++;\n\n // if the current question index is smaller than the size of the quiz list\n if (currentQuestionIndex < quizList.size()) {\n\n // clear the possible answers\n possibleAnswers.clear();\n\n // grab the definition of current question, assign the correct answer variable\n // and add it to the list of possible answers.\n definition = quizList.get(currentQuestionIndex)[0];\n correctAnswer = quizMap.get(definition);\n possibleAnswers.add(correctAnswer);\n\n // while there's less than 4 possible answers, get a random answer\n // and if it hasn't already been added, add it to the list.\n while (possibleAnswers.size() < 4) {\n String answer = quizList.get(new Random().nextInt(quizList.size() - 1))[1];\n if (!possibleAnswers.contains(answer)) {\n possibleAnswers.add(answer);\n }\n }\n\n // shuffle possible answers so they display in a random order\n Collections.shuffle(possibleAnswers);\n } else {\n // if the question index is out of bounds, set quiz as finished\n quizFinished = true;\n }\n }", "private void getRandomNumber() {\n\t\tRandom generator = new Random();\n\t\trandomNumber = generator.nextInt(POSSIBLE_CHOICE.length);\n\t}", "private void updateQuestion()//update the question each time\n\t{\n\t\tInteger num = random.nextInt(20);\n\t\tcurrentAminoAcid = FULL_NAMES[num];\n\t\tcurrentShortAA= SHORT_NAMES[num];\n\t\tquestionField.setText(\"What is the ONE letter name for:\");\n\t\taminoacid.setText(currentAminoAcid);\n\t\tanswerField.setText(\"\");\n\t\tvalidate();\n\t}", "private void initializeAnswers(){\n // Declare a random variable for randomly changing between pictures & random text options\n rand = new Random();\n\n // Set currentanswerbutton to be between 0-3, that way the button storing the correct answer is randomized, but we have 0-3 directly map to each button for deciding which button is correct\n // btntopLeftImage == 0\n // btntopRightImage == 1\n // btnbottomLeftImage == 2\n // btnbottomRightImage == 3\n currentanswerButton = rand.nextInt(4);\n\n // Randomly select a picture's abstracted integer value from the values array and set it to the current answer, then get 3 other values that are incorrect\n currentanswer = rand.nextInt(values.size());\n currentnotAnswer1 = rand.nextInt(values.size());\n currentnotAnswer2= rand.nextInt(values.size());\n currentnotAnswer3 = rand.nextInt(values.size());\n\n // Keep picking new options until none of them are the same to avoid duplicate options\n while ((currentanswer == currentnotAnswer1 || currentanswer == currentnotAnswer2 || currentanswer == currentnotAnswer3) || (currentnotAnswer1 == currentnotAnswer2 || currentnotAnswer1 == currentnotAnswer3) || (currentnotAnswer2== currentnotAnswer3)) {\n currentnotAnswer1 = rand.nextInt(values.size());\n currentnotAnswer2 = rand.nextInt(values.size());\n currentnotAnswer3 = rand.nextInt(values.size());\n }\n\n // Now Determine which button has the correct answer stored in it from the randomly generated int \"currentanswerButton\"\n // Button 1\n if (currentanswerButton == 0) {\n // Once determined set the center of the screen's image background to be the picture that is stored in the values arraylist at index \"currentanswer\"\n image.setBackground(ContextCompat.getDrawable(activity_gamePlay.this, values.get(currentanswer)));\n // Then set the corresponding button's text to be the correct/or incorrect options accordingly\n btntopLeftImage.setText(keys.get(currentanswer));\n btntopRightImage.setText(keys.get(currentnotAnswer1));\n btnbottomLeftImage.setText(keys.get(currentnotAnswer2));\n btnbottomRightImage.setText(keys.get(currentnotAnswer3));\n\n }\n // Same concept as Button 1\n // Button 2\n if (currentanswerButton== 1) {\n image.setBackground(ContextCompat.getDrawable(activity_gamePlay.this, values.get(currentanswer)));\n btntopLeftImage.setText(keys.get(currentnotAnswer1));\n btntopRightImage.setText(keys.get(currentanswer));\n btnbottomLeftImage.setText(keys.get(currentnotAnswer2));\n btnbottomRightImage.setText(keys.get(currentnotAnswer3));\n }\n\n // Same concept as Button 1\n // Button 3\n if (currentanswerButton == 2) {\n image.setBackground(ContextCompat.getDrawable(activity_gamePlay.this, values.get(currentanswer)));\n btntopLeftImage.setText(keys.get(currentnotAnswer1));\n btntopRightImage.setText(keys.get(currentnotAnswer2));\n btnbottomLeftImage.setText(keys.get(currentanswer));\n btnbottomRightImage.setText(keys.get(currentnotAnswer3));\n }\n\n // Same concept as Button 1\n // Button 4\n if (currentanswerButton == 3) {\n image.setBackground(ContextCompat.getDrawable(activity_gamePlay.this, values.get(currentanswer)));\n btntopLeftImage.setText(keys.get(currentnotAnswer1));\n btntopRightImage.setText(keys.get(currentnotAnswer2));\n btnbottomLeftImage.setText(keys.get(currentnotAnswer3));\n btnbottomRightImage.setText(keys.get(currentanswer));\n }\n\n }", "public String getAnAnswer() {\n\t\t\n\t\tString answer = \"\";\n\t\t\n\t\t\n\t\tRandom randomGenerator = new Random(); //Construct a new random number generator\n\t\tint randomNumber = randomGenerator.nextInt(mAnswers.length);\n\t\t\n\t\tanswer = mAnswers[randomNumber];\n\t\t\n\t\treturn answer;\n\t}", "static ArrayList<Integer> generateQuestion(ArrayList<Integer> remainingSongsIds)\n {\n //shuffle the ids\n Collections.shuffle(remainingSongsIds);\n\n ArrayList<Integer> options = new ArrayList<>();\n\n //pick the random first fours sample ids\n for(int i=0;i<NUM_OPTIONS;i++)\n {\n if(i<remainingSongsIds.size())\n {\n options.add(remainingSongsIds.get(i));\n }\n }\n return options;\n }", "public void setIdQuestion(int idT) {\r\n idQuestion=rand(idT);\r\n }", "void gatherInfoBeforePopulating (){\n\t\t\n\t\tcategoryId = Trivia_Game.getCategoryIdInMainMenu();\n\n\t \t //Loop until a valid questionId that hasn't been used is obtained\n\t \t\twhile (validQuestionNumber == false){\n\t \t\t\trandomValue0to29 = RandomGenerator0To29();\n\t \t\t\tSystem.out.println(\"random30 in onClick = \" + randomValue0to29);\n\n\t \t\t alreadyDisplayQuestion = questionsAlreadyDisplayed (randomValue0to29);\n\t \t\t if (alreadyDisplayQuestion == true){\n\t \t\t\t System.out.println(\"question number already displayed looking for a non displayed question\");\n\t \t\t }\n\t \t\t if (alreadyDisplayQuestion == false){\n\t \t\t\t System.out.println(\"question not displayed yet\");\n\t \t\t\t validQuestionNumber = true;\n\t \t\t }\n\t \t }\n\t \t \n\t \t validQuestionNumber = false;\n\t \t alreadyDisplayQuestion = false;\n\t \t questionId = randomValue0to29;\t//sets the valid random generated number to the questionID\n\t \t \n\t \t //connect to database to gather the question and answers\n\t \t getInfoFromDatabase(categoryId, questionId);\n \t\n\t \t //Calls random number from 0 to 3 to determine which button will display the correct answer\n\t \t randomValueZeroToThree = RandomGeneratorZeroToThree();\n\t \t System.out.println(\"random4 in onClick = \" + randomValueZeroToThree);\n\t \t \n\t \t //Sets the order according to the button that is to display the correct answer\n\t \t switch (randomValueZeroToThree){\n\t \t \tcase 0:\n\t \t \t\tdisplayedAnswer1FromDatabase = answer1FromDatabase;\t//correct answer\n\t \t \t\tdisplayedAnswer2FromDatabase = answer2FromDatabase;\n\t \t \t\tdisplayedAnswer3FromDatabase = answer3FromDatabase;\n\t \t \t\tdisplayedAnswer4FromDatabase = answer4FromDatabase;\n\t \t \t\trightButton1 = true;\n\t \t \t\trightButton2 = false;\n\t \t \t\trightButton3 = false;\n\t \t \t\trightButton4 = false;\n\t \t \t\tbreak;\n\t \t \t\t\n\t \t \tcase 1:\n\t \t \t\tdisplayedAnswer2FromDatabase = answer1FromDatabase;\t//correct answer\n\t \t \t\tdisplayedAnswer1FromDatabase = answer2FromDatabase;\n\t \t \t\tdisplayedAnswer3FromDatabase = answer3FromDatabase;\n\t \t \t\tdisplayedAnswer4FromDatabase = answer4FromDatabase;\n\t \t \t\trightButton1 = false;\n\t \t \t\trightButton2 = true;\n\t \t \t\trightButton3 = false;\n\t \t \t\trightButton4 = false;\n\t \t \t\tbreak;\n\t \t \t\n\t \t \tcase 2:\n\t \t \t\tdisplayedAnswer3FromDatabase = answer1FromDatabase;\t//correct answer\n\t \t \t\tdisplayedAnswer1FromDatabase = answer2FromDatabase;\n\t \t \t\tdisplayedAnswer2FromDatabase = answer3FromDatabase;\n\t \t \t\tdisplayedAnswer4FromDatabase = answer4FromDatabase;\n\t \t \t\trightButton1 = false;\n\t \t \t\trightButton2 = false;\n\t \t \t\trightButton3 = true;\n\t \t \t\trightButton4 = false;\n\t \t \t\tbreak;\n\t \t \t\t\n\t \t \tcase 3:\n\t \t \t\tdisplayedAnswer4FromDatabase = answer1FromDatabase;\t//correct answer\n\t \t \t\tdisplayedAnswer1FromDatabase = answer2FromDatabase;\n\t \t \t\tdisplayedAnswer3FromDatabase = answer3FromDatabase;\n\t \t \t\tdisplayedAnswer2FromDatabase = answer4FromDatabase;\n\t \t \t\trightButton1 = false;\n\t \t \t\trightButton2 = false;\n\t \t \t\trightButton3 = false;\n\t \t \t\trightButton4 = true;\n\t \t \t\tbreak;\n\t \t \t\n\t \t \tdefault: \n\t \t \t\tdisplayedAnswer1FromDatabase = answer4FromDatabase;\t//no correct answer\n\t \t \t\tdisplayedAnswer2FromDatabase = answer2FromDatabase;\n\t \t \t\tdisplayedAnswer3FromDatabase = answer3FromDatabase;\n\t \t \t\tdisplayedAnswer4FromDatabase = answer1FromDatabase;\t\n\t \t \t\trightButton1 = false;\n\t \t \t\trightButton2 = false;\n\t \t \t\trightButton3 = false;\n\t \t \t\trightButton4 = false;\n\t \t \t\t\n \t }\n\t \n\t // After the 9th question is displayed, the nextOfFinishValue should be set to 1 so the button displayes Finish instead of Next\n \t if (numberOfQuestionsDisplayedCounter < 9){\n\t \t\t\tnextOrFinishValue = 0;\n\t \t\t}\n\t \t\telse{\n\t \t\t\tnextOrFinishValue = 1;\n\t \t\t}\n\t\t\n\t}", "@Test\n public void shouldNotGiveQuestionIfAllQuestionsHaveBeenAnswered() {\n attributes.put(FinancialPlanningSpeechlet.GOAL_AMOUNT_KEY, 1000.0);\n attributes.put(FinancialPlanningSpeechlet.MONTHLY_CONTRIBUTION_KEY, 1000.0);\n attributes.put(FinancialPlanningSpeechlet.GOAL_PERIOD_KEY, 1000.0);\n String question = NextQuestionFactory.get(session);\n\n assertThat(question, Is.is(\"\"));\n }", "Randomizer getRandomizer();", "private static void createPlayfulSet() {\n\n\t\trandomKeys = new ArrayList<>();\n\n\t\trandomKeys.add(GuessRevealerConstants.RANDOM_TEXT1);\n\t\trandomKeys.add(GuessRevealerConstants.RANDOM_TEXT2);\n\t\trandomKeys.add(GuessRevealerConstants.RANDOM_TEXT3);\n\t\trandomKeys.add(GuessRevealerConstants.RANDOM_TEXT4);\n\t\trandomKeys.add(GuessRevealerConstants.RANDOM_TEXT5);\n\t\trandomKeys.add(GuessRevealerConstants.RANDOM_TEXT6);\n\t\trandomKeys.add(GuessRevealerConstants.RANDOM_TEXT7);\n\t\trandomKeys.add(GuessRevealerConstants.END);\n\n\t\trandomCount = randomKeys.size();\n\n\t}", "static void askQuestion() {\n\t\t// Setting up a Scanner to get user input\n\t\tScanner userInput = new Scanner(System.in);\n\n\t\t// Declaring variables\n\t\tdouble num1, num2, answer, userAnswer;\n\n\t\t// GENERATING QUESTION\n\n\t\t// Getting two new random numbers, rounded to one decimal place (with numbers generation from 0 to 50)\n\t\tnum1 = Math.round((Math.random() * 50)*10.0)/10.0;\n\t\tnum2 = Math.round((Math.random() * 50)*10.0)/10.0;\n\n\t\t// Generating a random number between 1 and 4 to randomize the math operation. A switch case is used to calculate the answer based on the math operation that gets generated.\n\t\tswitch ((int) Math.round(Math.random() * 3 + 1)) {\n\t\t\tcase 1: // Similar structure for each case (and the default case), structured as follows\n\t\t\t\tSystem.out.print(num1 + \" + \" + num2 + \" = \"); // Printing the question (based on the generated operation)\n\t\t\t\tanswer = num1 + num2; // Calculating the answer (based on the generated operation)\n\t\t\t\tbreak; // Exit the switch statement\n\t\t\tcase 2:\n\t\t\t\tSystem.out.print(num1 + \" - \" + num2 + \" = \");\n\t\t\t\tanswer = num1 - num2;\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tSystem.out.print(num1 + \" / \" + num2 + \" = \");\n\t\t\t\tanswer = num1 / num2;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tSystem.out.print(num1 + \" * \" + num2 + \" = \");\n\t\t\t\tanswer = num1 * num2;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tanswer = Math.round(answer * 10.0) / 10.0; // Rounding the answer to one decimal place\n\t\tuserAnswer = userInput.nextDouble(); // Getting the user's answer\n\n\t\tif (answer == userAnswer) System.out.println(\"That's right. Good Job!\\n\"); // If the answers match, the user is correct and the staetment is printed accordingly.\n\t\telse System.out.println(\"Incorrect. The correct answer was \" + answer + \".\\n\"); // Otherwise, show that the user's answer is incorrect and output an according statement.\n\t}", "private void fetchNewQuestion()\r\n\t{\r\n\t\t//Gets question and answers from model\r\n\t\tString[] question = quizModel.getNewQuestion();\r\n\t\t\r\n\t\t//Allocates answers to a new ArrayList then shuffles them randomly\r\n\t\tArrayList<String> answers = new ArrayList<String>();\r\n\t\tanswers.add(question[1]);\r\n\t\tanswers.add(question[2]);\r\n\t\tanswers.add(question[3]);\r\n\t\tanswers.add(question[4]);\r\n\t\tCollections.shuffle(answers);\r\n\t\t\r\n\t\t//Allocates north label to the question\r\n\t\tnorthLabel.setText(\"<html><div style='text-align: center;'>\" + question[0] + \"</div></html>\");\r\n\t\t\r\n\t\t//Allocates each radio button to a possible answer. Based on strings, so randomly generated questions...\r\n\t\t//...which by chance repeat a correct answer in two slots, either will award the user a point.\r\n\t\toption1.setText(answers.get(0));\r\n\t\toption2.setText(answers.get(1));\r\n\t\toption3.setText(answers.get(2));\r\n\t\toption4.setText(answers.get(3));\r\n\t\toption1.setActionCommand(answers.get(0));\r\n\t\toption2.setActionCommand(answers.get(1));\r\n\t\toption3.setActionCommand(answers.get(2));\r\n\t\toption4.setActionCommand(answers.get(3));\r\n\t\toption1.setSelected(true);\r\n\t\t\r\n\t\t//Update score\r\n\t\tscoreLabel.setText(\"<html><div style='text-align: center;'>\" + \"Score = \" + quizModel.getScore() + \"</div></html>\");\r\n\t}", "private String getRandomResponse() {\n\t\tfinal int NUMBER_OF_RESPONSES = 6;\n\t\tdouble r = Math.random();\n\t\tint whichResponse = (int) (r * NUMBER_OF_RESPONSES);\n\t\tString response = \"\";\n\n\t\tif (whichResponse == 0) {\n\t\t\tresponse = \"Interesting, tell me more.\";\n\t\t} else if (whichResponse == 1) {\n\t\t\tresponse = \"Hmmm.\";\n\t\t} else if (whichResponse == 2) {\n\t\t\tresponse = \"Do you really think so?\";\n\t\t} else if (whichResponse == 3) {\n\t\t\tresponse = \"You don't say.\";\n\t\t} else if(whichResponse == 4) {\n\t\t\tresponse = \"Well, that's right.\";\n\t\t} else if(whichResponse == 5) {\n\t\t\tresponse = \"Can we switch the topic?\";\n\t\t}\n\n\t\treturn response;\n\t}", "@Override\n public Question generate() {\n return new Question(\"Why do Canadians prefer their jokes in hexadecimal?\",\n \"Because 7 8 9 A!\");\n }", "public void setQuestion(){\n\n\n triggerReport(); //Check if max questions are displayed, if yes then show report\n\n MyDatabase db = new MyDatabase(QuizCorner.this);\n Cursor words = db.getQuizQuestion();\n TextView question_text = (TextView) findViewById(R.id.question_text);\n RadioButton rb;\n resetOptions();\n disableCheck();\n enableRadioButtons();\n hideAnswer();\n words.moveToFirst();\n word = words.getString(words.getColumnIndex(\"word\"));\n correct_answer = words.getString(words.getColumnIndex(\"meaning\"));\n question_text.setText(word + \" means:\");\n for (int i = 0; i < 4; i++){\n answers[i] = words.getString(words.getColumnIndex(\"meaning\"));\n words.moveToNext();\n }\n answers = randomizeArray(answers);\n for (int i = 0; i < 4; i++){\n rb = (RadioButton) findViewById(options[i]);\n rb.setText(answers[i]);\n }\n question_displayed_count++;\n }", "private void random() {\n\n\t}", "public void resetQuestion() \n\t{\n\t\tthis.game = masterPanel.getGame();\n\t\t\n\t\tArrayList<String> tempQuestion = new ArrayList<String>();\n\t\ttempQuestion = getRandQuestion();\n\t\t\n\t\tquestion.setText(tempQuestion.get(0));\n\t\tanswerOne.setText(tempQuestion.get(1));\n\t\tanswerTwo.setText(tempQuestion.get(2));\n\t\tanswerThree.setText(tempQuestion.get(3));\n\t\tanswerFour.setText(tempQuestion.get(4));\n\t\tcorrectAnswer = tempQuestion.get(5);\n\t\t\n\t\tlayoutConstraints.gridy = 1;\n\t\tthis.add(answerOne, layoutConstraints);\n\t\t\n\t\tlayoutConstraints.gridy = 2;\n\t\tthis.add(answerTwo, layoutConstraints);\n\t\t\n\t\tlayoutConstraints.gridy = 3;\n\t\tthis.add(answerThree, layoutConstraints);\n\t\t\n\t\tlayoutConstraints.gridy = 4;\n\t\tthis.add(answerFour, layoutConstraints);\n\t\t\n\t\tthis.repaint();\n\t}", "public Test(ArrayList<WrittenQuestion> questions){\r\n\t\tmyQuestions = new ArrayList<WrittenQuestion>();\r\n\t\tfor(WrittenQuestion q : questions){\r\n\t\t\tif(q instanceof Question){\r\n\t\t\t\tmyQuestions.add(new Question((Question)q));\r\n\t\t\t}else{\r\n\t\t\t\tmyQuestions.add(new WrittenQuestion(q));\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(allIDs==null){\r\n\t\t\tallIDs = new ArrayList<Integer>();\r\n\t\t\tfor (int i = 0; i<1000; i++){\r\n\t\t\t\tallIDs.add(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tRandom r = new Random();\r\n\t\tid = allIDs.remove((int)(r.nextInt(allIDs.size())));\r\n\r\n\t}", "public void setSingleChoices() {\r\n Random randomGenerator = new Random();\r\n int singleAnswer = randomGenerator.nextInt(4);\r\n studentAnswer.add(singleAnswer); }", "private void addQuestion() {\n Question q = new Question(\n \"¿Quien propuso la prueba del camino básico ?\", \"Tom McCabe\", \"Tom Robert\", \"Tom Charlie\", \"Tom McCabe\");\n this.addQuestion(q);\n\n\n Question q1 = new Question(\"¿Qué es una prueba de Caja negra y que errores desean encontrar en las categorías?\", \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\", \"esta basada en la funcionalidad de los módulos del programa\", \" determina la funcionalidad del sistema\", \" determina la funcionalidad del sistema\");\n this.addQuestion(q1);\n Question q2 = new Question(\"¿Qué es la complejidad ciclomática es una métrica de calidad software?\", \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\", \"esta basada en la funcionalidad de los módulos del programa\", \"basada en el cálculo del número\", \"basada en el cálculo del número\");\n this.addQuestion(q2);\n //preguntas del quiz II\n Question q3=new Question(\"Las pruebas de caja blanca buscan revisar los caminos, condiciones, \" +\n \"particiones de control y datos, de las funciones o módulos del sistema; \" +\n \"para lo cual el grupo de diseño de pruebas debe:\",\n \"Conformar un grupo de personas para que use el sistema nuevo\",\n \"Ejecutar sistema nuevo con los datos usados en el sistema actual\",\n \"Generar registro de datos que ejecute al menos una vez cada instrucción\",\n \"Generar registro de datos que ejecute al menos una vez cada instrucción\");\n this.addQuestion(q3);\n Question q4=new Question(\"¿Las pruebas unitarias son llamadas?\",\n \"Pruebas del camino\", \"Pruebas modulares\",\n \"Pruebas de complejidad\", \"Pruebas modulares\");\n this.addQuestion(q4);\n Question q5=new Question(\"¿Qué es una prueba de camino básico?\",\n \"Hace una cobertura de declaraciones del código\",\n \"Permite determinar si un modulo esta listo\",\n \"Técnica de pueba de caja blanca\",\n \"Técnica de pueba de caja blanca\" );\n this.addQuestion(q5);\n Question q6=new Question(\"Prueba de camino es propuesta:\", \"Tom McCabe\", \"McCall \", \"Pressman\",\n \"Tom McCabe\");\n this.addQuestion(q6);\n Question q7=new Question(\"¿Qué es complejidad ciclomatica?\",\"Grafo de flujo\",\"Programming\",\n \"Metrica\",\"Metrica\");\n this.addQuestion(q7);\n //preguntas del quiz III\n Question q8 = new Question(\n \"¿Se le llama prueba de regresión?\", \"Se tienen que hacer nuevas pruebas donde se han probado antes\",\n \"Manten informes detallados de las pruebas\", \"Selección de los usuarios que van a realizar las pruebas\",\n \"Se tienen que hacer nuevas pruebas donde se han probado antes\");\n this.addQuestion(q8);\n Question q9 = new Question(\"¿Cómo se realizan las pruebas de regresión?\",\n \"Selección de los usuarios que van a realizar las pruebas\",\n \"Se tienen que hacer nuevas pruebas donde se han probado antes\", \"A través de herramientas de automatización de pruebas\", \"A través de herramientas de automatización de pruebas\");\n this.addQuestion(q9);\n Question q10 = new Question(\"¿Cuándo ya hay falta de tiempo para ejecutar casos de prueba ya ejecutadas se dejan?\",\n \"En primer plano\", \"En segundo plano\", \"En tercer plano\", \"En segundo plano\");\n this.addQuestion(q10);\n //preguntas del quiz IV\n Question q11 = new Question(\n \"¿En qué se enfocan las pruebas funcionales?\",\n \"Enfocarse en los requisitos funcionales\", \"Enfocarse en los requisitos no funcionales\",\n \"Verificar la apropiada aceptación de datos\", \"Enfocarse en los requisitos funcionales\");\n this.addQuestion(q11);\n Question q12 = new Question(\"Las metas de estas pruebas son:\", \"Verificar la apropiada aceptación de datos\",\n \"Verificar el procesamiento\", \"Verificar la apropiada aceptación de datos, procedimiento y recuperación\",\n \"Verificar la apropiada aceptación de datos, procedimiento y recuperación\");\n this.addQuestion(q12);\n Question q13 = new Question(\"¿En qué estan basadas este tipo de pruebas?\",\n \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\",\n \"Esta basada en la funcionalidad de los módulos del programa\",\n \"Técnicas de cajas negra\", \"Técnicas de cajas negra\");\n this.addQuestion(q13);\n //preguntas del quiz V\n Question q14 = new Question(\n \"¿Cúal es el objetivo de esta técnica?\", \"Identificar errores introducidos por la combinación de programas probados unitariamente\",\n \"Decide qué acciones tomar cuando se descubren problemas\",\n \"Verificar que las interfaces entre las componentes de software funcionan correctamente\",\n \"Identificar errores introducidos por la combinación de programas probados unitariamente\");\n this.addQuestion(q14);\n Question q15 = new Question(\"¿Cúal es la descripción de la Prueba?\",\n \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\",\n \"Esta basada en la funcionalidad de los módulos del programa\",\n \"Describe cómo verificar que las interfaces entre las componentes de software funcionan correctamente\",\n \"Describe cómo verificar que las interfaces entre las componentes de software funcionan correctamente\");\n this.addQuestion(q15);\n Question q16 = new Question(\"Por cada caso de prueba ejecutado:\",\n \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\",\n \"Esta basada en la funcionalidad de los módulos del programa\",\n \"Comparar el resultado esperado con el resultado obtenido\", \"Comparar el resultado esperado con el resultado obtenido\");\n this.addQuestion(q16);\n //preguntas del quiz VI\n Question q17 = new Question(\n \"Este tipo de pruebas sirven para garantizar que la calidad del código es realmente óptima:\",\n \"Pruebas Unitarias\", \"Pruebas de Calidad de Código\",\n \"Pruebas de Regresión\", \"Pruebas de Calidad de Código\");\n this.addQuestion(q17);\n Question q18 = new Question(\"Pruebas de Calidad de código sirven para: \",\n \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\",\n \"Verificar que las especificaciones de diseño sean alcanzadas\",\n \"Garantizar la probabilidad de tener errores o bugs en la codificación\", \"Garantizar la probabilidad de tener errores o bugs en la codificación\");\n this.addQuestion(q18);\n Question q19 = new Question(\"Este análisis nos indica el porcentaje que nuestro código desarrollado ha sido probado por las pruebas unitarias\",\n \"Cobertura\", \"Focalización\", \"Regresión\", \"Cobertura\");\n this.addQuestion(q19);\n\n Question q20 = new Question( \"¿Qué significa V(G)?\",\n \"Número de Regiones\", \"Número de Aristas\", \"Número de Nodos\", \"Número de Regiones\");\n this.addQuestion(q20);\n\n Question q21 = new Question( \"¿Qué significa A?\",\n \"Número de Regiones\", \"Número de Aristas\", \"Número de Nodos\", \"Número de Aristas\");\n this.addQuestion(q21);\n\n Question q22 = new Question( \"¿Qué significa N?\",\n \"Número de Regiones\", \"Número de Aristas\", \"Número de Nodos\", \"Número de Nodos\");\n this.addQuestion(q22);\n\n Question q23 = new Question( \"¿Qué significa P?\",\n \"Número de Regiones\", \"Número de Aristas\", \"Número de Nodos Predicado\", \"Número de Nodos Predicado\");\n this.addQuestion(q23);\n Question q24 = new Question( \"De cuantás formas se puede calcular la complejidad ciclomatica V(G):\",\n \"3\", \"1\", \"2\", \"3\");\n this.addQuestion(q24);\n\n // END\n }", "public void quiz() {\n\t\t\t\t\tcorrectans = 0;\n\t\t\t\t\tint k = 0;\n\t\t\t\t\tint j = 0;\n\t\t\t\t\tint M = 0;\n\t\t\t\t\tj = readDifficulty();\n\t\t\t\t\tM = readProblemType();\n\t\t\t\t\t//ask the student to solve 10 different problems, as determined by the problem type\n\t\t\t for(int i = 0; i < 10; i++ ) {\n\t\t\t \t//contain two numbers sampled from a uniform random distribution with bounds determined by the problem difficulty\n\t\t\t \tint x = rand.nextInt(j); \n\t\t\t\t int y = rand.nextInt(j);\n\t\t\t\t int O = askquestion(j, M,x,y);\n\t\t\t\t if(M == 4) {\n\t\t\t\t \t float floatans = readdivision();\n\t\t\t\t \tk = divisionsol(floatans, x, y);\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t int userin = readResponse();\n\t\t\t k = isnanswercorrect(O , userin);\n\t\t\t }\n\t\t\t if(k == 1) {\n\t\t\t \t correctans++;\n\t\t\t }\n\t\t\t }\n\t\t\t int L = 0;\n\t\t\t L = displayCompletionMessage(correctans);\n\t\t\t if ( L == 1) {\n\t\t\t \tquiz();\n\t\t\t }\n\t\t\t else {\n\t\t\t \treturn;\n\t\t\t }\n\t\t\t \n\t\t\t\t}", "public int generateQuestionBox() {\n\n if(mGame.isInQuestion()) return 0;\n\n Vector2 relVel = mGame.getPlayer().getVelocity();\n\n QuestionBox e = new QuestionBox();\n e.setRelativeVelocity(relVel);\n e.setPosition(1000, rand.nextInt(mMap.getBottomBound()));\n\n Question question = mQuestionManager.getQuestion(); \n question.setVelocity(relVel.x, relVel.y);\n question.setPosition(mGame.getWidth() / 4, 20);\n question.setOptionsPosition(mGame.getWidth() - 40);\n question.setOptionsRelativeVelocity(relVel);\n question.pack(mGame.getWidth(), mGame.getHeight());\n question.reset();\n\n e.setQuestion(question);\n\n mGame.addEntity(e);\n return e.getWidth();\n }", "public void quest() {\n if ((int) (Math.random() * 100) > 50) {\n addStrangeCharacter();\n System.out.println(\"You found the npc to talk with\");\n if ((int) (Math.random() * 75) > 50) {\n addStrangeCharacter();\n System.out.println(\"And you beat the baws\");\n } else {\n System.out.println(\"And he baws owned you\");\n }\n } else {\n System.out.println(\"You couldn't even find the npc, lol n00b\");\n }\n }", "public Questions simulateQuestion(){\n return this._testQuestions.remove(0);\n }", "public void quizCreate(View view)\n {\n //Create screen\n correctOption = r.nextInt(4) + 1;\n int rand = generateRandom(r);\n\n setContentView(R.layout.quiz_layout1);\n ImageView pokeImage = (ImageView) findViewById(R.id.quiz_image);\n if (rand <= 0) {\n return;\n }\n int imageInt = getResources().getIdentifier(imageFilePrefix + rand, \"drawable\", getPackageName());\n pokeImage.setImageResource(imageInt);\n Button correctButton = (Button) findViewById(options.get(correctOption));\n correctButton.setText(myDbHelper.queryName(rand));\n\n }", "public static void displayQuestions() {\n System.out.println(\"1. Is your character male?\");\n System.out.println(\"2. Is your character female?\");\n System.out.println(\"3. Does your character have brown hair?\");\n System.out.println(\"4. Does your character have red hair?\");\n System.out.println(\"5. Does your character have blonde hair?\");\n System.out.println(\"6. Does your character have green eyes?\");\n System.out.println(\"7. Does your character have blue eyes?\");\n System.out.println(\"8. Does your character have brown eyes?\");\n System.out.println(\"9. Is your character wearing a green shirt?\");\n System.out.println(\"10. Is your character wearing a blue shirt?\");\n System.out.println(\"11. Is your character wearing a red shirt?\");\n }", "private Question setUpQuestion(List<Question> questionsList){\n int indexOfQuestion = random.nextInt(questionsList.size());\n questionToBeHandled = questionsList.get(indexOfQuestion);\n questionsList.remove(indexOfQuestion);\n return questionToBeHandled;\n }", "public ArrayList<String> generateAnswers(){\r\n ArrayList<String> ans;\r\n if(qType==0){\r\n ans = new ArrayList(Arrays.asList(\"A\",\"B\",\"C\",\"D\",\"E\"));\r\n }\r\n else{\r\n ans = new ArrayList(Arrays.asList(\"Choice 1\",\"Choice 2\"));\r\n }\r\n return ans;\r\n }", "public void setTFChoices() {\r\n Random randomGenerator = new Random();\r\n int trueFalseAnswer = randomGenerator.nextInt(2);\r\n studentAnswer.add(trueFalseAnswer);\r\n }", "public String getHow() {\t\n\t\tString[] howArray = new String[]{\n\t\t\t\t\"I'm pretty easygoing, actually.\",\n\t\t\t\t\"I don't need this question in my life\",\n\t\t\t\t\"Bleep bloop I'm a bot.\",\n\t\t\t\t\"Because you only annoy me when you’re breathing, really.\",\n\t\t\t\t\"Do yourself a favor and ignore anyone who tells you to be yourself. Bad idea in your case.\",\n\t\t\t\t\"Because I don’t know what your problem is, but I’m guessing it’s hard to pronounce.\",\n\t\t\t\t\"Because everyone’s entitled to act stupid once in awhile, but you really abuse the privilege.\",\n\t\t\t\t\"Because nobody can help imagining how much awesomer the world would be if your dad had just pulled out.\",\n\t\t\t\t\"Scrap that question, do you ever wonder what life would be like if you’d gotten enough oxygen at birth? \"\n\t\t};\n\t\tRandom random = new Random();\n\t\tint index = random.nextInt(howArray.length);\n\t\treturn howArray[index];\t\n\t}", "private String RandomGoal() {\n\t\tList<String> list = Arrays.asList(\"m\", \"m\", \"m\", \"m\", \"m\", \"m\", \"m\", \"m\", \"t\", \"t\");\n\t\tRandom rand = new Random();\n\t\tString randomgoal = list.get(rand.nextInt(list.size()));\n\n\t\treturn randomgoal;\n\t}", "public String getWhat() {\n\n\t\tString[] whatArray = new String[]{\n\t\t\t\t\"My lawyer says I don't need to answer this question\",\n\t\t\t\t\"Are you really asking me this right now?\",\n\t\t\t\t\"That was underwhelming. Try harder.\",\n\t\t\t\t\"What? What indeed.\",\n\t\t\t\t\"I think you should ask Siri that one. I really don't know what that is.\",\n\t\t\t\t\"Simon says: Everything is an object.\",\n\t\t\t\t\"You should ask STP, he's a really smart guy. Without his teaching, my creators would not have created me.\",\n\t\t\t\t\"That's a tough question to answer. Let's talk about cats instead. Meow?\"\n\t\t};\n\t\tRandom random = new Random();\n\t\tint index = random.nextInt(whatArray.length);\n\t\treturn whatArray[index];\t\n\t}", "private void randomizePuzzle() {\n\t\t// Choose random puzzles, shuffle the options.\n\t\tthis.puzzle = BarrowsPuzzleData.PUZZLES[(int) (Math.random() * BarrowsPuzzleData.PUZZLES.length)];\n\t\tthis.shuffledOptions = shuffleIntArray(puzzle.getOptions());\n\t}", "Boolean getRandomize();", "public void generate() {\n\t\tint randNum;\n\n\t\t// Generates variables.\n\t\tfor (int i = 0; i < variables.length; i++) {\n\t\t\trandNum = rand.nextInt(9) + 1;\n\t\t\twhile (!checkDuplicate(variables, i, randNum)) {\n\t\t\t\trandNum = rand.nextInt(9) + 1;\n\t\t\t}\n\t\t\tvariables[i] = randNum;\n\t\t}\n\n\t\t// Example sudoku.\n\t\trandNum = rand.nextInt(3) + 1;\n\t\tswitch (randNum) {\n\t\tcase 1:\n\t\t\tint[][] array1 = { { 4, 7, 1, 3, 2, 8, 5, 9, 6 },\n\t\t\t\t\t{ 6, 3, 9, 5, 1, 4, 7, 8, 2 },\n\t\t\t\t\t{ 5, 2, 8, 6, 7, 9, 1, 3, 4 },\n\t\t\t\t\t{ 1, 4, 2, 9, 6, 7, 3, 5, 8 },\n\t\t\t\t\t{ 8, 9, 7, 2, 5, 3, 4, 6, 1 },\n\t\t\t\t\t{ 3, 6, 5, 4, 8, 1, 2, 7, 9 },\n\t\t\t\t\t{ 9, 5, 6, 1, 3, 2, 8, 4, 7 },\n\t\t\t\t\t{ 2, 8, 4, 7, 9, 5, 6, 1, 3 },\n\t\t\t\t\t{ 7, 1, 3, 8, 4, 6, 9, 2, 5 } };\n\t\t\tcopy(array1, answer); // Copies example to answer.\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tint[][] array2 = { { 8, 3, 5, 4, 1, 6, 9, 2, 7 },\n\t\t\t\t\t{ 2, 9, 6, 8, 5, 7, 4, 3, 1 },\n\t\t\t\t\t{ 4, 1, 7, 2, 9, 3, 6, 5, 8 },\n\t\t\t\t\t{ 5, 6, 9, 1, 3, 4, 7, 8, 2 },\n\t\t\t\t\t{ 1, 2, 3, 6, 7, 8, 5, 4, 9 },\n\t\t\t\t\t{ 7, 4, 8, 5, 2, 9, 1, 6, 3 },\n\t\t\t\t\t{ 6, 5, 2, 7, 8, 1, 3, 9, 4 },\n\t\t\t\t\t{ 9, 8, 1, 3, 4, 5, 2, 7, 6 },\n\t\t\t\t\t{ 3, 7, 4, 9, 6, 2, 8, 1, 5 } };\n\t\t\tcopy(array2, answer);\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tint[][] array3 = { { 5, 3, 4, 6, 7, 8, 9, 1, 2 },\n\t\t\t\t\t{ 6, 7, 2, 1, 9, 5, 3, 4, 8 },\n\t\t\t\t\t{ 1, 9, 8, 3, 4, 2, 5, 6, 7 },\n\t\t\t\t\t{ 8, 5, 9, 7, 6, 1, 4, 2, 3 },\n\t\t\t\t\t{ 4, 2, 6, 8, 5, 3, 7, 9, 1 },\n\t\t\t\t\t{ 7, 1, 3, 9, 2, 4, 8, 5, 6 },\n\t\t\t\t\t{ 9, 6, 1, 5, 3, 7, 2, 8, 4 },\n\t\t\t\t\t{ 2, 8, 7, 4, 1, 9, 6, 3, 5 },\n\t\t\t\t\t{ 3, 4, 5, 2, 8, 6, 1, 7, 9 } };\n\t\t\tcopy(array3, answer);\n\t\t\tbreak;\n\t\t}\n\n\t\treplace(answer); // Randomize once more.\n\t\tcopy(answer, problem); // Copies answer to problem.\n\t\tgenProb(); // Generates problem.\n\n\t\tshuffle();\n\t\tcopy(problem, player); // Copies problem to player.\n\n\t\t// Checking for shuffled problem\n\t\tcopy(problem, comp);\n\n\t\tif (!solve(0, 0, 0, comp)) {\n\t\t\tgenerate();\n\t\t}\n\t\tif (!unique()) {\n\t\t\tgenerate();\n\t\t}\n\t}", "public abstract void newGuiQuestions(long ms, int n);", "public static void Random() {\n\t\tRandom ran =new Random();\r\n\t\trandom=ran.nextInt(6)+1;\r\n\t\t//random=1;\r\n\t\twho=A1063307_GUI.who2;\r\n\t\tif((ch[who].status)>0) {\r\n\t\t\tch[who].location=(ch[who].location)+random;\r\n\t\t\tch[who].status=(ch[who].status)-1;\r\n\t\t\t\r\n\t\t}else {\r\n\t\t\t\treturn;\r\n\t\t\t}\t\t\r\n\t}", "private String randomResponse()\r\n\t{\r\n\t\t\tpatience--;\r\n\t\t\tif (patience==0)\r\n\t\t\t{\r\n\t\t\t\tString[] randomArray = {\"Huh?\",\"Can you rephrase that in reptilian for me?\",\"Sorry I don't understand.\"\r\n\t\t\t\t\t\t,\"Hmmm\",\"Hmph\"};\r\n\t\t\t\tRandom rand = new Random();\r\n\t\t\t\tint i = rand.nextInt(4)+0;\r\n\t\t\t\treturn randomArray[i];\r\n\t\t\t}\t\r\n\t\t\telse if (patience <= 0)\r\n\t\t\t{\r\n\t\t\t\tString[] randomImpatientArray = {\"Hiss\",\"Can you please use your words correctly to speak\",\">:(((\",\"Your pushing my limit\",\"You were here... Now your here!!\",\"ok.....\"};\r\n\t\t\t\tRandom rand = new Random();\r\n\t\t\t\tint i = rand.nextInt(5)+0;\r\n\t\t\t\treturn randomImpatientArray[i];\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\tString[] randomPatientArray = {\"Hey can you please say that again.\",\"Excuse me but I don't understand\",\"Oh okay!Interesting\",\"Yeah yeah totally\"};\r\n\t\t\t\tRandom rand = new Random();\r\n\t\t\t\tint i = rand.nextInt(3)+0;\r\n\t\t\t\treturn randomPatientArray[i];\r\n\t\t\t}\r\n\t}", "public void takeQuiz()\r\n\t{\r\n\t\tScanner in = new Scanner(System.in);\r\n\t\tRandom generator = new Random();\r\n\t\tint question;\r\n\t\tint right = 0;\r\n\t\tString answer;\r\n\t\t\r\n\t\tfor(int i=0; i<10; i++)\r\n\t\t{\r\n\t\t\tquestion = generator.nextInt(questions.size());\r\n\t\t\t\r\n\t\t\tSystem.out.println( (i+1) + \".\" + questions.get(question).toString());\r\n\t\t\tSystem.out.println(\"Answer: \");\r\n\t\t\tanswer = in.nextLine();\r\n\t\t\t\r\n\t\t\t//checks input\r\n\t\t\twhile( !( answer.equalsIgnoreCase(\"1\") || answer.equalsIgnoreCase(\"2\") || answer.equalsIgnoreCase(\"3\") || answer.equalsIgnoreCase(\"4\") ) )\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"Invalid entry. Enter again:\");\r\n\t\t\t\tanswer = in.nextLine();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif( answer.equalsIgnoreCase(questions.get(question).getCorrectAnswer()))\r\n\t\t\t{\r\n\t\t\t\tright++;\r\n\t\t\t}\t\t\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(\"You got \" + right + \" questions right.\");\r\n\t}", "public Queue<WordExam> generateAllWordsExam(List<Word> wordsToTest) {\n LinkedList<WordExam> exams = new LinkedList<>();\n for(Word curWord : wordsToTest) {\n List<String> curWordExamOptions = getWordOptions(curWord, wordsToTest, 4);\n WordExam curWordExam = new WordExam(curWord, curWordExamOptions);\n exams.add(curWordExam);\n }\n\n Collections.shuffle(exams);\n\n return exams;\n }", "private void initQuestions() {\n questionList = Arrays.asList(getResources().getStringArray(R.array.questions));\n questionOne.setText(questionList.get(0));\n questionTwo.setText(questionList.get(1));\n questionThree.setText(questionList.get(2));\n questionFour.setText(questionList.get(3));\n questionFive.setText(questionList.get(4));\n questionSix.setText(questionList.get(5));\n\n List<String> optionsTwoList = Arrays.asList(getResources().getStringArray(R.array.qTwoOptions));\n answerTwoOptionA.setText(optionsTwoList.get(0));\n answerTwoOptionB.setText(optionsTwoList.get(1));\n answerTwoOptionC.setText(optionsTwoList.get(2));\n answerTwoOptionD.setText(optionsTwoList.get(3));\n\n List<String> optionsThreeList = Arrays.asList(getResources().getStringArray(R.array.qThreeOptions));\n answerThreeOptionA.setText(optionsThreeList.get(0));\n answerThreeOptionB.setText(optionsThreeList.get(1));\n answerThreeOptionC.setText(optionsThreeList.get(2));\n answerThreeOptionD.setText(optionsThreeList.get(3));\n\n List<String> optionsFiveList = Arrays.asList(getResources().getStringArray(R.array.qFiveOptions));\n answerFiveOptionA.setText(optionsFiveList.get(0));\n answerFiveOptionB.setText(optionsFiveList.get(1));\n answerFiveOptionC.setText(optionsFiveList.get(2));\n answerFiveOptionD.setText(optionsFiveList.get(3));\n\n List<String> optionsSixList = Arrays.asList(getResources().getStringArray(R.array.qSixOptions));\n answerSixOptionA.setText(optionsSixList.get(0));\n answerSixOptionB.setText(optionsSixList.get(1));\n answerSixOptionC.setText(optionsSixList.get(2));\n answerSixOptionD.setText(optionsSixList.get(3));\n\n }", "public abstract void randomize();", "public static List<Question> getQuestions() {\n if (QUESTION == null) {\n QUESTION = new ArrayList<>();\n List<Option> options = new ArrayList<Option>();\n options.add(new Option(1, \"Radio Waves\"));\n options.add(new Option(2, \"Sound Waves\"));\n options.add(new Option(3, \"Gravity Waves\"));\n options.add(new Option(4, \"Light Waves\"));\n QUESTION.add(new Question(1, \"Which kind of waves are used to make and receive cellphone calls?\", getCategory(4), options, options.get(0)));\n\n List<Option> options2 = new ArrayList<Option>();\n options2.add(new Option(1, \"8\"));\n options2.add(new Option(2, \"6\"));\n options2.add(new Option(3, \"3\"));\n options2.add(new Option(4, \"1\"));\n QUESTION.add(new Question(2, \"How many hearts does an octopus have?\", getCategory(4), options2, options2.get(2)));\n\n List<Option> options3 = new ArrayList<Option>();\n options3.add(new Option(1, \"Newton's Law\"));\n options3.add(new Option(2, \"Hooke's law\"));\n options3.add(new Option(3, \"Darwin's Law\"));\n options3.add(new Option(4, \"Archimedes' principle\"));\n QUESTION.add(new Question(3, \"Whose law states that the force needed to extend a spring by some distance is proportional to that distance?\", getCategory(4), options3, options3.get(1)));\n\n List<Option> options4 = new ArrayList<Option>();\n options4.add(new Option(1, \"M\"));\n options4.add(new Option(2, \"$\"));\n options4.add(new Option(3, \"W\"));\n options4.add(new Option(4, \"#\"));\n QUESTION.add(new Question(4, \"What is the chemical symbol for tungsten?\", getCategory(4), options4, options4.get(2)));\n\n List<Option> options5 = new ArrayList<Option>();\n options5.add(new Option(1, \"Pulsar\"));\n options5.add(new Option(2, \"Draconis\"));\n options5.add(new Option(3, \"Aludra\"));\n options5.add(new Option(4, \"Alwaid\"));\n QUESTION.add(new Question(5, \"What is a highly magnetized, rotating neutron star that emits a beam of electromagnetic radiation?\", getCategory(4), options5, options5.get(0)));\n\n List<Option> options6 = new ArrayList<Option>();\n options6.add(new Option(1, \"2\"));\n options6.add(new Option(2, \"4\"));\n options6.add(new Option(3, \"7\"));\n options6.add(new Option(4, \"10\"));\n QUESTION.add(new Question(6, \"At what temperature is Centigrade equal to Fahrenheit?\", getCategory(4), options6, options6.get(2)));\n\n List<Option> options7 = new ArrayList<Option>();\n options7.add(new Option(1, \"Temperature\"));\n options7.add(new Option(2, \"Distance\"));\n options7.add(new Option(3, \"Light Intensity\"));\n options7.add(new Option(4, \"Noise\"));\n QUESTION.add(new Question(7, \"Kelvin is a unit to measure what?\", getCategory(4), options7, options7.get(2)));\n\n List<Option> options8 = new ArrayList<Option>();\n options8.add(new Option(1, \"Mars\"));\n options8.add(new Option(2, \"Jupiter\"));\n options8.add(new Option(3, \"Saturn\"));\n options8.add(new Option(4, \"Neptune\"));\n QUESTION.add(new Question(8, \"Triton is the largest moon of what planet?\", getCategory(4), options8, options8.get(3)));\n\n List<Option> options9 = new ArrayList<Option>();\n options9.add(new Option(1, \"Brain\"));\n options9.add(new Option(2, \"Heart\"));\n options9.add(new Option(3, \"Lungs\"));\n options9.add(new Option(4, \"Skin\"));\n QUESTION.add(new Question(9, \"What is the human body’s biggest organ?\", getCategory(4), options9, options9.get(3)));\n\n List<Option> options10 = new ArrayList<Option>();\n options10.add(new Option(1, \"Skull\"));\n options10.add(new Option(2, \"Knee Cap\"));\n options10.add(new Option(3, \"Shoulder Joint\"));\n options10.add(new Option(4, \"Backbone\"));\n QUESTION.add(new Question(10, \"What is the more common name for the patella?\", getCategory(4), options10, options10.get(1)));\n\n List<Option> options11 = new ArrayList<Option>();\n options11.add(new Option(1, \"Mother India\"));\n options11.add(new Option(2, \"The Guide\"));\n options11.add(new Option(3, \"Madhumati\"));\n options11.add(new Option(4, \"Amrapali\"));\n QUESTION.add(new Question(11, \"Which was the 1st Indian movie submitted for Oscar?\", getCategory(1), options11, options11.get(0)));\n\n List<Option> options12 = new ArrayList<Option>();\n options12.add(new Option(1, \"Gunda\"));\n options12.add(new Option(2, \"Sholey\"));\n options12.add(new Option(3, \"Satte pe Satta\"));\n options12.add(new Option(4, \"Angoor\"));\n QUESTION.add(new Question(12, \"Which film is similar to Seven Brides For Seven Brothers?\", getCategory(1), options12, options12.get(2)));\n\n List<Option> options13 = new ArrayList<Option>();\n options13.add(new Option(1, \"Rocky\"));\n options13.add(new Option(2, \"Pancham\"));\n options13.add(new Option(3, \"Chichi\"));\n options13.add(new Option(4, \"Chintu\"));\n QUESTION.add(new Question(13, \"Music Director R.D. Burman is also known as?\", getCategory(1), options13, options13.get(1)));\n\n List<Option> options14 = new ArrayList<Option>();\n options14.add(new Option(1, \"Nagarjuna\"));\n options14.add(new Option(2, \"Chiranjeevi\"));\n options14.add(new Option(3, \"Rajinikanth\"));\n options14.add(new Option(4, \"NTR\"));\n QUESTION.add(new Question(14, \"Shivaji Rao Gaikwad is the real name of which actor?\", getCategory(1), options14, options14.get(2)));\n\n List<Option> options15 = new ArrayList<Option>();\n options15.add(new Option(1, \"Geraftaar\"));\n options15.add(new Option(2, \"Hum\"));\n options15.add(new Option(3, \"Andha kanoon\"));\n options15.add(new Option(4, \"Agneepath\"));\n QUESTION.add(new Question(15, \"Name the film in which Amitabh Bachchan, Rajinikanth and Kamal Hasan worked together.\", getCategory(1), options15, options15.get(0)));\n\n List<Option> options16 = new ArrayList<Option>();\n options16.add(new Option(1, \"AR Rahman\"));\n options16.add(new Option(2, \"Bhanu Athaiya\"));\n options16.add(new Option(3, \"Gulzar\"));\n options16.add(new Option(4, \"Rasul Pookutty\"));\n QUESTION.add(new Question(16, \"First Indian to win Oscar award?\", getCategory(1), options16, options16.get(1)));\n\n List<Option> options17 = new ArrayList<Option>();\n options17.add(new Option(1, \"Jab tak hai jaan\"));\n options17.add(new Option(2, \"Rab ne bana di jodi\"));\n options17.add(new Option(3, \"Veer zara\"));\n options17.add(new Option(4, \"Ek tha tiger\"));\n QUESTION.add(new Question(17, \"Which was the last movie directed by Yash Chopra?\", getCategory(1), options17, options17.get(0)));\n\n\n List<Option> options18 = new ArrayList<Option>();\n options18.add(new Option(1, \"‘Thala’ Ajith\"));\n options18.add(new Option(2, \"Arjun Sarja\"));\n options18.add(new Option(3, \"Ashutosh Gawariker\"));\n options18.add(new Option(4, \"AK Hangal\"));\n QUESTION.add(new Question(18, \"\\\"Itna sannata kyun hai bhai?\\\" Who said this, now legendary words, in 'Sholay'?\", getCategory(1), options18, options18.get(3)));\n\n List<Option> options19 = new ArrayList<Option>();\n options19.add(new Option(1, \"Tommy\"));\n options19.add(new Option(2, \"Tuffy\"));\n options19.add(new Option(3, \"Toffy\"));\n options19.add(new Option(4, \"Timmy\"));\n QUESTION.add(new Question(19, \"What was the name of Madhuri Dixit’s dog in Hum Aapke Hain Koun?\", getCategory(1), options19, options19.get(1)));\n\n List<Option> options20 = new ArrayList<Option>();\n options20.add(new Option(1, \"Premnath\"));\n options20.add(new Option(2, \"Dilip Kumar\"));\n options20.add(new Option(3, \"Raj Kapoor\"));\n options20.add(new Option(4, \"Kishore Kumar\"));\n QUESTION.add(new Question(20, \"Beautiful actress Madhubala was married to?\", getCategory(1), options20, options20.get(3)));\n\n\n List<Option> options21 = new ArrayList<Option>();\n options21.add(new Option(1, \"Sher Khan\"));\n options21.add(new Option(2, \"Mufasa\"));\n options21.add(new Option(3, \"Simba\"));\n options21.add(new Option(4, \"Sarabi\"));\n QUESTION.add(new Question(21, \"What is the name of the young lion whose story is told in the musical 'The Lion King'?\", getCategory(2), options21, options21.get(2)));\n\n List<Option> options22 = new ArrayList<Option>();\n options22.add(new Option(1, \"Scotland\"));\n options22.add(new Option(2, \"England\"));\n options22.add(new Option(3, \"Germany\"));\n options22.add(new Option(4, \"Netherland\"));\n QUESTION.add(new Question(22, \"Which country's freedom struggle is portrayed in the Mel Gibson movie 'Braveheart'?\", getCategory(2), options22, options22.get(0)));\n\n List<Option> options23 = new ArrayList<Option>();\n options23.add(new Option(1, \"Letters to Juliet\"));\n options23.add(new Option(2, \"Saving Private Ryan\"));\n options23.add(new Option(3, \"Forest Gump\"));\n options23.add(new Option(4, \"Gone With The Wind\"));\n QUESTION.add(new Question(23, \"Which movie had this dialogue \\\"My mama always said, life was like a box of chocolates. You never know what you're gonna get.\", getCategory(2), options23, options23.get(2)));\n\n List<Option> options24 = new ArrayList<Option>();\n options24.add(new Option(1, \"Die\"));\n options24.add(new Option(2, \"Golden\"));\n options24.add(new Option(3, \"Casino\"));\n options24.add(new Option(4, \"Never\"));\n QUESTION.add(new Question(24, \"Excluding \\\"the\\\", which word appears most often in Bond movie titles?\", getCategory(2), options24, options24.get(3)));\n\n List<Option> options25 = new ArrayList<Option>();\n options25.add(new Option(1, \"Bishop\"));\n options25.add(new Option(2, \"Ash\"));\n options25.add(new Option(3, \"Call\"));\n options25.add(new Option(4, \"Carlos\"));\n QUESTION.add(new Question(25, \"Name the android in movie Alien \", getCategory(2), options25, options25.get(1)));\n\n List<Option> options26 = new ArrayList<Option>();\n options26.add(new Option(1, \"Gone with the wind\"));\n options26.add(new Option(2, \"Home footage\"));\n options26.add(new Option(3, \"With Our King and Queen Through India\"));\n options26.add(new Option(4, \"Treasure Island\"));\n QUESTION.add(new Question(26, \"Which was the first colour film to win a Best Picture Oscar?\", getCategory(2), options26, options26.get(0)));\n\n List<Option> options27 = new ArrayList<Option>();\n options27.add(new Option(1, \"Robert Redford\"));\n options27.add(new Option(2, \"Michael Douglas\"));\n options27.add(new Option(3, \"Harrison Ford\"));\n options27.add(new Option(4, \"Patrick Swayze\"));\n QUESTION.add(new Question(27, \"Who played the male lead opposite Sharon Stone in the hugely successful movie 'The Basic Instinct'?\", getCategory(2), options27, options27.get(1)));\n\n List<Option> options28 = new ArrayList<Option>();\n options28.add(new Option(1, \"10,000 BC\"));\n options28.add(new Option(2, \"Day after tomorrow\"));\n options28.add(new Option(3, \"2012\"));\n options28.add(new Option(4, \"The Noah's Ark Principle\"));\n QUESTION.add(new Question(28, \"Which Roland Emmerich movie portrays fictional cataclysmic events that were to take place in early 21st century?\", getCategory(2), options28, options28.get(2)));\n\n List<Option> options29 = new ArrayList<Option>();\n options29.add(new Option(1, \"Finding Nemo\"));\n options29.add(new Option(2, \"The Incredibles\"));\n options29.add(new Option(3, \"Monsters, Inc.\"));\n options29.add(new Option(4, \"Toy Story\"));\n QUESTION.add(new Question(29, \"What was the first movie by Pixar to receive a rating higher than G in the United States?\", getCategory(2), options29, options29.get(1)));\n\n List<Option> options30 = new ArrayList<Option>();\n options30.add(new Option(1, \"Draco\"));\n options30.add(new Option(2, \"Harry\"));\n options30.add(new Option(3, \"Hermione\"));\n options30.add(new Option(4, \"Ron\"));\n QUESTION.add(new Question(30, \"In the 'Prisoner of Azkaban', who throws rocks at Hagrid's hut so that Harry, Ron and Hermione can leave?\", getCategory(2), options30, options30.get(2)));\n\n List<Option> options31 = new ArrayList<Option>();\n options31.add(new Option(1, \"Brett Lee\"));\n options31.add(new Option(2, \"Adam Gilchrist\"));\n options31.add(new Option(3, \"Jason Gillespie\"));\n options31.add(new Option(4, \"Glenn McGrath\"));\n QUESTION.add(new Question(31, \"'Dizzy' is the nickname of what Australian player?\", getCategory(3), options31, options31.get(2)));\n\n List<Option> options32 = new ArrayList<Option>();\n options32.add(new Option(1, \"1883 between Australia and Wales\"));\n options32.add(new Option(2, \"1844 between Canada and the USA\"));\n options32.add(new Option(3, \"1869 between England and Australia\"));\n options32.add(new Option(4, \"1892 between England and India\"));\n QUESTION.add(new Question(32, \"In what year was the first international cricket match held?\", getCategory(3), options32, options32.get(1)));\n\n List<Option> options33 = new ArrayList<Option>();\n options33.add(new Option(1, \"Salim Durrani\"));\n options33.add(new Option(2, \"Farooq Engineer\"));\n options33.add(new Option(3, \"Vijay Hazare\"));\n options33.add(new Option(4, \"Mansur Ali Khan Pataudi\"));\n QUESTION.add(new Question(33, \"Which former Indian cricketer was nicknamed 'Tiger'?\", getCategory(3), options33, options33.get(3)));\n\n List<Option> options34 = new ArrayList<Option>();\n options34.add(new Option(1, \"Piyush Chawla\"));\n options34.add(new Option(2, \"Gautam Gambhir\"));\n options34.add(new Option(3, \"Irfan Pathan\"));\n options34.add(new Option(4, \"Suresh Raina\"));\n QUESTION.add(new Question(34, \"Who was named as the ICC Emerging Player of the Year 2004?\", getCategory(3), options34, options34.get(2)));\n\n List<Option> options35 = new ArrayList<Option>();\n options35.add(new Option(1, \"Subhash Gupte\"));\n options35.add(new Option(2, \"M.L.Jaisimha\"));\n options35.add(new Option(3, \"Raman Lamba\"));\n options35.add(new Option(4, \"Lala Amarnath\"));\n QUESTION.add(new Question(35, \"Which cricketer died on the field in Bangladesh while playing for Abahani Club?\", getCategory(3), options35, options35.get(2)));\n\n List<Option> options36 = new ArrayList<Option>();\n options36.add(new Option(1, \"V. Raju\"));\n options36.add(new Option(2, \"Rajesh Chauhan\"));\n options36.add(new Option(3, \"Arshad Ayub\"));\n options36.add(new Option(4, \"Narendra Hirwani\"));\n QUESTION.add(new Question(36, \"In 1987-88, which Indian spinner took 16 wickets on his Test debut?\", getCategory(3), options36, options36.get(3)));\n\n List<Option> options37 = new ArrayList<Option>();\n options37.add(new Option(1, \"Ravi Shastri\"));\n options37.add(new Option(2, \"Dilip Vengsarkar\"));\n options37.add(new Option(3, \"Sachin Tendulkar\"));\n options37.add(new Option(4, \"Sanjay Manjrekar\"));\n QUESTION.add(new Question(37, \"Which former Indian Test cricketer equalled Gary Sobers world record of six sixes in an over in a Ranji Trophy match?\", getCategory(3), options37, options37.get(0)));\n\n List<Option> options38 = new ArrayList<Option>();\n options38.add(new Option(1, \"Mohsin khan\"));\n options38.add(new Option(2, \"Wasim Akram\"));\n options38.add(new Option(3, \"Naveen Nischol\"));\n options38.add(new Option(4, \"None Of The Above\"));\n QUESTION.add(new Question(38, \"Reena Roy the Indian film actress married a cricketer?\", getCategory(3), options38, options38.get(0)));\n\n List<Option> options39 = new ArrayList<Option>();\n options39.add(new Option(1, \"London, England\"));\n options39.add(new Option(2, \"Mumbai, India\"));\n options39.add(new Option(3, \"Lahore, Pakistan\"));\n options39.add(new Option(4, \"Nairobi, Kenya\"));\n QUESTION.add(new Question(39, \"Where did Yuvraj Singh make his ODI debut?\", getCategory(3), options39, options39.get(3)));\n\n List<Option> options40 = new ArrayList<Option>();\n options40.add(new Option(1, \"Arvind De Silva\"));\n options40.add(new Option(2, \"Roshan Mahanama\"));\n options40.add(new Option(3, \"Harshan Tilakaratne\"));\n options40.add(new Option(4, \"None Of The Above\"));\n QUESTION.add(new Question(40, \"Kapil Dev's 432 (world) record breaking victim was?\", getCategory(3), options40, options40.get(2)));\n\n List<Option> options41 = new ArrayList<Option>();\n options41.add(new Option(1, \"Vatican\"));\n options41.add(new Option(2, \"Iceland\"));\n options41.add(new Option(3, \"Netherlands\"));\n options41.add(new Option(4, \"Hungary\"));\n QUESTION.add(new Question(41, \"Which country has the lowest population density of any country in Europe?\", getCategory(5), options41, options41.get(1)));\n\n List<Option> options42 = new ArrayList<Option>();\n options42.add(new Option(1, \"Cambodia\"));\n options42.add(new Option(2, \"Thailand\"));\n options42.add(new Option(3, \"Mynamar\"));\n options42.add(new Option(4, \"Bhutan\"));\n QUESTION.add(new Question(42, \"Angkor Wat, the largest religious monument in the world, is in which country?\", getCategory(5), options42, options42.get(0)));\n\n List<Option> options43 = new ArrayList<Option>();\n options43.add(new Option(1, \"Southern\"));\n options43.add(new Option(2, \"Northern and Southern\"));\n options43.add(new Option(3, \"Northern\"));\n options43.add(new Option(4, \"None of the above\"));\n QUESTION.add(new Question(43, \"Is the Tropic of Cancer in the northern or southern hemisphere?\", getCategory(5), options43, options43.get(2)));\n\n List<Option> options44 = new ArrayList<Option>();\n options44.add(new Option(1, \"Bangladesh\"));\n options44.add(new Option(2, \"Nepal\"));\n options44.add(new Option(3, \"Pakistan\"));\n options44.add(new Option(4, \"China\"));\n QUESTION.add(new Question(44, \"The Ganges flows through India and which other country?\", getCategory(5), options44, options44.get(0)));\n\n List<Option> options45 = new ArrayList<Option>();\n options45.add(new Option(1, \"Indian\"));\n options45.add(new Option(2, \"Pacific\"));\n options45.add(new Option(3, \"Arctic\"));\n options45.add(new Option(4, \"Atlantic\"));\n QUESTION.add(new Question(45, \"Which ocean lies on the east coast of the United States?\", getCategory(5), options45, options45.get(3)));\n\n List<Option> options46 = new ArrayList<Option>();\n options46.add(new Option(1, \"Prime Axis\"));\n options46.add(new Option(2, \"Lambert Line\"));\n options46.add(new Option(3, \"Prime Meridian\"));\n options46.add(new Option(4, \"Greenwich\"));\n QUESTION.add(new Question(46, \"What is the imaginary line called that connects the north and south pole?\", getCategory(5), options46, options46.get(2)));\n\n List<Option> options47 = new ArrayList<Option>();\n options47.add(new Option(1, \"Tropic of Cancer\"));\n options47.add(new Option(2, \"Tropic of Capricorn\"));\n QUESTION.add(new Question(47, \"The most northerly circle of latitude on the Earth at which the Sun may appear directly overhead at its culmination is called?\", getCategory(5), options47, options47.get(0)));\n\n List<Option> options48 = new ArrayList<Option>();\n options48.add(new Option(1, \"Nevada\"));\n options48.add(new Option(2, \"Arizona\"));\n options48.add(new Option(3, \"New Mexico\"));\n options48.add(new Option(4, \"San Fransisco\"));\n QUESTION.add(new Question(48, \"Which U.S. state is the Grand Canyon located in?\", getCategory(5), options48, options48.get(1)));\n\n List<Option> options49 = new ArrayList<Option>();\n options49.add(new Option(1, \"Indian Ocean\"));\n options49.add(new Option(2, \"Atlantic Ocean\"));\n options49.add(new Option(3, \"Pacific Ocean\"));\n options49.add(new Option(4, \"Arctic Ocean\"));\n QUESTION.add(new Question(49, \"Which is the largest body of water?\", getCategory(5), options49, options49.get(2)));\n\n List<Option> options50 = new ArrayList<Option>();\n options50.add(new Option(1, \"Maldives\"));\n options50.add(new Option(2, \"Monaco\"));\n options50.add(new Option(3, \"Tuvalu\"));\n options50.add(new Option(4, \"Vatican City\"));\n QUESTION.add(new Question(50, \"Which is the smallest country, measured by total land area?\", getCategory(5), options50, options50.get(3)));\n\n List<Option> options51 = new ArrayList<Option>();\n options51.add(new Option(1, \"1923\"));\n options51.add(new Option(2, \"1938\"));\n options51.add(new Option(3, \"1917\"));\n options51.add(new Option(4, \"1914\"));\n QUESTION.add(new Question(51, \"World War I began in which year?\", getCategory(6), options51, options51.get(3)));\n\n List<Option> options52 = new ArrayList<Option>();\n options52.add(new Option(1, \"France\"));\n options52.add(new Option(2, \"Germany\"));\n options52.add(new Option(3, \"Austria\"));\n options52.add(new Option(4, \"Hungary\"));\n QUESTION.add(new Question(52, \"Adolf Hitler was born in which country?\", getCategory(6), options52, options52.get(2)));\n\n List<Option> options53 = new ArrayList<Option>();\n options53.add(new Option(1, \"1973\"));\n options53.add(new Option(2, \"Austin\"));\n options53.add(new Option(3, \"Dallas\"));\n options53.add(new Option(4, \"1958\"));\n QUESTION.add(new Question(53, \"John F. Kennedy was assassinated in?\", getCategory(6), options53, options53.get(2)));\n\n List<Option> options54 = new ArrayList<Option>();\n options54.add(new Option(1, \"Johannes Gutenburg\"));\n options54.add(new Option(2, \"Benjamin Franklin\"));\n options54.add(new Option(3, \"Sir Isaac Newton\"));\n options54.add(new Option(4, \"Martin Luther\"));\n QUESTION.add(new Question(54, \"The first successful printing press was developed by this man.\", getCategory(6), options54, options54.get(0)));\n\n List<Option> options55 = new ArrayList<Option>();\n options55.add(new Option(1, \"The White Death\"));\n options55.add(new Option(2, \"The Black Plague\"));\n options55.add(new Option(3, \"Smallpox\"));\n options55.add(new Option(4, \"The Bubonic Plague\"));\n QUESTION.add(new Question(55, \"The disease that ravaged and killed a third of Europe's population in the 14th century is known as\", getCategory(6), options55, options55.get(3)));\n\n List<Option> options56 = new ArrayList<Option>();\n options56.add(new Option(1, \"Panipat\"));\n options56.add(new Option(2, \"Troy\"));\n options56.add(new Option(3, \"Waterloo\"));\n options56.add(new Option(4, \"Monaco\"));\n QUESTION.add(new Question(56, \"Napoleon was finally defeated at the battle known as?\", getCategory(6), options56, options56.get(2)));\n\n List<Option> options57 = new ArrayList<Option>();\n options57.add(new Option(1, \"Magellan\"));\n options57.add(new Option(2, \"Cook\"));\n options57.add(new Option(3, \"Marco\"));\n options57.add(new Option(4, \"Sir Francis Drake\"));\n QUESTION.add(new Question(57, \"Who was the first Western explorer to reach China?\", getCategory(6), options57, options57.get(2)));\n\n List<Option> options58 = new ArrayList<Option>();\n options58.add(new Option(1, \"Shah Jahan\"));\n options58.add(new Option(2, \"Chandragupta Maurya\"));\n options58.add(new Option(3, \"Humayun\"));\n options58.add(new Option(4, \"Sher Shah Suri\"));\n QUESTION.add(new Question(58, \"Who built the Grand Trunk Road?\", getCategory(6), options58, options58.get(3)));\n\n List<Option> options59 = new ArrayList<Option>();\n options59.add(new Option(1, \"Jawaharlal Nehru\"));\n options59.add(new Option(2, \"M. K. Gandhi\"));\n options59.add(new Option(3, \"Dr. Rajendra Prasad\"));\n options59.add(new Option(4, \"Dr. S. Radhakrishnan\"));\n QUESTION.add(new Question(59, \"Who was the first President of India?\", getCategory(6), options59, options59.get(2)));\n\n List<Option> options60 = new ArrayList<Option>();\n options60.add(new Option(1, \"8\"));\n options60.add(new Option(2, \"10\"));\n options60.add(new Option(3, \"5\"));\n options60.add(new Option(4, \"18\"));\n QUESTION.add(new Question(60, \"How many days did the battle of Mahabharata last?\", getCategory(6), options60, options60.get(3)));\n }\n return QUESTION;\n }", "public void nextQuestion(View view) {\n\n Integer num1, num2;\n num1=generateRandomNumber(100);\n num2=generateRandomNumber(100);\n\n //set random number in textview\n TextView tv;\n tv=findViewById(R.id.question);\n tv.setText(Integer.toString(num1)+ \"X\" + Integer.toString(num2));\n\n }", "private void creatingNewQuestion() {\r\n AbstractStatement<?> s;\r\n ListQuestions lq = new ListQuestions(ThemesController.getThemeSelected());\r\n switch ((String) typeQuestion.getValue()) {\r\n case \"TrueFalse\":\r\n // just to be sure the answer corresponds to the json file\r\n Boolean answer = CorrectAnswer.getText().equalsIgnoreCase(\"true\");\r\n s = new TrueFalse<>(Text.getText(), answer);\r\n break;\r\n\r\n case \"MCQ\":\r\n s = new MCQ<>(Text.getText(), TextAnswer1.getText(), TextAnswer2.getText(), TextAnswer3.getText(), CorrectAnswer.getText());\r\n break;\r\n\r\n default:\r\n s = new ShortAnswer<>(Text.getText(), CorrectAnswer.getText());\r\n break;\r\n }\r\n lq.addQuestion(new Question(s, ThemesController.getThemeSelected(), Difficulty.fromInteger((Integer) difficulty.getValue()) ));\r\n lq.writeJson(ThemesController.getThemeSelected());\r\n }", "public void createMatching() {\n int numChoices = 0;\n Question q = new Matching(this.in,this.o);\n this.o.setDisplay(\"Enter the prompt for your Matching question:\\n\");\n this.o.getDisplay();\n\n q.setPrompt(this.in.getUserInput());\n\n while (numChoices == 0) {\n this.o.setDisplay(\"Enter the number of choices for your question:\\n\");\n this.o.getDisplay();\n\n try {\n numChoices = Integer.parseInt(this.in.getUserInput());\n } catch (NumberFormatException e) {\n numChoices = 0;\n }\n }\n\n for (int i=0; i<numChoices;i++) {\n this.o.setDisplay(\"Enter choice#\" + (i+1) + \"\\n\");\n this.o.getDisplay();\n\n ((Matching) q).addChoicesToMatch(this.in.getUserInput());\n }\n\n for (int i=0; i<numChoices;i++) {\n this.o.setDisplay(\"Answer#\" + (i+1) + \" (enter any answer for one of the choices)\\n\");\n this.o.getDisplay();\n\n ((Matching) q).addChoice(this.in.getUserInput());\n }\n\n q.setMaxResponses(numChoices);\n\n if (isTest) {\n int choiceNum = 0;\n RCA ca = new RCA(this.in,this.o);\n Test t = (Test)this.survey;\n ArrayList<Integer> ans = new ArrayList<Integer>();\n\n for (int j=0; j < q.getMaxResponses(); j++){\n\n while (choiceNum == 0) {\n this.o.setDisplay(\"Enter answer# for choice#\" + (j+1) + \": \\n\");\n this.o.getDisplay();\n\n try {\n choiceNum = Integer.parseInt(this.in.getUserInput());\n\n if (choiceNum > numChoices || choiceNum < 1) {\n choiceNum = 0;\n } else {\n if (ans.contains(choiceNum)) {\n this.o.setDisplay(\"Answer already used\\n\");\n this.o.getDisplay();\n choiceNum = 0;\n } else {\n ans.add(choiceNum);\n ca.addResponse(Integer.toString(choiceNum));\n }\n }\n\n } catch (NumberFormatException e) {\n choiceNum = 0;\n }\n }\n choiceNum = 0;\n }\n t.addAnswer(ca);\n }\n this.survey.addQuestion(q);\n }", "private String generatorResponse(int countLines) {\n return this.answersList.get(new Random().nextInt(countLines));\n }", "public static TradeGood getRandom() {\n TradeGood[] options = new TradeGood[] {WATER, FURS, ORE, FOOD, GAMES, FIREARMS,\n MEDICINE, NARCOTICS, ROBOTS, MACHINES};\n int index = GameState.getState().rng.nextInt(10);\n return options[index];\n }", "private void setUpQuestions(){\n if (index == questions.size()){ //if no more questions, jumps to the endGame\n endGame();\n }else {\n currentQuestion = questions.get(index);\n\n lblQuestion.setText(currentQuestion.getQuestion());\n imgPicture.setImageResource(currentQuestion.getPicture());\n btnRight.setText(currentQuestion.getOption1());\n btnLeft.setText(currentQuestion.getOption2());\n index++;\n }\n }", "public void setMultChoices() {\r\n Random randomGenerator = new Random();\r\n int howManyAnswer = randomGenerator.nextInt(6) + 1;\r\n for (int i = 0; i < howManyAnswer; i++) {\r\n int multipleAnswer = randomGenerator.nextInt(6);\r\n checkDuplicate(studentAnswer, multipleAnswer);\r\n\r\n }\r\n }", "public String getExerciseList() {\n int max = 5;\n int min = 1;\n\n int random = (int )(Math.random() * max + min);\n\n // DETERMINE WHICH EXERCISE TO ADD\n String exerciseList = \"\\n\";\n\n if (random == pushup) {\n exerciseList += \"Push Ups\";\n } else if (random == splitSquat) {\n exerciseList += \"Split Squats\";\n } else if (random == kbDeadLift) {\n exerciseList += \"Kettle Bell Dead Lifts\";\n } else if (random == armLift) {\n exerciseList += \"Arm Lifts\";\n } else {\n exerciseList += \"Sit Ups\";\n }\n\n return exerciseList;\n }", "private String getChallenge() {\n String challenge = null;\n\n int freq = getRandomNumberInRange(1, 5);\n\n if (freq == 1) {\n challenge = getString(R.string.challenge_box_jumps) + getRandomNumberInRange(1,5) + getString(R.string.times_suffix);\n }\n else if (freq == 2) {\n challenge = getString(R.string.challenge_push_ups) + getRandomNumberInRange(1,5) + getString(R.string.times_suffix);\n }\n else if (freq == 3) {\n challenge = getString(R.string.challenge_sit_ups) + getRandomNumberInRange(1,5) + getString(R.string.times_suffix);\n }\n else if (freq == 4) {\n challenge = getString(R.string.challenge_squats) + getRandomNumberInRange(1,5) + getString(R.string.times_suffix);\n }\n else if (freq == 5) {\n challenge = getString(R.string.challenge_planking) + getRandomNumberInRange(1,5) + getString(R.string.minutes_suffix);\n }\n return challenge;\n }", "public String getAnAnswer() {\n\n\t\tString answer = \" \";\n\n\t\t// Randomly select one of the answers\n\t\t// Construct a random number using the Random class and the\n\t\t// nextInt method\n\t\tRandom randomGenerator = new Random();\n\t\tint randomNumber = randomGenerator.nextInt(mAnswers.length);\n\n\t\t// Assign a randomly generated number to an answer\n\t\tanswer = mAnswers[randomNumber];\n\n\t\t// Return the result\n\t\treturn answer;\n\t}", "@Ignore\n @Test\n public void shouldNotGiveQuestionIfAllQuestionsHaveBeenAnsweredWithInts() {\n attributes.put(FinancialPlanningSpeechlet.GOAL_AMOUNT_KEY, 1000);\n attributes.put(FinancialPlanningSpeechlet.MONTHLY_CONTRIBUTION_KEY, 1000);\n attributes.put(FinancialPlanningSpeechlet.GOAL_PERIOD_KEY, 1000);\n String question = NextQuestionFactory.get(session);\n\n assertThat(question, Is.is(\"\"));\n }", "private static int getRandomNumberOfRooms(){\r\n return r.nextInt(50)+1;\r\n }", "private void gameHelper(int ranNum){\n\t\tif(questionAnsweredCount>=25){\n\t\t\treturn;\n\t\t}\n\t\tSystem.out.println(\"It is \" + teams[ranNum].getName() + \"'s turn to choose a question\");\n\t\t//find category\n\t\tSystem.out.println(\"Please choose a category you would like to answer: \");\n\t\tint categoryIdx = getCategory();\n\t\t//find points\n\t\tSystem.out.println(\"Please enter the dollar value of the question you wish to answer\");\n\t\tint pointIdx = getPointsIndex();\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\t\t//now check if the question is answer knowing dollar and cat is valid\n\t\tboolean answered = board[categoryIdx][pointIdx].answeredYet();\n\t\tif(!answered){\n\t\t\tint point = points[pointIdx];\n\t\t\tSystem.out.println(board[categoryIdx][pointIdx].getQeustion());\n\t\t\tSystem.out.println(\"Enter your answer. Remember to pose it as a question.\");\n\t\t\tString ans = sc.nextLine();\n\t\t\treadExitCommand(ans); // check if the user wants to exit any point\n\t\t\treadReplayCommand(ans);\n\t\t\tboard[categoryIdx][pointIdx].answerQuestion(ans); //ask Q\n\t\t\tif(!board[categoryIdx][pointIdx].getRight()&&board[categoryIdx][pointIdx].getWarned()){\n\t\t\t\t//not in question format. give one more chance\n\t\t\t\tans = sc.nextLine();\n\t\t\t\treadExitCommand(ans);\n\t\t\t\treadReplayCommand(ans);\n\t\t\t\tboard[categoryIdx][pointIdx].answerQuestion(ans);\n\t\t\t}\n\t\t\tif(board[categoryIdx][pointIdx].getRight()){\n\t\t\t\tSystem.out.println(\"You answered it right! \" + point + \" will be added to your total\");\n\t\t\t\tquestionAnsweredCount+= 10;\n\t\t\t\tteams[ranNum].addDollars(point);\n\t\t\t\tprintDollars();\n\t\t\t}\n\t\t\telse{\n\t\t\t\tSystem.out.println(\"Wrong Answer!\");\n\t\t\t\tquestionAnsweredCount++; \n\t\t\t\tteams[ranNum].minusDollars(point);\n\t\t\t\tprintDollars();\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(\"Question already answered. Choose it again\");\n\t\t\tgameHelper(ranNum); //same team choose a question again\n\t\t}\n\t\tint nextIdx = (ranNum+1)%(teams.length);\n\t\tgameHelper(nextIdx);\n\t}", "public void generateComputerChoice() {\n\t\tgetRandomNumber();\n\t\tsetComputerChoice();\n\t}", "private Integer getRandomMapKey() {\r\n\t\tList<Integer> mapKeys = new ArrayList<Integer>(this.compleQuestions.keySet());\r\n\t\tint randomIndex = (int) (Math.random() * mapKeys.size());\r\n\t\treturn mapKeys.get(randomIndex);\r\n\t}", "boolean questionsAlreadyDisplayed (int randomValue0to29){\n\t\t for (int i = 0 ; i < 10 ; i++){\n\t\t\t if (anArray2 [i] == randomValue0to29){\n\t\t\t\t return true;\t//question already displayed\n\t\t\t }\n\t\t\t\n\t\t }\n\t\t anArray2 [numberOfQuestionsDisplayedCounter] = randomValue0to29; // questionId added to array of displayed questions\n\t\t return false;\t//random number can be used as it has been used already\n\t }", "public abstract void newSpeechQuestions(long ms, int n);", "public InputAction makeChoice() {\n int choice = (int) Math.floor(Math.random() * 12);\n if(choice < 6) {\n return new InputAction(player, InputAction.ActionType.WORK, null);\n } else {\n DirectionType direction = directionByNumber.get(choice);\n return new InputAction(player, InputAction.ActionType.EXPLORE, direction);\n }\n }", "public static String randomSelection() {\n int min = 1;\n int max = 3;\n String randomSelection;\n Random random = new Random(System.currentTimeMillis());\n int randomNumber = random.nextInt((max - min) +1) +min;\n if(randomNumber == 1) {\n randomSelection = \"rock\";\n } else if (randomNumber == 2) {\n randomSelection = \"paper\";\n } else {\n randomSelection = \"scissors\";\n }\n return randomSelection;\n }", "public void generateR(){\n\t\t\tdo{\n\t\t\t\tr = new BigInteger(80, new Random());\n\t\t\t}while(!(q.gcd(r).equals(BigInteger.ONE)&&r.compareTo(q)<0&&r.compareTo(BigInteger.ONE)>=0));\n\t}", "public void generateRandomEvents();", "public void set_random_choice()\r\n\t{\r\n\t\tfor (int i=0 ; i<size ; i++)\r\n\t\t{\r\n\t\t\tnumbers.add(get_not_selected_random_digit());\r\n\t\t}\r\n\t}", "public int randomizeFirstNumber() {\n a = random.nextInt(100);\n question.setA(a);\n return a;\n }", "public static int sapQuestions (int sapPathway)\r\n {\r\n int questionNumber = (int)(Math.random()*20)+1;\r\n\r\n switch (questionNumber)\r\n {\r\n case 1: System.out.println(\"Which of the following is not a social institution?\\r\\n\" + \r\n \"1.) family\\r\\n\" + \r\n \"2.) education\\r\\n\" + \r\n \"3.) hidden Media\\r\\n\" + \r\n \"4.) social Media\\r\\n\");\r\n break;\r\n case 2: System.out.println(\"Stereotypes are maintained by _______\\r\\n\" + \r\n \"1.) ignoring contradictory evidence\\r\\n\" + \r\n \"2.) individualization \\r\\n\" + \r\n \"3.) overcomplicating generalization that is applied to all members of a group\\r\\n\" + \r\n \"4.) the ideology of “rescue”\\r\\n\");\r\n break;\r\n case 3: System.out.println(\"Racism is about _____\\r\\n\" + \r\n \"1.) effect not Intent\\r\\n\" + \r\n \"2.) intent not effect\\r\\n\" + \r\n \"3.) response not question\\r\\n\" + \r\n \"4.) question not response\\r\\n\");\r\n break;\r\n case 4: System.out.println(\"What is the definition of theory?\\r\\n\" + \r\n \"1.) what’s important to you\\r\\n\" + \r\n \"2.) best possible explanation based on available evidence\\r\\n\" + \r\n \"3.) your experiences, what you think is real\\r\\n\" + \r\n \"4.) determines how you interpret situations\\r\\n\");\r\n break;\r\n case 5: System.out.println(\"Which of the following is not an obstacle to clear thinking?\\r\\n\" + \r\n \"1.) drugs\\r\\n\" + \r\n \"2.) close-minded\\r\\n\" + \r\n \"3.) honesty\\r\\n\" + \r\n \"4.) emotions\\r\\n\");\r\n break;\r\n case 6: System.out.println(\"What does the IQ test asses?\\r\\n\" + \r\n \"1.) literacy skills\\r\\n\" + \r\n \"2.) survival skills\\r\\n\" + \r\n \"3.) logical reasoning skills\\r\\n\" + \r\n \"4.) 1 and 3\\r\\n\");\r\n break;\r\n case 7: System.out.println(\"How many types of intelligence are there?\\r\\n\" + \r\n \"1.) 27\\r\\n\" + \r\n \"2.) 5\\r\\n\" + \r\n \"3.) 3\\r\\n\" + \r\n \"4.) 8\\r\\n\");\r\n break;\r\n case 8: System.out.println(\"Emotions have 3 components\\r\\n\" + \r\n \"1.) psychological, cognitive, behavioral\\r\\n\" + \r\n \"2.) psychological, physical, social\\r\\n\" + \r\n \"3.) intensity, range, exposure\\r\\n\" + \r\n \"4.) range, duration, intensity\\r\\n\");\r\n break;\r\n case 9: System.out.println(\"Which of the following is not a component of happiness?\\r\\n\" + \r\n \"1.) diet and nutrition\\r\\n\" + \r\n \"2.) time in nature\\r\\n\" + \r\n \"3.) interventions\\r\\n\" + \r\n \"4.) relationships\\r\\n\");\r\n break;\r\n case 10: System.out.println(\"The brain compensates for damaged neurons by ______.\\r\\n\" + \r\n \"1.) extending neural connections over the dead neurons\\r\\n\" + \r\n \"2.) it doesn’t need too\\r\\n\" + \r\n \"3.) grows new neurons\\r\\n\" + \r\n \"4.) send neurons in from different places\\r\\n\");\r\n break;\r\n case 11: System.out.println(\"Which of the following is true?\\r\\n\" + \r\n \"1.) you continue to grow neurons until age 50\\r\\n\" + \r\n \"2.) 90% of the brain is achieved by age 6\\r\\n\" + \r\n \"3.) only 20% of the brain is actually being used \\r\\n\" + \r\n \"4.) the size of your brain determines your intelligence\\r\\n\");\r\n break;\r\n case 12: System.out.println(\"The feel-good chemical is properly known as?\\r\\n\" + \r\n \"1.) acetycholine\\r\\n\" + \r\n \"2.) endocrine\\r\\n\" + \r\n \"3.) dopamine\\r\\n\" + \r\n \"4.) doperdoodle\\r\\n\");\r\n break;\r\n case 13: System.out.println(\"Who created the theory about ID, superego and ego?\\r\\n\" + \r\n \"1.) Albert\\r\\n\" + \r\n \"2.) Freud\\r\\n\" + \r\n \"3.) Erikson\\r\\n\" + \r\n \"4.) Olaf\\r\\n\");\r\n break;\r\n case 14: System.out.println(\"Classic Conditioning is _______?\\r\\n\" + \r\n \"1.) when an organism learns to associate two things that are normally unrelated\\r\\n\" + \r\n \"2.) when an organism learns to disassociate two things that are normally related \\r\\n\" + \r\n \"3.) when you teach an organism the survival style of another organism\\r\\n\" + \r\n \"4.) when you train an organism without the use of modern technology\\r\\n\");\r\n break;\r\n case 15: System.out.println(\"The cerebellum is responsible for what?\\r\\n\" + \r\n \"1.) visual info processing\\r\\n\" + \r\n \"2.) secrets hormones\\r\\n\" + \r\n \"3.) balance and coordination\\r\\n\" + \r\n \"4.) controls heartbeat\\r\\n\");\r\n break;\r\n case 16: System.out.println(\"Transphobia is the fear of?\\r\\n\" + \r\n \"1.) transgender individuals\\r\\n\" + \r\n \"2.) homosexual individuals\\r\\n\" + \r\n \"3.) women\\r\\n\" + \r\n \"4.) transfats\\r\\n\");\r\n break;\r\n case 17: System.out.println(\"What factors contribute to a positive IQ score in children?\\r\\n\" + \r\n \"1.) early access to words\\r\\n\" + \r\n \"2.) affectionate parents\\r\\n\" + \r\n \"3.) spending time on activities\\r\\n\" + \r\n \"4.) all of the above\\r\\n\");\r\n break;\r\n case 18: System.out.println(\"Emotions can be ______.\\r\\n\" + \r\n \"1.) a reaction\\r\\n\" + \r\n \"2.) a goal\\r\\n\" + \r\n \"3.) all of the above\\r\\n\" + \r\n \"4.) none of the above\\r\\n\");\r\n break;\r\n case 19: System.out.println(\"What is not a stage in increasing prejudice?\\r\\n\" + \r\n \"1.) verbal rejection\\r\\n\" + \r\n \"2.) extermination\\r\\n\" + \r\n \"3.) avoidance\\r\\n\" + \r\n \"4.) self agreement\\r\\n\");\r\n break;\r\n case 20: System.out.println(\"What part of the brain is still developing in adolescents?\\r\\n\" + \r\n \"1.) brain stem\\r\\n\" + \r\n \"2.) pons\\r\\n\" + \r\n \"3.) prefrontal cortex\\r\\n\" + \r\n \"4.) occipital\\r\\n\");\r\n break;\r\n }\r\n\r\n return questionNumber;\r\n }", "public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n System.out.println(\"Bienvenido a Magic Ball 8!!\");\n System.out.print(\"Escribe tu pregunta y te la contestaré: \");\n String question = scan.nextLine();\n // Get a random number from 1 to 8\n double a = Math.random()*8;\n // Use if statements to print out 1 of 8 responses\n if (a>=0 & a<1){\n System.out.println(\"No lo sé, lo siento...... :(\");\n }\n if (a>=1 & a<2){\n System.out.println(\"Eso tan solo depende de tí\");\n }\n if (a>=2 & a<3){\n System.out.println(\"La respuesta está en tu habitación....\");\n }\n if (a>=3 & a<4){\n System.out.println(\"Si haces las cosas bien, encontrarás lo que buscas..\");\n }\n if (a>=4 & a<5){\n System.out.println(\"Depende de lo que quieras encontrar..\");\n }\n if (a>=5 & a<6){\n System.out.println(\"No sé para qué me preguntas eso, pero la respuesta la tienes tú\");\n }\n if (a>=6 & a<7){\n System.out.println(\"Sin comentarios.....\");\n }\n if (a>=7 & a<8){\n System.out.println(\"¡Vaya preguntas me haces!\");\n } \n }", "private Random rand()\n\t{\n\t\treturn new Random();\n\t}" ]
[ "0.7788143", "0.77652144", "0.77076125", "0.74455595", "0.74142116", "0.73238635", "0.7319068", "0.70898247", "0.68963987", "0.68364745", "0.6821474", "0.668809", "0.6649148", "0.6608279", "0.6607432", "0.65865225", "0.6584359", "0.6559922", "0.65241945", "0.65224177", "0.6513515", "0.6498878", "0.6477152", "0.64518344", "0.6443609", "0.64275944", "0.6397079", "0.6394362", "0.63807666", "0.63637716", "0.63540804", "0.63364905", "0.6303214", "0.6285327", "0.6278478", "0.6270606", "0.6260784", "0.6255055", "0.6246447", "0.6242881", "0.6234781", "0.62294066", "0.6225555", "0.62214583", "0.6203788", "0.61831367", "0.61825985", "0.61722213", "0.6148691", "0.6141439", "0.6140425", "0.61394614", "0.6123397", "0.6120683", "0.611254", "0.6098326", "0.6095187", "0.60886127", "0.60751855", "0.60693973", "0.6068866", "0.6064337", "0.60451734", "0.604491", "0.60433924", "0.604225", "0.6031901", "0.6016125", "0.6008189", "0.6005499", "0.5996569", "0.5991454", "0.5980971", "0.5976912", "0.59729", "0.59618866", "0.5951291", "0.5943037", "0.5910764", "0.58843666", "0.5883239", "0.5872151", "0.5849035", "0.58467084", "0.58338505", "0.5833436", "0.58117855", "0.5810738", "0.58077747", "0.58056533", "0.5780066", "0.5774946", "0.5751648", "0.5751146", "0.5748781", "0.5747431", "0.57207197", "0.5711976", "0.5711871", "0.57090837" ]
0.6216714
44
Method that calculates a random question for the ks2 question areas
public static String[] randomQuestionKS2(String op){ int part1 = randomNumber(); int part2 = randomNumber(); ArrayList<Integer> multiQs = new ArrayList<>(Arrays.asList(2,5,10)); ArrayList<Integer> divQs = new ArrayList<>(Arrays.asList(5,10)); if (op.equals("*")){ int pos = multiQs.get(randomMulti()); part1 = pos; } else if (op.equals("/")){ ArrayList <Integer> divide10 = new ArrayList<>(Arrays.asList(10,20,30,40,50,60,70,80,90,100)); int pos = (randomNumber()) - 1; int pos2 = (randomDivide()); part1 = divide10.get(pos); part2 = divQs.get(pos2); } String str1 = Integer.toString(part1); String str2 = Integer.toString(part2); String question = str1 + " " + op + " " + str2; int ans = 0; if (op.equals("+")){ part1 = randomNumber50(); part2 = randomNumber50(); ans = part1 + part2; str1 = Integer.toString(part1); str2 = Integer.toString(part2); question = str1 + " " + op + " " + str2; } else if (op.equals("-")){ part1 = randomNumber100(); part2 = randomNumber50(); if (part1 < part2){ ans = part2 - part1; str1 = Integer.toString(part1); str2 = Integer.toString(part2); question = str2 + " " + op + " " + str1; } ans = part1 - part2; str1 = Integer.toString(part1); str2 = Integer.toString(part2); question = str1 + " " + op + " " + str2; } else if (op.equals("*")){ ans = part1 * part2; } else if (op.equals("/")){ ans = part1 / part2; } String ansStr = Integer.toString(ans); String x[] = new String[2]; x[0] = question; x[1] = ansStr; return x; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void questionGenerator()\n\t{\n\t\t//creates questions\n\t\toperation = rand.nextInt(3) + min;\n\t\t\n\t\t//makes max # 10 to make it easier for user if random generator picks multiplication problem\n\t\tif (operation == 3)\n\t\t\tmax = 10; \n\t\t\n\t\t//sets random for number1 & number2\n\t\tnumber1 = rand.nextInt(max) + min; //random number max and min\n\t\tnumber2 = rand.nextInt(max) + min; \n\t\t\t\t\n\t\t//ensures final answer of problem is not negative by switching #'s if random generator picks subtraction problem\n\t\tif (operation == 2 && number1 < number2)\n\t\t{\n\t\t\tint tempNum = number1;\n\t\t\tnumber1 = number2;\n\t\t\tnumber2 = tempNum;\n\t\t}\n\t\tanswer = 0;\n\t\t\n\t\t//randomizes operator to randomize question types\n\t\tif (operation == 1)\n\t\t{\n\t\t\toperator = '+';\n\t\t\tanswer = number1 + number2;\n\t\t}\n\t\tif (operation == 2)\n\t\t{\n\t\t\toperator = '-';\n\t\t\tanswer = number1 - number2;\n\t\t}\n\t\tif (operation == 3)\n\t\t{\n\t\t\toperator = '*';\n\t\t\tanswer = number1 * number2;\n\t\t}\n\t\t\t\n\t\t//prints question\n\t\tlabel2.setText(\"Question: \" + number1 + \" \" + operator + \" \" + number2 + \" = ?\");\n\t}", "public static String[] randomQuestions(String op){\r\n String question = \"\";\r\n String ansStr = \"\";\r\n \r\n int part1 = randomNumber();\r\n int part2 = randomNumber();\r\n int ans = 0;\r\n double roundAns = 0.0;\r\n \r\n if (op.equals(\"^\")){\r\n //Round to Closest Whole Number\r\n roundAns = (randomDecimal());\r\n double k = Math.round(roundAns);\r\n \r\n question = Double.toString(roundAns);\r\n ansStr = Double.toString(k);\r\n }\r\n else if (op.equals(\"Alg\")){\r\n //Algebraic Formula - Find x/y\r\n int coeff = randomNumberAlg();\r\n int layout = randomNumber();\r\n part1 = randomNumberAlg();\r\n part2 = randomNumberAlg();\r\n \r\n if (layout < 3){\r\n //?x = int\r\n ans = part1 * coeff;\r\n \r\n question = coeff+\"x = \"+ ans;\r\n ansStr = Integer.toString(part1);\r\n \r\n } else if (layout > 3 && layout <= 7){\r\n //?x+num = int || ?x-num = int\r\n if (layout == 4||layout == 5){\r\n ans = (part1 * coeff) + part2;\r\n \r\n question = coeff+\"x + \"+part2+\" = \"+ans;\r\n ansStr = Integer.toString(part1);\r\n } else if (layout == 6||layout == 7){\r\n ans = (part1 * coeff) - part2;\r\n \r\n question = coeff+\"x - \"+part2+\" = \"+ans;\r\n ansStr = Integer.toString(part1);\r\n } \r\n } else if (layout > 7 && layout <= 10){\r\n //?x/num = int \r\n ans = (part1 * coeff)/part2;\r\n \r\n question = coeff+\"x/\"+part2+\" = \"+ ans;\r\n ansStr = Integer.toString(part1);\r\n } \r\n }\r\n else if (op.equals(\"%\")){\r\n //Precentages - Covert Fraction to Percentage\r\n int div = HCF(part1, part2);\r\n int finalp1 = part1 % div;\r\n int finalp2 = part2 % div;\r\n \r\n if (finalp1 == 0){\r\n finalp1 = randomNumberRatio();\r\n }\r\n if (finalp2 == 0){\r\n finalp2 = randomNumberRatio();\r\n }\r\n \r\n double fract = finalp1/finalp2;\r\n \r\n if (finalp1>finalp2){\r\n fract = finalp1/finalp2;\r\n question = finalp1+\"/\"+finalp2;\r\n }\r\n else {\r\n fract = finalp2/finalp1;\r\n question = finalp2+\"/\"+finalp1;\r\n }\r\n \r\n double perc = fract * 100;\r\n \r\n ansStr = Double.toString(perc);\r\n \r\n }\r\n else if (op.equals(\":\")){\r\n //Ratio - Simplifying\r\n part1 = randomNumberRatio();\r\n part2 = randomNumberRatio();\r\n int div = HCF(part1, part2);\r\n int finalp1 = part1 / div;\r\n int finalp2 = part2 / div;\r\n \r\n question = part1+\":\"+part2;\r\n ansStr = finalp1+\":\"+finalp2;\r\n }\r\n\r\n else if (op.equals(\"//\")){\r\n //Fractions - Simplifying\r\n int div = HCF(part1, part2);\r\n int finalp1 = part1 % div;\r\n int finalp2 = part2 % div;\r\n \r\n question = part1+\"/\"+part2;\r\n ansStr = finalp1+\"/\"+finalp2;\r\n \r\n }\r\n \r\n String x[] = new String[2];\r\n x[0] = question;\r\n x[1] = ansStr;\r\n \r\n return x;\r\n }", "public void setQuestion(){\n Random rand = new Random();\n a = rand.nextInt(maxRange)+1;\n b = rand.nextInt(maxRange)+1;\n int res = rand.nextInt(4);\n equation.setText(a +\"+\"+ b);\n for(int i=0; i<4; i++){\n if(i == res)\n arr[i] = a+b;\n else {\n int answer = rand.nextInt(2*maxRange)+1;\n while(answer == a+b)\n answer = rand.nextInt(2*maxRange)+1;\n arr[i] = answer;\n }\n }\n for(int i=0; i<4; i++)\n buttons[i].setText(String.valueOf(arr[i]));\n }", "private void settingQuestion() {\n\n int[] setWord = {0, 0, 0, 0, 0};\n int[] setPos = {0, 0, 0, 0};\n int[] setBtn = {0, 0, 0, 0};\n\n Random ans = new Random();\n int wordNum = ans.nextInt(vocabularyLesson.size());\n //answer = vocabularyLesson.get(wordNum).getMean();\n word = vocabularyLesson.get(wordNum).getWord();\n vocabularyID = vocabularyLesson.get(wordNum).getId();\n answer = word;\n\n Practice practice = pc.getPracticeById(vocabularyID);\n if (practice != null) {\n Log.d(\"idVocabulary\", practice.getSentence());\n question.setText(practice.getSentence());\n }\n\n\n // Random position contain answer\n setWord[wordNum] = 1;\n Random p = new Random();\n int pos = p.nextInt(4);\n if (pos == 0) {\n word1.setText(word);\n setBtn[0] = 1;\n }\n if (pos == 1) {\n word2.setText(word);\n setBtn[1] = 1;\n }\n if (pos == 2) {\n word3.setText(word);\n setBtn[2] = 1;\n }\n if (pos == 3) {\n word4.setText(word);\n setBtn[3] = 1;\n }\n setPos[pos] = 1;\n\n // Random 3 position contain 3 answer\n for (int i = 0; i < 3; i++) {\n Random ques = new Random();\n int num = ques.nextInt(5);\n int p1 = ques.nextInt(4);\n while (setWord[num] == 1 || setPos[p1] == 1) {\n num = ques.nextInt(5);\n p1 = ques.nextInt(4);\n }\n String wordIncorrect = vocabularyLesson.get(num).getWord();\n setWord[num] = 1;\n setPos[p1] = 1;\n if (setBtn[p1] == 0 && p1 == 0) {\n word1.setText(wordIncorrect);\n setBtn[0] = 1;\n }\n if (setBtn[p1] == 0 && p1 == 1) {\n word2.setText(wordIncorrect);\n setBtn[1] = 1;\n }\n if (setBtn[p1] == 0 && p1 == 2) {\n word3.setText(wordIncorrect);\n setBtn[2] = 1;\n }\n if (setBtn[p1] == 0 && p1 == 3) {\n word4.setText(wordIncorrect);\n setBtn[3] = 1;\n }\n }\n\n }", "@GET\n @Path(\"/randomquestion\")\n public String getRandomQuestion() {\n return \"test\";\n //return map.keySet().toArray()[ThreadLocalRandom.current().nextInt(1, map.size())].toString();\n }", "public String generateQuestion(){\r\n qType = rand.nextInt(2);\r\n if (qType ==0)\r\n return \"Multiple choice question.\";\r\n else\r\n return \"Single choice question.\";\r\n }", "public abstract void generateQuestion();", "void setQuestion(){\n int numberRange = currentLevel * 3;\n Random randInt = new Random();\n\n int partA = randInt.nextInt(numberRange);\n partA++;//not zero\n\n int partB = randInt.nextInt(numberRange);\n partB++;//not zero\n\n correctAnswer = partA * partB;\n int wrongAnswer1 = correctAnswer-2;\n int wrongAnswer2 = correctAnswer+2;\n\n textObjectPartA.setText(\"\"+partA);\n textObjectPartB.setText(\"\"+partB);\n\n //set the multi choice buttons\n //A number between 0 and 2\n int buttonLayout = randInt.nextInt(3);\n switch (buttonLayout){\n case 0:\n buttonObjectChoice1.setText(\"\"+correctAnswer);\n buttonObjectChoice2.setText(\"\"+wrongAnswer1);\n buttonObjectChoice3.setText(\"\"+wrongAnswer2);\n break;\n\n case 1:\n buttonObjectChoice2.setText(\"\"+correctAnswer);\n buttonObjectChoice3.setText(\"\"+wrongAnswer1);\n buttonObjectChoice1.setText(\"\"+wrongAnswer2);\n break;\n\n case 2:\n buttonObjectChoice3.setText(\"\"+correctAnswer);\n buttonObjectChoice1.setText(\"\"+wrongAnswer1);\n buttonObjectChoice2.setText(\"\"+wrongAnswer2);\n break;\n }\n }", "public void randomize(){\r\n\t\tfor(int i = 0;i<this.myQuestions.size();i++){\r\n\t\t\tthis.myQuestions.get(i).randomize();\r\n\t\t}\r\n\t\tCollections.shuffle(this.myQuestions);\r\n\t}", "public void quiz() {\n\t\t\t\t\tcorrectans = 0;\n\t\t\t\t\tint k = 0;\n\t\t\t\t\tint j = 0;\n\t\t\t\t\tint M = 0;\n\t\t\t\t\tj = readDifficulty();\n\t\t\t\t\tM = readProblemType();\n\t\t\t\t\t//ask the student to solve 10 different problems, as determined by the problem type\n\t\t\t for(int i = 0; i < 10; i++ ) {\n\t\t\t \t//contain two numbers sampled from a uniform random distribution with bounds determined by the problem difficulty\n\t\t\t \tint x = rand.nextInt(j); \n\t\t\t\t int y = rand.nextInt(j);\n\t\t\t\t int O = askquestion(j, M,x,y);\n\t\t\t\t if(M == 4) {\n\t\t\t\t \t float floatans = readdivision();\n\t\t\t\t \tk = divisionsol(floatans, x, y);\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t int userin = readResponse();\n\t\t\t k = isnanswercorrect(O , userin);\n\t\t\t }\n\t\t\t if(k == 1) {\n\t\t\t \t correctans++;\n\t\t\t }\n\t\t\t }\n\t\t\t int L = 0;\n\t\t\t L = displayCompletionMessage(correctans);\n\t\t\t if ( L == 1) {\n\t\t\t \tquiz();\n\t\t\t }\n\t\t\t else {\n\t\t\t \treturn;\n\t\t\t }\n\t\t\t \n\t\t\t\t}", "private void generateNewQuestion() {\n GameManager gameManager = new GameManager();\n long previousQuestionId = -1;\n try {\n previousQuestionId = mGameModel.getQuestion().getId();\n } catch (NullPointerException e) {\n previousQuestionId = -1;\n }\n mGameModel.setQuestion(gameManager.generateRandomQuestion(previousQuestionId));\n mGameModel.getGameMaster().setDidPlayerAnswer(false);\n mGameModel.getGameMaster().setPlayerAnswerCorrect(false);\n mGameModel.getGameSlave().setDidPlayerAnswer(false);\n mGameModel.getGameSlave().setPlayerAnswerCorrect(false);\n LOGD(TAG, \"New question generated\");\n }", "public Answer randomAnswer()\n\t{\n\t\tRandom random = new Random();\n\t\tint num = random.nextInt(answers.length);\n\t\treturn answers[num];\n\t}", "private ArrayList<String> getRandQuestion() \n\t{\t\n\t\tquestionUsed = true;\n\t\t\n\t\tRandom randomizer = new Random();\n\t\tint randIdx = 0;\n\t\t\n\t\tif(questionsUsed.isEmpty())\n\t\t\trandIdx = randomizer.nextInt(allQuestions.size());\n\t\telse\n\t\t{\n\t\t\twhile(questionUsed)\n\t\t\t{\n\t\t\t\trandIdx = randomizer.nextInt(allQuestions.size());\n\t\t\t\tcheckIfQuestionUsed(randIdx);\n\t\t\t}\n\t\t}\n\t\t\n\t\tquestionsUsed.add(randIdx);\n\t\t\n\t\treturn allQuestions.get(randIdx);\n\t}", "public void fillQuestionsTable() {\n\n //Hard Questions\n Questions q1 = new Questions(\"The redshift of a distant galaxy is 0·014. According to Hubble’s law, the distance of the galaxy from Earth is? \", \" 9·66 × 10e-12 m\", \" 9·32 × 10e27 m\", \"1·83 × 10e24 m\", \"1·30 × 10e26 m \", 3);\n addQuestion(q1);\n Questions q2 = new Questions(\"A ray of monochromatic light passes from air into water. The wavelength of this light in air is 589 nm. The speed of this light in water is? \", \" 2·56 × 10e2 m/s \", \"4·52 × 10e2 m/s\", \"4·78 × 10e2 m/s\", \"1·52 × 10e2 m/s\", 2);\n addQuestion(q2);\n Questions q3 = new Questions(\"A car is moving at a speed of 2·0 m s−1. The car now accelerates at 4·0 m s−2 until it reaches a speed of 14 m s−1. The distance travelled by the car during this acceleration is\", \"1.5m\", \"18m\", \"24m\", \"25m\", 3);\n addQuestion(q3);\n Questions q4 = new Questions(\"A spacecraft is travelling at 0·10c relative to a star. \\nAn observer on the spacecraft measures the speed of light emitted by the star to be?\", \"0.90c\", \"1.00c\", \"1.01c\", \"0.99c\", 2);\n addQuestion(q4);\n Questions q5 = new Questions(\"Measurements of the expansion rate of the Universe lead to the conclusion that the rate of expansion is increasing. Present theory proposes that this is due to? \", \"Redshift\", \"Dark Matter\", \"Dark Energy\", \"Gravity\", 3);\n addQuestion(q5);\n Questions q6 = new Questions(\"A block of wood slides with a constant velocity down a slope. The slope makes an angle of 30º with the horizontal axis. The mass of the block is 2·0 kg. The magnitude of the force of friction acting on the block is?\" , \"1.0N\", \"2.0N\", \"9.0N\", \"9.8N\", 4);\n addQuestion(q6);\n Questions q7 = new Questions(\"A planet orbits a star at a distance of 3·0 × 10e9 m. The star exerts a gravitational force of 1·6 × 10e27 N on the planet. The mass of the star is 6·0 × 10e30 kg. The mass of the planet is? \", \"2.4 x 10e14 kg\", \"3.6 x 10e25 kg\", \"1.2 x 10e16 kg\", \"1.6 x 10e26 kg\", 2);\n addQuestion(q7);\n Questions q8 = new Questions(\"Radiation of frequency 9·00 × 10e15 Hz is incident on a clean metal surface. The maximum kinetic energy of a photoelectron ejected from this surface is 5·70 × 10e−18 J. The work function of the metal is?\", \"2.67 x 10e-19 J\", \"9.10 x 10e-1 J\", \"1.60 x 10e-18 J\", \"4.80 x 10e-2 J\", 1);\n addQuestion(q8);\n Questions q9 = new Questions(\"The irradiance of light from a point source is 32 W m−2 at a distance of 4·0 m from the source. The irradiance of the light at a distance of 16 m from the source is? \", \"1.0 W m-2\", \"8.0 W m-2\", \"4.0 W m-2\", \"2.0 W m-2\", 4);\n addQuestion(q9);\n Questions q10 = new Questions(\"A person stands on a weighing machine in a lift. When the lift is at rest, the reading on the weighing machine is 700 N. The lift now descends and its speed increases at a constant rate. The reading on the weighing machine...\", \"Is a constant value higher than 700N. \", \"Is a constant value lower than 700N. \", \"Continually increases from 700 N. \", \"Continually decreases from 700 N. \", 2);\n addQuestion(q10);\n\n //Medium Questions\n Questions q11 = new Questions(\"What is Newtons Second Law of Motion?\", \"F = ma\", \"m = Fa\", \"F = a/m\", \"Every action has an equal and opposite reaction\", 1);\n addQuestion(q11);\n Questions q12 = new Questions(\"In s = vt, what does s stand for?\", \"Distance\", \"Speed\", \"Sin\", \"Displacement\", 4);\n addQuestion(q12);\n Questions q13 = new Questions(\"An object reaches terminal velocity when...\", \"Forward force is greater than the frictional force.\", \"All forces acting on that object are equal.\", \"Acceleration starts decreasing.\", \"Acceleration is greater than 0\", 2);\n addQuestion(q13);\n Questions q14 = new Questions(\"An Elastic Collision is where?\", \"There is no loss of Kinetic Energy.\", \"There is a small loss in Kinetic Energy.\", \"There is an increase in Kinetic Energy.\", \"Some Kinetic Energy is transferred to another type.\", 1);\n addQuestion(q14);\n Questions q15 = new Questions(\"The speed of light is?\", \"Different for all observers.\", \"The same for all observers. \", \"The same speed regardless of the medium it is travelling through. \", \"Equal to the speed of sound.\", 2);\n addQuestion(q15);\n Questions q16 = new Questions(\"What is redshift?\", \"Light moving to us, shifting to red. \", \"A dodgy gear change. \", \"Light moving away from us shifting to longer wavelengths.\", \"Another word for dark energy. \", 3);\n addQuestion(q16);\n Questions q17 = new Questions(\"Which law allows us to estimate the age of the universe?\", \"Newtons 3rd Law \", \"The Hubble-Lemaitre Law \", \"Planck's Law \", \"Wien's Law \", 2);\n addQuestion(q17);\n Questions q18 = new Questions(\"The standard model...\", \"Models how time interacts with space. \", \"Describes how entropy works. \", \"Is the 2nd Law of Thermodynamics. \", \"Describes the fundamental particles of the universe and how they interact\", 4);\n addQuestion(q18);\n Questions q19 = new Questions(\"The photoelectric effect gives evidence for?\", \"The wave model of light. \", \"The particle model of light. \", \"The speed of light. \", \"The frequency of light. \", 2);\n addQuestion(q19);\n Questions q20 = new Questions(\"AC is a current which...\", \"Doesn't change direction. \", \"Is often called variable current. \", \"Is sneaky. \", \"Changes direction and instantaneous value with time. \", 4);\n addQuestion(q20);\n\n //Easy Questions\n Questions q21 = new Questions(\"What properties does light display?\", \"Wave\", \"Particle\", \"Both\", \"Neither\", 3);\n addQuestion(q21);\n Questions q22 = new Questions(\"In V = IR, what does V stand for?\", \"Velocity\", \"Voltage\", \"Viscosity\", \"Volume\", 2);\n addQuestion(q22);\n Questions q23 = new Questions(\"The abbreviation rms typically stands for?\", \"Round mean sandwich. \", \"Random manic speed. \", \"Root manic speed. \", \"Root mean squared. \", 4);\n addQuestion(q23);\n Questions q24 = new Questions(\"Path Difference = \", \"= (m/λ) or (m + ½)/λ where m = 0,1,2…\", \"= mλ or (m + ½) λ where m = 0,1,2…\", \"= λ / m or (λ + ½) / m where m = 0,1,2…\", \" = mλ or (m + ½) λ where m = 0.5,1.5,2.5,…\", 2);\n addQuestion(q24);\n Questions q25 = new Questions(\"How many types of quark are there?\", \"6\", \"4 \", \"8\", \"2\", 1);\n addQuestion(q25);\n Questions q26 = new Questions(\"A neutrino is a type of?\", \"Baryon\", \"Gluon\", \"Lepton\", \"Quark\", 3);\n addQuestion(q26);\n Questions q27 = new Questions(\"A moving charge produces:\", \"A weak field\", \"An electric field\", \"A strong field\", \"Another moving charge\", 2);\n addQuestion(q27);\n Questions q28 = new Questions(\"What contains nuclear fusion reactors?\", \"A magnetic field\", \"An electric field\", \"A pool of water\", \"Large amounts of padding\", 1);\n addQuestion(q28);\n Questions q29 = new Questions(\"What is the critical angle of a surface?\", \"The incident angle where the angle of refraction is 45 degrees.\", \"The incident angle where the angle of refraction is 90 degrees.\", \"The incident angle where the angle of refraction is 135 degrees.\", \"The incident angle where the angle of refraction is 180 degrees.\", 2);\n addQuestion(q29);\n Questions q30 = new Questions(\"Which is not a type of Lepton?\", \"Electron\", \"Tau\", \"Gluon\", \"Muon\", 3);\n addQuestion(q30);\n }", "public void generateNumbers() {\n number1 = (int) (Math.random() * 10) + 1;\n number2 = (int) (Math.random() * 10) + 1;\n operator = (int) (Math.random() * 4) + 1;\n //50% chance whether the displayed answer will be right or wrong\n rightOrWrong = (int) (Math.random() * 2) + 1;\n //calculate the offset of displayed answer for a wrong equation (Error)\n error = (int) (Math.random() * 4) + 1;\n generateEquation();\n }", "private Integer getRandomMapKey() {\r\n\t\tList<Integer> mapKeys = new ArrayList<Integer>(this.compleQuestions.keySet());\r\n\t\tint randomIndex = (int) (Math.random() * mapKeys.size());\r\n\t\treturn mapKeys.get(randomIndex);\r\n\t}", "static void askQuestion() {\n\t\t// Setting up a Scanner to get user input\n\t\tScanner userInput = new Scanner(System.in);\n\n\t\t// Declaring variables\n\t\tdouble num1, num2, answer, userAnswer;\n\n\t\t// GENERATING QUESTION\n\n\t\t// Getting two new random numbers, rounded to one decimal place (with numbers generation from 0 to 50)\n\t\tnum1 = Math.round((Math.random() * 50)*10.0)/10.0;\n\t\tnum2 = Math.round((Math.random() * 50)*10.0)/10.0;\n\n\t\t// Generating a random number between 1 and 4 to randomize the math operation. A switch case is used to calculate the answer based on the math operation that gets generated.\n\t\tswitch ((int) Math.round(Math.random() * 3 + 1)) {\n\t\t\tcase 1: // Similar structure for each case (and the default case), structured as follows\n\t\t\t\tSystem.out.print(num1 + \" + \" + num2 + \" = \"); // Printing the question (based on the generated operation)\n\t\t\t\tanswer = num1 + num2; // Calculating the answer (based on the generated operation)\n\t\t\t\tbreak; // Exit the switch statement\n\t\t\tcase 2:\n\t\t\t\tSystem.out.print(num1 + \" - \" + num2 + \" = \");\n\t\t\t\tanswer = num1 - num2;\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tSystem.out.print(num1 + \" / \" + num2 + \" = \");\n\t\t\t\tanswer = num1 / num2;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tSystem.out.print(num1 + \" * \" + num2 + \" = \");\n\t\t\t\tanswer = num1 * num2;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tanswer = Math.round(answer * 10.0) / 10.0; // Rounding the answer to one decimal place\n\t\tuserAnswer = userInput.nextDouble(); // Getting the user's answer\n\n\t\tif (answer == userAnswer) System.out.println(\"That's right. Good Job!\\n\"); // If the answers match, the user is correct and the staetment is printed accordingly.\n\t\telse System.out.println(\"Incorrect. The correct answer was \" + answer + \".\\n\"); // Otherwise, show that the user's answer is incorrect and output an according statement.\n\t}", "private Answer generateAnswer(int numberOfPossibleAnswers, int numberOfCorrectAnswers) {\n\t\tAnswer answer = new Answer();\n\t\t//check to make sure that an impossible value cannot be passed\n\t\tif(numberOfPossibleAnswers > 9) {\n\t\t\tnumberOfPossibleAnswers = 9;\n\t\t}\n\t\t//check to make sure that an impossible value cannot be passed\n\t\tif(numberOfCorrectAnswers > 9) {\n\t\t\tnumberOfCorrectAnswers = 9;\n\t\t}\n\t\tRandom random = new Random();\n\t\t//if the question can only have one correct answer the student will only choose one answer at random\n\t\tif(numberOfCorrectAnswers == 1) {\n\t\t\tanswer.setAnswer(random.nextInt(numberOfPossibleAnswers));\n\t\t}\n\t\telse if(numberOfCorrectAnswers > 1) {\n\t\t\t//randomly chooses how many answers to give for the question\n\t\t\tint numberOfAnswers = random.nextInt(numberOfPossibleAnswers) + 1;\n\t\t\t//chooses at random which answers to choose\n\t\t\tfor(int i = 0; i < numberOfAnswers; i++) { \n\t\t\t\tint answerId = random.nextInt(numberOfPossibleAnswers);\n\t\t\t\t//if the answer has already been given by the student, the student will choose \n\t\t\t\t//another random answer until it has not already been chosen\n\t\t\t\twhile(answer.getAnswer(answerId)) {\n\t\t\t\t\tanswerId = random.nextInt(numberOfPossibleAnswers);\n\t\t\t\t}\n\t\t\t\tanswer.setAnswer(answerId);\n\t\t\t}\n\t\t}\n\t\treturn answer;\n\t}", "protected void constructNewQuestion(){\n arabicWordScoreItem = wordScoreTable.whatWordToLearn();\n arabicWord = arabicWordScoreItem.word;\n correctAnswer = dictionary.get(arabicWord);\n\n for (int i=0;i<wrongAnswers.length;i++){\n int wrongAnswerId;\n String randomArabicWord;\n String wrongAnswer;\n do {\n wrongAnswerId = constructQuestionRandom.nextInt(next_word_index);\n randomArabicWord = dictionary_key_list.get(wrongAnswerId);\n wrongAnswer = dictionary.get(randomArabicWord);\n } while (wrongAnswer.equals(correctAnswer));\n wrongAnswers[i] = wrongAnswer;\n }\n }", "public String printOutQuestion()\n\t{\n\t\tRandom rand = new Random();\n\t\tString[] answers = new String[4];\n\t\tString returnString;\n\t\tanswers[0] = answer;\n\t\tanswers[1] = falseAnswers[0];\n\t\tanswers[2] = falseAnswers[1];\n\t\tanswers[3] = falseAnswers[2];\n\t\tString firstAns = \"\", secondAns = \"\", thirdAns = \"\", fourthAns = \"\";\n\t\t\n\t\twhile(firstAns == secondAns || firstAns == thirdAns || firstAns == fourthAns || secondAns == thirdAns || secondAns == fourthAns || thirdAns == fourthAns)\n\t\t{\n\t\t\tfirstAns = answers[rand.nextInt(4)];\n\t\t//\tSystem.out.println(firstAns); Used for debugging\n\t\t\tsecondAns = answers[rand.nextInt(4)];\n\t\t//\tSystem.out.println(secondAns); Used for debugging\n\t\t\tthirdAns = answers[rand.nextInt(4)];\n\t\t//\tSystem.out.println(thirdAns); Used for debugging\n\t\t\tfourthAns = answers[rand.nextInt(4)];\n\t\t//\tSystem.out.println(fourthAns); Used for debugging\n\t\t}\n\t\t\n\t\tanswerA = firstAns;\n\t\tanswerB = secondAns;\n\t\tanswerC = thirdAns;\n\t\tanswerD = fourthAns;\n\t\t//System.out.println(questionString + \"Answer A: \" + firstAns + \"Answer B: \" + secondAns + \"Answer C: \" + thirdAns + \"Answer D: \" + fourthAns); Used for debugging\n\t\treturnString = questionString + \"?\"; \n\t\tSystem.out.println(\"Actual Answer is: \" + answer);\n\t\treturn returnString;\n\t}", "private void initializeAnswers(){\n // Declare a random variable for randomly changing between pictures & random text options\n rand = new Random();\n\n // Set currentanswerbutton to be between 0-3, that way the button storing the correct answer is randomized, but we have 0-3 directly map to each button for deciding which button is correct\n // btntopLeftImage == 0\n // btntopRightImage == 1\n // btnbottomLeftImage == 2\n // btnbottomRightImage == 3\n currentanswerButton = rand.nextInt(4);\n\n // Randomly select a picture's abstracted integer value from the values array and set it to the current answer, then get 3 other values that are incorrect\n currentanswer = rand.nextInt(values.size());\n currentnotAnswer1 = rand.nextInt(values.size());\n currentnotAnswer2= rand.nextInt(values.size());\n currentnotAnswer3 = rand.nextInt(values.size());\n\n // Keep picking new options until none of them are the same to avoid duplicate options\n while ((currentanswer == currentnotAnswer1 || currentanswer == currentnotAnswer2 || currentanswer == currentnotAnswer3) || (currentnotAnswer1 == currentnotAnswer2 || currentnotAnswer1 == currentnotAnswer3) || (currentnotAnswer2== currentnotAnswer3)) {\n currentnotAnswer1 = rand.nextInt(values.size());\n currentnotAnswer2 = rand.nextInt(values.size());\n currentnotAnswer3 = rand.nextInt(values.size());\n }\n\n // Now Determine which button has the correct answer stored in it from the randomly generated int \"currentanswerButton\"\n // Button 1\n if (currentanswerButton == 0) {\n // Once determined set the center of the screen's image background to be the picture that is stored in the values arraylist at index \"currentanswer\"\n image.setBackground(ContextCompat.getDrawable(activity_gamePlay.this, values.get(currentanswer)));\n // Then set the corresponding button's text to be the correct/or incorrect options accordingly\n btntopLeftImage.setText(keys.get(currentanswer));\n btntopRightImage.setText(keys.get(currentnotAnswer1));\n btnbottomLeftImage.setText(keys.get(currentnotAnswer2));\n btnbottomRightImage.setText(keys.get(currentnotAnswer3));\n\n }\n // Same concept as Button 1\n // Button 2\n if (currentanswerButton== 1) {\n image.setBackground(ContextCompat.getDrawable(activity_gamePlay.this, values.get(currentanswer)));\n btntopLeftImage.setText(keys.get(currentnotAnswer1));\n btntopRightImage.setText(keys.get(currentanswer));\n btnbottomLeftImage.setText(keys.get(currentnotAnswer2));\n btnbottomRightImage.setText(keys.get(currentnotAnswer3));\n }\n\n // Same concept as Button 1\n // Button 3\n if (currentanswerButton == 2) {\n image.setBackground(ContextCompat.getDrawable(activity_gamePlay.this, values.get(currentanswer)));\n btntopLeftImage.setText(keys.get(currentnotAnswer1));\n btntopRightImage.setText(keys.get(currentnotAnswer2));\n btnbottomLeftImage.setText(keys.get(currentanswer));\n btnbottomRightImage.setText(keys.get(currentnotAnswer3));\n }\n\n // Same concept as Button 1\n // Button 4\n if (currentanswerButton == 3) {\n image.setBackground(ContextCompat.getDrawable(activity_gamePlay.this, values.get(currentanswer)));\n btntopLeftImage.setText(keys.get(currentnotAnswer1));\n btntopRightImage.setText(keys.get(currentnotAnswer2));\n btnbottomLeftImage.setText(keys.get(currentnotAnswer3));\n btnbottomRightImage.setText(keys.get(currentanswer));\n }\n\n }", "public static ArrayList<String> generateQ(int num, String op){\r\n //Calls the RandomQuestion from the KeyFunctions Class\r\n //Rounding -> \"^\"\r\n //Algebra -> \"Alg\"\r\n //Percentages -> \"%\"\r\n //Ratio -> \":\"\r\n //Fraction -> \"//\"\r\n \r\n bothList = new ArrayList<String>();\r\n if (op.equals(\"+\")||op.equals(\"-\")||op.equals(\"*\")||op.equals(\"/\")){\r\n for (int i = 1; i <= num; i++){\r\n String[] x = randomQuestionKS2(op);\r\n\r\n bothList.add(x[0]);\r\n bothList.add(x[1]);\r\n }}\r\n \r\n if (op.equals(\"^\")||op.equals(\"Alg\")||op.equals(\"%\")||op.equals(\":\")||op.equals(\"//\")){\r\n for (int i = 1; i <= num; i++){\r\n String[] x = randomQuestions(op);\r\n \r\n bothList.add(x[0]);\r\n bothList.add(x[1]);\r\n }}\r\n \r\n //System.out.print(questionList);\r\n //System.out.print(answerList);\r\n //System.out.print(bothList);\r\n return bothList;\r\n \r\n }", "public int generateQuestionBox() {\n\n if(mGame.isInQuestion()) return 0;\n\n Vector2 relVel = mGame.getPlayer().getVelocity();\n\n QuestionBox e = new QuestionBox();\n e.setRelativeVelocity(relVel);\n e.setPosition(1000, rand.nextInt(mMap.getBottomBound()));\n\n Question question = mQuestionManager.getQuestion(); \n question.setVelocity(relVel.x, relVel.y);\n question.setPosition(mGame.getWidth() / 4, 20);\n question.setOptionsPosition(mGame.getWidth() - 40);\n question.setOptionsRelativeVelocity(relVel);\n question.pack(mGame.getWidth(), mGame.getHeight());\n question.reset();\n\n e.setQuestion(question);\n\n mGame.addEntity(e);\n return e.getWidth();\n }", "public Area GetNextAreaRandom(Area area)\n\n {\n\n Random rand = new Random();\n\n int i = 0;\n\n switch(area.paths)\n\n {\n\n case Constants.North:\n\n i = rand.nextInt(2);\n\n if(i==0)\n\n return area.areaMap.get(Constants.North);\n\n if(i==1)\n\n return area;\n\n case Constants.South:\n\n if(i==0)\n\n return area.areaMap.get(Constants.South);\n\n if(i==1)\n\n return area;\n\n \n\n case Constants.East:\n\n if(i==0)\n\n return area.areaMap.get(Constants.East);\n\n if(i==1)\n\n return area;\n\n \n\n case Constants.West:\n\n if(i==0)\n\n return area.areaMap.get(Constants.West);\n\n if(i==1)\n\n return area;\n\n \n\n \n\n case Constants.NorthAndSouth:\n\n i = rand.nextInt(3);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.North);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.South);\n\n if(i == 2)\n\n return area;\n\n case Constants.NorthAndEast:\n\n i = rand.nextInt(3);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.North);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.East);\n\n if(i == 2)\n\n return area;\n\n case Constants.NorthAndWest:\n\n i = rand.nextInt(3);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.North);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.West);\n\n if(i == 2)\n\n return area;\n\n case Constants.SouthAndEast:\n\n i = rand.nextInt(3);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.East);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.South);\n\n if(i == 2)\n\n return area;\n\n case Constants.SouthAndWest:\n\n i = rand.nextInt(3);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.West);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.South);\n\n if(i == 2)\n\n return area;\n\n case Constants.EastAndWest:\n\n i = rand.nextInt(3);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.East);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.West);\n\n if(i == 2)\n\n return area;\n\n case Constants.NorthSouthAndEast:\n\n i = rand.nextInt(4);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.North);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.South);\n\n if(i == 2)\n\n return area.areaMap.get(Constants.East);\n\n if(i == 3)\n\n return area;\n\n case Constants.NorthSouthAndWest:\n\n i = rand.nextInt(4);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.North);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.South);\n\n if(i == 2)\n\n return area.areaMap.get(Constants.West);\n\n if(i == 3)\n\n return area;\n\n case Constants.NorthEastAndWest:\n\n i = rand.nextInt(4);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.North);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.East);\n\n if(i == 2)\n\n return area.areaMap.get(Constants.West);\n\n if(i == 3)\n\n return area;\n\n case Constants.SouthEastAndWest:\n\n i = rand.nextInt(4);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.West);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.South);\n\n if(i == 2)\n\n return area.areaMap.get(Constants.East);\n\n if(i == 3)\n\n return area;\n\n \n\n case Constants.NorthSouthEastAndWest:\n\n i = rand.nextInt(5);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.West);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.South);\n\n if(i == 2)\n\n return area.areaMap.get(Constants.North);\n\n if(i == 3)\n\n return area.areaMap.get(Constants.East);\n\n if(i == 4)\n\n return area;\n\n }\n\n \n\n return area;\n\n \n\n \n\n }", "public static void generateQuizz(int size)\n {\n nb1 = new int[size];\n nb2 = new int[size];\n answer = new int[size];\n for(int i = 0; i<size; i++)\n {\n nb1[i] = (int)(Math.random()*50+1);\n nb2[i] = (int)(Math.random()*50+1);\n answer[i] = 0;\n }\n \n }", "private String generateAnswer() throws IOException {\n int j = lineNumber();\n int i = 0;\n String result = \"\";\n Random rnd = new Random();\n int rndNumber = rnd.nextInt(j);\n File answers = new File(this.settings.getValue(\"botAnswerFile\"));\n try (RandomAccessFile raf = new RandomAccessFile(answers, \"r\")) {\n while (raf.getFilePointer() != raf.length()) {\n result = raf.readLine();\n i++;\n if ((i - 1) == rndNumber) {\n break;\n }\n }\n }\n return result;\n }", "public static int physicsQuestions(int physicsPathway) {\r\n int questionNumber = (int) (Math.random() * 20) + 1;\r\n\r\n switch (questionNumber) {\r\n case 1:\r\n System.out.println(\r\n \"The term kinematics is best described as (1.1)\\r\\n\" + \"1.) A term used to quantify motion\\r\\n\"\r\n + \"2.) The study of a position \\r\\n\" + \"3.) The study of how objects move\\r\\n\"\r\n + \"4.) A term used to quantify inertia\\r\\n\");\r\n break;\r\n case 2:\r\n System.out.println(\r\n \"For a straight line on a position-time graph, the rise refers to the change in quantity? (1.2)\\r\\n\"\r\n + \"1.) Slope\\r\\n\" + \"2.) Time \\r\\n\" + \"3.) Velocity\\r\\n\" + \"4.) Position \\r\\n\");\r\n break;\r\n case 3:\r\n System.out.println(\r\n \"A river has a current of 2.3 m/s. A man points his boat so that it is directed straight across the river. In still water, the boat can move with a speed of 3.2 m/s. What is the average speed of the boat while travelling across the river? (2.2)\\r\\n\"\r\n + \"1.) 1.1 m/s\\r\\n\" + \"2.) 2.8 m/s\\r\\n\" + \"3.) 3.9 m/s\\r\\n\" + \"4.) 5.5 m/s\\r\\n\");\r\n break;\r\n case 4:\r\n System.out.println(\r\n \"A basketball is shot with an initial velocity of 16 m/s at an angle of 55°. What is the approximate horizontal distance that the ball travels in 1.5 s? (2.2, 2.3)\\r\\n\"\r\n + \"1.) 9.1 m\\r\\n\" + \"2.) 13 m\\r\\n\" + \"3.) 14 m\\r\\n\" + \"4.) 20 m\\r\\n\");\r\n break;\r\n case 5:\r\n System.out.println(\r\n \"Which of the following forces is caused by the electric charges of particles? (3.1)\\r\\n\"\r\n + \"1.) Electromagnetic\\r\\n\" + \"2.) Ravitational\\r\\n\" + \"3.) Weak nuclear\\r\\n\"\r\n + \"4.) Strong nuclear\\r\\n\");\r\n break;\r\n case 6:\r\n System.out.println(\r\n \"What is the net force experienced by a 20.0 kg object that accelerates at a rate of 4.0 m/s²? (3.3)\\r\\n\"\r\n + \"1.) 80 N\\r\\n\" + \"2.) 60 N\\r\\n\" + \"3.) 800 N\\r\\n\" + \"4.) 5.0 N\\r\\n\");\r\n break;\r\n case 7:\r\n System.out.println(\r\n \"Which of the following scenarios will result in the largest amount of frictional force from the air? (4.1)\\r\\n\"\r\n + \"1.) A small surface area moving slowly \\r\\n\"\r\n + \"2.) A small surface area moving rapidly\\r\\n\"\r\n + \"3.) A large surface area moving slowly\\r\\n\"\r\n + \"4.) A large surface area moving rapidly\\r\\n\");\r\n break;\r\n case 8:\r\n System.out.println(\r\n \"Two blocks, at 4.0 kg and 5.0 kg, are suspended from the ceiling by a piece of string. What is the tension in the string? (3.5)\\r\\n\"\r\n + \"1.) 9.0 N\\r\\n\" + \"2.) 88 kg\\r\\n\" + \"3.) 88 N\\r\\n\" + \"4.) 49 N\\r\\n\");\r\n break;\r\n case 9:\r\n System.out.println(\r\n \"The type of energy possessed by moving objects is (5.2)\\r\\n\" + \"1.) Kinetic energy\\r\\n\"\r\n + \"2.) Potential energy\\r\\n\" + \"3.) Chemical energy\\r\\n\" + \"4.) Work energy \\r\\n\");\r\n break;\r\n case 10:\r\n System.out.println(\r\n \"What power input is needed for a 70.0 kg person to go up 5.00m of stairs in 2.00s? (5.5)\\r\\n\"\r\n + \"1.) 3430 J\\r\\n\" + \"2.) 175 J\\r\\n\" + \"3.) 1720 J\\r\\n\" + \"4.) 340 J\\r\\n\");\r\n break;\r\n case 11:\r\n System.out.println(\r\n \"The term used to describe the transfer of thermal energy that occurs when warmer objects are in physical contact with colder objects is (6.2)\\r\\n\"\r\n + \"1.) Thermal convection\\r\\n\" + \"2.) Thermal induction\\r\\n\" + \"3.) Thermal radiation \\r\\n\"\r\n + \"4.) Thermal conduction\\r\\n\");\r\n break;\r\n case 12:\r\n System.out.println(\r\n \"An increase in the motion of the particles that make up a substance will have what effect? (6.1)\\r\\n\"\r\n + \"1.) It will make the substance warmer\\r\\n\" + \"2.) It will make the substance colder\\r\\n\"\r\n + \"3.) It will make the substance spin\\r\\n\"\r\n + \"4.) It will not have any effect on the subject\\r\\n\");\r\n break;\r\n case 13:\r\n System.out.println(\r\n \"Which of the following statements is true of amplitude? (9.4)\\r\\n\"\r\n + \"1.) When the difference between the frequency of a wave and its natural frequency increases, the amplitude of a wave increases.\\r\\n\"\r\n + \"2.) A decrease in wave energy decreases a wave’s amplitude.\\r\\n\"\r\n + \"3.) When damping is increased, the amplitude of a wave increases\\r\\n\"\r\n + \"4.) When a system vibrates close to a harmonic, resonance occurs and the amplitude of the observed vibration decreases.\\r\\n\");\r\n break;\r\n case 14:\r\n System.out.println(\r\n \"If you know the linear density of a violin string and want to calculate the speed of a wave on the violin string, which additional information is needed? (8.4)\\r\\n\"\r\n + \"1.) Tension on the string\\r\\n\" + \"2.) Temperature of the string\\r\\n\"\r\n + \"3.) Time to complete a cycle\\r\\n\" + \"4.) Density of the violin’s sounding board\\r\\n\");\r\n break;\r\n case 15:\r\n System.out.println(\r\n \"When two waves meet, one with amplitude of 4 cm and the other with amplitude 2 cm, what are the possible maximum and minimum amplitudes of the resulting wave? (9.1)\\r\\n\"\r\n + \"1.) Maximum 6 cm, minimum 2 cm\\r\\n\" + \"2.) Maximum 4 cm, minimum 2 cm\\r\\n\"\r\n + \"3.) Maximum 8 cm, minimum 0.5 cm\\r\\n\" + \"4.) Maximum 6 cm, minimum 6 cm\\r\\n\");\r\n break;\r\n case 16:\r\n System.out.println(\r\n \"A truck is travelling at 30 m/s toward a stationary observer. If the truck sounds its horn at a frequency of 700 Hz, what frequency does the observer detect? (Use 340 m/s as the speed of sound.) (9.5)\\r\\n\"\r\n + \"1.) 638 Hz\\r\\n\" + \"2.) 643 Hz\\r\\n\" + \"3.) 762 Hz\\r\\n\" + \"4.) 767 Hz\\r\\n\");\r\n break;\r\n case 17:\r\n System.out.println(\r\n \"Which of the following is a unit of electrical energy? (11.1)\\r\\n\" + \"1.) Watt\\r\\n\"\r\n + \"2.) Volt \\r\\n\" + \"3.) Joule\\r\\n\" + \"4.) Ohm\\r\\n\");\r\n break;\r\n case 18:\r\n System.out.println(\r\n \"If an external magnetic field is pointing to the right and the current in a wire is pointing out of the page, in which direction is the force on the wire? (12.5)\\r\\n\"\r\n + \"1.) Upward\\r\\n\" + \"2.) Downward\\r\\n\" + \"3.) Left\\r\\n\" + \"4.) Into the page\\r\\n\");\r\n break;\r\n case 19:\r\n System.out.println(\r\n \"Magnetic field lines (12.1)\\r\\n\" + \"1.) Are stronger at the poles\\r\\n\"\r\n + \"2.) Can cross one another\\r\\n\" + \"3.) Are affected by gravity\\r\\n\"\r\n + \"4.) Exist in two dimensions only\\r\\n\");\r\n break;\r\n case 20:\r\n System.out.println(\r\n \"Which device is used to measure the resistance of a load? (11.3, 11.5, 11.7)\\r\\n\"\r\n + \"1.) Galvanometer\\r\\n\" + \"2.) Voltmeter\\r\\n\" + \"3.) Ohmmeter\\r\\n\" + \"4.) Ammeter\\r\\n\");\r\n break;\r\n }\r\n\r\n return questionNumber;\r\n }", "public void generateRandomQuestions(){\r\n numberHolder = new ArrayList<>(NUMBER_OF_QUESTIONS);\r\n for (int i = 0; i < NUMBER_OF_QUESTIONS; i++)\r\n numberHolder.add(i);\r\n\r\n Collections.shuffle(numberHolder);\r\n System.out.println(numberHolder);\r\n\r\n }", "static void generateQuestions(int numQuestions, int selection, String fileName, String points) {\n String finalAnswers = \"\";\n switch (selection) {\n case 1:\n for (int i = 0; i < numQuestions; i++) {\n finalAnswers += one(points);\n }\n break;\n case 2:\n for (int i = 0; i < numQuestions; i++) {\n finalAnswers += two(points);\n }\n break;\n case 3:\n for (int i = 0; i < numQuestions; i++) {\n finalAnswers += three(points);\n }\n break;\n case 4:\n for (int i = 0; i < numQuestions; i++) {\n finalAnswers += four(points);\n }\n break;\n default:\n System.out.println(\"Wrong selection. Please try again\");\n break;\n }\n writeAnswers(fileName, finalAnswers);\n }", "public void setTFChoices() {\r\n Random randomGenerator = new Random();\r\n int trueFalseAnswer = randomGenerator.nextInt(2);\r\n studentAnswer.add(trueFalseAnswer);\r\n }", "public static boolean checkAnswer(int rnd){\r\n\t\t//depending on the random number and what is clicked on by the user, return true or false\r\n\t\t if (rnd==0&&(x>413&&x<703)&&(y>748&&y<838))\r\n\t\t {\r\n\t\t\t return true;\r\n\t\t }\r\n\t\t else if (rnd==1&&(x>406&&x<695)&&(y>558&&y<646))\r\n\t\t {\r\n\t\t\t return true;\r\n\t\t }\r\n\t\t else if (rnd==2&&(x>90&&x<381)&&(y>557&&y<647))\r\n\t\t {\r\n\t\t\t return true;\r\n\t\t }\r\n\t\t else if (rnd==3&&(x>90&&x<381)&&(y>748&&y<838))\r\n\t\t {\r\n\t\t\t return true;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\t return false;\r\n\t\t }\r\n\t}", "public void setIdQuestion(int idT) {\r\n idQuestion=rand(idT);\r\n }", "public void chooseAnswer(View view)\n {\n\n if(view.getTag().toString().equals(Integer.toString(pos_of_correct)))\n {\n //Log.i(\"Result\",\"Correct Answer\");\n correct++;\n noOfQues++;\n correct();\n }\n else\n {\n //Log.i(\"Result\",\"Incorrect Answer\");\n //resluttextview.setText(\"Incorrect!\");\n incorrect();\n noOfQues++;\n }\n pointtextView.setText(Integer.toString(correct)+\"/\"+Integer.toString(noOfQues));\n if(tag==4)\n generateAdditionQuestion();\n if(tag==5)\n generateSubtractionQuestion();\n if(tag==6)\n generateMultiplicationQuestion();\n if(tag==7)\n generateDivisionQuestion();\n\n }", "int randomPoint() { return 1 + (int)Math.round((Math.random()*20) % (size - 2)); }", "public void randomize() {\n\t\tx = ThreadLocalRandom.current().nextInt(0, 499 + 1);\n\t\ty = ThreadLocalRandom.current().nextInt(0, 499 + 1);\n\t}", "public static int sapQuestions (int sapPathway)\r\n {\r\n int questionNumber = (int)(Math.random()*20)+1;\r\n\r\n switch (questionNumber)\r\n {\r\n case 1: System.out.println(\"Which of the following is not a social institution?\\r\\n\" + \r\n \"1.) family\\r\\n\" + \r\n \"2.) education\\r\\n\" + \r\n \"3.) hidden Media\\r\\n\" + \r\n \"4.) social Media\\r\\n\");\r\n break;\r\n case 2: System.out.println(\"Stereotypes are maintained by _______\\r\\n\" + \r\n \"1.) ignoring contradictory evidence\\r\\n\" + \r\n \"2.) individualization \\r\\n\" + \r\n \"3.) overcomplicating generalization that is applied to all members of a group\\r\\n\" + \r\n \"4.) the ideology of “rescue”\\r\\n\");\r\n break;\r\n case 3: System.out.println(\"Racism is about _____\\r\\n\" + \r\n \"1.) effect not Intent\\r\\n\" + \r\n \"2.) intent not effect\\r\\n\" + \r\n \"3.) response not question\\r\\n\" + \r\n \"4.) question not response\\r\\n\");\r\n break;\r\n case 4: System.out.println(\"What is the definition of theory?\\r\\n\" + \r\n \"1.) what’s important to you\\r\\n\" + \r\n \"2.) best possible explanation based on available evidence\\r\\n\" + \r\n \"3.) your experiences, what you think is real\\r\\n\" + \r\n \"4.) determines how you interpret situations\\r\\n\");\r\n break;\r\n case 5: System.out.println(\"Which of the following is not an obstacle to clear thinking?\\r\\n\" + \r\n \"1.) drugs\\r\\n\" + \r\n \"2.) close-minded\\r\\n\" + \r\n \"3.) honesty\\r\\n\" + \r\n \"4.) emotions\\r\\n\");\r\n break;\r\n case 6: System.out.println(\"What does the IQ test asses?\\r\\n\" + \r\n \"1.) literacy skills\\r\\n\" + \r\n \"2.) survival skills\\r\\n\" + \r\n \"3.) logical reasoning skills\\r\\n\" + \r\n \"4.) 1 and 3\\r\\n\");\r\n break;\r\n case 7: System.out.println(\"How many types of intelligence are there?\\r\\n\" + \r\n \"1.) 27\\r\\n\" + \r\n \"2.) 5\\r\\n\" + \r\n \"3.) 3\\r\\n\" + \r\n \"4.) 8\\r\\n\");\r\n break;\r\n case 8: System.out.println(\"Emotions have 3 components\\r\\n\" + \r\n \"1.) psychological, cognitive, behavioral\\r\\n\" + \r\n \"2.) psychological, physical, social\\r\\n\" + \r\n \"3.) intensity, range, exposure\\r\\n\" + \r\n \"4.) range, duration, intensity\\r\\n\");\r\n break;\r\n case 9: System.out.println(\"Which of the following is not a component of happiness?\\r\\n\" + \r\n \"1.) diet and nutrition\\r\\n\" + \r\n \"2.) time in nature\\r\\n\" + \r\n \"3.) interventions\\r\\n\" + \r\n \"4.) relationships\\r\\n\");\r\n break;\r\n case 10: System.out.println(\"The brain compensates for damaged neurons by ______.\\r\\n\" + \r\n \"1.) extending neural connections over the dead neurons\\r\\n\" + \r\n \"2.) it doesn’t need too\\r\\n\" + \r\n \"3.) grows new neurons\\r\\n\" + \r\n \"4.) send neurons in from different places\\r\\n\");\r\n break;\r\n case 11: System.out.println(\"Which of the following is true?\\r\\n\" + \r\n \"1.) you continue to grow neurons until age 50\\r\\n\" + \r\n \"2.) 90% of the brain is achieved by age 6\\r\\n\" + \r\n \"3.) only 20% of the brain is actually being used \\r\\n\" + \r\n \"4.) the size of your brain determines your intelligence\\r\\n\");\r\n break;\r\n case 12: System.out.println(\"The feel-good chemical is properly known as?\\r\\n\" + \r\n \"1.) acetycholine\\r\\n\" + \r\n \"2.) endocrine\\r\\n\" + \r\n \"3.) dopamine\\r\\n\" + \r\n \"4.) doperdoodle\\r\\n\");\r\n break;\r\n case 13: System.out.println(\"Who created the theory about ID, superego and ego?\\r\\n\" + \r\n \"1.) Albert\\r\\n\" + \r\n \"2.) Freud\\r\\n\" + \r\n \"3.) Erikson\\r\\n\" + \r\n \"4.) Olaf\\r\\n\");\r\n break;\r\n case 14: System.out.println(\"Classic Conditioning is _______?\\r\\n\" + \r\n \"1.) when an organism learns to associate two things that are normally unrelated\\r\\n\" + \r\n \"2.) when an organism learns to disassociate two things that are normally related \\r\\n\" + \r\n \"3.) when you teach an organism the survival style of another organism\\r\\n\" + \r\n \"4.) when you train an organism without the use of modern technology\\r\\n\");\r\n break;\r\n case 15: System.out.println(\"The cerebellum is responsible for what?\\r\\n\" + \r\n \"1.) visual info processing\\r\\n\" + \r\n \"2.) secrets hormones\\r\\n\" + \r\n \"3.) balance and coordination\\r\\n\" + \r\n \"4.) controls heartbeat\\r\\n\");\r\n break;\r\n case 16: System.out.println(\"Transphobia is the fear of?\\r\\n\" + \r\n \"1.) transgender individuals\\r\\n\" + \r\n \"2.) homosexual individuals\\r\\n\" + \r\n \"3.) women\\r\\n\" + \r\n \"4.) transfats\\r\\n\");\r\n break;\r\n case 17: System.out.println(\"What factors contribute to a positive IQ score in children?\\r\\n\" + \r\n \"1.) early access to words\\r\\n\" + \r\n \"2.) affectionate parents\\r\\n\" + \r\n \"3.) spending time on activities\\r\\n\" + \r\n \"4.) all of the above\\r\\n\");\r\n break;\r\n case 18: System.out.println(\"Emotions can be ______.\\r\\n\" + \r\n \"1.) a reaction\\r\\n\" + \r\n \"2.) a goal\\r\\n\" + \r\n \"3.) all of the above\\r\\n\" + \r\n \"4.) none of the above\\r\\n\");\r\n break;\r\n case 19: System.out.println(\"What is not a stage in increasing prejudice?\\r\\n\" + \r\n \"1.) verbal rejection\\r\\n\" + \r\n \"2.) extermination\\r\\n\" + \r\n \"3.) avoidance\\r\\n\" + \r\n \"4.) self agreement\\r\\n\");\r\n break;\r\n case 20: System.out.println(\"What part of the brain is still developing in adolescents?\\r\\n\" + \r\n \"1.) brain stem\\r\\n\" + \r\n \"2.) pons\\r\\n\" + \r\n \"3.) prefrontal cortex\\r\\n\" + \r\n \"4.) occipital\\r\\n\");\r\n break;\r\n }\r\n\r\n return questionNumber;\r\n }", "public static int csQuestions(int csPathway) {\r\n int questionNumber = (int) (Math.random() * 20) + 1;\r\n\r\n switch (questionNumber) {\r\n case 1:\r\n System.out.println(\r\n \"\\r\\n\" + \"Which of the following is not one of the 8 ethics of programming\\r\\n\" + \"1.) Self\\r\\n\"\r\n + \"2.) Product\\r\\n\" + \"3.) Gracious Professionalism \\r\\n\" + \"4.) Public\\r\\n\");\r\n break;\r\n case 2:\r\n System.out.println(\r\n \"What’s wrong with the following main method? Public static boolean main(String args[]) {\\r\\n\"\r\n + \"1.) The main should be private\\r\\n\" + \"2.) The p in public should be lowercase\\r\\n\"\r\n + \"3.) The arguments should be int\\r\\n\"\r\n + \"4.) The p in public should be lowercase and boolean should be void\\r\\n\");\r\n break;\r\n case 3:\r\n System.out.println(\r\n \"What are the primitive types?\\r\\n\"\r\n + \"1.) byte, String, int, double, char, boolean, float, long\\r\\n\"\r\n + \"2.) double, char, boolean, float\\r\\n\"\r\n + \"3.) byte, short, int, long, float, double, char, boolean\\r\\n\"\r\n + \"4.) double, class, boolean, float\\r\\n\");\r\n break;\r\n case 4:\r\n System.out.println(\r\n \"The “less than or equal to” comparison operator in Java is _______.\\r\\n\" + \"1.) =<\\r\\n\"\r\n + \"2.) !=\\r\\n\" + \"3.) <=\\r\\n\" + \"4.) <\\r\\n\");\r\n break;\r\n case 5:\r\n System.out.println(\r\n \"What are the benefits of modular programming?\\r\\n\"\r\n + \"1.) Methods are used to break code into manageable pieces\\r\\n\"\r\n + \"2.) Make code more reusable\\r\\n\" + \"3.) Help to debug code\\r\\n\"\r\n + \"4.) All of the above\\r\\n\");\r\n break;\r\n case 6:\r\n System.out.println(\r\n \"The following code displays ______.\\r\\n\" + \" double temp = 50;\\r\\n\" + \" \\r\\n\"\r\n + \" if (temp >= 100)\\r\\n\" + \" System.out.println(“too hot’);\\r\\n\"\r\n + \" else if (temp <=40)\\r\\n\" + \" System.out.println(“too cold”);\\r\\n\"\r\n + \" else \\r\\n\" + \" System.out.println(“just right”);\\r\\n\"\r\n + \"1.) too hot too cold just right\\r\\n\" + \"2.) too hot\\r\\n\" + \"3.) too cold\\r\\n\"\r\n + \"4.) just right\\r\\n\");\r\n break;\r\n case 7:\r\n System.out.println(\r\n \"The order of precedence (from high to low) of the operators +,*, &&, ||, ! is\\r\\n\"\r\n + \"1.) *, +, !, &&, ||\\r\\n\" + \"2.) *, +, &&, ||, !\\r\\n\" + \"3.) &&, ||, !, +, *\\r\\n\"\r\n + \"4.) *, +, !, ||, &&\\r\\n\");\r\n break;\r\n case 8:\r\n System.out.println(\r\n \"What does the String Class, s.length() do?\\r\\n\" + \"1.) returns the character at index x\\r\\n\"\r\n + \"2.) returns true/false if the string stored in s is the same as that in t ignoring the case\\r\\n\"\r\n + \"3.) returns the number of characters in the string\\r\\n\"\r\n + \"4.) returns the string in all lowercase\\r\\n\");\r\n break;\r\n case 9:\r\n System.out.println(\r\n \"What does the Math Class, Math.random() do?\\r\\n\"\r\n + \"1.) returns a double from 0.0 and less than 1.0\\r\\n\"\r\n + \"2.) return a double of the square root of the value given\\r\\n\"\r\n + \"3.) returns the minimum of the two values given\\r\\n\"\r\n + \"4.) returns a double of the base raised to the exponent\\r\\n\");\r\n break;\r\n case 10:\r\n System.out.println(\r\n \"What does void in the following method, public static void main(String[] args), mean?\\r\\n\"\r\n + \"1.) when called on, this method will not have a return value\\r\\n\"\r\n + \"2.) void is the method name\\r\\n\"\r\n + \"3.) when called on, this method will return a boolean\\r\\n\"\r\n + \"4.) void represent that this method needs no parameters\\r\\n\");\r\n break;\r\n case 11:\r\n System.out.println(\r\n \"What is wrong with the following line, System.out.println(“Hello World”)\\r\\n\"\r\n + \"1.) System should be lowercase\\r\\n\" + \"2.) missing a semicolon at the end\\r\\n\"\r\n + \"3.) Hello World needs to be in single quotations\\r\\n\"\r\n + \"4.) missing a comma at the end\\r\\n\");\r\n break;\r\n case 12:\r\n System.out.println(\r\n \"What is // used for?\\r\\n\" + \"1.) print a new line\\r\\n\" + \"2.) block comments\\r\\n\"\r\n + \"3.) single line comments\\r\\n\" + \"4.) print double space\\r\\n\");\r\n break;\r\n case 13:\r\n System.out.println(\r\n \"What does the String Class, s.equalsIgnoreCase(t) do?\\r\\n\"\r\n + \"1.) returns the string in all lowercase\\r\\n\" + \"2.) returns the character at index x\\r\\n\"\r\n + \"3.) returns true/false if the string stored in s is the same as that in t\\r\\n\"\r\n + \"4.) returns true/false if the string stored in s is the same as that in t ignoring the case\\r\\n\");\r\n break;\r\n case 14:\r\n System.out.println(\r\n \"If you run a program and it returns with ArrayIndexOutOfBoundsException. There’s a ______.\\r\\n\"\r\n + \"1.) runtime error\\r\\n\" + \"2.) syntax error\\r\\n\" + \"3.) format error \\r\\n\"\r\n + \"4.) logic error\\r\\n\");\r\n break;\r\n case 15:\r\n System.out.println(\r\n \"What are two ways to make code more readable?\\r\\n\" + \"1.) comments and arrays\\r\\n\"\r\n + \"2.) descriptive names and randomized casing\\r\\n\"\r\n + \"3.) descriptive names and comments\\r\\n\" + \"4.) indentation and return statements \\r\\n\");\r\n break;\r\n case 16:\r\n System.out.println(\r\n \"A for statement is a _________.\\r\\n\" + \"1.) conditional loop\\r\\n\" + \"2.) counter loop \\r\\n\"\r\n + \"3.) selection statement\\r\\n\" + \"4.) selection loop\\r\\n\");\r\n break;\r\n case 17:\r\n System.out.println(\r\n \"// are used for what in Java?\\r\\n\" + \"1.) single line commenting \\r\\n\"\r\n + \"2.) end of a java statement \\r\\n\" + \"3.) block comment\\r\\n\"\r\n + \"4.) Java doc comment\\r\\n\");\r\n break;\r\n case 18:\r\n System.out.println(\r\n \"Which of the following is the correct way to name a variable?\\r\\n\" + \"1.) StudentNumber\\r\\n\"\r\n + \"2.) _student_number\\r\\n\" + \"3.) STUDENTNUMBER\\r\\n\" + \"4.) studentNumber\\r\\n\");\r\n break;\r\n case 19:\r\n System.out.println(\r\n \"What will the following code execute?\\r\\n\" + \" int x = 10;\\r\\n\" + \" x += 5;\\r\\n\"\r\n + \" System.out.println(“X equals” + x);\\r\\n\" + \"1.) prints out “X equals x”\\r\\n\"\r\n + \"2.) prints out “X equals 10”\\r\\n\" + \"3.) prints out “X equals 15”\\r\\n\"\r\n + \"4.) prints out “X equals 5”\\r\\n\");\r\n break;\r\n case 20:\r\n System.out.println(\r\n \"What does the Math Class, Math.pow(base, exp) do?\\r\\n\"\r\n + \"1.) return a double of the square root of the value given\\r\\n\"\r\n + \"2.) returns a double from 0.0 and less than 1.0\\r\\n\"\r\n + \"3.)returns the maximum of the two values given\\r\\n\"\r\n + \"4.) returns a double of the base raised to the exponent\\r\\n\");\r\n }\r\n\r\n return questionNumber;\r\n }", "public MovieQuestion getQuestion() {\n\t\tMovieQuestion newQ = new MovieQuestion();\n\t\tint row;\n\t\tCursor c;\n\t\tboolean okToAdd = false;\n\n\t\t// Pick random question\n\t\tswitch ((int)(Math.random()*9)) {\n\t\tcase 0: // Who directed the movie %s?\n\t\t\tc = mDb.rawQuery(\"SELECT * FROM movies\", null);\n\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\tc.moveToPosition(row);\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[0], c.getString(1));\n\t\t\tnewQ.answers[0] = c.getString(3);\n\t\t\t\n\t\t\tLog.i(\"NewQuestion\", \"Correct:\" + c.getString(3));\n\t\t\t\n\t\t\t// Fill answers with unique wrong values\n\t\t\tfor(int i = 1; i < 4;) {\n\t\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\t\tc.moveToPosition(row);\n\t\t\t\tLog.i(\"NewQuestion\", \"Wrong:\" + c.getString(3));\n\t\t\t\t// i < 4, so we do not increment indefinitely.\n\t\t\t\tfor(int j = 0; j < i && i < 4; j++) {\n\t\t\t\t\tif(newQ.answers[j].equals(c.getString(3))) {\n\t\t\t\t\t\tokToAdd = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tokToAdd = true;\n\t\t\t\t}\n\t\t\t\tif(okToAdd)\n\t\t\t\t\tnewQ.answers[i++] = c.getString(3);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 1: // When was the movie %s released?\n\t\t\tc = mDb.rawQuery(\"SELECT * FROM movies\", null);\n\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\tc.moveToPosition(row);\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[1], c.getString(1));\n\t\t\tnewQ.answers[0] = c.getString(2);\n\n\t\t\t// Fill answers with unique wrong values\n\t\t\tfor(int i = 1; i < 4;) {\n\t\t\t\tint wrongYear = Integer.parseInt(newQ.answers[0]) + (int)((Math.random()-.5)*50); // +/- [1-25] years\n\t\t\t\tif (wrongYear <= 2014 && wrongYear != Integer.parseInt(newQ.answers[0]))\n\t\t\t\t\tnewQ.answers[i++] = \"\" + wrongYear;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 2: // Which star was in the movie %s?\n\t\t\tc = mDb.rawQuery(\"SELECT DISTINCT m.`title`, m.`director`, s.`first_name`, s.`last_name` FROM `movies` m, `stars` s, `stars_in_movies` sm WHERE m.id = sm.movie_id AND s.id = sm.star_id AND s.id GROUP BY m.`id`, s.`first_name`, s.`last_name` ORDER BY RANDOM() LIMIT 4\", null);\n\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\tc.moveToFirst(); // only 4 results are returned.\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[2], c.getString(0));\n\t\t\tnewQ.answers[0] = c.getString(2) +\" \"+ c.getString(3); \n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\tfor (int j = 1; j < 4; j++) {\n\t\t\t\tc.moveToNext();\n\t\t\t\tnewQ.answers[j] = c.getString(2) +\" \"+ c.getString(3);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 3: // Which star was not in the movie %s?\n\t\t\t// The lone star, the left out one...the answer\n\t\t\tString singleActorQuery = \"SELECT mov.`title`, star.`first_name`, star.`last_name`, star.`id` FROM `movies` mov, `stars` star, \"+\n\t\t\t\t\t\"(SELECT movie_id, star_id FROM `stars_in_movies` GROUP BY movie_id HAVING COUNT(star_id) <= 1 ORDER BY RANDOM() LIMIT 1) mult \"+ \n\t\t\t\t\t\"WHERE mov.`id` = mult.`movie_id` AND star.`id`= mult.`star_id`\";\n\t\t\tc = mDb.rawQuery(singleActorQuery, null);\n\t\t\tc.moveToFirst();\n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\tnewQ.answers[0] = c.getString(1) +\" \"+c.getString(2);\n\n\t\t\t// The cool kids: A group of actors in the same movie....excluding the lone star.\n//\t\t\tString starId = c.getString(3);\n\t\t\tString multipleActorQuery = \"SELECT mov.`title`, star.`first_name`, star.`last_name` \" +\n\t\t\t\t\t\"FROM `movies` mov, `stars` star, `stars_in_movies` sim, \" +\n\t\t\t\t\t\"(SELECT movie_id, star_id FROM `stars_in_movies` GROUP BY movie_id HAVING COUNT(star_id) > 2 ORDER BY RANDOM() LIMIT 1) mult\" +\n\t\t\t\t\t\" WHERE mov.`id` = mult.`movie_id` AND star.`id` = sim.`star_id` AND mult.`movie_id` = sim.`movie_id` \" +\n\t\t\t\t\t\"LIMIT 3\";\n\t\t\tc = mDb.rawQuery(multipleActorQuery, null);\n\t\t\tc.moveToFirst();\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[3], c.getString(0));\n\t\t\tfor (int i = 1; i < 4; i++) {\n\t\t\t\tnewQ.answers[i] = c.getString(1) +\" \"+c.getString(2);\n\t\t\t\tc.moveToNext();\n\t\t\t}\n\n\t\t\tbreak;\n\t\tcase 4: // In which movie do the stars %s and %s appear together?\n\t\t\t// Get a movie they both star in\n\t\t\tc = mDb.rawQuery(\"SELECT m.`title`, s.`first_name`, s.`last_name`, s2.`first_name`, s2.`last_name`\" +\n\t\t\t\t\t\"FROM `movies` m, `stars` s, `stars` s2, `stars_in_movies` sm, `stars_in_movies` sm2 \" +\n\t\t\t\t\t\"WHERE m.id = sm.movie_id AND m.id = sm2.movie_id AND s.id = sm.star_id AND s2.id = sm2.star_id AND s.id != s2.id \" +\n\t\t\t\t\t\"GROUP BY m.`id`, s.`first_name`, s.`last_name` ORDER BY RANDOM() LIMIT 4\", null);\n\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\tc.moveToFirst();\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[4], c.getString(1)+\" \"+c.getString(2), c.getString(3)+\" \"+c.getString(4));\n\t\t\tnewQ.answers[0] = c.getString(0); \n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\tfor (int j = 1; j < 4; j++) {\n\t\t\t\tc.moveToNext();\n\t\t\t\tnewQ.answers[j] = c.getString(0);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 5: // Who directed the star %s?\n\t\t\tc = mDb.rawQuery(\"SELECT DISTINCT m.`year`, m.`director`, s.`first_name`, s.`last_name` FROM `movies` m, `stars` s, `stars_in_movies` sm WHERE m.id = sm.movie_id AND s.id = sm.star_id AND s.id GROUP BY m.`id`, s.`first_name`, s.`last_name` ORDER BY RANDOM() LIMIT 4\", null);\n\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\tc.moveToFirst(); // only 4 results are returned.\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[5], c.getString(2) +\" \"+ c.getString(3));\n\t\t\tnewQ.answers[0] = c.getString(1); \n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\tfor (int j = 1; j < 4; j++) {\n\t\t\t\tc.moveToNext();\n\t\t\t\tnewQ.answers[j] = c.getString(1);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 6: // Which star appears in both movies %s and %s?\n\t\t\t// Get the 2 movies with the same actor...\n\t\t\tc = mDb.rawQuery(\"SELECT mov.`id`, mov.`title`, star.`first_name`, star.`last_name`, star.`id` FROM `movies` mov, `stars_in_movies` sim, `stars` star, (SELECT movie_id, star_id, COUNT(movie_id) as cnt FROM `stars_in_movies` GROUP BY star_id HAVING COUNT(movie_id) > 3 ORDER BY RANDOM() LIMIT 1) as popular WHERE sim.`movie_id` = mov.`id` AND popular.`star_id` = sim.`star_id` AND star.`id` = sim.`star_id` LIMIT 2\", null);\n\t\t\tc.moveToFirst();\n\t\t\tString id = c.getString(4);\n\t\t\t\n\t\t\tString[] movies = new String[2];\n\t\t\tmovies[0] = c.getString(1);\n\t\t\tc.moveToNext();\n\t\t\tmovies[1] = c.getString(1);\n\t\t\t\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[6], movies[0], movies[1]);\n\t\t\tnewQ.answers[0] = c.getString(2) +\" \"+ c.getString(3);\n\t\t\t\n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\t\n\t\t\t// Pick 3 alternatives...\n\t\t\tc = mDb.rawQuery(\"SELECT s.first_name, s.last_name FROM stars s WHERE s.id != \"+id+\" GROUP BY s.id ORDER BY RANDOM() LIMIT 3\", null);\n\t\t\tc.moveToFirst();\n\t\t\tfor (int i = 1; i < 4; i++) {\n\t\t\t\tnewQ.answers[i] = c.getString(0) +\" \"+ c.getString(1);\n\t\t\t\tc.moveToNext();\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 7: // Which star did not appear in the same movie with the star %s?\n\t\t\t// The lone star, the left out one...the answer\n\t\t\tString singleActorQueryII = \"SELECT mov.`title`, star.`first_name`, star.`last_name`, star.`id` FROM `movies` mov, `stars` star, \"+\n\t\t\t\t\t\"(SELECT movie_id, star_id FROM `stars_in_movies` GROUP BY movie_id HAVING COUNT(star_id) <= 1 ORDER BY RANDOM() LIMIT 1) mult \"+ \n\t\t\t\t\t\"WHERE mov.`id` = mult.`movie_id` AND star.`id`= mult.`star_id`\";\n\t\t\tc = mDb.rawQuery(singleActorQueryII, null);\n\t\t\tc.moveToFirst();\n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\tnewQ.answers[0] = c.getString(1) +\" \"+c.getString(2);\n\n\t\t\t// The cool kids: A group of actors in the same movie....excluding the lone star.\n\t\t\tString multipleActorQueryII = \"SELECT mov.`title`, star.`first_name`, star.`last_name` \" +\n\t\t\t\t\t\"FROM `movies` mov, `stars` star, `stars_in_movies` sim, \" +\n\t\t\t\t\t\"(SELECT movie_id, star_id FROM `stars_in_movies` GROUP BY movie_id HAVING COUNT(star_id) > 3 ORDER BY RANDOM() LIMIT 1) mult\" +\n\t\t\t\t\t\" WHERE mov.`id` = mult.`movie_id` AND star.`id` = sim.`star_id` AND mult.`movie_id` = sim.`movie_id` \" +\n\t\t\t\t\t\" GROUP BY star.`id`\"+\n\t\t\t\t\t\" LIMIT 4\";\n\t\t\tc = mDb.rawQuery(multipleActorQueryII, null);\n\t\t\tc.moveToFirst();\n\t\t\t// Take the first of the group and put his name in the question\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[7], c.getString(1) +\" \"+c.getString(2));\n\t\t\tc.moveToNext();\n\t\t\tfor (int i = 1; i < 4; i++) {\n\t\t\t\tnewQ.answers[i] = c.getString(1) +\" \"+c.getString(2);\n\t\t\t\tc.moveToNext();\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault: // Who directed the star %s in year %s?\n\t\t\tc = mDb.rawQuery(\"SELECT DISTINCT m.`year`, m.`director`, s.`first_name`, s.`last_name` FROM `movies` m, `stars` s, `stars_in_movies` sm WHERE m.id = sm.movie_id AND s.id = sm.star_id AND s.id GROUP BY m.`id`, s.`first_name`, s.`last_name` ORDER BY RANDOM() LIMIT 4\", null);\n\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\tc.moveToFirst(); // only 4 results are returned.\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[8], c.getString(2) +\" \"+ c.getString(3), c.getString(0));\n\t\t\tnewQ.answers[0] = c.getString(1); \n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\tfor (int j = 1; j < 4; j++) {\n\t\t\t\tc.moveToNext();\n\t\t\t\tnewQ.answers[j] = c.getString(1);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\treturn newQ;\n\t}", "private int evaluate() {\n return (int) (Math.random() * 8);\n }", "public void submitAnswers(View view) {\n\n int points = 0;\n\n //Question 1\n RadioButton radioButton_q1 = findViewById (R.id.optionB_q1);\n boolean firstQuestionCorrect = radioButton_q1.isChecked ();\n if (firstQuestionCorrect) {\n points += 1;\n }\n //Question 2\n RadioButton radioButton_q2 = findViewById (R.id.optionC_q2);\n boolean secondQuestionCorrect = radioButton_q2.isChecked ();\n if (secondQuestionCorrect) {\n points += 1;\n }\n\n //Question 3 - in order to get a point in Question 3, three particular boxes has to be checked\n CheckBox checkAns1_q3 = findViewById (R.id.checkbox1_q3);\n boolean thirdQuestionAnswer1 = checkAns1_q3.isChecked ();\n CheckBox checkAns2_q3 = findViewById (R.id.checkbox2_q3);\n boolean thirdQuestionAnswer2 = checkAns2_q3.isChecked ();\n CheckBox checkAns3_q3 = findViewById (R.id.checkbox3_q3);\n boolean thirdQuestionAnswer3 = checkAns3_q3.isChecked ();\n CheckBox checkAns4_q3 = findViewById (R.id.checkbox4_q3);\n boolean thirdQuestionAnswer4 = checkAns4_q3.isChecked ();\n CheckBox checkAns5_q3 = findViewById (R.id.checkbox5_q3);\n boolean thirdQuestionAnswer5 = checkAns5_q3.isChecked ();\n CheckBox checkAns6_q3 = findViewById (R.id.checkbox6_q3);\n boolean thirdQuestionAnswer6 = checkAns6_q3.isChecked ();\n CheckBox checkAns7_q3 = findViewById (R.id.checkbox7_q3);\n boolean thirdQuestionAnswer7 = checkAns7_q3.isChecked ();\n if (thirdQuestionAnswer2 && thirdQuestionAnswer3 && thirdQuestionAnswer6 && !thirdQuestionAnswer1 && !thirdQuestionAnswer4 && !thirdQuestionAnswer5 && !thirdQuestionAnswer7) {\n points = points + 1;\n }\n\n //Question 4\n RadioButton radioButton_q4 = findViewById (R.id.optionC_q4);\n boolean forthQuestionCorrect = radioButton_q4.isChecked ();\n if (forthQuestionCorrect) {\n points += 1;\n }\n\n //Question 5\n EditText fifthAnswer = findViewById (R.id.q5_answer);\n String fifthAnswerText = fifthAnswer.getText ().toString ();\n if (fifthAnswerText.equals (\"\")) {\n Toast.makeText (getApplicationContext (), getString (R.string.noFifthAnswer), Toast.LENGTH_LONG).show ();\n return;\n } else if ((fifthAnswerText.equalsIgnoreCase (getString (R.string.pacific))) || (fifthAnswerText.equalsIgnoreCase (getString (R.string.pacificOcean)))) {\n points += 1;\n }\n\n //Question 6\n RadioButton radioButton_q6 = findViewById (R.id.optionA_q6);\n boolean sixthQuestionCorrect = radioButton_q6.isChecked ();\n if (sixthQuestionCorrect) {\n points += 1;\n }\n\n //Showing the result to the user\n displayScore (points);\n }", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n System.out.println(\"Do you want to try your luck with the slot machine? Type 1 for YES or 2 for NO:\");\n int answer = sc.nextInt();\n\n\n //Create If/Else based on Yes/No response\n //Create For loop to generate numbers\n //Convert int affirmation to string value\n\n if (answer == 1)\n {\n for (int i = 0; i <= 2; i++)\n {\n double j = (Math.random() *10);\n int k = (int) j;\n System.out.print(\"[\"+k+\"]\");\n }\n }\n\n else\n {\n System.out.println(\"Maybe next time!\");\n\n }\n }", "private void fillQuestionsTable() {\n Question q1 = new Question(\"Who is NOT a Master on the Jedi council?\", \"Anakin Skywalker\", \"Obi Wan Kenobi\", \"Mace Windu\", \"Yoda\", 1);\n Question q2 = new Question(\"Who was Anakin Skywalker's padawan?\", \"Kit Fisto\", \"Ashoka Tano\", \"Barris Ofee\", \"Jacen Solo\",2);\n Question q3 = new Question(\"What Separatist leader liked to make find additions to his collection?\", \"Pong Krell\", \"Count Dooku\", \"General Grevious\", \"Darth Bane\", 3);\n Question q4 = new Question(\"Choose the correct Response:\\n Hello There!\", \"General Kenobi!\", \"You are a bold one!\", \"You never should have come here!\", \"You turned her against me!\", 1);\n Question q5 = new Question(\"What ancient combat technique did Master Obi Wan Kenobi use to his advantage throughout the Clone Wars?\", \"Kendo arts\", \"The High ground\", \"Lightsaber Form VIII\", \"Force healing\", 2);\n Question q6 = new Question(\"What was the only surviving member of Domino squad?\", \"Fives\", \"Heavy\", \"Echo\", \"Jesse\", 3);\n Question q7 = new Question(\"What Jedi brutally murdered children as a part of his descent to become a Sith?\", \"Quinlan Vos\", \"Plo Koon\", \"Kit Fisto\", \"Anakin Skywalker\", 4);\n Question q8 = new Question(\"What Sith was the first to reveal himself to the Jedi after a millenia and was subsquently cut in half shortly after?\", \"Darth Plagieus\", \"Darth Maul\", \"Darth Bane\", \"Darth Cadeus\", 2);\n Question q9 = new Question(\"What 4 armed creature operates a diner on the upper levels of Coruscant?\", \"Dexter Jettster\", \"Cad Bane\", \"Aurua Sing\", \"Dorme Amidala\", 1);\n Question q10 = new Question(\"What ruler fell in love with an underage boy and subsequently married him once he became a Jedi?\", \"Aurua Sing\", \"Duttchess Satine\", \"Mara Jade\", \"Padme Amidala\", 4);\n\n // adds them to the list\n addQuestion(q1);\n addQuestion(q2);\n addQuestion(q3);\n addQuestion(q4);\n addQuestion(q5);\n addQuestion(q6);\n addQuestion(q7);\n addQuestion(q8);\n addQuestion(q9);\n addQuestion(q10);\n }", "@Test\n public void shouldNotGiveQuestionIfAllQuestionsHaveBeenAnswered() {\n attributes.put(FinancialPlanningSpeechlet.GOAL_AMOUNT_KEY, 1000.0);\n attributes.put(FinancialPlanningSpeechlet.MONTHLY_CONTRIBUTION_KEY, 1000.0);\n attributes.put(FinancialPlanningSpeechlet.GOAL_PERIOD_KEY, 1000.0);\n String question = NextQuestionFactory.get(session);\n\n assertThat(question, Is.is(\"\"));\n }", "private void setquestion() {\n qinit();\n question_count++;\n\n if (modeflag == 3) {\n modetag = (int) (Math.random() * 3);\n } else {\n modetag = modeflag;\n }\n\n WordingIO trueword = new WordingIO(vocabulary);\n\n if (modetag == 0) {\n\n MCmode(trueword);\n }\n\n if (modetag == 1) {\n BFmode(trueword);\n }\n\n if (modetag == 2) {\n TLmode(trueword);\n }\n\n if (time_limit != 0) {\n timingtoanswer(time_limit, jLabel2, answer_temp, jLabel5, jLabel6, jButton1);\n }\n }", "public static void Random() {\n\t\tRandom ran =new Random();\r\n\t\trandom=ran.nextInt(6)+1;\r\n\t\t//random=1;\r\n\t\twho=A1063307_GUI.who2;\r\n\t\tif((ch[who].status)>0) {\r\n\t\t\tch[who].location=(ch[who].location)+random;\r\n\t\t\tch[who].status=(ch[who].status)-1;\r\n\t\t\t\r\n\t\t}else {\r\n\t\t\t\treturn;\r\n\t\t\t}\t\t\r\n\t}", "public final static int pointsToAdd(TemporaryChar temp)\n\t{\n\t\tint randomIndex;\n\t\tchar charAnswer;\n\t\tint intAnswer;\n\t\tif (temp.symbol == GameConstants.easyQuestionsSymbol)\n\t\t{\n\t\t\trandomIndex=Global.rand.nextInt(Database.EASYQUESTIONS.length);\n\t\t\twhile (Database.EASYQUESTIONS[randomIndex].haveBeenUsed() == true)\n\t\t\t{\n\t\t\t\trandomIndex = Global.rand.nextInt(Database.EASYQUESTIONS.length);\n\t\t\t}\n\t\t\tSystem.out.println(Database.EASYQUESTIONS[randomIndex].toString());\n\t\t\tDatabase.EASYQUESTIONS[randomIndex].setToUsed();\n\t\t\tcharAnswer=Global.sc.next(\".\").charAt(0);\n\t\t\tif (Database.EASYQUESTIONS[randomIndex].isTrue(charAnswer))\n\t\t\t{\n\t\t\t\treturn GameConstants.easyQuestionsPoints;\n\t\t\t}\n\t\t}\n\n\t\tif (temp.symbol == GameConstants.mediumQuestionsSymbol)\n\t\t{\n\t\t\trandomIndex=Global.rand.nextInt(Database.MEDIUMQUESTIONS.length);\n\t\t\twhile (Database.MEDIUMQUESTIONS[randomIndex].haveBeenUsed() == true)\n\t\t\t{\n\t\t\t\trandomIndex = Global.rand.nextInt(Database.MEDIUMQUESTIONS.length);\n\t\t\t}\n\t\t\tSystem.out.println(Database.MEDIUMQUESTIONS[randomIndex].toString());\n\t\t\tDatabase.MEDIUMQUESTIONS[randomIndex].setToUsed();\n\t\t\tcharAnswer=Global.sc.next(\".\").charAt(0);\n\t\t\tif (Database.MEDIUMQUESTIONS[randomIndex].isTrue(charAnswer))\n\t\t\t{\n\t\t\t\treturn GameConstants.mediumQuestionsPoints;\n\t\t\t}\n\t\t}\n\n\n\t\tif (temp.symbol == GameConstants.hardQuestionsSymbol)\n\t\t{\n\n\t\t\trandomIndex=Global.rand.nextInt(Database.HARDQUESTIONS.length);\n\t\t\twhile (Database.HARDQUESTIONS[randomIndex].haveBeenUsed() == true)\n\t\t\t{\n\t\t\t\trandomIndex = Global.rand.nextInt(Database.HARDQUESTIONS.length);\n\t\t\t}\n\t\t\tSystem.out.println(\"Please enter an integer: \");\n\t\t\tSystem.out.println(Database.HARDQUESTIONS[randomIndex].toString());\n\t\t\tDatabase.HARDQUESTIONS[randomIndex].setToUsed();\n\t\t\tintAnswer=Global.sc.nextInt();\n\t\t\tif (Database.HARDQUESTIONS[randomIndex].isTrue(intAnswer))\n\t\t\t{\n\t\t\t\treturn GameConstants.hardQuestionsPoints;\n\t\t\t}\n\t\t\t/**\n\t\t\t * If the answer is wrong checks if it is at least 10% close to the real answer. \n\t\t\t * */\n\t\t\telse \n\t\t\t{\n\t\t\t\tif (Database.HARDQUESTIONS[randomIndex].isCloseToAnswer(intAnswer))\n\t\t\t\t{\n\t\t\t\t\treturn GameConstants.hardQuestionsNotFullPoints;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\n\n\n\n\n\t}", "private double getRandom() {\n return 2*Math.random() - 1;\n }", "void gatherInfoBeforePopulating (){\n\t\t\n\t\tcategoryId = Trivia_Game.getCategoryIdInMainMenu();\n\n\t \t //Loop until a valid questionId that hasn't been used is obtained\n\t \t\twhile (validQuestionNumber == false){\n\t \t\t\trandomValue0to29 = RandomGenerator0To29();\n\t \t\t\tSystem.out.println(\"random30 in onClick = \" + randomValue0to29);\n\n\t \t\t alreadyDisplayQuestion = questionsAlreadyDisplayed (randomValue0to29);\n\t \t\t if (alreadyDisplayQuestion == true){\n\t \t\t\t System.out.println(\"question number already displayed looking for a non displayed question\");\n\t \t\t }\n\t \t\t if (alreadyDisplayQuestion == false){\n\t \t\t\t System.out.println(\"question not displayed yet\");\n\t \t\t\t validQuestionNumber = true;\n\t \t\t }\n\t \t }\n\t \t \n\t \t validQuestionNumber = false;\n\t \t alreadyDisplayQuestion = false;\n\t \t questionId = randomValue0to29;\t//sets the valid random generated number to the questionID\n\t \t \n\t \t //connect to database to gather the question and answers\n\t \t getInfoFromDatabase(categoryId, questionId);\n \t\n\t \t //Calls random number from 0 to 3 to determine which button will display the correct answer\n\t \t randomValueZeroToThree = RandomGeneratorZeroToThree();\n\t \t System.out.println(\"random4 in onClick = \" + randomValueZeroToThree);\n\t \t \n\t \t //Sets the order according to the button that is to display the correct answer\n\t \t switch (randomValueZeroToThree){\n\t \t \tcase 0:\n\t \t \t\tdisplayedAnswer1FromDatabase = answer1FromDatabase;\t//correct answer\n\t \t \t\tdisplayedAnswer2FromDatabase = answer2FromDatabase;\n\t \t \t\tdisplayedAnswer3FromDatabase = answer3FromDatabase;\n\t \t \t\tdisplayedAnswer4FromDatabase = answer4FromDatabase;\n\t \t \t\trightButton1 = true;\n\t \t \t\trightButton2 = false;\n\t \t \t\trightButton3 = false;\n\t \t \t\trightButton4 = false;\n\t \t \t\tbreak;\n\t \t \t\t\n\t \t \tcase 1:\n\t \t \t\tdisplayedAnswer2FromDatabase = answer1FromDatabase;\t//correct answer\n\t \t \t\tdisplayedAnswer1FromDatabase = answer2FromDatabase;\n\t \t \t\tdisplayedAnswer3FromDatabase = answer3FromDatabase;\n\t \t \t\tdisplayedAnswer4FromDatabase = answer4FromDatabase;\n\t \t \t\trightButton1 = false;\n\t \t \t\trightButton2 = true;\n\t \t \t\trightButton3 = false;\n\t \t \t\trightButton4 = false;\n\t \t \t\tbreak;\n\t \t \t\n\t \t \tcase 2:\n\t \t \t\tdisplayedAnswer3FromDatabase = answer1FromDatabase;\t//correct answer\n\t \t \t\tdisplayedAnswer1FromDatabase = answer2FromDatabase;\n\t \t \t\tdisplayedAnswer2FromDatabase = answer3FromDatabase;\n\t \t \t\tdisplayedAnswer4FromDatabase = answer4FromDatabase;\n\t \t \t\trightButton1 = false;\n\t \t \t\trightButton2 = false;\n\t \t \t\trightButton3 = true;\n\t \t \t\trightButton4 = false;\n\t \t \t\tbreak;\n\t \t \t\t\n\t \t \tcase 3:\n\t \t \t\tdisplayedAnswer4FromDatabase = answer1FromDatabase;\t//correct answer\n\t \t \t\tdisplayedAnswer1FromDatabase = answer2FromDatabase;\n\t \t \t\tdisplayedAnswer3FromDatabase = answer3FromDatabase;\n\t \t \t\tdisplayedAnswer2FromDatabase = answer4FromDatabase;\n\t \t \t\trightButton1 = false;\n\t \t \t\trightButton2 = false;\n\t \t \t\trightButton3 = false;\n\t \t \t\trightButton4 = true;\n\t \t \t\tbreak;\n\t \t \t\n\t \t \tdefault: \n\t \t \t\tdisplayedAnswer1FromDatabase = answer4FromDatabase;\t//no correct answer\n\t \t \t\tdisplayedAnswer2FromDatabase = answer2FromDatabase;\n\t \t \t\tdisplayedAnswer3FromDatabase = answer3FromDatabase;\n\t \t \t\tdisplayedAnswer4FromDatabase = answer1FromDatabase;\t\n\t \t \t\trightButton1 = false;\n\t \t \t\trightButton2 = false;\n\t \t \t\trightButton3 = false;\n\t \t \t\trightButton4 = false;\n\t \t \t\t\n \t }\n\t \n\t // After the 9th question is displayed, the nextOfFinishValue should be set to 1 so the button displayes Finish instead of Next\n \t if (numberOfQuestionsDisplayedCounter < 9){\n\t \t\t\tnextOrFinishValue = 0;\n\t \t\t}\n\t \t\telse{\n\t \t\t\tnextOrFinishValue = 1;\n\t \t\t}\n\t\t\n\t}", "public void randomlySetAllQR() {\n\t\tfor (int q = -3; q <=3; q++) {\r\n\t\t\tfor (int r = -3; r <=3; r++) {\r\n\t\t\t\tsetHexFromQR(q,r, new HexModel(HexModel.TileType.DesertTile));\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public float randomQual() {\n\t\treturn((float) getRandomInteger(30,250));\n\t}", "private void updateQuestion()//update the question each time\n\t{\n\t\tInteger num = random.nextInt(20);\n\t\tcurrentAminoAcid = FULL_NAMES[num];\n\t\tcurrentShortAA= SHORT_NAMES[num];\n\t\tquestionField.setText(\"What is the ONE letter name for:\");\n\t\taminoacid.setText(currentAminoAcid);\n\t\tanswerField.setText(\"\");\n\t\tvalidate();\n\t}", "Question getQuest(String topic){\r\n\t\thasQ = false;\r\n\t\twhile(!hasQ){\r\n\t\t\trandNo = rand.nextInt(bank.get(topic).size());\r\n\t\t\tif(!bank.get(topic).get(randNo).getAsked()){\r\n\t\t\t\tbank.get(topic).get(randNo).setAsked(true);\r\n\t\t\t\treturn bank.get(topic).get(randNo);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public void loadQuestion() {\r\n\r\n //getting the number of the question stored in variable r\r\n //making sure that a question is not loaded up if the count exceeds the number of total questions\r\n if(count <NUMBER_OF_QUESTIONS) {\r\n int r = numberHolder.get(count);\r\n //creating object that will access the QuestionStore class and retrieve values and passing the value of the random question number to the class\r\n QuestionStore qs = new QuestionStore(r);\r\n //calling methods in order to fill up question text and mutliple choices and load the answer\r\n qs.storeQuestions();\r\n qs.storeChoices();\r\n qs.storeAnswers();\r\n //setting the question and multiple choices\r\n\r\n q.setText(qs.getQuestion());\r\n c1.setText(qs.getChoice1());\r\n c2.setText(qs.getChoice2());\r\n c3.setText(qs.getChoice3());\r\n answer = qs.getAnswer();\r\n }\r\n else{\r\n endGame();\r\n }\r\n\r\n\r\n\r\n\r\n }", "public int askquestion(int J, int M, int X, int Y){\n\t\t//type of 5 shall result questions that are a randomly mixture of addition, multiplication, subtraction, and division problems\n\t\tif(M == 5) {\n\t\t\tM = 1 + rand.nextInt(4);\n\t\t}\n\t\t\t\t\n\t\t\t\t\tswitch (M) {\n\t\t\t\t\t//type of 1 shall limit the program to generating only addition problems\n\t\t case 1: System.out.println(\"Solve this addition problem:\\n\");\n\t\t\t\t\t\t\tSystem.out.println(\"How much is \" + X + \" plus \" + Y + \" equal\");\n\t\t\t\t\t\t\t M = X+Y;\n\t\t break;\n\t\t // type 2 shall limit the program to generating only multiplication problems.\n\t\t case 2: System.out.println(\"Solve this multiplication problem:\\n\");\n\t\t\t\t\t\t\tSystem.out.println(\"How much is \" + X + \" times \" + Y + \" equal\");\n\t\t\t\t\t\t\tM = X*Y;\n\t\t break;\n\t\t //type of 3 shall limit the program to generating only subtraction problems\n\t\t case 3: System.out.println(\"Solve this subtraction problem:\\n\");\n\t\t\t\t\t\t\tSystem.out.println(\"How much is \" + X + \" minus \" + Y + \" equal\");\n\t\t\t\t\t\t\tM = X-Y;\n\t\t break;\n\t\t // type of 4 shall limit the program to generating only division problems\n\t\t case 4: System.out.println(\"Solve this division problem:\\n\");\n\t\t\t\t\t\t\tSystem.out.println(\"How much is \" + X + \" divided by \" + Y + \" equal\");\n\t\t\t\t\t\t\tM = 0;\n\t\t break;}\n\t\t return M;\n\t\t\t\t}", "public int getRandomY() {\r\n\t\treturn y1;\r\n\t}", "public void shuffle () {\n this.lives = 6;\n this.attempts.clear();\n this.victory = false;\n this.lose = false;\n Random r = new Random ();\n this._word = _dictionary[r.nextInt(_dictionary.length)];\n // this._word = _dictionary[2]; // Testing purposes\n this.hint.setLength(0);\n for (int i = 0; i < _word.length(); i++) {\n this.hint.append(\"_ \");\n } \n }", "public void random(){\r\n\t\tRandom rand = new Random();\r\n\t\trandArray = new int[6];\r\n\t\tfor (int i = 0; i < 6; i++){\r\n\t\t\t//Randomly generated number from zero to nine\r\n\t\t\trandom = rand.nextInt(10);\r\n\t\t\t//Random values stored into the array\r\n\t\t\trandArray[i] = random;\r\n\t\t\tif(i == 0){\r\n\t\t\t\ta = random;\r\n\t\t\t}\r\n\t\t\tif(i == 1){\r\n\t\t\t\tb = random;\r\n\t\t\t}\r\n\t\t\tif(i == 2){\r\n\t\t\t\tc = random;\r\n\t\t\t}\r\n\t\t\tif(i == 3){\r\n\t\t\t\td = random;\r\n\t\t\t}\r\n\t\t\tif(i == 4){\r\n\t\t\t\tf = random;\r\n\t\t\t}\r\n\t\t\tif(i == 5){\r\n\t\t\t\tg = random;\r\n\t\t\t}\r\n\t\t\t//Random values outputted\r\n\t\t\t//Prints out if the hint was not used.\r\n\t\t\tif (executed == false || guessed == true ){\r\n\t\t\t\tprint(randArray[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Prints out if the hint was not used.\r\n\t\tif (executed == false || guessed == true){\r\n\t\t\tprintln(\" Randomly Generated Value\");\r\n\t\t}\r\n\t}", "Point getRandomPoint() {\n\t\t\t\t\tdouble val = Math.random() * 3;\n\t\t\t\t\tif (val >=0.0 && val <1.0)\n\t\t\t\t\t\treturn p1;\n\t\t\t\t\telse if (val >=1.0 && val <2.0)\n\t\t\t\t\t\t\treturn p2;\n\t\t\t\t\telse\n\t\t\t\t\t\t\treturn p3;\n\t\t\t\t\t}", "private Question setUpQuestion(List<Question> questionsList){\n int indexOfQuestion = random.nextInt(questionsList.size());\n questionToBeHandled = questionsList.get(indexOfQuestion);\n questionsList.remove(indexOfQuestion);\n return questionToBeHandled;\n }", "private void evaluateQuestions() {\n RadioGroup groupTwo = findViewById(R.id.radioGroupQ2);\n int groupTwoId = groupTwo.getCheckedRadioButtonId();\n\n // Get the ID of radio group 6 to ascertain if a radio button has been ticked\n RadioGroup groupSix = findViewById(R.id.radioGroupQ6);\n int groupSixId = groupSix.getCheckedRadioButtonId();\n\n // Get the ID of radio group 7 to ascertain if a radio button has been ticked\n RadioGroup groupSeven = findViewById(R.id.radioGroupQ7);\n int groupSevenId = groupSeven.getCheckedRadioButtonId();\n\n // Taking in the vale of any question that has been checked in question 3 and storing it\n CheckBox question3Option1 = findViewById(R.id.question_three_option1);\n boolean stateOfQuestion3_option1 = question3Option1.isChecked();\n CheckBox question3Option2 = findViewById(R.id.question_three_option2);\n boolean stateOfQuestion3Option2 = question3Option2.isChecked();\n CheckBox question3Option3 = findViewById(R.id.question_three_option3);\n boolean stateOfQuestion3Option3 = question3Option3.isChecked();\n CheckBox question3Option4 = findViewById(R.id.question_three_option4);\n boolean stateOfQuestion3Option4 = question3Option4.isChecked();\n\n // Taking in the value of any question that has been checked in question 4 and storing it\n CheckBox question4Option1 = findViewById(R.id.question_four_option1);\n boolean stateOfQuestion4Option1 = question4Option1.isChecked();\n CheckBox question4Option2 = findViewById(R.id.question_four_option2);\n boolean stateOfQuestion4Option2 = question4Option2.isChecked();\n CheckBox question4Option3 = findViewById(R.id.question_four_option3);\n boolean stateOfQuestion4Option3 = question4Option3.isChecked();\n CheckBox question4Option4 = findViewById(R.id.question_four_option4);\n boolean stateOfQuestion4Option4 = question4Option4.isChecked();\n\n // Taking in the vale of any question that has been checked in question 8 and storing it\n CheckBox question8Option1 = findViewById(R.id.question_eight_option1);\n boolean stateOfQuestion8Option1 = question8Option1.isChecked();\n CheckBox question8Option2 = findViewById(R.id.question_eight_option2);\n boolean stateOfQuestion8Option2 = question8Option2.isChecked();\n CheckBox question8Option3 = findViewById(R.id.question_eight_option3);\n boolean stateOfQuestion8Option3 = question8Option3.isChecked();\n CheckBox question8Option4 = findViewById(R.id.question_eight_option4);\n boolean stateOfQuestion8Option4 = question8Option4.isChecked();\n\n // Getting all EditText fields\n\n EditText questText1 = findViewById(R.id.question_one_field);\n String question1 = questText1.getText().toString();\n\n\n EditText questText5 = findViewById(R.id.question_five_field);\n String question5 = questText5.getText().toString();\n\n EditText questText9 = findViewById(R.id.question_nine_field);\n String question9 = questText9.getText().toString();\n\n // Variable parameters for calculateRadiobutton method\n\n RadioButton quest2_opt3 = findViewById(R.id.question_two_option3);\n boolean question2_option3 = quest2_opt3.isChecked();\n\n RadioButton quest6_opt1 = findViewById(R.id.question_six_option2);\n boolean question6_option2= quest6_opt1.isChecked();\n\n RadioButton quest7_opt1 = findViewById(R.id.question_seven_option1);\n boolean question7_option1 = quest7_opt1.isChecked();\n\n // Store all checked parameter to ascertain that at least one option was ticked in\n // question 3\n boolean question3 = stateOfQuestion3_option1 || stateOfQuestion3Option2 ||\n stateOfQuestion3Option3 || stateOfQuestion3Option4;\n\n\n // Store all checked parameter to ascertain that at least one option was ticked in\n // question 4\n boolean question4 = stateOfQuestion4Option1 || stateOfQuestion4Option2 || stateOfQuestion4Option3 ||\n stateOfQuestion4Option4;\n\n\n // Store all checked parameter to ascertain that at least one option was ticked in\n // question 8\n boolean question8 = stateOfQuestion8Option1 || stateOfQuestion8Option2 ||\n stateOfQuestion8Option3 || stateOfQuestion8Option4;\n\n // if no radio button has been checked in radio group 2 after submit button has been clicked\n if ( groupTwoId == -1) {\n Toast.makeText(this, \"Please pick an answer in question 2\",\n Toast.LENGTH_SHORT).show();\n }\n\n // if no radio button has been clicked in radio group 6 after submit button has been clicked\n else if (groupSixId == -1) {\n Toast.makeText(this, \"Please pick an answer to question 6\",\n Toast.LENGTH_SHORT).show();\n }\n\n // if no radio button has been clicked in radio group 7 after submit button has been clicked\n else if (groupSevenId == -1) {\n Toast.makeText(this, \"Please pick an answer to question 7\",\n Toast.LENGTH_SHORT).show();\n }\n\n // if no checkbox was clicked in question 3 after submit button has been clicked\n else if (!question3) {\n Toast.makeText(this, \"Please select an answer to question 3\",\n Toast.LENGTH_SHORT).show();\n }\n\n // if no checkbox was clicked in question 4 after submit button has been clicked\n else if (!question4) {\n Toast.makeText(this, \"Please select an answer to question 4\",\n Toast.LENGTH_SHORT).show();\n\n }\n\n // if no checkbox was clicked in question 8 after submit button has been clicked\n else if (!question8) {\n Toast.makeText(this, \"Please select an answer to question 8\",\n Toast.LENGTH_SHORT).show();\n }\n\n // check if the questions has been answered without hitting the reset button\n else if (checkSubmit > 0) {\n Toast.makeText(this, \"Press the reset button\",\n Toast.LENGTH_SHORT).show();\n } else {\n //Add one to checkSubmit variable to avoid the score from being recalculated and added to\n // the previous score if the submit button was pressed more than once.\n checkSubmit += 1;\n\n // calculate all checkboxes by calling calculateCheckboxes method\n calculateScoreForCheckBoxes( stateOfQuestion3_option1, stateOfQuestion3Option3,stateOfQuestion3Option4,\n stateOfQuestion4Option1, stateOfQuestion4Option2, stateOfQuestion4Option4,\n stateOfQuestion8Option1, stateOfQuestion8Option3);\n\n // calculate all radio buttons by calling calculateRadioButtons method\n calculateScoreForRadioButtons(question2_option3, question6_option2, question7_option1);\n\n // calculate all Text inputs by calling editTextAnswers method\n calculateScoreForEditTextAnswers(question1,question5, question9);\n\n displayScore(score);\n\n String grade;\n\n if (score < 10) {\n grade = \"Meh...\";\n } else if (score >=10 && score <=14) {\n grade = \"Average\";\n } else if ((score >= 15) && (19 >= score)) {\n grade = \"Impressive!\";\n } else {\n grade = \"Excellent!\";\n }\n\n // Display a toast message to show total score\n Toast.makeText(this, grade + \" your score is \" + score + \"\",\n Toast.LENGTH_SHORT).show();\n }\n }", "public int[] pick() {\n int key = map.ceilingKey(random.nextInt(areaSum) + 1);\n int[] rectangle = map.get(key);\n\n int length = rectangle[2] - rectangle[0] + 1;\n int breadth = rectangle[3] - rectangle[1] + 1;\n\n //length denotes the no of x coordinates we can have.\n //breadth denotes the no of y coordinates we can have\n\n //random.nextInt gives a random value from x1 - x2-1 which we can add to the current x and we can have a valid x .\n //random.nextInt gives a random value from y1 - y2-1 which we can add to the current y and we can have a valid y .\n\n int x = rectangle[0] + random.nextInt(length);\n int y = rectangle[1] + random.nextInt(breadth);\n\n return new int[]{x, y};\n }", "int getWrongAnswers();", "private void fetchNewQuestion()\r\n\t{\r\n\t\t//Gets question and answers from model\r\n\t\tString[] question = quizModel.getNewQuestion();\r\n\t\t\r\n\t\t//Allocates answers to a new ArrayList then shuffles them randomly\r\n\t\tArrayList<String> answers = new ArrayList<String>();\r\n\t\tanswers.add(question[1]);\r\n\t\tanswers.add(question[2]);\r\n\t\tanswers.add(question[3]);\r\n\t\tanswers.add(question[4]);\r\n\t\tCollections.shuffle(answers);\r\n\t\t\r\n\t\t//Allocates north label to the question\r\n\t\tnorthLabel.setText(\"<html><div style='text-align: center;'>\" + question[0] + \"</div></html>\");\r\n\t\t\r\n\t\t//Allocates each radio button to a possible answer. Based on strings, so randomly generated questions...\r\n\t\t//...which by chance repeat a correct answer in two slots, either will award the user a point.\r\n\t\toption1.setText(answers.get(0));\r\n\t\toption2.setText(answers.get(1));\r\n\t\toption3.setText(answers.get(2));\r\n\t\toption4.setText(answers.get(3));\r\n\t\toption1.setActionCommand(answers.get(0));\r\n\t\toption2.setActionCommand(answers.get(1));\r\n\t\toption3.setActionCommand(answers.get(2));\r\n\t\toption4.setActionCommand(answers.get(3));\r\n\t\toption1.setSelected(true);\r\n\t\t\r\n\t\t//Update score\r\n\t\tscoreLabel.setText(\"<html><div style='text-align: center;'>\" + \"Score = \" + quizModel.getScore() + \"</div></html>\");\r\n\t}", "public String answerQuestions(int qNumber, Tile[] tile1, \n\t\t\t\t\t\t\t\tTile[] tile2, Tile[] tile3) {\n\t\t\n\t\tint sum = 0;\n\t\tint sumRack1 = 0;\n\t\tint sumRack2 = 0;\n\t\tint sumRack3 = 0;\n\t\tint answerSum = 0;\n\t\tString more = \"\";\n\t\tArrayList<Tile> allCards = new ArrayList<Tile>();\n\t\tint ySevens = 0;\n\t\tint gSixes = 0;\n\t\tint rSixes = 0;\n\t\tint blues = 0;\n\t\tint oranges = 0;\n\t\tint browns = 0;\n\t\tint reds = 0;\n\t\tint blacks = 0;\n\t\tint greens = 0;\n\t\tint yellows = 0;\n\t\t\n\t\t// question number that's being asked\n\t\tswitch(qNumber) {\n\t\t\n\t\tcase 1:\n\t\t\t\n\t\t\tfor(int i = 0; i < tile1.length; i++) {\n\t\t\t\tsumRack1 = sumRack1 + tile1[i].getNumber();\n\t\t\t}\n\t\t\tif(sumRack1 >= 18) {\n\t\t\t\tanswerSum++;\n\t\t\t}\n\t\t\t\n\t\t\tfor (int i = 0; i < tile2.length; i++) {\n\t\t\t\tsumRack2 = sumRack2 + tile2[i].getNumber();\n\t\t\t}\n\t\t\tif(sumRack2 >= 18) {\n\t\t\t\tanswerSum++;\n\t\t\t}\n\t\t\t\n\t\t\tfor (int i = 0; i < tile3.length; i++) {\n\t\t\t\tsumRack3 = sumRack3 + tile3[i].getNumber();\n\t\t\t}\n\t\t\tif(sumRack3 >= 18) {\n\t\t\t\tanswerSum++;\n\t\t\t}\n\t\t\tanswer = \"On \" + answerSum + \" racks\";\n\t\t\tbreak;\n\t\t\n\t\tcase 2:\n\t\t\t\n\t\t\tfor (int i = 0; i < tile1.length; i++) {\n\t\t\t\tsum = sum + tile1[i].getNumber();\n\t\t\t}\n\t\t\tif (sum <= 12) {\n\t\t\t\tanswerSum++;\n\t\t\t}\n\t\t\t\n\t\t\tsum = 0;\n\t\t\tfor (int i = 0; i < tile2.length; i++) {\n\t\t\t\tsum = sum + tile2[i].getNumber();\n\t\t\t}\n\t\t\tif (sum <= 12) {\n\t\t\t\tanswerSum++;\n\t\t\t}\n\t\t\t\n\t\t\tsum = 0;\n\t\t\tfor (int i = 0; i < tile2.length; i++) {\n\t\t\t\tsum = sum + tile2[i].getNumber();\n\t\t\t}\n\t\t\tif (sum <= 12) {\n\t\t\t\tanswerSum++;\n\t\t\t}\n\t\t\tanswer = \"On \" + answerSum + \" racks\";\n\t\t\tbreak;\n\t\t\n\t\tcase 3:\n\t\t\tboolean sameNumDiffColors = false;\n\t\t\tint rackCount = 0;\n\t\t\t\n\t\t\tArrayList<Tile> list1 = new ArrayList<Tile>();\n\t\t\tArrayList<Tile> list2 = new ArrayList<Tile>();\n\t\t\tArrayList<Tile> list3 = new ArrayList<Tile>();\n\t\t\tfor(int i = 0; i < tile1.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tlist1.add(tile1[i]);\n\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 3, tile1. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\ttry{\n\t\t\t\tif(((Tile) list1.get(0)).getNumber() == ((Tile) list1.get(1)).getNumber()) {\n\t\t\t\t\tif(((Tile) list1.get(0)).getColor() != ((Tile) list1.get(1)).getColor()) {\n\t\t\t\t\t\tsameNumDiffColors = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(((Tile) list1.get(0)).getNumber() == ((Tile) list1.get(2)).getNumber()) {\n\t\t\t\t\tif(((Tile) list1.get(0)).getColor() != ((Tile) list1.get(2)).getColor()) {\n\t\t\t\t\t\tsameNumDiffColors = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(((Tile) list1.get(2)).getNumber() == ((Tile) list1.get(1)).getNumber()) {\n\t\t\t\t\tif(((Tile) list1.get(2)).getColor() != ((Tile) list1.get(1)).getColor()) {\n\t\t\t\t\t\tsameNumDiffColors = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(sameNumDiffColors) {\n\t\t\t\t\trackCount++;\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tLog.d(\"Code777\", \"Player.java Case 3, Tile1 sameNumDiffColors.\");\n\t\t\t}\n\t\t\t\n\t\t\tsameNumDiffColors = false;\n\t\t\tfor(int i = 0; i < tile2.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tlist2.add(tile2[i]);\n\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 3, tile2. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\ttry{\n\t\t\t\tif(((Tile) list2.get(0)).getNumber() == ((Tile) list2.get(1)).getNumber()) {\n\t\t\t\t\tif(((Tile) list2.get(0)).getColor() != ((Tile) list2.get(1)).getColor()) {\n\t\t\t\t\t\tsameNumDiffColors = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(((Tile) list2.get(0)).getNumber() == ((Tile) list2.get(2)).getNumber()) {\n\t\t\t\t\tif(((Tile) list2.get(0)).getColor() != ((Tile) list2.get(2)).getColor()) {\n\t\t\t\t\t\tsameNumDiffColors = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(((Tile) list2.get(2)).getNumber() == ((Tile) list2.get(1)).getNumber()) {\n\t\t\t\t\tif(((Tile) list2.get(2)).getColor() != ((Tile) list2.get(1)).getColor()) {\n\t\t\t\t\t\tsameNumDiffColors = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(sameNumDiffColors) {\n\t\t\t\t\trackCount++;\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tLog.d(\"Code777\", \"Player.java Case 3, Tile1 sameNumDiffColors.\");\n\t\t\t}\n\t\t\t\n\t\t\tsameNumDiffColors = false;\n\t\t\tfor(int i = 0; i < tile3.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tlist3.add(tile3[i]);\n\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 3, tile3. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\ttry{\n\t\t\t\tif(((Tile) list3.get(0)).getNumber() == ((Tile) list3.get(1)).getNumber()) {\n\t\t\t\t\tif(((Tile) list3.get(0)).getColor() != ((Tile) list3.get(1)).getColor()) {\n\t\t\t\t\t\tsameNumDiffColors = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(((Tile) list3.get(0)).getNumber() == ((Tile) list3.get(2)).getNumber()) {\n\t\t\t\t\tif(((Tile) list3.get(0)).getColor() != ((Tile) list3.get(2)).getColor()) {\n\t\t\t\t\t\tsameNumDiffColors = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(((Tile) list3.get(2)).getNumber() == ((Tile) list3.get(1)).getNumber()) {\n\t\t\t\t\tif(((Tile) list3.get(2)).getColor() != ((Tile) list3.get(1)).getColor()) {\n\t\t\t\t\t\tsameNumDiffColors = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(sameNumDiffColors) {\n\t\t\t\t\trackCount++;\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tLog.d(\"Code777\", \"Player.java Case 3, Tile1 sameNumDiffColors.\");\n\t\t\t}\n\t\t\tanswer = \"On \" + rackCount + \" racks\";\n\t\t\tbreak;\n\t\t\n\t\tcase 4:\n\t\t\trackCount = 0;\n\t\t\tString[] arrayTileColor = new String[3];\n\t\t\ttry {\n\t\t\t\tarrayTileColor[0] = tile1[0].getColor();\n\t\t\t\tarrayTileColor[1] = tile1[1].getColor();\n\t\t\t\tarrayTileColor[2] = tile1[2].getColor();\n\t\t\t} catch (Exception e) {\n\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 4 tile1\");\n\t\t\t}\n\t\t\tif(!(arrayTileColor[0].equals(arrayTileColor[1])))\n\t\t\t\tif(!(arrayTileColor[0].equals(arrayTileColor[2])))\n\t\t\t\t\tif(!(arrayTileColor[1].equals(arrayTileColor[2])))\n\t\t\t\t\t\trackCount++;\n\t\t\t\t\t\t\n\t\t\ttry {\n\t\t\t\tarrayTileColor[0] = tile2[0].getColor();\n\t\t\t\tarrayTileColor[1] = tile2[1].getColor();\n\t\t\t\tarrayTileColor[2] = tile2[2].getColor();\n\t\t\t} catch (Exception e) {\n\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 4 tile2\");\n\t\t\t}\n\t\t\tif(!(arrayTileColor[0].equals(arrayTileColor[1])))\n\t\t\t\tif(!(arrayTileColor[0].equals(arrayTileColor[2])))\n\t\t\t\t\tif(!(arrayTileColor[1].equals(arrayTileColor[2])))\n\t\t\t\t\t\trackCount++;\n\t\t\t\n\t\t\ttry {\n\t\t\t\tarrayTileColor[0] = tile3[0].getColor();\n\t\t\t\tarrayTileColor[1] = tile3[1].getColor();\n\t\t\t\tarrayTileColor[2] = tile3[2].getColor();\n\t\t\t} catch (Exception e) {\n\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 4 tile3\");\n\t\t\t}\n\t\t\tif(!(arrayTileColor[0].equals(arrayTileColor[1])))\n\t\t\t\tif(!(arrayTileColor[0].equals(arrayTileColor[2])))\n\t\t\t\t\tif(!(arrayTileColor[1].equals(arrayTileColor[2])))\n\t\t\t\t\t\trackCount++;\n\t\t\t\n\t\t\tanswer = \"On \" + rackCount + \" racks\";\n\t\t\tbreak;\n\n\t\t\n\t\tcase 5:\n\t\t\tLog.d(\"Code777\", \"---Answer Question 5: \"+ qNumber);\n\t\t\tint[] modArray = new int[3];\n\t\t\tint numRacks = 0;\n\t\t\tfor(int i = 0; i < tile1.length; i++) {\n\t\t\t\tmodArray[i] = tile1[i].getNumber() % 2;\n\t\t\t}\n\t\t\tif((modArray[0] == modArray[1]) && (modArray[0] == modArray[2])) {\n\t\t\t\tnumRacks++;\n\t\t\t}\n\t\t\t\n\t\t\tfor(int i = 0; i < tile2.length; i++) {\n\t\t\t\tmodArray[i] = tile2[i].getNumber() % 2;\n\t\t\t}\n\t\t\tif((modArray[0] == modArray[1]) && (modArray[0] == modArray[2])) {\n\t\t\t\tnumRacks++;\n\t\t\t}\n\t\t\t\n\t\t\tfor(int i = 0; i < tile3.length; i++) {\n\t\t\t\tmodArray[i] = tile3[i].getNumber() % 2;\n\t\t\t}\n\t\t\tif((modArray[0] == modArray[1]) && (modArray[0] == modArray[2])) {\n\t\t\t\tnumRacks++;\n\t\t\t}\n\t\t\tanswer = \"On \" + numRacks + \" racks\";\t\n\t\t\tbreak;\n\n\t\t\t\n\t\tcase 6:\n\t\t\tint dupTiles = 0;\n\t\t\ttry {\n\t\t\t\tif(((tile1[0].getNumber() == tile1[1].getNumber()) && \n\t\t\t\t\t\t(tile1[0].getColor().equals(tile1[1].getColor()))\n\t\t\t\t\t\t|| ((tile1[0].getNumber() == tile1[2].getNumber()) \n\t\t\t\t\t\t\t\t&& (tile1[0].getColor().equals(tile1[2].getColor())))\n\t\t\t\t\t\t\t\t\t|| ((tile1[1].getNumber() == tile1[2].getNumber()) \n\t\t\t\t\t\t\t\t\t\t\t&& (tile1[1].getColor().equals(tile1[2].getColor())))))\n\t\t\t\t\t\t\t\t\t\t\t\t\tdupTiles++;\n\t\t\t\t\n\t\t\t} catch (Exception e) {\n\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 6, tile1. \");\n\t\t\t}\n\t\t\t\n\t\t\ttry {\n\t\t\t\tif(((tile2[0].getNumber() == tile2[1].getNumber()) && \n\t\t\t\t\t\t(tile2[0].getColor().equals(tile2[1].getColor()))\n\t\t\t\t\t\t|| ((tile2[0].getNumber() == tile2[2].getNumber()) \n\t\t\t\t\t\t\t\t&& (tile2[0].getColor().equals(tile2[2].getColor())))\n\t\t\t\t\t\t\t\t|| ((tile2[1].getNumber() == tile2[2].getNumber()) \n\t\t\t\t\t\t\t\t\t\t&& (tile2[1].getColor().equals(tile2[2].getColor()))))) \n\t\t\t\t\t\t\t\t\t\t\t\t\tdupTiles++;\n\t\t\t\t\n\t\t\t} catch (Exception e) {\n\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 6, tile2. \");\n\t\t\t}\n\t\t\t\n\t\t\ttry {\n\t\t\t\tif(((tile3[0].getNumber() == tile3[1].getNumber()) && \n\t\t\t\t\t\t(tile3[0].getColor().equals(tile3[1].getColor()))\n\t\t\t\t\t\t|| ((tile3[0].getNumber() == tile3[2].getNumber()) \n\t\t\t\t\t\t\t\t&& (tile3[0].getColor().equals(tile3[2].getColor())))\n\t\t\t\t\t\t\t\t\t|| ((tile3[1].getNumber() == tile3[2].getNumber()) \n\t\t\t\t\t\t\t\t\t\t&& (tile3[1].getColor().equals(tile3[2].getColor())))))\n\t\t\t\t\t\t\t\t\t\t\t\t\tdupTiles++;\n\t\t\t\t\n\t\t\t} catch (Exception e) {\n\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 9, tile3. \");\n\t\t\t}\n\t\t\tanswer = \"On \" + dupTiles + \" racks\";\n\t\t\tbreak;\n\n\t\t\n\t\tcase 7:\n\t\t\tint consecutive = 0;\n\t\t\t\n\t\t\tint[] numArray = new int[3];\n\t\t\ttry {\n\t\t\t\tnumArray[0] = tile1[0].getNumber();\n\t\t\t\tnumArray[1] = tile1[1].getNumber();\n\t\t\t\tnumArray[2] = tile1[2].getNumber();\n\t\t\t} catch (Exception e) {\n\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 7, tile1. \");\n\t\t\t}\n\t\t\t\n\t\t\tArrays.sort(numArray);\n\t\t\tif((numArray[2] - numArray[1]) == 1 )\n\t\t\t\tif((numArray[1] - numArray[0]) == 1)\n\t\t\t\t\tconsecutive++;\n\t\t\t\n\t\t\ttry {\n\t\t\t\tnumArray[0] = tile2[0].getNumber();\n\t\t\t\tnumArray[1] = tile2[1].getNumber();\n\t\t\t\tnumArray[2] = tile2[2].getNumber();\n\t\t\t} catch (Exception e) {\n\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 7, tile1. \");\n\t\t\t}\n\t\t\tArrays.sort(numArray);\n\t\t\tif((numArray[2] - numArray[1]) == 1 )\n\t\t\t\tif( (numArray[1] - numArray[0]) == 1)\n\t\t\t\t\tconsecutive++;\n\t\t\t\n\t\t\ttry {\n\t\t\t\tnumArray[0] = tile3[0].getNumber();\n\t\t\t\tnumArray[1] = tile3[1].getNumber();\n\t\t\t\tnumArray[2] = tile3[2].getNumber();\n\t\t\t} catch (Exception e) {\n\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 7, tile1. \");\n\t\t\t}\n\t\t\tArrays.sort(numArray);\n\t\t\tif((numArray[2] - numArray[1]) == 1) \n\t\t\t\tif( (numArray[1] - numArray[0]) == 1)\n\t\t\t\t\tconsecutive++;\n\t\t\n\t\t\tanswer = \"On \" + consecutive + \" racks\";\n\t\t\tbreak;\n\n\t\t\n\t\tcase 8:\n\t\t\tSet<String> tileList = new HashSet<String>();\n\t\t\tint uniqueColors = 0;\n\t\t\tfor(int i = 0; i < tile1.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\ttileList.add(tile1[i].getColor());\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 8, tile1. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfor(int i = 0; i < tile2.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\ttileList.add(tile2[i].getColor());\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 9, tile2. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfor(int i = 0; i < tile3.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\ttileList.add(tile3[i].getColor());\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 9, tile3. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tuniqueColors = tileList.size();\n\t\t\tanswer = \"I see \" + uniqueColors + \" colors\";\n\t\t\tbreak;\n\n\t\t\t\n\t\tcase 9:\n\t\t\tArrayList<String> allColors = new ArrayList<String>();\n\t\t\tint greenCount = 0;\n\t\t\tint yellowCount = 0;\n\t\t\tint blackCount = 0;\n\t\t\tint brownCount = 0;\n\t\t\tint orangeCount = 0;\n\t\t\tint pinkCount = 0;\n\t\t\tint blueCount = 0;\n\t\t\tint count = 0;\n\t\t\t\n\t\t\tfor(int i = 0; i < tile1.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallColors.add(tile1[i].getColor());\n\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 9, tile1. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile2.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallColors.add(tile2[i].getColor());\n\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 9, tile2. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile3.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallColors.add(tile3[i].getColor());\n\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 9, tile3. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfor(int i = 0; i < allColors.size(); i++) {\n\t\t\t\tif(allColors.get(i).equals(\"green\")) {\n\t\t\t\t\tgreenCount++;\n\t\t\t\t}\n\t\t\t\tif(allColors.get(i).equals(\"yellow\")) {\n\t\t\t\t\tyellowCount++;\n\t\t\t\t}\n\t\t\t\tif(allColors.get(i).equals(\"black\")) {\n\t\t\t\t\tblackCount++;\n\t\t\t\t}\n\t\t\t\tif(allColors.get(i).equals(\"brown\")) {\n\t\t\t\t\tbrownCount++;\n\t\t\t\t}\n\t\t\t\tif(allColors.get(i).equals(\"orange\")) {\n\t\t\t\t\torangeCount++;\n\t\t\t\t}\n\t\t\t\tif(allColors.get(i).equals(\"red\")) {\n\t\t\t\t\tpinkCount++;\n\t\t\t\t}\n\t\t\t\tif(allColors.get(i).equals(\"blue\")) {\n\t\t\t\t\tblueCount++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (greenCount >= 3) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\tif (yellowCount >= 3) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\tif (blackCount >= 3) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\tif (brownCount >= 3) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\tif (orangeCount >= 3) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\tif (pinkCount >= 3) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\tif (blueCount >= 3) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\tanswer = \"\" + count + \" colors\";\n\t\t\tbreak;\n\n\t\t\n\t\tcase 10:\n\t\t\tint totalNums = 7;\n\t\t\tint uniqueNumsPresent = 0;\n\t\t\tint numsMissing = 0;\n\t\t\tSet<Integer> presentNums = new HashSet<Integer>();\n\t\t\tfor(int i = 0; i < tile1.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tpresentNums.add(tile1[i].getNumber());\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 10, tile1. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile2.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tpresentNums.add(tile2[i].getNumber());\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 10, tile2. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile3.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tpresentNums.add(tile3[i].getNumber());\n\t\t\t\t} catch (Exception e ) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 10, tile3. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tuniqueNumsPresent = presentNums.size();\n\t\t\tnumsMissing = totalNums - uniqueNumsPresent;\n\t\t\tanswer = \"\" + numsMissing + \" numbers are missing\";\n\t\t\tbreak;\n\n\t\t\n\t\tcase 11:\n\t\t\tArrayList<Tile> allTiles = new ArrayList<Tile>();\n\t\t\tint cardsISee = 0;\n\t\t\t\n\t\t\tfor(int i = 0; i < tile1.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallTiles.add(tile1[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 11, tile1. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile2.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallTiles.add(tile2[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 11, tile2. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile3.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallTiles.add(tile3[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 11, tile3. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < allTiles.size(); i++) {\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile) allTiles.get(i)).getNumber() == 1) &&\n\t\t\t\t\t\t\t(((Tile)allTiles.get(i)).getColor().equals(\"green\"))){\n\t\t\t\t\t\tcardsISee++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 11, tile1, getNumber(). \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile) allTiles.get(i)).getNumber() == 5) &&\n\t\t\t\t\t\t\t(((Tile)allTiles.get(i)).getColor().equals(\"black\"))){\n\t\t\t\t\t\tcardsISee++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 11, tile2, getNumber(). \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile) allTiles.get(i)).getNumber() == 7) &&\n\t\t\t\t\t\t\t(((Tile)allTiles.get(i)).getColor().equals(\"red\"))){\n\t\t\t\t\t\tcardsISee++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 11, tile3, getNumber() \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tanswer = \"\" + cardsISee;\n\t\t\tbreak;\n\n\t\t\t\n\t\tcase 12:\n\t\t\tint threes = 0;\n\t\t\tfor(int i = 0; i < tile1.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile1[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 12, tile1. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile2.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile2[i]);\n\t\t\t\t} catch (Exception e ) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 12, tile2. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile3.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile3[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 12, tile3. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < allCards.size(); i++) {\n\t\t\t\ttry {\n\t\t\t\t\tif(((Tile) allCards.get(i)).getNumber() == 3){\n\t\t\t\t\t\tthrees++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 12, getNumber()=3. \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile) allCards.get(i)).getNumber() == 6) &&\n\t\t\t\t\t\t\t(((Tile)allCards.get(i)).getColor().equals(\"red\"))){\n\t\t\t\t\t\trSixes++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 12, getNumber = 6. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(threes < rSixes) {\n\t\t\t\tmore = \"More Red 6s\";\n\t\t\t}\n\t\t\telse if(threes > rSixes) {\n\t\t\t\tmore = \"More 3s\";\n\t\t\t}\n\t\t\telse if(threes == rSixes) {\n\t\t\t\tmore = \"About the same\";\n\t\t\t}\n\t\t\tanswer = \"\" + more;\n\t\t\tbreak;\n\n\t\t\t\n\t\tcase 13:\n\n\t\t\tfor(int i = 0; i < tile1.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile1[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 13, tile1. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile2.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile2[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 13, tile2. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile3.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile3[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 13, tile3. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < allCards.size(); i++) {\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile) allCards.get(i)).getNumber() == 6) &&\n\t\t\t\t\t\t\t(((Tile)allCards.get(i)).getColor().equals(\"green\"))){\n\t\t\t\t\t\tgSixes++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 13, getNumber = 6. \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile) allCards.get(i)).getNumber() == 7) &&\n\t\t\t\t\t\t\t(((Tile)allCards.get(i)).getColor().equals(\"yellow\"))){\n\t\t\t\t\t\tySevens++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 13, getNumber = 7 \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(gSixes < ySevens) {\n\t\t\t\tmore = \"More Yellow 7s\";\n\t\t\t}\n\t\t\telse if(gSixes > ySevens) {\n\t\t\t\tmore = \"More Green 6s\";\n\t\t\t}\n\t\t\telse if(gSixes == ySevens) {\n\t\t\t\tmore = \"About the same\";\n\t\t\t}\n\t\t\tanswer = \"\" + more;\n\t\t\tbreak;\n\n\t\t\t\n\t\tcase 14:\n\t\t\tint yTwos = 0;\n\t\t\tfor(int i = 0; i < tile1.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile1[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 14, tile1. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile2.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile2[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 14, tile2. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile3.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile3[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 14, tile3. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < allCards.size(); i++) {\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile) allCards.get(i)).getNumber() == 2) &&\n\t\t\t\t\t\t\t(((Tile)allCards.get(i)).getColor().equals(\"yellow\"))){\n\t\t\t\t\t\tyTwos++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 14, getNumber = 2. \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile) allCards.get(i)).getNumber() == 7) &&\n\t\t\t\t\t\t\t(((Tile)allCards.get(i)).getColor().equals(\"yellow\"))){\n\t\t\t\t\t\tySevens++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 14, getNumber = 7. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(yTwos < ySevens) {\n\t\t\t\tmore = \"More Yellow 7s\";\n\t\t\t}\n\t\t\telse if(yTwos > ySevens) {\n\t\t\t\tmore = \"More Yellow 2s\";\n\t\t\t}\n\t\t\telse if(yTwos == ySevens) {\n\t\t\t\tmore = \"About the same\";\n\t\t\t}\n\t\t\tanswer = \"\" + more;\n\t\t\tbreak;\n\n\t\t\t\n\t\tcase 15:\n\n\t\t\tfor(int i = 0; i < tile1.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile1[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 15, tile1. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile2.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile2[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 15, tile2. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile3.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile3[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 15, tile3. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < allCards.size(); i++) {\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile) allCards.get(i)).getNumber() == 6) &&\n\t\t\t\t\t\t\t(((Tile)allCards.get(i)).getColor().equals(\"green\"))){\n\t\t\t\t\t\tgSixes++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 15, getColor = green. \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile) allCards.get(i)).getNumber() == 6) &&\n\t\t\t\t\t\t\t(((Tile)allCards.get(i)).getColor().equals(\"orange\"))){\n\t\t\t\t\t\trSixes++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 15, getColor = orange\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(gSixes < rSixes) {\n\t\t\t\tmore = \"More Orange 6s\";\n\t\t\t}\n\t\t\telse if(gSixes > rSixes) {\n\t\t\t\tmore = \"More Green 6s\";\n\t\t\t}\n\t\t\telse if(gSixes == rSixes) {\n\t\t\t\tmore = \"About the same\";\n\t\t\t}\n\t\t\tanswer = \"\" + more;\n\t\t\tbreak;\n\n\t\t\t\n\t\tcase 16:\n\t\t\tint oSevens = 0;\n\t\t\tint bSevens = 0;\n\t\t\tfor(int i = 0; i < tile1.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile1[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 16, tile1. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile2.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile2[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 16, tile2. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile3.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile3[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 17, tile3. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < allCards.size(); i++) {\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile) allCards.get(i)).getNumber() == 7) &&\n\t\t\t\t\t\t\t(((Tile)allCards.get(i)).getColor().equals(\"blue\"))){\n\t\t\t\t\t\tbSevens++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 16, getNumber = blue. \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tif(!(((Tile) allCards.get(i)).getNumber() == 7) &&\n\t\t\t\t\t\t\t(((Tile)allCards.get(i)).getColor().equals(\"blue\"))){\n\t\t\t\t\t\toSevens++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 16, getNumber = not blue. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(bSevens < oSevens) {\n\t\t\t\tmore = \"More 7s of Other Colors\";\n\t\t\t}\n\t\t\telse if(bSevens > oSevens) {\n\t\t\t\tmore = \"More Blue 7s\";\n\t\t\t}\n\t\t\telse if(bSevens == oSevens) {\n\t\t\t\tmore = \"About the same\";\n\t\t\t}\n\t\t\tanswer = \"\" + more;\n\t\t\tbreak;\n\n\t\t\t\n\t\tcase 17:\n\t\t\tfor(int i = 0; i < tile1.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile1[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 17, tile1. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile2.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile2[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 17, tile2. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile3.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile3[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 18, tile3. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < allCards.size(); i++) {\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile)allCards.get(i)).getColor().equals(\"brown\"))){\n\t\t\t\t\t\tbrowns++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 18, getColor=brown. \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile)allCards.get(i)).getColor().equals(\"blue\"))){\n\t\t\t\t\t\tblues++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 18, getColor=blue. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(browns < blues) {\n\t\t\t\tmore = \"More Blue Numbers\";\n\t\t\t}\n\t\t\telse if(browns > blues) {\n\t\t\t\tmore = \"More Brown Numbers\";\n\t\t\t}\n\t\t\telse if(browns == blues) {\n\t\t\t\tmore = \"About the same\";\n\t\t\t}\n\t\t\tanswer = \"\" + more;\n\t\t\tbreak;\n\n\t\t\t\n\t\tcase 18:\n\t\t\tfor(int i = 0; i < tile1.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile1[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 18, tile1. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile2.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile2[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 18, tile2. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile3.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile3[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 18, tile3. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < allCards.size(); i++) {\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile)allCards.get(i)).getColor().equals(\"red\"))){\n\t\t\t\t\t\treds++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 18, getColor=red. \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile)allCards.get(i)).getColor().equals(\"orange\"))){\n\t\t\t\t\t\toranges++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 18, getColor=orange. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(reds < oranges) {\n\t\t\t\tmore = \"More Orange Numbers\";\n\t\t\t}\n\t\t\telse if(reds > oranges) {\n\t\t\t\tmore = \"More Red Numbers\";\n\t\t\t}\n\t\t\telse if(reds == oranges) {\n\t\t\t\tmore = \"About the same\";\n\t\t\t}\n\t\t\tanswer = \"\" + more;\n\t\t\tbreak;\n\n\t\t\t\n\t\tcase 19:\n\t\t\tfor(int i = 0; i < tile1.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile1[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 19, tile1. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile2.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile2[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 19, tile2. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile3.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile3[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 19, tile3. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < allCards.size(); i++) {\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile)allCards.get(i)).getColor().equals(\"green\"))){\n\t\t\t\t\t\tgreens++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 19, getColor=green. \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile)allCards.get(i)).getColor().equals(\"blue\"))){\n\t\t\t\t\t\tblues++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 19, getColor=blue. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(greens < blues) {\n\t\t\t\tmore = \"More Blue Numbers\";\n\t\t\t}\n\t\t\telse if(greens > blues) {\n\t\t\t\tmore = \"More Green Numbers\";\n\t\t\t}\n\t\t\telse if(greens == blues) {\n\t\t\t\tmore = \"About the same\";\n\t\t\t}\n\t\t\tanswer = \"\" + more;\n\t\t\tbreak;\n\n\t\t\t\n\t\tcase 20:\n\t\t\tfor(int i = 0; i < tile1.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile1[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 20, tile1. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile2.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile2[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 20, tile2. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile3.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile3[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 20, tile3. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < allCards.size(); i++) {\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile)allCards.get(i)).getColor().equals(\"yellow\"))){\n\t\t\t\t\t\tyellows++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 20, getColor=yellow. \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile)allCards.get(i)).getColor().equals(\"orange\"))){\n\t\t\t\t\t\toranges++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 20, getColor=orange. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(yellows < oranges) {\n\t\t\t\tmore = \"More Orange Numbers\";\n\t\t\t}\n\t\t\telse if(yellows > oranges) {\n\t\t\t\tmore = \"More Yellow Numbers\";\n\t\t\t}\n\t\t\telse if(yellows == oranges) {\n\t\t\t\tmore = \"About the same\";\n\t\t\t}\n\t\t\tanswer = \"\" + more;\n\t\t\tbreak;\n\t\t\t\n\t\tcase 21:\n\t\t\tfor(int i = 0; i < tile1.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile1[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 21, tile1. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile2.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile2[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 21, tile2. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile3.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile3[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 21, tile3. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < allCards.size(); i++) {\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile)allCards.get(i)).getColor().equals(\"black\"))){\n\t\t\t\t\t\tblacks++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 21, getColor=black. \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile)allCards.get(i)).getColor().equals(\"brown\"))){\n\t\t\t\t\t\tbrowns++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 21, getColor=brown. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(blacks < browns) {\n\t\t\t\tmore = \"More Brown Numbers\";\n\t\t\t}\n\t\t\telse if(blacks > browns) {\n\t\t\t\tmore = \"More Black Numbers\";\n\t\t\t}\n\t\t\telse if(blacks == browns) {\n\t\t\t\tmore = \"About the same\";\n\t\t\t}\n\t\t\tanswer = \"\" + more;\n\t\t\tbreak;\n\n\t\t\t\n\t\tcase 22:\n\t\t\tallCards = new ArrayList<Tile>();\n\t\t\treds = 0;\n\t\t\tblacks = 0;\n\t\t\tmore = \"\";\n\t\t\tfor(int i = 0; i < tile1.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile1[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 22, tile1. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile2.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile2[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 22, tile2. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile3.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile3[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 22, tile3. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < allCards.size(); i++) {\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile)allCards.get(i)).getColor().equals(\"red\"))){\n\t\t\t\t\t\treds++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 22, getColor=red. \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile)allCards.get(i)).getColor().equals(\"black\"))){\n\t\t\t\t\t\tblacks++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 22, getColor=black. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(reds < blacks) {\n\t\t\t\tmore = \"More Black Numbers\";\n\t\t\t}\n\t\t\telse if(reds > blacks) {\n\t\t\t\tmore = \"More Red Numbers\";\n\t\t\t}\n\t\t\telse if(reds == blacks) {\n\t\t\t\tmore = \"About the same\";\n\t\t\t}\n\t\t\tanswer = \"\" + more;\n\t\t\tbreak;\n\t\t\t\n\t\tcase 23:\n\t\t\tfor(int i = 0; i < tile1.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile1[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 23, tile1. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile2.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile2[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 23, tile2. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile3.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile3[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 23, tile3. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < allCards.size(); i++) {\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile)allCards.get(i)).getColor().equals(\"green\"))){\n\t\t\t\t\t\tgreens++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 23, getColor=green. \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile)allCards.get(i)).getColor().equals(\"yellow\"))){\n\t\t\t\t\t\tyellows++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 23, getColor=yellow. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(greens < yellows) {\n\t\t\t\tmore = \"More Yellow Numbers\";\n\t\t\t}\n\t\t\telse if(greens > yellows) {\n\t\t\t\tmore = \"More Green Numbers\";\n\t\t\t}\n\t\t\telse if(greens == yellows) {\n\t\t\t\tmore = \"About the same\";\n\t\t\t}\n\t\t\tanswer = \"\" + more;\n\t\t\tbreak;\n\t\t\t\n\t\t}\n\t\treturn answer;\n\t}", "public void setQuestion(){\n\n\n triggerReport(); //Check if max questions are displayed, if yes then show report\n\n MyDatabase db = new MyDatabase(QuizCorner.this);\n Cursor words = db.getQuizQuestion();\n TextView question_text = (TextView) findViewById(R.id.question_text);\n RadioButton rb;\n resetOptions();\n disableCheck();\n enableRadioButtons();\n hideAnswer();\n words.moveToFirst();\n word = words.getString(words.getColumnIndex(\"word\"));\n correct_answer = words.getString(words.getColumnIndex(\"meaning\"));\n question_text.setText(word + \" means:\");\n for (int i = 0; i < 4; i++){\n answers[i] = words.getString(words.getColumnIndex(\"meaning\"));\n words.moveToNext();\n }\n answers = randomizeArray(answers);\n for (int i = 0; i < 4; i++){\n rb = (RadioButton) findViewById(options[i]);\n rb.setText(answers[i]);\n }\n question_displayed_count++;\n }", "Chromosome getRandomAmongFittest(int limit);", "Randomizer getRandomizer();", "public void q2Submit(View view) {\n\n RadioButton radioButton = (RadioButton) findViewById(R.id.q2option3);\n\n //Nested if statements to check if the answer is correct or not, then to assign 2 points if it's correct.\n if (radioButton.isChecked()) {\n if (isNotAnsweredQ2) {\n display(pointCounter += 2);\n Toast.makeText(this, getString(R.string.correct2), Toast.LENGTH_SHORT).show();\n isNotAnsweredQ2 = false;\n }\n } else {\n Toast.makeText(this, getString(R.string.thinkAgain), Toast.LENGTH_SHORT).show();\n }\n }", "public String getAnAnswer() {\n\t\t\n\t\tString answer = \"\";\n\t\t\n\t\t\n\t\tRandom randomGenerator = new Random(); //Construct a new random number generator\n\t\tint randomNumber = randomGenerator.nextInt(mAnswers.length);\n\t\t\n\t\tanswer = mAnswers[randomNumber];\n\t\t\n\t\treturn answer;\n\t}", "public static void main(String[] args) {\n\r\n\t\tRandom rr=new Random();\r\n\t\t\r\n\t\tSystem.out.println(Math.random());//[0,1)\r\n\t\t \r\n\t\t// 第一种情况 int(强转之后最终的值一定是0)\r\n\t\t// 第二种情况 int(强转之后将小数点舍去 1-5)\r\n\t\tSystem.out.println((int)Math.random()*5);//0.99*5永远到不了5\r\n\t\tSystem.out.println((int)(Math.random()*5+1));//[1,5.)\r\n\t\t\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\t\r\n\t\tfor(int i=0;i<=20;i++){\r\n\t\t\tSystem.out.print(i%7+\"-\");\r\n\t\t\t\r\n\t\t}\r\n\t\t//1-M的随机产生\r\n\t\t//(int)(Math.random()*M+1)\r\n\t\t\r\n\t\t\r\n\t\t//产生0 1的概率不同 Math.random()<p?0:1\r\n\t\tSystem.out.println(\"----\"+rr.rand01p());\r\n\t\tSystem.out.println(\"----\"+rr.rand01());\r\n\t\tfor(int i=0;i<=11;i++){\r\n\t\t\tSystem.out.print(i%6+\"-\");\r\n\t\t \t\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(rr.rand106());\r\n\t}", "public void checkAnswerOne() {\n RadioGroup ans1 = findViewById(R.id.radio_gr_q1);\n int radioButtonId = ans1.getCheckedRadioButtonId();\n\n if (radioButtonId == R.id.a2_q1) {\n points++;\n }\n }", "public IcelandGUI() {\n initComponents();\n question = \"\";\n // insert = \"\"; \n count = 0;\n count2 = 0;\n yBtn.setVisible(false);\n nBtn.setVisible(false);\n //t = new jdbcTest();\n try {\n \n Class.forName(\"com.mysql.jdbc.Driver\");\n String connectionUrl = \"jdbc:mysql://localhost:3307/jdbcTest?user=root&password=password\";\n Connection conn = DriverManager.getConnection(connectionUrl);\n Statement st = (Statement) conn.createStatement();\n String find = \"select quest,answer,wrongAns,wrongAns2,wrongAns3,q_sel from Question where country = 'iceland' and q_sel = 'N' order by rand() limit 1;\"; \n ResultSet rs = st.executeQuery(find);\n \n /* https://www.youtube.com/watch?v=MY4FavUyFNQ */ \n \n while(rs.next()){\n question = questionLbl.getText();\n questionLbl.setText(\"\\n\"+rs.getString(\"quest\")); \n Statement st2 = conn.createStatement();\n st2.executeUpdate(\"update Question set q_sel = 'Y' where quest = '\"+rs.getString(\"quest\")+\"'\");\n \n String[] solutionArray = {rs.getString(\"answer\"),rs.getString(\"wrongAns\"),rs.getString(\"wrongAns2\"),rs.getString(\"wrongAns3\")};\n \n \n String [] arr = solutionArray;\n Random rgen = new Random();\n int N = arr.length;\n /*\n * fisher yates shuffle\n *\n * 9/3/2015\n *\n * @reference http://algs4.cs.princeton.edu/11model/Knuth.java.html\n * @author sean trant 13332576\n */ \n \n for (int i = 0; i < N; i++) {\n // choose index uniformly in [i, N-1]\n int r = i + (int) (Math.random() * (N - i));\n Object swap = arr[r];\n arr[r] = arr[i];\n arr[i] = (String)swap;\n \n \n answerBtn1.setText(arr[0]);\n answerBtn2.setText(arr[1]);\n answerBtn3.setText(arr[2]);\n answerBtn4.setText(arr[3]); \n }\n\n }\n \n \n } catch (Exception ex) {\n System.out.println(\"AGGHHHH!!!!!\"); \n } \n \n \n \n }", "@Ignore\n @Test\n public void shouldNotGiveQuestionIfAllQuestionsHaveBeenAnsweredWithInts() {\n attributes.put(FinancialPlanningSpeechlet.GOAL_AMOUNT_KEY, 1000);\n attributes.put(FinancialPlanningSpeechlet.MONTHLY_CONTRIBUTION_KEY, 1000);\n attributes.put(FinancialPlanningSpeechlet.GOAL_PERIOD_KEY, 1000);\n String question = NextQuestionFactory.get(session);\n\n assertThat(question, Is.is(\"\"));\n }", "public void addRandomKids(OperatorFactory o, TerminalFactory t,\r\n int maxDepth, Random rand) {}", "private void newQuestion(int number) {\n bakeImageView.setImageResource(list.get(number - 1).getImage());\n\n //decide which button to place the correct answer\n int correct_answer = r.nextInt(4) + 1;\n\n int firstButton = number - 1;\n int secondButton;\n int thirdButton;\n int fourthButton;\n\n switch (correct_answer) {\n case 1:\n answer1Button.setText(list.get(firstButton).getName());\n\n do {\n secondButton = r.nextInt(list.size());\n } while (secondButton == firstButton);\n do {\n thirdButton = r.nextInt(list.size());\n } while (thirdButton == firstButton || thirdButton == secondButton);\n do {\n fourthButton = r.nextInt(list.size());\n } while (fourthButton == firstButton || fourthButton == secondButton || fourthButton == thirdButton);\n\n answer2Button.setText(list.get(secondButton).getName());\n answer3Button.setText(list.get(thirdButton).getName());\n answer4Button.setText(list.get(fourthButton).getName());\n\n break;\n\n case 2:\n answer2Button.setText(list.get(firstButton).getName());\n\n do {\n secondButton = r.nextInt(list.size());\n } while (secondButton == firstButton);\n do {\n thirdButton = r.nextInt(list.size());\n } while (thirdButton == firstButton || thirdButton == secondButton);\n do {\n fourthButton = r.nextInt(list.size());\n } while (fourthButton == firstButton || fourthButton == secondButton || fourthButton == thirdButton);\n\n answer1Button.setText(list.get(secondButton).getName());\n answer3Button.setText(list.get(thirdButton).getName());\n answer4Button.setText(list.get(fourthButton).getName());\n\n break;\n\n case 3:\n answer3Button.setText(list.get(firstButton).getName());\n\n do {\n secondButton = r.nextInt(list.size());\n } while (secondButton == firstButton);\n do {\n thirdButton = r.nextInt(list.size());\n } while (thirdButton == firstButton || thirdButton == secondButton);\n do {\n fourthButton = r.nextInt(list.size());\n } while (fourthButton == firstButton || fourthButton == secondButton || fourthButton == thirdButton);\n\n answer2Button.setText(list.get(secondButton).getName());\n answer1Button.setText(list.get(thirdButton).getName());\n answer4Button.setText(list.get(fourthButton).getName());\n\n\n break;\n\n case 4:\n answer4Button.setText(list.get(firstButton).getName());\n\n do {\n secondButton = r.nextInt(list.size());\n } while (secondButton == firstButton);\n do {\n thirdButton = r.nextInt(list.size());\n } while (thirdButton == firstButton || thirdButton == secondButton);\n do {\n fourthButton = r.nextInt(list.size());\n } while (fourthButton == firstButton || fourthButton == secondButton || fourthButton == thirdButton);\n\n answer2Button.setText(list.get(secondButton).getName());\n answer3Button.setText(list.get(thirdButton).getName());\n answer1Button.setText(list.get(fourthButton).getName());\n\n break;\n }\n }", "@Override\n\tpublic void makeDecision() {\n\t\tint powerMax = (int)(initPower) / 100;\n\t\tint powerMin = (int)(initPower * 0.3) / 100;\n\n\t\t// The value is calculated randomly from 0 to 10% of the initial power\n\t\tRandom rand = new Random();\n\t\tint actualPower = rand.nextInt((powerMax - powerMin) + 1) + powerMin;\n\t\tanswer.setConsumption(actualPower);\n\t}", "public int randomGQ() {\n\t\treturn(getRandomInteger(10,100));\n\t}", "private void gameHelper(int ranNum){\n\t\tif(questionAnsweredCount>=25){\n\t\t\treturn;\n\t\t}\n\t\tSystem.out.println(\"It is \" + teams[ranNum].getName() + \"'s turn to choose a question\");\n\t\t//find category\n\t\tSystem.out.println(\"Please choose a category you would like to answer: \");\n\t\tint categoryIdx = getCategory();\n\t\t//find points\n\t\tSystem.out.println(\"Please enter the dollar value of the question you wish to answer\");\n\t\tint pointIdx = getPointsIndex();\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\t\t//now check if the question is answer knowing dollar and cat is valid\n\t\tboolean answered = board[categoryIdx][pointIdx].answeredYet();\n\t\tif(!answered){\n\t\t\tint point = points[pointIdx];\n\t\t\tSystem.out.println(board[categoryIdx][pointIdx].getQeustion());\n\t\t\tSystem.out.println(\"Enter your answer. Remember to pose it as a question.\");\n\t\t\tString ans = sc.nextLine();\n\t\t\treadExitCommand(ans); // check if the user wants to exit any point\n\t\t\treadReplayCommand(ans);\n\t\t\tboard[categoryIdx][pointIdx].answerQuestion(ans); //ask Q\n\t\t\tif(!board[categoryIdx][pointIdx].getRight()&&board[categoryIdx][pointIdx].getWarned()){\n\t\t\t\t//not in question format. give one more chance\n\t\t\t\tans = sc.nextLine();\n\t\t\t\treadExitCommand(ans);\n\t\t\t\treadReplayCommand(ans);\n\t\t\t\tboard[categoryIdx][pointIdx].answerQuestion(ans);\n\t\t\t}\n\t\t\tif(board[categoryIdx][pointIdx].getRight()){\n\t\t\t\tSystem.out.println(\"You answered it right! \" + point + \" will be added to your total\");\n\t\t\t\tquestionAnsweredCount+= 10;\n\t\t\t\tteams[ranNum].addDollars(point);\n\t\t\t\tprintDollars();\n\t\t\t}\n\t\t\telse{\n\t\t\t\tSystem.out.println(\"Wrong Answer!\");\n\t\t\t\tquestionAnsweredCount++; \n\t\t\t\tteams[ranNum].minusDollars(point);\n\t\t\t\tprintDollars();\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(\"Question already answered. Choose it again\");\n\t\t\tgameHelper(ranNum); //same team choose a question again\n\t\t}\n\t\tint nextIdx = (ranNum+1)%(teams.length);\n\t\tgameHelper(nextIdx);\n\t}", "public void mo2479c() {\n Collections.shuffle(mo2625k(), C0817u.f2167a);\n }", "private void checkIfQuestionUsed(int randIdx)\n\t{\n\t\t\tfor(Integer current : questionsUsed)\n\t\t\t{\n\t\t\t\tif (current == randIdx) {\n\t\t\t\t\tquestionUsed = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tquestionUsed = false;\n\t\t\t}\n\t}", "public static int getRandomTask() {\n double p = rand.nextDouble(); // required probs given in Question\n for (int i = 0; i < 6; i++) {\n if (p <= prob[i])\n return i;\n }\n return 1;\n }", "private static int getRandomNumberOfRooms(){\r\n return r.nextInt(50)+1;\r\n }", "private void random() {\n\n\t}", "public void generateKeys() {\n\t\t// p and q Length pairs: (1024,160), (2048,224), (2048,256), and (3072,256).\n\t\t// q must be a prime; choosing 160 Bit for q\n\t\tSystem.out.print(\"Calculating q: \");\n\t\tq = lib.generatePrime(160);\n\t\tSystem.out.println(q + \" - Bitlength: \" + q.bitLength());\n\t\t\n\t\t// p must be a prime\n\t\tSystem.out.print(\"Calculating p \");\n\t\tp = calculateP(q);\n\t System.out.println(\"\\np: \" + p + \" - Bitlength: \" + p.bitLength());\n\t System.out.println(\"Test-Division: ((p-1)/q) - Rest: \" + p.subtract(one).mod(q));\n\t \n\t // choose an h with (1 < h < p−1) and try again if g comes out as 1.\n \t// Most choices of h will lead to a usable g; commonly h=2 is used.\n\t System.out.print(\"Calculating g: \");\n\t BigInteger h = BigInteger.valueOf(2);\n\t BigInteger pMinusOne = p.subtract(one);\n\t do {\n\t \tg = h.modPow(pMinusOne.divide(q), p);\n\t \tSystem.out.print(\".\");\n\t }\n\t while (g == one);\n\t System.out.println(\" \"+g);\n\t \n\t // Choose x by some random method, where 0 < x < q\n\t // this is going to be the private key\n\t do {\n\t \tx = new BigInteger(q.bitCount(), lib.getRandom());\n }\n\t while (x.compareTo(zero) == -1);\n\t \n\t // Calculate y = g^x mod p\n\t y = g.modPow(x, p);\n\t \n System.out.println(\"y: \" + y);\n System.out.println(\"-------------------\");\n System.out.println(\"Private key (x): \" + x);\n\t}", "public void q1Submit(View view) {\n\n EditText editText = (EditText) findViewById(R.id.q1enterEditText);\n String q1answer = editText.getText().toString().trim();\n\n //Nested if statements to check if the answer is correct or not, then to assign 2 points if it's correct.\n if ((q1answer.toLowerCase().equals(getString(R.string.q1AnswerCheck1))) || (q1answer.toLowerCase().equals(getString(R.string.q1AnswerCheck2)))) {\n if (isNotAnsweredQ1) {\n display(pointCounter += 2);\n Toast.makeText(this, getString(R.string.correct1), Toast.LENGTH_SHORT).show();\n isNotAnsweredQ1 = false;\n }\n } else {\n Toast.makeText(this, getString(R.string.thinkAgain), Toast.LENGTH_SHORT).show();\n }\n }", "private void nextQuestion() {\n\n // increment current question index\n currentQuestionIndex++;\n\n // if the current question index is smaller than the size of the quiz list\n if (currentQuestionIndex < quizList.size()) {\n\n // clear the possible answers\n possibleAnswers.clear();\n\n // grab the definition of current question, assign the correct answer variable\n // and add it to the list of possible answers.\n definition = quizList.get(currentQuestionIndex)[0];\n correctAnswer = quizMap.get(definition);\n possibleAnswers.add(correctAnswer);\n\n // while there's less than 4 possible answers, get a random answer\n // and if it hasn't already been added, add it to the list.\n while (possibleAnswers.size() < 4) {\n String answer = quizList.get(new Random().nextInt(quizList.size() - 1))[1];\n if (!possibleAnswers.contains(answer)) {\n possibleAnswers.add(answer);\n }\n }\n\n // shuffle possible answers so they display in a random order\n Collections.shuffle(possibleAnswers);\n } else {\n // if the question index is out of bounds, set quiz as finished\n quizFinished = true;\n }\n }", "public int root2(){\n\t\t\tRandom r1=new Random();\n\t\t\tint r2= r1.nextInt((9) + 1) + 1;\n\t\t\treturn r2;\n\t}", "public void kast() {\n\t\t// vaelg en tilfaeldig side\n\t\tdouble tilfaeldigtTal = Math.random();\n\t\tvaerdi = (int) (tilfaeldigtTal * 6 + 1);\n\t}", "public EE57SubtractionQuestion() { // constructor\n a = (int)(Math.random() * 50 + 1);\n b = (int)(Math.random() * 50);\n \n if (a < b) { // check if a < b in order to do not have a negative answer\n \t\tint temp = a;\n \t\ta = b;\n \t\tb = temp;\n }\n }", "java.lang.String getCorrectAnswer();", "public static void main(String[] args) {\n\t\t\tSystem.out.println(\"Question 1\");\r\n\t\t\tfloat a = 5240.5f;\r\n\t\t\tfloat b = 10970.055f;\r\n\t\t\tint x = (int) a;\r\n\t\t\tint y = (int) b;\r\n\t\t\tSystem.out.println(x);\r\n\t\t\tSystem.out.println(y + \"\\n\");\r\n\r\n\t\t\t// Question 2:\r\n\t\t\tSystem.out.println(\"Question 2\");\r\n\t\t\tint a1 = random.nextInt(100000);\r\n\t\t\tSystem.out.printf(\"%05d\", a1);\r\n\t\t\tSystem.out.println(\"\\n\");\r\n\r\n\t\t\t// Question 3:\r\n\t\t\tSystem.out.println(\"Question 3\");\r\n\t\t\tint b1 = a1 % 100;\r\n\t\t\tSystem.out.println(\"Hai số cuối của a1: \" + b1);\r\n\t\t\tSystem.out.println(\"\\n\");\r\n\r\n\t\t\tQuestion4();\r\n\r\n\t\t\tExercise2();\r\n\r\n\t\t\tSystem.out.println(\"\\n\");\r\n\r\n\t\t\t// Exercise 3:\r\n\t\t\tSystem.out.println(\"Exercise3\");\r\n\t\t\t// Question 1:\r\n\t\t\tSystem.out.println(\"Question 1:\");\r\n\t\t\tInteger salary = 5000;\r\n\t\t\tfloat salaryf = salary;\r\n\t\t\tSystem.out.printf(\"%.2f\", salaryf);\r\n\r\n\t\t\t// Question 2:\r\n\t\t\tSystem.out.println(\"Question 2:\");\r\n\t\t\tString value = \"1234567\";\r\n\t\t\tint a2 = Integer.parseInt(value);\r\n\t\t\tSystem.out.println(a2);\r\n\r\n\t\t\t// Question 3:\r\n\t\t\tSystem.out.println(\"Question 3:\");\r\n\t\t\tInteger value1 = 1234567;\r\n\t\t\tint a3 = value1.intValue();\r\n\t\t\tSystem.out.println(a3);\r\n\t\t\tSystem.out.println(\"\\n\");\r\n\r\n\t\t\t// Exercise 4:\r\n\t\t\tSystem.out.println(\"Exercise 4:\");\r\n\t\t\t// Question 1:\r\n\t\t\tSystem.out.println(\"Question 1\");\r\n\t\t\tSystem.out.println(\"Mời bạn nhập họ và tên: \");\r\n\t\t\tString nhapGiaTri1 = scanner.nextLine();\r\n\t\t\tString nhapGiaTri = scanner.nextLine();\r\n\t\t\tint count = 1;\r\n\t\t\tint j;\r\n\t\t\tfor (j = 0; j < nhapGiaTri.length(); j++) {\r\n\t\t\t\tif (nhapGiaTri.charAt(j) != ' ') {\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"Độ dài của chuỗi ký tự nhapGiaTri: \" + count);\r\n\t\t\tSystem.out.println(\"\\n\");\r\n\r\n\t\t\t// Question 2:\r\n\t\t\tSystem.out.println(\"Question 2\");\r\n\t\t\tSystem.out.println(\"Mời bạn nhập chuỗi ký tự 1: \");\r\n\t\t\tString s1 = scanner.next();\r\n\t\t\tSystem.out.println(\" \");\r\n\t\t\tSystem.out.println(\"Mời bạn nhập chuỗi ký tự 2: \");\r\n\t\t\tString s2 = scanner.next();\r\n\t\t\tSystem.out.println(\"Kết quả khi nối hai xâu kí tự s1 và s2: \" + s1 + s2);\r\n\t\t\tSystem.out.println(\"\\n\");\r\n\r\n\t\t\t// Question 3:\r\n\t\t\tSystem.out.println(\"Mời bạn nhập họ tên: \");\r\n\t\t\tString hoTen1 = scanner.nextLine();\r\n\t\t\tString hoTen2 = scanner.nextLine();\r\n\t\t\tString hoTen = hoTen2.substring(0, 1).toUpperCase() + hoTen2.substring(1);\r\n\t\t\tSystem.out.println(hoTen);\r\n\t\t\tSystem.out.println(\"\\n\");\r\n\r\n\t\t\t// question 4:\r\n\t\t\tString name;\r\n\t\t\tSystem.out.println(\"Nhập tên: \");\r\n\t\t\tname = scanner.nextLine();\r\n\t\t\tname = name.toUpperCase();\r\n\t\t\tfor (int i = 0; i < name.length(); i++) {\r\n\t\t\t\tSystem.out.println(\"Ký tự thứ \" + i + \" là: \" + name.charAt(i));\r\n\t\t\t}\r\n\r\n\t\t\t// question 5:;\r\n\t\t\tSystem.out.println(\"Nhập họ: \");\r\n\t\t\tString firstName = scanner.nextLine();\r\n\t\t\tSystem.out.println(\"Nhập tên: \");\r\n\t\t\tString lastName = scanner.nextLine();\r\n\t\t\tSystem.out.println(\"Họ tên đầy đủ: \" + firstName.concat(lastName));\r\n\r\n\t\t\t// question 6:\r\n\t\t\tSystem.out.println(\"Nhập họ: \");\r\n\t\t\tString firstName1 = scanner.nextLine();\r\n\t\t\tSystem.out.println(\"Nhập tên: \");\r\n\t\t\tString lastName1 = scanner.nextLine();\r\n\t\t\tSystem.out.println(\"Họ tên đầy đủ: \" + firstName.concat(lastName));\r\n\r\n\t\t\t// question 7:\r\n\r\n\t\t\tString fullName;\r\n\t\t\tSystem.out.println(\"Nhập họ tên đầy đủ\");\r\n\t\t\tfullName = scanner.nextLine();\r\n\t\t\t// remove space characters\r\n\t\t\tfullName = fullName.trim();\r\n\t\t\tfullName = fullName.replaceAll(\"\\\\s+\", \" \");\r\n\t\t\tSystem.out.println(fullName);\r\n\t\t\tString[] words = fullName.split(\" \");\r\n\t\t\tfullName = \"\";\r\n\t\t\tfor (String word : words) {\r\n\t\t\t\tString firstCharacter = word.substring(0, 1).toUpperCase();\r\n\t\t\t\tString leftCharacter = word.substring(1);\r\n\t\t\t\tword = firstCharacter + leftCharacter;\r\n\t\t\t\tfullName += word + \" \";\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"Họ tên sau khi chuẩn hóa: \" + fullName);\r\n\r\n\t\t\t// question 8:\r\n\t\t\tString[] groupNames = { \"Java with VTI\", \"Cách qua môn gia va\", \"Học Java có khó không?\" };\r\n\t\t\tfor (String groupName : groupNames) {\r\n\t\t\t\tif (groupName.contains(\"Java\")) {\r\n\t\t\t\t\tSystem.out.println(groupName);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Question 9:\r\n\t\t\tString[] groupNames1 = { \"Java\", \"C#\", \"C++\" };\r\n\t\t\tfor (String groupName : groupNames) {\r\n\t\t\t\tif (groupName.equals(\"Java\")) {\r\n\t\t\t\t\tSystem.out.println(groupName);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// question 10:\r\n\t\t\tString x1, x2, reversex1 = \"\";\r\n\t\t\tSystem.out.println(\"Nhập chuỗi 1\");\r\n\t\t\tx1 = scanner.nextLine();\r\n\t\t\tSystem.out.println(\"Nhập chuỗi 2\");\r\n\t\t\tx2 = scanner.nextLine();\r\n\t\t\tfor (int i = x1.length() - 1; i >= 0; i--) {\r\n\t\t\t\treversex1 += x1.substring(i, i + 1);\r\n\t\t\t}\r\n\t\t\tif (x2.equals(reversex1)) {\r\n\t\t\t\tSystem.out.println(\"Đây là chuỗi đảo ngược !\");\r\n\t\t\t} else {\r\n\t\t\t\tSystem.out.println(\"Đây không phải chuỗi đảo ngược\");\r\n\t\t\t}\r\n\r\n\t\t\t// question 11:\r\n\t\t\tSystem.out.println(\"Mời bạn nhập vào một chuỗi: \");\r\n\t\t\tString str = scanner.nextLine();\r\n\t\t\tint count1 = 0;\r\n\t\t\tfor (int i = 0; i < str.length(); i++) {\r\n\t\t\t\tif ('a' == str.charAt(i)) {\r\n\t\t\t\t\tcount1++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.println(count);\r\n\r\n\t\t\t// question 12:\r\n\t\t\tString daoNguoc = \"\";\r\n\t\t\tSystem.out.println(\"Nhập chuỗi 1\");\r\n\t\t\tString x3 = scanner.nextLine();\r\n\t\t\tfor (int i = x3.length() - 1; i >= 0; i--) {\r\n\t\t\t\tdaoNguoc += x3.charAt(i);\r\n\t\t\t}\r\n\t\t\tSystem.out.println(daoNguoc);\t\t\t\r\n\t\t\t\r\n\t\t}", "public void generateQ(){\n\t\t\tq = wsum.add(BigInteger.ONE);\n\t}", "public void quizCreate(View view)\n {\n //Create screen\n correctOption = r.nextInt(4) + 1;\n int rand = generateRandom(r);\n\n setContentView(R.layout.quiz_layout1);\n ImageView pokeImage = (ImageView) findViewById(R.id.quiz_image);\n if (rand <= 0) {\n return;\n }\n int imageInt = getResources().getIdentifier(imageFilePrefix + rand, \"drawable\", getPackageName());\n pokeImage.setImageResource(imageInt);\n Button correctButton = (Button) findViewById(options.get(correctOption));\n correctButton.setText(myDbHelper.queryName(rand));\n\n }", "public void nextQuestion(View view) {\n\n Integer num1, num2;\n num1=generateRandomNumber(100);\n num2=generateRandomNumber(100);\n\n //set random number in textview\n TextView tv;\n tv=findViewById(R.id.question);\n tv.setText(Integer.toString(num1)+ \"X\" + Integer.toString(num2));\n\n }", "private void study(String studyToolId) {\n String[][] questionsAndAnswers = studyToolManager.fetchQuestionsAndAnswers(studyToolId);\n String templateId = studyToolManager.getStudyToolTemplateId(studyToolId);\n TemplateManager.TemplateType templateType = templateManager.getTemplateType(Integer.parseInt(templateId));\n List<Object> timeInfo = templateManager.getTimeInfo(templateId);\n boolean isTimed = (Boolean) timeInfo.get(0);\n boolean isTimedPerQuestion = (Boolean) timeInfo.get(1);\n long timeLimitInMS = 1000 * (Integer) timeInfo.get(2);\n long quizStartTime = System.currentTimeMillis();\n int total_score = questionsAndAnswers.length;\n int curr_score = 0;\n Queue<String[]> questionsToRepeat = new LinkedList<>();\n AnswerChecker answerChecker = studyToolManager.getAnswerChecker(studyToolId);\n for (String[] qa : questionsAndAnswers) {\n long questionStartTime = System.currentTimeMillis();\n studyToolDisplayer.displayAQuestion(qa);\n regularPresenter.getAnswerPrompter(templateType);\n String answer = scanner.nextLine();\n boolean correctness = answerChecker.isCorrectAnswer(answer, qa[1]);\n if (templateType.equals(TemplateManager.TemplateType.FC) && !correctness) {\n // TODO: make this depend on template's configuration\n questionsToRepeat.add(qa);\n }\n long questionTimeElapsed = System.currentTimeMillis() - questionStartTime;\n if (isTimed && isTimedPerQuestion && (questionTimeElapsed >= timeLimitInMS)) {\n regularPresenter.ranOutOfTimeReporter();\n } else {\n curr_score += (correctness ? 1 : 0);\n regularPresenter.correctnessReporter(correctness);\n }\n regularPresenter.pressEnterToShowAnswer();\n scanner.nextLine();\n studyToolDisplayer.displayAnAnswer(qa);\n }\n //FC only, for repeating wrong questions until all is memorized\n while (!questionsToRepeat.isEmpty()) {\n String[] qa = questionsToRepeat.poll();\n studyToolDisplayer.displayAQuestion(qa);\n regularPresenter.getAnswerPrompter(templateType);\n String answer = scanner.nextLine();\n boolean correctness = answerChecker.isCorrectAnswer(answer, qa[1]);\n if (!correctness) {\n questionsToRepeat.add(qa);\n }\n regularPresenter.correctnessReporter(correctness);\n regularPresenter.pressEnterToShowAnswer();\n studyToolDisplayer.displayAnAnswer(qa);\n }\n long quizTimeElapsed = System.currentTimeMillis() - quizStartTime;\n if (isTimed && !isTimedPerQuestion && (quizTimeElapsed >= timeLimitInMS)){\n regularPresenter.ranOutOfTimeReporter();\n }\n else if (templateManager.isTemplateScored(templateId)) {\n String score = curr_score + \"/\" + total_score;\n regularPresenter.studySessionEndedReporter(score);\n }\n }", "public void setSingleChoices() {\r\n Random randomGenerator = new Random();\r\n int singleAnswer = randomGenerator.nextInt(4);\r\n studentAnswer.add(singleAnswer); }", "private String getRandomResponse() {\n\t\tfinal int NUMBER_OF_RESPONSES = 6;\n\t\tdouble r = Math.random();\n\t\tint whichResponse = (int) (r * NUMBER_OF_RESPONSES);\n\t\tString response = \"\";\n\n\t\tif (whichResponse == 0) {\n\t\t\tresponse = \"Interesting, tell me more.\";\n\t\t} else if (whichResponse == 1) {\n\t\t\tresponse = \"Hmmm.\";\n\t\t} else if (whichResponse == 2) {\n\t\t\tresponse = \"Do you really think so?\";\n\t\t} else if (whichResponse == 3) {\n\t\t\tresponse = \"You don't say.\";\n\t\t} else if(whichResponse == 4) {\n\t\t\tresponse = \"Well, that's right.\";\n\t\t} else if(whichResponse == 5) {\n\t\t\tresponse = \"Can we switch the topic?\";\n\t\t}\n\n\t\treturn response;\n\t}", "public abstract void randomize();", "public int randomizeSecondNumber() {\n b = random.nextInt(100);\n question.setA(b);\n return b;\n }", "@Override\n\tpublic double compete() {\n\t\tdouble result=MyTools.getRandomNum(500, 800);\n\t\tsetThisResult(result);\n\t\treturn result;\n\t}" ]
[ "0.6677473", "0.6557477", "0.6389339", "0.6379834", "0.6379605", "0.63562286", "0.6104095", "0.6056189", "0.5836303", "0.5833877", "0.5828556", "0.58164114", "0.5782971", "0.57596827", "0.57548815", "0.57144076", "0.5706773", "0.56672806", "0.5659394", "0.56475604", "0.56301236", "0.5578832", "0.5576008", "0.55758023", "0.5543543", "0.5520624", "0.5504729", "0.550225", "0.54909235", "0.54857415", "0.547638", "0.54528993", "0.5428556", "0.5418845", "0.541521", "0.5410706", "0.5408568", "0.53991175", "0.539834", "0.5387526", "0.53702193", "0.5361691", "0.5336102", "0.53243333", "0.5322814", "0.53219604", "0.53129536", "0.5312014", "0.5297547", "0.5292552", "0.5288623", "0.5287286", "0.52840203", "0.5281042", "0.5279984", "0.5274399", "0.5265835", "0.52556807", "0.52445453", "0.5241834", "0.5225929", "0.52205384", "0.5218466", "0.5217421", "0.5204028", "0.51975495", "0.5192545", "0.51923746", "0.51892513", "0.51877", "0.5182119", "0.51800525", "0.51774055", "0.5174917", "0.5166254", "0.51612735", "0.5159601", "0.51570326", "0.5146088", "0.51434773", "0.51369685", "0.5136234", "0.513382", "0.5133508", "0.5125924", "0.51221156", "0.51186097", "0.51145786", "0.511293", "0.5099977", "0.5098004", "0.5096023", "0.50913894", "0.50900376", "0.5087883", "0.5077771", "0.50727016", "0.50576526", "0.50551885", "0.50530326" ]
0.721288
0
Method that calculates a random question for the ks1 question areas
public static String[] randomQuestions(String op){ String question = ""; String ansStr = ""; int part1 = randomNumber(); int part2 = randomNumber(); int ans = 0; double roundAns = 0.0; if (op.equals("^")){ //Round to Closest Whole Number roundAns = (randomDecimal()); double k = Math.round(roundAns); question = Double.toString(roundAns); ansStr = Double.toString(k); } else if (op.equals("Alg")){ //Algebraic Formula - Find x/y int coeff = randomNumberAlg(); int layout = randomNumber(); part1 = randomNumberAlg(); part2 = randomNumberAlg(); if (layout < 3){ //?x = int ans = part1 * coeff; question = coeff+"x = "+ ans; ansStr = Integer.toString(part1); } else if (layout > 3 && layout <= 7){ //?x+num = int || ?x-num = int if (layout == 4||layout == 5){ ans = (part1 * coeff) + part2; question = coeff+"x + "+part2+" = "+ans; ansStr = Integer.toString(part1); } else if (layout == 6||layout == 7){ ans = (part1 * coeff) - part2; question = coeff+"x - "+part2+" = "+ans; ansStr = Integer.toString(part1); } } else if (layout > 7 && layout <= 10){ //?x/num = int ans = (part1 * coeff)/part2; question = coeff+"x/"+part2+" = "+ ans; ansStr = Integer.toString(part1); } } else if (op.equals("%")){ //Precentages - Covert Fraction to Percentage int div = HCF(part1, part2); int finalp1 = part1 % div; int finalp2 = part2 % div; if (finalp1 == 0){ finalp1 = randomNumberRatio(); } if (finalp2 == 0){ finalp2 = randomNumberRatio(); } double fract = finalp1/finalp2; if (finalp1>finalp2){ fract = finalp1/finalp2; question = finalp1+"/"+finalp2; } else { fract = finalp2/finalp1; question = finalp2+"/"+finalp1; } double perc = fract * 100; ansStr = Double.toString(perc); } else if (op.equals(":")){ //Ratio - Simplifying part1 = randomNumberRatio(); part2 = randomNumberRatio(); int div = HCF(part1, part2); int finalp1 = part1 / div; int finalp2 = part2 / div; question = part1+":"+part2; ansStr = finalp1+":"+finalp2; } else if (op.equals("//")){ //Fractions - Simplifying int div = HCF(part1, part2); int finalp1 = part1 % div; int finalp2 = part2 % div; question = part1+"/"+part2; ansStr = finalp1+"/"+finalp2; } String x[] = new String[2]; x[0] = question; x[1] = ansStr; return x; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String[] randomQuestionKS2(String op){\r\n int part1 = randomNumber();\r\n int part2 = randomNumber();\r\n \r\n ArrayList<Integer> multiQs = new ArrayList<>(Arrays.asList(2,5,10));\r\n ArrayList<Integer> divQs = new ArrayList<>(Arrays.asList(5,10));\r\n \r\n \r\n if (op.equals(\"*\")){ \r\n int pos = multiQs.get(randomMulti());\r\n \r\n part1 = pos;\r\n } else if (op.equals(\"/\")){\r\n ArrayList <Integer> divide10 = new ArrayList<>(Arrays.asList(10,20,30,40,50,60,70,80,90,100));\r\n \r\n int pos = (randomNumber()) - 1;\r\n int pos2 = (randomDivide());\r\n \r\n part1 = divide10.get(pos);\r\n part2 = divQs.get(pos2); \r\n }\r\n \r\n String str1 = Integer.toString(part1);\r\n String str2 = Integer.toString(part2);\r\n \r\n String question = str1 + \" \" + op + \" \" + str2;\r\n int ans = 0;\r\n \r\n if (op.equals(\"+\")){\r\n part1 = randomNumber50();\r\n part2 = randomNumber50();\r\n ans = part1 + part2;\r\n str1 = Integer.toString(part1);\r\n str2 = Integer.toString(part2);\r\n question = str1 + \" \" + op + \" \" + str2;\r\n }\r\n else if (op.equals(\"-\")){\r\n part1 = randomNumber100();\r\n part2 = randomNumber50();\r\n if (part1 < part2){\r\n ans = part2 - part1;\r\n str1 = Integer.toString(part1);\r\n str2 = Integer.toString(part2);\r\n question = str2 + \" \" + op + \" \" + str1;\r\n }\r\n ans = part1 - part2;\r\n str1 = Integer.toString(part1);\r\n str2 = Integer.toString(part2);\r\n question = str1 + \" \" + op + \" \" + str2;\r\n }\r\n else if (op.equals(\"*\")){\r\n ans = part1 * part2;\r\n }\r\n else if (op.equals(\"/\")){\r\n ans = part1 / part2;\r\n }\r\n \r\n String ansStr = Integer.toString(ans);\r\n \r\n String x[] = new String[2];\r\n x[0] = question;\r\n x[1] = ansStr;\r\n \r\n return x;\r\n }", "public void questionGenerator()\n\t{\n\t\t//creates questions\n\t\toperation = rand.nextInt(3) + min;\n\t\t\n\t\t//makes max # 10 to make it easier for user if random generator picks multiplication problem\n\t\tif (operation == 3)\n\t\t\tmax = 10; \n\t\t\n\t\t//sets random for number1 & number2\n\t\tnumber1 = rand.nextInt(max) + min; //random number max and min\n\t\tnumber2 = rand.nextInt(max) + min; \n\t\t\t\t\n\t\t//ensures final answer of problem is not negative by switching #'s if random generator picks subtraction problem\n\t\tif (operation == 2 && number1 < number2)\n\t\t{\n\t\t\tint tempNum = number1;\n\t\t\tnumber1 = number2;\n\t\t\tnumber2 = tempNum;\n\t\t}\n\t\tanswer = 0;\n\t\t\n\t\t//randomizes operator to randomize question types\n\t\tif (operation == 1)\n\t\t{\n\t\t\toperator = '+';\n\t\t\tanswer = number1 + number2;\n\t\t}\n\t\tif (operation == 2)\n\t\t{\n\t\t\toperator = '-';\n\t\t\tanswer = number1 - number2;\n\t\t}\n\t\tif (operation == 3)\n\t\t{\n\t\t\toperator = '*';\n\t\t\tanswer = number1 * number2;\n\t\t}\n\t\t\t\n\t\t//prints question\n\t\tlabel2.setText(\"Question: \" + number1 + \" \" + operator + \" \" + number2 + \" = ?\");\n\t}", "@GET\n @Path(\"/randomquestion\")\n public String getRandomQuestion() {\n return \"test\";\n //return map.keySet().toArray()[ThreadLocalRandom.current().nextInt(1, map.size())].toString();\n }", "private void settingQuestion() {\n\n int[] setWord = {0, 0, 0, 0, 0};\n int[] setPos = {0, 0, 0, 0};\n int[] setBtn = {0, 0, 0, 0};\n\n Random ans = new Random();\n int wordNum = ans.nextInt(vocabularyLesson.size());\n //answer = vocabularyLesson.get(wordNum).getMean();\n word = vocabularyLesson.get(wordNum).getWord();\n vocabularyID = vocabularyLesson.get(wordNum).getId();\n answer = word;\n\n Practice practice = pc.getPracticeById(vocabularyID);\n if (practice != null) {\n Log.d(\"idVocabulary\", practice.getSentence());\n question.setText(practice.getSentence());\n }\n\n\n // Random position contain answer\n setWord[wordNum] = 1;\n Random p = new Random();\n int pos = p.nextInt(4);\n if (pos == 0) {\n word1.setText(word);\n setBtn[0] = 1;\n }\n if (pos == 1) {\n word2.setText(word);\n setBtn[1] = 1;\n }\n if (pos == 2) {\n word3.setText(word);\n setBtn[2] = 1;\n }\n if (pos == 3) {\n word4.setText(word);\n setBtn[3] = 1;\n }\n setPos[pos] = 1;\n\n // Random 3 position contain 3 answer\n for (int i = 0; i < 3; i++) {\n Random ques = new Random();\n int num = ques.nextInt(5);\n int p1 = ques.nextInt(4);\n while (setWord[num] == 1 || setPos[p1] == 1) {\n num = ques.nextInt(5);\n p1 = ques.nextInt(4);\n }\n String wordIncorrect = vocabularyLesson.get(num).getWord();\n setWord[num] = 1;\n setPos[p1] = 1;\n if (setBtn[p1] == 0 && p1 == 0) {\n word1.setText(wordIncorrect);\n setBtn[0] = 1;\n }\n if (setBtn[p1] == 0 && p1 == 1) {\n word2.setText(wordIncorrect);\n setBtn[1] = 1;\n }\n if (setBtn[p1] == 0 && p1 == 2) {\n word3.setText(wordIncorrect);\n setBtn[2] = 1;\n }\n if (setBtn[p1] == 0 && p1 == 3) {\n word4.setText(wordIncorrect);\n setBtn[3] = 1;\n }\n }\n\n }", "public void setQuestion(){\n Random rand = new Random();\n a = rand.nextInt(maxRange)+1;\n b = rand.nextInt(maxRange)+1;\n int res = rand.nextInt(4);\n equation.setText(a +\"+\"+ b);\n for(int i=0; i<4; i++){\n if(i == res)\n arr[i] = a+b;\n else {\n int answer = rand.nextInt(2*maxRange)+1;\n while(answer == a+b)\n answer = rand.nextInt(2*maxRange)+1;\n arr[i] = answer;\n }\n }\n for(int i=0; i<4; i++)\n buttons[i].setText(String.valueOf(arr[i]));\n }", "public String generateQuestion(){\r\n qType = rand.nextInt(2);\r\n if (qType ==0)\r\n return \"Multiple choice question.\";\r\n else\r\n return \"Single choice question.\";\r\n }", "void setQuestion(){\n int numberRange = currentLevel * 3;\n Random randInt = new Random();\n\n int partA = randInt.nextInt(numberRange);\n partA++;//not zero\n\n int partB = randInt.nextInt(numberRange);\n partB++;//not zero\n\n correctAnswer = partA * partB;\n int wrongAnswer1 = correctAnswer-2;\n int wrongAnswer2 = correctAnswer+2;\n\n textObjectPartA.setText(\"\"+partA);\n textObjectPartB.setText(\"\"+partB);\n\n //set the multi choice buttons\n //A number between 0 and 2\n int buttonLayout = randInt.nextInt(3);\n switch (buttonLayout){\n case 0:\n buttonObjectChoice1.setText(\"\"+correctAnswer);\n buttonObjectChoice2.setText(\"\"+wrongAnswer1);\n buttonObjectChoice3.setText(\"\"+wrongAnswer2);\n break;\n\n case 1:\n buttonObjectChoice2.setText(\"\"+correctAnswer);\n buttonObjectChoice3.setText(\"\"+wrongAnswer1);\n buttonObjectChoice1.setText(\"\"+wrongAnswer2);\n break;\n\n case 2:\n buttonObjectChoice3.setText(\"\"+correctAnswer);\n buttonObjectChoice1.setText(\"\"+wrongAnswer1);\n buttonObjectChoice2.setText(\"\"+wrongAnswer2);\n break;\n }\n }", "public abstract void generateQuestion();", "private void generateNewQuestion() {\n GameManager gameManager = new GameManager();\n long previousQuestionId = -1;\n try {\n previousQuestionId = mGameModel.getQuestion().getId();\n } catch (NullPointerException e) {\n previousQuestionId = -1;\n }\n mGameModel.setQuestion(gameManager.generateRandomQuestion(previousQuestionId));\n mGameModel.getGameMaster().setDidPlayerAnswer(false);\n mGameModel.getGameMaster().setPlayerAnswerCorrect(false);\n mGameModel.getGameSlave().setDidPlayerAnswer(false);\n mGameModel.getGameSlave().setPlayerAnswerCorrect(false);\n LOGD(TAG, \"New question generated\");\n }", "public void randomize(){\r\n\t\tfor(int i = 0;i<this.myQuestions.size();i++){\r\n\t\t\tthis.myQuestions.get(i).randomize();\r\n\t\t}\r\n\t\tCollections.shuffle(this.myQuestions);\r\n\t}", "public void quiz() {\n\t\t\t\t\tcorrectans = 0;\n\t\t\t\t\tint k = 0;\n\t\t\t\t\tint j = 0;\n\t\t\t\t\tint M = 0;\n\t\t\t\t\tj = readDifficulty();\n\t\t\t\t\tM = readProblemType();\n\t\t\t\t\t//ask the student to solve 10 different problems, as determined by the problem type\n\t\t\t for(int i = 0; i < 10; i++ ) {\n\t\t\t \t//contain two numbers sampled from a uniform random distribution with bounds determined by the problem difficulty\n\t\t\t \tint x = rand.nextInt(j); \n\t\t\t\t int y = rand.nextInt(j);\n\t\t\t\t int O = askquestion(j, M,x,y);\n\t\t\t\t if(M == 4) {\n\t\t\t\t \t float floatans = readdivision();\n\t\t\t\t \tk = divisionsol(floatans, x, y);\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t int userin = readResponse();\n\t\t\t k = isnanswercorrect(O , userin);\n\t\t\t }\n\t\t\t if(k == 1) {\n\t\t\t \t correctans++;\n\t\t\t }\n\t\t\t }\n\t\t\t int L = 0;\n\t\t\t L = displayCompletionMessage(correctans);\n\t\t\t if ( L == 1) {\n\t\t\t \tquiz();\n\t\t\t }\n\t\t\t else {\n\t\t\t \treturn;\n\t\t\t }\n\t\t\t \n\t\t\t\t}", "public void fillQuestionsTable() {\n\n //Hard Questions\n Questions q1 = new Questions(\"The redshift of a distant galaxy is 0·014. According to Hubble’s law, the distance of the galaxy from Earth is? \", \" 9·66 × 10e-12 m\", \" 9·32 × 10e27 m\", \"1·83 × 10e24 m\", \"1·30 × 10e26 m \", 3);\n addQuestion(q1);\n Questions q2 = new Questions(\"A ray of monochromatic light passes from air into water. The wavelength of this light in air is 589 nm. The speed of this light in water is? \", \" 2·56 × 10e2 m/s \", \"4·52 × 10e2 m/s\", \"4·78 × 10e2 m/s\", \"1·52 × 10e2 m/s\", 2);\n addQuestion(q2);\n Questions q3 = new Questions(\"A car is moving at a speed of 2·0 m s−1. The car now accelerates at 4·0 m s−2 until it reaches a speed of 14 m s−1. The distance travelled by the car during this acceleration is\", \"1.5m\", \"18m\", \"24m\", \"25m\", 3);\n addQuestion(q3);\n Questions q4 = new Questions(\"A spacecraft is travelling at 0·10c relative to a star. \\nAn observer on the spacecraft measures the speed of light emitted by the star to be?\", \"0.90c\", \"1.00c\", \"1.01c\", \"0.99c\", 2);\n addQuestion(q4);\n Questions q5 = new Questions(\"Measurements of the expansion rate of the Universe lead to the conclusion that the rate of expansion is increasing. Present theory proposes that this is due to? \", \"Redshift\", \"Dark Matter\", \"Dark Energy\", \"Gravity\", 3);\n addQuestion(q5);\n Questions q6 = new Questions(\"A block of wood slides with a constant velocity down a slope. The slope makes an angle of 30º with the horizontal axis. The mass of the block is 2·0 kg. The magnitude of the force of friction acting on the block is?\" , \"1.0N\", \"2.0N\", \"9.0N\", \"9.8N\", 4);\n addQuestion(q6);\n Questions q7 = new Questions(\"A planet orbits a star at a distance of 3·0 × 10e9 m. The star exerts a gravitational force of 1·6 × 10e27 N on the planet. The mass of the star is 6·0 × 10e30 kg. The mass of the planet is? \", \"2.4 x 10e14 kg\", \"3.6 x 10e25 kg\", \"1.2 x 10e16 kg\", \"1.6 x 10e26 kg\", 2);\n addQuestion(q7);\n Questions q8 = new Questions(\"Radiation of frequency 9·00 × 10e15 Hz is incident on a clean metal surface. The maximum kinetic energy of a photoelectron ejected from this surface is 5·70 × 10e−18 J. The work function of the metal is?\", \"2.67 x 10e-19 J\", \"9.10 x 10e-1 J\", \"1.60 x 10e-18 J\", \"4.80 x 10e-2 J\", 1);\n addQuestion(q8);\n Questions q9 = new Questions(\"The irradiance of light from a point source is 32 W m−2 at a distance of 4·0 m from the source. The irradiance of the light at a distance of 16 m from the source is? \", \"1.0 W m-2\", \"8.0 W m-2\", \"4.0 W m-2\", \"2.0 W m-2\", 4);\n addQuestion(q9);\n Questions q10 = new Questions(\"A person stands on a weighing machine in a lift. When the lift is at rest, the reading on the weighing machine is 700 N. The lift now descends and its speed increases at a constant rate. The reading on the weighing machine...\", \"Is a constant value higher than 700N. \", \"Is a constant value lower than 700N. \", \"Continually increases from 700 N. \", \"Continually decreases from 700 N. \", 2);\n addQuestion(q10);\n\n //Medium Questions\n Questions q11 = new Questions(\"What is Newtons Second Law of Motion?\", \"F = ma\", \"m = Fa\", \"F = a/m\", \"Every action has an equal and opposite reaction\", 1);\n addQuestion(q11);\n Questions q12 = new Questions(\"In s = vt, what does s stand for?\", \"Distance\", \"Speed\", \"Sin\", \"Displacement\", 4);\n addQuestion(q12);\n Questions q13 = new Questions(\"An object reaches terminal velocity when...\", \"Forward force is greater than the frictional force.\", \"All forces acting on that object are equal.\", \"Acceleration starts decreasing.\", \"Acceleration is greater than 0\", 2);\n addQuestion(q13);\n Questions q14 = new Questions(\"An Elastic Collision is where?\", \"There is no loss of Kinetic Energy.\", \"There is a small loss in Kinetic Energy.\", \"There is an increase in Kinetic Energy.\", \"Some Kinetic Energy is transferred to another type.\", 1);\n addQuestion(q14);\n Questions q15 = new Questions(\"The speed of light is?\", \"Different for all observers.\", \"The same for all observers. \", \"The same speed regardless of the medium it is travelling through. \", \"Equal to the speed of sound.\", 2);\n addQuestion(q15);\n Questions q16 = new Questions(\"What is redshift?\", \"Light moving to us, shifting to red. \", \"A dodgy gear change. \", \"Light moving away from us shifting to longer wavelengths.\", \"Another word for dark energy. \", 3);\n addQuestion(q16);\n Questions q17 = new Questions(\"Which law allows us to estimate the age of the universe?\", \"Newtons 3rd Law \", \"The Hubble-Lemaitre Law \", \"Planck's Law \", \"Wien's Law \", 2);\n addQuestion(q17);\n Questions q18 = new Questions(\"The standard model...\", \"Models how time interacts with space. \", \"Describes how entropy works. \", \"Is the 2nd Law of Thermodynamics. \", \"Describes the fundamental particles of the universe and how they interact\", 4);\n addQuestion(q18);\n Questions q19 = new Questions(\"The photoelectric effect gives evidence for?\", \"The wave model of light. \", \"The particle model of light. \", \"The speed of light. \", \"The frequency of light. \", 2);\n addQuestion(q19);\n Questions q20 = new Questions(\"AC is a current which...\", \"Doesn't change direction. \", \"Is often called variable current. \", \"Is sneaky. \", \"Changes direction and instantaneous value with time. \", 4);\n addQuestion(q20);\n\n //Easy Questions\n Questions q21 = new Questions(\"What properties does light display?\", \"Wave\", \"Particle\", \"Both\", \"Neither\", 3);\n addQuestion(q21);\n Questions q22 = new Questions(\"In V = IR, what does V stand for?\", \"Velocity\", \"Voltage\", \"Viscosity\", \"Volume\", 2);\n addQuestion(q22);\n Questions q23 = new Questions(\"The abbreviation rms typically stands for?\", \"Round mean sandwich. \", \"Random manic speed. \", \"Root manic speed. \", \"Root mean squared. \", 4);\n addQuestion(q23);\n Questions q24 = new Questions(\"Path Difference = \", \"= (m/λ) or (m + ½)/λ where m = 0,1,2…\", \"= mλ or (m + ½) λ where m = 0,1,2…\", \"= λ / m or (λ + ½) / m where m = 0,1,2…\", \" = mλ or (m + ½) λ where m = 0.5,1.5,2.5,…\", 2);\n addQuestion(q24);\n Questions q25 = new Questions(\"How many types of quark are there?\", \"6\", \"4 \", \"8\", \"2\", 1);\n addQuestion(q25);\n Questions q26 = new Questions(\"A neutrino is a type of?\", \"Baryon\", \"Gluon\", \"Lepton\", \"Quark\", 3);\n addQuestion(q26);\n Questions q27 = new Questions(\"A moving charge produces:\", \"A weak field\", \"An electric field\", \"A strong field\", \"Another moving charge\", 2);\n addQuestion(q27);\n Questions q28 = new Questions(\"What contains nuclear fusion reactors?\", \"A magnetic field\", \"An electric field\", \"A pool of water\", \"Large amounts of padding\", 1);\n addQuestion(q28);\n Questions q29 = new Questions(\"What is the critical angle of a surface?\", \"The incident angle where the angle of refraction is 45 degrees.\", \"The incident angle where the angle of refraction is 90 degrees.\", \"The incident angle where the angle of refraction is 135 degrees.\", \"The incident angle where the angle of refraction is 180 degrees.\", 2);\n addQuestion(q29);\n Questions q30 = new Questions(\"Which is not a type of Lepton?\", \"Electron\", \"Tau\", \"Gluon\", \"Muon\", 3);\n addQuestion(q30);\n }", "private ArrayList<String> getRandQuestion() \n\t{\t\n\t\tquestionUsed = true;\n\t\t\n\t\tRandom randomizer = new Random();\n\t\tint randIdx = 0;\n\t\t\n\t\tif(questionsUsed.isEmpty())\n\t\t\trandIdx = randomizer.nextInt(allQuestions.size());\n\t\telse\n\t\t{\n\t\t\twhile(questionUsed)\n\t\t\t{\n\t\t\t\trandIdx = randomizer.nextInt(allQuestions.size());\n\t\t\t\tcheckIfQuestionUsed(randIdx);\n\t\t\t}\n\t\t}\n\t\t\n\t\tquestionsUsed.add(randIdx);\n\t\t\n\t\treturn allQuestions.get(randIdx);\n\t}", "private Integer getRandomMapKey() {\r\n\t\tList<Integer> mapKeys = new ArrayList<Integer>(this.compleQuestions.keySet());\r\n\t\tint randomIndex = (int) (Math.random() * mapKeys.size());\r\n\t\treturn mapKeys.get(randomIndex);\r\n\t}", "public Answer randomAnswer()\n\t{\n\t\tRandom random = new Random();\n\t\tint num = random.nextInt(answers.length);\n\t\treturn answers[num];\n\t}", "public void generateNumbers() {\n number1 = (int) (Math.random() * 10) + 1;\n number2 = (int) (Math.random() * 10) + 1;\n operator = (int) (Math.random() * 4) + 1;\n //50% chance whether the displayed answer will be right or wrong\n rightOrWrong = (int) (Math.random() * 2) + 1;\n //calculate the offset of displayed answer for a wrong equation (Error)\n error = (int) (Math.random() * 4) + 1;\n generateEquation();\n }", "public void setIdQuestion(int idT) {\r\n idQuestion=rand(idT);\r\n }", "private void updateQuestion()//update the question each time\n\t{\n\t\tInteger num = random.nextInt(20);\n\t\tcurrentAminoAcid = FULL_NAMES[num];\n\t\tcurrentShortAA= SHORT_NAMES[num];\n\t\tquestionField.setText(\"What is the ONE letter name for:\");\n\t\taminoacid.setText(currentAminoAcid);\n\t\tanswerField.setText(\"\");\n\t\tvalidate();\n\t}", "public void generateRandomQuestions(){\r\n numberHolder = new ArrayList<>(NUMBER_OF_QUESTIONS);\r\n for (int i = 0; i < NUMBER_OF_QUESTIONS; i++)\r\n numberHolder.add(i);\r\n\r\n Collections.shuffle(numberHolder);\r\n System.out.println(numberHolder);\r\n\r\n }", "public void checkAnswerOne() {\n RadioGroup ans1 = findViewById(R.id.radio_gr_q1);\n int radioButtonId = ans1.getCheckedRadioButtonId();\n\n if (radioButtonId == R.id.a2_q1) {\n points++;\n }\n }", "private void initializeAnswers(){\n // Declare a random variable for randomly changing between pictures & random text options\n rand = new Random();\n\n // Set currentanswerbutton to be between 0-3, that way the button storing the correct answer is randomized, but we have 0-3 directly map to each button for deciding which button is correct\n // btntopLeftImage == 0\n // btntopRightImage == 1\n // btnbottomLeftImage == 2\n // btnbottomRightImage == 3\n currentanswerButton = rand.nextInt(4);\n\n // Randomly select a picture's abstracted integer value from the values array and set it to the current answer, then get 3 other values that are incorrect\n currentanswer = rand.nextInt(values.size());\n currentnotAnswer1 = rand.nextInt(values.size());\n currentnotAnswer2= rand.nextInt(values.size());\n currentnotAnswer3 = rand.nextInt(values.size());\n\n // Keep picking new options until none of them are the same to avoid duplicate options\n while ((currentanswer == currentnotAnswer1 || currentanswer == currentnotAnswer2 || currentanswer == currentnotAnswer3) || (currentnotAnswer1 == currentnotAnswer2 || currentnotAnswer1 == currentnotAnswer3) || (currentnotAnswer2== currentnotAnswer3)) {\n currentnotAnswer1 = rand.nextInt(values.size());\n currentnotAnswer2 = rand.nextInt(values.size());\n currentnotAnswer3 = rand.nextInt(values.size());\n }\n\n // Now Determine which button has the correct answer stored in it from the randomly generated int \"currentanswerButton\"\n // Button 1\n if (currentanswerButton == 0) {\n // Once determined set the center of the screen's image background to be the picture that is stored in the values arraylist at index \"currentanswer\"\n image.setBackground(ContextCompat.getDrawable(activity_gamePlay.this, values.get(currentanswer)));\n // Then set the corresponding button's text to be the correct/or incorrect options accordingly\n btntopLeftImage.setText(keys.get(currentanswer));\n btntopRightImage.setText(keys.get(currentnotAnswer1));\n btnbottomLeftImage.setText(keys.get(currentnotAnswer2));\n btnbottomRightImage.setText(keys.get(currentnotAnswer3));\n\n }\n // Same concept as Button 1\n // Button 2\n if (currentanswerButton== 1) {\n image.setBackground(ContextCompat.getDrawable(activity_gamePlay.this, values.get(currentanswer)));\n btntopLeftImage.setText(keys.get(currentnotAnswer1));\n btntopRightImage.setText(keys.get(currentanswer));\n btnbottomLeftImage.setText(keys.get(currentnotAnswer2));\n btnbottomRightImage.setText(keys.get(currentnotAnswer3));\n }\n\n // Same concept as Button 1\n // Button 3\n if (currentanswerButton == 2) {\n image.setBackground(ContextCompat.getDrawable(activity_gamePlay.this, values.get(currentanswer)));\n btntopLeftImage.setText(keys.get(currentnotAnswer1));\n btntopRightImage.setText(keys.get(currentnotAnswer2));\n btnbottomLeftImage.setText(keys.get(currentanswer));\n btnbottomRightImage.setText(keys.get(currentnotAnswer3));\n }\n\n // Same concept as Button 1\n // Button 4\n if (currentanswerButton == 3) {\n image.setBackground(ContextCompat.getDrawable(activity_gamePlay.this, values.get(currentanswer)));\n btntopLeftImage.setText(keys.get(currentnotAnswer1));\n btntopRightImage.setText(keys.get(currentnotAnswer2));\n btnbottomLeftImage.setText(keys.get(currentnotAnswer3));\n btnbottomRightImage.setText(keys.get(currentanswer));\n }\n\n }", "private Answer generateAnswer(int numberOfPossibleAnswers, int numberOfCorrectAnswers) {\n\t\tAnswer answer = new Answer();\n\t\t//check to make sure that an impossible value cannot be passed\n\t\tif(numberOfPossibleAnswers > 9) {\n\t\t\tnumberOfPossibleAnswers = 9;\n\t\t}\n\t\t//check to make sure that an impossible value cannot be passed\n\t\tif(numberOfCorrectAnswers > 9) {\n\t\t\tnumberOfCorrectAnswers = 9;\n\t\t}\n\t\tRandom random = new Random();\n\t\t//if the question can only have one correct answer the student will only choose one answer at random\n\t\tif(numberOfCorrectAnswers == 1) {\n\t\t\tanswer.setAnswer(random.nextInt(numberOfPossibleAnswers));\n\t\t}\n\t\telse if(numberOfCorrectAnswers > 1) {\n\t\t\t//randomly chooses how many answers to give for the question\n\t\t\tint numberOfAnswers = random.nextInt(numberOfPossibleAnswers) + 1;\n\t\t\t//chooses at random which answers to choose\n\t\t\tfor(int i = 0; i < numberOfAnswers; i++) { \n\t\t\t\tint answerId = random.nextInt(numberOfPossibleAnswers);\n\t\t\t\t//if the answer has already been given by the student, the student will choose \n\t\t\t\t//another random answer until it has not already been chosen\n\t\t\t\twhile(answer.getAnswer(answerId)) {\n\t\t\t\t\tanswerId = random.nextInt(numberOfPossibleAnswers);\n\t\t\t\t}\n\t\t\t\tanswer.setAnswer(answerId);\n\t\t\t}\n\t\t}\n\t\treturn answer;\n\t}", "protected void constructNewQuestion(){\n arabicWordScoreItem = wordScoreTable.whatWordToLearn();\n arabicWord = arabicWordScoreItem.word;\n correctAnswer = dictionary.get(arabicWord);\n\n for (int i=0;i<wrongAnswers.length;i++){\n int wrongAnswerId;\n String randomArabicWord;\n String wrongAnswer;\n do {\n wrongAnswerId = constructQuestionRandom.nextInt(next_word_index);\n randomArabicWord = dictionary_key_list.get(wrongAnswerId);\n wrongAnswer = dictionary.get(randomArabicWord);\n } while (wrongAnswer.equals(correctAnswer));\n wrongAnswers[i] = wrongAnswer;\n }\n }", "static void generateQuestions(int numQuestions, int selection, String fileName, String points) {\n String finalAnswers = \"\";\n switch (selection) {\n case 1:\n for (int i = 0; i < numQuestions; i++) {\n finalAnswers += one(points);\n }\n break;\n case 2:\n for (int i = 0; i < numQuestions; i++) {\n finalAnswers += two(points);\n }\n break;\n case 3:\n for (int i = 0; i < numQuestions; i++) {\n finalAnswers += three(points);\n }\n break;\n case 4:\n for (int i = 0; i < numQuestions; i++) {\n finalAnswers += four(points);\n }\n break;\n default:\n System.out.println(\"Wrong selection. Please try again\");\n break;\n }\n writeAnswers(fileName, finalAnswers);\n }", "public void submitAnswers(View view) {\n\n int points = 0;\n\n //Question 1\n RadioButton radioButton_q1 = findViewById (R.id.optionB_q1);\n boolean firstQuestionCorrect = radioButton_q1.isChecked ();\n if (firstQuestionCorrect) {\n points += 1;\n }\n //Question 2\n RadioButton radioButton_q2 = findViewById (R.id.optionC_q2);\n boolean secondQuestionCorrect = radioButton_q2.isChecked ();\n if (secondQuestionCorrect) {\n points += 1;\n }\n\n //Question 3 - in order to get a point in Question 3, three particular boxes has to be checked\n CheckBox checkAns1_q3 = findViewById (R.id.checkbox1_q3);\n boolean thirdQuestionAnswer1 = checkAns1_q3.isChecked ();\n CheckBox checkAns2_q3 = findViewById (R.id.checkbox2_q3);\n boolean thirdQuestionAnswer2 = checkAns2_q3.isChecked ();\n CheckBox checkAns3_q3 = findViewById (R.id.checkbox3_q3);\n boolean thirdQuestionAnswer3 = checkAns3_q3.isChecked ();\n CheckBox checkAns4_q3 = findViewById (R.id.checkbox4_q3);\n boolean thirdQuestionAnswer4 = checkAns4_q3.isChecked ();\n CheckBox checkAns5_q3 = findViewById (R.id.checkbox5_q3);\n boolean thirdQuestionAnswer5 = checkAns5_q3.isChecked ();\n CheckBox checkAns6_q3 = findViewById (R.id.checkbox6_q3);\n boolean thirdQuestionAnswer6 = checkAns6_q3.isChecked ();\n CheckBox checkAns7_q3 = findViewById (R.id.checkbox7_q3);\n boolean thirdQuestionAnswer7 = checkAns7_q3.isChecked ();\n if (thirdQuestionAnswer2 && thirdQuestionAnswer3 && thirdQuestionAnswer6 && !thirdQuestionAnswer1 && !thirdQuestionAnswer4 && !thirdQuestionAnswer5 && !thirdQuestionAnswer7) {\n points = points + 1;\n }\n\n //Question 4\n RadioButton radioButton_q4 = findViewById (R.id.optionC_q4);\n boolean forthQuestionCorrect = radioButton_q4.isChecked ();\n if (forthQuestionCorrect) {\n points += 1;\n }\n\n //Question 5\n EditText fifthAnswer = findViewById (R.id.q5_answer);\n String fifthAnswerText = fifthAnswer.getText ().toString ();\n if (fifthAnswerText.equals (\"\")) {\n Toast.makeText (getApplicationContext (), getString (R.string.noFifthAnswer), Toast.LENGTH_LONG).show ();\n return;\n } else if ((fifthAnswerText.equalsIgnoreCase (getString (R.string.pacific))) || (fifthAnswerText.equalsIgnoreCase (getString (R.string.pacificOcean)))) {\n points += 1;\n }\n\n //Question 6\n RadioButton radioButton_q6 = findViewById (R.id.optionA_q6);\n boolean sixthQuestionCorrect = radioButton_q6.isChecked ();\n if (sixthQuestionCorrect) {\n points += 1;\n }\n\n //Showing the result to the user\n displayScore (points);\n }", "public String printOutQuestion()\n\t{\n\t\tRandom rand = new Random();\n\t\tString[] answers = new String[4];\n\t\tString returnString;\n\t\tanswers[0] = answer;\n\t\tanswers[1] = falseAnswers[0];\n\t\tanswers[2] = falseAnswers[1];\n\t\tanswers[3] = falseAnswers[2];\n\t\tString firstAns = \"\", secondAns = \"\", thirdAns = \"\", fourthAns = \"\";\n\t\t\n\t\twhile(firstAns == secondAns || firstAns == thirdAns || firstAns == fourthAns || secondAns == thirdAns || secondAns == fourthAns || thirdAns == fourthAns)\n\t\t{\n\t\t\tfirstAns = answers[rand.nextInt(4)];\n\t\t//\tSystem.out.println(firstAns); Used for debugging\n\t\t\tsecondAns = answers[rand.nextInt(4)];\n\t\t//\tSystem.out.println(secondAns); Used for debugging\n\t\t\tthirdAns = answers[rand.nextInt(4)];\n\t\t//\tSystem.out.println(thirdAns); Used for debugging\n\t\t\tfourthAns = answers[rand.nextInt(4)];\n\t\t//\tSystem.out.println(fourthAns); Used for debugging\n\t\t}\n\t\t\n\t\tanswerA = firstAns;\n\t\tanswerB = secondAns;\n\t\tanswerC = thirdAns;\n\t\tanswerD = fourthAns;\n\t\t//System.out.println(questionString + \"Answer A: \" + firstAns + \"Answer B: \" + secondAns + \"Answer C: \" + thirdAns + \"Answer D: \" + fourthAns); Used for debugging\n\t\treturnString = questionString + \"?\"; \n\t\tSystem.out.println(\"Actual Answer is: \" + answer);\n\t\treturn returnString;\n\t}", "private void fillQuestionsTable() {\n Question q1 = new Question(\"Who is NOT a Master on the Jedi council?\", \"Anakin Skywalker\", \"Obi Wan Kenobi\", \"Mace Windu\", \"Yoda\", 1);\n Question q2 = new Question(\"Who was Anakin Skywalker's padawan?\", \"Kit Fisto\", \"Ashoka Tano\", \"Barris Ofee\", \"Jacen Solo\",2);\n Question q3 = new Question(\"What Separatist leader liked to make find additions to his collection?\", \"Pong Krell\", \"Count Dooku\", \"General Grevious\", \"Darth Bane\", 3);\n Question q4 = new Question(\"Choose the correct Response:\\n Hello There!\", \"General Kenobi!\", \"You are a bold one!\", \"You never should have come here!\", \"You turned her against me!\", 1);\n Question q5 = new Question(\"What ancient combat technique did Master Obi Wan Kenobi use to his advantage throughout the Clone Wars?\", \"Kendo arts\", \"The High ground\", \"Lightsaber Form VIII\", \"Force healing\", 2);\n Question q6 = new Question(\"What was the only surviving member of Domino squad?\", \"Fives\", \"Heavy\", \"Echo\", \"Jesse\", 3);\n Question q7 = new Question(\"What Jedi brutally murdered children as a part of his descent to become a Sith?\", \"Quinlan Vos\", \"Plo Koon\", \"Kit Fisto\", \"Anakin Skywalker\", 4);\n Question q8 = new Question(\"What Sith was the first to reveal himself to the Jedi after a millenia and was subsquently cut in half shortly after?\", \"Darth Plagieus\", \"Darth Maul\", \"Darth Bane\", \"Darth Cadeus\", 2);\n Question q9 = new Question(\"What 4 armed creature operates a diner on the upper levels of Coruscant?\", \"Dexter Jettster\", \"Cad Bane\", \"Aurua Sing\", \"Dorme Amidala\", 1);\n Question q10 = new Question(\"What ruler fell in love with an underage boy and subsequently married him once he became a Jedi?\", \"Aurua Sing\", \"Duttchess Satine\", \"Mara Jade\", \"Padme Amidala\", 4);\n\n // adds them to the list\n addQuestion(q1);\n addQuestion(q2);\n addQuestion(q3);\n addQuestion(q4);\n addQuestion(q5);\n addQuestion(q6);\n addQuestion(q7);\n addQuestion(q8);\n addQuestion(q9);\n addQuestion(q10);\n }", "static void askQuestion() {\n\t\t// Setting up a Scanner to get user input\n\t\tScanner userInput = new Scanner(System.in);\n\n\t\t// Declaring variables\n\t\tdouble num1, num2, answer, userAnswer;\n\n\t\t// GENERATING QUESTION\n\n\t\t// Getting two new random numbers, rounded to one decimal place (with numbers generation from 0 to 50)\n\t\tnum1 = Math.round((Math.random() * 50)*10.0)/10.0;\n\t\tnum2 = Math.round((Math.random() * 50)*10.0)/10.0;\n\n\t\t// Generating a random number between 1 and 4 to randomize the math operation. A switch case is used to calculate the answer based on the math operation that gets generated.\n\t\tswitch ((int) Math.round(Math.random() * 3 + 1)) {\n\t\t\tcase 1: // Similar structure for each case (and the default case), structured as follows\n\t\t\t\tSystem.out.print(num1 + \" + \" + num2 + \" = \"); // Printing the question (based on the generated operation)\n\t\t\t\tanswer = num1 + num2; // Calculating the answer (based on the generated operation)\n\t\t\t\tbreak; // Exit the switch statement\n\t\t\tcase 2:\n\t\t\t\tSystem.out.print(num1 + \" - \" + num2 + \" = \");\n\t\t\t\tanswer = num1 - num2;\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tSystem.out.print(num1 + \" / \" + num2 + \" = \");\n\t\t\t\tanswer = num1 / num2;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tSystem.out.print(num1 + \" * \" + num2 + \" = \");\n\t\t\t\tanswer = num1 * num2;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tanswer = Math.round(answer * 10.0) / 10.0; // Rounding the answer to one decimal place\n\t\tuserAnswer = userInput.nextDouble(); // Getting the user's answer\n\n\t\tif (answer == userAnswer) System.out.println(\"That's right. Good Job!\\n\"); // If the answers match, the user is correct and the staetment is printed accordingly.\n\t\telse System.out.println(\"Incorrect. The correct answer was \" + answer + \".\\n\"); // Otherwise, show that the user's answer is incorrect and output an according statement.\n\t}", "public void chooseAnswer(View view)\n {\n\n if(view.getTag().toString().equals(Integer.toString(pos_of_correct)))\n {\n //Log.i(\"Result\",\"Correct Answer\");\n correct++;\n noOfQues++;\n correct();\n }\n else\n {\n //Log.i(\"Result\",\"Incorrect Answer\");\n //resluttextview.setText(\"Incorrect!\");\n incorrect();\n noOfQues++;\n }\n pointtextView.setText(Integer.toString(correct)+\"/\"+Integer.toString(noOfQues));\n if(tag==4)\n generateAdditionQuestion();\n if(tag==5)\n generateSubtractionQuestion();\n if(tag==6)\n generateMultiplicationQuestion();\n if(tag==7)\n generateDivisionQuestion();\n\n }", "public int generateQuestionBox() {\n\n if(mGame.isInQuestion()) return 0;\n\n Vector2 relVel = mGame.getPlayer().getVelocity();\n\n QuestionBox e = new QuestionBox();\n e.setRelativeVelocity(relVel);\n e.setPosition(1000, rand.nextInt(mMap.getBottomBound()));\n\n Question question = mQuestionManager.getQuestion(); \n question.setVelocity(relVel.x, relVel.y);\n question.setPosition(mGame.getWidth() / 4, 20);\n question.setOptionsPosition(mGame.getWidth() - 40);\n question.setOptionsRelativeVelocity(relVel);\n question.pack(mGame.getWidth(), mGame.getHeight());\n question.reset();\n\n e.setQuestion(question);\n\n mGame.addEntity(e);\n return e.getWidth();\n }", "@Test\n public void shouldNotGiveQuestionIfAllQuestionsHaveBeenAnswered() {\n attributes.put(FinancialPlanningSpeechlet.GOAL_AMOUNT_KEY, 1000.0);\n attributes.put(FinancialPlanningSpeechlet.MONTHLY_CONTRIBUTION_KEY, 1000.0);\n attributes.put(FinancialPlanningSpeechlet.GOAL_PERIOD_KEY, 1000.0);\n String question = NextQuestionFactory.get(session);\n\n assertThat(question, Is.is(\"\"));\n }", "public int randomizeFirstNumber() {\n a = random.nextInt(100);\n question.setA(a);\n return a;\n }", "private void setquestion() {\n qinit();\n question_count++;\n\n if (modeflag == 3) {\n modetag = (int) (Math.random() * 3);\n } else {\n modetag = modeflag;\n }\n\n WordingIO trueword = new WordingIO(vocabulary);\n\n if (modetag == 0) {\n\n MCmode(trueword);\n }\n\n if (modetag == 1) {\n BFmode(trueword);\n }\n\n if (modetag == 2) {\n TLmode(trueword);\n }\n\n if (time_limit != 0) {\n timingtoanswer(time_limit, jLabel2, answer_temp, jLabel5, jLabel6, jButton1);\n }\n }", "private Question setUpQuestion(List<Question> questionsList){\n int indexOfQuestion = random.nextInt(questionsList.size());\n questionToBeHandled = questionsList.get(indexOfQuestion);\n questionsList.remove(indexOfQuestion);\n return questionToBeHandled;\n }", "public static boolean checkAnswer(int rnd){\r\n\t\t//depending on the random number and what is clicked on by the user, return true or false\r\n\t\t if (rnd==0&&(x>413&&x<703)&&(y>748&&y<838))\r\n\t\t {\r\n\t\t\t return true;\r\n\t\t }\r\n\t\t else if (rnd==1&&(x>406&&x<695)&&(y>558&&y<646))\r\n\t\t {\r\n\t\t\t return true;\r\n\t\t }\r\n\t\t else if (rnd==2&&(x>90&&x<381)&&(y>557&&y<647))\r\n\t\t {\r\n\t\t\t return true;\r\n\t\t }\r\n\t\t else if (rnd==3&&(x>90&&x<381)&&(y>748&&y<838))\r\n\t\t {\r\n\t\t\t return true;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\t return false;\r\n\t\t }\r\n\t}", "public static void generateQuizz(int size)\n {\n nb1 = new int[size];\n nb2 = new int[size];\n answer = new int[size];\n for(int i = 0; i<size; i++)\n {\n nb1[i] = (int)(Math.random()*50+1);\n nb2[i] = (int)(Math.random()*50+1);\n answer[i] = 0;\n }\n \n }", "private int evaluate() {\n return (int) (Math.random() * 8);\n }", "public void setSingleChoices() {\r\n Random randomGenerator = new Random();\r\n int singleAnswer = randomGenerator.nextInt(4);\r\n studentAnswer.add(singleAnswer); }", "public final static int pointsToAdd(TemporaryChar temp)\n\t{\n\t\tint randomIndex;\n\t\tchar charAnswer;\n\t\tint intAnswer;\n\t\tif (temp.symbol == GameConstants.easyQuestionsSymbol)\n\t\t{\n\t\t\trandomIndex=Global.rand.nextInt(Database.EASYQUESTIONS.length);\n\t\t\twhile (Database.EASYQUESTIONS[randomIndex].haveBeenUsed() == true)\n\t\t\t{\n\t\t\t\trandomIndex = Global.rand.nextInt(Database.EASYQUESTIONS.length);\n\t\t\t}\n\t\t\tSystem.out.println(Database.EASYQUESTIONS[randomIndex].toString());\n\t\t\tDatabase.EASYQUESTIONS[randomIndex].setToUsed();\n\t\t\tcharAnswer=Global.sc.next(\".\").charAt(0);\n\t\t\tif (Database.EASYQUESTIONS[randomIndex].isTrue(charAnswer))\n\t\t\t{\n\t\t\t\treturn GameConstants.easyQuestionsPoints;\n\t\t\t}\n\t\t}\n\n\t\tif (temp.symbol == GameConstants.mediumQuestionsSymbol)\n\t\t{\n\t\t\trandomIndex=Global.rand.nextInt(Database.MEDIUMQUESTIONS.length);\n\t\t\twhile (Database.MEDIUMQUESTIONS[randomIndex].haveBeenUsed() == true)\n\t\t\t{\n\t\t\t\trandomIndex = Global.rand.nextInt(Database.MEDIUMQUESTIONS.length);\n\t\t\t}\n\t\t\tSystem.out.println(Database.MEDIUMQUESTIONS[randomIndex].toString());\n\t\t\tDatabase.MEDIUMQUESTIONS[randomIndex].setToUsed();\n\t\t\tcharAnswer=Global.sc.next(\".\").charAt(0);\n\t\t\tif (Database.MEDIUMQUESTIONS[randomIndex].isTrue(charAnswer))\n\t\t\t{\n\t\t\t\treturn GameConstants.mediumQuestionsPoints;\n\t\t\t}\n\t\t}\n\n\n\t\tif (temp.symbol == GameConstants.hardQuestionsSymbol)\n\t\t{\n\n\t\t\trandomIndex=Global.rand.nextInt(Database.HARDQUESTIONS.length);\n\t\t\twhile (Database.HARDQUESTIONS[randomIndex].haveBeenUsed() == true)\n\t\t\t{\n\t\t\t\trandomIndex = Global.rand.nextInt(Database.HARDQUESTIONS.length);\n\t\t\t}\n\t\t\tSystem.out.println(\"Please enter an integer: \");\n\t\t\tSystem.out.println(Database.HARDQUESTIONS[randomIndex].toString());\n\t\t\tDatabase.HARDQUESTIONS[randomIndex].setToUsed();\n\t\t\tintAnswer=Global.sc.nextInt();\n\t\t\tif (Database.HARDQUESTIONS[randomIndex].isTrue(intAnswer))\n\t\t\t{\n\t\t\t\treturn GameConstants.hardQuestionsPoints;\n\t\t\t}\n\t\t\t/**\n\t\t\t * If the answer is wrong checks if it is at least 10% close to the real answer. \n\t\t\t * */\n\t\t\telse \n\t\t\t{\n\t\t\t\tif (Database.HARDQUESTIONS[randomIndex].isCloseToAnswer(intAnswer))\n\t\t\t\t{\n\t\t\t\t\treturn GameConstants.hardQuestionsNotFullPoints;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\n\n\n\n\n\t}", "public static ArrayList<String> generateQ(int num, String op){\r\n //Calls the RandomQuestion from the KeyFunctions Class\r\n //Rounding -> \"^\"\r\n //Algebra -> \"Alg\"\r\n //Percentages -> \"%\"\r\n //Ratio -> \":\"\r\n //Fraction -> \"//\"\r\n \r\n bothList = new ArrayList<String>();\r\n if (op.equals(\"+\")||op.equals(\"-\")||op.equals(\"*\")||op.equals(\"/\")){\r\n for (int i = 1; i <= num; i++){\r\n String[] x = randomQuestionKS2(op);\r\n\r\n bothList.add(x[0]);\r\n bothList.add(x[1]);\r\n }}\r\n \r\n if (op.equals(\"^\")||op.equals(\"Alg\")||op.equals(\"%\")||op.equals(\":\")||op.equals(\"//\")){\r\n for (int i = 1; i <= num; i++){\r\n String[] x = randomQuestions(op);\r\n \r\n bothList.add(x[0]);\r\n bothList.add(x[1]);\r\n }}\r\n \r\n //System.out.print(questionList);\r\n //System.out.print(answerList);\r\n //System.out.print(bothList);\r\n return bothList;\r\n \r\n }", "public void setQuestion(){\n\n\n triggerReport(); //Check if max questions are displayed, if yes then show report\n\n MyDatabase db = new MyDatabase(QuizCorner.this);\n Cursor words = db.getQuizQuestion();\n TextView question_text = (TextView) findViewById(R.id.question_text);\n RadioButton rb;\n resetOptions();\n disableCheck();\n enableRadioButtons();\n hideAnswer();\n words.moveToFirst();\n word = words.getString(words.getColumnIndex(\"word\"));\n correct_answer = words.getString(words.getColumnIndex(\"meaning\"));\n question_text.setText(word + \" means:\");\n for (int i = 0; i < 4; i++){\n answers[i] = words.getString(words.getColumnIndex(\"meaning\"));\n words.moveToNext();\n }\n answers = randomizeArray(answers);\n for (int i = 0; i < 4; i++){\n rb = (RadioButton) findViewById(options[i]);\n rb.setText(answers[i]);\n }\n question_displayed_count++;\n }", "public static int physicsQuestions(int physicsPathway) {\r\n int questionNumber = (int) (Math.random() * 20) + 1;\r\n\r\n switch (questionNumber) {\r\n case 1:\r\n System.out.println(\r\n \"The term kinematics is best described as (1.1)\\r\\n\" + \"1.) A term used to quantify motion\\r\\n\"\r\n + \"2.) The study of a position \\r\\n\" + \"3.) The study of how objects move\\r\\n\"\r\n + \"4.) A term used to quantify inertia\\r\\n\");\r\n break;\r\n case 2:\r\n System.out.println(\r\n \"For a straight line on a position-time graph, the rise refers to the change in quantity? (1.2)\\r\\n\"\r\n + \"1.) Slope\\r\\n\" + \"2.) Time \\r\\n\" + \"3.) Velocity\\r\\n\" + \"4.) Position \\r\\n\");\r\n break;\r\n case 3:\r\n System.out.println(\r\n \"A river has a current of 2.3 m/s. A man points his boat so that it is directed straight across the river. In still water, the boat can move with a speed of 3.2 m/s. What is the average speed of the boat while travelling across the river? (2.2)\\r\\n\"\r\n + \"1.) 1.1 m/s\\r\\n\" + \"2.) 2.8 m/s\\r\\n\" + \"3.) 3.9 m/s\\r\\n\" + \"4.) 5.5 m/s\\r\\n\");\r\n break;\r\n case 4:\r\n System.out.println(\r\n \"A basketball is shot with an initial velocity of 16 m/s at an angle of 55°. What is the approximate horizontal distance that the ball travels in 1.5 s? (2.2, 2.3)\\r\\n\"\r\n + \"1.) 9.1 m\\r\\n\" + \"2.) 13 m\\r\\n\" + \"3.) 14 m\\r\\n\" + \"4.) 20 m\\r\\n\");\r\n break;\r\n case 5:\r\n System.out.println(\r\n \"Which of the following forces is caused by the electric charges of particles? (3.1)\\r\\n\"\r\n + \"1.) Electromagnetic\\r\\n\" + \"2.) Ravitational\\r\\n\" + \"3.) Weak nuclear\\r\\n\"\r\n + \"4.) Strong nuclear\\r\\n\");\r\n break;\r\n case 6:\r\n System.out.println(\r\n \"What is the net force experienced by a 20.0 kg object that accelerates at a rate of 4.0 m/s²? (3.3)\\r\\n\"\r\n + \"1.) 80 N\\r\\n\" + \"2.) 60 N\\r\\n\" + \"3.) 800 N\\r\\n\" + \"4.) 5.0 N\\r\\n\");\r\n break;\r\n case 7:\r\n System.out.println(\r\n \"Which of the following scenarios will result in the largest amount of frictional force from the air? (4.1)\\r\\n\"\r\n + \"1.) A small surface area moving slowly \\r\\n\"\r\n + \"2.) A small surface area moving rapidly\\r\\n\"\r\n + \"3.) A large surface area moving slowly\\r\\n\"\r\n + \"4.) A large surface area moving rapidly\\r\\n\");\r\n break;\r\n case 8:\r\n System.out.println(\r\n \"Two blocks, at 4.0 kg and 5.0 kg, are suspended from the ceiling by a piece of string. What is the tension in the string? (3.5)\\r\\n\"\r\n + \"1.) 9.0 N\\r\\n\" + \"2.) 88 kg\\r\\n\" + \"3.) 88 N\\r\\n\" + \"4.) 49 N\\r\\n\");\r\n break;\r\n case 9:\r\n System.out.println(\r\n \"The type of energy possessed by moving objects is (5.2)\\r\\n\" + \"1.) Kinetic energy\\r\\n\"\r\n + \"2.) Potential energy\\r\\n\" + \"3.) Chemical energy\\r\\n\" + \"4.) Work energy \\r\\n\");\r\n break;\r\n case 10:\r\n System.out.println(\r\n \"What power input is needed for a 70.0 kg person to go up 5.00m of stairs in 2.00s? (5.5)\\r\\n\"\r\n + \"1.) 3430 J\\r\\n\" + \"2.) 175 J\\r\\n\" + \"3.) 1720 J\\r\\n\" + \"4.) 340 J\\r\\n\");\r\n break;\r\n case 11:\r\n System.out.println(\r\n \"The term used to describe the transfer of thermal energy that occurs when warmer objects are in physical contact with colder objects is (6.2)\\r\\n\"\r\n + \"1.) Thermal convection\\r\\n\" + \"2.) Thermal induction\\r\\n\" + \"3.) Thermal radiation \\r\\n\"\r\n + \"4.) Thermal conduction\\r\\n\");\r\n break;\r\n case 12:\r\n System.out.println(\r\n \"An increase in the motion of the particles that make up a substance will have what effect? (6.1)\\r\\n\"\r\n + \"1.) It will make the substance warmer\\r\\n\" + \"2.) It will make the substance colder\\r\\n\"\r\n + \"3.) It will make the substance spin\\r\\n\"\r\n + \"4.) It will not have any effect on the subject\\r\\n\");\r\n break;\r\n case 13:\r\n System.out.println(\r\n \"Which of the following statements is true of amplitude? (9.4)\\r\\n\"\r\n + \"1.) When the difference between the frequency of a wave and its natural frequency increases, the amplitude of a wave increases.\\r\\n\"\r\n + \"2.) A decrease in wave energy decreases a wave’s amplitude.\\r\\n\"\r\n + \"3.) When damping is increased, the amplitude of a wave increases\\r\\n\"\r\n + \"4.) When a system vibrates close to a harmonic, resonance occurs and the amplitude of the observed vibration decreases.\\r\\n\");\r\n break;\r\n case 14:\r\n System.out.println(\r\n \"If you know the linear density of a violin string and want to calculate the speed of a wave on the violin string, which additional information is needed? (8.4)\\r\\n\"\r\n + \"1.) Tension on the string\\r\\n\" + \"2.) Temperature of the string\\r\\n\"\r\n + \"3.) Time to complete a cycle\\r\\n\" + \"4.) Density of the violin’s sounding board\\r\\n\");\r\n break;\r\n case 15:\r\n System.out.println(\r\n \"When two waves meet, one with amplitude of 4 cm and the other with amplitude 2 cm, what are the possible maximum and minimum amplitudes of the resulting wave? (9.1)\\r\\n\"\r\n + \"1.) Maximum 6 cm, minimum 2 cm\\r\\n\" + \"2.) Maximum 4 cm, minimum 2 cm\\r\\n\"\r\n + \"3.) Maximum 8 cm, minimum 0.5 cm\\r\\n\" + \"4.) Maximum 6 cm, minimum 6 cm\\r\\n\");\r\n break;\r\n case 16:\r\n System.out.println(\r\n \"A truck is travelling at 30 m/s toward a stationary observer. If the truck sounds its horn at a frequency of 700 Hz, what frequency does the observer detect? (Use 340 m/s as the speed of sound.) (9.5)\\r\\n\"\r\n + \"1.) 638 Hz\\r\\n\" + \"2.) 643 Hz\\r\\n\" + \"3.) 762 Hz\\r\\n\" + \"4.) 767 Hz\\r\\n\");\r\n break;\r\n case 17:\r\n System.out.println(\r\n \"Which of the following is a unit of electrical energy? (11.1)\\r\\n\" + \"1.) Watt\\r\\n\"\r\n + \"2.) Volt \\r\\n\" + \"3.) Joule\\r\\n\" + \"4.) Ohm\\r\\n\");\r\n break;\r\n case 18:\r\n System.out.println(\r\n \"If an external magnetic field is pointing to the right and the current in a wire is pointing out of the page, in which direction is the force on the wire? (12.5)\\r\\n\"\r\n + \"1.) Upward\\r\\n\" + \"2.) Downward\\r\\n\" + \"3.) Left\\r\\n\" + \"4.) Into the page\\r\\n\");\r\n break;\r\n case 19:\r\n System.out.println(\r\n \"Magnetic field lines (12.1)\\r\\n\" + \"1.) Are stronger at the poles\\r\\n\"\r\n + \"2.) Can cross one another\\r\\n\" + \"3.) Are affected by gravity\\r\\n\"\r\n + \"4.) Exist in two dimensions only\\r\\n\");\r\n break;\r\n case 20:\r\n System.out.println(\r\n \"Which device is used to measure the resistance of a load? (11.3, 11.5, 11.7)\\r\\n\"\r\n + \"1.) Galvanometer\\r\\n\" + \"2.) Voltmeter\\r\\n\" + \"3.) Ohmmeter\\r\\n\" + \"4.) Ammeter\\r\\n\");\r\n break;\r\n }\r\n\r\n return questionNumber;\r\n }", "public static void Random() {\n\t\tRandom ran =new Random();\r\n\t\trandom=ran.nextInt(6)+1;\r\n\t\t//random=1;\r\n\t\twho=A1063307_GUI.who2;\r\n\t\tif((ch[who].status)>0) {\r\n\t\t\tch[who].location=(ch[who].location)+random;\r\n\t\t\tch[who].status=(ch[who].status)-1;\r\n\t\t\t\r\n\t\t}else {\r\n\t\t\t\treturn;\r\n\t\t\t}\t\t\r\n\t}", "public static void main(String[] args) {\n\r\n\t\tRandom rr=new Random();\r\n\t\t\r\n\t\tSystem.out.println(Math.random());//[0,1)\r\n\t\t \r\n\t\t// 第一种情况 int(强转之后最终的值一定是0)\r\n\t\t// 第二种情况 int(强转之后将小数点舍去 1-5)\r\n\t\tSystem.out.println((int)Math.random()*5);//0.99*5永远到不了5\r\n\t\tSystem.out.println((int)(Math.random()*5+1));//[1,5.)\r\n\t\t\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\t\r\n\t\tfor(int i=0;i<=20;i++){\r\n\t\t\tSystem.out.print(i%7+\"-\");\r\n\t\t\t\r\n\t\t}\r\n\t\t//1-M的随机产生\r\n\t\t//(int)(Math.random()*M+1)\r\n\t\t\r\n\t\t\r\n\t\t//产生0 1的概率不同 Math.random()<p?0:1\r\n\t\tSystem.out.println(\"----\"+rr.rand01p());\r\n\t\tSystem.out.println(\"----\"+rr.rand01());\r\n\t\tfor(int i=0;i<=11;i++){\r\n\t\t\tSystem.out.print(i%6+\"-\");\r\n\t\t \t\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(rr.rand106());\r\n\t}", "public void loadQuestion() {\r\n\r\n //getting the number of the question stored in variable r\r\n //making sure that a question is not loaded up if the count exceeds the number of total questions\r\n if(count <NUMBER_OF_QUESTIONS) {\r\n int r = numberHolder.get(count);\r\n //creating object that will access the QuestionStore class and retrieve values and passing the value of the random question number to the class\r\n QuestionStore qs = new QuestionStore(r);\r\n //calling methods in order to fill up question text and mutliple choices and load the answer\r\n qs.storeQuestions();\r\n qs.storeChoices();\r\n qs.storeAnswers();\r\n //setting the question and multiple choices\r\n\r\n q.setText(qs.getQuestion());\r\n c1.setText(qs.getChoice1());\r\n c2.setText(qs.getChoice2());\r\n c3.setText(qs.getChoice3());\r\n answer = qs.getAnswer();\r\n }\r\n else{\r\n endGame();\r\n }\r\n\r\n\r\n\r\n\r\n }", "@Ignore\n @Test\n public void shouldNotGiveQuestionIfAllQuestionsHaveBeenAnsweredWithInts() {\n attributes.put(FinancialPlanningSpeechlet.GOAL_AMOUNT_KEY, 1000);\n attributes.put(FinancialPlanningSpeechlet.MONTHLY_CONTRIBUTION_KEY, 1000);\n attributes.put(FinancialPlanningSpeechlet.GOAL_PERIOD_KEY, 1000);\n String question = NextQuestionFactory.get(session);\n\n assertThat(question, Is.is(\"\"));\n }", "private void newQuestion(int number) {\n bakeImageView.setImageResource(list.get(number - 1).getImage());\n\n //decide which button to place the correct answer\n int correct_answer = r.nextInt(4) + 1;\n\n int firstButton = number - 1;\n int secondButton;\n int thirdButton;\n int fourthButton;\n\n switch (correct_answer) {\n case 1:\n answer1Button.setText(list.get(firstButton).getName());\n\n do {\n secondButton = r.nextInt(list.size());\n } while (secondButton == firstButton);\n do {\n thirdButton = r.nextInt(list.size());\n } while (thirdButton == firstButton || thirdButton == secondButton);\n do {\n fourthButton = r.nextInt(list.size());\n } while (fourthButton == firstButton || fourthButton == secondButton || fourthButton == thirdButton);\n\n answer2Button.setText(list.get(secondButton).getName());\n answer3Button.setText(list.get(thirdButton).getName());\n answer4Button.setText(list.get(fourthButton).getName());\n\n break;\n\n case 2:\n answer2Button.setText(list.get(firstButton).getName());\n\n do {\n secondButton = r.nextInt(list.size());\n } while (secondButton == firstButton);\n do {\n thirdButton = r.nextInt(list.size());\n } while (thirdButton == firstButton || thirdButton == secondButton);\n do {\n fourthButton = r.nextInt(list.size());\n } while (fourthButton == firstButton || fourthButton == secondButton || fourthButton == thirdButton);\n\n answer1Button.setText(list.get(secondButton).getName());\n answer3Button.setText(list.get(thirdButton).getName());\n answer4Button.setText(list.get(fourthButton).getName());\n\n break;\n\n case 3:\n answer3Button.setText(list.get(firstButton).getName());\n\n do {\n secondButton = r.nextInt(list.size());\n } while (secondButton == firstButton);\n do {\n thirdButton = r.nextInt(list.size());\n } while (thirdButton == firstButton || thirdButton == secondButton);\n do {\n fourthButton = r.nextInt(list.size());\n } while (fourthButton == firstButton || fourthButton == secondButton || fourthButton == thirdButton);\n\n answer2Button.setText(list.get(secondButton).getName());\n answer1Button.setText(list.get(thirdButton).getName());\n answer4Button.setText(list.get(fourthButton).getName());\n\n\n break;\n\n case 4:\n answer4Button.setText(list.get(firstButton).getName());\n\n do {\n secondButton = r.nextInt(list.size());\n } while (secondButton == firstButton);\n do {\n thirdButton = r.nextInt(list.size());\n } while (thirdButton == firstButton || thirdButton == secondButton);\n do {\n fourthButton = r.nextInt(list.size());\n } while (fourthButton == firstButton || fourthButton == secondButton || fourthButton == thirdButton);\n\n answer2Button.setText(list.get(secondButton).getName());\n answer3Button.setText(list.get(thirdButton).getName());\n answer1Button.setText(list.get(fourthButton).getName());\n\n break;\n }\n }", "Question getQuest(String topic){\r\n\t\thasQ = false;\r\n\t\twhile(!hasQ){\r\n\t\t\trandNo = rand.nextInt(bank.get(topic).size());\r\n\t\t\tif(!bank.get(topic).get(randNo).getAsked()){\r\n\t\t\t\tbank.get(topic).get(randNo).setAsked(true);\r\n\t\t\t\treturn bank.get(topic).get(randNo);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "private String generateAnswer() throws IOException {\n int j = lineNumber();\n int i = 0;\n String result = \"\";\n Random rnd = new Random();\n int rndNumber = rnd.nextInt(j);\n File answers = new File(this.settings.getValue(\"botAnswerFile\"));\n try (RandomAccessFile raf = new RandomAccessFile(answers, \"r\")) {\n while (raf.getFilePointer() != raf.length()) {\n result = raf.readLine();\n i++;\n if ((i - 1) == rndNumber) {\n break;\n }\n }\n }\n return result;\n }", "public Area GetNextAreaRandom(Area area)\n\n {\n\n Random rand = new Random();\n\n int i = 0;\n\n switch(area.paths)\n\n {\n\n case Constants.North:\n\n i = rand.nextInt(2);\n\n if(i==0)\n\n return area.areaMap.get(Constants.North);\n\n if(i==1)\n\n return area;\n\n case Constants.South:\n\n if(i==0)\n\n return area.areaMap.get(Constants.South);\n\n if(i==1)\n\n return area;\n\n \n\n case Constants.East:\n\n if(i==0)\n\n return area.areaMap.get(Constants.East);\n\n if(i==1)\n\n return area;\n\n \n\n case Constants.West:\n\n if(i==0)\n\n return area.areaMap.get(Constants.West);\n\n if(i==1)\n\n return area;\n\n \n\n \n\n case Constants.NorthAndSouth:\n\n i = rand.nextInt(3);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.North);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.South);\n\n if(i == 2)\n\n return area;\n\n case Constants.NorthAndEast:\n\n i = rand.nextInt(3);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.North);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.East);\n\n if(i == 2)\n\n return area;\n\n case Constants.NorthAndWest:\n\n i = rand.nextInt(3);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.North);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.West);\n\n if(i == 2)\n\n return area;\n\n case Constants.SouthAndEast:\n\n i = rand.nextInt(3);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.East);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.South);\n\n if(i == 2)\n\n return area;\n\n case Constants.SouthAndWest:\n\n i = rand.nextInt(3);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.West);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.South);\n\n if(i == 2)\n\n return area;\n\n case Constants.EastAndWest:\n\n i = rand.nextInt(3);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.East);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.West);\n\n if(i == 2)\n\n return area;\n\n case Constants.NorthSouthAndEast:\n\n i = rand.nextInt(4);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.North);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.South);\n\n if(i == 2)\n\n return area.areaMap.get(Constants.East);\n\n if(i == 3)\n\n return area;\n\n case Constants.NorthSouthAndWest:\n\n i = rand.nextInt(4);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.North);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.South);\n\n if(i == 2)\n\n return area.areaMap.get(Constants.West);\n\n if(i == 3)\n\n return area;\n\n case Constants.NorthEastAndWest:\n\n i = rand.nextInt(4);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.North);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.East);\n\n if(i == 2)\n\n return area.areaMap.get(Constants.West);\n\n if(i == 3)\n\n return area;\n\n case Constants.SouthEastAndWest:\n\n i = rand.nextInt(4);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.West);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.South);\n\n if(i == 2)\n\n return area.areaMap.get(Constants.East);\n\n if(i == 3)\n\n return area;\n\n \n\n case Constants.NorthSouthEastAndWest:\n\n i = rand.nextInt(5);\n\n if(i == 0)\n\n return area.areaMap.get(Constants.West);\n\n if(i == 1)\n\n return area.areaMap.get(Constants.South);\n\n if(i == 2)\n\n return area.areaMap.get(Constants.North);\n\n if(i == 3)\n\n return area.areaMap.get(Constants.East);\n\n if(i == 4)\n\n return area;\n\n }\n\n \n\n return area;\n\n \n\n \n\n }", "public void generateQ(){\n\t\t\tq = wsum.add(BigInteger.ONE);\n\t}", "public float randomQual() {\n\t\treturn((float) getRandomInteger(30,250));\n\t}", "public void randomlySetAllQR() {\n\t\tfor (int q = -3; q <=3; q++) {\r\n\t\t\tfor (int r = -3; r <=3; r++) {\r\n\t\t\t\tsetHexFromQR(q,r, new HexModel(HexModel.TileType.DesertTile));\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void evaluateQuestions() {\n RadioGroup groupTwo = findViewById(R.id.radioGroupQ2);\n int groupTwoId = groupTwo.getCheckedRadioButtonId();\n\n // Get the ID of radio group 6 to ascertain if a radio button has been ticked\n RadioGroup groupSix = findViewById(R.id.radioGroupQ6);\n int groupSixId = groupSix.getCheckedRadioButtonId();\n\n // Get the ID of radio group 7 to ascertain if a radio button has been ticked\n RadioGroup groupSeven = findViewById(R.id.radioGroupQ7);\n int groupSevenId = groupSeven.getCheckedRadioButtonId();\n\n // Taking in the vale of any question that has been checked in question 3 and storing it\n CheckBox question3Option1 = findViewById(R.id.question_three_option1);\n boolean stateOfQuestion3_option1 = question3Option1.isChecked();\n CheckBox question3Option2 = findViewById(R.id.question_three_option2);\n boolean stateOfQuestion3Option2 = question3Option2.isChecked();\n CheckBox question3Option3 = findViewById(R.id.question_three_option3);\n boolean stateOfQuestion3Option3 = question3Option3.isChecked();\n CheckBox question3Option4 = findViewById(R.id.question_three_option4);\n boolean stateOfQuestion3Option4 = question3Option4.isChecked();\n\n // Taking in the value of any question that has been checked in question 4 and storing it\n CheckBox question4Option1 = findViewById(R.id.question_four_option1);\n boolean stateOfQuestion4Option1 = question4Option1.isChecked();\n CheckBox question4Option2 = findViewById(R.id.question_four_option2);\n boolean stateOfQuestion4Option2 = question4Option2.isChecked();\n CheckBox question4Option3 = findViewById(R.id.question_four_option3);\n boolean stateOfQuestion4Option3 = question4Option3.isChecked();\n CheckBox question4Option4 = findViewById(R.id.question_four_option4);\n boolean stateOfQuestion4Option4 = question4Option4.isChecked();\n\n // Taking in the vale of any question that has been checked in question 8 and storing it\n CheckBox question8Option1 = findViewById(R.id.question_eight_option1);\n boolean stateOfQuestion8Option1 = question8Option1.isChecked();\n CheckBox question8Option2 = findViewById(R.id.question_eight_option2);\n boolean stateOfQuestion8Option2 = question8Option2.isChecked();\n CheckBox question8Option3 = findViewById(R.id.question_eight_option3);\n boolean stateOfQuestion8Option3 = question8Option3.isChecked();\n CheckBox question8Option4 = findViewById(R.id.question_eight_option4);\n boolean stateOfQuestion8Option4 = question8Option4.isChecked();\n\n // Getting all EditText fields\n\n EditText questText1 = findViewById(R.id.question_one_field);\n String question1 = questText1.getText().toString();\n\n\n EditText questText5 = findViewById(R.id.question_five_field);\n String question5 = questText5.getText().toString();\n\n EditText questText9 = findViewById(R.id.question_nine_field);\n String question9 = questText9.getText().toString();\n\n // Variable parameters for calculateRadiobutton method\n\n RadioButton quest2_opt3 = findViewById(R.id.question_two_option3);\n boolean question2_option3 = quest2_opt3.isChecked();\n\n RadioButton quest6_opt1 = findViewById(R.id.question_six_option2);\n boolean question6_option2= quest6_opt1.isChecked();\n\n RadioButton quest7_opt1 = findViewById(R.id.question_seven_option1);\n boolean question7_option1 = quest7_opt1.isChecked();\n\n // Store all checked parameter to ascertain that at least one option was ticked in\n // question 3\n boolean question3 = stateOfQuestion3_option1 || stateOfQuestion3Option2 ||\n stateOfQuestion3Option3 || stateOfQuestion3Option4;\n\n\n // Store all checked parameter to ascertain that at least one option was ticked in\n // question 4\n boolean question4 = stateOfQuestion4Option1 || stateOfQuestion4Option2 || stateOfQuestion4Option3 ||\n stateOfQuestion4Option4;\n\n\n // Store all checked parameter to ascertain that at least one option was ticked in\n // question 8\n boolean question8 = stateOfQuestion8Option1 || stateOfQuestion8Option2 ||\n stateOfQuestion8Option3 || stateOfQuestion8Option4;\n\n // if no radio button has been checked in radio group 2 after submit button has been clicked\n if ( groupTwoId == -1) {\n Toast.makeText(this, \"Please pick an answer in question 2\",\n Toast.LENGTH_SHORT).show();\n }\n\n // if no radio button has been clicked in radio group 6 after submit button has been clicked\n else if (groupSixId == -1) {\n Toast.makeText(this, \"Please pick an answer to question 6\",\n Toast.LENGTH_SHORT).show();\n }\n\n // if no radio button has been clicked in radio group 7 after submit button has been clicked\n else if (groupSevenId == -1) {\n Toast.makeText(this, \"Please pick an answer to question 7\",\n Toast.LENGTH_SHORT).show();\n }\n\n // if no checkbox was clicked in question 3 after submit button has been clicked\n else if (!question3) {\n Toast.makeText(this, \"Please select an answer to question 3\",\n Toast.LENGTH_SHORT).show();\n }\n\n // if no checkbox was clicked in question 4 after submit button has been clicked\n else if (!question4) {\n Toast.makeText(this, \"Please select an answer to question 4\",\n Toast.LENGTH_SHORT).show();\n\n }\n\n // if no checkbox was clicked in question 8 after submit button has been clicked\n else if (!question8) {\n Toast.makeText(this, \"Please select an answer to question 8\",\n Toast.LENGTH_SHORT).show();\n }\n\n // check if the questions has been answered without hitting the reset button\n else if (checkSubmit > 0) {\n Toast.makeText(this, \"Press the reset button\",\n Toast.LENGTH_SHORT).show();\n } else {\n //Add one to checkSubmit variable to avoid the score from being recalculated and added to\n // the previous score if the submit button was pressed more than once.\n checkSubmit += 1;\n\n // calculate all checkboxes by calling calculateCheckboxes method\n calculateScoreForCheckBoxes( stateOfQuestion3_option1, stateOfQuestion3Option3,stateOfQuestion3Option4,\n stateOfQuestion4Option1, stateOfQuestion4Option2, stateOfQuestion4Option4,\n stateOfQuestion8Option1, stateOfQuestion8Option3);\n\n // calculate all radio buttons by calling calculateRadioButtons method\n calculateScoreForRadioButtons(question2_option3, question6_option2, question7_option1);\n\n // calculate all Text inputs by calling editTextAnswers method\n calculateScoreForEditTextAnswers(question1,question5, question9);\n\n displayScore(score);\n\n String grade;\n\n if (score < 10) {\n grade = \"Meh...\";\n } else if (score >=10 && score <=14) {\n grade = \"Average\";\n } else if ((score >= 15) && (19 >= score)) {\n grade = \"Impressive!\";\n } else {\n grade = \"Excellent!\";\n }\n\n // Display a toast message to show total score\n Toast.makeText(this, grade + \" your score is \" + score + \"\",\n Toast.LENGTH_SHORT).show();\n }\n }", "public void shuffle () {\n this.lives = 6;\n this.attempts.clear();\n this.victory = false;\n this.lose = false;\n Random r = new Random ();\n this._word = _dictionary[r.nextInt(_dictionary.length)];\n // this._word = _dictionary[2]; // Testing purposes\n this.hint.setLength(0);\n for (int i = 0; i < _word.length(); i++) {\n this.hint.append(\"_ \");\n } \n }", "public String answerQuestions(int qNumber, Tile[] tile1, \n\t\t\t\t\t\t\t\tTile[] tile2, Tile[] tile3) {\n\t\t\n\t\tint sum = 0;\n\t\tint sumRack1 = 0;\n\t\tint sumRack2 = 0;\n\t\tint sumRack3 = 0;\n\t\tint answerSum = 0;\n\t\tString more = \"\";\n\t\tArrayList<Tile> allCards = new ArrayList<Tile>();\n\t\tint ySevens = 0;\n\t\tint gSixes = 0;\n\t\tint rSixes = 0;\n\t\tint blues = 0;\n\t\tint oranges = 0;\n\t\tint browns = 0;\n\t\tint reds = 0;\n\t\tint blacks = 0;\n\t\tint greens = 0;\n\t\tint yellows = 0;\n\t\t\n\t\t// question number that's being asked\n\t\tswitch(qNumber) {\n\t\t\n\t\tcase 1:\n\t\t\t\n\t\t\tfor(int i = 0; i < tile1.length; i++) {\n\t\t\t\tsumRack1 = sumRack1 + tile1[i].getNumber();\n\t\t\t}\n\t\t\tif(sumRack1 >= 18) {\n\t\t\t\tanswerSum++;\n\t\t\t}\n\t\t\t\n\t\t\tfor (int i = 0; i < tile2.length; i++) {\n\t\t\t\tsumRack2 = sumRack2 + tile2[i].getNumber();\n\t\t\t}\n\t\t\tif(sumRack2 >= 18) {\n\t\t\t\tanswerSum++;\n\t\t\t}\n\t\t\t\n\t\t\tfor (int i = 0; i < tile3.length; i++) {\n\t\t\t\tsumRack3 = sumRack3 + tile3[i].getNumber();\n\t\t\t}\n\t\t\tif(sumRack3 >= 18) {\n\t\t\t\tanswerSum++;\n\t\t\t}\n\t\t\tanswer = \"On \" + answerSum + \" racks\";\n\t\t\tbreak;\n\t\t\n\t\tcase 2:\n\t\t\t\n\t\t\tfor (int i = 0; i < tile1.length; i++) {\n\t\t\t\tsum = sum + tile1[i].getNumber();\n\t\t\t}\n\t\t\tif (sum <= 12) {\n\t\t\t\tanswerSum++;\n\t\t\t}\n\t\t\t\n\t\t\tsum = 0;\n\t\t\tfor (int i = 0; i < tile2.length; i++) {\n\t\t\t\tsum = sum + tile2[i].getNumber();\n\t\t\t}\n\t\t\tif (sum <= 12) {\n\t\t\t\tanswerSum++;\n\t\t\t}\n\t\t\t\n\t\t\tsum = 0;\n\t\t\tfor (int i = 0; i < tile2.length; i++) {\n\t\t\t\tsum = sum + tile2[i].getNumber();\n\t\t\t}\n\t\t\tif (sum <= 12) {\n\t\t\t\tanswerSum++;\n\t\t\t}\n\t\t\tanswer = \"On \" + answerSum + \" racks\";\n\t\t\tbreak;\n\t\t\n\t\tcase 3:\n\t\t\tboolean sameNumDiffColors = false;\n\t\t\tint rackCount = 0;\n\t\t\t\n\t\t\tArrayList<Tile> list1 = new ArrayList<Tile>();\n\t\t\tArrayList<Tile> list2 = new ArrayList<Tile>();\n\t\t\tArrayList<Tile> list3 = new ArrayList<Tile>();\n\t\t\tfor(int i = 0; i < tile1.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tlist1.add(tile1[i]);\n\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 3, tile1. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\ttry{\n\t\t\t\tif(((Tile) list1.get(0)).getNumber() == ((Tile) list1.get(1)).getNumber()) {\n\t\t\t\t\tif(((Tile) list1.get(0)).getColor() != ((Tile) list1.get(1)).getColor()) {\n\t\t\t\t\t\tsameNumDiffColors = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(((Tile) list1.get(0)).getNumber() == ((Tile) list1.get(2)).getNumber()) {\n\t\t\t\t\tif(((Tile) list1.get(0)).getColor() != ((Tile) list1.get(2)).getColor()) {\n\t\t\t\t\t\tsameNumDiffColors = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(((Tile) list1.get(2)).getNumber() == ((Tile) list1.get(1)).getNumber()) {\n\t\t\t\t\tif(((Tile) list1.get(2)).getColor() != ((Tile) list1.get(1)).getColor()) {\n\t\t\t\t\t\tsameNumDiffColors = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(sameNumDiffColors) {\n\t\t\t\t\trackCount++;\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tLog.d(\"Code777\", \"Player.java Case 3, Tile1 sameNumDiffColors.\");\n\t\t\t}\n\t\t\t\n\t\t\tsameNumDiffColors = false;\n\t\t\tfor(int i = 0; i < tile2.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tlist2.add(tile2[i]);\n\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 3, tile2. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\ttry{\n\t\t\t\tif(((Tile) list2.get(0)).getNumber() == ((Tile) list2.get(1)).getNumber()) {\n\t\t\t\t\tif(((Tile) list2.get(0)).getColor() != ((Tile) list2.get(1)).getColor()) {\n\t\t\t\t\t\tsameNumDiffColors = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(((Tile) list2.get(0)).getNumber() == ((Tile) list2.get(2)).getNumber()) {\n\t\t\t\t\tif(((Tile) list2.get(0)).getColor() != ((Tile) list2.get(2)).getColor()) {\n\t\t\t\t\t\tsameNumDiffColors = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(((Tile) list2.get(2)).getNumber() == ((Tile) list2.get(1)).getNumber()) {\n\t\t\t\t\tif(((Tile) list2.get(2)).getColor() != ((Tile) list2.get(1)).getColor()) {\n\t\t\t\t\t\tsameNumDiffColors = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(sameNumDiffColors) {\n\t\t\t\t\trackCount++;\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tLog.d(\"Code777\", \"Player.java Case 3, Tile1 sameNumDiffColors.\");\n\t\t\t}\n\t\t\t\n\t\t\tsameNumDiffColors = false;\n\t\t\tfor(int i = 0; i < tile3.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tlist3.add(tile3[i]);\n\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 3, tile3. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\ttry{\n\t\t\t\tif(((Tile) list3.get(0)).getNumber() == ((Tile) list3.get(1)).getNumber()) {\n\t\t\t\t\tif(((Tile) list3.get(0)).getColor() != ((Tile) list3.get(1)).getColor()) {\n\t\t\t\t\t\tsameNumDiffColors = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(((Tile) list3.get(0)).getNumber() == ((Tile) list3.get(2)).getNumber()) {\n\t\t\t\t\tif(((Tile) list3.get(0)).getColor() != ((Tile) list3.get(2)).getColor()) {\n\t\t\t\t\t\tsameNumDiffColors = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(((Tile) list3.get(2)).getNumber() == ((Tile) list3.get(1)).getNumber()) {\n\t\t\t\t\tif(((Tile) list3.get(2)).getColor() != ((Tile) list3.get(1)).getColor()) {\n\t\t\t\t\t\tsameNumDiffColors = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(sameNumDiffColors) {\n\t\t\t\t\trackCount++;\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tLog.d(\"Code777\", \"Player.java Case 3, Tile1 sameNumDiffColors.\");\n\t\t\t}\n\t\t\tanswer = \"On \" + rackCount + \" racks\";\n\t\t\tbreak;\n\t\t\n\t\tcase 4:\n\t\t\trackCount = 0;\n\t\t\tString[] arrayTileColor = new String[3];\n\t\t\ttry {\n\t\t\t\tarrayTileColor[0] = tile1[0].getColor();\n\t\t\t\tarrayTileColor[1] = tile1[1].getColor();\n\t\t\t\tarrayTileColor[2] = tile1[2].getColor();\n\t\t\t} catch (Exception e) {\n\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 4 tile1\");\n\t\t\t}\n\t\t\tif(!(arrayTileColor[0].equals(arrayTileColor[1])))\n\t\t\t\tif(!(arrayTileColor[0].equals(arrayTileColor[2])))\n\t\t\t\t\tif(!(arrayTileColor[1].equals(arrayTileColor[2])))\n\t\t\t\t\t\trackCount++;\n\t\t\t\t\t\t\n\t\t\ttry {\n\t\t\t\tarrayTileColor[0] = tile2[0].getColor();\n\t\t\t\tarrayTileColor[1] = tile2[1].getColor();\n\t\t\t\tarrayTileColor[2] = tile2[2].getColor();\n\t\t\t} catch (Exception e) {\n\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 4 tile2\");\n\t\t\t}\n\t\t\tif(!(arrayTileColor[0].equals(arrayTileColor[1])))\n\t\t\t\tif(!(arrayTileColor[0].equals(arrayTileColor[2])))\n\t\t\t\t\tif(!(arrayTileColor[1].equals(arrayTileColor[2])))\n\t\t\t\t\t\trackCount++;\n\t\t\t\n\t\t\ttry {\n\t\t\t\tarrayTileColor[0] = tile3[0].getColor();\n\t\t\t\tarrayTileColor[1] = tile3[1].getColor();\n\t\t\t\tarrayTileColor[2] = tile3[2].getColor();\n\t\t\t} catch (Exception e) {\n\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 4 tile3\");\n\t\t\t}\n\t\t\tif(!(arrayTileColor[0].equals(arrayTileColor[1])))\n\t\t\t\tif(!(arrayTileColor[0].equals(arrayTileColor[2])))\n\t\t\t\t\tif(!(arrayTileColor[1].equals(arrayTileColor[2])))\n\t\t\t\t\t\trackCount++;\n\t\t\t\n\t\t\tanswer = \"On \" + rackCount + \" racks\";\n\t\t\tbreak;\n\n\t\t\n\t\tcase 5:\n\t\t\tLog.d(\"Code777\", \"---Answer Question 5: \"+ qNumber);\n\t\t\tint[] modArray = new int[3];\n\t\t\tint numRacks = 0;\n\t\t\tfor(int i = 0; i < tile1.length; i++) {\n\t\t\t\tmodArray[i] = tile1[i].getNumber() % 2;\n\t\t\t}\n\t\t\tif((modArray[0] == modArray[1]) && (modArray[0] == modArray[2])) {\n\t\t\t\tnumRacks++;\n\t\t\t}\n\t\t\t\n\t\t\tfor(int i = 0; i < tile2.length; i++) {\n\t\t\t\tmodArray[i] = tile2[i].getNumber() % 2;\n\t\t\t}\n\t\t\tif((modArray[0] == modArray[1]) && (modArray[0] == modArray[2])) {\n\t\t\t\tnumRacks++;\n\t\t\t}\n\t\t\t\n\t\t\tfor(int i = 0; i < tile3.length; i++) {\n\t\t\t\tmodArray[i] = tile3[i].getNumber() % 2;\n\t\t\t}\n\t\t\tif((modArray[0] == modArray[1]) && (modArray[0] == modArray[2])) {\n\t\t\t\tnumRacks++;\n\t\t\t}\n\t\t\tanswer = \"On \" + numRacks + \" racks\";\t\n\t\t\tbreak;\n\n\t\t\t\n\t\tcase 6:\n\t\t\tint dupTiles = 0;\n\t\t\ttry {\n\t\t\t\tif(((tile1[0].getNumber() == tile1[1].getNumber()) && \n\t\t\t\t\t\t(tile1[0].getColor().equals(tile1[1].getColor()))\n\t\t\t\t\t\t|| ((tile1[0].getNumber() == tile1[2].getNumber()) \n\t\t\t\t\t\t\t\t&& (tile1[0].getColor().equals(tile1[2].getColor())))\n\t\t\t\t\t\t\t\t\t|| ((tile1[1].getNumber() == tile1[2].getNumber()) \n\t\t\t\t\t\t\t\t\t\t\t&& (tile1[1].getColor().equals(tile1[2].getColor())))))\n\t\t\t\t\t\t\t\t\t\t\t\t\tdupTiles++;\n\t\t\t\t\n\t\t\t} catch (Exception e) {\n\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 6, tile1. \");\n\t\t\t}\n\t\t\t\n\t\t\ttry {\n\t\t\t\tif(((tile2[0].getNumber() == tile2[1].getNumber()) && \n\t\t\t\t\t\t(tile2[0].getColor().equals(tile2[1].getColor()))\n\t\t\t\t\t\t|| ((tile2[0].getNumber() == tile2[2].getNumber()) \n\t\t\t\t\t\t\t\t&& (tile2[0].getColor().equals(tile2[2].getColor())))\n\t\t\t\t\t\t\t\t|| ((tile2[1].getNumber() == tile2[2].getNumber()) \n\t\t\t\t\t\t\t\t\t\t&& (tile2[1].getColor().equals(tile2[2].getColor()))))) \n\t\t\t\t\t\t\t\t\t\t\t\t\tdupTiles++;\n\t\t\t\t\n\t\t\t} catch (Exception e) {\n\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 6, tile2. \");\n\t\t\t}\n\t\t\t\n\t\t\ttry {\n\t\t\t\tif(((tile3[0].getNumber() == tile3[1].getNumber()) && \n\t\t\t\t\t\t(tile3[0].getColor().equals(tile3[1].getColor()))\n\t\t\t\t\t\t|| ((tile3[0].getNumber() == tile3[2].getNumber()) \n\t\t\t\t\t\t\t\t&& (tile3[0].getColor().equals(tile3[2].getColor())))\n\t\t\t\t\t\t\t\t\t|| ((tile3[1].getNumber() == tile3[2].getNumber()) \n\t\t\t\t\t\t\t\t\t\t&& (tile3[1].getColor().equals(tile3[2].getColor())))))\n\t\t\t\t\t\t\t\t\t\t\t\t\tdupTiles++;\n\t\t\t\t\n\t\t\t} catch (Exception e) {\n\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 9, tile3. \");\n\t\t\t}\n\t\t\tanswer = \"On \" + dupTiles + \" racks\";\n\t\t\tbreak;\n\n\t\t\n\t\tcase 7:\n\t\t\tint consecutive = 0;\n\t\t\t\n\t\t\tint[] numArray = new int[3];\n\t\t\ttry {\n\t\t\t\tnumArray[0] = tile1[0].getNumber();\n\t\t\t\tnumArray[1] = tile1[1].getNumber();\n\t\t\t\tnumArray[2] = tile1[2].getNumber();\n\t\t\t} catch (Exception e) {\n\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 7, tile1. \");\n\t\t\t}\n\t\t\t\n\t\t\tArrays.sort(numArray);\n\t\t\tif((numArray[2] - numArray[1]) == 1 )\n\t\t\t\tif((numArray[1] - numArray[0]) == 1)\n\t\t\t\t\tconsecutive++;\n\t\t\t\n\t\t\ttry {\n\t\t\t\tnumArray[0] = tile2[0].getNumber();\n\t\t\t\tnumArray[1] = tile2[1].getNumber();\n\t\t\t\tnumArray[2] = tile2[2].getNumber();\n\t\t\t} catch (Exception e) {\n\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 7, tile1. \");\n\t\t\t}\n\t\t\tArrays.sort(numArray);\n\t\t\tif((numArray[2] - numArray[1]) == 1 )\n\t\t\t\tif( (numArray[1] - numArray[0]) == 1)\n\t\t\t\t\tconsecutive++;\n\t\t\t\n\t\t\ttry {\n\t\t\t\tnumArray[0] = tile3[0].getNumber();\n\t\t\t\tnumArray[1] = tile3[1].getNumber();\n\t\t\t\tnumArray[2] = tile3[2].getNumber();\n\t\t\t} catch (Exception e) {\n\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 7, tile1. \");\n\t\t\t}\n\t\t\tArrays.sort(numArray);\n\t\t\tif((numArray[2] - numArray[1]) == 1) \n\t\t\t\tif( (numArray[1] - numArray[0]) == 1)\n\t\t\t\t\tconsecutive++;\n\t\t\n\t\t\tanswer = \"On \" + consecutive + \" racks\";\n\t\t\tbreak;\n\n\t\t\n\t\tcase 8:\n\t\t\tSet<String> tileList = new HashSet<String>();\n\t\t\tint uniqueColors = 0;\n\t\t\tfor(int i = 0; i < tile1.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\ttileList.add(tile1[i].getColor());\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 8, tile1. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfor(int i = 0; i < tile2.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\ttileList.add(tile2[i].getColor());\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 9, tile2. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfor(int i = 0; i < tile3.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\ttileList.add(tile3[i].getColor());\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 9, tile3. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tuniqueColors = tileList.size();\n\t\t\tanswer = \"I see \" + uniqueColors + \" colors\";\n\t\t\tbreak;\n\n\t\t\t\n\t\tcase 9:\n\t\t\tArrayList<String> allColors = new ArrayList<String>();\n\t\t\tint greenCount = 0;\n\t\t\tint yellowCount = 0;\n\t\t\tint blackCount = 0;\n\t\t\tint brownCount = 0;\n\t\t\tint orangeCount = 0;\n\t\t\tint pinkCount = 0;\n\t\t\tint blueCount = 0;\n\t\t\tint count = 0;\n\t\t\t\n\t\t\tfor(int i = 0; i < tile1.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallColors.add(tile1[i].getColor());\n\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 9, tile1. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile2.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallColors.add(tile2[i].getColor());\n\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 9, tile2. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile3.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallColors.add(tile3[i].getColor());\n\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 9, tile3. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfor(int i = 0; i < allColors.size(); i++) {\n\t\t\t\tif(allColors.get(i).equals(\"green\")) {\n\t\t\t\t\tgreenCount++;\n\t\t\t\t}\n\t\t\t\tif(allColors.get(i).equals(\"yellow\")) {\n\t\t\t\t\tyellowCount++;\n\t\t\t\t}\n\t\t\t\tif(allColors.get(i).equals(\"black\")) {\n\t\t\t\t\tblackCount++;\n\t\t\t\t}\n\t\t\t\tif(allColors.get(i).equals(\"brown\")) {\n\t\t\t\t\tbrownCount++;\n\t\t\t\t}\n\t\t\t\tif(allColors.get(i).equals(\"orange\")) {\n\t\t\t\t\torangeCount++;\n\t\t\t\t}\n\t\t\t\tif(allColors.get(i).equals(\"red\")) {\n\t\t\t\t\tpinkCount++;\n\t\t\t\t}\n\t\t\t\tif(allColors.get(i).equals(\"blue\")) {\n\t\t\t\t\tblueCount++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (greenCount >= 3) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\tif (yellowCount >= 3) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\tif (blackCount >= 3) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\tif (brownCount >= 3) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\tif (orangeCount >= 3) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\tif (pinkCount >= 3) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\tif (blueCount >= 3) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\tanswer = \"\" + count + \" colors\";\n\t\t\tbreak;\n\n\t\t\n\t\tcase 10:\n\t\t\tint totalNums = 7;\n\t\t\tint uniqueNumsPresent = 0;\n\t\t\tint numsMissing = 0;\n\t\t\tSet<Integer> presentNums = new HashSet<Integer>();\n\t\t\tfor(int i = 0; i < tile1.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tpresentNums.add(tile1[i].getNumber());\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 10, tile1. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile2.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tpresentNums.add(tile2[i].getNumber());\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 10, tile2. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile3.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tpresentNums.add(tile3[i].getNumber());\n\t\t\t\t} catch (Exception e ) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 10, tile3. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tuniqueNumsPresent = presentNums.size();\n\t\t\tnumsMissing = totalNums - uniqueNumsPresent;\n\t\t\tanswer = \"\" + numsMissing + \" numbers are missing\";\n\t\t\tbreak;\n\n\t\t\n\t\tcase 11:\n\t\t\tArrayList<Tile> allTiles = new ArrayList<Tile>();\n\t\t\tint cardsISee = 0;\n\t\t\t\n\t\t\tfor(int i = 0; i < tile1.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallTiles.add(tile1[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 11, tile1. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile2.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallTiles.add(tile2[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 11, tile2. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile3.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallTiles.add(tile3[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 11, tile3. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < allTiles.size(); i++) {\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile) allTiles.get(i)).getNumber() == 1) &&\n\t\t\t\t\t\t\t(((Tile)allTiles.get(i)).getColor().equals(\"green\"))){\n\t\t\t\t\t\tcardsISee++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 11, tile1, getNumber(). \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile) allTiles.get(i)).getNumber() == 5) &&\n\t\t\t\t\t\t\t(((Tile)allTiles.get(i)).getColor().equals(\"black\"))){\n\t\t\t\t\t\tcardsISee++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 11, tile2, getNumber(). \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile) allTiles.get(i)).getNumber() == 7) &&\n\t\t\t\t\t\t\t(((Tile)allTiles.get(i)).getColor().equals(\"red\"))){\n\t\t\t\t\t\tcardsISee++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 11, tile3, getNumber() \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tanswer = \"\" + cardsISee;\n\t\t\tbreak;\n\n\t\t\t\n\t\tcase 12:\n\t\t\tint threes = 0;\n\t\t\tfor(int i = 0; i < tile1.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile1[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 12, tile1. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile2.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile2[i]);\n\t\t\t\t} catch (Exception e ) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 12, tile2. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile3.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile3[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 12, tile3. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < allCards.size(); i++) {\n\t\t\t\ttry {\n\t\t\t\t\tif(((Tile) allCards.get(i)).getNumber() == 3){\n\t\t\t\t\t\tthrees++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 12, getNumber()=3. \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile) allCards.get(i)).getNumber() == 6) &&\n\t\t\t\t\t\t\t(((Tile)allCards.get(i)).getColor().equals(\"red\"))){\n\t\t\t\t\t\trSixes++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 12, getNumber = 6. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(threes < rSixes) {\n\t\t\t\tmore = \"More Red 6s\";\n\t\t\t}\n\t\t\telse if(threes > rSixes) {\n\t\t\t\tmore = \"More 3s\";\n\t\t\t}\n\t\t\telse if(threes == rSixes) {\n\t\t\t\tmore = \"About the same\";\n\t\t\t}\n\t\t\tanswer = \"\" + more;\n\t\t\tbreak;\n\n\t\t\t\n\t\tcase 13:\n\n\t\t\tfor(int i = 0; i < tile1.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile1[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 13, tile1. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile2.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile2[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 13, tile2. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile3.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile3[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 13, tile3. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < allCards.size(); i++) {\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile) allCards.get(i)).getNumber() == 6) &&\n\t\t\t\t\t\t\t(((Tile)allCards.get(i)).getColor().equals(\"green\"))){\n\t\t\t\t\t\tgSixes++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 13, getNumber = 6. \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile) allCards.get(i)).getNumber() == 7) &&\n\t\t\t\t\t\t\t(((Tile)allCards.get(i)).getColor().equals(\"yellow\"))){\n\t\t\t\t\t\tySevens++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 13, getNumber = 7 \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(gSixes < ySevens) {\n\t\t\t\tmore = \"More Yellow 7s\";\n\t\t\t}\n\t\t\telse if(gSixes > ySevens) {\n\t\t\t\tmore = \"More Green 6s\";\n\t\t\t}\n\t\t\telse if(gSixes == ySevens) {\n\t\t\t\tmore = \"About the same\";\n\t\t\t}\n\t\t\tanswer = \"\" + more;\n\t\t\tbreak;\n\n\t\t\t\n\t\tcase 14:\n\t\t\tint yTwos = 0;\n\t\t\tfor(int i = 0; i < tile1.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile1[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 14, tile1. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile2.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile2[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 14, tile2. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile3.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile3[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 14, tile3. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < allCards.size(); i++) {\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile) allCards.get(i)).getNumber() == 2) &&\n\t\t\t\t\t\t\t(((Tile)allCards.get(i)).getColor().equals(\"yellow\"))){\n\t\t\t\t\t\tyTwos++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 14, getNumber = 2. \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile) allCards.get(i)).getNumber() == 7) &&\n\t\t\t\t\t\t\t(((Tile)allCards.get(i)).getColor().equals(\"yellow\"))){\n\t\t\t\t\t\tySevens++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 14, getNumber = 7. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(yTwos < ySevens) {\n\t\t\t\tmore = \"More Yellow 7s\";\n\t\t\t}\n\t\t\telse if(yTwos > ySevens) {\n\t\t\t\tmore = \"More Yellow 2s\";\n\t\t\t}\n\t\t\telse if(yTwos == ySevens) {\n\t\t\t\tmore = \"About the same\";\n\t\t\t}\n\t\t\tanswer = \"\" + more;\n\t\t\tbreak;\n\n\t\t\t\n\t\tcase 15:\n\n\t\t\tfor(int i = 0; i < tile1.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile1[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 15, tile1. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile2.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile2[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 15, tile2. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile3.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile3[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 15, tile3. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < allCards.size(); i++) {\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile) allCards.get(i)).getNumber() == 6) &&\n\t\t\t\t\t\t\t(((Tile)allCards.get(i)).getColor().equals(\"green\"))){\n\t\t\t\t\t\tgSixes++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 15, getColor = green. \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile) allCards.get(i)).getNumber() == 6) &&\n\t\t\t\t\t\t\t(((Tile)allCards.get(i)).getColor().equals(\"orange\"))){\n\t\t\t\t\t\trSixes++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 15, getColor = orange\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(gSixes < rSixes) {\n\t\t\t\tmore = \"More Orange 6s\";\n\t\t\t}\n\t\t\telse if(gSixes > rSixes) {\n\t\t\t\tmore = \"More Green 6s\";\n\t\t\t}\n\t\t\telse if(gSixes == rSixes) {\n\t\t\t\tmore = \"About the same\";\n\t\t\t}\n\t\t\tanswer = \"\" + more;\n\t\t\tbreak;\n\n\t\t\t\n\t\tcase 16:\n\t\t\tint oSevens = 0;\n\t\t\tint bSevens = 0;\n\t\t\tfor(int i = 0; i < tile1.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile1[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 16, tile1. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile2.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile2[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 16, tile2. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile3.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile3[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 17, tile3. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < allCards.size(); i++) {\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile) allCards.get(i)).getNumber() == 7) &&\n\t\t\t\t\t\t\t(((Tile)allCards.get(i)).getColor().equals(\"blue\"))){\n\t\t\t\t\t\tbSevens++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 16, getNumber = blue. \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tif(!(((Tile) allCards.get(i)).getNumber() == 7) &&\n\t\t\t\t\t\t\t(((Tile)allCards.get(i)).getColor().equals(\"blue\"))){\n\t\t\t\t\t\toSevens++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 16, getNumber = not blue. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(bSevens < oSevens) {\n\t\t\t\tmore = \"More 7s of Other Colors\";\n\t\t\t}\n\t\t\telse if(bSevens > oSevens) {\n\t\t\t\tmore = \"More Blue 7s\";\n\t\t\t}\n\t\t\telse if(bSevens == oSevens) {\n\t\t\t\tmore = \"About the same\";\n\t\t\t}\n\t\t\tanswer = \"\" + more;\n\t\t\tbreak;\n\n\t\t\t\n\t\tcase 17:\n\t\t\tfor(int i = 0; i < tile1.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile1[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 17, tile1. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile2.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile2[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 17, tile2. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile3.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile3[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 18, tile3. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < allCards.size(); i++) {\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile)allCards.get(i)).getColor().equals(\"brown\"))){\n\t\t\t\t\t\tbrowns++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 18, getColor=brown. \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile)allCards.get(i)).getColor().equals(\"blue\"))){\n\t\t\t\t\t\tblues++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 18, getColor=blue. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(browns < blues) {\n\t\t\t\tmore = \"More Blue Numbers\";\n\t\t\t}\n\t\t\telse if(browns > blues) {\n\t\t\t\tmore = \"More Brown Numbers\";\n\t\t\t}\n\t\t\telse if(browns == blues) {\n\t\t\t\tmore = \"About the same\";\n\t\t\t}\n\t\t\tanswer = \"\" + more;\n\t\t\tbreak;\n\n\t\t\t\n\t\tcase 18:\n\t\t\tfor(int i = 0; i < tile1.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile1[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 18, tile1. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile2.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile2[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 18, tile2. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile3.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile3[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 18, tile3. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < allCards.size(); i++) {\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile)allCards.get(i)).getColor().equals(\"red\"))){\n\t\t\t\t\t\treds++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 18, getColor=red. \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile)allCards.get(i)).getColor().equals(\"orange\"))){\n\t\t\t\t\t\toranges++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 18, getColor=orange. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(reds < oranges) {\n\t\t\t\tmore = \"More Orange Numbers\";\n\t\t\t}\n\t\t\telse if(reds > oranges) {\n\t\t\t\tmore = \"More Red Numbers\";\n\t\t\t}\n\t\t\telse if(reds == oranges) {\n\t\t\t\tmore = \"About the same\";\n\t\t\t}\n\t\t\tanswer = \"\" + more;\n\t\t\tbreak;\n\n\t\t\t\n\t\tcase 19:\n\t\t\tfor(int i = 0; i < tile1.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile1[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 19, tile1. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile2.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile2[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 19, tile2. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile3.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile3[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 19, tile3. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < allCards.size(); i++) {\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile)allCards.get(i)).getColor().equals(\"green\"))){\n\t\t\t\t\t\tgreens++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 19, getColor=green. \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile)allCards.get(i)).getColor().equals(\"blue\"))){\n\t\t\t\t\t\tblues++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 19, getColor=blue. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(greens < blues) {\n\t\t\t\tmore = \"More Blue Numbers\";\n\t\t\t}\n\t\t\telse if(greens > blues) {\n\t\t\t\tmore = \"More Green Numbers\";\n\t\t\t}\n\t\t\telse if(greens == blues) {\n\t\t\t\tmore = \"About the same\";\n\t\t\t}\n\t\t\tanswer = \"\" + more;\n\t\t\tbreak;\n\n\t\t\t\n\t\tcase 20:\n\t\t\tfor(int i = 0; i < tile1.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile1[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 20, tile1. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile2.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile2[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 20, tile2. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile3.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile3[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 20, tile3. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < allCards.size(); i++) {\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile)allCards.get(i)).getColor().equals(\"yellow\"))){\n\t\t\t\t\t\tyellows++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 20, getColor=yellow. \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile)allCards.get(i)).getColor().equals(\"orange\"))){\n\t\t\t\t\t\toranges++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 20, getColor=orange. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(yellows < oranges) {\n\t\t\t\tmore = \"More Orange Numbers\";\n\t\t\t}\n\t\t\telse if(yellows > oranges) {\n\t\t\t\tmore = \"More Yellow Numbers\";\n\t\t\t}\n\t\t\telse if(yellows == oranges) {\n\t\t\t\tmore = \"About the same\";\n\t\t\t}\n\t\t\tanswer = \"\" + more;\n\t\t\tbreak;\n\t\t\t\n\t\tcase 21:\n\t\t\tfor(int i = 0; i < tile1.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile1[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 21, tile1. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile2.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile2[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 21, tile2. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile3.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile3[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 21, tile3. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < allCards.size(); i++) {\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile)allCards.get(i)).getColor().equals(\"black\"))){\n\t\t\t\t\t\tblacks++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 21, getColor=black. \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile)allCards.get(i)).getColor().equals(\"brown\"))){\n\t\t\t\t\t\tbrowns++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 21, getColor=brown. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(blacks < browns) {\n\t\t\t\tmore = \"More Brown Numbers\";\n\t\t\t}\n\t\t\telse if(blacks > browns) {\n\t\t\t\tmore = \"More Black Numbers\";\n\t\t\t}\n\t\t\telse if(blacks == browns) {\n\t\t\t\tmore = \"About the same\";\n\t\t\t}\n\t\t\tanswer = \"\" + more;\n\t\t\tbreak;\n\n\t\t\t\n\t\tcase 22:\n\t\t\tallCards = new ArrayList<Tile>();\n\t\t\treds = 0;\n\t\t\tblacks = 0;\n\t\t\tmore = \"\";\n\t\t\tfor(int i = 0; i < tile1.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile1[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 22, tile1. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile2.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile2[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 22, tile2. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile3.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile3[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 22, tile3. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < allCards.size(); i++) {\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile)allCards.get(i)).getColor().equals(\"red\"))){\n\t\t\t\t\t\treds++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 22, getColor=red. \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile)allCards.get(i)).getColor().equals(\"black\"))){\n\t\t\t\t\t\tblacks++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 22, getColor=black. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(reds < blacks) {\n\t\t\t\tmore = \"More Black Numbers\";\n\t\t\t}\n\t\t\telse if(reds > blacks) {\n\t\t\t\tmore = \"More Red Numbers\";\n\t\t\t}\n\t\t\telse if(reds == blacks) {\n\t\t\t\tmore = \"About the same\";\n\t\t\t}\n\t\t\tanswer = \"\" + more;\n\t\t\tbreak;\n\t\t\t\n\t\tcase 23:\n\t\t\tfor(int i = 0; i < tile1.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile1[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 23, tile1. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile2.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile2[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 23, tile2. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < tile3.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tallCards.add(tile3[i]);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 23, tile3. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < allCards.size(); i++) {\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile)allCards.get(i)).getColor().equals(\"green\"))){\n\t\t\t\t\t\tgreens++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 23, getColor=green. \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tif((((Tile)allCards.get(i)).getColor().equals(\"yellow\"))){\n\t\t\t\t\t\tyellows++;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.d(\"Code777\", \"ERROR - Player.java Case 23, getColor=yellow. \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(greens < yellows) {\n\t\t\t\tmore = \"More Yellow Numbers\";\n\t\t\t}\n\t\t\telse if(greens > yellows) {\n\t\t\t\tmore = \"More Green Numbers\";\n\t\t\t}\n\t\t\telse if(greens == yellows) {\n\t\t\t\tmore = \"About the same\";\n\t\t\t}\n\t\t\tanswer = \"\" + more;\n\t\t\tbreak;\n\t\t\t\n\t\t}\n\t\treturn answer;\n\t}", "public void quizCreate(View view)\n {\n //Create screen\n correctOption = r.nextInt(4) + 1;\n int rand = generateRandom(r);\n\n setContentView(R.layout.quiz_layout1);\n ImageView pokeImage = (ImageView) findViewById(R.id.quiz_image);\n if (rand <= 0) {\n return;\n }\n int imageInt = getResources().getIdentifier(imageFilePrefix + rand, \"drawable\", getPackageName());\n pokeImage.setImageResource(imageInt);\n Button correctButton = (Button) findViewById(options.get(correctOption));\n correctButton.setText(myDbHelper.queryName(rand));\n\n }", "public void q1Submit(View view) {\n\n EditText editText = (EditText) findViewById(R.id.q1enterEditText);\n String q1answer = editText.getText().toString().trim();\n\n //Nested if statements to check if the answer is correct or not, then to assign 2 points if it's correct.\n if ((q1answer.toLowerCase().equals(getString(R.string.q1AnswerCheck1))) || (q1answer.toLowerCase().equals(getString(R.string.q1AnswerCheck2)))) {\n if (isNotAnsweredQ1) {\n display(pointCounter += 2);\n Toast.makeText(this, getString(R.string.correct1), Toast.LENGTH_SHORT).show();\n isNotAnsweredQ1 = false;\n }\n } else {\n Toast.makeText(this, getString(R.string.thinkAgain), Toast.LENGTH_SHORT).show();\n }\n }", "@Test\n\tpublic void testGetAllQuestions() {\n\t\tList<QnaQuestion> questions = questionLogic.getAllQuestions(LOCATION1_ID);\n\t\tAssert.assertEquals(5, questions.size());\n\t\tAssert.assertTrue(questions.contains(tdp.question1_location1));\n\t\tAssert.assertTrue(questions.contains(tdp.question2_location1));\n\t\tAssert.assertTrue(questions.contains(tdp.question3_location1));\n\t\tAssert.assertTrue(questions.contains(tdp.question4_location1));\n\t\tAssert.assertTrue(questions.contains(tdp.question5_location1));\n\t}", "public static void main(String[] args) {\n\t\t\tSystem.out.println(\"Question 1\");\r\n\t\t\tfloat a = 5240.5f;\r\n\t\t\tfloat b = 10970.055f;\r\n\t\t\tint x = (int) a;\r\n\t\t\tint y = (int) b;\r\n\t\t\tSystem.out.println(x);\r\n\t\t\tSystem.out.println(y + \"\\n\");\r\n\r\n\t\t\t// Question 2:\r\n\t\t\tSystem.out.println(\"Question 2\");\r\n\t\t\tint a1 = random.nextInt(100000);\r\n\t\t\tSystem.out.printf(\"%05d\", a1);\r\n\t\t\tSystem.out.println(\"\\n\");\r\n\r\n\t\t\t// Question 3:\r\n\t\t\tSystem.out.println(\"Question 3\");\r\n\t\t\tint b1 = a1 % 100;\r\n\t\t\tSystem.out.println(\"Hai số cuối của a1: \" + b1);\r\n\t\t\tSystem.out.println(\"\\n\");\r\n\r\n\t\t\tQuestion4();\r\n\r\n\t\t\tExercise2();\r\n\r\n\t\t\tSystem.out.println(\"\\n\");\r\n\r\n\t\t\t// Exercise 3:\r\n\t\t\tSystem.out.println(\"Exercise3\");\r\n\t\t\t// Question 1:\r\n\t\t\tSystem.out.println(\"Question 1:\");\r\n\t\t\tInteger salary = 5000;\r\n\t\t\tfloat salaryf = salary;\r\n\t\t\tSystem.out.printf(\"%.2f\", salaryf);\r\n\r\n\t\t\t// Question 2:\r\n\t\t\tSystem.out.println(\"Question 2:\");\r\n\t\t\tString value = \"1234567\";\r\n\t\t\tint a2 = Integer.parseInt(value);\r\n\t\t\tSystem.out.println(a2);\r\n\r\n\t\t\t// Question 3:\r\n\t\t\tSystem.out.println(\"Question 3:\");\r\n\t\t\tInteger value1 = 1234567;\r\n\t\t\tint a3 = value1.intValue();\r\n\t\t\tSystem.out.println(a3);\r\n\t\t\tSystem.out.println(\"\\n\");\r\n\r\n\t\t\t// Exercise 4:\r\n\t\t\tSystem.out.println(\"Exercise 4:\");\r\n\t\t\t// Question 1:\r\n\t\t\tSystem.out.println(\"Question 1\");\r\n\t\t\tSystem.out.println(\"Mời bạn nhập họ và tên: \");\r\n\t\t\tString nhapGiaTri1 = scanner.nextLine();\r\n\t\t\tString nhapGiaTri = scanner.nextLine();\r\n\t\t\tint count = 1;\r\n\t\t\tint j;\r\n\t\t\tfor (j = 0; j < nhapGiaTri.length(); j++) {\r\n\t\t\t\tif (nhapGiaTri.charAt(j) != ' ') {\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"Độ dài của chuỗi ký tự nhapGiaTri: \" + count);\r\n\t\t\tSystem.out.println(\"\\n\");\r\n\r\n\t\t\t// Question 2:\r\n\t\t\tSystem.out.println(\"Question 2\");\r\n\t\t\tSystem.out.println(\"Mời bạn nhập chuỗi ký tự 1: \");\r\n\t\t\tString s1 = scanner.next();\r\n\t\t\tSystem.out.println(\" \");\r\n\t\t\tSystem.out.println(\"Mời bạn nhập chuỗi ký tự 2: \");\r\n\t\t\tString s2 = scanner.next();\r\n\t\t\tSystem.out.println(\"Kết quả khi nối hai xâu kí tự s1 và s2: \" + s1 + s2);\r\n\t\t\tSystem.out.println(\"\\n\");\r\n\r\n\t\t\t// Question 3:\r\n\t\t\tSystem.out.println(\"Mời bạn nhập họ tên: \");\r\n\t\t\tString hoTen1 = scanner.nextLine();\r\n\t\t\tString hoTen2 = scanner.nextLine();\r\n\t\t\tString hoTen = hoTen2.substring(0, 1).toUpperCase() + hoTen2.substring(1);\r\n\t\t\tSystem.out.println(hoTen);\r\n\t\t\tSystem.out.println(\"\\n\");\r\n\r\n\t\t\t// question 4:\r\n\t\t\tString name;\r\n\t\t\tSystem.out.println(\"Nhập tên: \");\r\n\t\t\tname = scanner.nextLine();\r\n\t\t\tname = name.toUpperCase();\r\n\t\t\tfor (int i = 0; i < name.length(); i++) {\r\n\t\t\t\tSystem.out.println(\"Ký tự thứ \" + i + \" là: \" + name.charAt(i));\r\n\t\t\t}\r\n\r\n\t\t\t// question 5:;\r\n\t\t\tSystem.out.println(\"Nhập họ: \");\r\n\t\t\tString firstName = scanner.nextLine();\r\n\t\t\tSystem.out.println(\"Nhập tên: \");\r\n\t\t\tString lastName = scanner.nextLine();\r\n\t\t\tSystem.out.println(\"Họ tên đầy đủ: \" + firstName.concat(lastName));\r\n\r\n\t\t\t// question 6:\r\n\t\t\tSystem.out.println(\"Nhập họ: \");\r\n\t\t\tString firstName1 = scanner.nextLine();\r\n\t\t\tSystem.out.println(\"Nhập tên: \");\r\n\t\t\tString lastName1 = scanner.nextLine();\r\n\t\t\tSystem.out.println(\"Họ tên đầy đủ: \" + firstName.concat(lastName));\r\n\r\n\t\t\t// question 7:\r\n\r\n\t\t\tString fullName;\r\n\t\t\tSystem.out.println(\"Nhập họ tên đầy đủ\");\r\n\t\t\tfullName = scanner.nextLine();\r\n\t\t\t// remove space characters\r\n\t\t\tfullName = fullName.trim();\r\n\t\t\tfullName = fullName.replaceAll(\"\\\\s+\", \" \");\r\n\t\t\tSystem.out.println(fullName);\r\n\t\t\tString[] words = fullName.split(\" \");\r\n\t\t\tfullName = \"\";\r\n\t\t\tfor (String word : words) {\r\n\t\t\t\tString firstCharacter = word.substring(0, 1).toUpperCase();\r\n\t\t\t\tString leftCharacter = word.substring(1);\r\n\t\t\t\tword = firstCharacter + leftCharacter;\r\n\t\t\t\tfullName += word + \" \";\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"Họ tên sau khi chuẩn hóa: \" + fullName);\r\n\r\n\t\t\t// question 8:\r\n\t\t\tString[] groupNames = { \"Java with VTI\", \"Cách qua môn gia va\", \"Học Java có khó không?\" };\r\n\t\t\tfor (String groupName : groupNames) {\r\n\t\t\t\tif (groupName.contains(\"Java\")) {\r\n\t\t\t\t\tSystem.out.println(groupName);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Question 9:\r\n\t\t\tString[] groupNames1 = { \"Java\", \"C#\", \"C++\" };\r\n\t\t\tfor (String groupName : groupNames) {\r\n\t\t\t\tif (groupName.equals(\"Java\")) {\r\n\t\t\t\t\tSystem.out.println(groupName);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// question 10:\r\n\t\t\tString x1, x2, reversex1 = \"\";\r\n\t\t\tSystem.out.println(\"Nhập chuỗi 1\");\r\n\t\t\tx1 = scanner.nextLine();\r\n\t\t\tSystem.out.println(\"Nhập chuỗi 2\");\r\n\t\t\tx2 = scanner.nextLine();\r\n\t\t\tfor (int i = x1.length() - 1; i >= 0; i--) {\r\n\t\t\t\treversex1 += x1.substring(i, i + 1);\r\n\t\t\t}\r\n\t\t\tif (x2.equals(reversex1)) {\r\n\t\t\t\tSystem.out.println(\"Đây là chuỗi đảo ngược !\");\r\n\t\t\t} else {\r\n\t\t\t\tSystem.out.println(\"Đây không phải chuỗi đảo ngược\");\r\n\t\t\t}\r\n\r\n\t\t\t// question 11:\r\n\t\t\tSystem.out.println(\"Mời bạn nhập vào một chuỗi: \");\r\n\t\t\tString str = scanner.nextLine();\r\n\t\t\tint count1 = 0;\r\n\t\t\tfor (int i = 0; i < str.length(); i++) {\r\n\t\t\t\tif ('a' == str.charAt(i)) {\r\n\t\t\t\t\tcount1++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.println(count);\r\n\r\n\t\t\t// question 12:\r\n\t\t\tString daoNguoc = \"\";\r\n\t\t\tSystem.out.println(\"Nhập chuỗi 1\");\r\n\t\t\tString x3 = scanner.nextLine();\r\n\t\t\tfor (int i = x3.length() - 1; i >= 0; i--) {\r\n\t\t\t\tdaoNguoc += x3.charAt(i);\r\n\t\t\t}\r\n\t\t\tSystem.out.println(daoNguoc);\t\t\t\r\n\t\t\t\r\n\t\t}", "public static int sapQuestions (int sapPathway)\r\n {\r\n int questionNumber = (int)(Math.random()*20)+1;\r\n\r\n switch (questionNumber)\r\n {\r\n case 1: System.out.println(\"Which of the following is not a social institution?\\r\\n\" + \r\n \"1.) family\\r\\n\" + \r\n \"2.) education\\r\\n\" + \r\n \"3.) hidden Media\\r\\n\" + \r\n \"4.) social Media\\r\\n\");\r\n break;\r\n case 2: System.out.println(\"Stereotypes are maintained by _______\\r\\n\" + \r\n \"1.) ignoring contradictory evidence\\r\\n\" + \r\n \"2.) individualization \\r\\n\" + \r\n \"3.) overcomplicating generalization that is applied to all members of a group\\r\\n\" + \r\n \"4.) the ideology of “rescue”\\r\\n\");\r\n break;\r\n case 3: System.out.println(\"Racism is about _____\\r\\n\" + \r\n \"1.) effect not Intent\\r\\n\" + \r\n \"2.) intent not effect\\r\\n\" + \r\n \"3.) response not question\\r\\n\" + \r\n \"4.) question not response\\r\\n\");\r\n break;\r\n case 4: System.out.println(\"What is the definition of theory?\\r\\n\" + \r\n \"1.) what’s important to you\\r\\n\" + \r\n \"2.) best possible explanation based on available evidence\\r\\n\" + \r\n \"3.) your experiences, what you think is real\\r\\n\" + \r\n \"4.) determines how you interpret situations\\r\\n\");\r\n break;\r\n case 5: System.out.println(\"Which of the following is not an obstacle to clear thinking?\\r\\n\" + \r\n \"1.) drugs\\r\\n\" + \r\n \"2.) close-minded\\r\\n\" + \r\n \"3.) honesty\\r\\n\" + \r\n \"4.) emotions\\r\\n\");\r\n break;\r\n case 6: System.out.println(\"What does the IQ test asses?\\r\\n\" + \r\n \"1.) literacy skills\\r\\n\" + \r\n \"2.) survival skills\\r\\n\" + \r\n \"3.) logical reasoning skills\\r\\n\" + \r\n \"4.) 1 and 3\\r\\n\");\r\n break;\r\n case 7: System.out.println(\"How many types of intelligence are there?\\r\\n\" + \r\n \"1.) 27\\r\\n\" + \r\n \"2.) 5\\r\\n\" + \r\n \"3.) 3\\r\\n\" + \r\n \"4.) 8\\r\\n\");\r\n break;\r\n case 8: System.out.println(\"Emotions have 3 components\\r\\n\" + \r\n \"1.) psychological, cognitive, behavioral\\r\\n\" + \r\n \"2.) psychological, physical, social\\r\\n\" + \r\n \"3.) intensity, range, exposure\\r\\n\" + \r\n \"4.) range, duration, intensity\\r\\n\");\r\n break;\r\n case 9: System.out.println(\"Which of the following is not a component of happiness?\\r\\n\" + \r\n \"1.) diet and nutrition\\r\\n\" + \r\n \"2.) time in nature\\r\\n\" + \r\n \"3.) interventions\\r\\n\" + \r\n \"4.) relationships\\r\\n\");\r\n break;\r\n case 10: System.out.println(\"The brain compensates for damaged neurons by ______.\\r\\n\" + \r\n \"1.) extending neural connections over the dead neurons\\r\\n\" + \r\n \"2.) it doesn’t need too\\r\\n\" + \r\n \"3.) grows new neurons\\r\\n\" + \r\n \"4.) send neurons in from different places\\r\\n\");\r\n break;\r\n case 11: System.out.println(\"Which of the following is true?\\r\\n\" + \r\n \"1.) you continue to grow neurons until age 50\\r\\n\" + \r\n \"2.) 90% of the brain is achieved by age 6\\r\\n\" + \r\n \"3.) only 20% of the brain is actually being used \\r\\n\" + \r\n \"4.) the size of your brain determines your intelligence\\r\\n\");\r\n break;\r\n case 12: System.out.println(\"The feel-good chemical is properly known as?\\r\\n\" + \r\n \"1.) acetycholine\\r\\n\" + \r\n \"2.) endocrine\\r\\n\" + \r\n \"3.) dopamine\\r\\n\" + \r\n \"4.) doperdoodle\\r\\n\");\r\n break;\r\n case 13: System.out.println(\"Who created the theory about ID, superego and ego?\\r\\n\" + \r\n \"1.) Albert\\r\\n\" + \r\n \"2.) Freud\\r\\n\" + \r\n \"3.) Erikson\\r\\n\" + \r\n \"4.) Olaf\\r\\n\");\r\n break;\r\n case 14: System.out.println(\"Classic Conditioning is _______?\\r\\n\" + \r\n \"1.) when an organism learns to associate two things that are normally unrelated\\r\\n\" + \r\n \"2.) when an organism learns to disassociate two things that are normally related \\r\\n\" + \r\n \"3.) when you teach an organism the survival style of another organism\\r\\n\" + \r\n \"4.) when you train an organism without the use of modern technology\\r\\n\");\r\n break;\r\n case 15: System.out.println(\"The cerebellum is responsible for what?\\r\\n\" + \r\n \"1.) visual info processing\\r\\n\" + \r\n \"2.) secrets hormones\\r\\n\" + \r\n \"3.) balance and coordination\\r\\n\" + \r\n \"4.) controls heartbeat\\r\\n\");\r\n break;\r\n case 16: System.out.println(\"Transphobia is the fear of?\\r\\n\" + \r\n \"1.) transgender individuals\\r\\n\" + \r\n \"2.) homosexual individuals\\r\\n\" + \r\n \"3.) women\\r\\n\" + \r\n \"4.) transfats\\r\\n\");\r\n break;\r\n case 17: System.out.println(\"What factors contribute to a positive IQ score in children?\\r\\n\" + \r\n \"1.) early access to words\\r\\n\" + \r\n \"2.) affectionate parents\\r\\n\" + \r\n \"3.) spending time on activities\\r\\n\" + \r\n \"4.) all of the above\\r\\n\");\r\n break;\r\n case 18: System.out.println(\"Emotions can be ______.\\r\\n\" + \r\n \"1.) a reaction\\r\\n\" + \r\n \"2.) a goal\\r\\n\" + \r\n \"3.) all of the above\\r\\n\" + \r\n \"4.) none of the above\\r\\n\");\r\n break;\r\n case 19: System.out.println(\"What is not a stage in increasing prejudice?\\r\\n\" + \r\n \"1.) verbal rejection\\r\\n\" + \r\n \"2.) extermination\\r\\n\" + \r\n \"3.) avoidance\\r\\n\" + \r\n \"4.) self agreement\\r\\n\");\r\n break;\r\n case 20: System.out.println(\"What part of the brain is still developing in adolescents?\\r\\n\" + \r\n \"1.) brain stem\\r\\n\" + \r\n \"2.) pons\\r\\n\" + \r\n \"3.) prefrontal cortex\\r\\n\" + \r\n \"4.) occipital\\r\\n\");\r\n break;\r\n }\r\n\r\n return questionNumber;\r\n }", "private void checkIfQuestionUsed(int randIdx)\n\t{\n\t\t\tfor(Integer current : questionsUsed)\n\t\t\t{\n\t\t\t\tif (current == randIdx) {\n\t\t\t\t\tquestionUsed = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tquestionUsed = false;\n\t\t\t}\n\t}", "private void nextQuestion() {\n\n // increment current question index\n currentQuestionIndex++;\n\n // if the current question index is smaller than the size of the quiz list\n if (currentQuestionIndex < quizList.size()) {\n\n // clear the possible answers\n possibleAnswers.clear();\n\n // grab the definition of current question, assign the correct answer variable\n // and add it to the list of possible answers.\n definition = quizList.get(currentQuestionIndex)[0];\n correctAnswer = quizMap.get(definition);\n possibleAnswers.add(correctAnswer);\n\n // while there's less than 4 possible answers, get a random answer\n // and if it hasn't already been added, add it to the list.\n while (possibleAnswers.size() < 4) {\n String answer = quizList.get(new Random().nextInt(quizList.size() - 1))[1];\n if (!possibleAnswers.contains(answer)) {\n possibleAnswers.add(answer);\n }\n }\n\n // shuffle possible answers so they display in a random order\n Collections.shuffle(possibleAnswers);\n } else {\n // if the question index is out of bounds, set quiz as finished\n quizFinished = true;\n }\n }", "public void randomize() {\n\t\tx = ThreadLocalRandom.current().nextInt(0, 499 + 1);\n\t\ty = ThreadLocalRandom.current().nextInt(0, 499 + 1);\n\t}", "public double getRandomX() {\r\n\t\treturn x1;\r\n\t}", "public void kast() {\n\t\t// vaelg en tilfaeldig side\n\t\tdouble tilfaeldigtTal = Math.random();\n\t\tvaerdi = (int) (tilfaeldigtTal * 6 + 1);\n\t}", "public void random(){\r\n\t\tRandom rand = new Random();\r\n\t\trandArray = new int[6];\r\n\t\tfor (int i = 0; i < 6; i++){\r\n\t\t\t//Randomly generated number from zero to nine\r\n\t\t\trandom = rand.nextInt(10);\r\n\t\t\t//Random values stored into the array\r\n\t\t\trandArray[i] = random;\r\n\t\t\tif(i == 0){\r\n\t\t\t\ta = random;\r\n\t\t\t}\r\n\t\t\tif(i == 1){\r\n\t\t\t\tb = random;\r\n\t\t\t}\r\n\t\t\tif(i == 2){\r\n\t\t\t\tc = random;\r\n\t\t\t}\r\n\t\t\tif(i == 3){\r\n\t\t\t\td = random;\r\n\t\t\t}\r\n\t\t\tif(i == 4){\r\n\t\t\t\tf = random;\r\n\t\t\t}\r\n\t\t\tif(i == 5){\r\n\t\t\t\tg = random;\r\n\t\t\t}\r\n\t\t\t//Random values outputted\r\n\t\t\t//Prints out if the hint was not used.\r\n\t\t\tif (executed == false || guessed == true ){\r\n\t\t\t\tprint(randArray[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Prints out if the hint was not used.\r\n\t\tif (executed == false || guessed == true){\r\n\t\t\tprintln(\" Randomly Generated Value\");\r\n\t\t}\r\n\t}", "public MovieQuestion getQuestion() {\n\t\tMovieQuestion newQ = new MovieQuestion();\n\t\tint row;\n\t\tCursor c;\n\t\tboolean okToAdd = false;\n\n\t\t// Pick random question\n\t\tswitch ((int)(Math.random()*9)) {\n\t\tcase 0: // Who directed the movie %s?\n\t\t\tc = mDb.rawQuery(\"SELECT * FROM movies\", null);\n\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\tc.moveToPosition(row);\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[0], c.getString(1));\n\t\t\tnewQ.answers[0] = c.getString(3);\n\t\t\t\n\t\t\tLog.i(\"NewQuestion\", \"Correct:\" + c.getString(3));\n\t\t\t\n\t\t\t// Fill answers with unique wrong values\n\t\t\tfor(int i = 1; i < 4;) {\n\t\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\t\tc.moveToPosition(row);\n\t\t\t\tLog.i(\"NewQuestion\", \"Wrong:\" + c.getString(3));\n\t\t\t\t// i < 4, so we do not increment indefinitely.\n\t\t\t\tfor(int j = 0; j < i && i < 4; j++) {\n\t\t\t\t\tif(newQ.answers[j].equals(c.getString(3))) {\n\t\t\t\t\t\tokToAdd = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tokToAdd = true;\n\t\t\t\t}\n\t\t\t\tif(okToAdd)\n\t\t\t\t\tnewQ.answers[i++] = c.getString(3);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 1: // When was the movie %s released?\n\t\t\tc = mDb.rawQuery(\"SELECT * FROM movies\", null);\n\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\tc.moveToPosition(row);\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[1], c.getString(1));\n\t\t\tnewQ.answers[0] = c.getString(2);\n\n\t\t\t// Fill answers with unique wrong values\n\t\t\tfor(int i = 1; i < 4;) {\n\t\t\t\tint wrongYear = Integer.parseInt(newQ.answers[0]) + (int)((Math.random()-.5)*50); // +/- [1-25] years\n\t\t\t\tif (wrongYear <= 2014 && wrongYear != Integer.parseInt(newQ.answers[0]))\n\t\t\t\t\tnewQ.answers[i++] = \"\" + wrongYear;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 2: // Which star was in the movie %s?\n\t\t\tc = mDb.rawQuery(\"SELECT DISTINCT m.`title`, m.`director`, s.`first_name`, s.`last_name` FROM `movies` m, `stars` s, `stars_in_movies` sm WHERE m.id = sm.movie_id AND s.id = sm.star_id AND s.id GROUP BY m.`id`, s.`first_name`, s.`last_name` ORDER BY RANDOM() LIMIT 4\", null);\n\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\tc.moveToFirst(); // only 4 results are returned.\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[2], c.getString(0));\n\t\t\tnewQ.answers[0] = c.getString(2) +\" \"+ c.getString(3); \n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\tfor (int j = 1; j < 4; j++) {\n\t\t\t\tc.moveToNext();\n\t\t\t\tnewQ.answers[j] = c.getString(2) +\" \"+ c.getString(3);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 3: // Which star was not in the movie %s?\n\t\t\t// The lone star, the left out one...the answer\n\t\t\tString singleActorQuery = \"SELECT mov.`title`, star.`first_name`, star.`last_name`, star.`id` FROM `movies` mov, `stars` star, \"+\n\t\t\t\t\t\"(SELECT movie_id, star_id FROM `stars_in_movies` GROUP BY movie_id HAVING COUNT(star_id) <= 1 ORDER BY RANDOM() LIMIT 1) mult \"+ \n\t\t\t\t\t\"WHERE mov.`id` = mult.`movie_id` AND star.`id`= mult.`star_id`\";\n\t\t\tc = mDb.rawQuery(singleActorQuery, null);\n\t\t\tc.moveToFirst();\n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\tnewQ.answers[0] = c.getString(1) +\" \"+c.getString(2);\n\n\t\t\t// The cool kids: A group of actors in the same movie....excluding the lone star.\n//\t\t\tString starId = c.getString(3);\n\t\t\tString multipleActorQuery = \"SELECT mov.`title`, star.`first_name`, star.`last_name` \" +\n\t\t\t\t\t\"FROM `movies` mov, `stars` star, `stars_in_movies` sim, \" +\n\t\t\t\t\t\"(SELECT movie_id, star_id FROM `stars_in_movies` GROUP BY movie_id HAVING COUNT(star_id) > 2 ORDER BY RANDOM() LIMIT 1) mult\" +\n\t\t\t\t\t\" WHERE mov.`id` = mult.`movie_id` AND star.`id` = sim.`star_id` AND mult.`movie_id` = sim.`movie_id` \" +\n\t\t\t\t\t\"LIMIT 3\";\n\t\t\tc = mDb.rawQuery(multipleActorQuery, null);\n\t\t\tc.moveToFirst();\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[3], c.getString(0));\n\t\t\tfor (int i = 1; i < 4; i++) {\n\t\t\t\tnewQ.answers[i] = c.getString(1) +\" \"+c.getString(2);\n\t\t\t\tc.moveToNext();\n\t\t\t}\n\n\t\t\tbreak;\n\t\tcase 4: // In which movie do the stars %s and %s appear together?\n\t\t\t// Get a movie they both star in\n\t\t\tc = mDb.rawQuery(\"SELECT m.`title`, s.`first_name`, s.`last_name`, s2.`first_name`, s2.`last_name`\" +\n\t\t\t\t\t\"FROM `movies` m, `stars` s, `stars` s2, `stars_in_movies` sm, `stars_in_movies` sm2 \" +\n\t\t\t\t\t\"WHERE m.id = sm.movie_id AND m.id = sm2.movie_id AND s.id = sm.star_id AND s2.id = sm2.star_id AND s.id != s2.id \" +\n\t\t\t\t\t\"GROUP BY m.`id`, s.`first_name`, s.`last_name` ORDER BY RANDOM() LIMIT 4\", null);\n\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\tc.moveToFirst();\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[4], c.getString(1)+\" \"+c.getString(2), c.getString(3)+\" \"+c.getString(4));\n\t\t\tnewQ.answers[0] = c.getString(0); \n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\tfor (int j = 1; j < 4; j++) {\n\t\t\t\tc.moveToNext();\n\t\t\t\tnewQ.answers[j] = c.getString(0);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 5: // Who directed the star %s?\n\t\t\tc = mDb.rawQuery(\"SELECT DISTINCT m.`year`, m.`director`, s.`first_name`, s.`last_name` FROM `movies` m, `stars` s, `stars_in_movies` sm WHERE m.id = sm.movie_id AND s.id = sm.star_id AND s.id GROUP BY m.`id`, s.`first_name`, s.`last_name` ORDER BY RANDOM() LIMIT 4\", null);\n\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\tc.moveToFirst(); // only 4 results are returned.\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[5], c.getString(2) +\" \"+ c.getString(3));\n\t\t\tnewQ.answers[0] = c.getString(1); \n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\tfor (int j = 1; j < 4; j++) {\n\t\t\t\tc.moveToNext();\n\t\t\t\tnewQ.answers[j] = c.getString(1);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 6: // Which star appears in both movies %s and %s?\n\t\t\t// Get the 2 movies with the same actor...\n\t\t\tc = mDb.rawQuery(\"SELECT mov.`id`, mov.`title`, star.`first_name`, star.`last_name`, star.`id` FROM `movies` mov, `stars_in_movies` sim, `stars` star, (SELECT movie_id, star_id, COUNT(movie_id) as cnt FROM `stars_in_movies` GROUP BY star_id HAVING COUNT(movie_id) > 3 ORDER BY RANDOM() LIMIT 1) as popular WHERE sim.`movie_id` = mov.`id` AND popular.`star_id` = sim.`star_id` AND star.`id` = sim.`star_id` LIMIT 2\", null);\n\t\t\tc.moveToFirst();\n\t\t\tString id = c.getString(4);\n\t\t\t\n\t\t\tString[] movies = new String[2];\n\t\t\tmovies[0] = c.getString(1);\n\t\t\tc.moveToNext();\n\t\t\tmovies[1] = c.getString(1);\n\t\t\t\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[6], movies[0], movies[1]);\n\t\t\tnewQ.answers[0] = c.getString(2) +\" \"+ c.getString(3);\n\t\t\t\n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\t\n\t\t\t// Pick 3 alternatives...\n\t\t\tc = mDb.rawQuery(\"SELECT s.first_name, s.last_name FROM stars s WHERE s.id != \"+id+\" GROUP BY s.id ORDER BY RANDOM() LIMIT 3\", null);\n\t\t\tc.moveToFirst();\n\t\t\tfor (int i = 1; i < 4; i++) {\n\t\t\t\tnewQ.answers[i] = c.getString(0) +\" \"+ c.getString(1);\n\t\t\t\tc.moveToNext();\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 7: // Which star did not appear in the same movie with the star %s?\n\t\t\t// The lone star, the left out one...the answer\n\t\t\tString singleActorQueryII = \"SELECT mov.`title`, star.`first_name`, star.`last_name`, star.`id` FROM `movies` mov, `stars` star, \"+\n\t\t\t\t\t\"(SELECT movie_id, star_id FROM `stars_in_movies` GROUP BY movie_id HAVING COUNT(star_id) <= 1 ORDER BY RANDOM() LIMIT 1) mult \"+ \n\t\t\t\t\t\"WHERE mov.`id` = mult.`movie_id` AND star.`id`= mult.`star_id`\";\n\t\t\tc = mDb.rawQuery(singleActorQueryII, null);\n\t\t\tc.moveToFirst();\n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\tnewQ.answers[0] = c.getString(1) +\" \"+c.getString(2);\n\n\t\t\t// The cool kids: A group of actors in the same movie....excluding the lone star.\n\t\t\tString multipleActorQueryII = \"SELECT mov.`title`, star.`first_name`, star.`last_name` \" +\n\t\t\t\t\t\"FROM `movies` mov, `stars` star, `stars_in_movies` sim, \" +\n\t\t\t\t\t\"(SELECT movie_id, star_id FROM `stars_in_movies` GROUP BY movie_id HAVING COUNT(star_id) > 3 ORDER BY RANDOM() LIMIT 1) mult\" +\n\t\t\t\t\t\" WHERE mov.`id` = mult.`movie_id` AND star.`id` = sim.`star_id` AND mult.`movie_id` = sim.`movie_id` \" +\n\t\t\t\t\t\" GROUP BY star.`id`\"+\n\t\t\t\t\t\" LIMIT 4\";\n\t\t\tc = mDb.rawQuery(multipleActorQueryII, null);\n\t\t\tc.moveToFirst();\n\t\t\t// Take the first of the group and put his name in the question\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[7], c.getString(1) +\" \"+c.getString(2));\n\t\t\tc.moveToNext();\n\t\t\tfor (int i = 1; i < 4; i++) {\n\t\t\t\tnewQ.answers[i] = c.getString(1) +\" \"+c.getString(2);\n\t\t\t\tc.moveToNext();\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault: // Who directed the star %s in year %s?\n\t\t\tc = mDb.rawQuery(\"SELECT DISTINCT m.`year`, m.`director`, s.`first_name`, s.`last_name` FROM `movies` m, `stars` s, `stars_in_movies` sm WHERE m.id = sm.movie_id AND s.id = sm.star_id AND s.id GROUP BY m.`id`, s.`first_name`, s.`last_name` ORDER BY RANDOM() LIMIT 4\", null);\n\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\tc.moveToFirst(); // only 4 results are returned.\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[8], c.getString(2) +\" \"+ c.getString(3), c.getString(0));\n\t\t\tnewQ.answers[0] = c.getString(1); \n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\tfor (int j = 1; j < 4; j++) {\n\t\t\t\tc.moveToNext();\n\t\t\t\tnewQ.answers[j] = c.getString(1);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\treturn newQ;\n\t}", "private void fetchNewQuestion()\r\n\t{\r\n\t\t//Gets question and answers from model\r\n\t\tString[] question = quizModel.getNewQuestion();\r\n\t\t\r\n\t\t//Allocates answers to a new ArrayList then shuffles them randomly\r\n\t\tArrayList<String> answers = new ArrayList<String>();\r\n\t\tanswers.add(question[1]);\r\n\t\tanswers.add(question[2]);\r\n\t\tanswers.add(question[3]);\r\n\t\tanswers.add(question[4]);\r\n\t\tCollections.shuffle(answers);\r\n\t\t\r\n\t\t//Allocates north label to the question\r\n\t\tnorthLabel.setText(\"<html><div style='text-align: center;'>\" + question[0] + \"</div></html>\");\r\n\t\t\r\n\t\t//Allocates each radio button to a possible answer. Based on strings, so randomly generated questions...\r\n\t\t//...which by chance repeat a correct answer in two slots, either will award the user a point.\r\n\t\toption1.setText(answers.get(0));\r\n\t\toption2.setText(answers.get(1));\r\n\t\toption3.setText(answers.get(2));\r\n\t\toption4.setText(answers.get(3));\r\n\t\toption1.setActionCommand(answers.get(0));\r\n\t\toption2.setActionCommand(answers.get(1));\r\n\t\toption3.setActionCommand(answers.get(2));\r\n\t\toption4.setActionCommand(answers.get(3));\r\n\t\toption1.setSelected(true);\r\n\t\t\r\n\t\t//Update score\r\n\t\tscoreLabel.setText(\"<html><div style='text-align: center;'>\" + \"Score = \" + quizModel.getScore() + \"</div></html>\");\r\n\t}", "public void nextQuestion(View view) {\n\n Integer num1, num2;\n num1=generateRandomNumber(100);\n num2=generateRandomNumber(100);\n\n //set random number in textview\n TextView tv;\n tv=findViewById(R.id.question);\n tv.setText(Integer.toString(num1)+ \"X\" + Integer.toString(num2));\n\n }", "Point getRandomPoint() {\n\t\t\t\t\tdouble val = Math.random() * 3;\n\t\t\t\t\tif (val >=0.0 && val <1.0)\n\t\t\t\t\t\treturn p1;\n\t\t\t\t\telse if (val >=1.0 && val <2.0)\n\t\t\t\t\t\t\treturn p2;\n\t\t\t\t\telse\n\t\t\t\t\t\t\treturn p3;\n\t\t\t\t\t}", "private void study(String studyToolId) {\n String[][] questionsAndAnswers = studyToolManager.fetchQuestionsAndAnswers(studyToolId);\n String templateId = studyToolManager.getStudyToolTemplateId(studyToolId);\n TemplateManager.TemplateType templateType = templateManager.getTemplateType(Integer.parseInt(templateId));\n List<Object> timeInfo = templateManager.getTimeInfo(templateId);\n boolean isTimed = (Boolean) timeInfo.get(0);\n boolean isTimedPerQuestion = (Boolean) timeInfo.get(1);\n long timeLimitInMS = 1000 * (Integer) timeInfo.get(2);\n long quizStartTime = System.currentTimeMillis();\n int total_score = questionsAndAnswers.length;\n int curr_score = 0;\n Queue<String[]> questionsToRepeat = new LinkedList<>();\n AnswerChecker answerChecker = studyToolManager.getAnswerChecker(studyToolId);\n for (String[] qa : questionsAndAnswers) {\n long questionStartTime = System.currentTimeMillis();\n studyToolDisplayer.displayAQuestion(qa);\n regularPresenter.getAnswerPrompter(templateType);\n String answer = scanner.nextLine();\n boolean correctness = answerChecker.isCorrectAnswer(answer, qa[1]);\n if (templateType.equals(TemplateManager.TemplateType.FC) && !correctness) {\n // TODO: make this depend on template's configuration\n questionsToRepeat.add(qa);\n }\n long questionTimeElapsed = System.currentTimeMillis() - questionStartTime;\n if (isTimed && isTimedPerQuestion && (questionTimeElapsed >= timeLimitInMS)) {\n regularPresenter.ranOutOfTimeReporter();\n } else {\n curr_score += (correctness ? 1 : 0);\n regularPresenter.correctnessReporter(correctness);\n }\n regularPresenter.pressEnterToShowAnswer();\n scanner.nextLine();\n studyToolDisplayer.displayAnAnswer(qa);\n }\n //FC only, for repeating wrong questions until all is memorized\n while (!questionsToRepeat.isEmpty()) {\n String[] qa = questionsToRepeat.poll();\n studyToolDisplayer.displayAQuestion(qa);\n regularPresenter.getAnswerPrompter(templateType);\n String answer = scanner.nextLine();\n boolean correctness = answerChecker.isCorrectAnswer(answer, qa[1]);\n if (!correctness) {\n questionsToRepeat.add(qa);\n }\n regularPresenter.correctnessReporter(correctness);\n regularPresenter.pressEnterToShowAnswer();\n studyToolDisplayer.displayAnAnswer(qa);\n }\n long quizTimeElapsed = System.currentTimeMillis() - quizStartTime;\n if (isTimed && !isTimedPerQuestion && (quizTimeElapsed >= timeLimitInMS)){\n regularPresenter.ranOutOfTimeReporter();\n }\n else if (templateManager.isTemplateScored(templateId)) {\n String score = curr_score + \"/\" + total_score;\n regularPresenter.studySessionEndedReporter(score);\n }\n }", "public Test(ArrayList<WrittenQuestion> questions){\r\n\t\tmyQuestions = new ArrayList<WrittenQuestion>();\r\n\t\tfor(WrittenQuestion q : questions){\r\n\t\t\tif(q instanceof Question){\r\n\t\t\t\tmyQuestions.add(new Question((Question)q));\r\n\t\t\t}else{\r\n\t\t\t\tmyQuestions.add(new WrittenQuestion(q));\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(allIDs==null){\r\n\t\t\tallIDs = new ArrayList<Integer>();\r\n\t\t\tfor (int i = 0; i<1000; i++){\r\n\t\t\t\tallIDs.add(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tRandom r = new Random();\r\n\t\tid = allIDs.remove((int)(r.nextInt(allIDs.size())));\r\n\r\n\t}", "public static int csQuestions(int csPathway) {\r\n int questionNumber = (int) (Math.random() * 20) + 1;\r\n\r\n switch (questionNumber) {\r\n case 1:\r\n System.out.println(\r\n \"\\r\\n\" + \"Which of the following is not one of the 8 ethics of programming\\r\\n\" + \"1.) Self\\r\\n\"\r\n + \"2.) Product\\r\\n\" + \"3.) Gracious Professionalism \\r\\n\" + \"4.) Public\\r\\n\");\r\n break;\r\n case 2:\r\n System.out.println(\r\n \"What’s wrong with the following main method? Public static boolean main(String args[]) {\\r\\n\"\r\n + \"1.) The main should be private\\r\\n\" + \"2.) The p in public should be lowercase\\r\\n\"\r\n + \"3.) The arguments should be int\\r\\n\"\r\n + \"4.) The p in public should be lowercase and boolean should be void\\r\\n\");\r\n break;\r\n case 3:\r\n System.out.println(\r\n \"What are the primitive types?\\r\\n\"\r\n + \"1.) byte, String, int, double, char, boolean, float, long\\r\\n\"\r\n + \"2.) double, char, boolean, float\\r\\n\"\r\n + \"3.) byte, short, int, long, float, double, char, boolean\\r\\n\"\r\n + \"4.) double, class, boolean, float\\r\\n\");\r\n break;\r\n case 4:\r\n System.out.println(\r\n \"The “less than or equal to” comparison operator in Java is _______.\\r\\n\" + \"1.) =<\\r\\n\"\r\n + \"2.) !=\\r\\n\" + \"3.) <=\\r\\n\" + \"4.) <\\r\\n\");\r\n break;\r\n case 5:\r\n System.out.println(\r\n \"What are the benefits of modular programming?\\r\\n\"\r\n + \"1.) Methods are used to break code into manageable pieces\\r\\n\"\r\n + \"2.) Make code more reusable\\r\\n\" + \"3.) Help to debug code\\r\\n\"\r\n + \"4.) All of the above\\r\\n\");\r\n break;\r\n case 6:\r\n System.out.println(\r\n \"The following code displays ______.\\r\\n\" + \" double temp = 50;\\r\\n\" + \" \\r\\n\"\r\n + \" if (temp >= 100)\\r\\n\" + \" System.out.println(“too hot’);\\r\\n\"\r\n + \" else if (temp <=40)\\r\\n\" + \" System.out.println(“too cold”);\\r\\n\"\r\n + \" else \\r\\n\" + \" System.out.println(“just right”);\\r\\n\"\r\n + \"1.) too hot too cold just right\\r\\n\" + \"2.) too hot\\r\\n\" + \"3.) too cold\\r\\n\"\r\n + \"4.) just right\\r\\n\");\r\n break;\r\n case 7:\r\n System.out.println(\r\n \"The order of precedence (from high to low) of the operators +,*, &&, ||, ! is\\r\\n\"\r\n + \"1.) *, +, !, &&, ||\\r\\n\" + \"2.) *, +, &&, ||, !\\r\\n\" + \"3.) &&, ||, !, +, *\\r\\n\"\r\n + \"4.) *, +, !, ||, &&\\r\\n\");\r\n break;\r\n case 8:\r\n System.out.println(\r\n \"What does the String Class, s.length() do?\\r\\n\" + \"1.) returns the character at index x\\r\\n\"\r\n + \"2.) returns true/false if the string stored in s is the same as that in t ignoring the case\\r\\n\"\r\n + \"3.) returns the number of characters in the string\\r\\n\"\r\n + \"4.) returns the string in all lowercase\\r\\n\");\r\n break;\r\n case 9:\r\n System.out.println(\r\n \"What does the Math Class, Math.random() do?\\r\\n\"\r\n + \"1.) returns a double from 0.0 and less than 1.0\\r\\n\"\r\n + \"2.) return a double of the square root of the value given\\r\\n\"\r\n + \"3.) returns the minimum of the two values given\\r\\n\"\r\n + \"4.) returns a double of the base raised to the exponent\\r\\n\");\r\n break;\r\n case 10:\r\n System.out.println(\r\n \"What does void in the following method, public static void main(String[] args), mean?\\r\\n\"\r\n + \"1.) when called on, this method will not have a return value\\r\\n\"\r\n + \"2.) void is the method name\\r\\n\"\r\n + \"3.) when called on, this method will return a boolean\\r\\n\"\r\n + \"4.) void represent that this method needs no parameters\\r\\n\");\r\n break;\r\n case 11:\r\n System.out.println(\r\n \"What is wrong with the following line, System.out.println(“Hello World”)\\r\\n\"\r\n + \"1.) System should be lowercase\\r\\n\" + \"2.) missing a semicolon at the end\\r\\n\"\r\n + \"3.) Hello World needs to be in single quotations\\r\\n\"\r\n + \"4.) missing a comma at the end\\r\\n\");\r\n break;\r\n case 12:\r\n System.out.println(\r\n \"What is // used for?\\r\\n\" + \"1.) print a new line\\r\\n\" + \"2.) block comments\\r\\n\"\r\n + \"3.) single line comments\\r\\n\" + \"4.) print double space\\r\\n\");\r\n break;\r\n case 13:\r\n System.out.println(\r\n \"What does the String Class, s.equalsIgnoreCase(t) do?\\r\\n\"\r\n + \"1.) returns the string in all lowercase\\r\\n\" + \"2.) returns the character at index x\\r\\n\"\r\n + \"3.) returns true/false if the string stored in s is the same as that in t\\r\\n\"\r\n + \"4.) returns true/false if the string stored in s is the same as that in t ignoring the case\\r\\n\");\r\n break;\r\n case 14:\r\n System.out.println(\r\n \"If you run a program and it returns with ArrayIndexOutOfBoundsException. There’s a ______.\\r\\n\"\r\n + \"1.) runtime error\\r\\n\" + \"2.) syntax error\\r\\n\" + \"3.) format error \\r\\n\"\r\n + \"4.) logic error\\r\\n\");\r\n break;\r\n case 15:\r\n System.out.println(\r\n \"What are two ways to make code more readable?\\r\\n\" + \"1.) comments and arrays\\r\\n\"\r\n + \"2.) descriptive names and randomized casing\\r\\n\"\r\n + \"3.) descriptive names and comments\\r\\n\" + \"4.) indentation and return statements \\r\\n\");\r\n break;\r\n case 16:\r\n System.out.println(\r\n \"A for statement is a _________.\\r\\n\" + \"1.) conditional loop\\r\\n\" + \"2.) counter loop \\r\\n\"\r\n + \"3.) selection statement\\r\\n\" + \"4.) selection loop\\r\\n\");\r\n break;\r\n case 17:\r\n System.out.println(\r\n \"// are used for what in Java?\\r\\n\" + \"1.) single line commenting \\r\\n\"\r\n + \"2.) end of a java statement \\r\\n\" + \"3.) block comment\\r\\n\"\r\n + \"4.) Java doc comment\\r\\n\");\r\n break;\r\n case 18:\r\n System.out.println(\r\n \"Which of the following is the correct way to name a variable?\\r\\n\" + \"1.) StudentNumber\\r\\n\"\r\n + \"2.) _student_number\\r\\n\" + \"3.) STUDENTNUMBER\\r\\n\" + \"4.) studentNumber\\r\\n\");\r\n break;\r\n case 19:\r\n System.out.println(\r\n \"What will the following code execute?\\r\\n\" + \" int x = 10;\\r\\n\" + \" x += 5;\\r\\n\"\r\n + \" System.out.println(“X equals” + x);\\r\\n\" + \"1.) prints out “X equals x”\\r\\n\"\r\n + \"2.) prints out “X equals 10”\\r\\n\" + \"3.) prints out “X equals 15”\\r\\n\"\r\n + \"4.) prints out “X equals 5”\\r\\n\");\r\n break;\r\n case 20:\r\n System.out.println(\r\n \"What does the Math Class, Math.pow(base, exp) do?\\r\\n\"\r\n + \"1.) return a double of the square root of the value given\\r\\n\"\r\n + \"2.) returns a double from 0.0 and less than 1.0\\r\\n\"\r\n + \"3.)returns the maximum of the two values given\\r\\n\"\r\n + \"4.) returns a double of the base raised to the exponent\\r\\n\");\r\n }\r\n\r\n return questionNumber;\r\n }", "public int getRandomY() {\r\n\t\treturn y1;\r\n\t}", "public static int getRandomTask() {\n double p = rand.nextDouble(); // required probs given in Question\n for (int i = 0; i < 6; i++) {\n if (p <= prob[i])\n return i;\n }\n return 1;\n }", "public void resetQuestion() \n\t{\n\t\tthis.game = masterPanel.getGame();\n\t\t\n\t\tArrayList<String> tempQuestion = new ArrayList<String>();\n\t\ttempQuestion = getRandQuestion();\n\t\t\n\t\tquestion.setText(tempQuestion.get(0));\n\t\tanswerOne.setText(tempQuestion.get(1));\n\t\tanswerTwo.setText(tempQuestion.get(2));\n\t\tanswerThree.setText(tempQuestion.get(3));\n\t\tanswerFour.setText(tempQuestion.get(4));\n\t\tcorrectAnswer = tempQuestion.get(5);\n\t\t\n\t\tlayoutConstraints.gridy = 1;\n\t\tthis.add(answerOne, layoutConstraints);\n\t\t\n\t\tlayoutConstraints.gridy = 2;\n\t\tthis.add(answerTwo, layoutConstraints);\n\t\t\n\t\tlayoutConstraints.gridy = 3;\n\t\tthis.add(answerThree, layoutConstraints);\n\t\t\n\t\tlayoutConstraints.gridy = 4;\n\t\tthis.add(answerFour, layoutConstraints);\n\t\t\n\t\tthis.repaint();\n\t}", "int randomPoint() { return 1 + (int)Math.round((Math.random()*20) % (size - 2)); }", "void gatherInfoBeforePopulating (){\n\t\t\n\t\tcategoryId = Trivia_Game.getCategoryIdInMainMenu();\n\n\t \t //Loop until a valid questionId that hasn't been used is obtained\n\t \t\twhile (validQuestionNumber == false){\n\t \t\t\trandomValue0to29 = RandomGenerator0To29();\n\t \t\t\tSystem.out.println(\"random30 in onClick = \" + randomValue0to29);\n\n\t \t\t alreadyDisplayQuestion = questionsAlreadyDisplayed (randomValue0to29);\n\t \t\t if (alreadyDisplayQuestion == true){\n\t \t\t\t System.out.println(\"question number already displayed looking for a non displayed question\");\n\t \t\t }\n\t \t\t if (alreadyDisplayQuestion == false){\n\t \t\t\t System.out.println(\"question not displayed yet\");\n\t \t\t\t validQuestionNumber = true;\n\t \t\t }\n\t \t }\n\t \t \n\t \t validQuestionNumber = false;\n\t \t alreadyDisplayQuestion = false;\n\t \t questionId = randomValue0to29;\t//sets the valid random generated number to the questionID\n\t \t \n\t \t //connect to database to gather the question and answers\n\t \t getInfoFromDatabase(categoryId, questionId);\n \t\n\t \t //Calls random number from 0 to 3 to determine which button will display the correct answer\n\t \t randomValueZeroToThree = RandomGeneratorZeroToThree();\n\t \t System.out.println(\"random4 in onClick = \" + randomValueZeroToThree);\n\t \t \n\t \t //Sets the order according to the button that is to display the correct answer\n\t \t switch (randomValueZeroToThree){\n\t \t \tcase 0:\n\t \t \t\tdisplayedAnswer1FromDatabase = answer1FromDatabase;\t//correct answer\n\t \t \t\tdisplayedAnswer2FromDatabase = answer2FromDatabase;\n\t \t \t\tdisplayedAnswer3FromDatabase = answer3FromDatabase;\n\t \t \t\tdisplayedAnswer4FromDatabase = answer4FromDatabase;\n\t \t \t\trightButton1 = true;\n\t \t \t\trightButton2 = false;\n\t \t \t\trightButton3 = false;\n\t \t \t\trightButton4 = false;\n\t \t \t\tbreak;\n\t \t \t\t\n\t \t \tcase 1:\n\t \t \t\tdisplayedAnswer2FromDatabase = answer1FromDatabase;\t//correct answer\n\t \t \t\tdisplayedAnswer1FromDatabase = answer2FromDatabase;\n\t \t \t\tdisplayedAnswer3FromDatabase = answer3FromDatabase;\n\t \t \t\tdisplayedAnswer4FromDatabase = answer4FromDatabase;\n\t \t \t\trightButton1 = false;\n\t \t \t\trightButton2 = true;\n\t \t \t\trightButton3 = false;\n\t \t \t\trightButton4 = false;\n\t \t \t\tbreak;\n\t \t \t\n\t \t \tcase 2:\n\t \t \t\tdisplayedAnswer3FromDatabase = answer1FromDatabase;\t//correct answer\n\t \t \t\tdisplayedAnswer1FromDatabase = answer2FromDatabase;\n\t \t \t\tdisplayedAnswer2FromDatabase = answer3FromDatabase;\n\t \t \t\tdisplayedAnswer4FromDatabase = answer4FromDatabase;\n\t \t \t\trightButton1 = false;\n\t \t \t\trightButton2 = false;\n\t \t \t\trightButton3 = true;\n\t \t \t\trightButton4 = false;\n\t \t \t\tbreak;\n\t \t \t\t\n\t \t \tcase 3:\n\t \t \t\tdisplayedAnswer4FromDatabase = answer1FromDatabase;\t//correct answer\n\t \t \t\tdisplayedAnswer1FromDatabase = answer2FromDatabase;\n\t \t \t\tdisplayedAnswer3FromDatabase = answer3FromDatabase;\n\t \t \t\tdisplayedAnswer2FromDatabase = answer4FromDatabase;\n\t \t \t\trightButton1 = false;\n\t \t \t\trightButton2 = false;\n\t \t \t\trightButton3 = false;\n\t \t \t\trightButton4 = true;\n\t \t \t\tbreak;\n\t \t \t\n\t \t \tdefault: \n\t \t \t\tdisplayedAnswer1FromDatabase = answer4FromDatabase;\t//no correct answer\n\t \t \t\tdisplayedAnswer2FromDatabase = answer2FromDatabase;\n\t \t \t\tdisplayedAnswer3FromDatabase = answer3FromDatabase;\n\t \t \t\tdisplayedAnswer4FromDatabase = answer1FromDatabase;\t\n\t \t \t\trightButton1 = false;\n\t \t \t\trightButton2 = false;\n\t \t \t\trightButton3 = false;\n\t \t \t\trightButton4 = false;\n\t \t \t\t\n \t }\n\t \n\t // After the 9th question is displayed, the nextOfFinishValue should be set to 1 so the button displayes Finish instead of Next\n \t if (numberOfQuestionsDisplayedCounter < 9){\n\t \t\t\tnextOrFinishValue = 0;\n\t \t\t}\n\t \t\telse{\n\t \t\t\tnextOrFinishValue = 1;\n\t \t\t}\n\t\t\n\t}", "public int askquestion(int J, int M, int X, int Y){\n\t\t//type of 5 shall result questions that are a randomly mixture of addition, multiplication, subtraction, and division problems\n\t\tif(M == 5) {\n\t\t\tM = 1 + rand.nextInt(4);\n\t\t}\n\t\t\t\t\n\t\t\t\t\tswitch (M) {\n\t\t\t\t\t//type of 1 shall limit the program to generating only addition problems\n\t\t case 1: System.out.println(\"Solve this addition problem:\\n\");\n\t\t\t\t\t\t\tSystem.out.println(\"How much is \" + X + \" plus \" + Y + \" equal\");\n\t\t\t\t\t\t\t M = X+Y;\n\t\t break;\n\t\t // type 2 shall limit the program to generating only multiplication problems.\n\t\t case 2: System.out.println(\"Solve this multiplication problem:\\n\");\n\t\t\t\t\t\t\tSystem.out.println(\"How much is \" + X + \" times \" + Y + \" equal\");\n\t\t\t\t\t\t\tM = X*Y;\n\t\t break;\n\t\t //type of 3 shall limit the program to generating only subtraction problems\n\t\t case 3: System.out.println(\"Solve this subtraction problem:\\n\");\n\t\t\t\t\t\t\tSystem.out.println(\"How much is \" + X + \" minus \" + Y + \" equal\");\n\t\t\t\t\t\t\tM = X-Y;\n\t\t break;\n\t\t // type of 4 shall limit the program to generating only division problems\n\t\t case 4: System.out.println(\"Solve this division problem:\\n\");\n\t\t\t\t\t\t\tSystem.out.println(\"How much is \" + X + \" divided by \" + Y + \" equal\");\n\t\t\t\t\t\t\tM = 0;\n\t\t break;}\n\t\t return M;\n\t\t\t\t}", "public void setTFChoices() {\r\n Random randomGenerator = new Random();\r\n int trueFalseAnswer = randomGenerator.nextInt(2);\r\n studentAnswer.add(trueFalseAnswer);\r\n }", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n System.out.println(\"Do you want to try your luck with the slot machine? Type 1 for YES or 2 for NO:\");\n int answer = sc.nextInt();\n\n\n //Create If/Else based on Yes/No response\n //Create For loop to generate numbers\n //Convert int affirmation to string value\n\n if (answer == 1)\n {\n for (int i = 0; i <= 2; i++)\n {\n double j = (Math.random() *10);\n int k = (int) j;\n System.out.print(\"[\"+k+\"]\");\n }\n }\n\n else\n {\n System.out.println(\"Maybe next time!\");\n\n }\n }", "public String checkNewQuestions() {\n\t\tint numAnswers = testGenerator.getNumAnswers(questionNo);\n\t\tString question = \"\";\n\n\t\tquestion += testGenerator.getQuestionText(questionNo);\n\t\tquestion += testGenerator.getAnswerText(questionNo, 1);\n\t\tquestion += testGenerator.getAnswerText(questionNo, 2);\n\n\t\tif(numAnswers >= 3) {\n\t\t\tquestion += testGenerator.getAnswerText(questionNo, 3);\n\t\t} \n\t\tif(numAnswers == 4) {\n\t\t\tquestion += testGenerator.getAnswerText(questionNo, 4);\n\t\t}\n\t\treturn question;\n\t}", "@FXML\n\tprivate void answerQuestion() {\n\t\tint correctAnsID = 0;\n\t\ttry {\n\t\t\tswitch (((RadioButton) answerGroup.getSelectedToggle()).getId()) {\n\t\t\tcase \"ans1Check\":\n\t\t\t\tcorrectAnsID = 1;\n\t\t\t\tbreak;\n\t\t\tcase \"ans2Check\":\n\t\t\t\tcorrectAnsID = 2;\n\t\t\t\tbreak;\n\t\t\tcase \"ans3Check\":\n\t\t\t\tcorrectAnsID = 3;\n\t\t\t\tbreak;\n\t\t\tcase \"ans4Check\":\n\t\t\t\tcorrectAnsID = 4;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\terrorLabel.setVisible(true);\n\t\t}\n\n\t\t// nothing is selected\n\t\tif (correctAnsID == 0) { \n\t\t\terrorLabel.setVisible(true);\n\t\t\t// correct answer\n\t\t} else if (question.getCorrect_ans() == correctAnsID) {\n\t\t\tcontrol.setScore(control.getScore() + question.getScore());\n\t\t\thandleAlertAndWindow(AlertType.INFORMATION, \"Congrats! :D\",\n\t\t\t\t\t\"You received \" + question.getScore() + \" points\");\n\t\t\t// wrong answer\n\t\t} else {\n\t\t\tcontrol.setScore(control.getScore() + question.getPenalty());\n\n\t\t\thandleAlertAndWindow(AlertType.ERROR, \"Uh oh! :(\",\n\t\t\t\t\t\"You lost \" + question.getPenalty() + \" points\");\n\t\t}\n\n\t\t// reset the eaten question\n\t\tViewLogic.playGameController.getControl().setQuestionEaten(null);\n\t}", "@Override\n\tpublic void makeDecision() {\n\t\tint powerMax = (int)(initPower) / 100;\n\t\tint powerMin = (int)(initPower * 0.3) / 100;\n\n\t\t// The value is calculated randomly from 0 to 10% of the initial power\n\t\tRandom rand = new Random();\n\t\tint actualPower = rand.nextInt((powerMax - powerMin) + 1) + powerMin;\n\t\tanswer.setConsumption(actualPower);\n\t}", "public AssistantJack(int answerSet) {\n\t\tthis();\n\t\tif(answerSet == 1) {\n\t\t\tthis.correctTheory = new Theory(1,1,1);\n\t\t}\n\t\telse if (answerSet == 2) {\n\t\t\tthis.correctTheory = new Theory(6, 10, 6);\n\t\t}\n\t\telse {\n\t\t\tRandom random = new Random();\n\t\t\tint weapon = random.nextInt(6) + 1;\n\t\t\tint location = random.nextInt(10) + 1;\n\t\t\tint person = random.nextInt(6) + 1;\n\t\t\tthis.correctTheory = new Theory(weapon, location, person);\n\t\t}\n\t}", "@Override\n public Question generate() {\n return new Question(\"Why do Canadians prefer their jokes in hexadecimal?\",\n \"Because 7 8 9 A!\");\n }", "Randomizer getRandomizer();", "private void addQuestion() {\n Question q = new Question(\n \"¿Quien propuso la prueba del camino básico ?\", \"Tom McCabe\", \"Tom Robert\", \"Tom Charlie\", \"Tom McCabe\");\n this.addQuestion(q);\n\n\n Question q1 = new Question(\"¿Qué es una prueba de Caja negra y que errores desean encontrar en las categorías?\", \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\", \"esta basada en la funcionalidad de los módulos del programa\", \" determina la funcionalidad del sistema\", \" determina la funcionalidad del sistema\");\n this.addQuestion(q1);\n Question q2 = new Question(\"¿Qué es la complejidad ciclomática es una métrica de calidad software?\", \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\", \"esta basada en la funcionalidad de los módulos del programa\", \"basada en el cálculo del número\", \"basada en el cálculo del número\");\n this.addQuestion(q2);\n //preguntas del quiz II\n Question q3=new Question(\"Las pruebas de caja blanca buscan revisar los caminos, condiciones, \" +\n \"particiones de control y datos, de las funciones o módulos del sistema; \" +\n \"para lo cual el grupo de diseño de pruebas debe:\",\n \"Conformar un grupo de personas para que use el sistema nuevo\",\n \"Ejecutar sistema nuevo con los datos usados en el sistema actual\",\n \"Generar registro de datos que ejecute al menos una vez cada instrucción\",\n \"Generar registro de datos que ejecute al menos una vez cada instrucción\");\n this.addQuestion(q3);\n Question q4=new Question(\"¿Las pruebas unitarias son llamadas?\",\n \"Pruebas del camino\", \"Pruebas modulares\",\n \"Pruebas de complejidad\", \"Pruebas modulares\");\n this.addQuestion(q4);\n Question q5=new Question(\"¿Qué es una prueba de camino básico?\",\n \"Hace una cobertura de declaraciones del código\",\n \"Permite determinar si un modulo esta listo\",\n \"Técnica de pueba de caja blanca\",\n \"Técnica de pueba de caja blanca\" );\n this.addQuestion(q5);\n Question q6=new Question(\"Prueba de camino es propuesta:\", \"Tom McCabe\", \"McCall \", \"Pressman\",\n \"Tom McCabe\");\n this.addQuestion(q6);\n Question q7=new Question(\"¿Qué es complejidad ciclomatica?\",\"Grafo de flujo\",\"Programming\",\n \"Metrica\",\"Metrica\");\n this.addQuestion(q7);\n //preguntas del quiz III\n Question q8 = new Question(\n \"¿Se le llama prueba de regresión?\", \"Se tienen que hacer nuevas pruebas donde se han probado antes\",\n \"Manten informes detallados de las pruebas\", \"Selección de los usuarios que van a realizar las pruebas\",\n \"Se tienen que hacer nuevas pruebas donde se han probado antes\");\n this.addQuestion(q8);\n Question q9 = new Question(\"¿Cómo se realizan las pruebas de regresión?\",\n \"Selección de los usuarios que van a realizar las pruebas\",\n \"Se tienen que hacer nuevas pruebas donde se han probado antes\", \"A través de herramientas de automatización de pruebas\", \"A través de herramientas de automatización de pruebas\");\n this.addQuestion(q9);\n Question q10 = new Question(\"¿Cuándo ya hay falta de tiempo para ejecutar casos de prueba ya ejecutadas se dejan?\",\n \"En primer plano\", \"En segundo plano\", \"En tercer plano\", \"En segundo plano\");\n this.addQuestion(q10);\n //preguntas del quiz IV\n Question q11 = new Question(\n \"¿En qué se enfocan las pruebas funcionales?\",\n \"Enfocarse en los requisitos funcionales\", \"Enfocarse en los requisitos no funcionales\",\n \"Verificar la apropiada aceptación de datos\", \"Enfocarse en los requisitos funcionales\");\n this.addQuestion(q11);\n Question q12 = new Question(\"Las metas de estas pruebas son:\", \"Verificar la apropiada aceptación de datos\",\n \"Verificar el procesamiento\", \"Verificar la apropiada aceptación de datos, procedimiento y recuperación\",\n \"Verificar la apropiada aceptación de datos, procedimiento y recuperación\");\n this.addQuestion(q12);\n Question q13 = new Question(\"¿En qué estan basadas este tipo de pruebas?\",\n \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\",\n \"Esta basada en la funcionalidad de los módulos del programa\",\n \"Técnicas de cajas negra\", \"Técnicas de cajas negra\");\n this.addQuestion(q13);\n //preguntas del quiz V\n Question q14 = new Question(\n \"¿Cúal es el objetivo de esta técnica?\", \"Identificar errores introducidos por la combinación de programas probados unitariamente\",\n \"Decide qué acciones tomar cuando se descubren problemas\",\n \"Verificar que las interfaces entre las componentes de software funcionan correctamente\",\n \"Identificar errores introducidos por la combinación de programas probados unitariamente\");\n this.addQuestion(q14);\n Question q15 = new Question(\"¿Cúal es la descripción de la Prueba?\",\n \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\",\n \"Esta basada en la funcionalidad de los módulos del programa\",\n \"Describe cómo verificar que las interfaces entre las componentes de software funcionan correctamente\",\n \"Describe cómo verificar que las interfaces entre las componentes de software funcionan correctamente\");\n this.addQuestion(q15);\n Question q16 = new Question(\"Por cada caso de prueba ejecutado:\",\n \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\",\n \"Esta basada en la funcionalidad de los módulos del programa\",\n \"Comparar el resultado esperado con el resultado obtenido\", \"Comparar el resultado esperado con el resultado obtenido\");\n this.addQuestion(q16);\n //preguntas del quiz VI\n Question q17 = new Question(\n \"Este tipo de pruebas sirven para garantizar que la calidad del código es realmente óptima:\",\n \"Pruebas Unitarias\", \"Pruebas de Calidad de Código\",\n \"Pruebas de Regresión\", \"Pruebas de Calidad de Código\");\n this.addQuestion(q17);\n Question q18 = new Question(\"Pruebas de Calidad de código sirven para: \",\n \"Hace una cobertura de declaraciones del código, ramas, caminos y condiciones\",\n \"Verificar que las especificaciones de diseño sean alcanzadas\",\n \"Garantizar la probabilidad de tener errores o bugs en la codificación\", \"Garantizar la probabilidad de tener errores o bugs en la codificación\");\n this.addQuestion(q18);\n Question q19 = new Question(\"Este análisis nos indica el porcentaje que nuestro código desarrollado ha sido probado por las pruebas unitarias\",\n \"Cobertura\", \"Focalización\", \"Regresión\", \"Cobertura\");\n this.addQuestion(q19);\n\n Question q20 = new Question( \"¿Qué significa V(G)?\",\n \"Número de Regiones\", \"Número de Aristas\", \"Número de Nodos\", \"Número de Regiones\");\n this.addQuestion(q20);\n\n Question q21 = new Question( \"¿Qué significa A?\",\n \"Número de Regiones\", \"Número de Aristas\", \"Número de Nodos\", \"Número de Aristas\");\n this.addQuestion(q21);\n\n Question q22 = new Question( \"¿Qué significa N?\",\n \"Número de Regiones\", \"Número de Aristas\", \"Número de Nodos\", \"Número de Nodos\");\n this.addQuestion(q22);\n\n Question q23 = new Question( \"¿Qué significa P?\",\n \"Número de Regiones\", \"Número de Aristas\", \"Número de Nodos Predicado\", \"Número de Nodos Predicado\");\n this.addQuestion(q23);\n Question q24 = new Question( \"De cuantás formas se puede calcular la complejidad ciclomatica V(G):\",\n \"3\", \"1\", \"2\", \"3\");\n this.addQuestion(q24);\n\n // END\n }", "private void gameHelper(int ranNum){\n\t\tif(questionAnsweredCount>=25){\n\t\t\treturn;\n\t\t}\n\t\tSystem.out.println(\"It is \" + teams[ranNum].getName() + \"'s turn to choose a question\");\n\t\t//find category\n\t\tSystem.out.println(\"Please choose a category you would like to answer: \");\n\t\tint categoryIdx = getCategory();\n\t\t//find points\n\t\tSystem.out.println(\"Please enter the dollar value of the question you wish to answer\");\n\t\tint pointIdx = getPointsIndex();\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\t\t//now check if the question is answer knowing dollar and cat is valid\n\t\tboolean answered = board[categoryIdx][pointIdx].answeredYet();\n\t\tif(!answered){\n\t\t\tint point = points[pointIdx];\n\t\t\tSystem.out.println(board[categoryIdx][pointIdx].getQeustion());\n\t\t\tSystem.out.println(\"Enter your answer. Remember to pose it as a question.\");\n\t\t\tString ans = sc.nextLine();\n\t\t\treadExitCommand(ans); // check if the user wants to exit any point\n\t\t\treadReplayCommand(ans);\n\t\t\tboard[categoryIdx][pointIdx].answerQuestion(ans); //ask Q\n\t\t\tif(!board[categoryIdx][pointIdx].getRight()&&board[categoryIdx][pointIdx].getWarned()){\n\t\t\t\t//not in question format. give one more chance\n\t\t\t\tans = sc.nextLine();\n\t\t\t\treadExitCommand(ans);\n\t\t\t\treadReplayCommand(ans);\n\t\t\t\tboard[categoryIdx][pointIdx].answerQuestion(ans);\n\t\t\t}\n\t\t\tif(board[categoryIdx][pointIdx].getRight()){\n\t\t\t\tSystem.out.println(\"You answered it right! \" + point + \" will be added to your total\");\n\t\t\t\tquestionAnsweredCount+= 10;\n\t\t\t\tteams[ranNum].addDollars(point);\n\t\t\t\tprintDollars();\n\t\t\t}\n\t\t\telse{\n\t\t\t\tSystem.out.println(\"Wrong Answer!\");\n\t\t\t\tquestionAnsweredCount++; \n\t\t\t\tteams[ranNum].minusDollars(point);\n\t\t\t\tprintDollars();\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(\"Question already answered. Choose it again\");\n\t\t\tgameHelper(ranNum); //same team choose a question again\n\t\t}\n\t\tint nextIdx = (ranNum+1)%(teams.length);\n\t\tgameHelper(nextIdx);\n\t}", "private void random() {\n\n\t}", "public void generateDemoQuiz() {\n Quiz demoQuiz = new Quiz(); //Instantiate a Quiz\n Category testCategory = makeCategory(); //Make some bs categories to attach the quiz\n Question question1 = new Question(); //Make some bs questions (just one for now)\n question1.setQuestion(\"Which of the following famous scientist cured Cat Cancer?\"); //Set the question ... of the question? IDK how to word this better\n\n //Make some funny cat names\n Answer a1 = new Answer(\"H. John Whiskers\");\n Answer a2 = new Answer(\"Bartolemeu Meowser\");\n Answer a3 = new Answer(\"Catalie Portman\");\n Answer a4 = new Answer(\"Anderson Pooper\");\n\n //Build an arraylist full of said cat names\n ArrayList<Answer> answerList = new ArrayList<Answer>();\n answerList.add(a1);\n answerList.add(a2);\n answerList.add(a3);\n answerList.add(a4);\n\n //Put those answers inside that question!\n question1.setAnswerChoices(answerList);\n question1.setCorrectAnswer(a1); //Everybody knows H John Whiskers cured kitty cancer\n\n //Build an arraylist full of the question(s) you just made, in our demo case there is only one question\n ArrayList<Question> questionList = new ArrayList<Question>();\n questionList.add(question1); //Put the questions inside your list\n\n\n //Put all the data you just made into a Quiz\n demoQuiz.setQuizName(\"Famous Cat Scientists\");\n demoQuiz.setQuizCategory(testCategory);\n demoQuiz.setQuizQuestions(questionList);\n\n }", "int getWrongAnswers();", "public void submitAnswers(View view) {\n\n // Question one\n // Get String given in the first EditText field and turn it into lower case\n EditText firstAnswerField = (EditText) findViewById(R.id.answer_one);\n Editable firstAnswerEditable = firstAnswerField.getText();\n String firstAnswer = firstAnswerEditable.toString().toLowerCase();\n\n // Check if the answer given in the first EditText field is correct and if it is, add one\n // point\n if (firstAnswer.contains(\"baltic\")) {\n points++;\n }\n\n // Question two\n // Get String given in the second EditText field and turn it into lower case\n EditText secondAnswerField = (EditText) findViewById(R.id.answer_two);\n Editable secondAnswerEditable = secondAnswerField.getText();\n String secondAnswer = secondAnswerEditable.toString().toLowerCase();\n\n // Check if the answer given in the second EditText field is correct and if it is, add one\n // point\n if (secondAnswer.contains(\"basketball\")) {\n points++;\n }\n\n // Question three\n // Check if the correct answer is given\n RadioButton thirdQuestionCorrectAnswer = (RadioButton)\n findViewById(R.id.question_3_radio_button_3);\n boolean isThirdQuestionCorrectAnswer = thirdQuestionCorrectAnswer.isChecked();\n // If the correct answer is given, add one point\n if (isThirdQuestionCorrectAnswer) {\n points++;\n }\n\n // Question four\n // Check if the correct answer is given\n RadioButton fourthQuestionCorrectAnswer = (RadioButton)\n findViewById(R.id.question_4_radio_button_2);\n boolean isFourthQuestionCorrectAnswer = fourthQuestionCorrectAnswer.isChecked();\n\n // If the correct answer is given, add one point\n if (isFourthQuestionCorrectAnswer) {\n points++;\n }\n\n // Question five\n // Find check boxes\n CheckBox fifthQuestionCheckBoxOne = (CheckBox) findViewById(R.id.question_5_check_box_1);\n\n CheckBox fifthQuestionCheckBoxTwo = (CheckBox) findViewById(R.id.question_5_check_box_2);\n\n CheckBox fifthQuestionCheckBoxThree = (CheckBox) findViewById(R.id.question_5_check_box_3);\n\n CheckBox fifthQuestionCheckBoxFour = (CheckBox) findViewById(R.id.question_5_check_box_4);\n\n // If correct answers are given, add one point,\n // if incorrect answers are given, do not add points\n\n if (fifthQuestionCheckBoxThree.isChecked() && fifthQuestionCheckBoxFour.isChecked()\n && !fifthQuestionCheckBoxOne.isChecked() && !fifthQuestionCheckBoxTwo.isChecked()){\n points++;\n }\n\n // Question six\n // Find check boxes\n CheckBox sixthQuestionCheckBoxOne = (CheckBox) findViewById(R.id.question_6_check_box_1);\n\n CheckBox sixthQuestionCheckBoxTwo = (CheckBox) findViewById(R.id.question_6_check_box_2);\n\n CheckBox sixthQuestionCheckBoxThree = (CheckBox) findViewById(R.id.question_6_check_box_3);\n\n CheckBox sixthQuestionCheckBoxFour = (CheckBox) findViewById(R.id.question_6_check_box_4);\n\n // If correct answers are given, add one point,\n // if incorrect answers are given, do not add points\n if (sixthQuestionCheckBoxOne.isChecked() && sixthQuestionCheckBoxTwo.isChecked()\n && sixthQuestionCheckBoxFour.isChecked() && !sixthQuestionCheckBoxThree.isChecked()){\n points++;\n }\n\n // If the user answers all questions correctly, show toast message with congratulations\n if (points == 6){\n Toast.makeText(this, \"Congratulations! You have earned 6 points.\" +\n \"\\n\" + \"It is the maximum number of points in this quiz.\",\n Toast.LENGTH_SHORT).show();\n }\n\n // If the user does not answer all questions correctly, show users's points, total points\n // possible and advise to check answers\n else {\n Toast.makeText(this, \"Your points: \" + points + \"\\n\" + \"Total points possible: 6\" +\n \"\\n\" + \"Check your answers or spelling again.\", Toast.LENGTH_SHORT).show();\n }\n\n // Reset points to 0\n points = 0;\n }", "public static void main(String[] args) {\n HashMap<Integer,String> questions = new HashMap<Integer, String>();\n try\n// reading file\n {\n int count = 0;\n File quiz = new File(\"quizzer.txt\");\n Scanner reader = new Scanner(quiz);\n while (reader.hasNextLine())\n {\n questions.put(count,reader.nextLine());\n count++;\n }\n }\n catch (Exception e)\n {\n e.printStackTrace();\n }\n//asking user for their name\n System.out.println(\"Enter Your name.\");\n String userName = scan.nextLine();\n// generating questions to ask\n int[] questionsToAsk = randomQuestionCollection(5,questions.size()-1);\n int score = 0;\n for(int i=0; i<questionsToAsk.length;i++) {\n String[] splitQuestion = questions.get(questionsToAsk[i]).split(\",\");\n if (askQuestion(splitQuestion) == 1) {\n System.out.println(\"Correct\");\n score++;\n }\n }\n// printing score\n System.out.println(userName+ \" you correctly answered \"+score + \"questions\");\n }", "public int randomGQ() {\n\t\treturn(getRandomInteger(10,100));\n\t}", "public IcelandGUI() {\n initComponents();\n question = \"\";\n // insert = \"\"; \n count = 0;\n count2 = 0;\n yBtn.setVisible(false);\n nBtn.setVisible(false);\n //t = new jdbcTest();\n try {\n \n Class.forName(\"com.mysql.jdbc.Driver\");\n String connectionUrl = \"jdbc:mysql://localhost:3307/jdbcTest?user=root&password=password\";\n Connection conn = DriverManager.getConnection(connectionUrl);\n Statement st = (Statement) conn.createStatement();\n String find = \"select quest,answer,wrongAns,wrongAns2,wrongAns3,q_sel from Question where country = 'iceland' and q_sel = 'N' order by rand() limit 1;\"; \n ResultSet rs = st.executeQuery(find);\n \n /* https://www.youtube.com/watch?v=MY4FavUyFNQ */ \n \n while(rs.next()){\n question = questionLbl.getText();\n questionLbl.setText(\"\\n\"+rs.getString(\"quest\")); \n Statement st2 = conn.createStatement();\n st2.executeUpdate(\"update Question set q_sel = 'Y' where quest = '\"+rs.getString(\"quest\")+\"'\");\n \n String[] solutionArray = {rs.getString(\"answer\"),rs.getString(\"wrongAns\"),rs.getString(\"wrongAns2\"),rs.getString(\"wrongAns3\")};\n \n \n String [] arr = solutionArray;\n Random rgen = new Random();\n int N = arr.length;\n /*\n * fisher yates shuffle\n *\n * 9/3/2015\n *\n * @reference http://algs4.cs.princeton.edu/11model/Knuth.java.html\n * @author sean trant 13332576\n */ \n \n for (int i = 0; i < N; i++) {\n // choose index uniformly in [i, N-1]\n int r = i + (int) (Math.random() * (N - i));\n Object swap = arr[r];\n arr[r] = arr[i];\n arr[i] = (String)swap;\n \n \n answerBtn1.setText(arr[0]);\n answerBtn2.setText(arr[1]);\n answerBtn3.setText(arr[2]);\n answerBtn4.setText(arr[3]); \n }\n\n }\n \n \n } catch (Exception ex) {\n System.out.println(\"AGGHHHH!!!!!\"); \n } \n \n \n \n }", "public String getAnAnswer() {\n\t\t\n\t\tString answer = \"\";\n\t\t\n\t\t\n\t\tRandom randomGenerator = new Random(); //Construct a new random number generator\n\t\tint randomNumber = randomGenerator.nextInt(mAnswers.length);\n\t\t\n\t\tanswer = mAnswers[randomNumber];\n\t\t\n\t\treturn answer;\n\t}", "@Override\n\tpublic double compete() {\n\t\tdouble result=MyTools.getRandomNum(500, 800);\n\t\tsetThisResult(result);\n\t\treturn result;\n\t}", "public void mo2479c() {\n Collections.shuffle(mo2625k(), C0817u.f2167a);\n }" ]
[ "0.69491816", "0.6602448", "0.6503715", "0.6493717", "0.64157474", "0.6392035", "0.6237226", "0.62045366", "0.59781086", "0.59330696", "0.59273136", "0.59225464", "0.5913795", "0.5858477", "0.5778499", "0.57116014", "0.5709363", "0.56990653", "0.56962585", "0.5693515", "0.56802875", "0.56635857", "0.566221", "0.56544465", "0.5646099", "0.56400585", "0.5609633", "0.56024593", "0.5582147", "0.5559351", "0.5557581", "0.55433404", "0.55349344", "0.55266476", "0.55256665", "0.55187833", "0.54931366", "0.5470938", "0.5423302", "0.5411408", "0.5411264", "0.54094875", "0.5405445", "0.54021776", "0.53996676", "0.5396936", "0.5396132", "0.5384948", "0.5378125", "0.5374027", "0.5373263", "0.5366657", "0.53657275", "0.5363531", "0.53628296", "0.5359067", "0.53543365", "0.53535974", "0.53516", "0.5347898", "0.5347876", "0.5338429", "0.53367215", "0.53281116", "0.532333", "0.5320887", "0.53192085", "0.53146374", "0.53095067", "0.5307588", "0.53050035", "0.52945924", "0.52923167", "0.5291502", "0.5285388", "0.5279794", "0.5276546", "0.5275594", "0.52741885", "0.5271168", "0.52607137", "0.525345", "0.52509785", "0.5250221", "0.5235035", "0.5222422", "0.5222397", "0.5218431", "0.52040863", "0.5202031", "0.5199625", "0.5196068", "0.518791", "0.5181458", "0.51749355", "0.5174012", "0.5147267", "0.51472056", "0.5145155", "0.5135337" ]
0.6576697
2
Constructor assigns strings to colours and puts them in a map.
public ColorsParser() { colorMap.put("black", Color.BLACK); colorMap.put("blue", Color.BLUE); colorMap.put("cyan", Color.CYAN); colorMap.put("darkgray", Color.DARK_GRAY); colorMap.put("gray", Color.GRAY); colorMap.put("green", Color.GREEN); colorMap.put("lightGray", Color.LIGHT_GRAY); colorMap.put("magenta", Color.MAGENTA); colorMap.put("orange", Color.ORANGE); colorMap.put("pink", Color.PINK); colorMap.put("white", Color.WHITE); colorMap.put("yellow", Color.YELLOW); colorMap.put("red", Color.RED); colorMap.put("BLACK", Color.BLACK); colorMap.put("BLUE", Color.BLUE); colorMap.put("CYAN", Color.CYAN); colorMap.put("DARKGRAY", Color.DARK_GRAY); colorMap.put("GRAY", Color.GRAY); colorMap.put("GREEN", Color.GREEN); colorMap.put("LIGHTGRAY", Color.LIGHT_GRAY); colorMap.put("MAGENTA", Color.MAGENTA); colorMap.put("ORANGE", Color.ORANGE); colorMap.put("PINK", Color.PINK); colorMap.put("WHITE", Color.WHITE); colorMap.put("YELLOW", Color.YELLOW); colorMap.put("RED", Color.RED); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static Map<Character, Color> createColorMap() {\n\n final Map<Character, Color> map = new HashMap<Character, Color>();\n map.put(' ', NO_COLOR);\n map.put(Block.I.getChar(), I_COLOR);\n map.put(Block.O.getChar(), O_COLOR);\n map.put(Block.J.getChar(), J_COLOR);\n map.put(Block.L.getChar(), L_COLOR);\n map.put(Block.Z.getChar(), Z_COLOR);\n map.put(Block.S.getChar(), S_COLOR);\n map.put(Block.T.getChar(), T_COLOR);\n return map;\n }", "private static HashMap<String, TColor> createColors(){\n\t\tHashMap<String, TColor> iconColors = new HashMap<String, TColor>();\n\t\ticonColors.put(\"Arts & Entertainment\", TColor.newHex(\"E62733\"));\n\t\ticonColors.put(\"College & University\", TColor.newHex(\"E0006D\"));\n\t\ticonColors.put(\"Food\", TColor.newHex(\"917A2C\"));\n\t\ticonColors.put(\"Nightlife Spot\", TColor.newHex(\"582583\"));\n\t\ticonColors.put(\"Outdoors & Recreation\", TColor.newHex(\"00A43C\"));\n\t\ticonColors.put(\"Professional & Other Places\", TColor.newHex(\"00A38C\"));\n\t\ticonColors.put(\"Residence\", TColor.newHex(\"FFED00\"));\n\t\ticonColors.put(\"Shop & Service\", TColor.newHex(\"0067B2\"));\n\t\ticonColors.put(\"Travel & Transport\", TColor.newHex(\"F39200\"));\n//\t\tfor(Entry<String, TColor> e: iconColors.entrySet()){\n//\t\t\te.getValue().saturate(0.15f);\n//\t\t}\n\t\treturn iconColors;\n\t}", "public CustomColourMap(Colour[] colour, String name){\n\t\tsuper(colour, name);\n\t\tthis.SetMapSize(colour.length);\n\t\tm_colourMap = new Colour[this.GetMapSize()];\n\t\tthis.InitMap();\n\t\t\n\t\tfor (int i = 0; i < this.GetMapSize(); i++) {\n\t\t\tm_colourMap[i] = colour[i];\n\t\t}\t\t\n\t}", "protected HashMap<String,Color> addColors() {\n\t\tHashMap<String,Color> colorChoices = new HashMap<String,Color>();\n\t\tcolorChoices.put(\"RED\", Color.RED);\n\t\tcolorChoices.put(\"BLUE\", Color.BLUE);\n\t\tcolorChoices.put(\"BLACK\", Color.BLACK);\n\t\treturn colorChoices;\n\t}", "public void InitMap() {\n for (int i=0; i<m_mapSize; i++) {\n SetColour(i, null);\n }\n }", "public static void populateColors() {\n colors.put(0,Color.rgb(238, 228, 218, 0.35)); //empty tile\n colors.put(2, Color.rgb(238, 228, 218));\n colors.put(4, Color.rgb(237, 224, 200));\n colors.put(8,Color.rgb(242, 177, 121));\n colors.put(16, Color.rgb(245, 149, 99));\n colors.put(32,Color.rgb(246, 124, 95));\n colors.put(64,Color.rgb(246, 94, 59));\n colors.put(128,Color.rgb(237, 207, 114));\n colors.put(256,Color.rgb(237, 204, 97));\n colors.put(512,Color.rgb(237, 200, 80));\n colors.put(1024,Color.rgb(237, 197, 63));\n colors.put(2048,Color.rgb(237, 194, 46));\n colors.put(4096,Color.rgb(237, 194, 46));\n colors.put(8192,Color.rgb(237, 194, 46));\n\n }", "KeyColor(String name){\n this.name = name;\n }", "public void initializeNames(Map<PlayerColor, String> playerNames) {\n for (PlayerColor color : PlayerColor.values()){\n if (playerNames.keySet().contains(color)){\n switch (color){\n case RED:\n redName.setText(playerNames.get(color));\n break;\n case GREEN:\n greenName.setText(playerNames.get(color));\n break;\n case BLUE:\n blueName.setText(playerNames.get(color));\n break;\n case YELLOW:\n yellowName.setText(playerNames.get(color));\n break;\n }\n }\n else {\n switch (color){\n case RED:\n redName.setText(\"\");\n for(Text text : redPlayerTrack.values()){\n text.setText(\"\");\n }\n break;\n case GREEN:\n greenName.setText(\"\");\n for(Text text : greenPlayerTrack.values()){\n text.setText(\"\");\n }\n break;\n case BLUE:\n blueName.setText(\"\");\n for(Text text : bluePlayerTrack.values()){\n text.setText(\"\");\n }\n break;\n case YELLOW:\n yellowName.setText(\"\");\n for(Text text : yellowPlayerTrack.values()){\n text.setText(\"\");\n }\n break;\n }\n }\n }\n }", "public void fillColours() {\n this.colours = new String[4];\n this.colours[0] = \"diamonds\";\n this.colours[1] = \"hearts\";\n this.colours[2] = \"spades\";\n this.colours[3] = \"clubs\";\n }", "public void add(String colours){\n //get middle colour\n String newColours=\"\";\n char middle = colours.charAt(4);\n\n FaceColour col = FaceColour.valueOf(Character.toString(middle));\n newColours = colours.substring(0);\n for(FaceColour faceCol : faceToColourMap.keySet()){\n char faceColCh = faceCol.name().charAt(0);\n newColours = newColours.replace(faceColCh, faceToColourMap.get(faceCol));\n }\n\n cube[col.ordinal()] = newColours;\n }", "private void initPieceColors(){\n\t\tfor(Piece p : this.pieces)\n\t\t\tpieceColors.put(p, Utils.randomColor());\n\t}", "public Board(String[] colors){\n for(int i = 0; i<156; i++){\n spaces.add(colors[i%6]); //loops through the colors and adds them all to a list\n }\n }", "public static void main(String[] args) {\n\t\t//Setting up some objects to test.\n\t\tColour[] four = new Colour[4];\n\t\tColour[] five = new Colour[5];\n\t\tColour[] six = new Colour[6];\n\t\t\n\t\tColour white = new Colour(\"#FFFFFF\");\n\t\tfour[0] = white;\n\t\tfive[0] = white;\n\t\tsix[0] = white;\n\t\tColour black = new Colour(\"#000000\");\n\t\tfour[1] = black;\n\t\tfive[1] = black;\n\t\tsix[1] = black;\n\t\tColour red = new Colour(\"#FF0000\");\n\t\tfour[2] = red;\n\t\tfive[2] = red;\n\t\tsix[2] = red;\n\t\tColour green = new Colour(\"#00FF00\");\n\t\tfour[3] = green;\n\t\tfive[3] = green;\n\t\tsix[3] = green;\n\t\tColour blue = new Colour(\"#0000FF\");\n\t\tfive[4] = blue;\n\t\tsix[4] = blue;\n\t\tColour bluegreen = new Colour(\"#00FFFF\");\n\t\tsix[5] = bluegreen;\n\t\t\n\t\t//Test that <5 objects can be added.\n\t\tCustomColourMap fourcolours = new CustomColourMap(four, \"Four\");\n\t\tSystem.out.println(\"Expected: No output.\");\n\t\tSystem.out.println();\n\t\t\n\t\t//Test that =5 objects can be added.\n\t\tCustomColourMap fivecolours = new CustomColourMap(five, \"Five\");\n\t\tSystem.out.println(\"Expected: No output.\");\n\t\tSystem.out.println();\n\t\t\n\t\t//Test that if >5 objects are added, it is acceptable.\n\t\tCustomColourMap sixcolours = new CustomColourMap(six, \"Six\");\n\t\tSystem.out.println(\"Expected: No output.\");\n\t\tSystem.out.println();\n\t\t\n\t\t//Test the getColour method.\n\t\tfor (int i=0; i<fivecolours.getMapSize(); i++) {\n\t\t\tSystem.out.print(fivecolours.GetColour(i).GetHex() + \" \");\n\t\t}\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"Expected: #FFFFFF #000000 #FF0000 #00FF00 #0000FF\");\n\t\tSystem.out.println();\n\t\t\n\t\tfor (int i=0; i<sixcolours.GetMapSize(); i++) {\n\t\t\tSystem.out.print(sixcolours.GetColour(i).GetHex() + \" \");\n\t\t}\n\t\tSystem.out.println();\n\t\tSystem.out.println(\n\t\t\t\"Expected: #FFFFFF #000000 #FF0000 #00FF00 #0000FF #00FFFF\");\n\t\tSystem.out.println();\n\t\t\n\t\t//Test the setColour method.\n\t\tfor (int i=0; i<fivecolours.getMapSize(); i++) {\n\t\t\tfivecolours.SetColour(i, new Colour(\"#FFFFFF\"));\n\t\t}\n\t\tfor (int i=0; i<fivecolours.getMapSize(); i++) {\n\t\t\tSystem.out.print(fivecolours.GetColour(i).GetHex() + \" \");\n\t\t}\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"Expected: #FFFFFF #FFFFFF #FFFFFF #FFFFFF #FFFFFF \");\n\t\tSystem.out.println();\n\t\t\n\t\t//Test the getMapSize method.\n\t\tSystem.out.println(fivecolours.getMapSize());\n\t\tSystem.out.println(\"Expected: Five\");\n\t\tSystem.out.println();\n\t\t\n\t\tSystem.out.println(sixcolours.GetMapSize());\n\t\tSystem.out.println(\"Expected: Six\");\n\t\tSystem.out.println();\n\t\t\n\t\t//Test the getNumber method.\n\t\tSystem.out.println(fivecolours.GetNumber());\n\t\tSystem.out.println(\"Expected: Five\");\n\t\tSystem.out.println();\n\t\t\n\t\tSystem.out.println(sixcolours.GetNumber());\n\t\tSystem.out.println(\"Expected: Six\");\n\t\tSystem.out.println();\n\t\n\t\n\t}", "public static interface ColorMap {\n\t\tpublic Color map(Color a, double x, double y);\n\t}", "public interface MclnStatePalette {\n\n String CORE_NOTHING_COLOR = \"0xC0C0C0\";\n String CORE_CONTRADICT_COLOR = \"0xAAAAAA\";\n String CORE_UNKNOWN_COLOR = \"0xC0C0C0\";\n String CORE_POSITIVE_COLOR = \"0xFFFFFF\";\n String CORE_NEGATIVE_COLOR = \"0xFFFFFF\";\n\n String CREATION = \"0xC0C0C0\";\n String NOT_CREATION = \"0x0B0B0B\";\n String WHITE = \"0xFFFFFF\";\n String BLACK = \"0x000000\";\n\n String GRAY = \"0xCCCCCC\";\n String NOT_GRAY = \"0x333333\";\n String MID_GRAY = \"0xBBBBBB\";\n String DARK_GRAY = \"0xAAAAAA\";\n\n String RED = \"0xFF0000\";\n String NOT_RED = \"0x00FFFF\";\n String MID_RED = \"0xCC0033\";\n String DARK_RED = \"0x800040\";\n\n String GREEN = \"0x00FF00\";\n String NOT_GREEN = \"0xFF00FF\";\n String MID_GREEN = \"0x94D352\";\n String DARK_GREEN = \"0x008040\";\n\n String BLUE = \"0x0000FF\";\n String NOT_BLUE = \"0xFFFF00\";\n String MID_BLUE = \"0x0040FF\";\n String DARK_BLUE = \"0x0020BB\";\n\n String PURPLE = \"0xFF00FF\";\n String NOT_PURPLE = GREEN;\n String MID_PURPLE = \"0x9900FF\";\n String DARK_PURPLE = \"0x4000DD\";\n\n String CYAN = \"0x00FFFF\";\n String NOT_CYAN = RED;\n String MID_CYAN = \"0x31A4B1\";\n String DARK_CYAN = \"0x2C5463\";\n\n String YELLOW = \"0xFFFF00\";\n String NOT_YELLOW = BLUE;\n String MID_YELLOW = \"0x9900FF\";\n String DARK_YELLOW = \"0x4000DD\";\n\n String BROWN = \"0xdec79f\";\n String MID_BROWN = \"0xce9b4e\";\n String DARK_BROWN = \"0xc27101\";\n\n String SWAMP = \"0xc8c8aa\";\n String MID_SWAMP = \"0x999966\";\n String DARK_SWAMP = \"0xe4e640\";\n\n String PINK = \"0xFF7FBF\";\n String NOT_PINK = \"0x005555\";\n String ORANGE = \"0xFF9900\";\n String CANARY = \"0xBFFF00\";\n\n int MCLN_MIN_STATE = MclnAlgebra.MCL_CORE_MAX + 1;\n\n MclnState MCLN_CREATION_STATE = MclnState.createState(\"Creation\", MCLN_MIN_STATE, CREATION);\n MclnState MCLN_NOT_CREATION_STATE = MclnState.createState(MCLN_CREATION_STATE, \"Not Creation\", -MCLN_MIN_STATE,\n NOT_CREATION);\n//\n// MclnState MCLN_CREATION_STATE = MclnState.createState(\"Creation\", MCLN_MIN_STATE, CREATION);\n// MclnState MCLN_NOT_CREATION_STATE = MclnState.createState(MCLN_CREATION_STATE, \"Not Creation\", -MCLN_MIN_STATE, NOT_CREATION);\n//\n// MclnState MCLN_STATE_GRAY = MclnState.createState(\"Gray\", (MCLN_MIN_STATE + 1) , GRAY);\n// MclnState MCLN_STATE_NOT_GRAY = MclnState.createState(MCLN_STATE_GRAY, \"Not Gray\", -(MCLN_MIN_STATE + 1), NOT_GRAY);\n//\n// MclnState MCLN_STATE_RED = MclnState.createState(\"Red\", (MCLN_MIN_STATE + 2), RED);\n// MclnState MCLN_STATE_NOT_RED = MclnState.createState(MCLN_STATE_RED, \"Not Red\", -(MCLN_MIN_STATE + 2), NOT_RED);\n//\n// MclnState MCLN_STATE_GREEN = MclnState.createState(\"Green\", (MCLN_MIN_STATE + 3), GREEN);\n// MclnState MCLN_STATE_NOT_GREEN = MclnState.createState(MCLN_STATE_GREEN, \"Not Green\", -(MCLN_MIN_STATE + 3), NOT_GREEN);\n//\n// MclnState MCLN_STATE_BLUE = MclnState.createState(\"Blue\", (MCLN_MIN_STATE + 4), BLUE);\n// MclnState MCLN_STATE_NOT_BLUE = MclnState.createState(MCLN_STATE_BLUE, \"Not Blue\", -(MCLN_MIN_STATE + 4), NOT_BLUE);\n//\n// MclnState MCLN_STATE_DARK_BLUE = MclnState.createState(\"Dark blue\", (MCLN_MIN_STATE + 5), DARK_BLUE);\n// MclnState MCLN_STATE_NOT_DARK_BLUE = MclnState.createState(MCLN_STATE_DARK_BLUE, \"Not Dark blue\", -(MCLN_MIN_STATE + 5), NOT_DARK_BLUE);\n//\n// MclnState MCLN_STATE_PINK = MclnState.createState(\"Pink\", (MCLN_MIN_STATE + 6), PINK);\n// MclnState MCLN_STATE_NOT_PINK = MclnState.createState(MCLN_STATE_PINK, \"Not Pink\", -(MCLN_MIN_STATE + 6), NOT_PINK);\n//\n// MclnState MCLN_STATE_DARK_GREEN = MclnState.createState(\"Dark Brown\", (MCLN_MIN_STATE + 7), DARK_GREEN);\n\n public List<MclnState> getAvailableStates();\n\n /**\n * @param color\n * @return\n */\n public MclnState getState(String color);\n\n// String CREATION_COLOR = \"0xC0C0C0\";\n// MclnState CREATION_MCLN_STATE = MclnState.createState(\"Creation State\", 0, CREATION_COLOR);\n\n// int mclnPaletteMax = 10 * 2;\n// int RED = 0xFF0000;\n// int NOT_RED = 0x00FFFF;\n// int GREEN = 0x00FF00;\n// int NOT_GREEN = 0xFF00FF;\n// int BLUE = 0x0000FF;\n// int NOT_BLUE = 0xFFFF00;\n// int YELLOW = NOT_BLUE;\n// int NOT_YELLOW = BLUE;\n// int MAGENTA = NOT_GREEN;\n// int NOT_MAGENTA = GREEN;\n// int CYAN = NOT_RED;\n// int NOT_CYAN = RED;\n// int PINK = 0xFFAAAA;\n// int NOT_PINK = 0x005555;\n//\n// int WHITE = 0xFFFFFF;\n// int VERY_LIGHT_CIAN = 0xCCFFFF;\n// int VERY_LIGHT_BLUE = 0xCCCCFF;\n// int VERY_LIGHT_MAGENTA = 0xCCFFCC;\n// int VERY_LIGHT_RED = 0xFFCCCC;\n// int VERY_LIGHT_YELLOW = 0xFFFFCC;\n//\n//\n// int DARK_RED = 0xCC0000;\n// int DARK_CIAN = 0x00CCCC;\n// int DARK_GREEN = 0x00CC00;\n// int DARK_MAGENTA = 0xCC00CC;\n// int DARK_BLUE = 0x0000CC;\n// int DARK_YELLOW = 0xCCCC00;\n//\n// int VERY_DARK_CIAN = 0x006666;\n// int VERY_DARK_BLUE1 = 0x003366;\n// int VERY_DARK_BLUE2 = 0x000066;\n// int VERY_DARK_BLUE3 = 0x330066;\n// int VERY_DARK_MAGENTA = 0x660066;\n// int VERY_DARK_RED1 = 0x660033;\n// int VERY_DARK_RED2 = 0x660000;\n// int VERY_DARK_RED3 = 0x663300;\n// int VERY_DARK_YELLOW = 0x666600;\n// int VERY_DARK_GREEN1 = 0x336600;\n// int VERY_DARK_GREEN2 = 0x006600;\n// int VERY_DARK_GREEN3 = 0x006633;\n//\n//\n//\n// MclnState getState(Integer color);\n//\n//// Integer getActiveState(Color color) {\n//// return activeColorPalette.get(color);\n//// }\n////\n//// Color getActiveColor(Integer state) {\n//// return activeStatePalette.get(state);\n//// }\n\n}", "public Theme (Map<TileColor, Color> palette) {\n\t\tthis.palette = palette;\n\t}", "public void setColor(String c);", "private void initCodeStyling() {\n\t\tboolean codeStyling = Boolean.valueOf(preferences.getProperty(\"codeStyling.enable\")).booleanValue();\n\t\tHashMap<String, Color> colorsMap = new HashMap<String, Color>();\n\t\tVector<String> keywords = null;\n\n\t\t// perform this only if code styling syntax coloring is enabled\n\t\tif (codeStyling) {\n\t\t\tint r = 0, g = 0, b = 0;\n\n\t\t\t// load colors from preferences file and store them in the\n\t\t\t// colors map\n\t\t\tr = Integer.parseInt(preferences.getProperty(\"normal.color.r\"));\n\t\t\tg = Integer.parseInt(preferences.getProperty(\"normal.color.g\"));\n\t\t\tb = Integer.parseInt(preferences.getProperty(\"normal.color.b\"));\n\t\t\tcolorsMap.put(\"normalColor\", new Color(r, g, b));\n\t\t\tr = Integer.parseInt(preferences.getProperty(\"numbers.color.r\"));\n\t\t\tg = Integer.parseInt(preferences.getProperty(\"numbers.color.g\"));\n\t\t\tb = Integer.parseInt(preferences.getProperty(\"numbers.color.b\"));\n\t\t\tcolorsMap.put(\"numbersColor\", new Color(r, g, b));\n\t\t\tr = Integer.parseInt(preferences.getProperty(\"string.color.r\"));\n\t\t\tg = Integer.parseInt(preferences.getProperty(\"string.color.g\"));\n\t\t\tb = Integer.parseInt(preferences.getProperty(\"string.color.b\"));\n\t\t\tcolorsMap.put(\"stringColor\", new Color(r, g, b));\n\t\t\tr = Integer.parseInt(preferences.getProperty(\"keywords.color.r\"));\n\t\t\tg = Integer.parseInt(preferences.getProperty(\"keywords.color.g\"));\n\t\t\tb = Integer.parseInt(preferences.getProperty(\"keywords.color.b\"));\n\t\t\tcolorsMap.put(\"keywordsColor\", new Color(r, g, b));\n\t\t\tr = Integer.parseInt(preferences.getProperty(\"comments.color.r\"));\n\t\t\tg = Integer.parseInt(preferences.getProperty(\"comments.color.g\"));\n\t\t\tb = Integer.parseInt(preferences.getProperty(\"comments.color.b\"));\n\t\t\tcolorsMap.put(\"commentsColor\", new Color(r, g, b));\n\t\t\tr = Integer.parseInt(preferences.getProperty(\"braceMatching.color.r\"));\n\t\t\tg = Integer.parseInt(preferences.getProperty(\"braceMatching.color.g\"));\n\t\t\tb = Integer.parseInt(preferences.getProperty(\"braceMatching.color.b\"));\n\t\t\tcolorsMap.put(\"braceMatchingColor\", new Color(r, g, b));\n\n\t\t\t// keywords are specified in the preferences file as comma\n\t\t\t// separated, so after getting them from the preferences file\n\t\t\t// the property is tokenized and added to a keywords vector\n\t\t\tkeywords = new Vector<String>();\n\t\t\tStringTokenizer tokenizer = new StringTokenizer(preferences.getProperty(\"keywords\"), \";\");\n\t\t\twhile (tokenizer.hasMoreTokens())\n\t\t\t\tkeywords.addElement(tokenizer.nextToken());\n\n\t\t\tcodeDocument = new CodeDocument(codeStyling, colorsMap, keywords);\n\t\t\ttextPane.setDocument(codeDocument);\n\t\t}\n\t}", "public void init_colors_red(){\t\n\t\tColor c1 = new Color(0,0,0);\t\t// BLACK\t\t\n\t\tColor c2 = new Color(255,0,0);\t// RED\n\t\tColor c3 = new Color(255,170,0);\t// ORANGE\n\t\tColor c4 = new Color(255,255,255);\t// WHITE\n\t\t\n\t\tinit_colors(c1,c2,c3,c4);\n\t}", "private static void initDefaultPalette(Map<TileColor, Color> palette) {\n\t\tpalette.put(TileColor.BLUE, Color.blue);\n\t\tpalette.put(TileColor.CYAN, Color.cyan);\n\t\tpalette.put(TileColor.GREEN, Color.green);\n\t\tpalette.put(TileColor.ORANGE, Color.orange);\n\t\tpalette.put(TileColor.PURPLE, Color.magenta);\n\t\tpalette.put(TileColor.RED, Color.red);\n\t\tpalette.put(TileColor.YELLOW, Color.yellow);\n\t}", "private void initColours() {\n colourArray = Utilities.get2dResourceArray(getContext(), \"colour\");\n\n // A means to save colour configuration when screen is rotated between games.\n if (colourSet == null) {\n // Set new colour pairing.\n colourSet = new ColourSet();\n }\n\n // Set View colours\n mGameLoop.setColour(colourSet.primarySet);\n setToolbarColour(colourSet.primaryColourDark);\n mAltBackground.setBackgroundColor(colourSet.primaryColour);\n mTempToolbar.setBackgroundColor(colourSet.primaryColourDark);\n mFab.setBackgroundTintList(ColorStateList.valueOf(colourSet.secondaryColour));\n mWorldScore.setBackgroundColor(colourSet.getPrimaryColour(COLOUR_LOCATION_SCORE));\n }", "Color(String text) {\n this.text = text;\n }", "public void setColorants(Map<String, PDColorSpace> colorants) {\n/* 116 */ COSDictionary colorantDict = null;\n/* 117 */ if (colorants != null)\n/* */ {\n/* 119 */ colorantDict = COSDictionaryMap.convert(colorants);\n/* */ }\n/* 121 */ this.dictionary.setItem(COSName.COLORANTS, (COSBase)colorantDict);\n/* */ }", "public Pawn(String color){\r\n this.color=color; \r\n }", "public static void main(String[] args) {\n HashMap<String, String> hashColours = new HashMap<>();\n hashColours.put(\"#FF0000\", \"red\");\n hashColours.put(\"#FFD700\",\"gold\");\n hashColours.put(\"#FFFF00\",\"yellow\");\n hashColours.put(\"#008080\",\"teal\");\n\n\n System.out.println(\"The hashmaps looks something like this: \" + hashColours.toString());\n\n\n //Update the above program to count the number of key-value mappings in a map\n System.out.println(\"The number of key-value pairs is: \" + hashColours.size());\n\n\n //Update the above program to get the value of a specified key in a map\n System.out.println(\"My favourite color has the hex value of #008080 and its name is: \" +hashColours.get(\"#008080\"));\n\n\n //Update the above program to remove a specific mappings from a map\n hashColours.remove(\"#FF0000\");\n System.out.println(\"After removing my least favourite colour the hashMap looks something like: \" + hashColours.toString());\n\n\n //Update the above program to view of the keys contained in this map\n Set keys = hashColours.keySet();\n System.out.println(\"The remaining keys are: \" + keys);\n }", "public Palette(int r, int g, int b) {\n myRed = r;\n myGreen = g;\n myBlue = b;\n }", "public Customer(char[] prefs){\n\t\tpreferences = new ArrayList<Color>();\n\t\tfor (int i=0; i<=prefs.length-1; i= i+2) {\n\t\t\tpreferences.add(new Color(Character.getNumericValue(prefs[i]),prefs[i+1]));\n\t\t}\n\t}", "private void setFillMapColor(String color) {\r\n for (String s: fillKListColor) {\r\n if (s.startsWith(\"color\")) {\r\n color = s.substring(6, s.length() - 1);\r\n String tempColor = (!color.startsWith(\"RGB\")) ? color : color.substring(4, color.length() - 1);\r\n Color fillKColor = new ColorsParser().colorFromString(tempColor);\r\n fillKMapColor.put(kListColor.get(fillKListColor.indexOf(s)), fillKColor);\r\n }\r\n }\r\n }", "public Collection(char colour) { /* ... code ... */ }", "abstract String getColor();", "public String getColorString();", "public void setColour(String[] colours)\n {\n for (int i=0 ; i<colours.length ; i++)\n {\n if(colours[i] != null)\n {\n if(checker.isStringspace(colours[i]))\n colour = colours;\n else\n colour[i] = \"\";\n }\n }\n \n }", "public RuleMap(){\n rules = new HashMap<Character, String>();\n }", "public ColouredString(ColourPair color, String content) {\n this.colour = color;\n this.content = content;\n }", "private void initRelationsColors() {\n for (int i=0;i<20;i++) {\n int r = 255-(i*12);\n int gb = 38-(i*2);\n relationsC[i] = newColor(r,gb,gb);\n }\n // do green.. 20-39, dark to bright\n for (int i=0;i<20;i++) {\n int g = 17+(i*12);\n int rb = i*2;\n relationsC[20+i] = newColor(rb,g,rb);\n }\n }", "public Piezas(String color) {\r\n this.color = color;\r\n }", "public String parseColors(String string){\n return ChatColor.translateAlternateColorCodes('&', string);\n }", "String getColor();", "interface Language {\n HashMap<String,String> colorMap= new HashMap<>();\n String getColor(String myToken);\n String defaultColor = \"black\";\n}", "public Map(Dimension dim, String mapStr) {\r\n\t\tthis.dim = dim;\r\n\t\tinitiateMap();\r\n\t\tstringToMap(mapStr);\r\n\t}", "@Test\n\tpublic void testIllegalMapWrongColorsTest1() {\n\t\ttry {\n\t\t\tmapFactory.initializeGameState(\"./src/Mapfiles/NightlyTests/IllegalMapWrongColorsTest1\", 1, rng, gs);\n\t\t} catch (IOException e) {\n\t\t\tfail(\"Expected IllegalArgumentException\");\n\t\t} catch (IllegalArgumentException e) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tfail(\"Expected IllegalArgumentException\");\n\t}", "public ColorClass(int ide, Interval[] intervals , boolean ordered) {\n this (\"C_\"+ide, intervals, ordered );\n }", "@Override\n public Color getMapColor() { return mapColor; }", "public ColorClass (int ide, boolean ordered) {\n this(\"C_\"+ide, ordered);\n }", "ColorGroup(String text) {\n this.text = text;\n }", "public ColouredString(String string) {\n this.content = string;\n }", "Color(int R, int G, int B) {\r\n\t\t this.rgb = new RGB(R,G,B);\r\n\t\t this.colorific = true;\r\n\t }", "public static String replaceColors(String str) {\n\t\tfor (CustomColor color : CustomColor.values())\n\t\t\tstr = str.replace(color.getCustom(), color.getString());\n\t\treturn str;\n\t}", "public void setColour(String c)\n\t{\n\t\tcolour = c;\n\t}", "@Test\n\tpublic void testIllegalMapWrongColorsTest2() {\n\t\ttry {\n\t\t\tmapFactory.initializeGameState(\"./src/Mapfiles/NightlyTests/IllegalMapWrongColorsTest2\", 1, rng, gs);\n\t\t} catch (IOException e) {\n\t\t\tfail(\"Expected IllegalArgumentException\");\n\t\t} catch (IllegalArgumentException e) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tfail(\"Expected IllegalArgumentException\");\n\t}", "@Override\r\n protected void loadStrings() {\r\n \r\n mfile = settings.getProperty( \"mfile\" );\r\n rmode = settings.getProperty( \"rmode\" );\r\n cmap = settings.getProperty( \"cmap\" );\r\n cmapMin = Double.parseDouble( settings.getProperty( \"cmapMin\" ) );\r\n cmapMax = Double.parseDouble( settings.getProperty( \"cmapMax\" ) );\r\n \r\n }", "public TetrisColors() {\n\t\treset();\t\n\t}", "public String seeColor(String str) {\r\n if (str.startsWith(\"red\")) {\r\n return \"red\";\r\n }\r\n if (str.startsWith(\"blue\")) {\r\n return \"blue\";\r\n }\r\n\r\n return \"\";\r\n }", "private static void createMap()\r\n {\r\n position = new String[8][8];\r\n for(int i=0;i<8;i++)\r\n {\r\n int z=0;\r\n for(int j=72;j>=65;j--)\r\n {\r\n position[i][z]=(char)j+\"\"+(i+1); //uses ascii char placement for letters\r\n z++;\r\n }\r\n }\r\n \r\n }", "public CachedColorizer()\n {\n colorIndex = 3;\n }", "public static AvatarColor mapColor(String color) {\n switch (color) {\n case \"white\":\n return WHITE;\n case \"black\":\n return BLACK;\n case \"red\":\n return RED;\n case \"green\":\n return GREEN;\n case \"blue\":\n return BLUE;\n default:\n throw new IllegalArgumentException(\"Color is not supported: \" + color);\n }\n }", "private void mapSetUp() {\n\t\tfor (int i = 0; i < allChar.length; i++) {\n\t\t\tmap.put(allChar[i], shuffledChar[i]);\n\t\t}\n\t}", "public ColorSet()\n {\n }", "private void initColorAr() {\n\t\tcolorAr = new ArrayList<Color>();\n\t\tcolorAr.add(Color.black);\n\t\tcolorAr.add(Color.green);\n\t\tcolorAr.add(Color.red);\n\t\tcolorAr.add(Color.blue);\n\t\tcolorAr.add(Color.white);\n\t\tcolorAr.add(Color.orange);\n\t\tcolorAr.add(Color.pink);\n\t\tcolorAr.add(Color.cyan);\n\t\tcolorAr.add(Color.darkGray);\n\t\tcolorAr.add(Color.gray);\n\t\tcolorAr.add(Color.magenta);\n\t\tcolorAr.add(Color.yellow);\n\t\tr = new Random();\n\t}", "public Glyph(char character, int red, int green, int blue) {\r\n this(character,\r\n new Color(red, green, blue),\r\n TRANSPARENT);\r\n }", "public NewCustomColorPalette() {\n\t\tsuper();\n\t\tbuildPalette();\n\t}", "public static Color valueOf(String s) {\n Matcher m = THREE_DIGIT_PATTERN.matcher(s);\n if (m.matches()) {\n return new Color(Integer.parseInt(m.group(1), 16) * 0x11,\n Integer.parseInt(m.group(2), 16) * 0x11,\n Integer.parseInt(m.group(3), 16) * 0x11);\n }\n m = SIX_DIGIT_PATTERN.matcher(s);\n if (m.matches()) {\n return new Color(Integer.parseInt(m.group(1), 16),\n Integer.parseInt(m.group(2), 16),\n Integer.parseInt(m.group(3), 16));\n }\n Color color = KEYWORD_MAP.get(s);\n if (color != null) {\n return color;\n }\n throw new IllegalArgumentException(\"Can't parse \\\"\" + s\n + \"\\\" as a CSS color.\");\n }", "private void setup()\r\n {\r\n \r\n char[][] examplemap = {\r\n { 'e','w','e','e','e','e','e','e','e','e' },\r\n { 'e','w','e','w','w','w','w','e','w','w' },\r\n { 'e','w','e','w','e','w','w','e','w','e' },\r\n { 'e','e','e','w','e','w','e','e','w','e' },\r\n { 'e','w','e','e','e','w','e','e','w','e' },\r\n { 'e','w','w','w','e','w','e','w','w','e' },\r\n { 'e','e','e','e','e','e','e','w','e','e' },\r\n { 'e','w','w','e','w','e','w','w','w','e' },\r\n { 'e','e','w','e','e','w','w','e','e','e' },\r\n { 'e','e','w','e','e','e','e','e','e','w' }};\r\n for (int i=0; i<map.length; i++)\r\n {\r\n for (int n=0; n<map[i].length; n++)\r\n {\r\n if (examplemap[n][i] == 'e')\r\n map[i][n].setBackground(Color.white);\r\n else\r\n map[i][n].setBackground(Color.black);\r\n }\r\n }\r\n \r\n map[0][0].setBackground(Color.red);\r\n this.Playerpos[0]=0;\r\n this.Playerpos[1]=0;\r\n \r\n \r\n map[9][8].setBackground(Color.blue);\r\n this.Goalpos[0]=9;\r\n this.Goalpos[1]=8;\r\n \r\n \r\n \r\n \r\n }", "public void setColors(ColorMapper colors) {\n\t\tthis.colors = colors;\n\t}", "public void drawmap(String[][] colours){\r\n\t\tint startingX = interval;\r\n\t\tint startingY = interval;\r\n\t\t\t//number of rows\r\n\t\t\tfor(int y =0;y < colours[0].length;y++){\r\n\t\t\t\t//number of columns \r\n\t\t\t\tfor(int x =0;x < colours.length;x++){\r\n\t\t\t\tif(colours[x][y].equals(food)){\r\n\t\t\t\t\t// if colour of the pixel is yellow, convert it into food and put into the 2D array\r\n\t\t\t\t\tfoodArray[x][y] = new JLabel(\" * \");\r\n\t\t\t\t\tfoodArray[x][y].setBounds(startingX,startingY, interval,interval);\r\n\t\t\t\t\tfoodArray[x][y].setForeground(Color.yellow);\r\n\t\t\t\t\tstartingX += interval;\r\n\t\t\t\t\tpanel.add(foodArray[x][y]);\r\n\t\t\t\t\tfoodCounter ++;\r\n\t\t\t\t}\r\n\t\t\t\telse if(colours[x][y].equals(wall)){\r\n\t\t\t\t\t// if colour of the pixel is blue, convert it into wall and put into the 2D array\r\n\t\t\t\t\tfoodArray[x][y] = new JLabel(new ImageIcon(\"src/misc/wall.png\"));\r\n\t\t\t\t\tfoodArray[x][y].setBounds(startingX,startingY, 15,15);\r\n\t\t\t\t\tfoodArray[x][y].setForeground(Color.pink);\r\n\t\t\t\t\tstartingX += interval;\r\n\t\t\t\t\tpanel.add(foodArray[x][y]);\r\n\t\t\t\t}\r\n\t\t\t\telse{ \r\n\t\t\t\t\tfoodArray[x][y] = new JLabel(\"\");\r\n\t\t\t\t\tfoodArray[x][y].setBounds(startingX,startingY, interval,interval);\r\n\t\t\t\t\tstartingX += interval;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\t// add the interval for the next wall/food \r\n\t\t\tstartingY += interval;\r\n\t\t\tstartingX = interval;\r\n\t\t}\r\n\t}", "public StrStrMap() {\n }", "protected void setColorList(ArrayList<String> colors)\n {\n \tthis.colors = colors;\n }", "public CharCharMap() {\n this(DEFAULT_INITIAL_SIZE, DEFAULT_LOAD_FACTOR);\n }", "GlobalColors() {\n countMap = new ConcurrentHashMap<State, Integer>();\n redMap = new ConcurrentHashMap<State, Boolean>();\n hasResult = false;\n result = false;\n }", "public HashMap<String, List<ColorId>> checkRocketJumpColors ()\n {\n Map<Square, List<Player>> mapRocket = checkRocketJump();\n HashMap<String, List<ColorId>> hashMapToReturn = new HashMap<>();\n List<ColorId> colorIdList ;\n\n for (Square squareIterate : mapRocket.keySet())\n {\n colorIdList = new ArrayList<>();\n\n for (Player playerIterate : mapRocket.get(squareIterate))\n {\n colorIdList.add(playerIterate.getColor());\n }\n\n hashMapToReturn.put(squareIterate.toStringCoordinates(), colorIdList);\n }\n\n return hashMapToReturn;\n\n }", "public interface Colors\n {\n // Restore default\n String RESTORE = \"\\033[0m\";\n \n // Default colors\n String BLACK = \"\\033[1;30m\"; // Black\n String RED = \"\\033[1;31m\"; // Red\n String GREEN = \"\\033[1;32m\"; // Green\n String YELLOW = \"\\033[1;33m\"; // Yellow\n String BLUE = \"\\033[1;34m\"; // Blue\n String PURPLE = \"\\033[1;35m\"; // Purple\n String CYAN = \"\\033[1;36m\"; // Cyan\n String WHITE = \"\\033[1;37m\"; // White\n }", "protected void createMaps() {\n\t\tBlueSchellingCell bCell = new BlueSchellingCell();\n\t\tOrangeSchellingCell oCell = new OrangeSchellingCell();\n\t\tEmptyCell eCell = new EmptyCell();\n\t\tTreeCell tCell = new TreeCell();\n\t\tBurningTreeCell bTCell = new BurningTreeCell();\n\t\tEmptyLandCell eLCell = new EmptyLandCell();\n\n\t\tLiveCell lCell = new LiveCell();\n\t\tDeadCell dCell = new DeadCell();\n\t\tGreenRPSCell gcell = new GreenRPSCell();\n\t\tRedRPSCell rcell = new RedRPSCell();\n\t\tBlueRPSCell blcell = new BlueRPSCell();\n\t\tWhiteRPSCell wcell = new WhiteRPSCell();\n\n\t\tFishCell fCell = new FishCell();\n\t\tSharkCell sCell = new SharkCell();\n\n\t\tAntGroupCell aCell = new AntGroupCell();\n\n\t\tsegregation.put('b', bCell);\n\t\tsegregation.put('o', oCell);\n\t\tsegregation.put('e', eCell);\n\n\t\tgameOfLife.put('l', lCell);\n\t\tgameOfLife.put('d', dCell);\n\n\t\trps.put('g', gcell);\n\t\trps.put('r', rcell);\n\t\trps.put('b', blcell);\n\t\trps.put('w', wcell);\n\n\t\tspreadingWildfire.put('t', tCell);\n\t\tspreadingWildfire.put('b', bTCell);\n\t\tspreadingWildfire.put('e', eLCell);\n\n\t\twaTor.put('f', fCell);\n\t\twaTor.put('s', sCell);\n\t\twaTor.put('e', eCell);\n\n\t\tforagingAnts.put('a', aCell);\n\t\tforagingAnts.put('e', eCell);\n\t\tinitExportMap();\n\n\t\tinitCountMap();\n\t}", "private DotColor(String displayedText, String... colors) {\n super(displayedText, colors[0], null);\n for(int i=0; i<colors.length; i++) {\n this.colors.add(colors[i]);\n this.icons.add(OurUtil.loadIcon(\"icons/ColorIcons/\"+colors[i]+\".gif\"));\n }\n }", "public ColourTest(String name)\n\t{\n\t\tsuper(name);\n\t}", "public ColorPallete(Color[] colorKeys, int colorCount){\r\n // number of colors in each two color section of the total gradient = total # of colors / # of sections\r\n int gradientResolution = colorCount / (colorKeys.length - 1);\r\n this.colors = createGradient(colorKeys, gradientResolution);\r\n }", "private void processInput(String str) {\r\n String[] strs = str.split(\":\")[1].split(\",\");\r\n for (String s : strs) {\r\n color.add(s.trim().toUpperCase());\r\n }\r\n }", "private void addColors() {\n colors.add(Color.GRAY);\n colors.add(Color.BLUE);\n colors.add(Color.DKGRAY);\n colors.add(Color.CYAN);\n colors.add(Color.MAGENTA);\n //Zijn voorlopig maar 5 kleuren, kan altijd makkelijk meer doen, wil ook liever hex-based kleuren gaan gebruiken.\n }", "private HepRepColor() {\n }", "private void initializeNamesMap (Workspace[] wss) {\n // fill name mapping with proper values\n namesMap = new HashMap(wss.length * 2);\n for (int i = 0; i < wss.length; i++) {\n // create new string for each display name to be able to search\n // using '==' operator in findProgrammaticName(String displayName) method\n namesMap.put(wss[i].getName(), new String(wss[i].getDisplayName()));;\n }\n }", "public ColorPalette(int numColors) {\n\t\tfor (int i = 0; i < numColors; i++)\n\t\t\tpalette.add(randomColor());\n\t}", "private void buildCharMap() {\n\t\tcharMap = new HashMap<Character , Integer>();\n\t\tcharMap.put('a', 0);\n\t\tcharMap.put('b', 1);\n\t\tcharMap.put('c', 2);\n\t\tcharMap.put('d', 3);\n\t\tcharMap.put('e', 4);\n\t\tcharMap.put('f', 5);\n\t\tcharMap.put('g', 6);\n\t\tcharMap.put('h', 7);\n\t\tcharMap.put('i', 8);\n\t\tcharMap.put('j', 9);\n\t\tcharMap.put('k', 10);\n\t\tcharMap.put('l', 11);\n\t\tcharMap.put('m', 12);\n\t\tcharMap.put('n', 13);\n\t\tcharMap.put('o', 14);\n\t\tcharMap.put('p', 15);\n\t\tcharMap.put('q', 16);\n\t\tcharMap.put('r', 17);\n\t\tcharMap.put('s', 18);\n\t\tcharMap.put('t', 19);\n\t\tcharMap.put('u', 20);\n\t\tcharMap.put('v', 21);\n\t\tcharMap.put('w', 22);\n\t\tcharMap.put('x', 23);\n\t\tcharMap.put('y', 24);\n\t\tcharMap.put('z', 25);\t\n\t}", "public Palette() {\n\t\tpaletteOfColorsHex = new ArrayList<>();\n\t\torderedOutputColors = new HashMap<>();\n\t\timgLuminanceIdxs = new HashMap<>();\n\t}", "private HashMap<String, ArrayList<Color>> loadXKCDColors() {\n\t\ttry {\n\t\t\t/* Open the file for reading. */\n\t\t\tBufferedReader br = new BufferedReader(new FileReader(COLORS_FILE));\n\t\t\t\n\t\t\t/* Construct the HashMap that we will provide back as a result. */\n\t\t\tHashMap<String, ArrayList<Color>> result = new HashMap<String, ArrayList<Color>>();\n\t\t\t\n\t\t\twhile (true) {\n\t\t\t\t/* Read the next entry:\n\t\t\t\t * 1. The name of the color.\n\t\t\t\t * 2. Its red component.\n\t\t\t\t * 3. Its green component.\n\t\t\t\t * 4. Its blue component.\n\t\t\t\t */\n\t\t\t\tString colorName = br.readLine();\n\t\t\t\tString r = br.readLine();\n\t\t\t\tString g = br.readLine();\n\t\t\t\tString b = br.readLine();\n\t\t\t\t\n\t\t\t\t/* If we ran out of data, we're done. */\n\t\t\t\tif (b == null) break;\n\t\t\t\t\n\t\t\t\t/* Construct a Color object from this data. */\n\t\t\t\tColor color = new Color(Integer.parseInt(r),\n\t\t\t\t Integer.parseInt(g),\n\t\t\t\t Integer.parseInt(b));\n\t\t\t\t\n\t\t\t\t/* Ensure that there's an ArrayList waiting for us. */\n\t\t\t\tif (!result.containsKey(colorName)) {\n\t\t\t\t\tresult.put(colorName, new ArrayList<Color>());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/* Add this color data to the color list. */\n\t\t\t\tresult.get(colorName).add(color);\n\t\t\t}\n\t\t\t\n\t\t\tbr.close();\n\t\t\treturn result;\t\t\t\n\t\t} catch (IOException e) {\n\t\t\tthrow new ErrorException(e);\n\t\t}\n\t}", "private void assignColors() {\n soundQuickStatus.setBackground(drawables[noise]);\n comfortQuickStatus.setBackground(drawables[comfort]);\n lightQuickStatus.setBackground(drawables[light]);\n convenienceQuickStatus.setBackground(drawables[convenience]);\n }", "public void createMap() {\n\t\tArrayList<String>boardMap = new ArrayList<String>(); //boardmap on tiedostosta ladattu maailman malli\n\t\t\n\t\t//2. try catch blocki, ei jaksa laittaa metodeja heittämään poikkeuksia\n\t\ttry {\n\t\t\tboardMap = loadMap(); //ladataan data boardMap muuttujaan tiedostosta\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\t\t\n\t\t\n\t\t// 3. j=rivit, i=merkit yksittäisellä rivillä\n\t\tfor(int j=0; j<boardMap.size();j++){ \t\t//..rivien lkm (boardMap.size) = alkioiden lkm. \n\t\t\tfor(int i=0; i<boardMap.get(j).length(); i++){\t\t//..merkkien lkm rivillä (alkion Stringin pituus .length)\n\t\t\t\tCharacter hexType = boardMap.get(j).charAt(i);\t//tuodaan tietyltä riviltä, yksittäinen MERKKI hexType -muuttujaan\n\t\t\t\tworld.add(new Hex(i, j, hexType.toString()));\t//Luodaan uusi HEXa maailmaan, Character -merkki muutetaan Stringiksi että Hex konstructori hyväksyy sen.\n\t\t\t}\n\t\t}\n\t\tconvertEmptyHex();\n\t}", "public MyHashMap() {\n map = new ArrayList<>();\n for (int i = 0;i<255;i++)\n map.add(new Entry());\n }", "public FMap(String rute) {\n super(rute);\n init(rute);\n }", "public void stringImage(char ch1, char ch2, char ch3, char ch4, char ch5, char ch6){\r\n\t\t//GLabels are assigned values of the chArray and given coordinates\r\n\t\tstringImage1 = new GLabel(String.valueOf(ch1),250,300 );\r\n\t\tstringImage2 = new GLabel(String.valueOf(ch2),283,300 );\r\n\t\tstringImage3 = new GLabel(String.valueOf(ch3),315,300 );\r\n\t\tstringImage4 = new GLabel(String.valueOf(ch4),347,300 );\r\n\t\tstringImage5 = new GLabel(String.valueOf(ch5),379,300 );\r\n\t\tstringImage6 = new GLabel(String.valueOf(ch6),411,300 );\r\n\t\t//Assigns the colors to each GLabel, either green or red\r\n\t\tif(match1 == true){\r\n\t\t\tstringImage1.setColor(Color.green);\r\n\t\t}if(match1 == false){\r\n\t\t\tstringImage1.setColor(Color.red);\r\n\t\t}if(match2 == true){\r\n\t\t\tstringImage2.setColor(Color.green);\r\n\t\t}if(match2 == false){\r\n\t\t\tstringImage2.setColor(Color.red);\r\n\t\t}if(match3 == true){\r\n\t\t\tstringImage3.setColor(Color.green);\r\n\t\t}if(match3 == false){\r\n\t\t\tstringImage3.setColor(Color.red);\r\n\t\t}if(match4 == true){\r\n\t\t\tstringImage4.setColor(Color.green);\r\n\t\t}if(match4 == false){\r\n\t\t\tstringImage4.setColor(Color.red);\r\n\t\t}if(match5 == true){\r\n\t\t\tstringImage5.setColor(Color.green);\r\n\t\t}if(match5 == false){\r\n\t\t\tstringImage5.setColor(Color.red);\r\n\t\t}if(match6 == true){\r\n\t\t\tstringImage6.setColor(Color.green);\r\n\t\t}if(match6 == false){\r\n\t\t\tstringImage6.setColor(Color.red);\r\n\t\t}\r\n\t\t//All GLabels are set with the same font\r\n\t\tstringImage1.setFont(\"Arial-40\");\r\n\t\tstringImage2.setFont(\"Arial-40\");\r\n\t\tstringImage3.setFont(\"Arial-40\");\r\n\t\tstringImage4.setFont(\"Arial-40\");\r\n\t\tstringImage5.setFont(\"Arial-40\");\r\n\t\tstringImage6.setFont(\"Arial-40\");\r\n\t\t////All GLabels are added to the canvas\r\n\t\tcanvas.add(stringImage1);\r\n\t\tcanvas.add(stringImage2);\r\n\t\tcanvas.add(stringImage3);\r\n\t\tcanvas.add(stringImage4);\r\n\t\tcanvas.add(stringImage5);\r\n\t\tcanvas.add(stringImage6);\r\n\t}", "public ColorClass (int ide, Interval interval, boolean ordered) {\n this (\"C\"+ide, interval, ordered);\n }", "private void init(String command) {\n if (command == null) throw new IllegalArgumentException(\"Empty command\");\n this.raw = command;\n\n String[] data = this.raw.split(\" \");\n this.map = new HashMap<>();\n for ( int i = 0; i < data.length; i++) {\n map.put( Index.values()[i], data[i] );\n }\n }", "public Figure(String colour) {\n this.colour = colour;\n }", "public ColorList () { \n\t\t\n\t}", "private static void initializeMap() {\n\t\tmap = new HashMap<String, MimeTransferEncoding>();\n\t\tfor (MimeTransferEncoding mte : MimeTransferEncoding.values()) {\n\t\t\tmap.put(mte.string, mte);\n\t\t}\n\t}", "void setColor(char c, char t) {\n\t\tif(c == 'b' && t == 'b') pI = PieceImage.B_BISHOP;\n\t\tif(c == 'b' && t == 'k') pI = PieceImage.B_KING;\n\t\tif(c == 'b' && t == 'c') pI = PieceImage.B_KNIGHT;\n\t\tif(c == 'b' && t == 'p') pI = PieceImage.B_PAWN;\n\t\tif(c == 'b' && t == 'q') pI = PieceImage.B_QUEEN;\n\t\tif(c == 'b' && t == 'r') pI = PieceImage.B_ROOK;\n\t\t\n\t\tif(c == 'w' && t == 'b') pI = PieceImage.W_BISHOP;\n\t\tif(c == 'w' && t == 'k') pI = PieceImage.W_KING;\n\t\tif(c == 'w' && t == 'c') pI = PieceImage.W_KNIGHT;\n\t\tif(c == 'w' && t == 'p') pI = PieceImage.W_PAWN;\n\t\tif(c == 'w' && t == 'q') pI = PieceImage.W_QUEEN;\n\t\tif(c == 'w' && t == 'r') pI = PieceImage.W_ROOK;\n\t\n\t\tif(c == 'c' && t == 'b') pI = PieceImage.C_BISHOP;\n\t\tif(c == 'c' && t == 'k') pI = PieceImage.C_KING;\n\t\tif(c == 'c' && t == 'c') pI = PieceImage.C_KNIGHT;\n\t\tif(c == 'c' && t == 'p') pI = PieceImage.C_PAWN;\n\t\tif(c == 'c' && t == 'q') pI = PieceImage.C_QUEEN;\n\t\tif(c == 'c' && t == 'r') pI = PieceImage.C_ROOK;\n\t\t\n\t\tif(c == 'p' && t == 'b') pI = PieceImage.P_BISHOP;\n\t\tif(c == 'p' && t == 'k') pI = PieceImage.P_KING;\n\t\tif(c == 'p' && t == 'c') pI = PieceImage.P_KNIGHT;\n\t\tif(c == 'p' && t == 'p') pI = PieceImage.P_PAWN;\n\t\tif(c == 'p' && t == 'q') pI = PieceImage.P_QUEEN;\n\t\tif(c == 'p' && t == 'r') pI = PieceImage.P_ROOK;\n\t\t}", "public java.awt.Color colorFromString(String s) {\n if (s.contains(\"RGB\")) {\n String[] parts = s.split(\"\\\\(|\\\\)\");\n String[] parameter = parts[2].split(\",\");\n int r = Integer.parseInt(parameter[0]);\n int g = Integer.parseInt(parameter[1]);\n int b = Integer.parseInt(parameter[2]);\n return new Color(r, g, b);\n }\n if (s.contains(\"color\")) {\n String[] parts = s.split(\"\\\\(|\\\\)\");\n String color = parts[1];\n return colorMap.get(color);\n }\n return null;\n\n }", "@Test\n public void testColorCodeExtraction() {\n String text = \"§aHello §b§oWhat's up?\";\n\n String colorResult = stringUtils.extractColorCodes(text).toString();\n String styleResult = stringUtils.extractStyleCodes(text).toString();\n\n Assert.assertEquals(\"[§a, §b]\", colorResult);\n Assert.assertEquals(\"[§o]\", styleResult);\n }", "public void setColor(String c)\n { \n color = c;\n draw();\n }", "private HashMap<String, ArrayList<int[]>> loadColorsFile() {\n\t\ttry {\n\t\t\t/* Open the file for reading. */\n\t\t\tBufferedReader br = new BufferedReader(new FileReader(COLORS_FILE));\n\t\t\t\n\t\t\t/* Construct the HashMap that we will provide back as a result. */\n\t\t\tHashMap<String, ArrayList<int[]>> result = new HashMap<String, ArrayList<int[]>>();\n\t\t\t\n\t\t\twhile (true) {\n\t\t\t\t/* Read the next entry:\n\t\t\t\t * 1. The name of the color.\n\t\t\t\t * 2. Its red component.\n\t\t\t\t * 3. Its green component.\n\t\t\t\t * 4. Its blue component.\n\t\t\t\t */\n\t\t\t\tString colorName = br.readLine();\n\t\t\t\tString r = br.readLine();\n\t\t\t\tString g = br.readLine();\n\t\t\t\tString b = br.readLine();\n\t\t\t\t\n\t\t\t\t/* If we ran out of data, we're done. */\n\t\t\t\tif (b == null) break;\n\t\t\t\t\n\t\t\t\t/* Construct an array of the colors. */\n\t\t\t\tint[] color = new int[3];\n\t\t\t\tcolor[0] = Integer.parseInt(r);\n\t\t\t\tcolor[1] = Integer.parseInt(g);\n\t\t\t\tcolor[2] = Integer.parseInt(b);\n\t\t\t\t\n\t\t\t\t/* Ensure that there's an ArrayList waiting for us. */\n\t\t\t\tif (!result.containsKey(colorName)) {\n\t\t\t\t\tresult.put(colorName, new ArrayList<int[]>());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/* Add this color data to the color list. */\n\t\t\t\tresult.get(colorName).add(color);\n\t\t\t}\n\t\t\t\n\t\t\tbr.close();\n\t\t\treturn result;\t\t\t\n\t\t} catch (IOException e) {\n\t\t\tthrow new ErrorException(e);\n\t\t}\n\t}", "protected AGG_State( String s )\n {\n name = s;\n nameHash.put( s, this );\n intValue = index;\n intHash.put( new Integer( intValue ), this );\n }", "public static Color name2color(String name) {\n Color ans = name2color.get(name);\n if (ans!=null) return ans;\n else if (name.equals(\"magic\")) ans=Color.WHITE;\n else if (name.equals(\"palevioletred\")) ans=new Color(222,113,148);\n else if (name.equals(\"red\")) ans=new Color(255,0,0);\n else if (name.equals(\"salmon\")) ans=new Color(255,130,115);\n else if (name.equals(\"magenta\")) ans=new Color(255,0,255);\n else if (name.equals(\"limegreen\")) ans=new Color(49,207,49);\n else if (name.equals(\"green2\")) ans=new Color(0,239,0);\n else if (name.equals(\"darkolivegreen2\")) ans=new Color(189,239,107);\n else if (name.equals(\"chartreuse2\")) ans=new Color(115,239,0);\n else if (name.equals(\"gold\")) ans=new Color(255,215,0);\n else if (name.equals(\"yellow\")) ans=new Color(255,255,0);\n else if (name.equals(\"lightgoldenrod\")) ans=new Color(239,223,132);\n else if (name.equals(\"cornflowerblue\")) ans=new Color(99,150,239);\n else if (name.equals(\"blue\")) ans=new Color(0,0,255);\n else if (name.equals(\"cadetblue\")) ans=new Color(90,158,165);\n else if (name.equals(\"cyan\")) ans=new Color(0,255,255);\n else if (name.equals(\"lightgray\")) ans=new Color(214,214,214);\n else if (name.equals(\"white\")) ans=Color.WHITE;\n else ans=Color.BLACK;\n name2color.put(name,ans);\n return ans;\n }" ]
[ "0.7205114", "0.66373825", "0.6590694", "0.61248916", "0.6098997", "0.604173", "0.60055375", "0.59463537", "0.5915712", "0.5853396", "0.5812107", "0.5790743", "0.57495147", "0.56995046", "0.56701505", "0.5582439", "0.5579208", "0.5575098", "0.5573799", "0.55735034", "0.5561961", "0.55614704", "0.55549765", "0.5541929", "0.55311483", "0.55198216", "0.5499392", "0.54932904", "0.54859143", "0.54688764", "0.5458224", "0.545379", "0.5443853", "0.5432015", "0.5407446", "0.53791094", "0.5378473", "0.5362391", "0.53574675", "0.5344706", "0.532975", "0.53175116", "0.5295229", "0.5292985", "0.52845967", "0.52743495", "0.52723694", "0.52632874", "0.526142", "0.52601373", "0.5258653", "0.52564156", "0.5236457", "0.5229994", "0.52288544", "0.5227484", "0.52223694", "0.5221711", "0.5213487", "0.5211084", "0.5209964", "0.5206988", "0.5198205", "0.51936316", "0.5186894", "0.51748437", "0.51686156", "0.5168097", "0.5166988", "0.51669085", "0.51631093", "0.5161855", "0.51539177", "0.5149552", "0.51443666", "0.5134712", "0.51307297", "0.51212347", "0.5118489", "0.5110437", "0.5106419", "0.51062745", "0.509106", "0.509048", "0.5080947", "0.50798607", "0.5077956", "0.50739014", "0.5072773", "0.50652266", "0.5053633", "0.5052842", "0.5052268", "0.50503975", "0.5048752", "0.5048231", "0.503638", "0.5027357", "0.50222576", "0.5018952" ]
0.67033136
1
parse color definition and return the specified color.
public java.awt.Color colorFromString(String s) { if (s.contains("RGB")) { String[] parts = s.split("\\(|\\)"); String[] parameter = parts[2].split(","); int r = Integer.parseInt(parameter[0]); int g = Integer.parseInt(parameter[1]); int b = Integer.parseInt(parameter[2]); return new Color(r, g, b); } if (s.contains("color")) { String[] parts = s.split("\\(|\\)"); String color = parts[1]; return colorMap.get(color); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public IsColor getColorFrom() {\n\t\treturn ColorBuilder.parse(getColorFromAsString());\n\t}", "public Color getColor(String key) {\n\t\tColor defaultValue = (Color) getDefault(key);\n\t\tString sp = internal.getProperty(key);\n\t\tif (sp == null) {\n\t\t\treturn defaultValue;\n\t\t}\n\t\ttry {\n\t\t\tint r, g, b, a;\n\t\t\tString token;\n\t\t\tStringTokenizer st = new StringTokenizer(sp, \" \", false);\n\t\t\tif (!st.hasMoreTokens()) {\n\t\t\t\t// the value is not correctly formated => remove it\n\t\t\t\tinternal.remove(key);\n\t\t\t\treturn defaultValue;\n\t\t\t}\n\t\t\ttoken = st.nextToken();\n\t\t\tr = Integer.parseInt(token);\n\t\t\tif (!st.hasMoreTokens()) {\n\t\t\t\tinternal.remove(key);\n\t\t\t\treturn defaultValue;\n\t\t\t}\n\t\t\ttoken = st.nextToken();\n\t\t\tg = Integer.parseInt(token);\n\t\t\tif (!st.hasMoreTokens()) {\n\t\t\t\tinternal.remove(key);\n\t\t\t\treturn defaultValue;\n\t\t\t}\n\t\t\ttoken = st.nextToken();\n\t\t\tb = Integer.parseInt(token);\n\t\t\tif (!st.hasMoreTokens()) {\n\t\t\t\tinternal.remove(key);\n\t\t\t\treturn defaultValue;\n\t\t\t}\n\t\t\ttoken = st.nextToken();\n\t\t\ta = Integer.parseInt(token);\n\t\t\treturn new Color(r, g, b, a);\n\t\t} catch (NumberFormatException e) {\n\t\t\tinternal.remove(key);\n\t\t\treturn defaultValue;\n\t\t}\n\t}", "private int parseColor(int start,int end) {\n char ch = mChars[start];\n if(ch != '\"' && ch != '0') {\n return 0;\n }\n boolean type = ch == '0';\n if(type) {\n String v = new String(mChars,start + 2,end - start - 2);\n try{\n //Copied from Color.java\n long color = Long.parseLong(v, 16);\n if (end - start == 8) {\n // Set the alpha value\n color |= 0x00000000ff000000;\n }\n return (int)color;\n }catch(RuntimeException e){\n return 0;\n }\n }else{\n if(end - start != 11 && end - start != 9) {\n return 0;\n }\n String v = new String(mChars,start + 1,end - start - 2);\n try{\n return Color.parseColor(v);\n }catch(RuntimeException e){\n return 0;\n }\n }\n }", "private static Color colorParse(String colorString)\n\t{\n\t\tString[] parts = colorString.split(\"\\\\Q,\\\\E\");\n\t\treturn new Color(Integer.parseInt(parts[0]),Integer.parseInt(parts[1]),Integer.parseInt(parts[2]));\n\t}", "Color decodeColor(String p) {\n StringTokenizer st = new StringTokenizer(p, \",\");\n if (st.countTokens() > 4) {\n return null;\n }\n int[] d = new int[4];\n int tokens = 0;\n while (st.hasMoreTokens()) {\n d[tokens] = Integer.parseInt(st.nextToken().trim());\n tokens++;\n }\n if (tokens == 4) {\n return new Color(d[0], d[1], d[2], d[3]);\n } else {\n return new Color(d[0], d[1], d[2]);\n }\n }", "private @NotNull Color parseColor (@NotNull String classColorString, @NotNull Color defaultColor)\n {\n try\n {\n if (classColorString != null)\n {\n return new Color ((int) Long.parseLong (classColorString, 16));\n }\n }\n catch (NumberFormatException e)\n {\n // ignore\n }\n return defaultColor;\n }", "public IsColor getColor() {\n\t\treturn ColorBuilder.parse(getColorAsString());\n\t}", "Color getColor();", "Color getColor();", "Color getColor();", "Color getColor();", "Color getColor();", "public static java.awt.Color colorFromString(String s) {\r\n Color color = null;\r\n s = s.substring(6, s.length() - 1);\r\n if (s.startsWith(\"RGB\")) {\r\n s = s.substring(4, s.length() - 1);\r\n String[] split = s.split(\",\");\r\n int color1 = Integer.parseInt(split[0]);\r\n int color2 = Integer.parseInt(split[1]);\r\n int color3 = Integer.parseInt(split[2]);\r\n color = new Color(color1, color2, color3);\r\n } else {\r\n Field field = null;\r\n try {\r\n field = Class.forName(\"java.awt.Color\").getField(s);\r\n } catch (NoSuchFieldException | SecurityException | ClassNotFoundException e) {\r\n e.printStackTrace();\r\n }\r\n try {\r\n color = (Color) field.get(null);\r\n } catch (IllegalArgumentException e) {\r\n e.printStackTrace();\r\n } catch (IllegalAccessException e) {\r\n e.printStackTrace();\r\n }\r\n// if (s.equals(\"blue\")) {\r\n// return Color.blue;\r\n// } else if (s.equals(\"black\")) {\r\n// return Color.black;\r\n// } else if (s.equals(\"cyan\")) {\r\n// return Color.cyan;\r\n// } else if (s.equals(\"gray\")) {\r\n// return Color.gray;\r\n// } else if (s.equals(\"lightGray\")) {\r\n// return Color.lightGray;\r\n// } else if (s.equals(\"green\")) {\r\n// return Color.green;\r\n// } else if (s.equals(\"orange\")) {\r\n// return Color.orange;\r\n// } else if (s.equals(\"pink\")) {\r\n// return Color.pink;\r\n// } else if (s.equals(\"red\")) {\r\n// return Color.red;\r\n// } else if (s.equals(\"white\")) {\r\n// return Color.white;\r\n// } else if (s.equals(\"yellow\")) {\r\n// return Color.yellow;\r\n// }\r\n }\r\n return color;\r\n }", "public static int parseColor(String str) {\n if (!TextUtils.isEmpty(str)) {\n if (str.startsWith(DXBindingXConstant.SINGLE_QUOTE) || str.startsWith(\"\\\"\")) {\n str = str.substring(1, str.length() - 1);\n }\n int parseColor = Color.parseColor(str);\n return Color.argb(255, Color.red(parseColor), Color.green(parseColor), Color.blue(parseColor));\n }\n throw new IllegalArgumentException(\"Unknown color\");\n }", "private Color detectColor(String c){\n switch (c){\n case \"RED\": return Color.RED;\n case \"BLUE\": return Color.BLUE;\n case \"YELLOW\": return Color.YELLOW;\n case \"GREEN\": return Color.GREEN;\n case \"WHITE\": return Color.WHITE;\n case \"BLACK\": return Color.BLACK;\n case \"CYAN\": return Color.CYAN;\n case \"ORANGE\": return Color.ORANGE;\n case \"MAGENTA\": return Color.MAGENTA;\n case \"PINK\": return Color.PINK;\n default: return null;\n }\n }", "public static Color parserColor(String value) throws NumberFormatException {\n if(value.length() > 0 && value.charAt(0) == '#') {\n String hexcode = value.substring(1);\n switch (value.length()) {\n case 4: {\n int rgb4 = Integer.parseInt(hexcode, 16);\n int r = ((rgb4 >> 8) & 0xF) * 0x11;\n int g = ((rgb4 >> 4) & 0xF) * 0x11;\n int b = ((rgb4 ) & 0xF) * 0x11;\n return new Color(0xFF000000 | (r << 16) | (g << 8) | b);\n }\n case 5: {\n int rgb4 = Integer.parseInt(hexcode, 16);\n int a = ((rgb4 >> 12) & 0xF) * 0x11;\n int r = ((rgb4 >> 8) & 0xF) * 0x11;\n int g = ((rgb4 >> 4) & 0xF) * 0x11;\n int b = ((rgb4 ) & 0xF) * 0x11;\n return new Color((a << 24) | (r << 16) | (g << 8) | b);\n }\n case 7:\n return new Color(0xFF000000 | Integer.parseInt(hexcode, 16));\n case 9:\n return new Color((int)Long.parseLong(hexcode, 16));\n default:\n throw new NumberFormatException(\"Can't parse '\" + value + \"' as hex color\");\n }\n }\n return Color.getColorByName(value);\n }", "java.awt.Color getColor();", "public Color getColor(String key) {\r\n String cs = getString(key);\r\n cs.trim();\r\n int i1 = cs.indexOf(','), i2 = cs.lastIndexOf(',');\r\n if (i1 != i2) {\r\n try {\r\n int r = Integer.decode(cs.substring(0, i1).trim()).intValue();\r\n int g = Integer.decode(cs.substring(i1 + 1, i2).trim()).intValue();\r\n int b = Integer.decode(cs.substring(i2 + 1).trim()).intValue();\r\n\r\n return new Color(r, g, b);\r\n }\r\n catch (Exception e) {}\r\n }\r\n\r\n return null;\r\n }", "public static Color valueOf(String s) {\n Matcher m = THREE_DIGIT_PATTERN.matcher(s);\n if (m.matches()) {\n return new Color(Integer.parseInt(m.group(1), 16) * 0x11,\n Integer.parseInt(m.group(2), 16) * 0x11,\n Integer.parseInt(m.group(3), 16) * 0x11);\n }\n m = SIX_DIGIT_PATTERN.matcher(s);\n if (m.matches()) {\n return new Color(Integer.parseInt(m.group(1), 16),\n Integer.parseInt(m.group(2), 16),\n Integer.parseInt(m.group(3), 16));\n }\n Color color = KEYWORD_MAP.get(s);\n if (color != null) {\n return color;\n }\n throw new IllegalArgumentException(\"Can't parse \\\"\" + s\n + \"\\\" as a CSS color.\");\n }", "public static Color parse(String colorString) {\n Color color = namedColors.get(colorString.toLowerCase(Locale.ENGLISH));\n if (color != null) {\n return color;\n }\n throw new IllegalArgumentException(colorString);\n }", "Color userColorChoose();", "@Override\r\n\tpublic Color getColor(String color) {\n\t\tif(color==null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t//是否是red类型\r\n\t\tif(color.equalsIgnoreCase(\"RED\")) {\r\n\t\t\treturn new Red();\r\n\t\t}else if(color.equalsIgnoreCase(\"GREEN\")) {\r\n\t\t\treturn new Green();\r\n\t\t}else if(color.equalsIgnoreCase(\"BLUE\")) {\r\n\t\t\treturn new Blue();\r\n\t\t}\r\n\t\t//都没返回类型时,返回null\r\n\t\treturn null;\r\n\t}", "private static int getHtmlColor(int start, int end, String color) {\n if (end - start < 3) {\n return COLOR_NONE;\n }\n if (color.charAt(start) == '#') {\n if (end - start == 9) {\n start += 2;\n }\n if (end - start == 7) {\n String colorText = color.substring(start + 1, end);\n if (\"000000\".equals(colorText) || \"FF000000\".equalsIgnoreCase(colorText)) {\n //修复夜间模式黑色颜色值看不清\n return COLOR_NONE;\n }\n int colorInt = Integer.parseInt(color.substring(start + 1, end), 16);\n return (colorInt | 0xff000000);\n }\n return COLOR_NONE;\n } else {\n Integer i = S_COLOR_MAP.get(color.substring(start, end).toLowerCase(Locale.US));\n if (i != null) {\n return i;\n }\n return COLOR_NONE;\n }\n }", "static Color getColor(String colorString) {\n if (ArgumentCheckUtil.isNullOrEmptyString(colorString)) {\n return Color.LIGHT_GRAY;\n } else if (colorString.toLowerCase().equals(\"white\")) {\n return Color.WHITE;\n } else if (colorString.toLowerCase().equals(\"lightgray\")) {\n return Color.LIGHT_GRAY;\n } else if (colorString.toLowerCase().equals(\"gray\")) {\n return Color.GRAY;\n } else if (colorString.toLowerCase().equals(\"darkgray\")) {\n return Color.DARK_GRAY;\n } else if (colorString.toLowerCase().equals(\"black\")) {\n return Color.BLACK;\n } else if (colorString.toLowerCase().equals(\"red\")) {\n return Color.RED;\n } else if (colorString.toLowerCase().equals(\"pink\")) {\n return Color.PINK;\n } else if (colorString.toLowerCase().equals(\"orange\")) {\n return Color.ORANGE;\n } else if (colorString.toLowerCase().equals(\"yellow\")) {\n return Color.YELLOW;\n } else if (colorString.toLowerCase().equals(\"green\")) {\n return Color.GREEN;\n } else if (colorString.toLowerCase().equals(\"magenta\")) {\n return Color.MAGENTA;\n } else if (colorString.toLowerCase().equals(\"cyan\")) {\n return Color.CYAN;\n } else if (colorString.toLowerCase().equals(\"blue\")) {\n return Color.BLUE;\n } else if (colorString.toLowerCase().equals(\"light_gray\")) {\n return Color.LIGHT_GRAY;\n } else if (colorString.toLowerCase().equals(\"dark_gray\")) {\n return Color.DARK_GRAY;\n } else if (colorString.startsWith(\"#\") && colorString.length() == 7) {\n // for #RRGGBB format\n try {\n return new Color(Integer.parseInt(colorString.substring(1, 3), 16), Integer.parseInt(colorString\n .substring(3, 5), 16), Integer.parseInt(colorString.substring(5), 16));\n } catch (NumberFormatException e) {\n return Color.LIGHT_GRAY;\n }\n } else {\n return Color.LIGHT_GRAY;\n }\n }", "private static TextColor colorString(String color) {\n if (color.toLowerCase().trim().startsWith(\"#\")) {\n // pass this for now.\n }\n switch (color.toLowerCase().trim()) {\n case \"blue\":\n case \"&9\":\n return TextColors.BLUE;\n case \"dark_blue\":\n case \"dark blue\":\n case \"&1\":\n return TextColors.DARK_BLUE;\n case \"dark red\":\n case \"dark_red\":\n case \"&4\":\n return TextColors.DARK_RED;\n case \"red\":\n case \"&c\":\n return TextColors.RED;\n case \"reset\":\n case \"&r\":\n return TextColors.RESET;\n case \"gold\":\n case \"&6\":\n return TextColors.GOLD;\n case \"yellow\":\n case \"&e\":\n return TextColors.YELLOW;\n case \"dark_green\":\n case \"dark green\":\n case \"&2\":\n return TextColors.DARK_GREEN;\n case \"green\":\n case \"lime\":\n case \"&a\":\n return TextColors.GREEN;\n case \"aqua\":\n case \"&b\":\n return TextColors.AQUA;\n case \"dark_aqua\":\n case \"dark aqua\":\n case \"&3\":\n return TextColors.DARK_AQUA;\n case \"light_purple\":\n case \"light purple\":\n case \"pink\":\n case \"%d\":\n return TextColors.LIGHT_PURPLE;\n case \"dark_purple\":\n case \"dark purple\":\n case \"purple\":\n case \"magenta\":\n case \"&5\":\n return TextColors.DARK_PURPLE;\n case \"white\":\n case \"&f\":\n return TextColors.WHITE;\n case \"gray\":\n case \"grey\":\n case \"&7\":\n return TextColors.GRAY;\n case \"dark_grey\":\n case \"dark_gray\":\n case \"dark gray\":\n case \"dark grey\":\n case \"&8\":\n return TextColors.DARK_GRAY;\n case \"black\":\n case \"&0\":\n return TextColors.BLACK;\n default:\n return TextColors.NONE;\n }\n }", "public Color getColor(final String colorString) {\n \t\treturn new Color(Integer.parseInt(colorString.substring(1), 16));\n \t}", "public int getColor(){\r\n\t\treturn color;\r\n\t}", "String getColor();", "public int getColor() {\n \t\treturn color;\n \t}", "public int getColor(){\n\t\treturn color;\n\t}", "public int getColor(){\n\t\treturn color;\n\t}", "private int parseColour(final String value) {\n\n\t\tint result = 0xffffff;\n\n\t\t// Handle colour values that are in the format \"rgb(r,g,b)\"\n\t\tif (value.startsWith(\"rgb\")) {\n\t\t\tint r, g, b;\n\t\t\tfinal ValueTokenizer t = new ValueTokenizer();\n\t\t\tt.getToken(value.substring(3));\n\t\t\tif (t.currentTok == ValueTokenizer.LTOK_NUMBER) {\n\t\t\t\tr = (int) t.tokenF;\n\t\t\t\tt.getToken(null);\n\t\t\t\tif (t.currentTok == ValueTokenizer.LTOK_NUMBER) {\n\t\t\t\t\tg = (int) t.tokenF;\n\t\t\t\t\tt.getToken(null);\n\t\t\t\t\tif (t.currentTok == ValueTokenizer.LTOK_NUMBER) {\n\t\t\t\t\t\tb = (int) t.tokenF;\n\t\t\t\t\t\tresult = (r << 16) + (g << 8) + b;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Handle colour values that are in the format #123abc. (Assume that's what it is,\n\t\t// if the length is seven characters).\n\t\telse if (value.length() == 7) {\n\t\t\ttry {\n\t\t\t\tresult = Integer.parseInt(value.substring(1, 7), 16);\n\t\t\t}\n\t\t\tcatch (final NumberFormatException e) {\n\t\t\t\tresult = 0xff0000;\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}", "public IsColor getColorTo() {\n\t\treturn ColorBuilder.parse(getColorToAsString());\n\t}", "public int getColorValue() {\r\n\t\treturn color;\r\n\t}", "public Color getColor() { return color; }", "public GameColor getColor();", "public static Color getRGBColor(String name)\n\t\t\tthrows IllegalArgumentException {\n\t\tint[] c = { 0, 0, 0, 0 };\n\t\tif (name.startsWith(\"#\")) {\n\t\t\tif (name.length() == 4) {\n\t\t\t\tc[0] = Integer.parseInt(name.substring(1, 2), 16) * 16;\n\t\t\t\tc[1] = Integer.parseInt(name.substring(2, 3), 16) * 16;\n\t\t\t\tc[2] = Integer.parseInt(name.substring(3), 16) * 16;\n\t\t\t\treturn new Color(c[0], c[1], c[2], c[3]);\n\t\t\t}\n\t\t\tif (name.length() == 7) {\n\t\t\t\tc[0] = Integer.parseInt(name.substring(1, 3), 16);\n\t\t\t\tc[1] = Integer.parseInt(name.substring(3, 5), 16);\n\t\t\t\tc[2] = Integer.parseInt(name.substring(5), 16);\n\t\t\t\treturn new Color(c[0], c[1], c[2], c[3]);\n\t\t\t}\n\t\t\tthrow new IllegalArgumentException(MessageLocalization.getComposedMessage(\"unknown.color.format.must.be.rgb.or.rrggbb\"));\n\t\t}\n else if (name.startsWith(\"rgb(\")) {\n StringTokenizer tok = new StringTokenizer(name, \"rgb(), \\t\\r\\n\\f\");\n for (int k = 0; k < 3; ++k) {\n String v = tok.nextToken();\n if (v.endsWith(\"%\"))\n c[k] = Integer.parseInt(v.substring(0, v.length() - 1)) * 255 / 100;\n else\n c[k] = Integer.parseInt(v);\n if (c[k] < 0)\n c[k] = 0;\n else if (c[k] > 255)\n c[k] = 255;\n }\n return new Color(c[0], c[1], c[2], c[3]);\n }\n\t\tname = name.toLowerCase();\n\t\tif (!NAMES.containsKey(name))\n\t\t\tthrow new IllegalArgumentException(\"Color '\" + name\n\t\t\t\t\t+ \"' not found.\");\n\t\tc = (int[]) NAMES.get(name);\n\t\treturn new Color(c[0], c[1], c[2], c[3]);\n\t}", "abstract Color getColor();", "@Nullable\r\n public Color getColor(String key) {\r\n return getTyped(key, Color.class, null);\r\n }", "public Color getColor();", "public Color getColor();", "public Color getColor();", "public String getColor() {\r\n return color;\r\n }", "RGB getNewColor();", "public int getColor() {\n return color;\n }", "public int getColor();", "public int getColor();", "public String getColor() { \n return color; \n }", "public String getColor(){\n\t\treturn color;\n\t}", "public String getColor() {\r\n\t\treturn color;\r\n\t}", "public Integer getColor() {\n\t\treturn color;\n\t}", "public static\n Color convertStringToColor(String val)\n {\n Color ret_Color;\n\n try\n {\n String workstr1;\n int slen = val.length();\n if (val.startsWith(\"0x\") || val.startsWith(\"0X\"))\n {\n workstr1 = val.substring(2);\n slen -= 2;\n }\n else\n if (val.startsWith(\"#\"))\n {\n workstr1 = val.substring(1);\n slen -= 1;\n }\n else\n { // decimal integer\n return new Color(Integer.parseInt(val));\n }\n\n // process hex string\n if (slen <= 6)\n { // no alpha\n int ival = Integer.parseInt(workstr1, 16);\n ret_Color = new Color(ival);\n }\n else\n { // has alpha of some sort\n String workstr2;\n if (slen == 8)\n {\n workstr2 = workstr1;\n }\n else\n if (slen == 7)\n {\n workstr2 = \"0\" + workstr1;\n }\n else\n {\n workstr2 = workstr1.substring(slen - 8); // get rightmost 8\n }\n\n // System.out.println(\"Color,val=[\" + val + \"],key=[\" + key + \"],slen=\" + slen + \"]\");\n // System.out.println(\" workstr1=[\" + workstr1 + \"],workstr2=[\" + workstr2 + \"]\");\n int a = Integer.parseInt(workstr2.substring(0, 2), 16); // a\n int r = Integer.parseInt(workstr2.substring(2, 4), 16); // r\n int g = Integer.parseInt(workstr2.substring(4, 6), 16); // g\n int b = Integer.parseInt(workstr2.substring(6, 8), 16); // b\n // System.out.println(\" ret_Color1=[\" + r + \":\" + g + \":\" + b +\":\" + a + \"]\");\n // int ival = Integer.parseInt(workstr2, 16);\n // ret_Color = new Color(ival, true);\n // System.out.println(\" ival=\" + ival);\n try {\n ret_Color = new Color(r, g, b, a);\n }\n catch (NoSuchMethodError excp1) {\n System.out.println(\"YutilProperties:convertStringToColor|excp1=[\" + excp1 + \"]\");\n ret_Color = new Color(r, g, b);\n }\n // System.out.println(\" ret_Color1=[\" + ret_Color + \"]\");\n }\n }\n catch(NumberFormatException e)\n {\n ret_Color = Color.black;\n // System.out.println(\"Color,ret_Color3=[\" + ret_Color + \"]\");\n }\n\n return ret_Color;\n }", "public String getColor()\n {\n return color;\n }", "public String getColor()\n {\n return color;\n }", "public String seeColor(String str) {\r\n if (str.startsWith(\"red\")) {\r\n return \"red\";\r\n }\r\n if (str.startsWith(\"blue\")) {\r\n return \"blue\";\r\n }\r\n\r\n return \"\";\r\n }", "@Override\n\tpublic Color getColor(String colorType) {\n\t\t\n\t\tif(colorType == null){\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tif(colorType.equalsIgnoreCase(\"RED\")){\n\t\t\treturn new Red();\n\t\t} else if(colorType.equalsIgnoreCase(\"GREEN\")){\n\t\t\treturn new Green();\n\t\t} else if(colorType.equalsIgnoreCase(\"Blue\")){\n\t\t\treturn new Blue();\n\t\t}\n\t\t\n\t\treturn null;\n\t\t\n\t}", "public Color getColor() { return color.get(); }", "public String getColor() {\n return color;\n }", "public String getColor() {\n return color;\n }", "public String getColor() {\n return color;\n }", "public String getColor() {\n return color;\n }", "public String getColor() {\n return color;\n }", "public String getColor() {\n return color;\n }", "public String getColor() {\n return color;\n }", "public String getColor() {\n return color;\n }", "public final Color getColor() {\n return color;\n }", "public char getColor();", "public String getColor() {\n\t\treturn color;\n\t}", "public String getColor() {\n\t\treturn color;\n\t}", "public String obtenColor() {\r\n return color;\r\n }", "public Color getCurrentColor();", "public RGBColor getColor(){\r\n return this._color;\r\n }", "public String getColor(){\r\n return color;\r\n }", "public Color getColor() \n\t{\n\t\treturn color;\n\t}", "public Color getColor() {\n return color;\n }", "public static Color colorStringToColor(String color) throws NoSuchFieldException {\r\n\t\tField field;\r\n\t\ttry {\r\n\t\t\tfield = Color.class.getField(color.toLowerCase());\r\n\t\t\treturn (Color) field.get(null);\r\n\t\t} catch (IllegalAccessException | IllegalArgumentException e) {\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t}", "public Color getColor() {\n \t\treturn color;\n \t}", "public Color getColor() {\n return color;\r\n }", "public Color getColor(final String key) {\n return get(Color.class, key);\n }", "public Color readColor() {\n return colorSensor.getColor();\n }", "public Color stringToColor (String sColor, Color cDefault)\r\n\t{\r\n\tInteger iRgb;\r\n\t\r\n\tif ((sColor == null)\r\n\t|| (sColor.charAt (0) != '#')\r\n\t|| (sColor.length () != 7))\r\n\t\t{\r\n\t\treturn (cDefault);\r\n\t\t}\r\n\t\t\r\n\ttry\r\n\t {\r\n\t iRgb = Integer.valueOf (sColor.substring (1,7), 16);\r\n\t return (new Color (iRgb.intValue ()));\r\n\t }\r\n\tcatch (Exception e)\r\n\t {\r\n\t return (cDefault);\r\n\t }\r\n\t}", "public String getColor() {\n return colorID;\n }", "public final Color getColor() {\r\n return color;\r\n }", "public Color getColor()\n {\n return color;\n }", "public Color getColor() {\r\n return color;\r\n }", "public Color getColor() {\r\n return color;\r\n }", "public Color getColor() {\r\n return color;\r\n }", "RGB getOldColor();", "public Color getColor()\n {\n return color;\n }", "public Color getColor()\n {\n return color;\n }", "public Color getColor()\n {\n return color;\n }", "public Color readColor() throws IOException {\n return new Color(readInt(), readInt(), readInt());\n }", "public Color getColor() {\n\treturn color;\n }", "public String getColor(){\n return this._color;\n }", "static public Element lookup(Color color)\n {\n return lookup(color.getRGB());\n }", "public Color getColor()\n { \n return color;\n }", "private static String checkColor(String color) throws ParseException {\n if (COLOR.contains(color.toUpperCase()))\n return color.toUpperCase();\n else\n throw new ParseException(\"Colore \" + color + \" non ammesso\", color.length());\n }", "public final Color getColor() {\n\t\treturn color;\n\t}", "static public int getRed(int color) {\n return (color >> 16) & 0xff;\n }", "public static Color getColor() {\n return myColor;\n }" ]
[ "0.6942244", "0.68542534", "0.68022025", "0.6758542", "0.6747843", "0.6720472", "0.66815704", "0.66813534", "0.66813534", "0.66813534", "0.66813534", "0.66813534", "0.66147524", "0.66065913", "0.65593445", "0.6557196", "0.6554413", "0.6533397", "0.64903426", "0.64391404", "0.63143915", "0.63027805", "0.62833744", "0.6263527", "0.62489533", "0.62466145", "0.6202152", "0.619388", "0.6154084", "0.613371", "0.613371", "0.6125352", "0.61115175", "0.6102299", "0.60884386", "0.6083768", "0.6082841", "0.60826194", "0.607037", "0.6063422", "0.6063422", "0.6063422", "0.60592747", "0.60495806", "0.6039724", "0.60380495", "0.60380495", "0.60316694", "0.6019897", "0.60123575", "0.60115486", "0.6006943", "0.59826374", "0.59826374", "0.5976351", "0.5975467", "0.5973734", "0.59606063", "0.59606063", "0.59606063", "0.59606063", "0.59606063", "0.59606063", "0.59606063", "0.59606063", "0.5949956", "0.59358203", "0.5935188", "0.5935188", "0.59342223", "0.5933302", "0.5929214", "0.5918875", "0.59186596", "0.5902703", "0.5897196", "0.5891554", "0.58913916", "0.58908516", "0.58816147", "0.5880345", "0.58742386", "0.5872403", "0.58704644", "0.58517706", "0.58517706", "0.58517706", "0.58412284", "0.5831062", "0.5831062", "0.5831062", "0.58299696", "0.5825728", "0.5824327", "0.58240944", "0.5823943", "0.582204", "0.58105606", "0.5804499", "0.5801213" ]
0.6938718
1
TODO das waere dann hauptsaechlich deins... bitte auch checken ob alles ascii is und so, und falls irgendwas nicht in ordnung ist, eine InvalidArgumentValueException schmeissen.
@Override public void parseInput() throws InvalidArgumentValueException { try { stringArgBytes = stringToArrayOfByte(stringText.getText()); } catch (NumberFormatException e) { throw new InvalidArgumentValueException( "This string cannot be converted to ASCII for some reason. Maybe there are non asci characters used in it"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test(expectedExceptions=InvalidArgumentValueException.class)\n public void argumentValidationTest() {\n String[] commandLine = new String[] {\"--value\",\"521\"};\n\n parsingEngine.addArgumentSource( ValidatingArgProvider.class );\n parsingEngine.parse( commandLine );\n parsingEngine.validate();\n\n ValidatingArgProvider argProvider = new ValidatingArgProvider();\n parsingEngine.loadArgumentsIntoObject( argProvider );\n\n Assert.assertEquals(argProvider.value.intValue(), 521, \"Argument is not correctly initialized\");\n\n // Try some invalid arguments\n commandLine = new String[] {\"--value\",\"foo\"};\n parsingEngine.parse( commandLine );\n parsingEngine.validate();\n }", "@Override\n public String execute(String argument) {\n try {\n if (!argument.isEmpty()) {\n throw new WrongArgumentException();\n }\n\n System.out.println(\"Программа успешно завершена!\");\n System.exit(0);\n } catch (WrongArgumentException e) {\n System.out.println(\"Используйте: '\" + getName() + \"'\");\n } catch (Exception e) {\n System.out.println(\"Что-то пошло не так. Повторите ввод.\");\n }\n return argument;\n }", "protected void baseCharacterCheck(final char c, final String parameter)\n throws IllegalArgumentException {\n if (Character.isISOControl(c) || !Character.isValidCodePoint(c)) {\n throw new IllegalArgumentException(\"Contains illegal character 0x\" +\n Integer.toHexString(c) + \": \" + parameter);\n }\n }", "private void validCharachter() throws DisallowedCharachter {\n if (!test.equals(\"X\") && !test.equals(\"O\")) {\n throw (new DisallowedCharachter());\n }\n }", "public void InvalidFormat();", "@When(\"^user enters an invalid \\\"([^\\\"]*)\\\"$\")\n public void userEntersAnInvalid(String arg0, DataTable args) throws Throwable {\n }", "@Test\n public void testRegisterPatientInvalidCharacter(){\n assertThrows(IllegalArgumentException.class,\n () -> { register.registerPatient(\"Donald\", \"Trump\", \"x0019112345\", \"Doctor Proctor\");});\n }", "@Override\n\tprotected void isValid(String input) throws DataInputException\n\t{\n\t}", "public String getValueOfArg() {\n\t\tif(index > data.length -1) return null;\n\t\t\n\t\twhile(isBlank()) {\n\t\t\tindex ++;\n\t\t}\n\t\t\n\t\tif(data[index] == '\\\"') {\n\t\t\tindex++;\n\t\t\tStringBuilder builder = new StringBuilder();\n\t\t\twhile(index < data.length-1 && data[index] != '\\\"') {\n\t\t\t\tif(data[index] == '\\\\' && isEscape(data, index)) {\t\t\t\t\t\t\n\t\t\t\t\tindex++;\n\t\t\t\t}\n\t\t\t\tbuilder.append(data[index]);\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\treturn builder.toString();\n\t\t}\n\t\t\n\t\tif(Character.isLetter(data[index])){\t\t\n\t\t\treturn textValue();\n\t\t}\n\t\t\n\t\tthrow new IllegalArgumentException(\"Illegal arguments found!\");\n\t}", "public abstract void validate(String value) throws DatatypeException;", "@Test\n\tpublic void test_ReadUtf8String_bad_data() throws IOException {\n\t\tBinaryReader br = br(true, -22, -87, 'A', 0);\n\t\tassertEquals(\"\\ufffdA\" /* unicode replacement char, 'A'*/, br.readUtf8String(0));\n\t}", "@Override\n public void accept(CharSequence charSequence) {\n }", "@Test\r\n public void testInvalidEncodings() {\r\n assertThatInputIsInvalid(\"NIX\");\r\n assertThatInputIsInvalid(\"UTF-9\");\r\n assertThatInputIsInvalid(\"ISO-8859-42\");\r\n }", "public NoLowerAlphaException()\r\n { \r\n super(\"The password must contain at least one lowercase alphabetic character\"); \r\n }", "@Override\n protected boolean isValueIsValid(String value) {\n return false;\n }", "public BinaryFormatException(int charPos, char badChar){\n super(\"Binary numbers consist only of 0's and 1's\");\n this.charPos = charPos;\n this.badChar = badChar;\n }", "@Test(expected = SuperCsvCellProcessorException.class)\n\tpublic void testWithNonString() {\n\t\tprocessor.execute(1234, ANONYMOUS_CSVCONTEXT);\n\t}", "protected void checkCommand(String com) throws IllegalArgumentException {\n if (com.length() != PushCacheProtocol.COMMAND_LEN) {\n throw new IllegalArgumentException(\"Command \\\"\" + com + \"\\\" is wrong length\");\n }\n if (com.charAt(3) != '\\0') {\n throw new IllegalArgumentException(\"Command \\\"\" + com + \"\\\" is not null terminated\");\n }\n }", "@Test(expected=MalformedNumberException.class)\n public void spacesInWeirdPlaces() throws MalformedNumberException {\n new RomanArabicConverter(\"1 4\");\n }", "@Test\n\tpublic void caseNameWithWrongLength() {\n\t\tString caseName = \"le\";\n\t\ttry {\n\t\t\tCaseManagerValidator.isCharAllowed(caseName);\n\t\t\tfail();\n\t\t} catch (ValidationException e) {\n\t\t}\n\t}", "@Test void testHexCharLiteralOutsideRangeFails() {\n final String sql = \"^_unicode'cg'^XCF\";\n final String expected = \"Unknown character set 'unicode'\";\n expr(sql).fails(expected);\n }", "@Test\r\n public void testValidEncodings() {\r\n assertThatInputIsValid(\"\");\r\n assertThatInputIsValid(\"UTF8\");\r\n assertThatInputIsValid(\"UTF-8\");\r\n assertThatInputIsValid(\"CP1252\");\r\n assertThatInputIsValid(\"ISO-8859-1\");\r\n assertThatInputIsValid(\"ISO-8859-5\");\r\n assertThatInputIsValid(\"ISO-8859-9\");\r\n }", "private void valida(String str)throws Exception{\n\t\t\t\n\t\t\tif(str == null || str.trim().isEmpty()){\n\t\t\t\tthrow new Exception(\"Nao eh possivel trabalhar com valores vazios ou null.\");\n\t\t\t}\n\t\t\n\t\t}", "public InvalidHexException(String invalid) {\r\n\t\tsuper(invalid);\r\n\t\tSystem.err.println(\"Invalid input: Hex values can only have characters 0-9 and A-F\");\r\n\t}", "@Test\n public void shouldNotBeAbleToInputSpecialCharactersInTradeInValueField() {\n }", "public void testConstructor_StringString_InvalidReplyCode() {\n try {\n new StaticReplyCommandHandler(-99, \"text\");\n fail(\"Expected AssertFailedException\");\n }\n catch (AssertFailedException expected) {\n LOG.info(\"Expected: \" + expected);\n }\n }", "public void testInvalidTextValueWithBrokenUTF8() throws Exception\n {\n final byte[] input = readResource(\"/data/clusterfuzz-cbor-35979.cbor\");\n try (JsonParser p = MAPPER.createParser(input)) {\n assertToken(JsonToken.VALUE_STRING, p.nextToken());\n p.getText();\n fail(\"Should not pass\");\n } catch (StreamReadException e) {\n verifyException(e, \"Truncated UTF-8 character in Short Unicode Name (36 bytes)\");\n }\n\n }", "static String validate(String username_or_password) {\r\n if (username_or_password.indexOf('\\'') != -1) {\r\n throw new IllegalArgumentException(\"invalid input: \" + username_or_password);\r\n }\r\n return username_or_password;\r\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\tpublic void caseNameWithSpecialChar() {\n\t\tString caseName = \"le@d\";\n\t\ttry {\n\t\t\tCaseManagerValidator.isCharAllowed(caseName);\n\t\t} catch (ValidationException e) {\n\t\t}\n\t}", "private static void validateInputArguments(String args[]) {\n\n\t\tif (args == null || args.length != 2) {\n\t\t\tthrow new InvalidParameterException(\"invalid Parameters\");\n\t\t}\n\n\t\tString dfaFileName = args[DFA_FILE_ARGS_INDEX];\n\t\tif (dfaFileName == null || dfaFileName.trim().isEmpty()) {\n\t\t\tthrow new InvalidParameterException(\"Invalid file name\");\n\t\t}\n\n\t\tString delimiter = args[DELIMITER_SYMBOL_ARGS_INDEX];\n\t\tif (delimiter == null || delimiter.trim().isEmpty()) {\n\t\t\tthrow new InvalidParameterException(\"Invalid delimiter symbol\");\n\t\t}\n\t}", "SpacesInvaders_recupererEspaceJeuDansChaineASCII createSpacesInvaders_recupererEspaceJeuDansChaineASCII();", "public void testCtorStr_Failure2() throws Exception {\n try {\n new RenameConverter(\" \");\n fail(\"IllegalArgumentException is expected.\");\n } catch (IllegalArgumentException e) {\n //success\n }\n }", "@Test(expected = IllegalArgumentException.class)\n\tpublic void whenEmptyStringUsed_ExceptionIsThrown() {\n\t\tString input = \"\";\n\t\tStringUtility stringUtility = new StringUtility();\n\t\tstringUtility.castWordNumberToNumber(input);\n\t}", "@Test\n\tpublic void TestR1NonIntegerParseableChars() {\n\t\tString invalid_solution = \"a74132865635897241812645793126489357598713624743526189259378416467251938381964572\";\n\t\tassertEquals(-1, sv.verify(invalid_solution));\n\t}", "public void testInvalidInput(){\n\t\tString input = \"bye\";\n\t\tString actual = operation.processOperation(input);\n\t\tString expected = \"bye bye could not be performed\";\n\t\tassertEquals(expected,actual);\n\t}", "@Test\n public void input_XX_() throws ValueOutOfBoundsException, MalformedNumberException {\n final RomanArabicConverter rac = new RomanArabicConverter(\"XX\");\n assertEquals(20, rac.toArabic());\n assertEquals(\"XX\", rac.toRoman());\n }", "@Test\n public void selfCheckShouldThrowGivenIllegalCharacters() throws InvalidFrameException {\n BowlingFrame testFrame = new BowlingFrame(\"Z5\".toCharArray());\n Assertions.assertThrows(InvalidFrameException.class, testFrame::selfCheck);\n }", "@Override\n public boolean isUnicode()\n {\n return true;\n }", "@Test\n\tpublic void input_1_() throws ValueOutOfBoundsException, MalformedNumberException\n\t{\n\t\tassertEquals(1, new RomanArabicConverter(\" 1 \").toArabic());\n\t\tassertEquals(\"I\", new RomanArabicConverter(\" 1 \").toRoman());\n\t}", "public void validate() throws ParameterValuesException {\n\t\tif (txtTenTaiSan.getText().isEmpty())\n\t\t\tthrow new ParameterValuesException(\"Bạn cần nhập tên tài sản\", null);\n\t}", "public boolean isAscii()\n { \n for (int i=0; i<val.length(); ++i)\n { \n int c = val.charAt(i);\n if (c > 0x7f) return false;\n }\n return true;\n }", "public FormatException() {\n\t\tsuper(\"This value is not within the standard.\");\n\t}", "public NoDigitException(){\r\n\r\n\t}", "static void validateHeaderName(String headerName) {\n //Check to see if the name is null\n if (headerName == null) {\n throw new NullPointerException(\"Header names cannot be null\");\n }\n //Go through each of the characters in the name\n for (int index = 0; index < headerName.length(); index++) {\n //Actually get the character\n char character = headerName.charAt(index);\n\n //Check to see if the character is not an ASCII character\n if (character > 127) {\n throw new IllegalArgumentException(\n \"Header name cannot contain non-ASCII characters: \" + headerName);\n }\n\n //Check for prohibited characters.\n switch (character) {\n case '\\t':\n case '\\n':\n case 0x0b:\n case '\\f':\n case '\\r':\n case ' ':\n case ',':\n case ';':\n case '=':\n throw new IllegalArgumentException(\n \"Header name cannot contain the following prohibited characters: \"\n + \"=,;: \\\\t\\\\r\\\\n\\\\v\\\\f: \" + headerName);\n default:\n }\n }\n }", "public ArgumentException() {\n super(\"Wrong arguments passed to function\");\n }", "public static boolean isAscii(char ch) {\n/* 403 */ return (ch < '€');\n/* */ }", "@Override\n public void verifyArgs(ArrayList<String> args) throws ArgumentFormatException {\n super.checkNumArgs(args);\n _args = true;\n }", "Data mo12944a(String str) throws IllegalArgumentException;", "@Test\n public void cannotConvertInvalidRomanString() throws IllegalArgumentException {\n String invalidRomanStr = \"mMmCMxciL\";\n\n //then\n exception.expect(IllegalArgumentException.class);\n exception.expectMessage(invalidRomanStr + \" is not a valid roman numeral string\");\n\n //when\n RomanNumberUtil.toDecimal(invalidRomanStr);\n }", "public void testSetText_EmptyText2() throws Exception {\n try {\n textInputBox.setText(\" \\t \\n \");\n fail(\"Expect IllegalArgumentException.\");\n } catch (IllegalArgumentException iae) {\n // expect\n }\n }", "@Test (expected = DataFormatException.class)\n \tpublic void testDelete_NegativeInvalidCredit() throws DataFormatException {\n \t\tSystem.out.println(\"DeleteTest 8: Tests constructor's ability to catch and reject credit amount values less than zero or have invalid (i.e.minus,-) characters...\");\n\t\tString line = \"manager AA -00099.99\";\n \t\tDelete test = new Delete( line);\n \t}", "public synchronized boolean validate(Object data) {\n if (!(data instanceof String)) {\n return false;\n }\n\n String dataString = (String) data;\n dataString = dataString.replaceAll(\"\\\\s\", \"\").replaceAll(\"-\", \"\");\n if (dataString.length() != 6) {\n return false;\n }\n\n for (Character c : dataString.substring(0, 2).toCharArray()) {\n if (!Character.isLetter(c)) {\n return false;\n }\n }\n for (Character c : dataString.substring(3, 5).toCharArray()) {\n if (!Character.isDigit(c)) {\n return false;\n }\n }\n return true;\n }", "@Test(expected = InvalidCommandException.class)\n public void testInvalidCommand() {\n interpreterInstance.interpret(\"notacommand argumentshere\");\n }", "@Test\n public void containsIllegalCharacters() {\n assertTrue(Deadline.containsIllegalCharacters(INVALID_DEADLINE_ILLEGAL_CHAR_DAY.toString()));\n\n // Deadline contains illegal character in Month -> true\n assertTrue(Deadline.containsIllegalCharacters(INVALID_DEADLINE_ILLEGAL_CHAR_MONTH.toString()));\n\n // Deadline contains illegal character in Year -> true\n assertTrue(Deadline.containsIllegalCharacters(INVALID_DEADLINE_ILLEGAL_CHAR_YEAR.toString()));\n\n // No illegal character -> false\n assertFalse(Deadline.containsIllegalCharacters(VALID_1ST_JAN_2018.toString()));\n assertFalse(Deadline.containsIllegalCharacters(VALID_1ST_JAN_WITHOUT_YEAR.toString()));\n }", "@Override\n public void validateSequenceData(char[] sequence, int dnaLength) {\n if (sequence.length != dnaLength) {\n throw new DnaStructureException(\n String.format(config.getErrorMessages().get(ErrorType.SEQ_LENGTH_INVALID.name())\n , Arrays.toString(sequence), sequence.length, dnaLength)\n );\n }\n\n String exp = config.getExpDnaContentValid();\n var pat = Pattern.compile(exp);\n var matcher = pat.matcher(String.valueOf(sequence));\n if (!matcher.matches()) {\n throw new DnaStructureException(\n String.format(config.getErrorMessages().get(ErrorType.SEQ_CONTENT_INVALID.name())\n , Arrays.toString(sequence)));\n }\n\n }", "public void testConstructor_String_InvalidReplyCode() {\n try {\n new StaticReplyCommandHandler(-1);\n fail(\"Expected AssertFailedException\");\n }\n catch (AssertFailedException expected) {\n LOG.info(\"Expected: \" + expected);\n }\n }", "public abstract ValidationResults validArguments(String[] arguments);", "private String makeIllegalArgumentExceptionMessage(Object owner, String methodName, Object argument) {\n\n StringBuilder builder = new StringBuilder();\n\n String message = errorMessagePreamble(owner, methodName, argument);\n builder.append(message);\n\n builder.append(\" should have worked but did not. Please contact the tech team and tell it to change the jvm.\");\n\n return builder.toString();\n }", "@Test\n public void parse_invalidArgs_throwsParseException() {\n assertParseFailure(parser, INVALID_ARG, String.format(MESSAGE_INVALID_COMMAND_FORMAT,\n SortCommand.MESSAGE_USAGE));\n }", "@Test\n\tpublic final void testAcute() \n\t\t\tthrows ParserConfigurationException, IOException, SAXException \n\t{\n\t\t// all vowels - lower case (with acute)\n\t\tassertSingleResult(\"1391080\", fldName, \"contemporánea\");\n\t\tassertSingleResult(\"2442876\", fldName, \"piétons\");\n\t\tassertSingleResult(\"1391080\", fldName, \"José María\");\n\t\tassertSingleResult(\"1391080\", fldName, \"Gijón\");\n\t\tassertSingleResult(\"1391080\", fldName, \"jesús.\");\n\t\t// plain text\n\t\tassertSingleResult(\"1391080\", fldName, \"contemporanea\");\n\t\tassertSingleResult(\"2442876\", fldName, \"pietons\");\n\t\tassertSingleResult(\"1391080\", fldName, \"Jose Maria\");\n\t\tassertSingleResult(\"1391080\", fldName, \"Gijon\");\n\t\tassertSingleResult(\"1391080\", fldName, \"jesus.\");\n\t\t// test multiple variations\n\t\tassertSingleResult(\"1391080\", fldName, \"José Maria\");\n\t\tassertSingleResult(\"1391080\", fldName, \"Jose María\");\n\n\t\tassertSingleResult(\"1391080\", fldName, \"Gijón jesús\");\n\t\tassertSingleResult(\"1391080\", fldName, \"Gijón jesus\");\n\t\tassertSingleResult(\"1391080\", fldName, \"Gijon jesús\");\n\t\tassertSingleResult(\"1391080\", fldName, \"Gijon jesus\");\n\t}", "@When(\"^user enters valid \\\"([^\\\"]*)\\\"$\")\n public void userEntersValid(String arg0) throws Throwable {\n }", "@Test (expected = DataFormatException.class)\n \tpublic void testDelete_InvalidUsername() throws DataFormatException {\n \t\tSystem.out.println(\"DeleteTest 3: Test if a Delete transaction rejects object construction of invalid username field values...\");\n \t\tString line = \"m@nag&r AA 001000.00\";\n \t\tDelete test = new Delete( line);\n \t}", "@Override\n protected void validate()\n throws CommandException, CommandValidationException {\n super.validate();\n String pp = getOption(\"printprompt\");\n if (pp != null)\n printPrompt = Boolean.parseBoolean(pp);\n else\n printPrompt = programOpts.isInteractive();\n encoding = getOption(\"encoding\");\n String fname = getOption(\"file\");\n if (fname != null)\n file = new File(fname);\n }", "public static void expectAscii(ByteReader r, char... expected) {\n\t\tfor (int i = 0; i < expected.length; i++) {\n\t\t\tchar c = (char) r.readUbyte();\n\t\t\tif (c == expected[i]) continue;\n\t\t\tthrow exceptionf(\"Expected '%s': '%s'\", escape(expected[i]), escape(c));\n\t\t}\n\t}", "@Override\n protected PacketArgs.ArgumentType[] getArgumentTypes() {\n return new PacketArgs.ArgumentType[] { PacketArgs.ArgumentType.String };\n }", "private C0054e m186a(CharSequence charSequence, RuntimeException runtimeException) {\n String obj;\n if (charSequence.length() > 64) {\n obj = charSequence.subSequence(0, 64).toString() + \"...\";\n } else {\n obj = charSequence.toString();\n }\n return new C0054e(\"Text '\" + obj + \"' could not be parsed: \" + runtimeException.getMessage(), charSequence, 0, runtimeException);\n }", "@Test\n\t\t\tpublic void checkAlphanumeric() {\n\t\t\t\tMessage msgjunit = new Message();\n\t\t\t\tString msg = msgjunit.getMessage();\n\n\t\t\t\tif (msg != null) {\n\t\t\t\t\tmsg = msg;\n\t\t\t\t} else {\n\t\t\t\t\tmsg = \"This is a message\";\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tInteger.parseInt(msg);\n\t\t\t\t\tSystem.out.println(\"Message is a not string:\" + \" \" + msg );\n\t\t\t\t} catch (NumberFormatException e) {\n\t\t\t\t\tSystem.out.println(\"Message is a string:\" + \" \" + msg);\n\t\t\t\t}\n\t\t\t}", "public TipoCaracteresException() {\n\t\tsuper(\"Los campos 'nombre' y ' apellido' solo pueden contener letras\");\n\t}", "@Test\n public void when_SourceHasInvalidFormat_Then_ThrowException() {\n //then\n assertThrows(IllegalArgumentException.class, () -> {\n //when\n underTest.read(\"FhFXVE,,,\");\n });\n }", "public NoUpperAlphaException() {\r\n\t\tsuper(\"The password must contain at least one uppercase alphabetic character.\");\r\n\t}", "public void testCtorStr_Failure1() throws Exception {\n try {\n new RenameConverter(null);\n fail(\"IllegalArgumentException is expected.\");\n } catch (IllegalArgumentException e) {\n //success\n }\n }", "@Test (expected = DataFormatException.class)\n \tpublic void testDelete_InvalidCredit() throws DataFormatException {\n \t\tSystem.out.println(\"DeleteTest 6: Test if a Delete transaction rejects object construction if credit amount has invalid characters (not numeric)...\");\n \t\tString line = \"manager AA invalid(.0\";\n \t\tDelete test = new Delete( line);\n \t}", "@Test(expected = IllegalArgumentException.class)\n\tpublic void criaContatoNomeInvalido() {\n\t\tcontato = new Contato(\"\", \"Jardely\", \"984653722\");\n\t}", "public void testCheckString_EmptyArg() {\n try {\n Util.checkString(\" \", \"Test\");\n\n fail(\"IllegalArgumentException expected.\");\n } catch (IllegalArgumentException iae) {\n //good\n }\n }", "public void testCheckString_EmptyArg() {\n try {\n Util.checkString(\" \", \"Test\");\n\n fail(\"IllegalArgumentException expected.\");\n } catch (IllegalArgumentException iae) {\n //good\n }\n }", "@Test(expected=IllegalArgumentException.class)\n\tpublic void testcontainsUniqueCharsNaiveNullString() {\n\t\tQuestion11.containsUniqueCharsNaive(null);\n\t}", "public void setNChar()\n/* */ {\n/* 1168 */ this.isNChar = true;\n/* */ }", "@Test(expectedExceptions=NumberFormatException.class)\r\n\tpublic void chkNumberFrmtExcep(){\r\n\t\tString x=\"100A\";\r\n\t\tint f=Integer.parseInt(x);//it will throw exception bcoz x=100A, if it is 100 it will not throw exception\r\n\t}", "private static String getArgumentString(Object arg) {\n if (arg instanceof String) {\n return \"\\\\\\\"\"+arg+\"\\\\\\\"\";\n }\n else return arg.toString();\n }", "public static void expectAscii(ByteReader r, String expected) {\n\t\tfor (int i = 0; i < expected.length(); i++) {\n\t\t\tchar c = (char) r.readUbyte();\n\t\t\tif (c == expected.charAt(i)) continue;\n\t\t\tthrow exceptionf(\"Expected '%s': '%s'\", escape(expected.charAt(i)), escape(c));\n\t\t}\n\t}", "private XMLParseException expectedInput(String charSet,\n int lineNr) {\n String msg = \"Expected: \" + charSet;\n return new XMLParseException(this.getTagName(), lineNr, msg);\n }", "private\n static\n boolean\n isHexChar( char ch )\n {\n return ( ch >= '0' && ch <= '9' ) ||\n ( ch >= 'a' && ch <= 'f' ) ||\n ( ch >= 'A' && ch <= 'F' );\n }", "public ArgumentChecker(String word) {\n\n if (word.isEmpty() || word == null) {\n throw new IllegalArgumentException();\n }\n }", "public DataDiFineTirocinioNonValidaException(String messaggio) {\r\n super(messaggio);\r\n }", "@Test (expected=MalformedNumberException.class)\n\tpublic void inputIIII() throws MalformedNumberException\n\t{\n\t\tnew RomanArabicConverter(\"IIII\");\n\t}", "@Test\n public void parse_invalidValueFollowedByValidValue_success() {\n Index targetIndex = INDEX_FIRST;\n String userInput = targetIndex.getOneBased() + INVALID_PHONE_DESC + PHONE_DESC_BOB;\n OrderDescriptor descriptor = new OrderDescriptorBuilder().withClientPhone(VALID_PHONE_BOB).build();\n EditOrderCommand expectedCommand = new EditOrderCommand(targetIndex, descriptor);\n assertParseSuccess(parser, userInput, expectedCommand);\n\n // other valid values specified\n userInput = targetIndex.getOneBased() + RECIPE_NAME_DESC_LAKSA + INVALID_PHONE_DESC + ADDRESS_DESC_BOB\n + PHONE_DESC_BOB;\n descriptor = new OrderDescriptorBuilder().withClientPhone(VALID_PHONE_BOB)\n .withClientAddress(VALID_ADDRESS_BOB).withRecipeName(VALID_RECIPE_NAME_LAKSA).build();\n expectedCommand = new EditOrderCommand(targetIndex, descriptor);\n assertParseSuccess(parser, userInput, expectedCommand);\n }", "@Override\n public void setCharacterEncoding(String arg0) {\n\n }", "Alphabet(String chars) {\n _chars = sanitizeChars(chars);\n }", "@Override\n public String getInputArg(String argName) {\n Log.w(TAG, \"Test input args is not supported.\");\n return null;\n }", "public static boolean checkInputAlert(String saInput) throws Exception {\r\n\t\tboolean bool = checkInput(saInput);\r\n\r\n\t\tif (! bool) {\r\n\t\t\tStringBuffer sb = new StringBuffer(\"Hazardous characters found in the input: \");\r\n\t\t\tsb.append(\"\\\"\").append(HansFilter.alter(saInput)).append(\"\\\"\");\r\n\r\n\t\t\tthrow new Exception(sb.toString());\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}", "@Test\n public void parse_emptyInvalidArgs_throwsParseException() {\n assertParseFailure(parser, ParserUtil.EMPTY_STRING, String.format(MESSAGE_INVALID_COMMAND_FORMAT,\n SortCommand.MESSAGE_USAGE));\n }", "@Test(expected = IllegalArgumentException.class)\n\tpublic void whenNullStringUsed_ExceptionIsThrown() {\n\t\tString input = null;\n\t\tStringUtility stringUtility = new StringUtility();\n\t\tstringUtility.castWordNumberToNumber(input);\n\t}", "@Override\n\t\tpublic boolean isInvalid() {\n\t\t\treturn false;\n\t\t}", "public static String getAsciiEncodedValue(String argString) {\n\t\tStringBuilder buffer = new StringBuilder();\n\t\tbuffer.append(\"<!\");\n\t\tfor (int i = 0; i < argString.length(); i++) {\n\t\t\tchar c = argString.charAt(i);\n\t\t\tbuffer.append(\"\" + (int) c);\n\t\t\tif (i != argString.length() - 1) {\n\t\t\t\tbuffer.append(\"+\");\n\t\t\t}\n\t\t}\n\t\tbuffer.append(\">\");\n\t\treturn buffer.toString();\n\t}", "private static boolean c(char paramChar)\r\n/* 680: */ {\r\n/* 681:674 */ return ((paramChar >= '0') && (paramChar <= '9')) || ((paramChar >= 'a') && (paramChar <= 'f')) || ((paramChar >= 'A') && (paramChar <= 'F'));\r\n/* 682: */ }", "@Test\n public void input_C_() throws ValueOutOfBoundsException, MalformedNumberException {\n final RomanArabicConverter rac = new RomanArabicConverter(\"C\");\n assertEquals(100, rac.toArabic());\n assertEquals(\"C\", rac.toRoman());\n }", "@Test(timeout = 4000)\n public void test127() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.parseColumnTypeAndSize(\"CONSTRAINT 4O)ZgZ_/TD! PRIMARY KEY ()\");\n fail(\"Expecting exception: NumberFormatException\");\n \n } catch(NumberFormatException e) {\n //\n // For input string: \\\"\\\"\n //\n verifyException(\"java.lang.NumberFormatException\", e);\n }\n }", "@Override\r\n\tpublic boolean validate(String num) {\n\t\treturn false;\r\n\t}", "@Test (expected = DataFormatException.class)\n \tpublic void testDelete_InvalidUserType() throws DataFormatException {\n \t\tSystem.out.println(\"DeleteTest 5: Test if a Delete transaction rejects object construction of invalid usertype field values...\");\n \t\tString line = \"manager ZZ 001000.00\";\n \t\tDelete test = new Delete( line);\n \t}" ]
[ "0.64014035", "0.63028437", "0.60218924", "0.58866143", "0.57993466", "0.5702348", "0.5698222", "0.568233", "0.56799346", "0.5618695", "0.559138", "0.5577724", "0.5574811", "0.55736667", "0.5570225", "0.5540809", "0.55382776", "0.55354834", "0.55248225", "0.5512903", "0.55007964", "0.5491831", "0.5488414", "0.5481742", "0.5458264", "0.5451959", "0.5439085", "0.5436586", "0.54296124", "0.54232955", "0.54227936", "0.54169995", "0.5373862", "0.5358695", "0.53540295", "0.5352707", "0.5332035", "0.5331058", "0.53310424", "0.53307545", "0.53304845", "0.53258944", "0.5320898", "0.53039855", "0.52979255", "0.5296361", "0.5289419", "0.5277341", "0.5270716", "0.52630436", "0.5261715", "0.524749", "0.5242663", "0.52322334", "0.5228372", "0.5226784", "0.52217966", "0.52176756", "0.5214649", "0.52144355", "0.52117354", "0.5204198", "0.5201117", "0.5200421", "0.5198771", "0.519308", "0.51921743", "0.5189401", "0.5184563", "0.51737916", "0.5173581", "0.5172674", "0.5171693", "0.51673883", "0.5166739", "0.5166739", "0.5166206", "0.5165507", "0.5162655", "0.51566017", "0.51486623", "0.51393336", "0.5134933", "0.5134099", "0.51312286", "0.5126546", "0.5122862", "0.51224834", "0.51219404", "0.51215076", "0.5116386", "0.5113274", "0.510265", "0.5100012", "0.5097368", "0.50956404", "0.5095233", "0.50914615", "0.5088643", "0.50821483" ]
0.7770911
0
Das is ganz lustig... ein string is in C immer "nullTerminiert". Das heisst, dass er (um das ende ueberhaupt erkennen zu koennen) am ende des strings noch einen zusaetzlichen 'nullByte' char hat. Den wuerde ich gerne hier auch mit reinmachen, da ich dann im controller mit String bibliotheken arbeiten kann.
private byte[] stringToArrayOfByte(String string) throws NumberFormatException { byte[] bytes = new byte[string.length() + 1]; for (int i = 0; i < string.length(); i++) { bytes[i] = charToByte(string.charAt(i)); } bytes[string.length()] = nullByte; return bytes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String nullConv(String value){\r\n\t\tif(value==null){\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\t\treturn value;\r\n\t}", "private static String null2unknown(String in) {\r\n\t\tif (in == null || in.length() == 0) {\r\n\t\t\treturn null;\r\n\t\t} else {\r\n\t\t\treturn in;\r\n\t\t}\r\n\t}", "@Override\n public String createString() {\n return null;\n }", "String getDefaultNull();", "private String parseNull () {\r\n \r\n assert iMessage!=null;\r\n assert iIndex>=0;\r\n assert iIndex<=iMessage.length();\r\n\r\n char chr=next();//get next character\r\n assert chr=='n';//assert correct first character\r\n skip(3);//skip to end of null token\r\n \r\n return \"null\";//return string representation of null\r\n \r\n }", "public String NullSave()\n {\n return \"null\";\n }", "protected String compString() {\n\t\treturn null;\n\t}", "private String getStringOrNull (String value) {\n if (value == null || value.isEmpty()) value = null;\n return value;\n }", "private void serializeNull(final StringBuffer buffer)\n {\n buffer.append(\"N;\");\n }", "private static String readNullPaddedString(ByteBuffer data, int length) {\n byte[] bytes = new byte[length];\n data.get(bytes);\n int stringLength = bytes.length - 1;\n while (stringLength > 0 && bytes[stringLength] == 0) {\n stringLength--;\n }\n return new String(bytes, 0, stringLength+1, Charset.forName(\"utf-8\"));\n }", "public static String formatNull() {\n\t\treturn \"null\";\n\t}", "@Override\r\n\tpublic String encode() {\n\t\treturn null;\r\n\t}", "public static String fromNullToEmtpyString(String a) {\r\n\t\tif (a == null) {\r\n\t\t\treturn \"\";\r\n\t\t} else {\r\n\t\t\treturn a;\r\n\t\t}\r\n\t}", "public static String dispNull (String input) {\n //because of short circuiting, if it's null, it never checks the length.\n if (input == null || input.length() == 0)\n return \"N/A\";\n else\n return input;\n }", "PTString() \n {\n _str = \"\";\n }", "private String composeCharacterString(String string) {\n return null;\r\n }", "private String getString() {\n\t\treturn null;\n\t}", "@Override\n\tpublic Object visit(StringNode stringNode) {\n\treturn null; }", "public static String dispNull (String input) {\n //because of short circuiting, if it's null, it never checks the length.\n if (input == null || input.length() == 0)\n return \"N/A\";\n else\n return input;\n }", "public static String dispNull (String input) {\n //because of short circuiting, if it's null, it never checks the length.\n if (input == null || input.length() == 0)\n return \"N/A\";\n else\n return input;\n }", "@Test\n\tpublic void testNullString() {\n\t\tString s = null;\n\t\tassertTrue(\"Null string\", StringUtil.isEmpty(s));\n\t}", "private String notNull(String value) {\n return value != null ? value : \"\";\n }", "@Override\n\tpublic Object revert(Object o) {\n\t\tif(o != null) {\n\t\t\treturn new String((char[])o);\n\t\t}\n\t\treturn null;\n\t}", "private final String m43294b(String str) {\n return str != null ? str : ManagerWebServices.PARAM_TEXT;\n }", "@Override\n public String getCharacterEncoding() {\n return null;\n }", "public static String nullToEmpty(String string)\r\n {\r\n return (string == null)?\"\":string;\r\n }", "@Test(timeout = 4000)\n public void test068() throws Throwable {\n String string0 = JSONObject.quote(\"e(h'R;/n&72HYkju\");\n assertEquals(\"\\\"e(h'R;/n&72HYkju\\\"\", string0);\n \n Object object0 = JSONObject.NULL;\n String string1 = JSONObject.valueToString(object0);\n assertEquals(\"null\", string1);\n }", "@Test\n\tpublic void caseNameWithNull() {\n\t\tString caseName = \"null\";\n\t\ttry {\n\t\t\tStringNumberUtil.stringUtil(caseName);\n\t\t\tfail();\n\t\t} catch (StringException e) {\n\n\t\t}\n\t}", "String nullStrToSpc(Object obj) {\n String spcStr = \"\";\n\n if (obj == null) {\n return spcStr;\n } else {\n return obj.toString();\n }\n }", "private String getNullValueText() {\n return getNull();\n }", "public static String checkNull(String string1) {\n if (string1 != null)\n return string1;\n else\n return \"\";\n }", "public static String nullToEmpty ( final String n )\n {\n return null == n ? \"\" : n;\n }", "public static String displayNull (String input)\r\n {\r\n //because of short circuiting, if it's null, it never checks the length.\r\n if (input == null || input.length() == 0)\r\n return \"N/A\";\r\n else\r\n return input;\r\n }", "@Override\n\tpublic function initFromString(String s) {\n\t\treturn null;\n\t}", "@Test\n\tvoid testCheckString4() {\n\t\tassertFalse(DataChecker.checkString((String)null));\n\t}", "public static String removeNullString(String value) {\r\n if(value == null) {\r\n value = NULL_STRING_INDICATOR;\r\n }\r\n\r\n /*else\r\n if(value.trim().equals(\"\")) {\r\n value = EMPTY_STRING_INDICATOR;\r\n }*/\r\n return value;\r\n }", "String toString(String value) {\n value = value.trim();\n if (\".\".equals(value)) value = \"\";\n if (\"n/a\".equals(value)) value = \"\";\n return (!\"\".equals(value) ? value : Tables.CHARNULL);\n }", "public static String convertNullToBlank(String s) {\n \tif(s==null) return \"\";\n \treturn s;\n }", "public FastString() {\n this(\"\");\n }", "@Override\r\n\t\t\tpublic String toExibir() {\n\t\t\t\treturn null;\r\n\t\t\t}", "@Override\n public String asText() {\n return null;\n }", "public PyShadowString() {\n\t\tthis(Py.EmptyString, Py.EmptyString);\n\t}", "public void testCheckNull() {\n Util.checkNull(\" \", \"test\");\n }", "private String getString(byte c) {\n\t\treturn c==1? \"$ \": \" \";\n\t}", "public void setNChar()\n/* */ {\n/* 1168 */ this.isNChar = true;\n/* */ }", "@Test(expected = NullPointerException.class)\n\tpublic void testNull() {\n\n\t\tString str = null;\n\t\tstr.toUpperCase();\n\t}", "public String encodeByte(byte[] raw) {\n\t\treturn null;\n\t}", "@Test(timeout = 4000)\n public void test039() throws Throwable {\n String string0 = JSONObject.valueToString((Object) null);\n assertEquals(\"null\", string0);\n }", "@Override\n\tpublic String getCharacterEncoding() {\n\t\treturn null;\n\t}", "@Override\n\tpublic Object valueOf(String arg0) {\n\t\treturn null;\n\t}", "@Override\n\tpublic xNSString javaMethodBaseWithNSStringRet() {\n\t\treturn null;\n\t}", "@Override\n\tpublic String display() {\n\t\treturn \"null\";\n\t}", "private static String addNull(String bitDisk) {\n\t\tbitDisk = \"0\" + bitDisk;\n\t\treturn bitDisk;\n\t}", "public static String toString(Object obj, String nullStr) {\n return obj == null ? nullStr : obj.toString();\n }", "@Override\n public String visit(CharLiteralExpr n, Object arg) {\n return null;\n }", "@NotNull\n String toNbtString();", "public String getString_data() { \n char carr[] = new char[Math.min(net.tinyos.message.Message.MAX_CONVERTED_STRING_LENGTH,60)];\n int i;\n for (i = 0; i < carr.length; i++) {\n if ((char)getElement_data(i) == (char)0) break;\n carr[i] = (char)getElement_data(i);\n }\n return new String(carr,0,i);\n }", "public static String convertNULLtoString(Object object) {\n return object == null ? EMPTY : object.toString();\n }", "@Test(expected=IllegalArgumentException.class)\n\tpublic void testContainsUniqueChars2NullString() {\n\t\tQuestion11.containsUniqueChars2(null);\n\t}", "private final void _writeNull()\n/* */ throws IOException\n/* */ {\n/* 1610 */ if (this._outputTail + 4 >= this._outputEnd) {\n/* 1611 */ _flushBuffer();\n/* */ }\n/* 1613 */ int ptr = this._outputTail;\n/* 1614 */ char[] buf = this._outputBuffer;\n/* 1615 */ buf[ptr] = 'n';\n/* 1616 */ buf[(++ptr)] = 'u';\n/* 1617 */ buf[(++ptr)] = 'l';\n/* 1618 */ buf[(++ptr)] = 'l';\n/* 1619 */ this._outputTail = (ptr + 1);\n/* */ }", "@Test(expected=IllegalArgumentException.class)\n\tpublic void testcontainsUniqueCharsNaiveNullString() {\n\t\tQuestion11.containsUniqueCharsNaive(null);\n\t}", "@Test\n public void testReplacingEmptyString()\n {\n String expectedValue=null,actualValue;\n actualValue=replaceingchar.replaceChar(\" \");\n assertEquals(expectedValue,actualValue);\n }", "public void testNull () throws IOException\n {\n Stream stream;\n\n stream = new Stream (null);\n assertTrue (\"erroneous character\", -1 == stream.read ());\n }", "public String notNull(String text)\n {\n return text == null ? \"\" : text;\n }", "public static String mapEmptyToNull(String strIn)\r\n {\r\n if (strIn == null || strIn.trim().equals(\"\"))\r\n {\r\n return null;\r\n }\r\n return strIn;\r\n }", "@Override\n public String encodeURL(String arg0) {\n return null;\n }", "@Override\n\t\tprotected String[] handleIrregulars(String s) {\n\t\t\treturn null;\n\t\t}", "@Test(timeout = 4000)\n public void test008() throws Throwable {\n String string0 = SQLUtil.renderValue((Object) null);\n assertEquals(\"null\", string0);\n }", "public static String nullToBlank(Object texto) {\n try {\n if (texto == null) {\n return \"\";\n }\n if (texto.toString().trim().equals(\"null\")) {\n return \"\";\n }\n return texto.toString().trim();\n } catch (Exception e) {\n return \"\";\n }\n\n }", "@Impure\n public abstract void encodeNull(int typeCode) throws DatabaseException;", "public String checkNull(String result) {\r\n\t\tif (result == null || result.equals(\"null\")) {\r\n\t\t\treturn \"\";\r\n\t\t} else {\r\n\t\t\treturn result;\r\n\t\t}\r\n\t}", "public static String emptyToNull(String string)\r\n {\r\n return TextUtil.isEmpty(string)?null:string;\r\n }", "public T caseString(sensorDeploymentLanguage.String object) {\n\t\treturn null;\n\t}", "@Test\n public void testWithNullString() throws org.nfunk.jep.ParseException\n {\n String string = null;\n Stack<Object> parameters = CollectionsUtils.newParametersStack(string);\n function.run(parameters);\n assertEquals(TRUE, parameters.pop());\n }", "@Override\n\t\tpublic String getCharacterEncoding() {\n\t\t\treturn null;\n\t\t}", "@Override\n public String getRequestString() {\n return null;\n }", "public static String nullSafeToString(Object obj) {\r\n if (obj == null) {\r\n return NULL_STRING;\r\n }\r\n if (obj instanceof String) {\r\n return (String) obj;\r\n }\r\n if (obj instanceof Object[]) {\r\n return nullSafeToString((Object[]) obj);\r\n }\r\n if (obj instanceof boolean[]) {\r\n return nullSafeToString((boolean[]) obj);\r\n }\r\n if (obj instanceof byte[]) {\r\n return nullSafeToString((byte[]) obj);\r\n }\r\n if (obj instanceof char[]) {\r\n return nullSafeToString((char[]) obj);\r\n }\r\n if (obj instanceof double[]) {\r\n return nullSafeToString((double[]) obj);\r\n }\r\n if (obj instanceof float[]) {\r\n return nullSafeToString((float[]) obj);\r\n }\r\n if (obj instanceof int[]) {\r\n return nullSafeToString((int[]) obj);\r\n }\r\n if (obj instanceof long[]) {\r\n return nullSafeToString((long[]) obj);\r\n }\r\n if (obj instanceof short[]) {\r\n return nullSafeToString((short[]) obj);\r\n }\r\n String str = obj.toString();\r\n return (str != null ? str : EMPTY_STRING);\r\n }", "public final String nullSafeGetString(final JSONObject data, final String key) {\n if ( data.get(key) != null ) {\n return data.get(key).toString();\n } else {\n return \"null\";\n }\n }", "public void testGetNullValue() {\n ValueString vs = new ValueString();\n\n assertNull(vs.getString());\n assertEquals(0.0D, vs.getNumber(), 0.0D);\n assertNull(vs.getDate());\n assertEquals(false, vs.getBoolean());\n assertEquals(0, vs.getInteger());\n assertEquals(null, vs.getBigNumber());\n assertNull(vs.getSerializable());\n }", "@Override\r\n\tpublic Buffer setString(int pos, String str, String enc) {\n\t\treturn null;\r\n\t}", "public NullStringEditor () {\n super();\n editable = true;\n }", "@Override\n\tprotected String wavRegleJeu() {\n\t\treturn null;\n\t}", "private static String valueOf(Object str3Sg) {\n\t\treturn null;\r\n\t}", "@Test\n public void testBuildRequiredStringWithGoodUtf8() throws Exception {\n assertThat(StringWrapper.newBuilder().setReqBytes(UTF8_BYTE_STRING).getReq())\n .isEqualTo(UTF8_BYTE_STRING_TEXT);\n }", "@Test\n void nullTest() {\n assertNull(sFloat1.toScrabbleInt());\n assertNull(sFloat1.and(sFloat2));\n assertNull(sFloat1.or(sFloat2));\n assertNull(sFloat1.toScrabbleBool());\n assertNull(sFloat1.toScrabbleBinary());\n assertNull(sFloat1.addToString(new ScrabbleString(\"Hello World\")));\n }", "protected StringValue() {\r\n value = \"\";\r\n typeLabel = BuiltInAtomicType.STRING;\r\n }", "@Test\n public void nonNullString() {\n }", "@Test\n\tpublic void testNullToTerm() {\n\t\tassertTrue(JAVA_NULL.termEquals(jpc.toTerm(null)));\n\t}", "@Override\n @SuppressWarnings(\"all\")\n public String encodeUrl(String arg0) {\n\n return null;\n }", "public String mo9242az() {\n return null;\n }", "public static String nullToZero(String s)\n {\n if(s == null || s.equals(\"null\") || s.trim().length() == 0)\n {\n return \"0\";\n }\n else\n {\n return s;\n }\n }", "public static String checkNull(String string1, String string2) {\n if (string1 != null)\n return string1;\n else if (string2 != null)\n return string2;\n else\n return \"\";\n }", "String getString();", "String getString();", "String getString();", "@Override\n\tpublic String readScalarString() throws IOException {\n\t\treturn null;\n\t}", "public static String checkString(String s) {\n if(s==null || s.length()==0) return null;\n return s;\n }", "public void testSetString() {\n ValueString vs = new ValueString();\n\n vs.setString(null);\n assertNull(vs.getString());\n vs.setString(\"\");\n assertEquals(\"\", vs.getString());\n vs.setString(\"Boden\");\n assertEquals(\"Boden\", vs.getString());\n }", "@Test\n public void nonNullStringPass() {\n }", "@Test\n void trim_null() {\n assertNull(stringUtil.trim(null));\n }", "@Override\n\tpublic String toMessageString() {\n\t\treturn null;\n\t}" ]
[ "0.6426544", "0.6399083", "0.6396247", "0.6388711", "0.63877285", "0.63432366", "0.6221849", "0.6218666", "0.6202424", "0.61830676", "0.61707044", "0.6160131", "0.6140281", "0.61306787", "0.60799474", "0.607393", "0.6070768", "0.6068335", "0.60597813", "0.60597813", "0.6031565", "0.60226727", "0.60164714", "0.5996755", "0.596416", "0.5957367", "0.59498864", "0.5913272", "0.5908579", "0.5857905", "0.585785", "0.58570385", "0.5847067", "0.5845929", "0.58376604", "0.5822472", "0.58150095", "0.5802525", "0.579532", "0.5755283", "0.57312495", "0.5731215", "0.56918883", "0.56909806", "0.5687974", "0.56865484", "0.56781495", "0.5676272", "0.56684625", "0.56679666", "0.56677014", "0.5645763", "0.564541", "0.5619036", "0.5616259", "0.56108975", "0.56095296", "0.56031245", "0.5600199", "0.55979025", "0.5589319", "0.5588223", "0.5576905", "0.5565313", "0.55628085", "0.5560567", "0.55588365", "0.5546536", "0.5543369", "0.55415225", "0.55385035", "0.5537333", "0.55287296", "0.5527357", "0.55263466", "0.552366", "0.55141515", "0.5513667", "0.55042005", "0.5491674", "0.5490395", "0.5477662", "0.5475409", "0.54695535", "0.5467084", "0.54545605", "0.5451244", "0.5448123", "0.54423565", "0.5440854", "0.5436866", "0.5435943", "0.5427703", "0.5427703", "0.5427703", "0.5425516", "0.54240614", "0.54132164", "0.54123974", "0.54118437", "0.5410396" ]
0.0
-1
TODO: Warning this method won't work in the case the id fields are not set
@Override public boolean equals(Object object) { if (!(object instanceof Ficha)) { return false; } Ficha other = (Ficha) object; if ((this.nidFicha == null && other.nidFicha != null) || (this.nidFicha != null && !this.nidFicha.equals(other.nidFicha))) { return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setId(Integer id) { this.id = id; }", "private Integer getId() { return this.id; }", "public void setId(int id){ this.id = id; }", "public void setId(Long id) {this.id = id;}", "public void setId(Long id) {this.id = id;}", "public void setID(String idIn) {this.id = idIn;}", "public void setId(int id) { this.id = id; }", "public void setId(int id) { this.id = id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public void setId(long id) { this.id = id; }", "public void setId(long id) { this.id = id; }", "public int getId(){ return id; }", "public int getId() {return id;}", "public int getId() {return Id;}", "public int getId(){return id;}", "public void setId(long id) {\n id_ = id;\n }", "private int getId() {\r\n\t\treturn id;\r\n\t}", "public Integer getId(){return id;}", "public int id() {return id;}", "public long getId(){return this.id;}", "public int getId(){\r\n return this.id;\r\n }", "@Override public String getID() { return id;}", "public Long id() { return this.id; }", "public Integer getId() { return id; }", "@Override\n\tpublic Integer getId() {\n return id;\n }", "@Override\n public Long getId () {\n return id;\n }", "@Override\n public long getId() {\n return id;\n }", "public Long getId() {return id;}", "public Long getId() {return id;}", "public String getId(){return id;}", "@Override\r\n\tpublic Long getId() {\n\t\treturn null;\r\n\t}", "public Integer getId() { return this.id; }", "@Override\r\n public int getId() {\n return id;\r\n }", "@Override\n\t\tpublic long getId() {\n\t\t\treturn 0;\n\t\t}", "public int getId() {\n return id;\n }", "public long getId() { return _id; }", "public int getId() {\n/* 35 */ return this.id;\n/* */ }", "public long getId() { return id; }", "public long getId() { return id; }", "public void setId(Long id) \n {\n this.id = id;\n }", "@Override\n\tpublic Long getId() {\n\t\treturn null;\n\t}", "@Override\n\tpublic Long getId() {\n\t\treturn null;\n\t}", "public void setId(String id) {\n this.id = id;\n }", "@Override\n\tpublic void setId(Long id) {\n\t}", "public Long getId() {\n return id;\n }", "public long getId() { return this.id; }", "public int getId()\n {\n return id;\n }", "public void setId(int id){\r\n this.id = id;\r\n }", "@Test\r\n\tpublic void testSetId() {\r\n\t\tbreaku1.setId(5);\r\n\t\texternu1.setId(6);\r\n\t\tmeetingu1.setId(7);\r\n\t\tteachu1.setId(8);\r\n\r\n\t\tassertEquals(5, breaku1.getId());\r\n\t\tassertEquals(6, externu1.getId());\r\n\t\tassertEquals(7, meetingu1.getId());\r\n\t\tassertEquals(8, teachu1.getId());\r\n\t}", "protected abstract String getId();", "@Override\n\tpublic int getId(){\n\t\treturn id;\n\t}", "public String getId() { return id; }", "public String getId() { return id; }", "public String getId() { return id; }", "public int getID() {return id;}", "public int getID() {return id;}", "public int getId ()\r\n {\r\n return id;\r\n }", "@Override\n public int getField(int id) {\n return 0;\n }", "public void setId(Long id)\n/* */ {\n/* 66 */ this.id = id;\n/* */ }", "public int getId(){\r\n return localId;\r\n }", "void setId(int id) {\n this.id = id;\n }", "@Override\n public Integer getId() {\n return id;\n }", "@Override\n\tpublic Object selectById(Object id) {\n\t\treturn null;\n\t}", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "@Override\n public int getId() {\n return id;\n }", "@Override\n public int getId() {\n return id;\n }", "public void setId(int id)\n {\n this.id=id;\n }", "@Override\r\n public int getID()\r\n {\r\n\treturn id;\r\n }", "@Override\n\tpublic Integer getId() {\n\t\treturn null;\n\t}", "public int getId()\r\n {\r\n return id;\r\n }", "public void setId(Long id){\n this.id = id;\n }", "@java.lang.Override\n public int getId() {\n return id_;\n }", "@java.lang.Override\n public int getId() {\n return id_;\n }", "final protected int getId() {\n\t\treturn id;\n\t}", "private void clearId() {\n \n id_ = 0;\n }", "public abstract Long getId();", "public void setId(Long id) \r\n {\r\n this.id = id;\r\n }", "@Override\n public long getId() {\n return this.id;\n }", "public String getId(){ return id.get(); }", "@SuppressWarnings ( \"unused\" )\n private void setId ( final Long id ) {\n this.id = id;\n }", "public void setId(long id){\n this.id = id;\n }", "public void setId(long id){\n this.id = id;\n }", "public void setId(Integer id)\r\n/* */ {\r\n/* 122 */ this.id = id;\r\n/* */ }", "public Long getId() \n {\n return id;\n }", "@Override\n\tpublic void setId(int id) {\n\n\t}", "public void test_getId() {\n assertEquals(\"'id' value should be properly retrieved.\", id, instance.getId());\n }", "@Override\r\n\tpublic Object getId() {\n\t\treturn null;\r\n\t}", "public int getId()\n {\n return id;\n }", "public int getID(){\n return id;\n }", "public String getID(){\n return Id;\n }" ]
[ "0.6897049", "0.6839498", "0.67057544", "0.66417086", "0.66417086", "0.6592169", "0.6579292", "0.6579292", "0.6575263", "0.6575263", "0.6575263", "0.6575263", "0.6575263", "0.6575263", "0.656245", "0.656245", "0.65447694", "0.65251684", "0.6516205", "0.6487982", "0.6477638", "0.6428175", "0.64196116", "0.6418121", "0.64022696", "0.6367566", "0.6355691", "0.6352598", "0.6348783", "0.6325491", "0.63200915", "0.63026214", "0.62942576", "0.62942576", "0.62838596", "0.62720686", "0.6267314", "0.62664306", "0.62634486", "0.626002", "0.6256922", "0.6251961", "0.6248661", "0.6248661", "0.6245221", "0.62398785", "0.62398785", "0.62326866", "0.62245816", "0.6220949", "0.6220645", "0.6212643", "0.6210262", "0.62027115", "0.62024575", "0.6193926", "0.61905754", "0.61905754", "0.61905754", "0.6190146", "0.6190146", "0.618559", "0.61844486", "0.61750674", "0.61745095", "0.6168598", "0.6167194", "0.6161174", "0.61578095", "0.61578095", "0.61578095", "0.61578095", "0.61578095", "0.61578095", "0.61578095", "0.6156709", "0.6156709", "0.6143479", "0.6135095", "0.6129762", "0.6129127", "0.61063343", "0.61055714", "0.61055714", "0.6104239", "0.61037016", "0.6102918", "0.61012363", "0.6100267", "0.6094533", "0.60939157", "0.60936975", "0.60936975", "0.60916936", "0.60904694", "0.6077306", "0.6073186", "0.60725886", "0.60711926", "0.60707015", "0.6070076" ]
0.0
-1
Created by VutkaBilai on 7/29/17.
public interface TrendingHashTagContract { interface view extends BaseView<Presenter>{ void showInitialActivity(); void showProgress(boolean show); void showTags(List<HashTag> tags); } interface Presenter extends BasePresenter{ void logOutUser(); } }
{ "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\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "private void poetries() {\n\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "public void mo38117a() {\n }", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "private void m50366E() {\n }", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n protected void getExras() {\n }", "@Override\n public int describeContents() { return 0; }", "public void mo4359a() {\n }", "protected boolean func_70814_o() { return true; }", "@Override\n public void init() {\n\n }", "@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\n\tpublic void jugar() {\n\t\t\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void init() {\n }", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\n public int retroceder() {\n return 0;\n }", "@Override\n 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 public void memoria() {\n \n }", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "private Rekenhulp()\n\t{\n\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() {}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\r\n\tpublic void init() {}", "@Override\n protected void init() {\n }", "@Override\r\n\tprotected void doF4() {\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}", "@Override\n protected void initialize() {\n\n \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 protected void initialize() \n {\n \n }", "@Override\n\tpublic void nefesAl() {\n\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 public void init() {\n\n }", "@Override\n public void init() {\n\n }", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n\tpublic int mettreAJour() {\n\t\treturn 0;\n\t}", "private void init() {\n\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "public void mo12628c() {\n }", "@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}", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "private void kk12() {\n\n\t}", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "public void mo6081a() {\n }", "@Override\n\tpublic void init() {\n\t}", "@Override public int describeContents() { return 0; }", "public void m23075a() {\n }", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "public void mo12930a() {\n }", "public final void mo91715d() {\n }", "@Override\n\tpublic void init()\n\t{\n\n\t}", "private void m50367F() {\n }", "@Override\n public int getSize() {\n return 1;\n }" ]
[ "0.6077759", "0.58964086", "0.58691704", "0.5833409", "0.5799253", "0.5799253", "0.57753503", "0.5751698", "0.5686066", "0.567629", "0.5664995", "0.56595194", "0.5634599", "0.56338", "0.5620905", "0.56198204", "0.5607147", "0.5599259", "0.55899215", "0.55871266", "0.5549861", "0.5547639", "0.5542971", "0.55335516", "0.5507214", "0.5505901", "0.5495608", "0.54890406", "0.5487589", "0.5487589", "0.5487589", "0.5487589", "0.5487589", "0.5467577", "0.5456939", "0.5456325", "0.5451366", "0.5449582", "0.5449178", "0.54379934", "0.54217005", "0.5410509", "0.54067063", "0.53965986", "0.53965986", "0.53965986", "0.53965986", "0.53965986", "0.53965986", "0.5395692", "0.53934735", "0.5385885", "0.5385825", "0.5385825", "0.5378828", "0.536764", "0.53645486", "0.53645486", "0.53645486", "0.53645486", "0.53645486", "0.53645486", "0.53645486", "0.53631866", "0.5361505", "0.5354722", "0.5354145", "0.5354145", "0.5354145", "0.53538495", "0.5342955", "0.5342955", "0.5336628", "0.5325922", "0.5320984", "0.5320984", "0.5320984", "0.5320939", "0.5320939", "0.53193456", "0.53160936", "0.5315026", "0.5307578", "0.53074646", "0.5306906", "0.5296237", "0.5296237", "0.5296237", "0.5295064", "0.5293674", "0.52907276", "0.52901554", "0.5289756", "0.52896696", "0.5285505", "0.52795076", "0.52771753", "0.5277135", "0.52718854", "0.52718675", "0.526313" ]
0.0
-1
Can use publicly available resources only, so use open query interface Here, ensure > 50 documents about ranking
@Test void verifyMetrics() throws IOException, InterruptedException { HttpRequest req = HttpRequest.newBuilder() .GET() .uri(URI.create("https://5f6trv8063.execute-api.us-east-1.amazonaws.com/default/VespaDocSearchLambda/?jsoncallback=?&query=ranking&ranking=documentation&locale=en-US&hits=1")) .build(); HttpResponse<String> res = httpClient.send(req, HttpResponse.BodyHandlers.ofString()); assertEquals(200, res.statusCode()); String body = res.body(); long hitCount = new ObjectMapper().readTree(body.substring(2, body.length()-2)) // Strip ?( ); from JSON-P response .get("root").get("fields").get("totalCount").asLong(); assert(hitCount > 50); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<Document> retrieveQuery( Query aQuery, int TopN ) throws IOException {\n\t\t// NT: you will find our IndexingLucene.Myindexreader provides method: docLength()\n\t\t// implement your retrieval model here, and for each input query, return the topN retrieved documents\n\t\t// sort the documents based on their relevance score, from high to low\n\n\t\tHashMap<Integer, HashMap<String,Integer>> idTokenDocFrequencyMap = new HashMap<>();\t//docid - (token - document frequency) map\n\t\tHashMap<String, Long> tokenColFrequencyMap = new HashMap<>();\t// token - collection frequency map\n\t\tString content = aQuery.GetQueryContent();\n\t\tString[] tokens = content.split(\" \");\n\n\t\tfor(String token : tokens){\n\t\t\ttokenColFrequencyMap.put(token, indexReader.CollectionFreq(token)); \t// update the second map\n\t\t\tint [][]postingList = indexReader.getPostingList(token);\n\t\t\tif(postingList == null) continue;\n\t\t\tfor(int i = 0; i < postingList.length; i++){\n\t\t\t\tint docid = postingList[i][0];\n\t\t\t\tint freq = postingList[i][1];\n\t\t\t\tif(idTokenDocFrequencyMap.containsKey(docid)){\t\t// update the first map\n\t\t\t\t\tidTokenDocFrequencyMap.get(docid).put(token,freq);\n\t\t\t\t}else {\n\t\t\t\t\tHashMap<String,Integer> tokenFrequencyMap = new HashMap<>();\n\t\t\t\t\ttokenFrequencyMap.put(token,freq);\n\t\t\t\t\tidTokenDocFrequencyMap.put(docid,tokenFrequencyMap);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tdouble U = 2000.0;\n\t\tList<Document> documentList = new ArrayList<>();\n\t\t// if use a docidList, it will have some duplicates.\n\t\tfor(Map.Entry<Integer, HashMap<String,Integer>> entry : idTokenDocFrequencyMap.entrySet()){\n\t\t\tdouble score = 1.0;\t\t\t// each document have one score\n\t\t\tint docid = entry.getKey();\n\t\t\tint docLen = indexReader.docLength(docid);\t// get document length\n\t\t\tHashMap<String,Integer> tokenDocFrequencyMap = idTokenDocFrequencyMap.get(docid);\n\t\t\tfor(String token : tokens){\t\t// for each token, not the token just exist in the document\n\t\t\t\tlong colFreq = tokenColFrequencyMap.getOrDefault(token,0l);\t// get collection frequency\n\t\t\t\tif(colFreq != 0){\n\t\t\t\t\tint docFreq = 0;\t// if this document don't have token, just set document frequency as 0\n\t\t\t\t\tif(tokenDocFrequencyMap.containsKey(token)){\n\t\t\t\t\t\tdocFreq = tokenDocFrequencyMap.get(token);\n\t\t\t\t\t}\n\t\t\t\t\tscore = score * (docFreq + U * ((double)colFreq / colLen)) / (docLen + U);\t//equation\n\t\t\t\t}\n\t\t\t}\n\t\t\tDocument document = new Document(docid+\"\", indexReader.getDocno(docid),score);\n\t\t\tdocumentList.add(document);\n\t\t}\n\n\t\tCollections.sort(documentList, new Comparator<Document>() {\n\t\t\t@Override\n\t\t\tpublic int compare(Document o1, Document o2) {\n\t\t\t\treturn Double.compare(o2.score(),o1.score());\n\t\t\t}\n\t\t});\n\t\tList<Document> res = new ArrayList<>();\n\t\tfor(int i = 0 ; i < TopN; i++){\n\t\t\tres.add(documentList.get(i));\n\t\t}\n\t\treturn res;\n\t}", "private static void RankedQueryMode(DiskIndexWriter diskWriter, DiskPositionalIndex disk_posIndex) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException {\n\n if (query.equals(\"q\")) {\n\n System.exit(0);\n }\n\n List<String> word = new ArrayList();\n String[] query_array = query.split(\"\\\\s+\");\n TokenProcessor processor = new NewTokenProcessor();\n\n for (int i = 0; i < query_array.length; i++) {\n word.add(processor.processToken(query_array[i]).get(0));\n }\n\n StrategyFactory sf = new StrategyFactory();\n StrategyInterface strategy = sf.execute(rankedOption);\n\n //maps postings to accumulator value\n HashMap<Integer, Doc_accum> postingMap = new HashMap<Integer, Doc_accum>();\n\n PriorityQueue<Doc_accum> queue = new PriorityQueue<>(Collections.reverseOrder());\n\n List<Posting> postings = new ArrayList<>();\n List<Doc_accum> results = new ArrayList<>();\n\n for (String term : word) {\n\n postings = disk_posIndex.getPosting_noPos(term);\n for (Posting p : postings) { //for each document in the postings list\n double t_fd = p.getT_fd();\n double d_ft = p.getD_ft();\n double w_qt = strategy.calculate_wqt(N, d_ft);\n double accum = 0;\n double w_dt = strategy.get_wdt(t_fd, disk_posIndex, p.getDocumentId());\n\n //pairs (Ranked_posting, accumulator factor)\n if (postingMap.containsKey(p.getDocumentId())) {\n accum = postingMap.get(p.getDocumentId()).getAccumulator();\n accum += (w_qt * w_dt);\n postingMap.replace(p.getDocumentId(), new Doc_accum(p, accum)); //replaces old accum value\n\n } else {\n accum += (w_qt * w_dt);\n postingMap.put(p.getDocumentId(), new Doc_accum(p, accum));\n }\n }\n\n }\n\n for (Integer p : postingMap.keySet()) {\n Doc_accum doc_temp = postingMap.get(p);\n double accum = doc_temp.getAccumulator(); //gets accum associated with doc\n\n if (accum > 0) {\n //search for each p's Ld factor in docWeights.bin\n double l_d = strategy.calculate_Ld(disk_posIndex, doc_temp.getPosting().getDocumentId());\n\n accum /= l_d;\n doc_temp.setAccumulator(accum);\n }\n\n queue.add(postingMap.get(p));\n\n }\n\n //returns top K=10 results \n int topK = 50;\n\n while ((results.size() < topK) && queue.size() > 0) {\n\n results.add(queue.poll()); //gets the posting acc pair and returns only posting\n\n }\n\n display_RankedResults(results);\n\n }", "protected HashMap<String,Double> rank(ArrayList<String> queryPostingLines, ArrayList<String> query){\n HashMap<String,HashMap<String,Integer>> queryWordsTFPerDoc = computeTFForQueryWords(queryPostingLines);\n ArrayList<String> retrievedDocuments = new ArrayList<>(queryWordsTFPerDoc.keySet());\n HashMap<String,Double> rankedDocs = new HashMap<>();\n\n for(String doc : retrievedDocuments){\n HashMap<String,Integer> docTFs = queryWordsTFPerDoc.get(doc);\n double rank = 0.3*rankByBM25(query,doc,docTFs) + 0.7*rankByPosition(query,doc,queryPostingLines);// - rankByCosSim(query,doc,docTFs);\n rankedDocs.put(doc,rank);\n }\n rankedDocs = sortByValue(rankedDocs);\n ArrayList<String> docsAfterSort = new ArrayList<>(rankedDocs.keySet());\n HashMap<String,Double> docsToRetrieve = new HashMap<>();\n int i=0;\n for(String doc: docsAfterSort){\n docsToRetrieve.put(documentDetails.get(doc)[0],rankedDocs.get(doc));\n i++;\n if(i == 50)\n break;\n }\n return docsToRetrieve;\n }", "public List<Classes.Document> RetrieveQuery(Classes.Query cQuery, int TopN, int TopK, double alpha) throws Exception { \r\n\t\t// Get P(token|feedback model)\r\n\t\tHashMap<String, Double> TokenRFScore = GetTokenRFScore(cQuery, TopK);\r\n\r\n\t\t// Store sorted top N results (from most relevant to least)\r\n\t\tList<Classes.Document> rankedList = new ArrayList<>();\r\n\t\t\r\n\t\t// Get query's content as input into retrieval model\r\n\t\tString[] tokens = cQuery.getQueryContent().split(\" \");\r\n\t\tList<DocScore> docScoreList = new ArrayList<>();\r\n\t\tqueryResult.forEach((luceneID, tfMap) -> {\r\n\t\t int doclen = 0;\r\n\t\t double score = 1.0;\r\n\t\t try {\r\n\t\t doclen = myireader.docLength(luceneID);\r\n\t\t } catch (Exception e) {\r\n\t\t \t e.printStackTrace();\r\n\t\t };\r\n\t\t \r\n\t\t /**\r\n\t\t\t * Dirichlet Prior Smoothing:\r\n\t\t\t * p(w|D) = (|D|/(|D|+MU))*(c(w,D)/|D|) + (MU/(|D|+MU))*p(w|REF)\r\n\t\t * score = λ*p_doc + (1-λ)*p_ref\r\n\t\t * = c1*p_doc + c2*p_ref\r\n\t\t\t */\r\n\t\t double c1 = doclen / (doclen + MU);\r\n\t\t double c2 = MU / (doclen + MU);\r\n\t\t for(String token : tokens) {\r\n\t\t \t long cf = termFreq.get(token);\r\n\t\t \t if(cf == 0) {\t\r\n\t\t \t\t continue;\r\n\t\t \t }\r\n\t\t \r\n\t\t \t int tf = tfMap.getOrDefault(token, 0);\r\n\t\t \t double p_doc = (double) tf / doclen; // c(w, D)\r\n\t\t \t double p_ref = (double) cf / CORPUS_SIZE; // p(w|REF)\r\n\t\t \t \r\n\t\t \t // Get the final probability of each token with pseudo RF score\r\n\t\t \t score *= alpha * (c1 * p_doc + c2 * p_ref) + (1 - alpha) * TokenRFScore.get(token);\r\n\t\t }\r\n\t\t \r\n\t\t DocScore docScore = new DocScore(luceneID, score);\r\n\t\t docScoreList.add(docScore);\r\n\t\t}); // The end of forEach loop block\r\n\r\n\t\t// Sort the result List \r\n\t\tCollections.sort(docScoreList, new Comparator<DocScore>() {\r\n\t\t\t@Override\r\n\t\t\tpublic int compare(DocScore ds1, DocScore ds2) {\r\n\t\t\t\tif(ds1.score != ds2.score) {\r\n\t\t\t\t\treturn ds1.score < ds2.score ? 1 : -1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn 1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t// Put all documents into result list\r\n\t\tfor(int n = 0; n < TopN; n++) {\r\n\t\t DocScore docScore = docScoreList.get(n);\r\n\t\t Classes.Document doc = null;\r\n\t\t try {\r\n\t\t \t int luceneID = docScore.getId(); // Get Lucene id\r\n\t\t \t doc = new Document(Integer.toString(luceneID), \r\n\t\t \t\t\t \t\t\tmyireader.getDocno(luceneID), \r\n\t\t \t\t\t docScore.getScore(),\r\n\t\t \t\t\t dreader.document(luceneID).get(\"restName\"),\r\n\t\t \t\t\t dreader.document(luceneID).get(\"restUrl\"),\r\n\t\t \t\t\t dreader.document(luceneID).get(\"originalContent\"));\r\n\t\t } catch(Exception e) {\r\n\t\t \t e.printStackTrace();\r\n\t\t };\r\n\t\t \r\n\t\t rankedList.add(doc);\r\n\t\t}\r\n\r\n\t\treturn rankedList;\r\n\t}", "@Override\r\n\t\t\tpublic List<ScoredDocument> search(Query query, long maxNumberOfDocuments) {\n\t\t\t\treturn null;\r\n\t\t\t}", "abstract public int numDocs();", "public void ReadIndex(int K) throws IOException {\n IndexReader indexReader = new IndexReader();\n\n // get doc frequency, termFrequency in all docs\n// int df = indexReader.getDocFreq(token);\n// long collectionTf = indexReader.getCollectionFrequency(token);\n//// System.out.println(\" The token \\\"\" + token + \"\\\" appeared in \" + df + \" documents and \" + collectionTf\n//// + \" times in total\");\n// if (df > 0) {\n// int[][] posting = indexReader.getPostingList(token);\n// for (int i = 0; i < posting.length; i++) {\n// int doc_id = posting[i][0];\n//// int term_freq = posting[i][1];\n// String doc_no = indexReader.getDocNo(doc_id);\n//// System.out.println(\"doc_no: \" + doc_id);\n//\n//// System.out.printf(\"%10s %6d %6d\\n\", doc_no, doc_id, term_freq);\n//// System.out.printf(\"%10s 10%6d %6d\\n\", doc_no, doc_id, indexReader.getTF(token, doc_id));\n// System.out.println(\"tf_idf: \" + indexReader.getTF_IDF_weight(token, doc_id));\n//\n// }\n// }\n\n\n String doc_no = indexReader.getDocNo(FileConst.query_doc_id);\n // retreived top K relevant doc ids\n System.out.println(\"=== Top 20 Most Relevant Documents and its Cosine Similarity Score ===\");\n indexReader.retrieveRank(query_tokens, Integer.parseInt(doc_no), K);\n\n indexReader.close();\n }", "private double rankByPosition(List<String> query, String docId, ArrayList<String> queryPostingLines){\n double rank = 0, sum = 0;\n boolean isEntity;\n ArrayList<Integer> allPositions = new ArrayList<>();\n double documentLength = Double.valueOf(documentDetails.get(docId)[3]);\n for(String word : query){\n isEntity = false;\n for(String postingLine : queryPostingLines) {\n if (word.equalsIgnoreCase(postingLine.substring(0, postingLine.indexOf(\"|\")))) { //checks if the posting line matches the current term\n if(postingLine.contains(\"_\" + docId + \":\") || postingLine.contains(\"|\" + docId + \":\" )){ //checks if the term appears in the document\n if(word.toUpperCase().equals(postingLine.substring(0, postingLine.indexOf(\"|\")))){ // an (or a part of) entity\n isEntity = true;\n }\n if(postingLine.contains(\"_\" + docId + \":\")){\n postingLine = postingLine.substring(postingLine.indexOf(\"_\" + docId + \":\") + docId.length() + 2);\n }\n else{ //in case the document is the first one in the term's posting line\n postingLine = postingLine.substring(postingLine.indexOf(\"|\" + docId + \":\") + docId.length() + 2);\n }\n postingLine = postingLine.substring(0,postingLine.indexOf(\"_\")); //trims the line only to the positions\n String[] positions = postingLine.split(\",\");\n for(int i=0; i<positions.length;i++){ //computes the rank\n sum += (1-(Double.valueOf(positions[i]))/documentLength);\n if(isEntity)\n rank++;\n allPositions.add(Integer.valueOf(positions[i]));\n }\n rank += sum / positions.length;\n\n sum = 0;\n }\n break;\n }\n }\n }\n allPositions.sort(Integer::compareTo);\n int adjacent = 0;\n for(int i=0; i<allPositions.size()-1; i++){\n if(allPositions.get(i) == allPositions.get(i+1)-1){\n adjacent++;\n }\n }\n\n return rank + rank*adjacent*1.5;\n }", "public interface SearchQuerySet extends QuerySet\n{\n\n // for AbstractSearch\n public static final int STAT_MODELS = 1;\n public static final int STAT_CLUSTERS = 2;\n public static final int STAT_GENOMES = 4;\n public static final int STAT_MODEL_CLUSTERS = 8;\n\n public String getStatsById(Collection data);\n public String getStatsByQuery(String query);\n public String getStatsById(Collection data,int stats);\n public String getStatsByQuery(String query,int stats);\n \n // for BlastSearch\n public String getBlastSearchQuery(Collection dbNames, Collection keys, KeyTypeUser.KeyType keyType);\n \n //for ClusterIDSearch\n public String getClusterIDSearchQuery(Collection input, int limit, int[] DBs, KeyTypeUser.KeyType keyType);\n \n // for ClusterNameSearch\n public String getClusterNameSearchQuery(Collection input, int limit, int[] DBs, KeyTypeUser.KeyType keyType);\n \n // for DescriptionSearch\n public String getDescriptionSearchQuery(Collection input, int limit, int[] DBs, KeyTypeUser.KeyType keyType);\n \n // for GoSearch \n public String getGoSearchQuery(Collection input, int limit, KeyTypeUser.KeyType keyType);\n \n // for GoTextSearch\n public String getGoTextSearchQuery(Collection input, int limit, KeyTypeUser.KeyType keyType);\n \n // for IdSearch\n public String getIdSearchQuery(Collection input, int limit, int[] DBs, KeyTypeUser.KeyType keyType);\n \n // for QueryCompSearch\n public String getQueryCompSearchQuery(String comp_id, String status, KeyTypeUser.KeyType keyType);\n \n // for QuerySearch\n public String getQuerySearchQuery(String queries_id, KeyTypeUser.KeyType keyType); \n \n // for SeqModelSearch\n public String getSeqModelSearchQuery(Collection model_ids, KeyTypeUser.KeyType keyType);\n \n // for UnknowclusterIdSearch\n public String getUnknownClusterIdSearchQuery(int cluster_id, KeyTypeUser.KeyType keyType);\n \n // for ProbeSetSearch\n public String getProbeSetSearchQuery(Collection input, int limit, KeyTypeUser.KeyType keyType);\n \n // for ProbeSetKeySearch\n public String getProbeSetKeySearchQuery(Collection input, int limit, KeyTypeUser.KeyType keyType);\n \n // for QueryTestSearch\n public String getQueryTestSearchQuery(String query_id, String version, String genome_id);\n \n // for QueryStatsSearch\n public String getQueryStatsSearchQuery(List query_ids,List DBs);\n \n // for PskClusterSearch\n public String getPskClusterSearchQuery(int cluster_id,KeyTypeUser.KeyType keyType);\n \n // for ClusterCorrSearch\n public String getClusterCorrSearchQuery(int cluster_id, int psk_id, KeyTypeUser.KeyType keyType);\n \n // for UnknownGenesSearch\n public String getUnknownGenesSearchQuery(Collection sources, KeyTypeUser.KeyType keyType);\n \n}", "@Override\r\n\t\t\tpublic List<ScoredDocument> search(Query query) {\n\t\t\t\treturn null;\r\n\t\t\t}", "public void performQueryfullSearchWithPersonalization(RestHighLevelClient client) throws IOException{\n \n String csvFile = \"ADD PATH TO QUERYFULL SEARCHES\";\n String pathToSubmissionFile = \"ADD PATH TO SUBMISSION FILE\";\n BufferedReader br = null;\n PrintWriter writer = null;\n String line = \"\";\n String csvSpliter = \";\"; \n List<String> reRankedProds;\n Long count= 0L;\n \n try{\n System.out.println(\"Iterating through test_only_queries...\");\n br = new BufferedReader(new FileReader(csvFile));\n writer = new PrintWriter(pathToSubmissionFile,\"UTF-8\");\n while((line = br.readLine())!=null){\n count++;\n String[] info = line.split(csvSpliter);\n String queryId = info[0];\n String userId = info[2];\n String[] items = info[info.length - 1].split(\",\");\n String[] nameTokens = info[info.length - 3].split(\",\");\n String name = getQuery(nameTokens);\n \n \n if(!userId.trim().equals(\"NA\")){\n reRankedProds = performPersonalizedQueryfullSearch(client,Integer.parseInt(userId),name,items);\n writer.println(queryId + \" \" + reRankedProds.toString().replace(\"[\", \"\").replace(\"]\", \"\").replace(\" \", \"\"));\n }else{\n reRankedProds = performPersonalizedQuerylessSearch(client,name,items);\n writer.println(queryId + \" \" + reRankedProds.toString().replace(\"[\", \"\").replace(\"]\", \"\").replace(\" \",\"\"));\n }\n \n }\n writer.close();\n } catch(FileNotFoundException e){\n e.printStackTrace();\n } catch (IOException e){\n e.printStackTrace();\n } finally{\n if (br != null) {\n try {\n br.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n client.close();\n }", "public interface DocumentRelatedTermsSearcher {\n List<ScoredTerm> getDocumentRelatedTerms(int docId, String term) throws SearchException;\n}", "private static void rankOffer() {\n\t\tList<JSONObject> pgmRank = FileUtil.FileToJsonList(\"C:/Users/强胜/Desktop/dataCrawler/申请方/翻译后的/去掉过时的/program55.json\", \"utf-8\");\n\t\tMap<Integer,String> map = new HashMap<Integer,String>();\n\t\tfor(JSONObject json : pgmRank){\n\t\t\tif(json.containsKey(\"sch_rank\") && json.containsKey(\"pgm_rank\")){\n\t\t\t\tmap.put(json.getInt(\"id\"), json.get(\"sch_rank\").toString()+\"!\"+json.get(\"pgm_rank\").toString());\n\t\t\t\t//System.out.println(json.getInt(\"sch_rank\")+\"!\"+json.getInt(\"pgm_rank\"));\n\t\t\t}\n\t\t}\n\t\t//String url = \"123.57.250.189\";\n\t\tString url = \"localhost\";\n\t\tint port = 27017;\n\t\tString dbName = \"dulishuo\";\n\t\tDB db = MongoUtil.getConnection(url, port, dbName);\n\t\t\n\t\tDBCollection offer = db.getCollection(\"newoffer\"); \n\t DBCursor update = offer.find();\n\t \n\t while(update.hasNext()){\n\t \tSystem.out.println(\"process_____\"+count++);\n\t \tDBObject obj = update.next();\n\t \tif(!obj.containsField(\"school_rank\") && !obj.containsField(\"program_rank\")){\n\t \t\tif(obj.containsField(\"program_id\")){\n\t\t \t\tint pgm_id = Integer.parseInt(obj.get(\"program_id\").toString());\n\t\t\t \tif(pgm_id != -1){\n\t\t\t \t\t//如果匹配到的program_id,且不为-1,且存在专排与综排 \n\t\t\t \t\tif(map.containsKey(pgm_id)){\n\t\t\t \t\t\tString rank = map.get(pgm_id);\n\t\t\t \t\t\ttry{\n\t\t\t \t\t\t\tint sch_rank = Integer.parseInt(rank.split(\"!\")[0].toString());\n\t\t\t\t \t\t\tint pgm_rank = Integer.parseInt(rank.split(\"!\")[1].toString());\n\t\t\t\t \t\t\tBasicDBObject newDocument = new BasicDBObject(); \n\t\t\t\t\t\t \tnewDocument.append(\"$set\", new BasicDBObject().append(\"school_rank\", sch_rank).append(\"program_rank\", pgm_rank)); \n\t\t\t\t\t\t \toffer.update(obj, newDocument);\n\t\t\t \t\t\t}catch(Exception e){\n\t\t\t \t\t\t\tSystem.out.println(rank);\n\t\t\t \t\t\t\treturn;\n\t\t\t \t\t\t}\n\t\t\t \t\t}\n\t\t\t \t\t//如果匹配到的program_id,且不为-1,但不存在排名,则设为999\n\t\t\t \t}\n\t\t \t}\n\t \t}\n\t }\n\t System.out.println(\"____end_____\");\n\t}", "public static void main(String[] args) throws IOException{\n \n List<List<String>> results;\n String query = \"ADD QUERY OR CATEGORY FOR SEARCH\";\n \n //ADD USER ID WHO SEARCHES\n Long userId = 1;\n PersonalizedSearch searchObj = new PersonalizedSearch();\n \n final CredentialsProvider credsProvider = new BasicCredentialsProvider();\n credsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(\"elastic\",\"elastic\"));\n \n \n RestHighLevelClient client = new RestHighLevelClient(\n RestClient.builder(\n new HttpHost(\"localhost\",9200),\n new HttpHost(\"localhost\",9201))\n .setHttpClientConfigCallback(new RestClientBuilder.HttpClientConfigCallback() {\n @Override\n public HttpAsyncClientBuilder customizeHttpClient(HttpAsyncClientBuilder hacb) {\n return hacb.setDefaultCredentialsProvider(credsProvider);\n }\n }));\n \n /**\n * ---------COMMENT OUT ONE OF THE FOLLOWING TO DO A PERSONALIZED SEARCH FOR A SIGNED IN OR/AND AN ANONYMOUS USER--------\n */\n\n System.out.println(\"Starting collecting queryless/queryfull submissions...\");\n System.out.println(\"\");\n// searchObj.performQuerylessSearchWithPersonalization(client);\n// searchObj.performQueryfullSearchWithPersonalization(client);\n// results = searchObj.performPharm24PersonalizedQueryfullSearch(client, userId, query);\n// results = searchObj.performPharm24PersonalizedQuerylessSearch(client, userId, query);\n \n for(int i=0; i<results.size(); i++){\n for(int j = 0; j<results.get(i).size();j++){\n System.out.println(results.get(i).get(j));\n }\n System.out.println(\"-------RERANKED---------\");\n }\n\n System.out.println(\"\");\n System.out.println(\"I\\'m done!\");\n \n \n }", "@Override\n public List<SearchResult> search(String queryString, int k) {\n // TODO: YOUR CODE HERE\n\n // Tokenize the query and put it into a Set\n HashSet<String> tokenSet = new HashSet<>(Searcher.tokenize(queryString));\n\n /*\n * Section 1: FETCHING termId, termFreq and relevant docId from the Query\n */\n\n // Init a set to store Relevant Document Id\n HashSet<Integer> relevantDocIdSet = new HashSet<>();\n for (String token : tokenSet) { // Iterates thru all query tokens\n int termId;\n try {\n termId = indexer.getTermDict().get(token);\n } catch (NullPointerException e) { // In case current token is not in the termDict\n continue; // Skip this one\n }\n // Get the Posting associate to the termId\n HashSet<Integer> posting = indexer.getPostingLists().get(termId);\n relevantDocIdSet.addAll(posting); // Add them all to the Relevant Document Id set\n }\n\n /*\n * Section 2: Calculate Jaccard Coefficient between the Query and all POTENTIAL DOCUMENTS\n */\n\n // ArrayList for the Final Result\n ArrayList<SearchResult> searchResults = new ArrayList<>();\n for (Document doc : documents) { // Iterates thru all documents\n if (!relevantDocIdSet.contains(doc.getId())) { // If the document is relevant\n searchResults.add(new SearchResult(doc, 0)); // Add the document as a SearchResult with zero score\n } else {\n HashSet<String> termIdSet = new HashSet<>(doc.getTokens()); // Get the token set from the document\n\n // Calculate Jaccard Coefficient of the document\n double jaccardScore = JaccardMathHelper.calculateJaccardSimilarity(tokenSet, termIdSet);\n\n // Add the SearchResult with the computed Jaccard Score\n searchResults.add(new SearchResult(doc, jaccardScore));\n }\n }\n\n return TFIDFSearcher.finalizeSearchResult(searchResults, k);\n }", "public List<IResult> getResults(List<Integer> relatedDocs, String query) {\r\n\r\n // results\r\n List<IResult> rs = new ArrayList<>();\r\n List<Double> documentVector, queryVector = new ArrayList<>();\r\n\r\n Map<String, Integer> termFreqs = this.preprocessor.processQuery(query);\r\n\r\n for(String op : new String[]{\"and\", \"or\", \"not\"}) {\r\n termFreqs.remove(op);\r\n }\r\n\r\n\r\n double highestVal = 0;\r\n\r\n // query TF-IDF vector\r\n for(String term : termFreqs.keySet()) {\r\n\r\n // unknown term == contained in no doc\r\n if(!this.index.getDict().containsKey(term)) {\r\n continue;\r\n }\r\n\r\n // # docs where term occurs in\r\n int termTotalFreq = this.index.getTermInDocCount(term);\r\n\r\n // query tf-idf vector\r\n double qTfIdf = this.tfidf.tfidfQuery(termFreqs.get(term), termTotalFreq);\r\n queryVector.add(qTfIdf);\r\n\r\n if(qTfIdf > highestVal) highestVal = qTfIdf;\r\n }\r\n\r\n // query vector normalization\r\n for(int i = 0; i < queryVector.size(); i++) {\r\n queryVector.set(i, queryVector.get(i)/highestVal);\r\n }\r\n\r\n\r\n for(int docId : relatedDocs) {\r\n documentVector = new ArrayList<>();\r\n highestVal = 0;\r\n\r\n for(String term : termFreqs.keySet()) {\r\n\r\n // unknown term == contained in no doc\r\n if(!this.index.getDict().containsKey(term)) {\r\n continue;\r\n }\r\n\r\n // document tf-idf vector\r\n double dTfIdf = this.tfidf.getTfIdf(term, docId);\r\n documentVector.add(dTfIdf);\r\n\r\n if(dTfIdf > highestVal) highestVal = dTfIdf;\r\n }\r\n\r\n // document vector normalization\r\n for(int i = 0; i < documentVector.size(); i++) {\r\n documentVector.set(i, documentVector.get(i)/highestVal);\r\n }\r\n\r\n Result result = new Result();\r\n result.setDocumentId(this.docs.get(docId).getUrl());\r\n result.setDocument(this.docs.get(docId));\r\n result.setScore((float) CosineSimilarity.process(documentVector, queryVector));\r\n rs.add(result);\r\n }\r\n\r\n Collections.sort(rs, new ResultComparator());\r\n\r\n // limit number of results\r\n if(rs.size() > IndexerConfig.MAX_RESULT_COUNT)\r\n rs = rs.subList(0, IndexerConfig.MAX_RESULT_COUNT);\r\n\r\n // rank it\r\n for(int i = 0; i < rs.size(); i++) {\r\n ((Result) rs.get(i)).setRank (i + 1);\r\n }\r\n\r\n return rs;\r\n }", "private ScoreDoc[] searchExec (Query query) {\n\n ScoreDoc[] hits = null;\n\n try {\n IndexReader reader = DirectoryReader.open(indexDir);\n IndexSearcher searcher = new IndexSearcher(reader);\n TopDocs docs = searcher.search(query, hitsPerPage, new Sort(SortField.FIELD_SCORE)); //search(query, docs);\n hits = docs.scoreDocs;\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n return hits;\n }", "@Test\n\tpublic void shouldReturnPagedOpenDocumentsSortedByOpenAmountAsc()\n\t{\n\t\tfinal SearchPageData<B2BDocumentModel> result = pagedB2BDocumentDao.getAllPagedDocuments(\n\t\t\t\tcreatePageableData(0, 10, \"byOpenAmountAsc\"), Collections.singletonList(AccountSummaryAddonUtils\n\t\t\t\t\t\t.createFilterByCriteriaObject(DOCUMENT_STATUS_OPEN, StringUtils.EMPTY)));\n\n\t\tTestCase.assertEquals(10, result.getResults().size());\n\t\tfor (final B2BDocumentModel document : result.getResults())\n\t\t{\n\t\t\tTestCase.assertEquals(DocumentStatus.OPEN, document.getStatus());\n\t\t}\n\t}", "private void readDocQueriesRelevance(){\n File f = new File(\"cranfield.query.relevance.txt\");\n if(f.exists() && !f.isDirectory()){\n try {\n FileReader fileReader=null;\n try {\n fileReader = new FileReader(f);\n } catch (FileNotFoundException ex) {\n Logger.getLogger(EvaluationQueries.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n BufferedReader bufferedReader = new BufferedReader(fileReader);\n String line;\n String[] querieDocRel;\n List<QuerieDocRelevance> tempQueriesRelevance;\n while ((line = bufferedReader.readLine()) != null) {\n querieDocRel = line.split(\"\\\\s+\");\n int querieNumber = Integer.parseInt(querieDocRel[0]);\n if(queriesRelevanceMap.containsKey(querieNumber)){\n tempQueriesRelevance = queriesRelevanceMap.get(querieNumber);\n tempQueriesRelevance.add(new QuerieDocRelevance(Integer.parseInt(querieDocRel[1]),Integer.parseInt(querieDocRel[2])));\n queriesRelevanceMap.put(querieNumber,tempQueriesRelevance);\n \n }else{\n tempQueriesRelevance = new ArrayList<>();\n tempQueriesRelevance.add(new QuerieDocRelevance(Integer.parseInt(querieDocRel[1]),Integer.parseInt(querieDocRel[2])));\n queriesRelevanceMap.put(querieNumber,tempQueriesRelevance); \n }\n \n }\n \n } catch (IOException ex) {\n Logger.getLogger(EvaluationQueries.class.getName()).log(Level.SEVERE, null, ex);\n } \n } \n \n }", "@Test\n public void testCombineRankHighPageRankWeight() {\n Iterator<Pair<Document, Double>> resultIterator = icsSearchEngine.searchQuery(Arrays.asList(\"anteater\"),\n 10, 1000000000.0);\n ImmutableList<Pair<Document, Double>> resultList = ImmutableList.copyOf(resultIterator);\n Assert.assertEquals(10, resultList.size());\n Assert.assertTrue(resultList.stream().limit(3).map(p -> p.getLeft())\n .anyMatch(doc -> doc.getText().contains(\"wics.ics.uci.edu\")));\n }", "public Document getDocumentPerCall(String scrapedImageURL, String contributor, String license, String synsetCode, String query, int rank) {\n\t\tDocument datasetRecord = new Document();\n\t\t//datasetRecord.append(\"url\", scrapedImageURL);\n\t\t\n\t\tDocument primaryKeyId = new Document();\n\t\tprimaryKeyId.append(\"url\", scrapedImageURL).append(\"category\", synsetCode);\n\t\tdatasetRecord.append(\"_id\", primaryKeyId);\n\t\tdatasetRecord.append(\"contributor\", contributor);\n\t\tdatasetRecord.append(\"license\", license);\n\t\tdatasetRecord.append(\"source\", SOURCE);\n\t\tdatasetRecord.append(\"keyword\", query);\n\t\t//datasetRecord.append(\"category\", synsetCode);\n\t\tdatasetRecord.append(\"pushToSamaHub\", false);\n\t\tdatasetRecord.append(\"taskId\", null);\n\t\tdatasetRecord.append(\"rank\", rank);\n\t\treturn datasetRecord;\n\t}", "public void queryRecommended(Query query, float score, String original);", "public void relevanceFeedback(PostingsList results, boolean[] docIsRelevant, Indexer indexer ) {\r\n// results contain the ranked list from the current search\r\n// docIsRelevant contains the users feedback on which of the 10 first hits are relevant\r\n\tdouble gamma = 0.0; // används ej, de orelevanta dokumenterna. städa upp queryn. Vad innehller de orelevanta dokumenterna för termer\r\n// dess termer tar vi bort från den relebanta.)\r\n\r\n\tdouble alfa = 0.8; // hur mycket litar på det gamla sökning innan feedback\r\n\tdouble beta = 0.6; // hur mycket hänsyn du ska ta till nya sökningen efter feedback \r\n\r\n\r\n\t/* \r\n\r\n\tAlgorithm: \r\n\tThe Rocchio algorithm is based on a method of relevance \r\n\tfeedback found in information retrieval systems\r\n\tThe algorithm is based on the assumption that most users \r\n\thave a general conception of which documents should be denoted \r\n\tas relevant or non-relevant.[1] Therefore, the user's search \r\n\tquery is revised to include an arbitrary percentage of relevant \r\n\tand non-relevant documents as a means of increasing the search \r\n\tengine's recall, and possibly the precision as well. The number \r\n\tof relevant and non-relevant documents allowed to enter a query \r\n\tis dictated by the weights of the a, b.\r\n\tthe associated weights (a, b) are responsible for shaping the \r\n\tmodified vector in a direction closer, or farther away, from the \r\n\toriginal query, related documents, and non-related documents.\r\n\r\n\r\n\r\n\tLimitations of rocchio:\r\n\t\tTherefore the two queries of \"Burma\" and \"Myanmar\" will \r\n\t\tappear much farther apart in the vector space model, \r\n\t\tthough they both contain similar origins\r\n\tWhy not use non-relevant documents:\r\n\t\tThough there are benefits to ranking documents as not-relevant, \r\n\t\ta relevant document ranking will result in more precise documents \r\n\t\tbeing made available to the user. \r\n\t\r\n\r\n\r\n\tRoccio algoritmen: \r\n\t\talfa = Original query weight \r\n\t\tbeta = related document weight\r\n\t\t\r\n\t\thigher alpha means that we give more focus to the original query terms\r\n\t\thigher beta means that we give more focus to the new search feedback. i.e new terms.\r\n\r\n\t\tTar en org query\r\n\t\tTar den gamla gånnger en viss vikt \r\n\t\tvikt är alfa + beta (entill vektor) plus att den kollar på original vektor, q0 \r\n\t\t\thögre alfa mer fokus på original queryn \r\n\t\t\thögra beta skiftar till mer fokus på de nya termerna. \r\n\t\tdvs utökas med ord/termer från dokument vektorerna som var relevanta. \r\n\r\n\tVanligtvis har man väldigt häg alfa och beta lite under för att det är standard. man tycker att den \r\n\tförsta queryn är väldigt bra.\r\n\r\n\t\r\n\t*/\r\n\r\n\tPostingsList related_doc_vector = new PostingsList();\r\n\tHashMap<String, Double> qm = new HashMap<String, Double>(); // spara termer och weights.\r\n\t// normalize weights\r\n\tfor(Double w : weights){\r\n\t\tw = w/weights.size();\r\n\t}\r\n\r\n\tIterator<PostingsEntry> it = results.iterator();\r\n\tfor(int i = 0; i < docIsRelevant.length; i++){\r\n\t\tif(docIsRelevant[i] == true){\r\n\t\t\trelated_doc_vector.list.add(results.get(i));\r\n\t\t} \r\n\t}\r\n\r\n\t// apply Rocchio algorithm.\r\n\tfor(int i = 0; i < terms.size(); i++){\r\n\t\tdouble new_weigt = weights.get(i) * alfa;\r\n\t\tqm.put(terms.get(i), new_weigt);\r\n\t}\r\n\r\n\tfor(int i = 0; i < related_doc_vector.size(); i++){\r\n\t\tIterator<PostingsEntry> ite = related_doc_vector.iterator();\r\n\t\twhile(ite.hasNext()){\r\n\t\t\tPostingsEntry postingsentry = ite.next();\r\n\t\t\tint docID = postingsentry.docID;\r\n\t\t\tString filename = indexer.index.docIDs.get(Integer.toString(docID)); // hämtar filnamnet\r\n\t\t\tString path = \"/Users/monadadoun/Desktop/ir/lab/davisWiki/\" + filename; \r\n\t\t\tFile file = new File(path);\r\n\t\t\tHashSet<String> hs = new HashSet<>();\r\n\t\t\t// lägger till alla ord som finns till mitt hashet\r\n\t\t\ttry (Reader reader = new InputStreamReader( new FileInputStream(file), StandardCharsets.UTF_8 )){\r\n\t\t\t\tTokenizer tok = new Tokenizer( reader, true, false, true, indexer.patterns_file );\r\n\t\t\t\twhile (tok.hasMoreTokens()) {\r\n\t\t\t\t\ths.add(tok.nextToken());\r\n\t\t\t\t}\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tIterator<String> iter = hs.iterator();\r\n\t\t\twhile(iter.hasNext()){\r\n\t\t\t\tString s = iter.next();\r\n\t\t\t\tif(qm.containsKey(s)){\r\n\t\t\t\t\tDouble tmp = qm.get(s);\r\n\t\t\t\t\tqm.put(s, tmp + beta * postingsentry.score);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tqm.put(s, beta * postingsentry.score);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tLinkedList<String> term = new LinkedList<>();\r\n\tLinkedList<Double> weight = new LinkedList<>();\r\n\tList<Map.Entry<String,Double>> answer = new ArrayList<Map.Entry<String,Double>>(qm.entrySet());\r\n\tanswer.sort((e1,e2) -> e2.getValue().compareTo(e1.getValue())); // sorterar efter värde så att orden med högst score ligger först\r\n\tfor (int i = 0; i < answer.size(); i++) {\r\n\t\tterm.add(answer.get(i).getKey());\r\n\t\tweight.add(answer.get(i).getValue()/answer.size());\r\n\t}\r\n\r\n\tterms = term;\r\n\tweights = weight;\r\n\t}", "@Override\n public double score(Document document) {\n Set<String> allDocTerms = documentsTerms.termsExtractedFromDocument(document).allTerms();\n\n //keeping only the query terms that are in the document\n Collection<String> relevantTerms = new LinkedHashSet<>(query);\n relevantTerms.retainAll(allDocTerms);\n\n //compute score using a sum formula on each query term\n int docLength = termsOccurences.get(document).totalNumberOfOccurences();\n double score = 0.0;\n for (String term : relevantTerms) {\n double termIDF = idf.weight(term);\n double termTF = tf.weight(term, document);\n\n score += termIDF * (termTF * (k1 + 1)) / (termTF + k1 * (1 - b + b * (docLength / averageDocLength)));\n }\n\n return score;\n }", "@Test\n public void testQueries() {\n nuxeoClient.repository().createDocumentById(testWorkspaceId, new Document(\"file1\", \"File\"));\n nuxeoClient.repository().createDocumentById(testWorkspaceId, new Document(\"file2\", \"File\"));\n\n // Get descendants of Workspaces\n String query = \"select * from Document where ecm:path startswith '/default-domain/workspaces'\";\n Documents documents = nuxeoClient.repository().query(query, \"10\", \"0\", \"50\", \"ecm:path\", \"asc\", null);\n assertEquals(3, documents.size());\n\n // Get all the File documents\n // TODO\n\n // Content of a given Folder, using a page provider\n // TODO\n }", "public void performQuerylessSearchWithPersonalization(RestHighLevelClient client) throws IOException{\n String csvFile = \"ADD PATH\";\n String pathForSubmissionFile = \"ADD PATH\";\n BufferedReader br = null;\n PrintWriter writer = null;\n String line = \"\";\n String csvSpliter = \";\"; \n List<String> reRankedProds;\n Long count= 0L;\n \n try{\n System.out.println(\"Iterating through test_only_queries...\");\n br = new BufferedReader(new FileReader(csvFile));\n writer = new PrintWriter(pathForSubmissionFile,\"UTF-8\");\n while((line = br.readLine())!=null){\n count++;\n String[] info = line.split(csvSpliter);\n String queryId = info[0];\n String userId = info[2];\n String[] items = info[info.length - 1].split(\",\");\n String category = info[info.length - 2];\n \n \n if(!userId.trim().equals(\"NA\")){\n reRankedProds = performPersonalizedQuerylessSearch(client,Integer.parseInt(userId),category,items);\n writer.println(queryId + \" \" + reRankedProds.toString().replace(\"[\", \"\").replace(\"]\", \"\").replace(\" \", \"\"));\n }else{\n reRankedProds = performPersonalizedQuerylessSearch(client,category,items);\n writer.println(queryId + \" \" + reRankedProds.toString().replace(\"[\", \"\").replace(\"]\", \"\").replace(\" \",\"\"));\n }\n \n }\n writer.close();\n } catch(FileNotFoundException e){\n e.printStackTrace();\n } catch (IOException e){\n e.printStackTrace();\n } finally{\n if (br != null) {\n try {\n br.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n client.close();\n }", "@Test\n public void testCombinePageRankTfIdf() {\n\n Iterator<Pair<Document, Double>> resultIterator = icsSearchEngine.searchQuery(\n Arrays.asList(\"ISG\", \"Bren\", \"School\", \"UCI\"),\n 100, 100.0);\n ImmutableList<Pair<Document, Double>> resultList = ImmutableList.copyOf(resultIterator);\n\n // first result should be \"isg.ics.uci.edu\"\n Assert.assertEquals(\"isg.ics.uci.edu\", getDocumentUrl(resultList.get(0).getLeft().getText()));\n\n // top 10 should have URLs starting \"hobbes.ics.uci.edu\"\n Assert.assertTrue(resultList.stream().limit(10).map(p -> getDocumentUrl(p.getLeft().getText()))\n .anyMatch(p -> p.contains(\"hobbes.ics.uci.edu\")));\n\n // top 50 should have URL \"ipubmed2.ics.uci.edu\"\n Assert.assertTrue(resultList.stream().limit(50).map(p -> getDocumentUrl(p.getLeft().getText()))\n .anyMatch(p -> p.equals(\"ipubmed2.ics.uci.edu\")));\n\n }", "int getNumberOfDocuments();", "private void updatePrecisionAndRecallAndAp(List<ScoreRetrieval> results, List<QuerieDocRelevance> queryRelevance){\n List<Double> precisionQuerieAP = new ArrayList<>();\n List<Double> precisionQuerieAPRankedTop = new ArrayList<>();\n int tp=0;\n int fp=0;\n int fn=0;\n int cont=0;\n int rankMax=10;\n \n //results.stream().map(ScoreRetrieval::getDocId).filter( docId -> querieRelevance.contains(docId)).mapToInt(List::size).sum();\n \n for(ScoreRetrieval result : results){\n if(queryRelevance.stream().filter(o -> o.getDocID()==result.getDocId()).findFirst().isPresent()){ \n tp++;\n precisionQuerieAP.add(tp/(double)(tp+fp));\n if(cont<rankMax){\n precisionQuerieAPRankedTop.add(tp/(double)(tp+fp));\n }\n }else{\n fp++;\n }\n cont++;\n }\n if(precisionQuerieAP.isEmpty()){\n apRes.add(0.0);\n }else{\n apRes.add(precisionQuerieAP.stream().mapToDouble(d->d).sum()/precisionQuerieAP.size());\n }\n if(precisionQuerieAPRankedTop.isEmpty()){\n apResRankedTopLimited.add(0.0);\n }else{\n apResRankedTopLimited.add(precisionQuerieAPRankedTop.stream().mapToDouble(d->d).sum()/precisionQuerieAPRankedTop.size());\n }\n \n \n for(QuerieDocRelevance querieRel : queryRelevance){\n if(!(results.stream().filter(q -> q.getDocId()==querieRel.getDocID()).findFirst().isPresent())){\n fn++; \n }\n }\n \n precision.add(tp/(double)(tp+fp));\n recall.add(tp/(double)(tp+fn));\n }", "Set<Document> findDocuments(Map<String, String> fields, int offset, int numberOfResults);", "private static void statisticOffer() {\n\t\tString url = \"localhost\";\n\t\tint port = 27017;\n\t\tString dbName = \"dulishuo\";\n\t\tDB db = MongoUtil.getConnection(url, port, dbName);\n\t\t\n\t\tDBCollection offer = db.getCollection(\"offer\"); \n\t DBCursor find = offer.find();\n\t \n\t while(find.hasNext()){\n\t \t\n\t }\n\t}", "public ArrayList<Document> politicalSearch(String Politicals)\n {\n ArrayList<Document> users = new ArrayList<Document>();\n try{\n IndexReader reader = DirectoryReader.open(FSDirectory.open(Paths.get(\"indice/\")));\n IndexSearcher searcher = new IndexSearcher(reader);\n Analyzer analyzer = new StandardAnalyzer();\n QueryParser parser = new QueryParser(\"text\",analyzer);\n Query query = parser.parse(Politicals);\n TopDocs result = searcher.search(query,25000);\n ScoreDoc[] hits =result.scoreDocs;\n for (int i = 0; i < hits.length; i++){\n Document doc = searcher.doc(hits[i].doc);\n if(Integer.parseInt(doc.get(\"userFollowersCount\")) > 1000){\n users.add(doc);\n }\n }\n reader.close();\n }\n catch(IOException | ParseException ex){\n Logger.getLogger(Lucene.class.getName()).log(Level.SEVERE,null,ex);\n }\n return users;\n }", "int numDocuments();", "public void testAdvancedQuery() {\n\t\t//manager.advancedQuery(ElasticIndex.analyzed, \"metropolitan areas\", \"sports clubs\");\n\t\t//manager.advancedQuery(ElasticIndex.analyzed, \"\", \"Award\");\n\n\t//manager.advancedQuery(ElasticIndex.analyzed,\"american actor\", \"list of movies starring Sean Connery\");\n//\tmanager.categorySearch(\"Sportspeople\", \"tennis\",ElasticIndex.analyzed,30);\n\t//manager.advancedQuery(ElasticIndex.analyzed,\"Broadway musicals\", \"Grammy Award\");\n\t//manager.advancedQuery(ElasticIndex.analyzed,\"musical movies\", \"Tony Award\");\n\t//manager.advancedQuery(ElasticIndex.analyzed,\"Top level football leagues\", \"teams\");\n\t//manager.advancedQuery(ElasticIndex.analyzed,\"american movies\", \"directed by Woody Allen\");\n\t//manager.advancedQuery(ElasticIndex.analyzed,\"United states\", \"professional sports teams\");\n\t\t//manager.advancedQuery(\"musical movies\", \"tony award\");\n\t\t//manager.advancedQuery(\"grammy\", \"best album in 2012\"); \n\t\t//manager.advancedQuery(\"american movies\", \"directed by Woody Allen\"); \n\t\t//Canceled manager.advancedQuery(\"tennis\", \"international players\"); \n\t\t// canceled manager.advancedQuery(\"tennis\", \"french open\"); \n\t\t// canceled manager.advancedQuery(\"film movie\", \"1933\"); \n//\t\tmanager.advancedQuery(\"United states\", \"professional sports teams \");\n//\t\t manager.advancedQuery(\"computer games\", \"developed by Ubisoft\");\n//\t\tmanager.advancedQuery(\"movies\", \"academy award nominations\");\n //manager.advancedQuery(\"movies\", \"starring Dustin Hoffman\");\n // manager.advancedQuery(\"movies\", \"best costume design\");\n // manager.advancedQuery(\"concert tours\", \"england\");\n // manager.advancedQuery(\"sport\", \"Francesco\");\n\t\t//System.out.println(\"******* advanced query *******\");\n\t\t//manager.advancedQuery(\"sportspeople\", \"tennis\");\n//\t\tmanager.advancedQuery(ElasticIndex.analyzed, \"Broadway musicals\", \"Grammy Award\");\n //System.out.println(\"*****************************\");\n\n\n\t\t\n\t\t//manager.advancedQuery(\"football\", \"italian championship\");\n\t\t//manager.advancedQuery(\"american basketball\", \"team\");\n\t\t //manager.advancedQuery(\"Goya Award\", \"Winner and nominees from FRA\");\n\t\t//manager.advancedQuery(\"films\", \"american comedy \");\n\t\t//manager.advancedQuery(\"films\", \"american Adventure directed by James P. Hogan\");\n\t\t//manager.advancedQuery(\"NCAA Division\", \"american universities in Arkansas\");\n\t\t//manager.advancedQuery(\"Academy award\", \"winners and nominees in acting in 2011\");\n\t\t//manager.advancedQuery(\"canadian soccer\", \"Alain Rochat position \");\n\n\t}", "public interface RelatedDocumentSearchRepository extends ElasticsearchRepository<RelatedDocument, Long> {\n}", "public interface ArticleRepository extends ElasticsearchRepository<Article, String> {\n\n Page<Article> findByTitle(String title, Pageable pageable);\n\n @Query(\"{\\\"bool\\\": {\\\"must\\\": [{\\\"match\\\": {\\\"title\\\": \\\"?0\\\"}}]}}\")\n Page<Article> findByAuthorsNameUsingCustomQuery(String title, Pageable pageable);\n}", "public interface mySolrInter extends SolrCrudRepository<CluesDocument,String> {\n @Query(value = \"*:*\")\n @Facet(fields = { \"brandName\" }, limit = 5)\n FacetPage<CluesDocument> findAllFacetOnName(Pageable page);\n}", "@Override\r\n\t\t\tpublic double matchingItems(Query query, Set<Document> documents,\r\n\t\t\t\t\tint docsPerQuery) {\n\t\t\t\treturn 0;\r\n\t\t\t}", "private double rankByBM25(List<String> query, String docId, HashMap<String,Integer> queryWordsTFPerDoc){\n int termFrequency, documentFrequency;\n double numOfDocs = documentDetails.size(), idf, rank = 0, k = 1.2, b = 0.75, numerator, denominator;\n int documentLength = Integer.valueOf(documentDetails.get(docId)[3]);\n\n for(String term : query){\n if(queryWordsTFPerDoc.containsKey(term.toUpperCase())) {\n term = term.toUpperCase();\n }\n else if(queryWordsTFPerDoc.containsKey(term.toLowerCase())){\n term = term.toLowerCase();\n }\n termFrequency = queryWordsTFPerDoc.getOrDefault(term,0);\n\n if(termFrequency != 0) {\n documentFrequency = Integer.valueOf(termsDF.get(term));\n idf = log2(numOfDocs / documentFrequency);\n\n numerator = termFrequency * (k + 1);\n denominator = termFrequency + k * (1 - b + b * (documentLength / averageDocumentLength));\n\n rank += idf * (numerator / denominator);\n }\n }\n return rank;\n }", "@Override\n public SearchDocument nextDocument(SearchQuery query, int docId) {\n return null;\n }", "public QueryController(String[] args){\n // Parse Args\n QueryArgs queryArgs = new QueryArgs();\n try {\n queryArgs.parseArgs(args);\n } catch (FileNotFoundException e) {\n //e.printStackTrace();\n System.err.println(\"Invalid Arguments received. Please check your arguments passed to ./search\");\n return;\n }\n\n // Run the Term Normaliser\n TermNormalizer normalizer = new TermNormalizer();\n String[] queryTerms = normalizer.transformedStringToTerms(queryArgs.queryString);\n\n //create the model\n Model model = new Model();\n model.loadCollectionFromMap(queryArgs.mapPath);\n model.loadLexicon(queryArgs.lexiconPath);\n model.loadInvertedList(queryArgs.invlistPath);\n if(queryArgs.stopListEnabled)\n {\n model.loadStopList(queryArgs.stopListPath);\n }\n if(queryArgs.printSummary && queryArgs.collectionPath != \"\")\n {\n model.setPathToCollection(queryArgs.collectionPath);\n }\n\n\n //fetch the top results from the query module\n QueryModule queryModule = new QueryModule();\n queryModule.doQuery(queryTerms, model, queryArgs.bm25Enabled);\n List<QueryResult> topResults = queryModule.getTopResult(queryArgs.maxResults);\n\n\n\n ResultsView resultsView = new ResultsView();\n if(queryArgs.printSummary)\n {\n\n DocSummary docSummary = new DocSummary();\n for(QueryResult result:topResults)\n {\n // retrieve the actualy text from the document collection\n result.setDoc(model.getDocumentCollection().getDocumentByIndex(result.getDoc().getIndex(), true));\n\n //set the summary on the result object by fetching it from the docSummary object\n result.setSummaryNQB(docSummary.getNonQueryBiasedSummary(result.getDoc(), model.getStopListModule()));\n result.setSummaryQB(docSummary.getQueryBiasedSummary(result.getDoc(), model.getStopListModule(), Arrays.asList(queryTerms)));\n }\n resultsView.printResultsWithSummary(topResults,queryArgs.queryLabel);\n }else\n {\n resultsView.printResults(topResults,queryArgs.queryLabel);\n }\n\n }", "public void index(List<ParsedDocument> pdocs,int qid) {\n\t\ttry {\n\t\t\tint count = iw.maxDoc()+1;\n\t\t\tDocument doc = null;\n\t\t\tIndexDocument iDoc=null;\n\t\t\tfor (ParsedDocument pdoc : pdocs) {\n\t\t\t\t\n\t\t\t\tiDoc=parseDocument(pdoc);\n\t\t\t\tif(iDoc==null){\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tField queryField = new Field(\"qid\", qid+\"\", Store.YES,\n\t\t\t\t\t\tIndex.NOT_ANALYZED);\n\t\t\t\tField uniqueField = new Field(\"id\", count + \"\", Store.YES,\n\t\t\t\t\t\tIndex.NOT_ANALYZED);\n\t\t\t\tField titleField = new Field(\"title\", iDoc.getTitle(),\n\t\t\t\t\t\tStore.YES, Index.ANALYZED, TermVector.YES);\n\t\t\t\tField bodyField = new Field(\"body\", iDoc.getBody(), Store.YES,\n\t\t\t\t\t\tIndex.ANALYZED, TermVector.YES);\n\t\t\t\tField urlField = new Field(\"url\", iDoc.getUrl(), Store.YES,\n\t\t\t\t\t\tIndex.NOT_ANALYZED);\n\t\t\t\tField anchorField = new Field(\"anchor\", iDoc.getAnchor(), Store.YES,\n\t\t\t\t\t\tIndex.ANALYZED, TermVector.YES);\n\n\t\t\t\tdoc = new Document();\n\t\t\t\tdoc.add(uniqueField);//标示不同的document\n\t\t\t\tdoc.add(queryField);//标示不同的query\n\t\t\t\tdoc.add(titleField);\n\t\t\t\tdoc.add(bodyField);\n\t\t\t\tdoc.add(urlField);\n\t\t\t\tdoc.add(anchorField);\n\t\t\t\t\n\t\t\t\tiw.addDocument(doc);\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\tiw.commit();\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} \n\t}", "public interface DroitaccesDocumentSearchRepository extends ElasticsearchRepository<DroitaccesDocument, Long> {\n}", "public List<Document> execute(){\n if(!advancedQuery)\n return convertToDocumentsList(executeRegularQuery());\n else\n return convertToDocumentsList(executeAdvancedQuery());\n }", "public /*TreeMap<String, Float>*/void getTopnTermsOverlapWithQuery() throws IOException, ParseException{\n\t\tString outputfile = \"./output/score/test3.txt\";\n\n\t\tFileOutputStream out = new FileOutputStream(outputfile);\n\t\tPrintStream ps = new PrintStream(out);\n\t\t/*-------------------------------------------------------------------------------*/\n\n\t\tTreeMap<String,Float> termsscoressorted = null;\n\t\tCollectionReader reader = new CollectionReader(indexDir); \n\t\tIndexReader ir = reader.getIndexReader();\t\t\n\n\t\tTopicsInMemory topics = new TopicsInMemory(\"data/CLEF-IP-2010/PAC_test/topics/PAC_topics-test2.xml\"/*omit-PAC-1094.xml\"*/);\n\t\tfor(Map.Entry<String, PatentDocument> topic : topics.getTopics().entrySet()){\n\t\t\tString qUcid = topic.getValue().getUcid();\n\t\t\tString queryid = topic.getKey();\n\t\t\tString queryName = topic.getKey() + \"_\" + topic.getValue().getUcid();\n\t\t\tString queryfile = topic.getKey() + \"_\" + topic.getValue().getUcid() + \".xml\";\n\n\t\t\t/*System.out.println(\"=========================================\");\n\t\t\tSystem.out.println(queryName);\n\t\t\tSystem.out.println(\"=========================================\");*/\n\t\t\t/*int docid = reader.getDocId(\"UN-EP-0663270\", PatentDocument.FileName);\n\t\t\tir.getTermVector(docid, field) getTermVectors(b);*/\n\n\t\t\tEvaluateResults er = new EvaluateResults();\n\t\t\tArrayList<String> tps = er.evaluatePatents(queryid, \"TP\");\n\t\t\tArrayList<String> fps = er.evaluatePatents(queryid, \"FP\");\n\t\t\tHashMap<String, Float> /*TFreqs*/ termsscores = new HashMap<>();\n\n\n\t\t\t/*--------------------------------- Query Words -------------------------------*/\n\t\t\t//\t\t\tHashMap<String, Integer> query_termsfreqspair = reader.gettermfreqpair(qUcid, PatentDocument.Description);\n\t\t\tHashSet<String> query_terms = reader.getDocTerms(qUcid, PatentDocument.Description);\n\t\t\t//\t\t\tSystem.out.println(query_termsfreqspair.size() +\"\\t\"+ query_termsfreqspair);\n//\t\t\tSystem.out.println(query_terms.size() + \"\\t\" + query_terms);\n\t\t\t/*-----------------------------------------------------------------------------*/\t\t\t\n\n\n\t\t\t//\t\t\tSystem.out.println(\"-----TPs----\");\n\t\t\tfor (String tp : tps) {\n\t\t\t\t/*System.out.println(\"---------\");\n\t\t\t\tSystem.out.println(tp);*/\n\t\t\t\tHashMap<String, Integer> termsfreqsTP = reader.gettermfreqpairAllsecs(\"UN-\" + tp);\n\n\t\t\t\tfor(Entry<String, Integer> tfTP:termsfreqsTP.entrySet()){\n\t\t\t\t\tif(termsscores.containsKey(tfTP.getKey())){\n\t\t\t\t\t\ttermsscores.put(tfTP.getKey(), termsscores.get(tfTP.getKey()) + (float)tfTP.getValue()/tps.size());\n\t\t\t\t\t}else{\n\t\t\t\t\t\t//\t\t\t\t\t\tfloat test = (float)t.getValue()/tps.size();\n\t\t\t\t\t\t//\t\t\t\t\t\tSystem.out.println(test);\n\t\t\t\t\t\ttermsscores.put(tfTP.getKey(), (float)tfTP.getValue()/tps.size());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//\t\t\t\tSystem.out.println(termsscores.size() + \" \" + termsscores);\t\t\t\t\t\n\t\t\t}\n\n\t\t\t/*System.out.println();\n\t\t\tSystem.out.println(\"-----FNs----\");*/\n\t\t\tfor (String fp : fps) {\n\t\t\t\t/*System.out.println(\"---------\");\n\t\t\t\tSystem.out.println(fp);*/\n\t\t\t\tHashMap<String, Integer> termsfreqsFP = reader.gettermfreqpairAllsecs(\"UN-\" + fp);\n\n\t\t\t\tfor(Entry<String, Integer> t:termsfreqsFP.entrySet()){\n\t\t\t\t\tif(termsscores.containsKey(t.getKey())){\n\t\t\t\t\t\ttermsscores.put(t.getKey(), termsscores.get(t.getKey()) - (float)t.getValue()/fps.size());\n\t\t\t\t\t}else{\t\t\t\t\t\t\n\t\t\t\t\t\ttermsscores.put(t.getKey(), -(float)t.getValue()/fps.size());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//\t\t\t\tSystem.out.println(TFreqs.size() + \" \" + TFreqs);\n\t\t\t}\n\t\t\t//\t\t\tSystem.out.println(termsscores.size() + \" \" + termsscores);\n\t\t\tValueComparator bvc = new ValueComparator(termsscores);\n\t\t\ttermsscoressorted = new TreeMap<String,Float>(bvc);\t\t\t\n\t\t\ttermsscoressorted.putAll(termsscores);\n\t\t\tSystem.out.println(queryid + \"\\t\"+ termsscoressorted.size() + \"\\t\" + termsscoressorted/*.keySet()*/);\n\t\t\tint overlap = 0;\n\t\t\tint i = 0;\n\t\t\tfor(Entry<String, Float> scoresorted:termsscoressorted.entrySet()){\n\t\t\t\ti++;\n\t\t\t\tif(i<=100){\n\t\t\t\t\tif(query_terms.contains(scoresorted.getKey())){\n\t\t\t\t\t\toverlap++;\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t\tSystem.out.println(queryName + \"\\t\"+overlap);\n//\t\t\tps.println(queryName + \"\\t\"+overlap);\n\t\t}\n\t}", "private ArrayList<WordDocument> executeAdvancedQuery(){\n ArrayList<WordDocument> documents = customDijkstrasTwoStack(this.query.split(\" \"));\n ArrayList<WordDocument> result = new ArrayList<WordDocument>();\n\n try{\n String[] orderByPart = query.substring(query.indexOf(\"ORDERBY\")).trim().toLowerCase().split(\" \");\n if(isOrderByCommand(orderByPart[0]))\n result = orderBy(documents, orderByPart[1], orderByPart[2]);\n }catch (StringIndexOutOfBoundsException ex){\n result = documents;\n }\n\n return result;\n }", "int[] allDocs();", "SearchResponse search(Pageable pageable, QueryBuilder query, Collection<AggregationBuilder> aggregations);", "abstract public int maxDoc();", "public static void pageRankmain() {\n\t\t\t\n\t\t\tstopWordStore();\n\t\t\t//File[] file_read= dir.listFiles();\n\t\t\t//textProcessor(file_read);// Will be called from LinkCrawler\n\t\t\t//queryProcess();\n\t\t\t//System.out.println(\"docsave \"+ docsave);\n\t\t\t/*for ( Map.Entry<String, ArrayList<String>> entry : docsave.entrySet()) {\n\t\t\t String key = entry.getKey();\n\t\t\t List<String> values = entry.getValue();\n\t\t\t System.out.print(\"Key = \" + key);\n\t\t\t System.out.println(\" , Values = \"+ values);\n\t\t\t}*/\n\t\t\t//########## RESPOINSIBLE FOR CREATING INVERTED INDEX OF TERMS ##########\n\t\t\tfor(int i=0;i<vocabulary.size();i++) {\n\t\t\t\tint count=1;\n\t\t\t\tMap<String, Integer> nestMap = new HashMap<String, Integer>();\n\t\t\t\tfor ( Map.Entry<String, ArrayList<String>> entry : docsave.entrySet()) {\n\t\t\t\t String keyMain = entry.getKey();\n\t\t\t\t List<String> values = entry.getValue();\n\t\t\t\t if(values.contains(vocabulary.get(i)))\n\t\t\t\t \t{\n\t\t\t\t \tentryDf.put(vocabulary.get(i), count);//entryDf stores documents frequency of vocabulary word \\\\it increase the count value for specific key\n\t\t\t\t \tcount++;\n\t\t\t\t \t}\n\t\t\t\t \n\t\t\t\t nestMap.put(keyMain, Collections.frequency(values,vocabulary.get(i)));\n\t\t\t \t\n\t\t\t \t//System.out.println(\"VOC \"+ vocabulary.get(i)+ \" KeyMain \" +keyMain+ \" \"+ Collections.frequency(values,vocabulary.get(i)));\n\t\t\t\t\t}\n\t\t\t\t\ttfList.put(vocabulary.get(i), nestMap);\n\t\t\t}\n\t\t\t//########## RESPOINSIBLE FOR CREATING A MAP \"storeIdf\" TO STORE IDF VALUES OF TERMS ##########\n\t\t\tfor ( Map.Entry<String, Integer> endf : entryDf.entrySet()) {\n\t\t\t\tString keydf = endf.getKey();\n\t\t\t\tint valdf = endf.getValue();\n\t\t\t\t//System.out.print(\"Key = \" + \"'\"+keydf+ \"'\");\n\t\t\t //System.out.print(\" , Values = \"+ valdf);\n\t\t\t double Hudai = (double) (docsave.size())/valdf;\n\t\t\t //System.out.println(\"docsave size \"+docsave.size()+ \" valdf \"+ valdf + \" Hudai \"+ Hudai+ \" log Value1 \"+ Math.log(Hudai)+ \" log Value2 \"+ Math.log(2));\n\t\t\t double idf= Math.log(Hudai)/Math.log(2);\n\t\t\t storeIdf.put(keydf, idf);\n\t\t\t //System.out.print(\" idf-> \"+ idf);\n\t\t\t //System.out.println();\n\t\t\t} \n\t\t\t\n\t\t\t//############ Just for Printing ##########NO WORK HERE########\n\t\t\tfor (Map.Entry<String, Map<String, Integer>> tokTf : tfList.entrySet()) {\n\t\t\t\tString keyTf = tokTf.getKey();\n\t\t\t\tMap<String, Integer> valTF = tokTf.getValue();\n\t\t\t\tSystem.out.println(\"Inverted Indexing by Key Word = \" + \"'\"+keyTf+ \"'\");\n\t\t\t\tfor (Map.Entry<String, Integer> nesTf : valTF.entrySet()) {\n\t\t\t\t\tString keyTF = nesTf.getKey();\n\t\t\t\t\tInteger valTf = nesTf.getValue();\n\t\t\t\t\tSystem.out.print(\" Document Consists This Key Word = \" + \"'\"+ keyTF+ \"'\");\n\t\t\t\t\tSystem.out.println(\" , Term Frequencies in This Doc = \"+ valTf);\n\t\t\t\t} \n\t\t\t}\n\t\t\t//########### FOR CALCULATING DOCUMENT LENTH #############//\n\t\t\tfor ( Map.Entry<String, ArrayList<String>> entry_new : docsave.entrySet()) // Iterating Number of Documents\n\t\t\t{\n\t\t\t\tString keyMain_new = entry_new.getKey();\n\t\t\t\t//int countStop=0;\n\t\t\t\tdouble sum=0;\n\t\t\t\t for(Map.Entry<String, Map<String, Integer>> tokTf_new : tfList.entrySet()) // Iterating through the vocabulary\n\t\t\t\t { \n\t\t\t\t\t Map<String, Integer> valTF_new = tokTf_new.getValue();\n\t\t\t\t\t for (Map.Entry<String, Integer> nesTf_new : valTF_new.entrySet()) // Iterating Through the Documents\n\t\t\t\t\t {\n\t\t\t\t\t\t if(keyMain_new.equals(nesTf_new.getKey())) // Only doc name EQUAL with docsave name can enter here\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t double val = nesTf_new.getValue()* (Double) storeIdf.get(tokTf_new.getKey());\n\t\t\t\t\t\t\t sum = sum+ Math.pow(val, 2);\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t\t //countStop++;\n\t\t\t\t }\n\t\t\t\t docLength.put(keyMain_new, Math.sqrt(sum));\n\t\t\t\t sum=0;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(\"Document Length \"+ docLength);\n\t\t\t//System.out.println(\"tfList \"+tfList);\n\t\t\t\n\t\t\t //########### FOR CALCULATING QUERY LENTH #############///\n\t\t\t\tdouble qrySum=0;\n\t\t\t\t for(String qryTerm: queryList) // Iterating through the vocabulary\n\t\t\t\t {\n\t\t\t\t\t//entryQf.put(qryTerm, Collections.frequency(queryList,qryTerm));// VUl ase\n\t\t\t\t\t \n\t\t\t\t\t\t if(storeIdf.get(qryTerm) != null) \n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t entryQf.put(qryTerm, Collections.frequency(queryList,qryTerm));\n\t\t\t\t\t\t\t double val = entryQf.get(qryTerm)* (Double) storeIdf.get(qryTerm);\n\t\t\t\t\t\t\t qrySum = qrySum+ Math.pow(val, 2);\n\t\t\t\t\t\t }\n\t\t\t\t\t System.out.println(qryTerm+\" \"+entryQf.get(qryTerm)+ \" \"+ (Double) storeIdf.get(qryTerm));\n\t\t\t\t }\n\t\t\t\t qrySum=Math.sqrt(qrySum);\n\t\t\t\t System.out.println(\"qrySum \" + qrySum);\n\t\t\t\t \n\t\t\t\t//########### FOR CALCULATING COSINE SIMILARITY #############///\n\t\t\t\t for ( Map.Entry<String, ArrayList<String>> entry_dotP : docsave.entrySet()) // Iterating Number of Documents\n\t\t\t\t\t{\n\t\t\t\t\t\tdouble sumProduct=0;\n\t\t\t\t\t\tdouble productTfIdf=0;\n\t\t\t\t\t\tString keyMain_new = entry_dotP.getKey(); //Geting Doc Name\n\t\t\t\t\t\t for(Map.Entry<String, Integer> qryTermItr : entryQf.entrySet()) // Iterating through the vocabulary\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t Map<String, Integer> matchTerm = tfList.get(qryTermItr.getKey()); // Getting a map of doc Names by a Query Term as value of tfList\n\n\t\t\t\t\t\t\t\t if(matchTerm.containsKey(keyMain_new)) // Only doc name EQUAL with docsave name can enter here\n\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t //System.out.println(\"Test \"+ matchTerm.get(keyMain_new) +\" keyMain_new \" + keyMain_new);\n\t\t\t\t\t\t\t\t\t double docTfIdf= matchTerm.get(keyMain_new) * storeIdf.get(qryTermItr.getKey());\n\t\t\t\t\t\t\t\t\t double qryTfIdf= qryTermItr.getValue() * storeIdf.get(qryTermItr.getKey());\n\t\t\t\t\t\t\t\t\t productTfIdf = docTfIdf * qryTfIdf;\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t sumProduct= sumProduct+productTfIdf;\n\t\t\t\t\t\t\t //System.out.println(\"productTfIdf \"+productTfIdf+\" sumProduct \"+ sumProduct);\n\t\t\t\t\t\t\t productTfIdf=0;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t cosineProd.put(entry_dotP.getKey(), sumProduct/(docLength.get(entry_dotP.getKey())*qrySum));\n\t\t\t\t\t\t sumProduct=0;\n\t\t\t\t\t\t //System.out.println(entry_dotP.getKey()+ \" \" + docLength.get(entry_dotP.getKey()));\n\t\t\t\t\t}\n\t\t\t\t System.out.println(\"cosineProd \"+ cosineProd);\n\t\t\t\t \n\t\t\t\t System.out.println(\"Number of Top Pages you want to see\");\n\t\t\t\t int topRank = Integer.parseInt(scan.nextLine());\n\t\t\t\t Map<String, Double> result = cosineProd.entrySet().stream()\n\t\t\t .sorted(Map.Entry.comparingByValue(Comparator.reverseOrder())).limit(topRank)\n\t\t\t .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue,\n\t\t\t (oldValue, newValue) -> oldValue, LinkedHashMap::new));\n\n\t\t\t\t scan.close();\n\t\t\t //Alternative way\n\t\t\t //Map<String, Double> result2 = new LinkedHashMap<>();\n\t\t\t //cosineProd.entrySet().stream().sorted(Map.Entry.<String, Double>comparingByValue().reversed()).limit(2).forEachOrdered(x -> result2.put(x.getKey(), x.getValue()));\n\n\t\t\t System.out.println(\"Sorted...\");\n\t\t\t System.out.println(result);\n\t\t\t //System.out.println(result2);\n\t}", "public void search(Indexer indexer, CityIndexer cityIndexer, Ranker ranker, String query, boolean withSemantic, ArrayList<String> chosenCities, ObservableList<String> citiesByTag, boolean withStemming, String saveInPath, String queryId, String queryDescription) {\n String[] originalQueryTerms = query.split(\" \");\n String originQuery = query;\n docsResults = new HashMap<>();\n parser = new Parse(withStemming, saveInPath, saveInPath);\n HashSet<String> docsOfChosenCities = new HashSet<>();\n query = \"\" + query + queryDescription;\n HashMap<String, Integer> queryTerms = parser.parseQuery(query);\n HashMap<String, ArrayList<Integer>> dictionary = indexer.getDictionary();\n if (!withStemming){\n setDocsInfo(saveInPath + \"\\\\docsInformation.txt\");\n }\n else{\n setDocsInfo(saveInPath + \"\\\\docsInformation_stemming.txt\");\n }\n\n\n //add semantic words of each term in query to 'queryTerms'\n if(withSemantic) {\n HashMap<String,ArrayList<String>> semanticWords = ws.connectToApi(originQuery);\n }\n\n //give an ID to query if it's a regular query (not queries file)\n if(queryId.equals(\"\")){\n queryId = \"\" + Searcher.queryID;\n Searcher.queryID++;\n }\n\n String postingDir;\n if (!withStemming) {\n postingDir = \"\\\\indexResults\\\\postingFiles\";\n } else {\n postingDir = \"\\\\indexResults\\\\postingFiles_Stemming\";\n }\n int pointer = 0;\n\n //find docs that contain the terms in the query in their text\n HashMap<String, Integer> queryTermsIgnoreCase = new HashMap<>();\n for (String term : queryTerms.keySet()) {\n String originTerm = term;\n if (!dictionary.containsKey(term.toUpperCase()) && !dictionary.containsKey(term.toLowerCase())) {\n continue;\n }\n if(dictionary.containsKey(term.toLowerCase())){\n term = term.toLowerCase();\n }\n else {\n term = term.toUpperCase();\n }\n queryTermsIgnoreCase.put(term,queryTerms.get(originTerm));\n pointer = dictionary.get(term).get(2);\n String chunk = (\"\" + term.charAt(0)).toUpperCase();\n\n //get the relevant line from posting file\n BufferedReader br = null;\n try {\n br = new BufferedReader(new FileReader(new File(saveInPath + postingDir + \"\\\\posting_\" + chunk + \".txt\")));\n String line = \"\";\n int i = 1;\n while ((line = (br.readLine())) != null) {\n if (i == pointer) {\n break;\n }\n i++;\n }\n br.close();\n\n //get docs from posting line and add them to the data structure 'docsResults'\n if(line != null) {\n findDocsFromLine(line, term);\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n //find docs that contain the chosen cities in their text\n for (String cityTerm : chosenCities) {\n if (!dictionary.containsKey(cityTerm) && !dictionary.containsKey(cityTerm.toLowerCase())) {\n continue;\n }\n if(dictionary.containsKey(cityTerm.toLowerCase())){\n cityTerm = cityTerm.toLowerCase();\n }\n pointer = dictionary.get(cityTerm).get(2);\n // char chunk = indexer.classifyToPosting(term).charAt(0);\n String chunk = (\"\" + cityTerm.charAt(0)).toUpperCase();\n\n //get the relevant line from posting file\n BufferedReader br = null;\n try {\n br = new BufferedReader(new FileReader(new File(saveInPath + postingDir + \"\\\\posting_\" + chunk + \".txt\")));\n String line = \"\";\n int i = 1;\n while ((line = (br.readLine())) != null) {\n if (i == pointer) {\n break;\n }\n i++;\n }\n br.close();\n\n //get docs from posting line and add them to the data structure 'docsOfChosenCities'\n String docs = line.substring(0, line.indexOf(\"[\") - 1); //get 'docsListStr'\n String[] docsArr = docs.split(\";\");\n for (String docInfo : docsArr) {\n String doc = docInfo.substring(0, docInfo.indexOf(\": \"));\n while(doc.charAt(0) == ' '){\n doc = doc.substring(1);\n }\n docsOfChosenCities.add(doc);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n //find docs that contain the chosen cities in their city tag\n if(!chosenCities.isEmpty()){\n for (String cityDicRec: chosenCities) {\n //get pointer to posting from cityDictionary\n try {\n pointer = cityIndexer.getCitiesDictionary().get(cityDicRec);\n } catch (NumberFormatException e) {\n e.printStackTrace();\n }\n //get the relevant line from posting file\n BufferedReader br = null;\n try {\n br = new BufferedReader(new FileReader(new File(saveInPath + \"\\\\cityIndexResults\" + \"\\\\posting_city\" + \".txt\")));\n String line = \"\";\n int i = 1;\n while ((line = (br.readLine())) != null) {\n if (i == pointer) {\n break;\n }\n i++;\n }\n br.close();\n\n //get docs from posting line and add them to the data structure 'docsOfChosenCities'\n String docs = line.substring(line.indexOf(\"[\") + 1, line.indexOf(\"]\")); //get 'docsListStr'\n String[] docsArr = docs.split(\"; \");\n for (String doc : docsArr) {\n docsOfChosenCities.add(doc);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n\n\n ranker.rank(docsResults, docsOfChosenCities, queryTermsIgnoreCase, dictionary, docsInfo,entities, queryId);\n }", "public static void main(String[] args) throws IOException {\n\t\tRepRiskIndexer.createIndex(AppConstants.INDEX_DIR, AppConstants.DATA_DIR);\r\n\t\tlong totalIndexed = RepRiskIndexer.getTotalIndexed();\r\n\t\t\r\n\t\t// 2nd lets get the contents from csv (RepRisk Companies)\r\n\t\tRepRiskCsvParser csvParser = new RepRiskCsvParser();\r\n\t\tcsvParser.setDELIMITER(';');\r\n\t\tList<Company> companies = csvParser.readCsvFile(\"C:\\\\Lucene\\\\RepRisk\\\\company_list.csv\");\r\n\t\tSystem.out.println(companies);\r\n\t\t\r\n\t\t// 3rd lets get relevant results and documents for each of the companies\r\n\t\tMap<Company, SearchResults> relevantDocs = new HashMap<>();\r\n\t\tRepRiskSearcher searcher = new RepRiskSearcher();\r\n\t\t\r\n\t\tfor(Company company : companies) {\r\n\t\t\trelevantDocs.put(company, \r\n\t\t\t\t\tnew SearchResults(\r\n\t\t\t\t\t\t\tsearcher.absoluteSearch(company.getName()), \r\n\t\t\t\t\t\t\tsearcher.relevantSearch(company.getName())));\r\n\t\t}\r\n\t\t\r\n\t\t// 4th initialize Precision and Recall\r\n\t\tPrecisionRecallCalculator calc = new PrecisionRecallCalculator(totalIndexed);\r\n\t\tfor(Map.Entry<Company, SearchResults> doc : relevantDocs.entrySet()) {\r\n\t\t\tCompany company = doc.getKey();\r\n\t\t\tPrecisionRecall result = calc.calculate(doc.getValue());\r\n\t\t\t\r\n\t\t\tSystem.out.println(company.getName() + \" \" + result);\r\n\t\t}\r\n\t\t\r\n\t\t// 5th print results\r\n\t\tcalc.calculateAveragePrecision();\r\n\t\tcalc.calculate11point();\r\n\t\tcalc.printAllResults();\r\n\t}", "public interface RerankerQuery {\n double score(Tree tree);\n}", "public List<edu.columbia.cs.ref.model.TokenizedDocument> search(Query query, int n) {\n\n\t\tTopDocs result = null;\n\t\t\n\t\ttry {\n\t\t\tresult = IndexSearcher.search(query, n);\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tList<TokenizedDocument> searchResults = new ArrayList<TokenizedDocument>();\n\t\t\n\t\tScoreDoc[] docs = result.scoreDocs;\n\t\t\n\t\tfor (int i = 0; i < docs.length; i++) {\n\t\t\t\n\t\t\tDocument document;\n\t\t\ttry {\n\t\t\t\tdocument = IndexSearcher.doc(docs[i].doc);\n\t\t\t\tsearchResults.add(getDocumentTable().get(createKey(document.get(PATH), document.get(FILE_NAME))));\n\t\t\t} catch (CorruptIndexException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\treturn searchResults;\n\t\t\n\t}", "public void searchTest() {\n\t\ttry {\n\t\t\tString keyword = \"操作道具\";\n\t\t\t// 使用IKQueryParser查询分析器构造Query对象\n\t\t\tQuery query = IKQueryParser.parse(LogsEntry.INDEX_FILED_CONTENT, keyword);\n\n\t\t\t// 搜索相似度最高的5条记录\n\t\t\tint querySize = 5;\n\t\t\tTopDocs topDocs = isearcher.search(query, null, querySize, sort);\n\t\t\tlogger.info(\"命中:{}\", topDocs.totalHits);\n\t\t\t// 输出结果\n\t\t\tScoreDoc[] scoreDocs = topDocs.scoreDocs;\n\t\t\tfor (int i = 0; i < scoreDocs.length; i++) {\n\t\t\t\tDocument targetDoc = isearcher.doc(scoreDocs[i].doc);\n\t\t\t\tlogger.info(\"内容:{}\", targetDoc.toString());\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tlogger.error(e.getMessage(), e);\n\t\t}\n\t}", "public void doSearch(int referenceId, int smallSetUpperBound,\n\t\tint largeSetLowerBound, int mediumSetPresentNumber,\n\t\tint replaceIndicator, String resultSetName, \n\t\tString databaseNames, String smallSetElementSetNames, \n\t\tString mediumSetElementSetNames, String preferredRecordSyntax, \n\t\tString query, int query_type, String searchResultsOID,\n\t \tDataDir Z39attributesPlusTerm, DataDir oclcUserInfo,\n String oclcUserInfoOID, Object rankQuery, String rankOID,\n boolean fMakeDataDir) \n throws Exception, Diagnostic1, AccessControl {\n\n \n BerString zRequest=null, zResponse=null;\n BerConnect zConnection;\n\n if (zsession == null) \n throw new Diagnostic1(Diagnostic1.temporarySystemError, \n \"User's Z39.50 session is not initialized\");\n\n // Re-init to the server\n if (zsession.isConnected() == false) {\n try {\n\n zsession.init.reInit();\n\n if (zsession.connection == null)\n throw new Diagnostic1(Diagnostic1.databaseUnavailable, \n \"Unable to connect to the Z39.50 server\");\n }\n catch (Exception e) {\n throw new Diagnostic1(Diagnostic1.databaseUnavailable, \n \"Unable to connect to the Z39.50 server\");\n } \n catch (Diagnostic1 d) {\n throw d;\n } \n } \n\n\n zConnection = (BerConnect)zsession.connection;\n\n zRequest = Request(referenceId, smallSetUpperBound,\n\t\tlargeSetLowerBound, mediumSetPresentNumber,\n\t\treplaceIndicator, resultSetName, \n\t\tdatabaseNames, smallSetElementSetNames, \n\t\tmediumSetElementSetNames, preferredRecordSyntax, \n\t\tquery, query_type, searchResultsOID,\n Z39attributesPlusTerm, oclcUserInfo, oclcUserInfoOID,\n rankQuery, rankOID, 0, 0);\n \n if (zRequest == null) {\n throw new Diagnostic1(Diagnostic1.malformedQuery, \"Unable to create search request\");\n\n// System.out.println(\"unable to build search request\");\n }\n\n try {\n zResponse = zConnection.doRequest(zRequest); \n }\n\t catch (InterruptedIOException ioe) { \n\t if (zsession.doTRC) { \n\t\t try {\n\t\t if (zsession.logger != null && \n\t\t\t zsession.logger.getLevel() != Z39logging.OFF) {\n\t\t\t synchronized (zsession.logger) {\n\t\t\t zsession.logger.println(\"Sending TRC to search\");\n\t\t\t }\n\t\t } \n\t\t zsession.trc.doTriggerResourceControl(0, 3);\n\t\t }\n\t\t catch (Exception trce) {\n\t\t // trce.printStackTrace();\n\t\t }\n\t\t catch (Diagnostic1 trcd) {\n\t\t // System.out.println(trcd);\n\t\t }\n\t }\n\n //differentiate between 105 and 109 diagnostics\n if (ioe.getMessage().endsWith(\"user\"))\n throw new Diagnostic1(Diagnostic1.terminatedAtOriginRequest,\n \"Unable to send request to the Z39.50 server\");\n else\n throw new Diagnostic1(Diagnostic1.databaseUnavailable,\n \"Unable to send request to the Z39.50 server\");\n\n } \n catch (Exception e1) {\n zsession.reset();\n throw new Diagnostic1(Diagnostic1.databaseUnavailable, \n \"Unable to send request to the Z39.50 server\");\n }\n\n if (zResponse == null) {\n throw new Diagnostic1(Diagnostic1.temporarySystemError,\n \"Invalid search response received from the Z39.50 Server\");\n }\n\n\n Response(zResponse);\n\n // If flag is set to decode recs into datadir and we\n // got records back, then decode and make sure we got\n // all we wanted \n if (resultCount > 0 && \n Present.numberOfRecordsReturned > 0) {\n\n if (fMakeDataDir) \n Present.decodeRecords();\n\n\n if(Present.numberOfRecordsReturned != mediumSetPresentNumber &&\n resultCount > Present.numberOfRecordsReturned) {\n \n int numrecs = mediumSetPresentNumber - \n Present.numberOfRecordsReturned;\n //System.out.println(\"Numrecs returned = \" + numrecs +\n //\" asked for: \" + mediumSetPresentNumber);\n\n try {\n\n zsession.present.doPresent(zsession.refId > 0 ? \n zsession.refId++ : 0,\n resultSetName, Present.numberOfRecordsReturned+1,\n numrecs, resultCount, \n mediumSetElementSetNames, preferredRecordSyntax, \n fMakeDataDir);\n }\n catch (Exception e) {\n // Don't barf good results received.\n }\n catch (Diagnostic1 d) {\n // Don't barf good results received.\n }\n // If we got the records back. add them to the\n // Present Vector or the BerString\n saveGoodRecords(fMakeDataDir);\n }\n }\n }", "int getDocumentCount();", "public interface GroupRateSearchRepository extends ElasticsearchRepository<GroupRate, Long> {\n}", "public PostingsList ranked_query(Query query, double w, double idf_threshold){\n long startTime = System.nanoTime();\n PostingsList result = new PostingsList();\n\n // Obtain union of terms above idf threshold if indexElimination is true\n // (Set idf_threshold to zero to disable this feature)\n Set<String> termsToConsider = this.queryTermsConsidered(query, idf_threshold);\n result = this.union_query(query, termsToConsider);\n //System.err.println(\"Size of result is \" + result.size());\n\n long estimatedTime = (System.nanoTime() - startTime)/1000000;\n System.err.println(\"* Union took: \" + estimatedTime);\n\n\n /*\n * 2) Iterate over PostingsEntries and build the solution\n */\n startTime = System.nanoTime();\n // Required when iterating over a PostingsList\n PostingsEntry postEnt = new PostingsEntry();\n // Number of documents in the collection\n double nDocs = this.docIDs.size();\n // Weight of a query vector coefficient\n double w_query_term;\n // Document tf-idf variables\n double termFrequency_doc, documentFrequency_doc, w_doc_term;\n\n for(String term : termsToConsider){\n // Obtain idf of the term\n documentFrequency_doc = Math.log(nDocs/new Double(this.idfMap.get(term)));\n\n // Obtain weight of the term\n w_query_term = query.weights.get(term);\n // Iterate over all documents containing the term and update the score(q,d)\n Iterator<PostingsEntry> it_d = result.iterator();\n while(it_d.hasNext()){\n postEnt = it_d.next();\n if (this.tfMap.get(postEnt.docID).containsKey(term)){\n termFrequency_doc = this.tfMap.get(postEnt.docID).get(term);\n w_doc_term = documentFrequency_doc*termFrequency_doc;\n postEnt.score += w_query_term*w_doc_term;\n }\n }\n }\n estimatedTime = (System.nanoTime() - startTime)/1000000;\n System.err.println(\"* Building solution took: \" + estimatedTime);\n\n /*\n * 3) Normalize the scores\n */\n startTime = System.nanoTime();\n Iterator<PostingsEntry> it = result.iterator();\n while(it.hasNext()){\n postEnt = it.next();\n postEnt.score /= (new Double(this.docLengths.get(\"\"+postEnt.docID)));//(Math.sqrt(postEnt.norm2));\n postEnt.score = w * postEnt.score + (1-w) * quality(postEnt.docID);\n }\n estimatedTime = (System.nanoTime() - startTime)/1000000;\n System.err.println(\"* Normalizing took: \" + estimatedTime);\n\n /*\n * 4) Sort the resulting solution\n */\n startTime = System.nanoTime();\n result.sort();\n estimatedTime = (System.nanoTime() - startTime)/1000000;\n System.err.println(\"* Sorting took: \" + estimatedTime);\n\n return result;\n }", "public void testRange() throws IOException, InvalidGeoException\r\n {\n LgteIndexSearcherWrapper searcher = new LgteIndexSearcherWrapper(path);\r\n\r\n //try find Jorge and Bruno documents last year\r\n // In this case the closest one will be in 2007\r\n String query = \"contents:(Jorge Bruno)\";\r\n\r\n LgteQuery lgteQueryResult1;\r\n LgteQuery lgteQueryResult1and2;\r\n try\r\n {\r\n lgteQueryResult1 = LgteQueryParser.parseQuery(query);\r\n lgteQueryResult1and2 = LgteQueryParser.parseQuery(query);\r\n\r\n MyCalendar c1Aux = new MyCalendar(2005,11,20,9,0,10);\r\n MyCalendar c2Aux = new MyCalendar(2007,1,12,20,45,15);\r\n long dif = c2Aux.getTimeInMillis() - c1Aux.getTimeInMillis();\r\n\r\n lgteQueryResult1.getQueryParams().setTimeMiliseconds(c1Aux.getTimeInMillis());\r\n lgteQueryResult1.getQueryParams().setRadiumMiliseconds(dif -1);\r\n lgteQueryResult1and2.getQueryParams().setTimeMiliseconds(c1Aux.getTimeInMillis());\r\n lgteQueryResult1and2.getQueryParams().setRadiumMiliseconds(dif+1);\r\n }\r\n catch (ParseException e)\r\n {\r\n fail(e.toString());\r\n return;\r\n }\r\n\r\n //Lets use aos Time Sorter to dont worry about distances and stuff like that, he will do the job\r\n TimeDistanceSortSource dsort1 = new TimeDistanceSortSource();\r\n LgteSort sort1 = new LgteSort(new SortField(\"foo\", dsort1));\r\n\r\n //LgteHits give you Documents and time with unecessary lines of boring code\r\n LgteHits lgteHits1;\r\n LgteHits lgteHits1and2;\r\n lgteHits1 = searcher.search(lgteQueryResult1, sort1);\r\n assertTrue(lgteHits1.length() == 1);\r\n\r\n lgteHits1and2 = searcher.search(lgteQueryResult1and2, sort1);\r\n assertTrue(lgteHits1and2.length() == 2);\r\n\r\n\r\n long time1_0 = lgteHits1.doc(0).getTime().getTime();\r\n long time1and2_0 = lgteHits1and2.doc(0).getTime().getTime();\r\n long time1and2_1 = lgteHits1and2.doc(1).getTime().getTime();\r\n assertTrue(time1_0 == new MyCalendar(2005,11,20,9,0,10).getTimeInMillis());\r\n assertTrue(time1and2_0 == new MyCalendar(2005,11,20,9,0,10).getTimeInMillis());\r\n assertTrue(time1and2_1 == new MyCalendar(2007,1,12,20,45,15).getTimeInMillis());\r\n\r\n\r\n searcher.close();\r\n }", "@Test\n\tpublic void shouldReturnPagedOpenDocumentsForAmountRange()\n\t{\n\t\tfinal SearchPageData<B2BDocumentModel> result = pagedB2BDocumentDao.getAllPagedDocuments(\n\t\t\t\tcreatePageableData(0, 10, StringUtils.EMPTY), Collections.singletonList(AccountSummaryAddonUtils\n\t\t\t\t\t\t.createAmountRangeCriteriaObject(AMOUNT_75_30, AMOUNT_76_31, DOCUMENT_STATUS_OPEN, FILTER_BY_AMOUNT)));\n\n\t\tTestCase.assertEquals(1, result.getResults().size());\n\t\tTestCase.assertEquals(DOCUMENT_NUMBER_PUR_002, result.getResults().get(0).getDocumentNumber());\n\t\tTestCase.assertEquals(AMOUNT_75_31, result.getResults().get(0).getAmount().toPlainString());\n\t}", "public void searchAndWriteQueryResultsToOutput() {\n\n List<String> queryList = fu.textFileToList(QUERY_FILE_PATH);\n\n for (int queryID = 0; queryID < queryList.size(); queryID++) {\n String query = queryList.get(queryID);\n // ===================================================\n // 4. Sort the documents by the BM25 scores.\n // ===================================================\n HashMap<String, Double> docScore = search(query);\n List<Map.Entry<String, Double>> rankedDocList =\n new LinkedList<Map.Entry<String, Double>>(docScore.entrySet());\n Collections.sort(rankedDocList, new MapComparatorByValues());\n\n // ===================================================\n // 5. Write Query Results to output\n // =================================================== \n String outputFilePath =\n RANKING_RESULTS_PATH + \"queryID_\" + (queryID + 1) + \".txt\";\n StringBuilder toOutput = new StringBuilder();\n // display results in console\n System.out.println(\"Found \" + docScore.size() + \" hits.\");\n int i = 0;\n for (Entry<String, Double> scoreEntry : rankedDocList) {\n if (i >= NUM_OF_RESULTS_TO_RETURN)\n break;\n String docId = scoreEntry.getKey();\n Double score = scoreEntry.getValue();\n String resultLine =\n (queryID + 1) + \" Q0 \" + docId + \" \" + (i + 1) + \" \" + score + \" BM25\";\n toOutput.append(resultLine);\n toOutput.append(System.getProperty(\"line.separator\"));\n System.out.println(resultLine);\n i++;\n }\n fu.writeStringToFile(toOutput.toString(), outputFilePath);\n }\n }", "abstract public Document document(int n) throws IOException;", "@Override\n @Test\n public void testQuery_advancedRankingWithJoin() throws Exception { }", "private static void prMode(DiskIndexWriter diskWriter, DiskPositionalIndex disk_posIndex) throws ClassNotFoundException, InstantiationException, IllegalAccessException, FileNotFoundException {\n long time = 0;\n GUI.JListModel.clear();\n\n if (query.equals(\"q\")) {\n\n System.exit(0);\n }\n MAP mean_ap = new MAP(path);\n //returns qRel.keyset() i.e. queries \n Set<String> queries = mean_ap.getQueries();\n List<Long> time_per_query = new ArrayList<>();\n //run ranked retrival for each query\n for (String q : queries) {\n time = 0;\n List<String> word = new ArrayList();\n\n query = q;\n long start = System.currentTimeMillis();\n\n String[] query_array = query.split(\"\\\\s+\");\n TokenProcessor processor = new NewTokenProcessor();\n\n for (int i = 0; i < query_array.length; i++) {\n word.add(processor.processToken(query_array[i]).get(0));\n }\n long t1 = System.currentTimeMillis();\n time = t1 - start; //time to parse\n StrategyFactory sf = new StrategyFactory();\n StrategyInterface strategy = sf.execute(rankedOption);\n\n //maps postings to accumulator value\n HashMap<Integer, Doc_accum> postingMap = new HashMap<Integer, Doc_accum>();\n\n PriorityQueue<Doc_accum> queue = new PriorityQueue<>(Collections.reverseOrder());\n\n List<Posting> postings = new ArrayList<>();\n List<Doc_accum> results = new ArrayList<>();\n\n for (String term : word) {\n long t2 = System.currentTimeMillis();\n\n if (term.equals(\"\")) {\n continue;\n } else {\n\n postings = disk_posIndex.getPosting_noPos(term);\n long t3 = System.currentTimeMillis();\n time = time + (t3 - t2);\n\n for (Posting p : postings) { //for each document in the postings list\n double t_fd = p.getT_fd();\n double d_ft = p.getD_ft();\n double w_qt = strategy.calculate_wqt(N, d_ft);\n double accum = 0;\n double w_dt = strategy.get_wdt(t_fd, disk_posIndex, p.getDocumentId());\n\n //pairs (Ranked_posting, accumulator factor)\n if (postingMap.containsKey(p.getDocumentId())) {\n accum = postingMap.get(p.getDocumentId()).getAccumulator();\n accum += (w_qt * w_dt);\n postingMap.replace(p.getDocumentId(), new Doc_accum(p, accum)); //replaces old accum value\n\n } else {\n accum += (w_qt * w_dt);\n postingMap.put(p.getDocumentId(), new Doc_accum(p, accum));\n }\n }\n\n }\n }\n for (Integer p : postingMap.keySet()) {\n Doc_accum doc_temp = postingMap.get(p);\n double accum = doc_temp.getAccumulator(); //gets accum associated with doc\n\n if (accum > 0) {\n //search for each p's Ld factor in docWeights.bin\n double l_d = strategy.calculate_Ld(disk_posIndex, doc_temp.getPosting().getDocumentId());\n\n accum /= l_d;\n doc_temp.setAccumulator(accum);\n }\n\n queue.add(postingMap.get(p));\n\n }\n\n //returns top K=10 results \n int topK = 50;\n\n while ((results.size() < topK) && queue.size() > 0) {\n\n results.add(queue.poll()); //gets the posting acc pair and returns only posting\n\n }\n time_per_query.add(time);\n List<String> filenames = get_RankedResults(results);\n\n mean_ap.add_poseRel(q, filenames);\n\n }\n\n double map_result = mean_ap.mean_ap();\n String mapDisplay = \"Mean average precision: \" + map_result;\n GUI.JListModel.addElement(mapDisplay);\n System.out.println(\"\\n\" + mapDisplay);\n\n double throughput_result = mean_ap.calculate_throughput(time_per_query);\n String throughput_Display = \"Throughput of the system is: \" + throughput_result;\n GUI.JListModel.addElement(throughput_Display);\n System.out.println(throughput_Display);\n\n double mrt_result = mean_ap.calculae_mean_response_time(time_per_query);\n String mrt_Display = \"Mean Response Time of the system is: \" + mrt_result;\n GUI.JListModel.addElement(mrt_Display);\n System.out.println(mrt_Display);\n\n }", "@Test\n void testRankFilter() {\n Query q = newQueryFromEncoded(\"?query=trump\" +\n \"&model.type=all\" +\n \"&model.defaultIndex=text\" +\n \"&filter=filterattribute%3Afrontpage_US_en-US\");\n assertEquals(\"RANK text:trump |filterattribute:frontpage_US_en-US\",\n q.getModel().getQueryTree().toString());\n }", "@Ignore\n @Test\n public void testSearchDocument() {\n System.out.println(\"searchDocument\");\n Client client = null;\n String indexName = \"\";\n String queryStr = \"\";\n String filterStr = \"\";\n int maxExpectedHits = 0;\n List expResult = null;\n // List result = ESUtil.searchDocument(client, indexName, queryStr, filterStr, maxExpectedHits);\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 interface SimilarityCalculator {\n\n /**\n * Calculates similarity between query and document.\n *\n * @param documentId Id of document.\n * @return Similarity.\n */\n double calculateScore(String documentId);\n}", "public SearchDocuments(String indexPath) throws IOException{\r\n this.setIndexPath(indexPath); \r\n \r\n //TO DO : add config.properties file\r\n //read configuration file and update static variables adequately\r\n// readConf();\r\n\r\n // Supported index Fields and their pubmed counterpart (\"Title\",\"ArticleTitle\") \r\n supportedIndexFields.put(\"Title\", \"ArticleTitle\");\r\n supportedIndexFields.put(\"TI\", \"ArticleTitle\");\r\n supportedIndexFields.put(\"Abstract\", \"AbstractText\");\r\n supportedIndexFields.put(\"AB\", \"AbstractText\");\r\n supportedIndexFields.put(\"PMID\", \"PMID\");\r\n supportedIndexFields.put(\"UID\", \"PMID\");\r\n //TO DO : add all supported index fields\r\n //TO DO : special words (i.e. nothascommenton etc) \r\n \r\n // Lucene objects\r\n \r\n /* Sorting */\r\n // Fields used for reverse chronological sorting of results\r\n // This Fields are indexed with no tokenization (for each element a StringField AND a SortedDocValuesField are added)\r\n // Using SortField.Type.STRING is valid (as an exception) beacause years are 4-digit numbers resulting in identical String-sorting and number-sorting.\r\n SortField sortFieldYear = new SortField(\"PubDate-Year\", SortField.Type.STRING, true);\r\n \r\n //TO DO : make custom comparators for the rest fields where lexilogical comparison is not valid\r\n // OR, store Pud Date as Date and use date comparison\r\n // Idealy one \"complex-field\" should be used for sorting, taking into account Year, Month, Day, Season and MedlineDate together)\r\n// SortField sortFieldMonth = new SortField(\"PubDate-Month\",SortField.Type.STRING,true);\r\n// SortField sortFieldDay = new SortField(\"PubDate-Day\",SortField.Type.STRING,true);\r\n// SortField sortFieldSeason = new SortField(\"PubDate-Season\",SortField.Type.STRING,true);\r\n// SortField sortFieldMedlineDate = new SortField(\"PubDate-MedlineDate\",SortField.Type.STRING,true);\r\n// this.setSort(new Sort(sortFieldYear, sortFieldMonth, sortFieldDay, sortFieldSeason, sortFieldMedlineDate));\r\n this.setSort(new Sort(sortFieldYear));\r\n \r\n /* Reading the index */\r\n// this.setReader(DirectoryReader.open(FSDirectory.open(Paths.get(getIndexPath()))));\r\n this.setReader(DirectoryReader.open(MMapDirectory.open(Paths.get(getIndexPath()))));\r\n this.setSearcher(new IndexSearcher(getReader()));\r\n this.setAnalyzer(new StandardAnalyzer());\r\n \r\n /* Caching */\r\n // these cache and policy instances can be shared across several queries and readers\r\n // it is fine to eg. store them into static variables\r\n // TO DO: Use stored (old) expert-queries (from mongoDB) and MESH terms to \"prepare\" cache.\r\n queryCache = new LRUQueryCache(maxNumberOfCachedQueries, maxRamBytesUsed);\r\n// defaultCachingPolicy = new UsageTrackingQueryCachingPolicy();\r\n defaultCachingPolicy = new QueryCachingPolicy.CacheOnLargeSegments(minIndexSize, minSizeRatio);\r\n this.getSearcher().setQueryCache(queryCache);\r\n this.getSearcher().setQueryCachingPolicy(defaultCachingPolicy);\r\n \r\n /* All fields as default for search */\r\n Iterator <String> allFieldsIterator = org.apache.lucene.index.MultiFields.getFields(reader).iterator();\r\n ArrayList <String> a = new ArrayList();\r\n String current = \"\";\r\n while(allFieldsIterator.hasNext()){\r\n current = allFieldsIterator.next();\r\n if(!current.startsWith(\"PubDate-\")){\r\n a.add(current);\r\n }\r\n }\r\n \r\n String[] allFields = new String[a.size()];\r\n allFields = a.toArray(allFields); //All index fields to be used as default search fields\r\n this.setParser( new MultiFieldQueryParser( allFields, getAnalyzer())); \r\n }", "private void executeQuery1(PersistenceManager pm) {\n Query query = pm.newQuery(Book.class, \"pages > 300\");\n Collection results = (Collection)query.execute();\n printCollection(\"Books with more than 300 pages:\", results.iterator());\n query.closeAll();\n }", "public List<Integer> findTopGenesByRanking( Integer n ) throws DAOException;", "protected SearchSearchResponse doNewSearch(QueryContext queryContext) throws Exception {\n\t\t\n\t\tBooleanQuery query = _queryBuilder.buildSearchQuery(queryContext);\n\t\t\n\t\tBooleanQuery rescoreQuery = \n\t\t\t\t_queryBuilder.buildRescoreQuery(queryContext);\n\t\t\n\t\tList<Aggregation> aggregations = getAggregations(queryContext);\n\n\t\treturn execute(queryContext, query, rescoreQuery, aggregations);\n\t}", "public void search(IndexShort < O > index, short range, short k)\n throws Exception {\n // assertEquals(index.aDB.count(), index.bDB.count());\n // assertEquals(index.aDB.count(), index.bDB.count());\n // index.stats();\n index.resetStats();\n // it is time to Search\n int querySize = 1000; // amount of elements to read from the query\n String re = null;\n logger.info(\"Matching begins...\");\n File query = new File(testProperties.getProperty(\"test.query.input\"));\n File dbFolder = new File(testProperties.getProperty(\"test.db.path\"));\n BufferedReader r = new BufferedReader(new FileReader(query));\n List < OBPriorityQueueShort < O >> result = new LinkedList < OBPriorityQueueShort < O >>();\n re = r.readLine();\n int i = 0;\n long realIndex = index.databaseSize();\n\n while (re != null) {\n String line = parseLine(re);\n if (line != null) {\n OBPriorityQueueShort < O > x = new OBPriorityQueueShort < O >(\n k);\n if (i % 100 == 0) {\n logger.info(\"Matching \" + i);\n }\n\n O s = factory.create(line);\n if (factory.shouldProcess(s)) {\n if(i == 279){\n System.out.println(\"hey\");\n }\n index.searchOB(s, range, x);\n result.add(x);\n i++;\n }\n }\n if (i == querySize) {\n logger.warn(\"Finishing test at i : \" + i);\n break;\n }\n re = r.readLine();\n }\n \n logger.info(index.getStats().toString());\n \n int maxQuery = i;\n // logger.info(\"Matching ends... Stats follow:\");\n // index.stats();\n\n // now we compare the results we got with the sequential search\n Iterator < OBPriorityQueueShort < O >> it = result.iterator();\n r.close();\n r = new BufferedReader(new FileReader(query));\n re = r.readLine();\n i = 0;\n while (re != null) {\n String line = parseLine(re);\n if (line != null) {\n if (i % 300 == 0) {\n logger.info(\"Matching \" + i + \" of \" + maxQuery);\n }\n O s = factory.create(line);\n if (factory.shouldProcess(s)) {\n OBPriorityQueueShort < O > x2 = new OBPriorityQueueShort < O >(\n k);\n searchSequential(realIndex, s, x2, index, range);\n OBPriorityQueueShort < O > x1 = it.next();\n //assertEquals(\"Error in query line: \" + i + \" slice: \"\n // + line, x2, x1); \n \n assertEquals(\"Error in query line: \" + i + \" \" + index.debug(s) + \"\\n slice: \"\n + line + \" \" + debug(x2,index ) + \"\\n\" + debug(x1,index), x2, x1);\n\n i++;\n }\n \n }\n if (i == querySize) {\n logger.warn(\"Finishing test at i : \" + i);\n break;\n }\n re = r.readLine();\n }\n r.close();\n logger.info(\"Finished matching validation.\");\n assertFalse(it.hasNext());\n }", "@Override\n @Test\n public void testQuery_invalidAdvancedRankingWithChildrenRankingSignals() throws Exception { }", "double calculateScore(String documentId);", "private Page<ElasticCandidate> search(CandidateSearchModel model, Pageable pageable){\n Integer experienceDuration = model.getSkillPlaceholder()\n .getExperienceDuration();\n String title = model.getSkillPlaceholder()\n .getSkill()\n .getTitle();\n RangeModel<Integer> rangeExperience = model.getSkillExperienceRange();\n Integer experienceUpperLimit = rangeExperience.getUpperLimit();\n Integer experienceLowerLimit = rangeExperience.getLowerLimit();\n\n // Prepares location\n String location = model.getLocation();\n\n // Prepare hourly rate\n Integer hourlyRate = model.getHourlyRate();\n RangeModel<Integer> rangeHourlyRate = model.getHourlyRateRange();\n Integer hourlyRateUpperLimit = rangeHourlyRate.getUpperLimit();\n Integer hourlyRateLowerLimit = rangeHourlyRate.getLowerLimit();\n\n // Prepares certifications\n Set<String> certifications = model.getCertifications();\n if (certifications != null && certifications.size() != 0) {\n Iterator iterator = certifications.iterator();\n String[] certificationsArray = new String[certifications.size()];\n for (int i = 0; i < certificationsArray.length; i++) {\n certificationsArray[i] = (String) iterator.next();\n }\n }\n\n // Prepares Starting date postponed !!\n// Long startingDate = model.getStartingDate().getTime();\n// Long startingDateUpperLimit = model.getStartingDateUpperRange().getTime();\n\n // Prepares time period\n String timePeriod = model.getTimePeriod();\n // endregion\n\n // region Build query\n SearchQuery searchQuery;\n\n\n if (certifications != null && certifications.size() != 0)\n searchQuery = new NativeSearchQueryBuilder().withQuery(matchAllQuery())\n\n\n .withQuery(\n boolQuery()\n .must(queryForMustSkill(title))\n .should(queryForExactValueSkill(title, experienceDuration))\n .should(queryForExactValueHourlyRate(hourlyRate))\n .should(queryForFuzzyHourlyRate(hourlyRate))\n .should(queryForFuzzySkill(title, experienceDuration))\n .should(queryForRangeSkill(title, experienceLowerLimit, experienceUpperLimit))\n .should(queryForRangeHourlyRate(hourlyRateLowerLimit, hourlyRateUpperLimit))\n .must(queryForLocation(location))\n// .must(queryForStartingDay(startingDate, startingDateUpperLimit))\n .must(queryForTimePeriod(timePeriod))\n .must(queryForCertifications(certifications)))\n .withPageable(pageable)\n .withFilter(queryForMustSkill(title))\n .withFilter(queryForExactValueSkill(title, experienceDuration))\n .withFilter(queryForExactValueHourlyRate(hourlyRate))\n .withFilter(queryForFuzzyHourlyRate(hourlyRate))\n .withFilter(queryForFuzzySkill(title, experienceDuration))\n .withFilter(queryForRangeSkill(title, experienceLowerLimit, experienceUpperLimit))\n .withFilter(queryForRangeHourlyRate(hourlyRateLowerLimit, hourlyRateUpperLimit))\n .withFilter(queryForLocation(location))\n .withFilter(queryForTimePeriod(timePeriod))\n .withFilter(queryForCertifications(certifications))\n// .withSort(SortBuilders.fieldSort(\"hourlyRate\")\n// .order(SortOrder.ASC))\n .build();\n\n else\n\n\n searchQuery = new NativeSearchQueryBuilder().withQuery(matchAllQuery())\n\n\n .withQuery(\n boolQuery()\n .must(queryForMustSkill(title))\n .should(queryForExactValueSkill(title, experienceDuration))\n .should(queryForExactValueHourlyRate(hourlyRate))\n .should(queryForFuzzyHourlyRate(hourlyRate))\n .should(queryForFuzzySkill(title, experienceDuration))\n .should(queryForRangeSkill(title, experienceLowerLimit, experienceUpperLimit))\n .should(queryForRangeHourlyRate(hourlyRateLowerLimit, hourlyRateUpperLimit))\n .must(queryForLocation(location))\n// .must(queryForStartingDay(startingDate, startingDateUpperLimit))\n .must(queryForTimePeriod(timePeriod)))\n .withPageable(pageable)\n .withFilter(queryForMustSkill(title))\n .withFilter(queryForExactValueSkill(title, experienceDuration))\n .withFilter(queryForExactValueHourlyRate(hourlyRate))\n .withFilter(queryForFuzzyHourlyRate(hourlyRate))\n .withFilter(queryForFuzzySkill(title, experienceDuration))\n .withFilter(queryForRangeSkill(title, experienceLowerLimit, experienceUpperLimit))\n .withFilter(queryForRangeHourlyRate(hourlyRateLowerLimit, hourlyRateUpperLimit))\n .withFilter(queryForLocation(location))\n .withFilter(queryForTimePeriod(timePeriod))\n// .withSort(SortBuilders.fieldSort(\"hourlyRate\")\n// .order(SortOrder.ASC))\n .build();\n\n // endregion\n\n // region Test\n Page<ElasticCandidate> queryForExactValueSkill = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForExactValueSkill(title, experienceDuration))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForExactValueHourlyRate = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForExactValueHourlyRate(hourlyRate))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForFuzzySkill = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForFuzzySkill(title, experienceDuration))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForFuzzyHourlyRate = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForFuzzyHourlyRate(hourlyRate))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForRangeSkill = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForRangeSkill(title, experienceLowerLimit, experienceUpperLimit))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForRangeHourlyRate = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForRangeHourlyRate(hourlyRateLowerLimit, hourlyRateUpperLimit))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForLocation = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForLocation(location))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForTimePeriod = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForTimePeriod(timePeriod))\n .build(), ElasticCandidate.class);\n Page<ElasticCandidate> queryForCertifications = elasticsearchTemplate.queryForPage(new NativeSearchQueryBuilder().withQuery(\n queryForCertifications(certifications))\n .build(), ElasticCandidate.class);\n // endregion\n\n\n Page<ElasticCandidate> sampleEntities = elasticsearchTemplate.queryForPage(searchQuery,\n ElasticCandidate.class);\n return sampleEntities;\n }", "public interface PerCompanySearchRepository extends ElasticsearchRepository<PerCompany, Long> {\n}", "@Test\n\tpublic void searchIteratorStatusRankCriteria(){\n\t\tRegionQueryPart regionQueryPart = new RegionQueryPart();\n\t\tregionQueryPart.setRegion(new String[]{\"AB\",\"bc\"});\n\t\tregionQueryPart.setRegionSelector(RegionSelector.ANY_OF);\n\t\t\n\t\tIterator<TaxonLookupModel> it = taxonDAO.searchIterator(200, null, -1,regionQueryPart, NATIVE_EPHEMERE_STATUSES, new String[]{\"family\",\"variety\"}, false, null);\n\t\tList<String> mockTaxonList = extractMockTaxonNameFromLookup(it);\n\t\tassertTrue(mockTaxonList.containsAll(Arrays.asList(new String[]{\"_Mock2\"})));\n\t\tassertTrue(!mockTaxonList.contains(\"_Mock4\"));\n\t}", "public List<Integer> processRelatedDocs(Query query) {\r\n List<Integer> result = new ArrayList<>();\r\n\r\n if (query.isTerm()) {\r\n\r\n result = this.processRelatedDocsQuery(query.getText());\r\n\r\n } else {\r\n\r\n //query.getNodes().keySet()\r\n for (BooleanClause.Occur key : new BooleanClause.Occur[] {\r\n BooleanClause.Occur.MUST,\r\n BooleanClause.Occur.SHOULD,\r\n BooleanClause.Occur.MUST_NOT }) {\r\n\r\n List<Query> nodes = query.getNodes().get(key);\r\n\r\n // no-op\r\n if(nodes.isEmpty()) continue;\r\n\r\n switch (key) {\r\n /* AND */ case MUST:\r\n for (Query node : nodes) {\r\n List<Integer> rel = this.processRelatedDocs(node);\r\n result = this.operator.and(result, rel);\r\n }\r\n break;\r\n /* OR */ case SHOULD:\r\n for (Query node : nodes) {\r\n List<Integer> rel = this.processRelatedDocs(node);\r\n result = this.operator.or(result, rel);\r\n }\r\n break;\r\n /* NOT */ case MUST_NOT:\r\n for (Query node : nodes) {\r\n List<Integer> rel = this.processRelatedDocs(node);\r\n result = this.operator.not(result, rel);\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return result;\r\n }", "public interface Searcher {\n\n\t/**\n\t * returns document titles for given query\n\t * \n\t * @param query\n\t * @return\n\t * @throws SearcherException\n\t */\n\tList<String> getDocumentTitles(String query) throws SearcherException;\n\n}", "public static void doPagingSearch(BufferedReader in, IndexSearcher searcher, Query query,\n int hitsPerPage, boolean raw, boolean interactive) throws IOException {\n TopDocs results = searcher.search(query, 5 * hitsPerPage);\n ScoreDoc[] hits = results.scoreDocs;\n\n int numTotalHits = results.totalHits;\n System.out.println(numTotalHits + \" total matching documents\");\n\n int start = 0;\n int end = Math.min(numTotalHits, hitsPerPage);\n\n while (true) {\n if (end > hits.length) {\n //System.out.println(\"Only results 1 - \" + hits.length + \" of \" + numTotalHits + \" total matching documents collected.\");\n //System.out.println(\"Collect more (y/n) ?\");\n String line = in.readLine();\n if (line.length() == 0 || line.charAt(0) == 'n') {\n break;\n }\n hits = searcher.search(query, numTotalHits).scoreDocs;\n }\n\n end = Math.min(hits.length, start + hitsPerPage);\n\n for (int i = start; i < end; i++) {\n if (raw) {\n System.out.println(\"doc=\" + hits[i].doc + \" score= \" + hits[i].score);\n continue;\n }\n\n Document doc = searcher.doc(hits[i].doc);\n String path = doc.get(\"path\");\n if (path != null) {\n System.out.println((i + 1) + \". \" + path);\n String title = doc.get(\"title\");\n if (title != null) {\n System.out.println(\" Title: \" + doc.get(\"title\"));\n }\n } else {\n System.out.println((i + 1) + \". \" + \"No path for this document\");\n }\n }\n\n if (!interactive || end == 0) {\n break;\n }\n\n if (numTotalHits >= end) {\n boolean quit = false;\n while (true) {\n System.out.print(\"Press \");\n if (start - hitsPerPage >= 0) {\n System.out.print(\"(p)revious page, \");\n }\n if (start + hitsPerPage < numTotalHits) {\n System.out.print(\"(n)ext page, \");\n }\n System.out.println(\"(q)uit or enter number to jump to a page.\");\n\n String line = in.readLine();\n if (line.length() == 0 || line.charAt(0) == 'q') {\n quit = true;\n break;\n }\n if (line.charAt(0) == 'p') {\n start = Math.max(0, start - hitsPerPage);\n break;\n } else if (line.charAt(0) == 'n') {\n if (start + hitsPerPage < numTotalHits) {\n start += hitsPerPage;\n }\n break;\n } else {\n int page = Integer.parseInt(line);\n if ((page - 1) * hitsPerPage < numTotalHits) {\n start = (page - 1) * hitsPerPage;\n break;\n } else {\n System.out.println(\"No such page\");\n }\n }\n }\n if (quit) break;\n end = Math.min(numTotalHits, start + hitsPerPage);\n }\n }\n }", "public interface Query {\n\n\t/**\n\t * @return ID of the given query\n\t */\n\tint queryID();\n\t\n\t/**\n\t * @return given query\n\t */\n\tString query();\n\t\n\t/**\n\t * @return list of relevant documents to the corresponding query\n\t */\n\tList<RelevanceInfo> listOfRelevantDocuments();\n\t\n\t/**\n\t * @return list of results to the corresponding query after running one of the retrieval models\n\t */\n\tList<Result> resultList();\n\t\n\t/**\n\t * @param resultList\n\t * @Effects adds results to the result list of the corresponding query\n\t */\n\tvoid putResultList(List<Result> resultList);\n}", "public interface PermissionSearchRepository extends ElasticsearchRepository<Permission, Long> {\n}", "public void rank(){\n\n\t}", "public void setDocumentCount(Integer arg0) {\n \n }", "public interface IndexDocsInES {\n\n void indexDocs(Client client, String index_name, String type_name, List<Pair> docs);\n}", "@Test\n\tpublic void shouldReturnPagedOpenDocumentsForCustomRetailFilteredByAmountRange()\n\t{\n\t\tfinal SearchPageData<B2BDocumentModel> result = pagedB2BDocumentDao.getPagedDocumentsForUnit(UNIT_CUSTOM_RETAIL,\n\t\t\t\tcreatePageableData(0, 10, StringUtils.EMPTY), Collections.singletonList(AccountSummaryAddonUtils\n\t\t\t\t\t\t.createAmountRangeCriteriaObject(\"24\", \"27\", DOCUMENT_STATUS_OPEN, FILTER_BY_AMOUNT)));\n\n\t\tTestCase.assertEquals(1, result.getResults().size());\n\t\tTestCase.assertEquals(DOCUMENT_NUMBER_DBN_002, result.getResults().get(0).getDocumentNumber());\n\t\tTestCase.assertEquals(\"26.28\", result.getResults().get(0).getAmount().toPlainString());\n\t}", "public static void main (String[] args) {\n EntityQuery query = new EntityQuery();\n Harvestable res = new OaiPmhResource();\n query.setFilter(\"test\", res);\n query.setAcl(\"diku\");\n query.setStartsWith(\"cf\",\"name\");\n System.out.println(query.asUrlParameters());\n System.out.println(query.asWhereClause(\"a\"));\n query.setQuery(\"(usedBy=library)\");\n System.out.println(query.asUrlParameters());\n System.out.println(query.asWhereClause(\"x\"));\n\n query = new EntityQuery();\n query.setQuery(\"(usedBy=library)\");\n System.out.println(query.asUrlParameters());\n System.out.println(query.asWhereClause(\"b\"));\n query.setQuery(\"usedBy=*library\");\n System.out.println(query.asUrlParameters());\n System.out.println(query.asWhereClause(\"c\"));\n query.setQuery(\"(=library\");\n System.out.println(query.asUrlParameters());\n System.out.println(query.asWhereClause(\"d\"));\n query.setQuery(\"usedBy=\");\n System.out.println(query.asUrlParameters());\n System.out.println(query.asWhereClause(\"e\"));\n query.setQuery(\"(usedBy!=library)\");\n System.out.println(query.asUrlParameters());\n System.out.println(query.asWhereClause(\"f\"));\n query.setQuery(\"(usedBy==library)\");\n System.out.println(query.asUrlParameters());\n System.out.println(query.asWhereClause(\"g\"));\n query.setQuery(\"(usedBy===library)\");\n System.out.println(query.asUrlParameters());\n System.out.println(query.asWhereClause(\"h\"));\n }", "public void rankMatches();", "private Node estimateRelevance(Node original) throws Exception {\n Node combineNode = new Node(\"combine\", new NodeParameters(), original.getInternalNodes(), original.getPosition());\n\n // Only get as many as we need\n Parameters localParameters = retrieval.getGlobalParameters().clone();\n int fbDocs = (int) retrieval.getGlobalParameters().get(\"fbDocs\", 10);\n localParameters.set(\"requested\", fbDocs);\n\n // transform and run\n Node transformedCombineNode = retrieval.transformQuery(combineNode, localParameters);\n List<ScoredDocument> initialResults = retrieval.executeQuery(transformedCombineNode, localParameters).scoredDocuments;\n \n // Gather content\n ArrayList<String> names = new ArrayList<String>();\n for (ScoredDocument sd : initialResults) {\n names.add(sd.documentName);\n }\n List<Document> docs = getDocuments(names);\n\n // Now the maps from the different information sources\n // Each of these is a term -> field -> score double-mapping\n HashMap<String, TObjectDoubleHashMap<String>> uCFSs = null;\n double ucfw = p.get(\"ucfw\", 1.0);\n if (ucfw != 0.0) {\n uCFSs = getUnigramCollFieldScores();\n }\n\n HashMap<String, TObjectDoubleHashMap<String>> bCFSs = null;\n double bcfw = p.get(\"bcfw\", 1.0);\n if (bcfw != 0.0) {\n bCFSs = getBigramCollFieldScores();\n }\n\n HashMap<String, TObjectDoubleHashMap<String>> uPRFSs = null;\n double uprfw = p.get(\"uprfw\", 1.0);\n if (uprfw != 0.0) {\n uPRFSs = getUnigramPRFScores(docs);\n }\n\n HashMap<String, TObjectDoubleHashMap<String>> bPRFSs = null;\n double bprfw = p.get(\"bprfw\", 1.0);\n if (bprfw != 0.0) {\n bPRFSs = getBigramPRFScores(docs);\n }\n\n // We can now construct term-field weights using our supplied lambdas\n // and scores\n Node termNodes = new Node(\"combine\", new NodeParameters(), new ArrayList<Node>(), 0);\n termNodes.getNodeParameters().set(\"norm\", false);\n TObjectDoubleHashMap<String> weights = new TObjectDoubleHashMap<String>();\n for (String term : queryTerms) {\n weights.clear();\n for (String field : fields) {\n double sum = 0.0;\n if (uCFSs != null) {\n sum += (ucfw * uCFSs.get(term).get(field));\n }\n\n if (bCFSs != null) {\n TObjectDoubleHashMap<String> termMap = bCFSs.get(term);\n if (termMap != null) {\n sum += (bcfw * termMap.get(field));\n }\n }\n\n if (uPRFSs != null) {\n sum += (uprfw * uPRFSs.get(term).get(field));\n }\n\n if (bPRFSs != null) {\n TObjectDoubleHashMap<String> termMap = bPRFSs.get(term);\n if (termMap != null) {\n sum += (bprfw * termMap.get(field));\n }\n }\n weights.put(field, sum);\n }\n termNodes.addChild(createTermFieldNodes(term, weights));\n }\n return termNodes;\n }", "@Ignore\n @Test\n public void testGetDocument() throws Exception\n {\n \n int organizationId = 100;\n \n Util.commonServiceIPs=\"127.0.0.1\";\n EntityManager em = Util.getEntityManagerFactory(100).createEntityManager();\n \n EntityManager platformEm = Util.getPlatformEntityManagerFactory().createEntityManager();\n \n Client esClient = ESUtil.getClient(em, platformEm, 1, false);\n \n String dataobjectId = \"081E9AB4157A5F628E93436DB994A1F1EADCF3EA\";\n \n JSONObject obj = ESUtil.getDocument(esClient,organizationId, dataobjectId, null);\n \n int k;\n }", "public void run(){\n\t\tif(searchHow==0){\n\t\t\tint isbnCount = 0;\n\t\t\tfor(int i=0; i<db.size(); i++){\n\t\t\t\t\tSearchRequest requestIsbn = new SearchRequest(db, searchForThis, isbnCount, db.size());\n\t\t\t\t\tdb.searchByISBN(requestIsbn);\n\t\t\t\t\tisbnCount = requestIsbn.foundPos;\n\t\t\t\t\tif (requestIsbn.foundPos >= 0) {\n\t\t\t\t\t\tisbnCount++;\n\t\t\t\t\t\tString formatThis = \"Matched ISBN at position: \" + requestIsbn.foundPos;\n\t\t\t\t\t\tSystem.out.printf(\"%-35s || Title: \"+db.getBook(requestIsbn.foundPos)+\"\\n\",formatThis);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\ti=db.size();\n\t\t\t}\n\t\t}\n\t\tif(searchHow==1){\n\t\t\tint titleCount = 0;\n\t\t\tfor(int i=0; i<db.size(); i++){\n\t\t\t\t\tSearchRequest requestTitle = new SearchRequest(db, searchForThis, titleCount, db.size());\n\t\t\t\t\tdb.searchByTitle(requestTitle);\n\t\t\t\t\ttitleCount = requestTitle.foundPos;\n\t\t\t\t\tif (requestTitle.foundPos >= 0) {\n\t\t\t\t\t\ttitleCount++;\n\t\t\t\t\t\tString formatThis = \"Matched title at position: \" + requestTitle.foundPos;\n\t\t\t\t\t\tSystem.out.printf(\"%-35s || Title: \"+db.getBook(requestTitle.foundPos)+\"\\n\",formatThis);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\ti=db.size();\n\t\t\t}\n\t\t}\n\t\tif(searchHow==2){\n\t\t\tint authorCount = 0;\n\t\t\tfor(int i=0; i<db.size(); i++){\n\t\t\t\t\tSearchRequest requestAuthor = new SearchRequest(db, searchForThis, authorCount, db.size());\n\t\t\t\t\tdb.searchByAuthor(requestAuthor);\n\t\t\t\t\tauthorCount = requestAuthor.foundPos;\n\t\t\t\t\tif (requestAuthor.foundPos >= 0) {\n\t\t\t\t\t\tauthorCount++;\n\t\t\t\t\t\tString formatThis = \"Matched author at position: \" + requestAuthor.foundPos;\n\t\t\t\t\t\tSystem.out.printf(\"%-35s || Title: \"+db.getBook(requestAuthor.foundPos)+\"\\n\",formatThis);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\ti=db.size();\n\t\t\t}\n\t\t}\n\t\tif(searchHow==3){\n\t\t\tint pageCount = 0;\n\t\t\tfor(int i=0; i<db.size(); i++){\n\t\t\t\t\tSearchRequest requestPage = new SearchRequest(db, searchForThis, pageCount, db.size());\n\t\t\t\t\tdb.searchByNumPages(requestPage);\n\t\t\t\t\tpageCount = requestPage.foundPos;\n\t\t\t\t\tif (requestPage.foundPos >= 0) {\n\t\t\t\t\t\tpageCount++;\n\t\t\t\t\t\tString formatThis = \"Matched pages at position: \" + requestPage.foundPos;\n\t\t\t\t\t\tSystem.out.printf(\"%-35s || Title: \"+db.getBook(requestPage.foundPos)+\"\\n\",formatThis);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\ti=db.size();\n\t\t\t}\n\t\t}\n\t\tif(searchHow==4){\n\t\t\tint yearCount = 0;\n\t\t\tfor(int i=0; i<db.size(); i++){\n\t\t\t\t\tSearchRequest requestYear = new SearchRequest(db, searchForThis, yearCount, db.size());\n\t\t\t\t\tdb.searchByYear(requestYear);\n\t\t\t\t\tyearCount = requestYear.foundPos;\n\t\t\t\t\tif (requestYear.foundPos >= 0) {\n\t\t\t\t\t\tyearCount++;\n\t\t\t\t\t\tString formatThis = \"Matched year at position: \" + requestYear.foundPos;\n\t\t\t\t\t\tSystem.out.printf(\"%-35s || Title: \"+db.getBook(requestYear.foundPos)+\"\\n\",formatThis);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\ti=db.size();\n\t\t\t}\n\t\t}\n\t}", "void index(IDocument document, IIndexerOutput output) throws java.io.IOException;", "public interface ReportRepository extends MongoRepository<Report, ObjectId> {\n\n /**\n * Get all unread reports count\n * @return\n */\n @Query(value = \"{'read': {'$exists' : false }}\", count = true)\n public int getUnreadCount();\n}", "@Override\n public void processCas(CAS aCas) throws ResourceProcessException {\nSystem.out.println(\"Retrival evaluator...\");\n JCas jcas;\n try {\n jcas = aCas.getJCas();\n } catch (CASException e) {\n throw new ResourceProcessException(e);\n }\n\n FSIterator it = jcas.getAnnotationIndex(Document.type).iterator();\n \n// if (it.hasNext()) {\n// Document doc = (Document) it.next();\n// cnt++;\n// }\n// log(cnt);\n it = jcas.getAnnotationIndex(Document.type).iterator();\n\n if (it.hasNext()) {\n Document doc = (Document) it.next();\n int queryid = doc.getQueryID();\n int rel = doc.getRelevanceValue();\n // Make sure that your previous annotators have populated this in CAS\n FSList fsTokenList = doc.getTokenList();\n ArrayList<Token> tokenList = Utils.fromFSListToCollection(fsTokenList, Token.class);\n Map<String, Integer> queryVector = new HashMap<String, Integer>();\n Map<String, Integer> docVector = new HashMap<String, Integer>();\n if (rel == 99) {\n for (Token t : tokenList) {\n queryVector.put(t.getText(), t.getFrequency());\n }\n queryVectorlist.add(queryVector);\n } else {\n for (Token t : tokenList) {\n docVector.put(t.getText(), t.getFrequency());\n }\n double cos = computeCosineSimilarity(queryVectorlist.get(queryid - 1), docVector);\n coslist.add(cos);\n\n if (rel == 1) {\n gold = lines;\n goldcos = cos;\n System.out.println(\"goldcos\"+goldcos);\n }\n }\n \n if (qIdList.size() >= 1 && qIdList.get(qIdList.size() - 1) != queryid) {\n// System.out.println(\"lines:\"+lines);\n sortSimilarity(coslist);\n log(coslist);\n int rank=findRank(coslist,goldcos);\n rankList.add(rank);\n coslist = new ArrayList<Double>();\n }\n\n qIdList.add(doc.getQueryID());// 有啥用???\n relList.add(doc.getRelevanceValue());\n\n // Do something useful here\n lines++;\n }\n //log(coslist);\n\n }", "public void doSearch(BufferedReader in, IndexSearcher searcher, Query query, \n int hitsPerPage, boolean raw, boolean interactive) throws IOException {\n TopDocs results = searcher.search(query, 5 * hitsPerPage);\n ScoreDoc[] hits = results.scoreDocs;\n \n int numTotalHits = results.totalHits;\n System.out.println(numTotalHits + \" total matching documents\");\n\n int start = 0;\n int end = Math.min(numTotalHits, hitsPerPage);\n \n for (int i = start; i < end; i++) \n {\n Document doc = searcher.doc(hits[i].doc);\n String id = doc.get(\"id\");\n String author=doc.get(\"author\");\n String price=doc.get(\"price\");\n String category=doc.get(\"category\");\n String bookname=doc.get(\"bookname\");\n System.out.println(id+author+price+category+bookname);\n }\n }", "public abstract Rank<String,String> query(String input) throws ClassificationException;", "public interface FollowSearchRepository extends ElasticsearchRepository<Follow, Long> {\n}", "String getAllDocumentsScan(int numDocsPerShard) {\n\t\tString url = esScanUrl + numDocsPerShard;\n\t\t@SuppressWarnings(\"unused\")\n\t\tint resCode = doHttpOperation(url, HTTP_GET, ES_QUERY_SCROLL);\n\t\treturn lastResponse;\n\t}", "@Test\n public void testWithinIndex() {\n\n db.command(new OCommandSQL(\"create class Polygon extends v\")).execute();\n db.command(new OCommandSQL(\"create property Polygon.geometry EMBEDDED OPolygon\")).execute();\n\n db.command(\n new OCommandSQL(\n \"insert into Polygon set geometry = ST_GeomFromText('POLYGON((0 0, 10 0, 10 5, 0 5, 0 0))')\"))\n .execute();\n\n db.command(\n new OCommandSQL(\"create index Polygon.g on Polygon (geometry) SPATIAL engine lucene\"))\n .execute();\n\n List<ODocument> execute =\n db.query(\n new OSQLSynchQuery<ODocument>(\n \"SELECT from Polygon where ST_DWithin(geometry, ST_GeomFromText('POLYGON((12 0, 14 0, 14 6, 12 6, 12 0))'), 2.0) = true\"));\n\n Assert.assertEquals(1, execute.size());\n\n OResultSet resultSet =\n db.query(\n \"SELECT from Polygon where ST_DWithin(geometry, ST_GeomFromText('POLYGON((12 0, 14 0, 14 6, 12 6, 12 0))'), 2.0) = true\");\n\n // Assert.assertEquals(1, resultSet.estimateSize());\n\n resultSet.stream().forEach(r -> System.out.println(\"r = \" + r));\n resultSet.close();\n }", "Page<Research> findAll(Pageable pageable);" ]
[ "0.62819564", "0.62480146", "0.617602", "0.61166847", "0.60676724", "0.59492314", "0.5864622", "0.58291525", "0.5826985", "0.5787878", "0.57864374", "0.57843375", "0.5699365", "0.5696352", "0.56950784", "0.5681597", "0.5665971", "0.56633705", "0.5651546", "0.5643067", "0.5641759", "0.559666", "0.5594535", "0.55725604", "0.556794", "0.55662656", "0.5526141", "0.54920524", "0.5487119", "0.5486721", "0.5469149", "0.54663956", "0.5465051", "0.5445886", "0.5440202", "0.5428156", "0.5405146", "0.53886545", "0.5371084", "0.53682745", "0.5362607", "0.53334296", "0.5329757", "0.532652", "0.53230566", "0.5293728", "0.52891827", "0.5277745", "0.5273423", "0.52723926", "0.5269679", "0.5265548", "0.5247339", "0.52408594", "0.52403057", "0.52388877", "0.52378994", "0.52360064", "0.5235701", "0.5232989", "0.523292", "0.5229342", "0.5226784", "0.5225942", "0.5211951", "0.520997", "0.51946336", "0.5181781", "0.51711416", "0.5163957", "0.5159364", "0.51513547", "0.51395947", "0.51393443", "0.5117654", "0.51160216", "0.51093644", "0.51072973", "0.5104379", "0.5104042", "0.5101111", "0.5097081", "0.5096785", "0.5070445", "0.50703335", "0.50696576", "0.50641286", "0.50621516", "0.5055206", "0.50535357", "0.50501627", "0.50498074", "0.50487435", "0.5047715", "0.5044095", "0.5043747", "0.5037416", "0.50348914", "0.50282377", "0.501947", "0.5015127" ]
0.0
-1
"OK" the command SAVE was performed correctly.
public String SAVE(String filename){ try{ //File will be rewritten BufferedWriter writer = new BufferedWriter(new FileWriter(filename, false)); Enumeration keys = this.clientData.keys(); while(keys.hasMoreElements()){ String keyToAppend = (String) keys.nextElement(); writer.append(keyToAppend + "," + this.clientData.get(keyToAppend) + '\n'); } writer.close(); } catch (IOException e) { e.printStackTrace(); return "ERROR CANNOT WRITE TO THE FILE"; } return "OK"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void alertSaveSuccess() {\n\t\tthis.alert(\"Saved\",\"Game saved\",AlertType.INFORMATION);\n\t}", "public void save() {\t\n\t\n\t\n\t}", "public void operationSave() {\n\r\n\t\tstatusFeldSave();\r\n\t}", "private void save() {\r\n\t\tif (Store.save()) {\r\n\t\t\tSystem.out.println(\" > The store has been successfully saved in the file StoreData.\\n\");\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\" > An error occurred during saving.\\n\");\r\n\t\t}\r\n\t}", "public boolean save();", "@Override\n\tpublic void save() {\n\t\tSystem.out.println(\"save method\");\n\t}", "public void save() {\n }", "public int save() {\n\t\treturn 0;\n\t}", "public void save() throws Exception {\n\t\tgetControl(\"saveButton\").click();\n\t\tVoodooUtils.pause(3000);\n\t}", "private void btnSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSaveActionPerformed\n boolean flag = this.cutiController.save(txtCutiID.getText(), (txtTglAwal.getText()), (txtTglAkhir.getText()),\n txtKet.getText(), cmbCutiKhususID.getSelectedIndex());\n String message = \"Failed to save data...\";\n if (flag){\n message = \"Success to save data...\";\n }\n JOptionPane.showMessageDialog(this, message, \"Allert / Notification\", \n JOptionPane.INFORMATION_MESSAGE);\n \n bindingTable();\n reset();\n }", "void save();", "void save();", "void save();", "public void save();", "public void save();", "public void save();", "public void save();", "private void btnSaveActionPerformed(java.awt.event.ActionEvent evt) {\n rom.save(obstacle, frog);\n isSaved = true;\n }", "@Override\n\tpublic void save() {\n\t\t\n\t}", "@Override\n\tpublic void save() {\n\t\t\n\t}", "private void checkSave() {\n if (view.getSave()) {\n try {\n saveGame.export(view.getSaveGameName());\n } catch (Exception e) {\n System.out.println(\"saving failed\");\n }\n System.exit(0);\n }\n }", "@Override\r\n\tpublic int save() throws NotesApiException {\n\t\treturn 0;\r\n\t}", "public String save() {\n\t\tString isValidatedOrMessage = this.validate();\n\t\tif(isValidatedOrMessage == \"valid\") {\n\t\t\tint id = Database.save(this.getClass().getSimpleName(), this);\n\t\t\tthis.id = id;\n\t\t\treturn \"saved\";\n\t\t} else {\n\t\t\treturn isValidatedOrMessage;\n\t\t}\t\t\n\t}", "public void saveAction() {\n\t\tresult.setValue(convertPairsToText());\n\t\tcloseDialog();\n\t}", "public abstract String doSave() throws Exception;", "@Override\r\n\tpublic void save() throws SaveException {\n\t\t\r\n\t}", "public String Save()\n\t{\n\t\tif (this.actionString == \"Create\")\n\t\t{\n\t\t\tSystem.out.println(\"CREATE NEW CAR: \" + this.modifyCar.toString());\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"UPDATE CAR: \" + this.modifyCar.toString());\n\t\t}\n\n\t\treturn \"home\";\n\t}", "@Override\r\n\tpublic void save() {\n\r\n\t\ts.save();\r\n\r\n\t}", "@Override\r\n\tpublic void save() {\n\r\n\t}", "@Override\r\n\tpublic void save() {\n\r\n\t}", "@Override\n public void Save() {\n\t \n }", "private void savedDialog() {\n\t\tTextView tv = new TextView(this);\n\t\ttv.setText(\"Changes to the current recipe have been saved.\");\n\t\tAlertDialog.Builder alert = new AlertDialog.Builder(this);\n\t\talert.setTitle(\"Success\");\n\t\talert.setView(tv);\n\t\talert.setNegativeButton(\"OK\", new DialogInterface.OnClickListener() {\n\t\t\tpublic void onClick(DialogInterface dialog, int whichButton) {\n\t\t\t\tfinish();\n\t\t\t}\n\t\t});\n\t\talert.show();\n\t}", "@Override\n public void save() {\n \n }", "public boolean doSave() {\n return true;\n }", "public void save(){\r\n if (inputValidation()) {\r\n if (modifyingPart) {\r\n saveExisting();\r\n } else {\r\n saveNew();\r\n }\r\n closeWindow();\r\n }\r\n\r\n }", "public void saving() {\n\t\tSystem.out.println(\"7\");\n\n\t}", "@Override\n String save() {\n return \"\";\n }", "@Override\n\tpublic void save() throws Exception {\n\t\tVoodooUtils.focusFrame(\"bwc-frame\");\n\t\tgetControl(\"save\").click();\n\t\tVoodooUtils.waitForReady();\n\t\tVoodooUtils.focusDefault();\n\t}", "private void save() {\n var boolGrid = editor.getBoolGrid();\n //Generate a track grid from the bool frid\n var grid = Track.createFromBoolGrid(boolGrid);\n var valid = Track.isValidTrack(grid);\n if (!valid) {\n //fire an error event\n MessageBus.fire(new ErrorEvent(\"Invalid track\", \"\", 2));\n } else {\n //Save the track and pop back\n var generator = new TrackFromGridGenerator(grid);\n var track = generator.generateTrack();\n (new TrackStorageManager()).saveTrack(track);\n menu.navigationPop();\n menu.showError(new ErrorEvent(\"Saved track!\", \"\", 2, Colour.GREEN));\n }\n }", "@Override\n public void save()\n {\n \n }", "public boolean save() {\n\t\treturn save(_file);\n\t}", "protected abstract void doSave();", "public void save(){\r\n\t\t//System.out.println(\"call save\");\r\n\t\tmodel.printDoc();\r\n\t}", "public void save() {\n DataBuffer.saveDataLocally();\n\n //TODO save to db must be done properly\n DataBuffer.save(session);\n\n //TODO recording saved confirmation\n }", "@Override\n public void save() {\n\n }", "int needsSaving();", "private boolean isSave() {\n return \"save\".equalsIgnoreCase(data.substring(tokenStart, tokenStart + 4));\n }", "private boolean askSave() {\n if (isNeedSaving()) {\n int option = JOptionPane.showConfirmDialog(form,\n \"Do you want to save the change?\", \"Save\", JOptionPane.YES_NO_CANCEL_OPTION);\n //direct code base on user choice\n switch (option) {\n case JOptionPane.YES_OPTION:\n //check if file is null\n if (file == null) {\n //check if user cancel save option\n if (!saveAs()) {\n return false;\n }\n } else {\n //check if user cancel save option\n if (!save()) {\n return false;\n }\n }\n break;\n case JOptionPane.CANCEL_OPTION:\n return false;\n }\n }\n return true;\n }", "private void checkSave() {\n if (config.needsSave() || motes.needsSave()) {\n System.out.println(\"need save\");\n int save = JOptionPane.showConfirmDialog(frame, \"Do you want to save this configuration?\", \"Save Configuration\", JOptionPane.YES_NO_OPTION);\n if (save == JOptionPane.YES_OPTION) {\n saveConfiguration(DEFAULT_DB_CONFIG_TABLE);\n }\n }\n }", "private void savePressed(){\n\t\t\n\t\tJFileChooser fileChooser = new JFileChooser(System.getProperty(\"user.dir\"));\n\t\tFileNameExtensionFilter extentions = new FileNameExtensionFilter(\"SuperCalcSave\", \"scalcsave\");\n\t\tfileChooser.setFileFilter(extentions);\n\t\tint retunedVal = fileChooser.showSaveDialog(this);\n\t\tFile file = null;\n\t\tif(retunedVal == JFileChooser.APPROVE_OPTION){\n\t\t\tfile = fileChooser.getSelectedFile();\n\t\t\t//make sure file has the right extention\n\t\t\tif(file.getAbsolutePath().contains(\".scalcsave\"))\n\t\t\t\tfile = new File(file.getAbsolutePath());\n\t\t\telse\n\t\t\t\tfile = new File(file.getAbsolutePath()+\".scalcsave\");\n\t\t}\n\t\t//only continue if a file is selected\n\t\tif(file != null){\t\n\t\t\ttry {\n\t\t\t\t//read in file\n\t\t\t\tObjectOutputStream output = new ObjectOutputStream(new FileOutputStream(file));\n\t\t\t\toutput.writeObject(SaveFile.getSaveFile());\n\t\t\t\toutput.close();\n\t\t\t\tSystem.out.println(\"Save Success\");\n\t\t\t\t\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "public boolean save() {\n return false;\n }", "public final void saveAction(){\r\n\t\ttestReqmtService.saveAction(uiTestReqEditModel);\r\n\t\tgeteditDetails(uiTestReqEditModel.getObjId());\r\n\t\taddInfoMessage(SAVETR, \"save.TRsuccess\"); \r\n\t\tfor (UITestReqModel reqmnt : uiTestReqModel.getResultList()) {\r\n\t\t\tif(reqmnt.isTrLink()){\r\n\t\t\t\treqmnt.setTrLink(false);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private boolean askSaveGame()\n {\n \tObject options[] = {\"Save\", \"Discard\", \"Cancel\"};\n \tint n = JOptionPane.showOptionDialog(this,\n \t\t\t\t\t \"Game has changed. Save changes?\",\n \t\t\t\t\t \"Save Game?\",\n \t\t\t\t\t JOptionPane.YES_NO_CANCEL_OPTION,\n \t\t\t\t\t JOptionPane.QUESTION_MESSAGE,\n \t\t\t\t\t null,\n \t\t\t\t\t options,\n \t\t\t\t\t options[0]);\n \tif (n == 0) {\n \t if (cmdSaveGame()) \n \t\treturn true;\n \t return false;\n \t} else if (n == 1) {\n \t return true;\n \t}\n \treturn false;\n }", "@Override\n public int save( Mention obj ) {\n return 0;\n }", "@Override\n\tpublic String save() throws Exception {\n\t\treturn null;\n\t}", "@Override\n public boolean save()\n {\n return false;\n }", "void saveGame() throws IOException, Throwable {\n Save save = new Save(\"01\");\n save.addToSaveGame(objectsToSave());\n save.saveGame();\n }", "private void saveData() {\n }", "public boolean bookSave(Book book) {\n\t\t\r\n\t\treturn true;\r\n\t}", "@Override\n\tpublic int save(CursoAsignatura ca) {\n\t\treturn 0;\n\t}", "private boolean OK() {\r\n return in == saves[save-1];\r\n }", "public void saveData(){\r\n file.executeAction(modelStore);\r\n }", "public void alertSaveError() {\n\t\tthis.alert(\"ERROR\",\"Save error\",AlertType.ERROR);\n\t}", "private void saveGame(){\n\t\t\n\t}", "protected boolean promptToSave() {\n if (!boxChanged) {\n return true;\n }\n switch (JOptionPane.showConfirmDialog(this,\n bundle.getString(\"Do_you_want_to_save_the_changes_to_\")\n + (boxFile == null ? bundle.getString(\"Untitled\") : boxFile.getName()) + \"?\",\n APP_NAME, JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE)) {\n case JOptionPane.YES_OPTION:\n return saveAction();\n case JOptionPane.NO_OPTION:\n return true;\n default:\n return false;\n }\n }", "public void saveData ( ) {\n\t\tinvokeSafe ( \"saveData\" );\n\t}", "private boolean promptToSave() throws IOException {\n applicationTemplate.getDialog(Dialog.DialogType.CONFIRMATION).show(\"Save work?\", \n \"Would you like to save your current work?\");\n return ((ConfirmationDialog)applicationTemplate.getDialog(Dialog.DialogType.CONFIRMATION)).getSelectedOption().equals(Option.YES) \n || ((ConfirmationDialog)applicationTemplate.getDialog(Dialog.DialogType.CONFIRMATION)).getSelectedOption().equals(Option.NO);\n }", "private void handleMenuSave() {\n String initialDirectory = getInitialDirectory();\n String initialFileName = getInitialFilename(Constants.APP_FILEEXTENSION_SPV);\n File file = FileChooserHelper.showSaveDialog(initialDirectory, initialFileName, this);\n\n if (file == null) {\n return;\n }\n\n handleFileStorageFactoryResult(controller.saveFile(file.getAbsolutePath()));\n }", "public void save(Veranstaltung veranstaltung) throws RuntimeException;", "@Override\n\tpublic void save(DataKey arg0) {\n\t\t\n\t}", "void save() {\n gameModelPoDao.saveToFile(file.getAbsolutePath(), gameModelPo);\n }", "public boolean promptToSave()\r\n {\r\n // PROMPT THE USER TO SAVE UNSAVED WORK\r\n AnimatedSpriteEditorGUI gui = AnimatedSpriteEditor.getEditor().getGUI();\r\n int selection =JOptionPane.showOptionDialog(gui, \r\n PROMPT_TO_SAVE_TEXT, PROMPT_TO_SAVE_TITLE_TEXT, \r\n JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, \r\n null, null, null);\r\n \r\n // IF THE USER SAID YES, THEN SAVE BEFORE MOVING ON\r\n if (selection == JOptionPane.YES_OPTION)\r\n {\r\n poseIO.savePose(currentFile, false);\r\n poseIO.savePoseImage(currentPoseName, poseID);\r\n saved = true;\r\n }\r\n \r\n // IF THE USER SAID CANCEL, THEN WE'LL TELL WHOEVER\r\n // CALLED THIS THAT THE USER IS NOT INTERESTED ANYMORE\r\n else if (selection == JOptionPane.CANCEL_OPTION)\r\n {\r\n return false;\r\n }\r\n\r\n // IF THE USER SAID NO, WE JUST GO ON WITHOUT SAVING\r\n // BUT FOR BOTH YES AND NO WE DO WHATEVER THE USER\r\n // HAD IN MIND IN THE FIRST PLACE\r\n return true;\r\n }", "public void saveData(){\n reporter.info(\"Save edited form\");\n clickOnElement(LOCATORS.getBy(COMPONENT_NAME,\"SAVE_BUTTON\"));\n }", "public void save()\n\t{\n\t\ttry\n\t\t{\n\t\t\tgetConnection().commit();\n\t\t\tgetPreparedStatement(\"SET FILES SCRIPT FORMAT COMPRESSED\").execute();\n\t\t\t// causes a checkpoint automatically.\n\t\t} catch (SQLException e)\n\t\t{\n\t\t\tm_logger.error(\"Couldn't cleanly save.\", e);\n\t\t}\n\t}", "public String save() {\n return code;\n }", "public void save(){\r\n\t\ttry {\r\n\t\t\tgame.suspendLoop();\r\n\t\t\tGameStockage.getInstance().save(game);\r\n\t\t\tgame.resumeLoop();\r\n\t\t} catch (GameNotSaveException e) {\r\n\t\t\tSystem.err.println(e.getMessage());\r\n\t\t\tgame.resumeLoop();\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.err.println(e.getMessage());\r\n\t\t\tgame.resumeLoop();\r\n\t\t}\r\n\t}", "private void saveFunction() {\n }", "@Override\n\tpublic void save(Religiao obj) throws Exception {\n\t\t\n\t}", "@Override\n\tpublic void save(CorsoDiLaurea corso) {\n\t\t\n\t}", "public String save() {\r\n\t\tVendorMasterModel model = new VendorMasterModel();\r\n\t\tmodel.initiate(context, session);\r\n\t\tboolean result;\r\n\t\tif (vendorMaster.getVendorCode().equals(\"\")) {\r\n\t\t\tresult = model.add(vendorMaster);\r\n\t\t\tif (result) {\r\n\t\t\t\taddActionMessage(\"Record saved successfully.\");\r\n\t\t\t\t//reset();\r\n\t\t\t\tgetNavigationPanel(3);\r\n\t\t\t}// end of if\r\n\t\t\telse {\r\n\t\t\t\taddActionMessage(\"Duplicate entry found.\");\r\n\t\t\t\tmodel.Data(vendorMaster, request);\r\n\t\t\t\tgetNavigationPanel(1);\r\n\t\t\t\treset();\r\n\t\t\t\treturn \"success\";\r\n\t\t\t\t\r\n\t\t\t}// end of else\r\n\t\t}// end of if\r\n\t\telse {\r\n\t\t\tresult = model.mod(vendorMaster);\r\n\t\t\tif (result) {\r\n\t\t\t\taddActionMessage(\"Record updated Successfully.\");\r\n\t\t\t\t//reset();\r\n\t\t\t\tgetNavigationPanel(3);\r\n\t\t\t}// end of if\r\n\t\t\telse {\r\n\t\t\t\tgetNavigationPanel(1);\r\n\t\t\t\tmodel.Data(vendorMaster, request);\r\n\t\t\t\taddActionMessage(\"Duplicate entry found.\");\r\n\t\t\t\treset();\r\n\t\t\t\treturn \"success\";\r\n\t\t\t\t\r\n\t\t\t}// end of else\r\n\t\t}// end of else\r\n\t\tmodel.calforedit(vendorMaster,vendorMaster.getVendorCode());\t\r\n\t\tmodel.terminate();\r\n\t\treturn \"Data\";\r\n\t}", "private void saveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveActionPerformed\n toSave();\n }", "public void testSave() throws RepositoryException{\n session.save();\n sessionControl.replay();\n sfControl.replay();\n \n jt.save();\n }", "protected void save() {\n close();\n if(saveAction != null) {\n saveAction.accept(getObject());\n }\n }", "public boolean getSave(){\n return this.didSave;\n }", "private static void checkSaveOnExit() {\n\t\tif(!saved && !config.isUpdateDB()) {\n \t\tint option = JOptionPane.showOptionDialog(frame,\n \t\t\t\t\"There are unsaved changes\\nDo you want to save them now?\",\n \t\t\t\t\"Unsaved changes\",JOptionPane.YES_NO_CANCEL_OPTION,\n \t\t\t\tJOptionPane.WARNING_MESSAGE, null, null, 0);\n \t\tswitch(option) {\n \t\tcase 0:\n \t\t\tportfolio.save(WORKING_FILE);\n \t\tcase 1:\n \t\t\tframe.dispose();\n \t\tdefault:\n \t\t\tbreak; \t \t\t\n \t\t}\n \t\tSystem.out.println(\"unsaved changes \" + option);\n \t} else {\n \t\tframe.dispose();\n \t}\n\t\t\n\t}", "protected void succeed()\r\n {\r\n // inform user\r\n ((OwMainAppContext) getContext()).postMessage(getContext().localize(\"plug.owdocprops.OwFieldView.saved\", \"The changes have been applied.\"));\r\n }", "public void clickOnSave() {\r\n\t\telement(saveButton).waitUntilVisible();\r\n\t\tsaveButton.click();\r\n\t}", "public void save(String msg) {\n\t\tSystem.out.println(\"测试——msg\"+msg);\n\t}", "public void changesSaved(boolean saveWorked) {\n if (saveWorked == true) {\n console.promptForPrintPrompt(\" ++++++++++++++++++++++++++++++++++++++++\");\n console.promptForPrintPrompt(\" +++++++ CHANGES SAVED TO FILE +++++++\");\n console.promptForPrintPrompt(\" ++++++++++++++++++++++++++++++++++++++++\");\n } else {\n console.promptForPrintPrompt(\" ++++++++++++++++++++++++++\");\n console.promptForPrintPrompt(\" + shhh bby is ok +\");\n console.promptForPrintPrompt(\" +========================+\");\n console.promptForPrintPrompt(\" + something is broke +\");\n console.promptForPrintPrompt(\" + unable to save to file +\");\n console.promptForPrintPrompt(\" ++++++++++++++++++++++++++\");\n }\n }", "@Override\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\tJOptionPane.showMessageDialog(null, \"保存成功\");\n\t\t}", "private void saveButtonActionPerformed(java.awt.event.ActionEvent evt)\n {\n if (validationIsOK()) {\n \tsaveSettings();\n autosave.saveSettings();\n if (this.autosaveListener != null\n ) {\n \tthis.autosaveListener.reloadSettings();\n }\n dispose();\n }\n }", "public boolean save(Data model);", "private void testSaveFile() {\n System.out.println(\"------ TESTING : saveFile(String filename) ------\");\n try{\n if(!iTestFileList.saveFile(sFile)) {\n throw new RuntimeException(\"FAILED -> saveFile(String filename) not working correctly\");\n }\n }catch (RuntimeException e){\n System.out.print(e.getMessage());\n }\n }", "public void trySave() throws BOException {\n//\t\tif (verifyState()) {\n\t\tverifyState();\n\t\tsave();\n//\t\t}\n\t}", "public boolean checkForSave(String msg) {\r\n \t\t// Checks if there's an old graph to save\r\n \t\tif (model != null && model.toBeSaved()) {\r\n \t\t\tint resultValue = JOptionPane.showConfirmDialog(mainWindow, msg, \"JMODEL - Warning\", JOptionPane.YES_NO_CANCEL_OPTION,\r\n \t\t\t\t\tJOptionPane.WARNING_MESSAGE);\r\n \t\t\tif (resultValue == JOptionPane.YES_OPTION) {\r\n \t\t\t\tsaveModel();\r\n \t\t\t\treturn true;\r\n \t\t\t}\r\n \t\t\tif (resultValue == JOptionPane.CANCEL_OPTION) {\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 save(New object);", "void save() {\r\n if (actionCompleted) {\r\n forget();\r\n } else {\r\n AccountSettings.stateStored = new Bundle();\r\n save(AccountSettings.stateStored);\r\n }\r\n }", "private void completeSave() {\n colorBar.updateRevertToCurrent();\n colorBar.revertColorBar();\n undoBtn.setEnabled(false);\n redoBtn.setEnabled(false);\n cmapParams.setColorMapName(seldCmapName);\n saveBtn.setEnabled(true);\n }", "private void displaySaveSuccess() {\n\t\tString title = \"Event successfully save...\";\n\t\tString msg =\n\t\t\t\t\"To Do List: \" +txtSubject.getText()+ \n\t\t\t\t\"\\nhas been save....\";\n\t\tJOptionPane.showMessageDialog(\n\t\t\t\tnull, msg, title, JOptionPane.INFORMATION_MESSAGE);\n\t}", "public void save () {\r\n String[] options = {\"Word List\", \"Puzzle\", \"Cancel\"};\r\n int result = JOptionPane.showOptionDialog (null, \"What Do You Want To Save?\", \"Save\", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[0]);\r\n if (result == 0) {\r\n fileManager.saveWords (words);\r\n } else if (result == 1){\r\n fileManager.savePuzzle (puzzle);\r\n }\r\n }", "private void saveAsButton(){\n SaveAsLabNameTextField.setText(\"\");\n SaveAsErrorLabel.setVisible(false);\n SaveAsDialog.setVisible(true);\n }" ]
[ "0.74323994", "0.7295605", "0.7197657", "0.71964693", "0.7149076", "0.7083359", "0.707917", "0.69997704", "0.69851005", "0.693229", "0.68997", "0.68997", "0.68997", "0.689769", "0.689769", "0.689769", "0.689769", "0.68974483", "0.68929", "0.68929", "0.68864006", "0.68754303", "0.6862668", "0.6849875", "0.6837049", "0.6770238", "0.6742923", "0.66979903", "0.6696484", "0.6696484", "0.66777307", "0.6677353", "0.66296715", "0.66228896", "0.66161954", "0.66160446", "0.66105795", "0.6609202", "0.66000825", "0.659605", "0.65852624", "0.657987", "0.6558585", "0.6557852", "0.65572643", "0.6522182", "0.65220845", "0.6509935", "0.648504", "0.6484497", "0.64799565", "0.64726985", "0.6471675", "0.64588785", "0.64375913", "0.64340246", "0.64313173", "0.6420887", "0.64164823", "0.64158237", "0.6415265", "0.6412393", "0.64113545", "0.6409774", "0.63680357", "0.63659143", "0.63639295", "0.6359437", "0.63582826", "0.6350292", "0.63486075", "0.63292575", "0.63259", "0.63240945", "0.6307762", "0.6298392", "0.62974995", "0.62926006", "0.62883", "0.6282116", "0.626579", "0.6254018", "0.62486905", "0.6244071", "0.6234847", "0.6232868", "0.6221403", "0.6212936", "0.62058145", "0.6197054", "0.6190603", "0.6181757", "0.6181263", "0.6181181", "0.61773854", "0.6171322", "0.6167428", "0.6164969", "0.61601305", "0.6150517", "0.6150389" ]
0.0
-1
"OK name" the command GET was performed correctly.
public String GET(String name){ return "OK " + this.clientData.get(name); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tprotected void executeGet(GetRequest request, OperationResponse response) {\n\t}", "@Override\n\tprotected Method getMethod() {\n\t\treturn Method.GET;\n\t}", "public Result get(Get get) throws IOException;", "public void doGet( )\n {\n \n }", "@NonNull\n public String getAction() {\n return \"GET\";\n }", "private static String sendGET(String getURL) throws IOException {\n\t\tURL obj = new URL(getURL);\n\t\tHttpURLConnection con = (HttpURLConnection) obj.openConnection();\n\t\tcon.setRequestMethod(\"GET\");\n\t\tString finalResponse = \"\";\n\n\t\t//This way we know if the request was processed successfully or there was any HTTP error message thrown.\n\t\tint responseCode = con.getResponseCode();\n\t\tSystem.out.println(\"GET Response Code : \" + responseCode);\n\t\tif (responseCode == HttpURLConnection.HTTP_OK) { // success\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));\n\t\t\tString inputLine;\n\t\t\tStringBuffer buffer = new StringBuffer();\n\n\t\t\twhile ((inputLine = in.readLine()) != null) {\n\t\t\t\tbuffer.append(inputLine);\n\t\t\t}\n\t\t\tin.close();\n\n\t\t\t// print result\n\t\t\tfinalResponse = buffer.toString();\n\t\t} else {\n\t\t\tSystem.out.println(\"GET request not worked\");\n\t\t}\n\t\treturn finalResponse;\n\t}", "java.lang.String getResponse();", "private static String sendGET(final Long id) {\n return \"\";\r\n }", "public static int doGet(String id, Result r) {\n r.setValue(\"\");\n String response = \"\";\n HttpURLConnection conn;\n int status = 0;\n try {\n // pass the name on the URL line\n URL url = new URL(\"https://intense-lake-93564.herokuapp.com/menusection/\" + \"//\"+id);\n conn = (HttpURLConnection) url.openConnection();\n conn.setRequestMethod(\"GET\");\n // tell the server what format we want back\n conn.setRequestProperty(\"Accept\", \"text/plain\");\n // wait for response\n status = conn.getResponseCode();\n // If things went poorly, don't try to read any response, just return.\n if (status != 200) {\n // not using msg\n String msg = conn.getResponseMessage();\n return conn.getResponseCode();\n }\n String output = \"\";\n // things went well so let's read the response\n BufferedReader br = new BufferedReader(new InputStreamReader(\n (conn.getInputStream())));\n while ((output = br.readLine()) != null) {\n response += output;\n }\n conn.disconnect(); \n }\n catch (MalformedURLException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n // return value from server\n // set the response object\n r.setValue(response);\n // return HTTP status to caller\n return status;\n }", "@Test\n void getTest() {\n URI uri = URI.create(endBody + \"/get\");\n\n // get the response\n HttpResponse<String> response = HttpMethods.get(uri);\n\n // check if it received OK\n assertEquals(200, response.statusCode());\n }", "public String testGet(String arg1) {\n HttpClient client = new DefaultHttpClient();\n HttpGet get = new HttpGet(URL);\n\n try {\n HttpResponse response = client.execute(get);\n HttpEntity resEntity = response.getEntity();\n return EntityUtils.toString(resEntity);\n } catch (Exception e) { }\n\n return null;\n }", "@GET\n @Produces(MediaType.TEXT_PLAIN)\n public String getIt() {\n return \"Got it!\";\n }", "@GET\n @Path(\"/ping\")\n\tpublic Response ping() {\n\t\tlog.debug(\"Ping check ok\");\n return Response.status(Response.Status.OK).entity(1).build();\n \n\t}", "static String sendGET(String GET_URL) throws IOException, JSONException {\n\t\t// Check URL is valid or not.\n\t\tif (isValidURL(GET_URL)) {\n\t\t\ttry {\n\t\t\t\tURL obj = new URL(GET_URL);\n\t\t\t\tHttpURLConnection con = (HttpURLConnection) obj.openConnection();\n\t\t\t\tcon.setRequestMethod(\"GET\");\n\t\t\t\tcon.setRequestProperty(\"User-Agent\", USER_AGENT);\n\t\t\t\tint responseCode = con.getResponseCode();\n\t\t\t\tSystem.out.println(\"GET Response Code :: \" + responseCode);\n\t\t\t\tif (responseCode == HttpURLConnection.HTTP_OK) { // success\n\t\t\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));\n\t\t\t\t\tString inputLine;\n\t\t\t\t\tStringBuffer response = new StringBuffer();\n\n\t\t\t\t\twhile ((inputLine = in.readLine()) != null) {\n\t\t\t\t\t\tresponse.append(inputLine);\n\t\t\t\t\t}\n\t\t\t\t\tin.close();\n\t\t\t\t\t// Convert to json object and get specified data from it. Then you can print if the response is json type.\n\t\t\t\t\tString list = getList(response.toString());\n\t\t\t\t\tSystem.out.println(list);\n\t\t\t\t\t// print result\n\t\t\t\t\tSystem.out.println(response.toString());\n\t\t\t\t\treturn \"GET request worked\"; // Added for testing.\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"GET request not worked\");\n\t\t\t\t\treturn \"GET request not worked\";\n\t\t\t\t}\n\t\t\t} catch (MalformedURLException e) {\n\t\t\t\treturn \"URL is valid but connection could not be established.\";\n\t\t\t} catch (IOException e) {\n\t\t\t\treturn \"URL is valid but connection could not be established.\";\n\t\t\t}\n\t\t} else {\n\t\t\treturn \"URL is not valid.\";\n\t\t}\n\t}", "String getResponse();", "@GET\n\n\t@Produces(MediaType.TEXT_PLAIN)\n\n\t//@Path(\"test\")\n\tpublic String getIt() {\n\n\t\treturn \"Got it!\";\n\t}", "@GET\n @StatusCodes ({\n @ResponseCode ( code = 200, condition = \"Upon a successful read.\"),\n @ResponseCode( code = 204, condition = \"Upon a successful query with no results.\"),\n @ResponseCode( code = 404, condition = \"The specified entity has been moved, deleted, or otherwise not found.\")\n })\n Response get();", "public String issueGetRequest(String query) {\n URL url;\n String result = \"\";\n\n return \"valid\";\n /**\n * Todo: When server API is up and running uncomment this.\n *\n * try { url = new URL(server + \"?\" + query); BufferedReader br = new\n * BufferedReader(new InputStreamReader(url.openStream())); String\n * strTemp = \"\";\n * \n * while (null != (strTemp = br.readLine())) { result = strTemp; }\n * \n * } catch (Exception e) { e.printStackTrace(); }\n * \n * return result;\n */\n }", "@Test\n\tpublic void readSystemPlayerStateUsingGETTest() throws ApiException {\n\t\tString gameId = \"mockGameId\";\n\t\tString playerId = \"mockPlayerId\";\n\t\tString conceptName = \"mockConcept\";\n\t\tApiClient client = new ApiClient();\n\t\tclient.setBasePath(\"http://localhost:\" + PORT);\n\t\tConfiguration.setDefaultApiClient(client);\n\n\t\tPlayerControllerApi api = new PlayerControllerApi();\n\n\t\tString mResponse = \"[\\\"mockChallenger\\\"]\";\n\n\t\tstubFor(get(\n\t\t\t\turlEqualTo(\"/data/game/\" + gameId + \"/player/\" + playerId + \"/challengers?conceptName=\" + conceptName))\n\t\t\t\t\t\t.willReturn(aResponse().withHeader(\"Content-Type\", \"application/json\").withBody(mResponse)));\n\n\t\tList<String> response = api.readSystemPlayerStateUsingGET(gameId, playerId, conceptName);\n\n\t\tassertEquals(response.contains(\"mockChallenger\"), true);\n\n\t}", "@Test\n\t \n\t public void getApi() {\n\t\t \n\t\t Response getIt=get(\"https://reqres.in/api/users?page=2\");\n\t\t getIt.prettyPrint();\n\t\t System.out.println(getIt.getStatusCode());\n\t\t System.out.println(getIt.getTime());\n\t\t \n\t\t //to validate\n\t\t int validGstatus=getIt.getStatusCode();\n\t\t Assert.assertEquals(validGstatus,200);\n\t\t \n\t }", "@Test\n void sendGetRequest() {\n try {\n String response = HttpUtils.sendGet();\n assertFalse(response.contains(\"404\"));\n } catch (IOException e) {\n e.printStackTrace();\n fail();\n }\n }", "public boolean isGet();", "public void doGet() throws IOException {\n\n // search ressource\n byte[] contentByte = null;\n try {\n contentByte = ToolBox.readFileByte(RESOURCE_DIRECTORY, this.url);\n this.statusCode = OK;\n ContentType contentType = new ContentType(this.extension);\n sendHeader(statusCode, contentType.getContentType(), contentByte.length);\n } catch (IOException e) {\n System.out.println(\"Ressource non trouvé\");\n statusCode = NOT_FOUND;\n contentByte = ToolBox.readFileByte(RESPONSE_PAGE_DIRECTORY, \"pageNotFound.html\");\n sendHeader(statusCode, \"text/html\", contentByte.length);\n }\n\n this.sendBodyByte(contentByte);\n }", "public static boolean isGet(String argRequestMethod) {\r\n\t\treturn HttpConstants.GET.equalsIgnoreCase(argRequestMethod);\r\n\t}", "@Test\n public void getRequest1() {\n str = METHOD_GET + \"/JavaPower.gif \" + HTTP_VERSION + ENDL +\n HOST_HEADER + \": www.devresource.org\" + ENDL +\n ACCEPT + \": text/html\" + ENDL +\n \"Range-Unit: 3388 | 1024\";\n request = new HttpRequest(str, IP_ADDRESS, HOST);\n\n assertEquals(request.getMethod(), HttpMethod.GET);\n assertEquals(request.getUrn(), \"/JavaPower.gif\");\n assertEquals(request.getHeader(ACCEPT), \"text/html\");\n assertEquals(request.getHeader(\"Range-Unit\"), \"3388 | 1024\");\n assertEquals(request.getHeader(NONEXISTENT_VAR), \"\");\n assertEquals(request.getParameter(NONEXISTENT_VAR), \"\");\n }", "public static int doGetList(Result r) {\n // Make an HTTP GET passing the name on the URL line\n r.setValue(\"\");\n String response = \"\";\n HttpURLConnection conn;\n int status = 0;\n try {\n \n URL url = new URL(\"https://intense-lake-93564.herokuapp.com/menusection/\");\n conn = (HttpURLConnection) url.openConnection();\n conn.setRequestMethod(\"GET\");\n // tell the server what format we want back\n conn.setRequestProperty(\"Accept\", \"text/plain\");\n // wait for response\n status = conn.getResponseCode();\n // If things went poorly, don't try to read any response, just return.\n if (status != 200) {\n // not using msg\n String msg = conn.getResponseMessage();\n return conn.getResponseCode();\n }\n String output = \"\";\n // things went well so let's read the response\n BufferedReader br = new BufferedReader(new InputStreamReader(\n (conn.getInputStream()))); \n while ((output = br.readLine()) != null) {\n response += output; \n } \n conn.disconnect();\n \n }\n catch (MalformedURLException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } \n // return value from server\n // set the response object\n r.setValue(response);\n // return HTTP status to caller\n return status;\n }", "@Override\n public final void doGet() {\n try {\n checkPermissions(getRequest());\n // GET one\n if (id != null) {\n output(api.runGet(id, getParameterAsList(PARAMETER_DEPLOY), getParameterAsList(PARAMETER_COUNTER)));\n } else if (countParameters() == 0) {\n throw new APIMissingIdException(getRequestURL());\n }\n // Search\n else {\n\n final ItemSearchResult<?> result = api.runSearch(Integer.parseInt(getParameter(PARAMETER_PAGE, \"0\")),\n Integer.parseInt(getParameter(PARAMETER_LIMIT, \"10\")), getParameter(PARAMETER_SEARCH),\n getParameter(PARAMETER_ORDER), parseFilters(getParameterAsList(PARAMETER_FILTER)),\n getParameterAsList(PARAMETER_DEPLOY), getParameterAsList(PARAMETER_COUNTER));\n\n head(\"Content-Range\", result.getPage() + \"-\" + result.getLength() + \"/\" + result.getTotal());\n\n output(result.getResults());\n }\n } catch (final APIException e) {\n e.setApi(apiName);\n e.setResource(resourceName);\n throw e;\n }\n }", "private String httpOk() {\n return \"HTTP/1.1 200 OK\\r\\n\"\n + \"Content-Type: text/html\\r\\n\"\n + \"\\r\\n\";\n }", "GetResponse() {\n\t}", "public ResponseTranslator get() {\n setMethod(\"GET\");\n return doRequest();\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n request.setCharacterEncoding(\"UTF-8\");\n checkRequest(\"command\", request, response);\n }", "@GET(\"system/status\")\n Call<InlineResponse200> getStatus();", "public abstract String getResponse();", "private boolean _autoGet() throws SessionException\n {\n if (this._argTable.get(CMD.PUSH) != null)\n return this._autoGetPush();\n else if (this._argTable.get(CMD.QUERY) != null)\n return this._autoGetQuery();\n else \n return this._autoGetPull();\n }", "@Override\n\tpublic Status onGetStatus(String name) {\n\t\treturn null;\n\t}", "@GetMapping(\"\")\r\n @ResponseStatus(code = HttpStatus.OK)\r\n public void main() {\r\n LOGGER.info(\"GET /\");\r\n }", "@Test\n\tpublic void checkStatus() {\n\t\tclient.execute(\"1095C-16-111111\");\n\t}", "public char[] uri_GET()\n {return uri_GET(new char[120], 0);}", "@Test\n public void mapGet() {\n check(MAPGET);\n query(MAPGET.args(MAPNEW.args(\"()\"), 1), \"\");\n query(MAPGET.args(MAPENTRY.args(1, 2), 1), 2);\n }", "public HttpResponseWrapper invokeGET(String path) {\n\t\treturn invokeHttpMethod(HttpMethodType.HTTP_GET, path, \"\");\n\t}", "@RequestMapping(value = \"/operations/{name}\",\n method = RequestMethod.GET,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public ResponseEntity<OperationDTO> get(@PathVariable String name) {\n log.debug(\"REST request to get Operation : {}\", name);\n return Optional.ofNullable(operationRepository.findOne(name))\n .map(operationMapper::operationToOperationDto)\n .map(operationDTO -> new ResponseEntity<>(\n operationDTO,\n HttpStatus.OK))\n .orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND));\n }", "@GET\r\n @Produces(MediaType.TEXT_PLAIN)\r\n public String getText() {\n return \"hai\";\r\n }", "@Test\n public void testGetIt() {\n String responseMsg = target.path(\"myresource\").request().get(String.class);\n assertEquals(\"Got it!\", responseMsg);\n }", "R get() throws IOException, ClientProtocolException;", "private synchronized String processGet(String query) {\r\n\t\tString[] valuesCommand = query.split(\" \");\r\n\t\tif ( valuesCommand.length != 2 )\r\n\t\t\treturn \"ERROR Bad syntaxe command GET - Usage : GET id\";\r\n\t\tString id = valuesCommand[1];\r\n\t\tif ( !this.bank.existAccount(id) ) {\r\n\t\t\treturn \"ERROR Account doesn't exist\";\r\n\t\t}\r\n\t\tdouble solde = this.bank.getSolde(id);\r\n\t\treturn \"SOLDE \" + solde + \" \" + this.bank.getLastOperation(id);\r\n\t}", "@SuppressWarnings(\"unchecked\")\n\t@GET\n @Path(\"get/{hash}\")\n @Produces(\"application/json\")\n public Response getIt(@PathParam(\"hash\") String curHash) {\n \t\n \tJSONObject resp = new JSONObject();\n \t\n \tOnlineStatus on = OnlineStatus.getInstance(); \n \t\n \t// Find SA\n \tint saID = SADAO.hashToId(curHash);\n \t\n \tif (saID == 0) {\n \t\tresp.put(\"Error\", \"Hash not in database\");\n \t\treturn Response.status(200).entity(resp.toJSONString()).build();\n \t}\n \t\n \t//if SA is set for exit\n \tif(on.isForExit(curHash)){\n \t\tresp.put(\"Signal\" , \"Kill\");\n \t\ton.exited(curHash);\n \t\t\n \t\treturn Response.status(200).entity(resp.toJSONString()).build();\n \t}\n \t\n \t// Update SAs Online Status\n \ton.update(curHash);\n \t\n \t// Find jobs for SA\n \tLinkedList<Job> jobsToSendToSa = JobDAO.getAllSAJobs(saID);\n \t\n \tif(jobsToSendToSa.size() > 0){\n \t\tSystem.out.println(\"Sending to SA \"+curHash+\" the following job(s) :\");\n \t}\n \tfor (Job j : jobsToSendToSa) {\n \t\tj.print();\n \t}\n \t\n \t// Create JSON and Sent\n \tObjectMapper mapper = new ObjectMapper();\n \t\n \ttry{\n \t\t\n \t\tString jsonInString = mapper.writeValueAsString(jobsToSendToSa);\n \t\t\n \t\treturn Response.status(200).entity(jsonInString).build();\n \t\n \t}catch (JsonProcessingException ex){\n \t\t\n \t\tSystem.out.println(ex.getMessage());\n \t\t\n \t\tresp.put(\"Error\", ex.getMessage());\n \t\treturn Response.status(200).entity(resp.toJSONString()).build();\n \t}\n }", "@Override\n\tpublic String getType() {\n\t\treturn Global.GET;\n\t}", "@Override\r\n\tpublic String execute(String request) {\n\t\treturn response = \"The command is invalid\";\r\n\r\n\t}", "@Override\n public Answer executeRequest(Command cmd) {\n return null;\n }", "private static HttpResponse sendGet() throws Exception {\n // Create the Call using the URL\n HttpGet http = new HttpGet(url);\n // Set the credentials set earlier into the headers\n Header header = new BasicScheme(StandardCharsets.UTF_8).authenticate(creds, http, null);\n // Set the header into the HTTP request\n http.addHeader(header);\n // Print the response\n return httpClient.execute(http);\n }", "ChangeName.Rsp getChangeNameRsp();", "@Test\n public void test_getMethodWithoutData() {\n DataStoreResponse response = util.get(\"abcdefghijklmnopqrFsstuvwxyzABCD\");\n assertEquals(true, response.hasActionError);\n assertEquals(DataStoreConstants.DATA_NOT_FOUND, response.message);\n }", "@GetMapping(\"ping\")\n public String ping() {\n return \"pong\";\n }", "public void doOslcGet(HttpServletRequest request, HttpServletResponse response,\n\t\t\tList<String> oslcCommand, ISmService smService) throws Exception {\n\n\t\tDatabase db = getDatabase();\n\t\tString query = smService.getParam(request, \"query\");\n\t\tif (oslcCommand.size() == 1 && Strings.isNullOrEmpty(query)) { // This is a repository/<accessName> case (but not query) - it is an OSLC repository, and we respond with\n\t\t\t// a description of this service provider.\n\t\t\tnew OSLCHelper(getDatabase()).respondForServiceProvider(oslcCommand.get(0), request, response, smService);\n\t\t\treturn;\n\t\t}\n\t\tString id = \"\";\n\t\tString version = null;\n\t\tString versionInfo = \"\";\n\t\tif (null != smService) {\n\t\t\tid = smService.getParam(request, \"id\");\n\t\t\tversion = smService.getParam(request, \"version\");\n\t\t\tif (false == Strings.isNullOrEmpty(version) && false == \"current\".equals(version))\n\t\t\t\tversionInfo = \"&nbsp;&nbsp;[ For version \" + Repository.dateOfVersion(version).toString() + \"]\";\n\t\t}\n if (oslcCommand.size() < 1)\n {\n response.setStatus(HttpStatus.SC_NOT_ACCEPTABLE);\n Utils.respondWithText(response, \"No API found for unspecific repository\");\n return;\n }\n\n String contentType = smService.getParam(request, Database.Vars.contentType.toString());\n if (Strings.isNullOrEmpty(contentType)) {\n \tcontentType = db.getVar(Database.Vars.contentType.toString());\n } else\n \tdb.setVar(Database.Vars.contentType.toString(), contentType);\n\n if ((false == Utils.willAccept(IConstants.HTML, request) && false == Utils.willAccept(IConstants.PLAIN_TEXT_TYPE, request)) || \n \t\tStrings.isNullOrEmpty(contentType)) {\n \tcontentType = Utils.formatFromAcceptType4Jena(request);\n }\n\n\t\tADatabaseRow row = db.getItem(id);\n String domain = oslcCommand.get(0);\n if (null == row && null != domain)\n \trow = db.getPort4Domain(domain);\n try\n {\n Repository repository = (Repository) row.getModelRepository(); // This is a model repository.// Repository.create(row);\n Model model = repository.getModelForVersion(version, null);\n if (null == model)\n \tmodel = repository.getModel();\n\n \tString select = smService.getParam(request, \"select\");\n \tString where = smService.getParam(request, \"where\");\n \tString orderBy = smService.getParam(request, \"orderBy\");\n \tString restore = smService.getParam(request, \"restore\");\n \tString name = smService.getParam(request, \"name\");\n \tString save = smService.getParam(request, \"save\");\n \tString deleteSaved = smService.getParam(request, \"deleteSaved\");\n\n\n if (false == Strings.isNullOrEmpty(query)) {\n \tJSONObject contents = makeInitialJsonForSparql(query, repository, id, version);\n \tJSONObject jo = getQueryParams(smService, request);\n \tIterator<?> keys = jo.keys();\n \twhile (keys.hasNext()) {\n \t\tString key = (String)keys.next(); // JSONObject.getNames(jo)) {\n \t\tcontents.put(key, Utils.safeGet(jo, key));\n// \t\tcontents.putAll(getQueryParams(smService, request));\n \t}\n Utils.respondGetWithTemplateAndJson(contents, \"/templates/sparql.html\", response);\n \treturn;\n } else if (oslcCommand.size() == 2 && \"sparql\".equals(oslcCommand.get(1))) {\n \t \n \tif (Strings.isNullOrEmpty(select) || Strings.isNullOrEmpty(where)) {\n \t\tUtils.respondWithText(response, \"Illegal query, no SELECT or WHERE\");\n \t\treturn;\n \t}\n \tselect = select.trim();\n \twhere = where.trim();\n \tif (Strings.isNullOrEmpty(orderBy))\n \t\torderBy = \"\";\n \torderBy = orderBy.trim();\n \tJSONObject contents = getSparqlContents(request, repository, select, where, orderBy, id, smService,\n \t\t\tname, false == Strings.isNullOrEmpty(restore),\n \t\t\tfalse == Strings.isNullOrEmpty(save),\n \t\t\tfalse == Strings.isNullOrEmpty(deleteSaved));\n \tcontents.put(\"moreOrLess\", smService.getParam(request, \"moreOrLess\"));\n// \t\tSystem.out.println(\"Contents for the SPARQL query page:\\n[\" + contents.toString() + \"]\");\n \tUtils.respondGetWithTemplateAndJson(contents, \"/templates/sparql.html\", response);\n \treturn;\n }\n\n String base = repository.getBase(); //getModel().getNsPrefixURI(\"base\");\n List<Resource> R = new ArrayList<Resource>();\n \tboolean isSingleResource = false;\n \n String title = \"\";\n if (oslcCommand.size() == 2 && null != smService.getParam(request, \"sparql\")) {\n \t// do sparql instead of standard oslc query\n \tif (Strings.isNullOrEmpty(select) || Strings.isNullOrEmpty(where)) {\n \t\tUtils.respondWithText(response, \"Illegal query, no SELECT or WHERE\");\n \t\treturn;\n \t}\n \tselect = select.trim();\n \twhere = \"{ \" + where.trim() + \" } \";\n \tif (Strings.isNullOrEmpty(orderBy))\n \t\torderBy = \"\";\n \torderBy = orderBy.trim();\n \tJSONObject contents = getSparqlContents(request, repository, select, where, orderBy, id, smService,\n \t\t\tname, false == Strings.isNullOrEmpty(restore),\n \t\t\tfalse == Strings.isNullOrEmpty(save),\n \t\t\tfalse == Strings.isNullOrEmpty(deleteSaved));\n \tif (Utils.willAccept(IConstants.PLAIN_TEXT_TYPE, request)) { // This is an AJAX query to get list of resources,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t// yet the list needs to be formatted according to the contentType\n \t\tString resOpen = \"\\\"\", resClose = \"\\\"\";\n \t\tif (contentType.equals(IConstants.N_TRIPLE) || \n// \t\t\tcontentType.equals(IConstants.NTRIPLE) ||\n \t\t\tcontentType.equals(IConstants.TURTLE) ||\n \t\t\tcontentType.equals(IConstants.N3)\n \t\t\t) {\n \t\t\t\tresOpen = \"<\";\n \t\t\t\tresClose = \">\";\n \t\t}\n\n \t\tStringBuffer sb = new StringBuffer();\n \t\tJSONArray rows = (JSONArray) Utils.safeGet(contents, \"rows\");\n \t\tif (rows.length() < 1)\n \t\t\tsb.append(\"No resources reference url for \" + where.split(\" \")[3].trim());\n \t\telse { \n \t\t\tsb.append(\"Following resources reference \" + where.split(\" \")[3].trim());\n \t\t\tfor (int i=0; i < rows.length(); i++) {\n \t\t\t\tJSONObject theRow = (JSONObject) rows.get(i); \n \t\t\t\tJSONArray values = (JSONArray) Utils.safeGet(theRow, \"values\");\n \t\t\t\tfor (int j=0; j < values.length(); j++) {\n \t\t\t\t\tJSONObject val = (JSONObject) values.get(j);\n \t\t\t\t\tsb.append(\"\\n\").append(resOpen).append(base).append(Utils.safeGet(val, \"td\").toString().split(\":\")[1]).append(resClose);\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\tUtils.respondWithText(response, sb.toString());\n \t} else {\n// \t\tSystem.out.println(\"Contents for the SPARQL query page:\\n[\" + contents + \"]\");\n \tcontents.put(\"moreOrLess\", smService.getParam(request, \"moreOrLess\"));\n \tUtils.respondGetWithTemplateAndJson(contents, \"/templates/sparql.html\", response);\n \t}\n \treturn;\n } else if (oslcCommand.size() > 2 && \"resource\".equals(oslcCommand.get(1))) { // single resource\n// boolean isSingleResource = (oslcCommand.size() > 2 && \"resource\".equals(oslcCommand.get(1)));\n// if (isSingleResource) {\n \tResource r = model.getResource(base + oslcCommand.get(2));\n \ttitle = \"Resource [\" + r.getURI() + \"] in Domain [\" + domain + \"]\";\n \tR.add(r);\n \tisSingleResource = true;\n \t//getOslcresourcdeNew(base, repository, oslcCommand.get(2));\n } else {\n \n \ttitle = \"Resources in \" + ((\"\".equals(id))?\"\":\"[\" + id + \"], \") + \"Domain [\" + domain + \"]\";\n \tif (oslcCommand.size() <= 2) {\n \t\tString oslcWhere = smService.getParam(request, \"oslc.where\");\n \t\tString oslcPrefix = smService.getParam(request, \"oslc.prefix\");\n// \t\tString oslcProperties = smService.getParam(request, \"oslc.properties\");\n// \t\tString oslcOrderBy = smService.getParam(request, \"oslc.orderBy\");\n\n \t\t// Handle the oslc prefixes:\n \t\tMap<String, String> prefixMap = new HashMap<String, String>();\n\n \t\tif (false == Strings.isNullOrEmpty(oslcPrefix))\n \t\t\ttry {\n \t\t\t\tprefixMap = QueryUtils.parsePrefixes(oslcPrefix);\n \t\t\t} catch (org.eclipse.lyo.core.query.ParseException e) {\n \t\t\t\tthrow new IOException(e.getMessage());\n \t\t\t}\n\n\n \t\t\t// Handle the oslc properties part:\n// \t\t\tProperties properties = null;\n//\n// \t\t\ttry {\n// \t\t\t\tif (Strings.isNullOrEmpty(oslcProperties)) {\n// \t\t\t\t\tproperties = QueryUtils.WILDCARD_PROPERTY_LIST;\n// \t\t\t\t} else\n// \t\t\t\t\tproperties = QueryUtils.parseSelect(oslcProperties, prefixMap);\n// \t\t\t} catch (org.eclipse.lyo.core.query.ParseException e) {\n// \t\t\t\tthrow new IOException(e.getMessage());\n// \t\t\t} catch (RuntimeException e) {\n// \t\t\t\te.printStackTrace();\n// \t\t\t}\n\n// \t\t\t// Handle the oslc where clause:\n// \t\t\tWhereClause whereClause = null;\n//\n// \t\t\tif (false == Strings.isNullOrEmpty(oslcWhere)) {\n// \t\t\t\ttry {\n// \t\t\t\t\twhereClause = QueryUtils.parseWhere(oslcWhere, prefixMap);\n// \t\t\t\t} catch (org.eclipse.lyo.core.query.ParseException e) {\n// \t\t\t\t\tthrow new IOException(e.getMessage());\n// \t\t\t\t}\n// \t\t\t}\n\n// \t\t\t// Handle the oslc order by clause:\n// \t\t\tOrderByClause orderByClause = null;\n//\n// \t\t\tif (false == Strings.isNullOrEmpty(oslcOrderBy)) {\n// \t\t\t\ttry {\n// \t\t\t\t\torderByClause = QueryUtils.parseOrderBy(oslcOrderBy, prefixMap);\n// \t\t\t\t} catch (org.eclipse.lyo.core.query.ParseException e) {\n// \t\t\t\t\tthrow new IOException(e.getMessage());\n// \t\t\t\t}\n// \t\t\t}\n\n// \t\t\tModel model = repository.getModel();\n \t\t\tif (Strings.isNullOrEmpty(oslcWhere)) {\n \t\t\t\tResIterator it = model.listSubjects();\n \t\t\t\twhile (it.hasNext()) {\n \t\t\t\t\tResource res = it.next();\n \t\t\t\t\tif (res.getURI().startsWith(base))\n \t\t\t\t\t\tR.add(res);\n \t\t\t\t}\n \t\t\t} else {\n \t\t\t\tprefixMap.putAll(model.getNsPrefixMap());\n \t\t\t\tprefixMap = Utils.fixNsPrefixes(prefixMap);\n \t\t\t\tString prefix = Utils.makePrefix4Query(prefixMap);\n \t\t\t\tString sparql = \"SELECT ?r WHERE + { ?r ?p ?v }\";\n \t\t\t\tString t[] = oslcWhere.split(\"=\");\n \t\t\t\tif (t.length > 1) {\n \t\t\t\t\tString pred = t[0].trim();\n \t\t\t\t\tString value = t[1].trim();\n \t\t\t\t\tsparql = prefix + \"SELECT ?r WHERE { ?r \" + pred + \" \" + value + \". }\";\n \t\t\t\t\tQueryExecution qexec = QueryExecutionFactory.create(sparql, model);\n \t\t\t\t\tResultSet rslt = qexec.execSelect();\n \t\t\t\t\twhile (rslt.hasNext()) {\n \t\t\t\t\t\tQuerySolution soltn = rslt.next();\n \t\t\t\t\t\tRDFNode r = (RDFNode) soltn.get(\"r\");\n \t\t\t\t\t\tif (r.toString().startsWith(base))\n \t\t\t\t\t\t\tR.add((Resource)r);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t\tnew OSLCHelper(getDatabase()).repsondForOslcQuery(R, request, response, smService, id);\n \t\t\treturn;\n \t} else {\n \t\tString resource = oslcCommand.get(1), N = \"\";\n \t\tif (resource.startsWith(\"resource#\"))\n \t\t\tN = resource.substring(\"resource#\".length());\n \t\telse if (resource.startsWith(\"resource/\"))\n \t\t\tN = resource.substring(\"resource/\".length());\n \t\tR.add(model.getResource(base + N));\n \t}\n }\n Model tmpModel = ModelFactory.createDefaultModel();\n // \tmodel.setNsPrefixes(Utils.fixNsPrefixes(repository.getModel().getNsPrefixMap()));\n for (Resource res : R) {\n \tStmtIterator it = res.listProperties();\n \twhile (it.hasNext()) {\n \t\tStatement stmt = it.next();\n \t\ttmpModel.add(stmt);\n \t}\n }\n\n// \tString type = Utils.formatFromAcceptType4Jena(request);\n// \tif (Utils.willAccept(ContentTypes.HTML, request)) {\n// \t\ttype = db.getVar(Database.Vars.contentType.toString());\n// \t}\n \tString output = Utils.modelToText(tmpModel, contentType);\n\n response.setHeader(HttpHeaders.ETAG, repository.getEtag());\n\n JSONObject contents = new JSONObject();\n contents.put(\"rdf\", output);\n contents.put(\"id\", id);\n String url = request.getRequestURL().toString(); //.getUri();\n if (url.indexOf('?') >=0)\n \turl = url.substring(0, url.indexOf('?'));\n contents.put(\"url\", url);\n contents.put(Database.Vars.contentType.toString(), db.getVar(Database.Vars.contentType.toString()));\n contents.put(\"header\", title);\n \t\tcontents.put(\"canDownload\", isSingleResource?\"false\":\"true\");\n \t\tcontents.put(\"host\", db.getHost(true, true));// db.getBaseURL()); //Utils.getHost(null, true));\n \t\tcontents.put(\"canmodify\", \"true\");\n \t\tcontents.put(\"version\", Strings.isNullOrEmpty(version)?\"\":version);\n contents.put(\"versionInfo\", versionInfo);\n //.processModelForJson(domain, \"ShowRDF\", repository, title, id, R);\n\n// \t\tString acceptType = Utils.formatFromAcceptType4Jena(request);\n\n \tif (Utils.willAccept(IConstants.HTML, request)) {\n// \t\tJSONObject contents = SmManager.processModelForJson(domain, \"ShowRDF\", model, title, id, true);\n// \t\tcontents.put(\"canDownload\", isSingleResource?\"false\":\"true\");\n \t\tcontents.put(\"hideGraphics\", \"\");\n \t\tUtils.respondGetWithTemplateAndJson(contents, \"/templates/rdf4oslc.html\", response);\n \t} else if (Utils.willAccept(IConstants.JSON, request)){\n// \t\tJSONObject contents = SmManager.processModelForJson(domain, \"ShowRDF\", model, title, id, true);\n// \t\tcontents.put(\"canDownload\", isSingleResource?\"false\":\"true\");\n \t\tUtils.respondWithJson(response, contents);\n \t} else {\n \t\tUtils.respondWithText(response, output, contentType);\n \t}\n }\n catch (Exception e)\n {\n e.printStackTrace();\n throw new Exception(\"OSLC failed [\" + e.getMessage() + \"].\");\n }\n\t}", "@Test\n public void testGetIt() {\n String responseMsg = target.path(\"service/servertest\").request().get(String.class);\n assertEquals(\"Got it!\", responseMsg);\n }", "@Test\r\n\tpublic void doGet() throws Exception {\n\t\tCloseableHttpClient httpClient = HttpClients.createDefault();\r\n\t\t// Create a GET object and pass a url to it\r\n\t\tHttpGet get = new HttpGet(\"http://www.google.com\");\r\n\t\t// make a request\r\n\t\tCloseableHttpResponse response = httpClient.execute(get);\r\n\t\t// get response as result\r\n\t\tSystem.out.println(response.getStatusLine().getStatusCode());\r\n\t\tHttpEntity entity = response.getEntity();\r\n\t\tSystem.out.println(EntityUtils.toString(entity));\r\n\t\t// close HttpClient\r\n\t\tresponse.close();\r\n\t\thttpClient.close();\r\n\t}", "@GET\n\t@Path(\"/test\")\n\t@Produces(\"text/plain\")\n\tpublic String resourceTest(){\n\t\treturn OpenstackNetProxyConstants.MESSAGE_TEST;\n\t}", "@GET\n @Produces(MediaType.TEXT_PLAIN)\n public Response getIt() {\n logger.info(\"Hello World method called.\");\n\n return Response\n .status(Response.Status.OK)\n .entity(\"Hello World\")\n .build();\n }", "private RawHttpResponse<?> executeRequest(String method, String path) throws IOException {\r\n\t\tSocket socket = new Socket(\"localhost\", 8080);\r\n\t\treturn executeRequest(method, path, \"\", socket);\r\n\t}", "@Test\n public void simpleGet(){\n when()\n .get(\"http:://34.223.219.142:1212/ords/hr/employees\")\n .then().statusCode(200);\n\n }", "@Order(2)\n\t\t@Test\n\t\tpublic void getMessageWithNoParam() throws IOException, ParseException {\n\t\t\tboolean response = Requests.sendGETBoolReturn(Requests.MESSAGE_URL, \"\");\n\t\t\t\n\t\t\t//the GET is expected to return all messages :: expected response is true (200 response code)\n\t\t\tassertTrue(response);\n\t\t}", "@Test\n\tpublic void getRequestWithQueryParamter() {\n\t\tgiven()\n\t\t.queryParam(\"fullText\", \"true\")\n\t\t.when()\n\t\t.get(\"https://restcountries.eu/rest/v2/name/aruba\")\n\t\t.then()\n\t\t.assertThat()\n\t\t.contentType(ContentType.JSON)\n\t\t.and()\n\t\t.statusCode(HttpStatus.SC_OK)\n\t\t.log().all();\n\t}", "public String getOk() {\r\n\t\treturn \"\";\r\n\t}", "@Test \n\tpublic void get() \n\t{\n\t\tassertTrue(true);\n\t}", "private void requestClientNameFromServer() {\n writeToServer(ServerAction.GET_NAME + \"\");\n }", "@Test\n public void testOptions() throws Exception {\n\n HttpURLConnection result = HttpUtil.options(\"http://localhost:9090/ehcache/rest/doesnotexist/1\");\n assertEquals(200, result.getResponseCode());\n assertEquals(\"application/vnd.sun.wadl+xml\", result.getContentType());\n\n String responseBody = HttpUtil.inputStreamToText(result.getInputStream());\n assertNotNull(responseBody);\n assertTrue(responseBody.matches(\"(.*)GET(.*)\"));\n assertTrue(responseBody.matches(\"(.*)PUT(.*)\"));\n assertTrue(responseBody.matches(\"(.*)DELETE(.*)\"));\n assertTrue(responseBody.matches(\"(.*)HEAD(.*)\"));\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tcommandAction(request,response);\r\n\t}", "@ApiOperation(value=\"get方法測式\", notes=\"取得會員資料\")\n @RequestMapping(value=\"getMethod\",method=RequestMethod.GET)\n @ApiResponses(value = {\n @ApiResponse(code = 200, message = \"Success\", response = String.class),\n @ApiResponse(code = 401, message = \"Unauthorized\"),\n @ApiResponse(code = 403, message = \"Forbidden\"),\n @ApiResponse(code = 404, message = \"Not Found\"),\n @ApiResponse(code = 500, message = \"Failure\")})\n public String getMember(@ApiParam(value = \"name that need to be updated\", required = true) @RequestParam String memberId) {\n System.out.println(\"==memberId===>\"+memberId);\n return memberId;\n }", "@Test\n public void testGet() throws Exception {\n SimpleSNMP simpleSNMP = new SimpleSNMP();\n\n\n String ip = \"127.0.0.1\";\n String oid = \".1.3.6.1.4.1.2011.10.2.6.1.1.1.1.6.97\";\n String responseSring = simpleSNMP.get(ip, \"public\", oid);\n\n printGetResult(oid, responseSring);\n }", "public String getOk() {\n return Ok.getText(); /*FAULT:: return \"y\"; */\n }", "@Path(\"/get9\")\n\t@GET\n\t@Produces(\"text/plain\")\n\tpublic String get9() {\n\t\tStringBuilder buf = new StringBuilder();\n\n\t\tbuf.append(\"Parameter Names: \\n\");\n\n\t\tfor (String param : uriInfo.getQueryParameters().keySet()) {\n\t\t\tbuf.append(param);\n\t\t\tbuf.append(\"\\n\");\n\t\t}\n\n\t\treturn buf.toString();\n\t}", "public static boolean isGet(HttpServletRequest argRequest) {\r\n\t\treturn HttpConstants.GET.equalsIgnoreCase(argRequest.getMethod());\r\n\t}", "@RequestMapping(value = \"/name/{name:.+}\", method = RequestMethod.GET)\n @Override\n public List<Command> commandForName(@PathVariable String name) {\n try {\n return repos.findByName(name);\n } catch (Exception e) {\n logger.error(\"Error getting command: \" + e.getMessage());\n throw new ServiceException(e);\n }\n }", "private static String get_request(String uri, boolean isChecking, String token) throws IOException {\r\n URL url = new URL(uri);\r\n HttpURLConnection connection = (HttpURLConnection) url.openConnection();\r\n connection.setRequestProperty(\"Content-Type\", \"application/json\");\r\n connection.setRequestProperty(\"User-Agent\", \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36 Edg/88.0.705.74\");\r\n if (isChecking) {\r\n connection.setRequestProperty(\"Authorization\", token);\r\n }\r\n connection.setRequestMethod(\"GET\");\r\n InputStream responseStream = connection.getInputStream();\r\n if (debug) {\r\n System.out.println(\"GET - \"+connection.getResponseCode());\r\n }\r\n try (Scanner scanner = new Scanner(responseStream)) {\r\n String responseBody = scanner.useDelimiter(\"\\\\A\").next();\r\n if (debug) {\r\n System.out.println(responseBody);\r\n }\r\n return responseBody;\r\n } catch (Exception e) {\r\n return \"ERROR\";\r\n }\r\n }", "@Test\n\tpublic void trial01() {\n\t\tspec1.pathParam(\"id\", 3);\n\t\tResponse response =given().spec(spec1).get(\"/{id}\");\n\t\tresponse.prettyPrint();\n\t\t\n\t\tresponse.then().assertThat().statusCode(200).contentType(ContentType.JSON).statusLine(\"HTTP/1.1 200 OK\");\n\t}", "@RequestMapping(value = \"/ping\", produces = \"text/plain\")\n public String ping() {\n return \"OK\";\n }", "public String requestAction3(){\n return \"Response Three\";\n }", "@Test\r\n\tpublic void testGetNom() {\r\n\t\tassertEquals(client.getNom(), \"toto\");\r\n\t}", "@RequestMapping(value = \"/ping/{shared_key}\", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)\n public CommonsResponse ping(@PathVariable(\"shared_key\") String nombrePantalla)\n {\n CommonsResponse response = new CommonsResponse();\n response.setCodigo(EstatusGenericos.INFO.getCode());\n response.setEstatus(EstatusGenericos.INFO.getCode());\n response.setDescripcion(EstatusGenericos.INFO.getDescription());\n return response;\n }", "Http.Status status();", "public EntityType2 get() throws ClientException {\n return send(HttpMethod.GET, null);\n }", "public boolean sendHTTPResponseGET(String getRES, Socket link) throws IOException{\n\t\tDataOutputStream ds = new DataOutputStream(link.getOutputStream());\n\t\tresourceHandler.ServerSideScripter objSvrSidScr = new resourceHandler.ServerSideScripter();\n\t\t\n\t\tString res=null;\t\t\n\t\t\n\t\tString WEBDOCS = serverConfig.ServerPaths.WEBDOCS;\n\t\tString defaultPage = serverConfig.ServerPaths.defaultPage;\n\n\t\tserverConfig.ServerPages svrPg = new serverConfig.ServerPages();\n\t\tString WEBRoot = svrPg.getWebRoot();\n\t\tString WEBErr = svrPg.getWebErr();\n\n\t\tif(getRES.length()>0){\n\t \ttry{\n\t \t\tresourceHandler.ResReader resRead = new resourceHandler.ResReader();\n\t\t\t\tif(getRES.equalsIgnoreCase(\"/\") && defaultPage.length()>0){\n\t\t\t\t\tres=WEBDOCS+platformSpecificLocator(\"/\" + defaultPage);\n\t\t\t\t\tif(sendResponseHeader(res, TypeOfFile.StoredFile, objSvrSidScr)){//res Exists\n\t\t\t\t\t\tresRec.sendHTTPResponseHeader(ds);\n\t\t\t\t\t\tresRead.writeHTTPResponseMsg(res, ds, objSvrSidScr);\n\t\t\t\t\t}\n\t\t\t\t\telse{//res don't Exists\n\t\t\t\t\t\tsendResponseHeader(\"404\", TypeOfFile.StringFile, objSvrSidScr);\n\t\t\t\t\t\tresRec.sendHTTPResponseHeader(ds);\n\t \t\tds.writeBytes(WEBErr);\n\t \t\tds.writeChars(\"\\n\");\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t\telse if(getRES.equalsIgnoreCase(\"/\") && defaultPage.length()==0){\n\t\t\t\t\tsendResponseHeader(\"200\", TypeOfFile.StringFile, objSvrSidScr);\n\t\t\t\t\tresRec.sendHTTPResponseHeader(ds);\n\t\t\t\t\tds.writeBytes(WEBRoot);\n \t\tds.writeChars(\"\\n\");\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tres=WEBDOCS+platformSpecificLocator(getRES);\n\t\t\t\t\tif(sendResponseHeader(res, TypeOfFile.StoredFile, objSvrSidScr)){\n\t\t\t\t\t\tresRec.sendHTTPResponseHeader(ds);\n\t\t\t\t\t\tSystem.out.println(\"++++++++++++++++responseMsg wrote\");\n\t\t\t\t\t\tresRead.writeHTTPResponseMsg(res, ds, objSvrSidScr);\n\t\t\t\t\t\tSystem.out.println(\"++++++++++++++++response clear\");\n\t\t\t\t\t}\n\t\t\t\t\telse{//res don't Exists\n\t\t\t\t\t\tsendResponseHeader(\"404\", TypeOfFile.StringFile, objSvrSidScr);\n\t\t\t\t\t\tresRec.sendHTTPResponseHeader(ds);\n\t \t\tds.writeBytes(WEBErr);\n\t \t\tds.writeChars(\"\\n\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"Resource to Read: \" + res);\n \t\t/*ds.close();*/\n\t\t\t\treturn true;\n\t \t}\n catch (Exception e){\n \ttry{\n\t\t\t\t\tSystem.out.println(\"++++++++++++++++Exception Raised\");\n\t\t\t\t\tsendResponseHeader(\"404\", TypeOfFile.StringFile, objSvrSidScr);\n\t\t\t\t\tresRec.sendHTTPResponseHeader(ds);\n \t\tds.writeBytes(WEBErr);\n \t\tds.writeChars(\"\\n\");\n \t\t/*ds.close();*/\n \t\t\t\tSystem.out.println(\"Resource to Read: \" + res + \".{ERROR}\");\n \t\t\t\treturn true;\n \t\t\t} \n catch (Exception e2){\n \t\t\t\tSystem.err.println(\"File input error\");\n \t\t\t}\n\t\t\t}\n\t\t}\n else{\n \tSystem.out.println(\"Invalid parameters\");\n }\n \n return false;\n\t}", "@Test\r\n public void testGetCommandName() {\r\n assertEquals(\"curl\", curl.getCommandName());\r\n }", "private String requesttosend() throws IOException {\n\t\tsender.sendMsg(Constants.REQSEND);\r\n\t\t//等待接收的返回状态\r\n\t\treturn sender.getMsg();\r\n\t}", "public PersonName get() throws ClientException {\n return send(HttpMethod.GET, null);\n }", "@Override\n\tpublic void onClick(View v) {\n\t\tString retStr = \"\";\n\t\tif(!(DEF_HTTP.equals(edit01.getText().toString()))) {\n\t\t\tretStr = doGet(edit01.getText().toString());\n\t\t\ttxtView.setText(edit01.getText().toString() + \" \" + retStr);\n\t\t}\n\t\t\n\t\tif(!(DEF_HTTP.equals(edit02.getText().toString()))) {\n\t\t\tretStr = doGet(edit02.getText().toString());\n\t\t\ttxtView.setText(txtView.getText().toString() + \"\\n\" + edit02.getText().toString() + \" \" + retStr);\n\t\t}\n\t\t\n\t\tif(!(DEF_HTTP.equals(edit03.getText().toString()))) {\n\t\t\tretStr = doGet(edit03.getText().toString());\n\t\t\ttxtView.setText(txtView.getText().toString() + \"\\n\" + edit03.getText().toString() + \" \" + retStr);\n\t\t}\n\t}", "public void doGet(HttpServletRequest request,\n HttpServletResponse response)\n throws IOException, ServletException {\n response.setContentType(TYPE_TEXT_HTML.label);\n response.setCharacterEncoding(UTF8.label);\n request.setCharacterEncoding(UTF8.label);\n String path = request.getRequestURI();\n logger.debug(RECEIVED_REQUEST + path);\n Command command = null;\n try {\n command = commands.get(path);\n command.execute(request, response);\n } catch (NullPointerException e) {\n logger.error(REQUEST_PATH_NOT_FOUND);\n request.setAttribute(JAVAX_SERVLET_ERROR_STATUS_CODE, 404);\n command = commands.get(EXCEPTION.label);\n command.execute(request, response);\n }\n }", "public HarvestResult executeGetRequest() throws ParseException, IOException {\n final HttpGet get = new HttpGet(petition.getUrl()\n + generateQueryParams());\n\n HttpResponse httpResult = null;\n T21HttpClientWithSSL httpClient = petition.getHttpClient();\n\n get.setHeaders(generateHeaders(get));\n int statusCode = HttpStatus.SC_NOT_FOUND;\n logPetition(get);\n httpResult = httpClient.execute(get);\n statusCode = httpResult.getStatusLine().getStatusCode();\n TLog.i(\"Status code = \" + statusCode);\n String answer = getJsonFromRequest(httpResult);\n HarvestResult result = generateResult(answer, statusCode, httpClient);\n return result;\n }", "public void serverSideOk();", "@HTTP(\n method = \"GET\",\n path = \"/apis/config.openshift.io/v1/apiservers/{name}/status\"\n )\n @Headers({ \n \"Accept: */*\"\n })\n KubernetesCall<APIServer> readAPIServerStatus(\n @Path(\"name\") String name, \n @QueryMap ReadAPIServerStatus queryParameters);", "public void request() {\n }", "public static String executeGet(String targetURL) {\t\n\t\t HttpURLConnection connection = null; \n\t\t try {\n\t\t //Create connection\n\t\t URL url = new URL(targetURL);\n\t\t connection = (HttpURLConnection)url.openConnection();\n\t\t connection.setRequestMethod(\"GET\");\n\t\t connection.setRequestProperty(\"Content-Type\", \"application/json\");\n\t\t connection.setRequestProperty(\"Content-Language\", \"en-US\"); \n\n\t\t connection.setUseCaches(false);\n\t\t connection.setDoOutput(true);\n\n\n\t\t //Get Response \n\t\t InputStream is = connection.getInputStream();\n\t\t BufferedReader rd = new BufferedReader(new InputStreamReader(is));\n\t\t StringBuilder response = new StringBuilder(); // or StringBuffer if not Java 5+ \n\t\t String line;\n\t\t while((line = rd.readLine()) != null) {\n\t\t response.append(line);\n\t\t response.append('\\r');\n\t\t }\n\t\t rd.close();\n\t\t return response.toString();\n\t\t } catch (Exception e) {\n\t\t return e.getMessage();\n\t\t } finally {\n\t\t if(connection != null) {\n\t\t connection.disconnect(); \n\t\t }\n\t\t }\n\t\t}", "private synchronized String execute(final HttpUriRequest request) {\n request.setParams(params);\n\n // Set the request's headers\n for (Entry<String, String> header : headers.entrySet()) {\n request.setHeader(header.getKey(), header.getValue());\n }\n\n // Execute the request and get it's content\n HttpResponse response;\n String content;\n try {\n\n // Execute the request\n response = getClient().execute(request);\n\n // Get the response content\n content = EntityUtils.toString(response.getEntity(), charset);\n } catch (IOException e) {\n throw new JsogClientException(\"Get request failed.\", e);\n }\n\n // Check the response code\n StatusLine sl = response.getStatusLine();\n if (sl.getStatusCode() != 200) {\n throw new Non200ResponseCodeException(\n sl.getStatusCode(),\n sl.getReasonPhrase(),\n content);\n }\n\n return content;\n }", "@When(\"user calls {string} with {string} http request\")\n public void user_calls_with_http_request(String AMAR, String HTTPreq) {\n pojoEnum pEnum =pojoEnum.valueOf(AMAR);\n resSpec = new ResponseSpecBuilder()\n .expectStatusCode(200)\n .expectContentType(ContentType.JSON).build();\n if(HTTPreq.equalsIgnoreCase(\"POST\")){\n response = res.when().post(pEnum.getResource());\n }\n else if(HTTPreq.equalsIgnoreCase(\"GET\")){\n response = res.when().get(pEnum.getResource());\n }\n else if(HTTPreq.equalsIgnoreCase(\"DELETE\")){\n response = res.when().delete(pEnum.getResource());\n }\n else if(HTTPreq.equalsIgnoreCase(\"PUT\")){\n response = res.when().put(pEnum.getResource());\n\n }\n String responseString = response.asString();\n System.out.println(\"This is the Response ---->\" +responseString);\n\n }", "public int getResponse() {return response;}", "public String requestAction2(){\n return \"Response Two\";\n }", "@Override\n\t\t\tpublic Object handle(Request req, Response res) {\n\t\t\t\tfinal String op = req.params(\":op\");\n\t\t\t\tfinal String path = req.queryParams(\"path\");\n\t\t\t\t//--- list will list down all available results for a course ---//\n\t\t\t\tif (op.equals(\"list\")) return Results.list(path);\n\t\t\t\t//--- get will display one single result ---//\n\t\t\t\telse if (op.equals(\"get\")) return Results.get(path);\n\t\t\t\telse return null;\n\t\t\t}", "@Override\n\t\t\tpublic Object handle(Request req, Response res) {\n\t\t\t\tfinal String op = req.params(\":op\");\n\t\t\t\tfinal String path = req.queryParams(\"path\");\n\t\t\t\t//--- list will list down all available results for a course ---//\n\t\t\t\tif (op.equals(\"list\")) return Results.list(path);\n\t\t\t\t//--- get will display one single result ---//\n\t\t\t\telse if (op.equals(\"get\")) return Results.get(path);\n\t\t\t\telse return null;\n\t\t\t}", "@Test(enabled=true)\npublic void getRequest() {\n\t\tString url = \"https://reqres.in/api/users?page=2\";\n\t\t\n\t\t//create an object of response class\n\t\t\n\t\t//Restassured will send get request to the url and store response in response object\n\t\tResponse response = RestAssured.get(url);\n\t\t\n\t\t//We have to put assertion in response code and response data\n\t\tAssert.assertEquals(response.getStatusCode(), 200 , \"Response code Mismatch\");\n\t\t\n\t\tint total_pages = response.jsonPath().get(\"total_pages\");\n\t\tAssert.assertEquals(total_pages, 2 , \"Total Pages value Mismatch\");\n \n}", "private String getResponse()\n {\n System.out.println();\n System.out.println(\"Enter id number to look up, 'd' to display list, 'q' to quit\");\n System.out.print(\"Your choice: \");\n return scanner.nextLine();\n }" ]
[ "0.69586617", "0.64550096", "0.64525306", "0.6308332", "0.6156002", "0.61187184", "0.6114084", "0.61075675", "0.5959942", "0.5900401", "0.58964086", "0.5878401", "0.5848859", "0.5848224", "0.5823874", "0.5819447", "0.57954556", "0.57946277", "0.5785604", "0.5781201", "0.5768879", "0.5743519", "0.5732602", "0.57253605", "0.5691336", "0.5684037", "0.56719595", "0.56562406", "0.56441283", "0.5642354", "0.5630007", "0.5629297", "0.5607309", "0.55893314", "0.5583287", "0.5571482", "0.55612963", "0.555253", "0.5551367", "0.5546397", "0.5500341", "0.54947865", "0.5482022", "0.54817396", "0.54780966", "0.5468809", "0.54662776", "0.5466057", "0.5460443", "0.54591846", "0.5457542", "0.54572535", "0.5456775", "0.54533887", "0.5442684", "0.5441545", "0.54409486", "0.543635", "0.54319406", "0.54277116", "0.54275775", "0.54267645", "0.54211074", "0.5419047", "0.5416387", "0.5400723", "0.5389698", "0.53867203", "0.5376229", "0.53747296", "0.5373886", "0.5373202", "0.5369483", "0.5368435", "0.5363969", "0.53532654", "0.53484076", "0.53404933", "0.5336639", "0.53263825", "0.53259724", "0.5323255", "0.53216136", "0.5319274", "0.53129363", "0.5311429", "0.53081167", "0.52899", "0.5289359", "0.52890277", "0.52873427", "0.52825147", "0.52807623", "0.5275667", "0.5266486", "0.5262846", "0.52620196", "0.52620196", "0.5260751", "0.5258724" ]
0.69398993
1
"OK" the command PUT was performed correctly,
public String PUT( String name, String number){ this.clientData.put(name,number); return "OK"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ResponseTranslator put() {\n setMethod(\"PUT\");\n return doRequest();\n }", "@PUT\n @Path(\"/update\")\n public void put() {\n System.out.println(\"PUT invoked\");\n }", "@Override\n\tpublic void doPut(HttpRequest request, AbstractHttpResponse response)\n\t\t\tthrows IOException {\n\t\t\n\t}", "@Override\n protected void executeLowLevelRequest() {\n doPutItem();\n }", "@Override\n public final void doPut() {\n try {\n checkPermissions(getRequest());\n if (id == null) {\n throw new APIMissingIdException(getRequestURL());\n }\n\n final String inputStream = getInputStream();\n if (inputStream.length() == 0) {\n api.runUpdate(id, new HashMap<String, String>());\n return;\n }\n\n Item.setApplyValidatorMandatoryByDefault(false);\n final IItem item = getJSonStreamAsItem();\n api.runUpdate(id, getAttributesWithDeploysAsJsonString(item));\n } catch (final APIException e) {\n e.setApi(apiName);\n e.setResource(resourceName);\n throw e;\n\n }\n }", "@Override\n public DataObjectResponse<T> handlePUT(DataObjectRequest<T> request)\n {\n return handlePUT(request, null);\n }", "private static String sendPUT(final Wine wine) {\n return \"\";\r\n }", "public int updateUser(Candidat c) {\n String url = StaticVars.baseURL + \"/updateuser\";\n System.out.println(url);\n ConnectionRequest req = new ConnectionRequest();\n\n req.setUrl(url);\n req.setPost(true);\n\nreq.setHttpMethod(\"PUT\"); \n\n\n String can = String.valueOf(currentCandidat.getId());\n req.addArgument(\"id\", can);\n String login =String .valueOf(currentCandidat.getLogin());\n req.addArgument(\"login\",login);\n req.addArgument(\"email\", String .valueOf(currentCandidat.getEmail()));\n req.addArgument(\"pays\", String .valueOf(currentCandidat.getPays()));\n req.addArgument(\"ville\", String .valueOf(currentCandidat.getVille()));\n req.addArgument(\"tel\", Integer.toString(currentCandidat.getTel()));\n req.addArgument(\"domaine\", String .valueOf(currentCandidat.getDomaine()));\n\n req.addResponseListener(new ActionListener<NetworkEvent>() {\n @Override\n public void actionPerformed(NetworkEvent evt) {\n result = req.getResponseCode();\n \n System.out.println(result);\n }\n });\n NetworkManager.getInstance().addToQueueAndWait(req);\n\n return result;\n }", "public static int doPut(String name, String id) {\n int status = 0;\n try {\n URL url = new URL(\"https://intense-lake-93564.herokuapp.com/menusection/\");\n HttpURLConnection conn = (HttpURLConnection) url.openConnection();\n conn.setRequestMethod(\"PUT\");\n conn.setDoOutput(true);\n // make the request info as an json message\n JSONObject objJson = new JSONObject();\n JSONObject objJsonSend = new JSONObject();\n try {\n objJson.put(\"id\", id);\n objJson.put(\"name\", name);\n objJsonSend.put(\"name\", name);\n } catch (JSONException ex) {\n Logger.getLogger(RestaurantApiClient.class.getName()).log(Level.SEVERE, null, ex);\n }\n String ans = objJson.toString();\n System.out.println(\"Request Body:\");\n System.out.println(objJsonSend.toString());\n OutputStreamWriter out = new OutputStreamWriter(conn.getOutputStream());\n out.write(ans);\n out.close();\n // wait for response\n status = conn.getResponseCode();\n conn.disconnect(); \n }\n catch (MalformedURLException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return status;\n }", "@Override\n public DataObjectResponse<Agenda> handlePUT(DataObjectRequest<Agenda> request)\n {\n return super.handlePUT(request);\n }", "@PUT\n @JWTTokenNeeded\n @Consumes({MediaType.APPLICATION_JSON})\n @Produces({MediaType.APPLICATION_JSON})\n public Response update(EscenarioDTO entidad) {\n logger.log(Level.INFO, \"entidad:{0}\", entidad);\n \n try {\n \tConciliacion entidadPadreJPA = null;\n if (entidad.getIdConciliacion() != null) {\n entidadPadreJPA = padreDAO.find(entidad.getIdConciliacion());\n if (entidadPadreJPA == null) {\n throw new DataNotFoundException(Response.Status.NOT_FOUND.getReasonPhrase() + entidad.getIdConciliacion());\n }\n }\n //Hallar La entidad actual para actualizarla\n Escenario entidadJPA = managerDAO.find(entidad.getId());\n if (entidadJPA != null) {\n entidadJPA.setFechaActualizacion(Date.from(Instant.now()));\n entidadJPA.setNombre(entidad.getNombre() != null ? entidad.getNombre() : entidadJPA.getNombre());\n entidadJPA.setImpacto(entidad.getImpacto() != null ? entidad.getImpacto() : entidadJPA.getImpacto());\n entidadJPA.setDescripcion(entidad.getDescripcion() != null ? entidad.getDescripcion() : entidadJPA.getDescripcion());\n \n Boolean actualizarConciliacion = false;\n entidadJPA.setConciliacion(entidad.getIdConciliacion() != null ? (entidadPadreJPA != null ? entidadPadreJPA : null) : entidadJPA.getConciliacion());\n \n Conciliacion conciliacionpadreactual = null;\n \n \n if (entidadJPA.getConciliacion() != null && !Objects.equals(entidadJPA.getConciliacion().getId(), entidad.getIdConciliacion())){\n actualizarConciliacion = true;\n conciliacionpadreactual = padreDAO.find(entidadJPA.getConciliacion().getId());\n }\n //entidadJPA.setConciliacion(entidad.getIdConciliacion() != null ? (entidadPadreJPA != null ? entidadPadreJPA : null) : entidadJPA.getConciliacion());\n managerDAO.edit(entidadJPA);\n if (actualizarConciliacion){\n if ((entidadPadreJPA != null)) {\n entidadPadreJPA.addEscenario(entidadJPA);\n padreDAO.edit(entidadPadreJPA);\n conciliacionpadreactual.removeEscenario(entidadJPA);\n padreDAO.edit(conciliacionpadreactual);\n }\n }\n LogAuditoria logAud = new LogAuditoria(this.modulo, Constantes.Acciones.EDITAR.name(), Date.from(Instant.now()), entidad.getUsername(), entidadJPA.toString());\n logAuditoriaDAO.create(logAud);\n \n ResponseWrapper wraper = new ResponseWrapper(true,I18N.getMessage(\"escenario.update\", entidad.getNombre()) ,entidadJPA.toDTO());\n \treturn Response.ok(wraper,MediaType.APPLICATION_JSON).build();\n }\n \n ResponseWrapper wraper = new ResponseWrapper(false,I18N.getMessage(\"escenario.notfound\", entidad.getNombre()));\n \treturn Response.ok(wraper,MediaType.APPLICATION_JSON).build();\n }catch (Exception e) {\n \tif(e.getCause() != null && (e.getCause() instanceof DataAlreadyExistException || e.getCause() instanceof DataNotFoundException)) {\n \t\tlogger.log(Level.SEVERE, e.getMessage(), e);\n \t\tResponseWrapper wraper = new ResponseWrapper(false, e.getCause().getMessage(), 500);\n \t\treturn Response.ok(wraper,MediaType.APPLICATION_JSON).build();\n \t}else {\n \t\tlogger.log(Level.SEVERE, e.getMessage(), e);\n \t\tResponseWrapper wraper = new ResponseWrapper(false, I18N.getMessage(\"general.readerror\"), 500);\n \t\treturn Response.ok(wraper,MediaType.APPLICATION_JSON).build();\n \t}\n }\n }", "@Test\n\t@Override\n\tpublic void testUpdateObjectOKJson() throws Exception {\n\t}", "public PUT(OperatorDescription description) {\n\t\tsuper(description);\n\t\t// TODO Auto-generated constructor stub\n\t}", "private int processPUT() throws ServerException {\r\n\t\tint statusCode;\r\n\t\tFile document = new File( request.getURI() );\r\n\t\tsynchronized ( this ) {\r\n\t\t\tif ( !document.exists() ) {\r\n\t\t\t\tBufferedOutputStream out = null;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tout = new BufferedOutputStream( new FileOutputStream( document ) );\r\n\t\t\t\t\tout.write( request.getParameterByteArray() );\r\n\t\t\t\t\tstatusCode = ResponseTable.CREATED;\r\n\t\t\t\t} catch ( IOException ioe ) {\r\n\t\t\t\t\tioe.printStackTrace();\r\n\t\t\t\t\tthrow new ServerException( ResponseTable.INTERNAL_SERVER_ERROR );\r\n\t\t\t\t} finally {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tout.close();\r\n\t\t\t\t\t} catch ( Exception e ) {\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tstatusCode = ResponseTable.NO_CONTENT;\r\n\t\t\t}\r\n\t\t}\r\n\t\tString headerMessage = createBasicHeaderMessage( statusCode ).toString();\r\n\t\twriteHeaderMessage( headerMessage );\r\n\t\treturn statusCode;\r\n\r\n\t}", "@Ignore\n\tpublic void testExecuteRequestClientActionPutBug181() throws Exception {\n\t\tString testFileName = \"test2.txt\";\n\t\tString irodsFileName = \"test2.txt\";\n\n\t\tString absPath = scratchFileUtils.createAndReturnAbsoluteScratchPath(IRODS_TEST_SUBDIR_PATH);\n\t\tString putFileName = FileGenerator.generateFileOfFixedLengthGivenName(absPath, testFileName, 100);\n\n\t\tString targetIrodsFileName = testingPropertiesHelper.buildIRODSCollectionAbsolutePathFromTestProperties(\n\t\t\t\ttestingProperties, IRODS_TEST_SUBDIR_PATH) + \"/\" + irodsFileName;\n\n\t\tIRODSAccount irodsAccount = testingPropertiesHelper.buildIRODSAccountFromTestProperties(testingProperties);\n\n\t\tIRODSAccessObjectFactory accessObjectFactory = irodsFileSystem.getIRODSAccessObjectFactory();\n\t\tStringBuilder builder = new StringBuilder();\n\t\tbuilder.append(\n\t\t\t\t\"myiput||acObjPutWithDateAndChksumAsAVUs(*rodsPath,*mainResource,*localFilePath,*inputChecksum,*outstatus)|nop\\n\");\n\t\tbuilder.append(\"*rodsPath=\");\n\t\tbuilder.append(targetIrodsFileName);\n\t\tbuilder.append(\"%*mainResource=\");\n\t\tbuilder.append(testingProperties.get(TestingPropertiesHelper.IRODS_RESOURCE_KEY));\n\t\tbuilder.append(\"%*localFilePath=\");\n\t\tbuilder.append(putFileName);\n\t\tbuilder.append(\"%*inputChecksum=\");\n\t\tbuilder.append(LocalFileUtils.computeCRC32FileCheckSumViaAbsolutePath(putFileName));\n\t\tbuilder.append(\"\\n\");\n\n\t\tbuilder.append(\"*ruleExecOut\");\n\t\tString ruleString = builder.toString();\n\n\t\tRuleProcessingAO ruleProcessingAO = accessObjectFactory.getRuleProcessingAO(irodsAccount);\n\n\t\tIRODSRuleExecResult result = ruleProcessingAO.executeRule(ruleString);\n\n\t\tIRODSFile putFile = irodsFileSystem.getIRODSFileFactory(irodsAccount).instanceIRODSFile(targetIrodsFileName);\n\n\t\tAssert.assertTrue(\"file does not exist\", putFile.exists());\n\n\t\tAssert.assertNotNull(\"did not get a response\", result);\n\t\tAssert.assertEquals(\"did not get results for client side operation\", 1,\n\t\t\t\tresult.getOutputParameterResults().size());\n\n\t}", "@Test\n public void putTest(){\n Map<String, Object> putRequestMap = new HashMap<>();\n putRequestMap.put(\"title\", \"Title 3\");\n putRequestMap.put(\"body\", \"Body 3\");\n\n given().contentType(ContentType.JSON)\n .body(putRequestMap)\n .pathParam(\"id\",1)\n .when().put(\"/posts/{id}\")\n .then().statusCode(200)\n .body(\"title\",is(\"Title 3\"),\n \"body\",is(\"Body 3\"),\n \"id\",is(1));\n }", "HttpPut putRequest(HttpServletRequest request, String address) throws IOException;", "@Test\n\tpublic void testExecuteRequestClientActionPut() throws Exception {\n\t\tString testFileName = \"testExecuteRequestClientActionPut.txt\";\n\t\tString testResultFileName = \"testExecuteRequestClientActionPutResult.txt\";\n\n\t\tString absPath = scratchFileUtils.createAndReturnAbsoluteScratchPath(IRODS_TEST_SUBDIR_PATH);\n\t\tString putFileName = FileGenerator.generateFileOfFixedLengthGivenName(absPath, testFileName, 1);\n\n\t\tString targetIrodsFileName = testingPropertiesHelper.buildIRODSCollectionAbsolutePathFromTestProperties(\n\t\t\t\ttestingProperties, IRODS_TEST_SUBDIR_PATH) + \"/\" + testResultFileName;\n\n\t\tIRODSAccount irodsAccount = testingPropertiesHelper.buildIRODSAccountFromTestProperties(testingProperties);\n\n\t\tIRODSAccessObjectFactory accessObjectFactory = irodsFileSystem.getIRODSAccessObjectFactory();\n\t\tStringBuilder builder = new StringBuilder();\n\t\tbuilder.append(\"testClientAction||msiDataObjPut(\");\n\t\tbuilder.append(targetIrodsFileName);\n\t\tbuilder.append(\",null,\");\n\t\tbuilder.append(putFileName);\n\t\tbuilder.append(\",*status)|nop\\n\");\n\t\tbuilder.append(\"*A=null\\n\");\n\t\tbuilder.append(\"*ruleExecOut\");\n\t\tRuleProcessingAO ruleProcessingAO = accessObjectFactory.getRuleProcessingAO(irodsAccount);\n\t\tRuleInvocationConfiguration context = new RuleInvocationConfiguration();\n\t\tcontext.setIrodsRuleInvocationTypeEnum(IrodsRuleInvocationTypeEnum.IRODS);\n\t\tcontext.setEncodeRuleEngineInstance(true);\n\n\t\tIRODSRuleExecResult result = ruleProcessingAO.executeRule(builder.toString(), null, context);\n\n\t\tIRODSFile putFile = irodsFileSystem.getIRODSFileFactory(irodsAccount).instanceIRODSFile(targetIrodsFileName);\n\n\t\tAssert.assertTrue(\"file does not exist\", putFile.exists());\n\n\t\tirodsFileSystem.close();\n\n\t\tAssert.assertNotNull(\"did not get a response\", result);\n\t\tAssert.assertEquals(\"did not get results for client side operation\", 1,\n\t\t\t\tresult.getOutputParameterResults().size());\n\n\t}", "@RequestMapping(value = \"/test\", method = RequestMethod.PUT)\n public void test() {}", "public void doPut() throws IOException {\n\n String otherContent = \".\";\n\n int contentLength = 0;\n\n while (!otherContent.equals(\"\")) {\n otherContent = in.readLine();\n if (otherContent.startsWith(\"Content-Length\")) {\n contentLength = Integer.parseInt(otherContent.split(\" \")[1]);\n }\n }\n\n char[] buffer = new char[contentLength];\n this.in.read(buffer, 0, contentLength); // read parameter\n\n String parameters = decodeValue(new String(buffer));\n System.out.println(\"Param \" + parameters);\n byte[] contentByte = parameters.getBytes();\n // traiter le buffer\n\n String path = RESOURCE_DIRECTORY + this.url;\n\n File file = new File(path);\n\n if (file.exists() && !file.isDirectory()) {\n Files.write(Paths.get(path), contentByte);\n statusCode = NO_CONTENT;\n } else {\n if (file.createNewFile()) {\n Files.write(Paths.get(path), contentByte);\n statusCode = CREATED;\n } else {\n statusCode = FORBIDEN;\n }\n\n }\n\n //Response to client\n sendHeader(statusCode, \"text/html\", contentByte.length);\n\n }", "@Test\r\n\tpublic void updateProductDetails() {\r\n\r\n\t\tRestAssured.baseURI = \"http://localhost:9000/products\";\r\n\t\tRequestSpecification request = RestAssured.given();\r\n\t\tJSONObject requestParams = new JSONObject();\r\n\t\trequestParams.put(\"name\", \"Banana\");\r\n\t\trequest.header(\"Content-Type\", \"application/json\");\r\n\t\trequest.body(requestParams.toString());\r\n\t\tResponse response = request.put(\"/5\");\r\n\t\tSystem.out.println(\"Update Responce Body ----->\" + response.asString());\r\n\t\tint statusCode = response.getStatusCode();\r\n\t\tAssert.assertEquals(statusCode, 200);\r\n\r\n\t}", "@Override\n protected void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n PrintWriter out = resp.getWriter();\n resp.setCharacterEncoding(\"UTF-8\");\n resp.setContentType(\"application/json\");\n resp.addHeader(\"Access-Control-Allow-Origin\", \"*\");\n resp.addHeader(\"Access-Control-Allow-Methods\", \"POST, GET, OPTIONS, PUT, DELETE, HEAD\");\n\n BufferedReader br = new BufferedReader(new InputStreamReader(req.getInputStream()));\n String data = URLDecoder.decode(br.readLine());\n// out.println(data);\n String[] dataParse = data.split(\"&\");\n Map<String, String> mapa = new HashMap<>();\n for (int i = 0; i < dataParse.length; i++) {\n String[] par = dataParse[i].split(\"=\");\n mapa.put(par[0], par[1]);\n }\n\n try {\n Contato contato = new Contato(Integer.parseInt(mapa.get(\"id\")));\n contato.setNome(mapa.get(\"nome\"));\n contato.setEmail(mapa.get(\"email\"));\n contato.setTelefone(mapa.get(\"telefone\"));\n contato.setCelular(mapa.get(\"celular\"));\n contato.altera();\n resp.setStatus(201); // status create\n } catch (SQLException e) {\n e.printStackTrace();\n resp.setStatus(500); // server error\n }\n }", "public RestUtils setMethodPut()\n\t{\n\t\trestMethodDef.setHttpMethod(HttpMethod.PUT);\n\t\treturn this;\n\t}", "protected ValidatableResponse updateResource(String path, JSONObject newResource) throws JSONException {\n return given()\n .header(HEADER_AUTHORIZATION, authenticated())\n .contentType(ContentType.JSON)\n .body(newResource.toString())\n .when()\n .put(path)\n .then()\n .statusCode(204);\n }", "void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException;", "public<T> Future<Void> update(String pathinfo) throws APIException, CadiException {\n\t\tfinal int idx = pathinfo.indexOf('?');\n\t\tfinal String qp; \n\t\tif(idx>=0) {\n\t\t\tqp=pathinfo.substring(idx+1);\n\t\t\tpathinfo=pathinfo.substring(0,idx);\n\t\t} else {\n\t\t\tqp=queryParams;\n\t\t}\n\n\t\tEClient<CT> client = client();\n\t\tclient.setMethod(PUT);\n\t\tclient.addHeader(CONTENT_TYPE, typeString(Void.class));\n\t\tclient.setQueryParams(qp);\n\t\tclient.setFragment(fragment);\n\t\tclient.setPathInfo(pathinfo);\n//\t\tclient.setPayload(new EClient.Transfer() {\n//\t\t\t@Override\n//\t\t\tpublic void transfer(OutputStream os) throws IOException, APIException {\n//\t\t\t}\n//\t\t});\n\t\tclient.send();\n\t\tqueryParams = fragment = null;\n\t\treturn client.future(null);\n\t}", "public void handlePut( HttpExchange exchange ) throws IOException {\n\n }", "public void doPut(String uri, T t) throws AbstractRequestException, AbstractClientRuntimeException {\n OmcpClient omcpClient = this.osirisConnectionFactory.getConnection();\n Response omcpResponse = omcpClient.doPut(uri, t);\n this.osirisConnectionFactory.closeConnection(omcpClient);\n OmcpUtil.handleOmcpResponse(omcpResponse);\n }", "@Test\n public void putId() throws Exception {\n Role role = create(new Role(\"roleName\"));\n\n //Change a field of the object that has to be updated\n role.setName(\"roleNameChanged\");\n RESTRole restRole = new RESTRole(role);\n\n //Perform the put request to update the object and check the fields of the returned object\n try {\n mvc.perform(MockMvcRequestBuilders.put(\"/auth/roles/{id}\", UUIDUtil.UUIDToNumberString(role.getUuid()))\n .header(\"Content-Type\", \"application/json\")\n .header(\"Authorization\", authPair[0])\n .header(\"Function\", authPair[1])\n .content(TestUtil.convertObjectToJsonBytes(restRole))\n )\n .andExpect(status().isOk())\n .andExpect(jsonPath(\"$.name\", equalTo(restRole.getName())));\n } catch (AssertionError e) {\n remove(role.getUuid());\n throw e;\n }\n\n //Test if changes actually went in effect in the database\n try {\n role = get(role.getUuid());\n try {\n assertEquals(\"name field not updated correctly\", \"roleNameChanged\", role.getName());\n } finally {\n //Clean up database for other tests\n remove(role.getUuid());\n }\n } catch (ObjectNotFoundException e) {\n fail(\"Could not retrieve the put object from the actual database\");\n }\n }", "private FormValidation putResultFile(PutMethod put) throws IOException, HttpException {\n\n try {\n HttpClient client = new HttpClient();\n int result = client.executeMethod(put);\n String response = \"\";\n if (result != HttpServletResponse.SC_OK) {\n StringBuilder msg = new StringBuilder();\n response = put.getResponseBodyAsString();\n if (response.length() > 0) {\n msg.append(\"Connection failed: \").append(response);\n System.out.println(msg.toString());\n }\n return FormValidation.error(msg.toString());\n } else {\n if (response.length() > 0) {\n return FormValidation.ok(Messages.connectionEstablished() + \": \" + response);\n } else {\n return FormValidation.ok(Messages.connectionEstablished());\n }\n }\n } finally {\n put.releaseConnection();\n }\n }", "@PutMapping\n public ResponseEntity<Track> updateTrack(@Valid @RequestBody Track mySong, @RequestHeader Map<String, String> headers)\n throws RecordNotFoundException, RecordUnauthorizedException{\n if(Utils.apiKey(headers)){\n Track entity = service.updateTrack(mySong);\n \n return new ResponseEntity<Track>(entity, new HttpHeaders(), HttpStatus.OK);\n }else{\n throw new RecordUnauthorizedException(\"API Key ERROR\");\n }\n }", "public String putJSON(String urlStr, String putStr) throws Exception{ \n \t/*\n \tURL url = new URL(urlStr);\n \tHttpURLConnection httpCon = (HttpURLConnection) url.openConnection();\n \thttpCon.setDoOutput(true);\n \thttpCon.setRequestMethod(\"PUT\");\n \tOutputStreamWriter out = new OutputStreamWriter(httpCon.getOutputStream());\n \tout.write(putStr);\n \tout.close();\n \t*/\n HttpClient httpClient = new DefaultHttpClient();\n HttpResponse response;\n HttpPut put=new HttpPut();\n HttpEntity httpEntity;\n StringEntity stringEntity=new StringEntity(putStr);\n stringEntity.setContentEncoding(new BasicHeader(HTTP.CONTENT_TYPE, \"application/json\"));\n httpEntity=stringEntity;\n put.setEntity(httpEntity);\n put.setURI(new URI(urlStr));\n put.setHeader(\"Content-type\", \"application/json\");\n response=httpClient.execute(put);\n return parseHttpResponse(response);\n \n }", "@PUT\n @Consumes(\"application/xml\")\n public void put(StorageConverter data) {\n Storage entity = data.getEntity();\n // TODO Fix\n entity.setCurrentStatus(\"TODO\");\n entity.setMessage(null);\n dao.update(entity);\n }", "T put(T obj) throws DataElementPutException, RepositoryAccessDeniedException;", "@Test\n\tpublic void testPutOfMessageAndUptesItTypeToSpecialThenTypeIsUpdatedInTheDatabase() throws Exception{\n\t\tDummyBoundary newBoundary = new DummyBoundary(null, \"dummy\");\n\t\tnewBoundary.setType(Type.NONE);\n\n\t\tDummyBoundary boundaryOnServer = \n\t\t this.restTemplate\n\t\t\t.postForObject(\n\t\t\t\t\tthis.url, \n\t\t\t\t\tnewBoundary, \n\t\t\t\t\tDummyBoundary.class);\n\t\t\n\t\tString id = boundaryOnServer \n\t\t\t.getId();\n\t\t\n\t\t// WHEN I PUT with update of type to be SPECIAL\n\t\tDummyBoundary update = new DummyBoundary();\n\t\tupdate.setType(Type.SPECIAL);\n\t\t\n\t\tthis.restTemplate\n\t\t\t.put(this.url + \"/{id}\", update, id);\n\t\t\n\t\t// THEN the database contains a message with same id and type: SPECIAL\n\t\tassertThat(this.restTemplate\n\t\t\t\t.getForObject(this.url + \"/{id}\", DummyBoundary.class, id))\n\t\t\t.extracting(\"id\", \"type\")\n\t\t\t.containsExactly(id, update.getType());\n\t\t\n\t}", "public int put(String json, String path)\n {\n\n Client client = Client.create();\n\n WebResource webResource = client.resource(getHostAddress() + \":\" + getPort() + \"/api/\" + path);\n ClientResponse response = webResource.type(\"application/json\").put(ClientResponse.class, json);\n\n\n int responser = response.getStatus();\n\n return responser;\n }", "public void processPutRequest(String request) throws IOException {\n\t\tString[] tokens = request.split(\"\\\\s+\");\n\t\tif (tokens.length != 3) {\n\t\t\tSystem.out.println(\"Incorrect Request\");\n\t\t\tclose();\n\t\t} else {\n\t\t\tString fileName = tokens[1];\n\t\t\tString version = tokens[2];\n\t\t\tif (version.equals(\"HTTP/1.0\") || version.equals(\"HTTP/1.1\")) {\n\t\t\t\tString filePath = \"C:\\\\Users\\\\admin\\\\Desktop\\\\socket\" + fileName.replaceAll(\"/\", \"\\\\\\\\\");\n\t\t\t\t// The path of file that client put\n\t\t\t\tFile file = new File(filePath);\n\t\t\t\tif (file.exists()) {\n\t\t\t\t\t// Send the response\n\t\t\t\t\tStringBuilder putMessage = new StringBuilder();\n\t\t\t\t\tputMessage.append(request);\n\t\t\t\t\tputMessage.append(CRLF);\n\t\t\t\t\tputMessage.append(\"User-Agent: MyClient-1.0\" + CRLF);\n\t\t\t\t\tputMessage.append(\"Accept-Encoding: ISO-8859-1\" + CRLF);\n\t\t\t\t\tputMessage.append(\n\t\t\t\t\t\t\t\"Content-Type: \" + URLConnection.getFileNameMap().getContentTypeFor(fileName) + CRLF);\n\t\t\t\t\tputMessage.append(\"Content-Length: \" + file.length() + CRLF);\n\t\t\t\t\tputMessage.append(\"Connection: close\" + CRLF);\n\t\t\t\t\tputMessage.append(CRLF);\n\t\t\t\t\t// Send to server\n\t\t\t\t\tString message = putMessage + \"\";\n\t\t\t\t\tbyte[] buffer = message.getBytes(ENCODING);\n\t\t\t\t\tostream.write(buffer, 0, message.length());\n\t\t\t\t\tostream.flush();\n\t\t\t\t\tSystem.out.println(message);\n\t\t\t\t\t// Read file and send it to server\n\t\t\t\t\tbyte[] sendData = Files.readAllBytes(file.toPath());\n\t\t\t\t\tostream.write(sendData);\n\t\t\t\t\tostream.flush();\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"File does not exist\");\n\t\t\t\t\tclose();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Bad Request\");\n\t\t\t\tclose();\n\t\t\t}\n\t\t}\n\t\tprocessResponse(\"PUT\");\n\t}", "@PUT\n @Produces({ \"application/json\" })\n @Path(\"{id}\")\n @CommitAfter\n public abstract Response update(Person person);", "@Test\n public void shouldReturnBadRequestIfPutMethodIsMadeAndNeitherNewValueNorExpectedValueAreSetInSetValue() {\n SetValue emptyValue = new SetValue();\n assertThatResourceMethodReturnsStatus(\n client().resource(REQUEST_URI).type(MediaType.APPLICATION_JSON_TYPE).entity(emptyValue),\n \"PUT\",\n ClientResponse.Status.BAD_REQUEST);\n }", "@Test\n\tpublic void testUpdateTicketOk() {\n\t}", "public DataObjectResponse<T> handlePUT(DataObjectRequest<T> request, T previouslyRetrievedObject)\n {\n if(getRequestValidator() != null) getRequestValidator().validatePUT(request);\n\n T dataObjectToUpdate = request.getDataObject();\n String updatingCustomerId = dataObjectToUpdate.getCustomerId();\n DefaultDataObjectResponse<T> response = new DefaultDataObjectResponse<>();\n try\n {\n // The object specified may not have the id set if the id is specified only in the url, set it now before moving on\n dataObjectToUpdate.setId(request.getId());\n VisibilityFilter<T, DataObjectRequest<T>> visibilityFilter = visibilityFilterMap.get(VisibilityMethod.PUT);\n //Get persisted object to verify visibility.\n T persistedDataObject = previouslyRetrievedObject == null\n ? objectPersister.retrieve(dataObjectToUpdate.getId())\n : previouslyRetrievedObject;\n if (persistedDataObject == null)\n {\n response.setErrorResponse(ErrorResponseFactory.objectNotFound(\n new ObjectNotFoundException(String.format(OBJECT_NOT_FOUND_EXCEPTION, request.getId())), request.getCID()));\n return response;\n }\n if (! visibilityFilter.isVisible(request, persistedDataObject))\n {\n return new DefaultDataObjectResponse<>(ErrorResponseFactory.unauthorized(String.format(AUTHORIZATION_EXCEPTION, persistedDataObject.getCustomerId()),\n request.getCID()));\n }\n\n //check the incoming customerID for visibility\n if (updatingCustomerId != null && !updatingCustomerId.equals(persistedDataObject.getCustomerId()) && !visibilityFilter.isVisible(request, dataObjectToUpdate))\n {\n return new DefaultDataObjectResponse<>(ErrorResponseFactory.unauthorized(String.format(AUTHORIZATION_EXCEPTION, dataObjectToUpdate.getCustomerId()),\n request.getCID()));\n }\n\n // NOTE: the default update implementation is just a persist call\n response.add(objectPersister.update(dataObjectToUpdate));\n return response;\n }\n catch(PersistenceException e)\n {\n final String id = dataObjectToUpdate == null ? \"UNKNOWN\" : dataObjectToUpdate.getId();\n BadRequestException badRequestException = new BadRequestException(String.format(UNABLE_TO_UPDATE_EXCEPTION, id), e);\n response.setErrorResponse(ErrorResponseFactory.badRequest(badRequestException, request.getCID()));\n }\n return response;\n }", "@Test\n\tpublic void testExecuteRequestClientActionPutWithOverwriteFileExists() throws Exception {\n\t\tString testFileName = \"testExecuteRequestClientActionPutWithOverwriteFileExists.txt\";\n\n\t\tString absPath = scratchFileUtils.createAndReturnAbsoluteScratchPath(IRODS_TEST_SUBDIR_PATH);\n\t\tString putFileName = FileGenerator.generateFileOfFixedLengthGivenName(absPath, testFileName, 1);\n\n\t\tString targetIrodsFileName = testingPropertiesHelper.buildIRODSCollectionAbsolutePathFromTestProperties(\n\t\t\t\ttestingProperties, IRODS_TEST_SUBDIR_PATH) + \"/\" + testFileName;\n\n\t\tIRODSAccount irodsAccount = testingPropertiesHelper.buildIRODSAccountFromTestProperties(testingProperties);\n\n\t\tIRODSAccessObjectFactory accessObjectFactory = irodsFileSystem.getIRODSAccessObjectFactory();\n\n\t\tIRODSFile targetFile = accessObjectFactory.getIRODSFileFactory(irodsAccount)\n\t\t\t\t.instanceIRODSFile(targetIrodsFileName);\n\t\tFile sourceFile = new File(putFileName);\n\n\t\t// put the file first to set up the overwrite\n\t\tDataTransferOperations dto = accessObjectFactory.getDataTransferOperations(irodsAccount);\n\t\tdto.putOperation(sourceFile, targetFile, null, null);\n\n\t\tStringBuilder builder = new StringBuilder();\n\t\tbuilder.append(\"testClientAction||msiDataObjPut(\");\n\t\tbuilder.append(targetIrodsFileName);\n\t\tbuilder.append(\",null,\");\n\t\tbuilder.append(\"\\\"localPath=\");\n\t\tbuilder.append(putFileName);\n\t\tbuilder.append(\"++++forceFlag=\\\"\");\n\t\tbuilder.append(\",*status)|nop\\n\");\n\t\tbuilder.append(\"*A=null\\n\");\n\t\tbuilder.append(\"*ruleExecOut\");\n\t\tRuleProcessingAO ruleProcessingAO = accessObjectFactory.getRuleProcessingAO(irodsAccount);\n\t\tRuleInvocationConfiguration context = new RuleInvocationConfiguration();\n\t\tcontext.setIrodsRuleInvocationTypeEnum(IrodsRuleInvocationTypeEnum.IRODS);\n\t\tcontext.setEncodeRuleEngineInstance(true);\n\n\t\tIRODSRuleExecResult result = ruleProcessingAO.executeRule(builder.toString(), null, context);\n\n\t\tIRODSFile putFile = irodsFileSystem.getIRODSFileFactory(irodsAccount).instanceIRODSFile(targetIrodsFileName);\n\n\t\tAssert.assertTrue(\"file does not exist\", putFile.exists());\n\n\t\tirodsFileSystem.close();\n\n\t\tAssert.assertNotNull(\"did not get a response\", result);\n\t\tAssert.assertEquals(\"did not get results for client side operation\", 1,\n\t\t\t\tresult.getOutputParameterResults().size());\n\n\t}", "@Override\n public MockResponse handleUpdate(RecordedRequest request) {\n return process(request, putHandler);\n }", "@Test\n public void updateBaasClientUsingPutTest() throws ApiException {\n UUID nucleusClientId = null;\n UpdateBaasClientCO baasClientCO = null;\n BaasClientVO response = api.updateBaasClientUsingPut(nucleusClientId, baasClientCO);\n\n // TODO: test validations\n }", "private void executePut() throws NetworkException, IOException,\n StreamException {\n StreamClientMetrics.begin(session);\n try {\n putMethod = new PutMethod(session.getURI());\n try {\n utils.setHeaders(putMethod, session.getHeaders());\n putMethod.setRequestEntity(this);\n switch (utils.execute(putMethod)) {\n case 200:\n break;\n case 400:\n final StreamErrorResponse errorResponse = utils.readErrorResponse(putMethod);\n throw new StreamException(errorResponse.isRecoverable(),\n \"Could not upload stream. {0}:{1}{2}{3}\",\n putMethod.getStatusCode(),\n putMethod.getStatusLine(), \"\\n\\t\",\n putMethod.getStatusText());\n case 503: // service unavailable\n utils.wait(utils.getRetryAfter(putMethod));\n case 500: // internal server error\n case 504: // gateway timeout\n utils.writeError(putMethod);\n throw new StreamException(Boolean.TRUE,\n \"Could not upload stream. {0}:{1}{2}{3}\",\n putMethod.getStatusCode(),\n putMethod.getStatusLine(), \"\\n\\t\",\n putMethod.getStatusText());\n default:\n utils.writeError(putMethod);\n throw new StreamException(\n \"Could not upload stream. {0}:{1}{2}{3}\",\n putMethod.getStatusCode(),\n putMethod.getStatusLine(), \"\\n\\t\",\n putMethod.getStatusText());\n }\n } catch (final UnknownHostException uhx) {\n utils.writeError(putMethod);\n throw new NetworkException(uhx);\n } catch (final SocketException sx) {\n utils.writeError(putMethod);\n throw new NetworkException(sx);\n } catch (final SocketTimeoutException stx) {\n utils.writeError(putMethod);\n throw new NetworkException(stx);\n } catch (final HttpException hx) {\n utils.writeError(putMethod);\n throw new NetworkException(hx);\n } catch (final IOException iox) {\n /* an io exception can be thrown with a network exception cause\n * by the stream's http connection object; and since we want to\n * differentiate between network and local io errors we examine\n * the causality */\n utils.writeError(putMethod);\n if (isNetworkException(iox.getCause())) {\n throw (NetworkException) iox.getCause();\n } else {\n throw iox;\n }\n } finally {\n putMethod.releaseConnection();\n }\n } finally {\n StreamClientMetrics.end(\"PUT\", session);\n }\n }", "@PUT\n\t@Consumes({\"text/turtle\",\"application/rdf+xml\"})\n\tResponse updateResource(String body, @HeaderParam(\"Accept\") String format);", "@Test\n void updateSuccess () {\n TestEntity testEntity = buildEntity();\n Api2 instance = new Api2();\n Long result = instance.save(testEntity);\n\n String name = \"Edited name\";\n boolean check = false;\n String description = \"edited description\";\n\n if (result != null) {\n testEntity.setName(name);\n testEntity.setCheck(check);\n testEntity.setDescription(description);\n instance.update(testEntity);\n\n Optional<TestEntity> optionalTestEntity = instance.getById(TestEntity.class, testEntity.getId());\n assertTrue(optionalTestEntity.isPresent());\n\n if (optionalTestEntity.isPresent()) {\n TestEntity entity = optionalTestEntity.get();\n\n assertEquals(entity.getName(), name);\n assertEquals(entity.getDescription(), description);\n assertEquals(entity.isCheck(), check);\n } else {\n fail();\n }\n } else {\n fail();\n }\n }", "public final void mT__40() throws RecognitionException {\n try {\n int _type = T__40;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // ../org.xtext.example.mydslsample/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDslSample.g:40:7: ( 'PUT' )\n // ../org.xtext.example.mydslsample/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDslSample.g:40:9: 'PUT'\n {\n match(\"PUT\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "public void returnedPutRequest( CellMessage msg , RequestImpl req ){\n // if the request was not successful we have to \n // remove the bfid entry from the database \n // and return the request to EuroGate\n //\n String group = req.getStorageGroup() ;\n String bfid = req.getBfid() ;\n \n if( req.getReturnCode() != 0 ){\n try{\n _dataBase.removeBitfileId( group , bfid ) ;\n }catch( DatabaseException dbe ){\n esay( \"Couldn't remove bfid from database : \"+bfid ) ;\n } \n return ;\n }\n //\n // update the database entry\n //\n try{\n BitfileId bitfileid = _dataBase.getBitfileId( group , bfid ) ;\n bitfileid.setMode(\"persistent\") ;\n bitfileid.setPosition( req.getPosition() ) ;\n bitfileid.setVolume( req.getVolume() ) ;\n _dataBase.storeBitfileId( group , bitfileid ) ;\n }catch( DatabaseException dbe ){\n esay( \"storeBitfileId : \"+dbe ) ;\n req.setReturnValue( dbe.getCode() , dbe.getMessage() ) ;\n }\n \n }", "public void catalogProductWebsiteLinkRepositoryV1SavePut (String sku, Body1 body, final Response.Listener<Boolean> responseListener, final Response.ErrorListener errorListener) {\n Object postBody = body;\n\n \n // verify the required parameter 'sku' is set\n if (sku == null) {\n VolleyError error = new VolleyError(\"Missing the required parameter 'sku' when calling catalogProductWebsiteLinkRepositoryV1SavePut\",\n new ApiException(400, \"Missing the required parameter 'sku' when calling catalogProductWebsiteLinkRepositoryV1SavePut\"));\n }\n \n\n // create path and map variables\n String path = \"/v1/products/{sku}/websites\".replaceAll(\"\\\\{format\\\\}\",\"json\").replaceAll(\"\\\\{\" + \"sku\" + \"\\\\}\", apiInvoker.escapeString(sku.toString()));\n\n // query params\n List<Pair> queryParams = new ArrayList<Pair>();\n // header params\n Map<String, String> headerParams = new HashMap<String, String>();\n // form params\n Map<String, String> formParams = new HashMap<String, String>();\n\n\n\n String[] contentTypes = {\n \n };\n String contentType = contentTypes.length > 0 ? contentTypes[0] : \"application/json\";\n\n if (contentType.startsWith(\"multipart/form-data\")) {\n // file uploading\n MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();\n \n\n HttpEntity httpEntity = localVarBuilder.build();\n postBody = httpEntity;\n } else {\n // normal form params\n }\n\n String[] authNames = new String[] { };\n\n try {\n apiInvoker.invokeAPI(basePath, path, \"PUT\", queryParams, postBody, headerParams, formParams, contentType, authNames,\n new Response.Listener<String>() {\n @Override\n public void onResponse(String localVarResponse) {\n try {\n responseListener.onResponse((Boolean) ApiInvoker.deserialize(localVarResponse, \"\", Boolean.class));\n } catch (ApiException exception) {\n errorListener.onErrorResponse(new VolleyError(exception));\n }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n errorListener.onErrorResponse(error);\n }\n });\n } catch (ApiException ex) {\n errorListener.onErrorResponse(new VolleyError(ex));\n }\n }", "@Test\n public void updateViajeroTest() {\n ViajeroEntity entity = data.get(0);\n PodamFactory factory = new PodamFactoryImpl();\n ViajeroEntity newEntity = factory.manufacturePojo(ViajeroEntity.class);\n\n newEntity.setId(entity.getId());\n\n vp.update(newEntity);\n\n ViajeroEntity resp = em.find(ViajeroEntity.class, entity.getId());\n\n Assert.assertEquals(newEntity.getId(), resp.getId());\n }", "public int handlePUT(String contentPayload, String contentType, String requestURL) throws ClientProtocolException, IOException{\r\n\t\t\r\n\t\tinputsource=null;\r\n\t\t\r\n\t\toutputString=\"\"; \r\n\t\t\r\n\t\thttpPut = new HttpPut(requestURL);\t\t\t\t\t\t// http PUT object\r\n\t\thttpPut.setHeader(\"Content-Type\", contentType);\t\t\t// setting content type\r\n\t\t\r\n\t\t//xml payload\r\n\t\tHttpEntity entity = new ByteArrayEntity(contentPayload.getBytes(\"UTF-8\"));\r\n\t\thttpPut.setEntity(entity);\r\n\t\t\r\n\t\t// creating response object to capture response from server.\r\n\t\tresponse = httpclient.execute(httpPut);\t\t\t\t\t\t\t\r\n\t\t\r\n\t\t//response entity\r\n\t HttpEntity resEntity = response.getEntity();\r\n\t statusLine= response.getStatusLine().toString();\t\t//status line\r\n\t BufferedReader br=new BufferedReader(new InputStreamReader(resEntity.getContent()));\r\n\t \tString line;\r\n\t \t\r\n\t \t//saving response from server in outputString\r\n\t \twhile((line=br.readLine())!=null)\r\n\t \t{\r\n\t \t\toutputString=outputString+line.toString();\r\n\t \t}\r\n\t \toutputString.trim();\r\n\t \tinputsource = new InputSource(new StringReader(outputString));\r\n\t \tbr.close();\t\t\t\t\t\t\t\t\t\t\t\t//close the buffered reader\r\n\t \t\r\n\t \t//returns status code\r\n\t return response.getStatusLine().getStatusCode();\r\n\t\t\r\n\t}", "@RequestMapping(method = RequestMethod.PUT)\n @Override\n public boolean update(@RequestBody Command command2) {\n if (command2 == null)\n throw new ServiceException(new DataValidationException(\"No command data provided\"));\n try {\n Command command = repos.findOne(command2.getId());\n if (command == null) {\n logger.error(\"Request to update with non-existent or unidentified command (id/name): \"\n + command2.getId() + \"/\" + command2.getName());\n throw new NotFoundException(ValueDescriptor.class.toString(), command2.getId());\n }\n updateCommand(command2, command);\n return true;\n } catch (NotFoundException nE) {\n throw nE;\n } catch (DataValidationException dE) {\n throw dE;\n } catch (Exception e) {\n logger.error(\"Error updating command: \" + e.getMessage());\n throw new ServiceException(e);\n }\n }", "@PUT\r\n @Consumes(\"application/json\")\r\n public void putJson(String content) {\r\n }", "@Override\n public JSONObject fullUpdateHwWalletObject(String urlSegment, String id, String body) {\n HttpHeaders header = constructHttpHeaders();\n // Construct the http URL.\n String baseUrl = ConfigUtil.instants().getValue(\"walletServerBaseUrl\");\n String walletServerUrl = baseUrl + urlSegment + id;\n\n // Send the http request and get response.\n HttpEntity<JSONObject> entity = new HttpEntity<>(JSONObject.parseObject(body), header);\n ResponseEntity<JSONObject> response =\n REST_TEMPLATE.exchange(walletServerUrl, HttpMethod.PUT, entity, JSONObject.class);\n\n // Return the updated model or instance.\n return response.getBody();\n }", "@Override\n protected Response doUpdate(Long id, JSONObject data) {\n return null;\n }", "@Override\r\n public long saveOrUpdate(Object model) {\r\n OrmPreconditions.checkForOpenSession(mIsOpen);\r\n OrmPreconditions.checkPersistenceForModify(model, mPersistencePolicy);\r\n mLogger.debug(\"Sending PUT request to save or update entity\");\r\n String uri = mHost + mPersistencePolicy.getRestEndpoint(model.getClass());\r\n Map<String, String> headers = new HashMap<String, String>();\r\n RestfulModelMap modelMap = mMapper.mapModel(model);\r\n if (mRestContext.getMessageType() == MessageType.JSON)\r\n headers.put(\"Content-Type\", \"application/json\");\r\n else if (mRestContext.getMessageType() == MessageType.XML)\r\n headers.put(\"Content-Type\", \"application/xml\");\r\n RestResponse response = mRestClient.executePut(uri, modelMap.toHttpEntity(), headers);\r\n switch (response.getStatusCode()) {\r\n case HttpStatus.SC_CREATED:\r\n return 1;\r\n case HttpStatus.SC_OK:\r\n case HttpStatus.SC_NO_CONTENT:\r\n return 0;\r\n default:\r\n return -1;\r\n }\r\n }", "@Test\n public void testFailureWithDrawInSufficientFund() throws IOException, URISyntaxException {\n URI uri = builder.setPath(\"/accounts/2/withdraw/1000\").build();\n\n HttpPut request = new HttpPut(uri);\n request.setHeader(\"Content-type\", \"application/json\");\n HttpResponse response = client.execute(request);\n int statusCode = response.getStatusLine().getStatusCode();\n assertTrue(statusCode == 500);\n }", "@PUT\n @Consumes(\"application/json\")\n public void putJson(String content) {\n }", "@PUT\n @Consumes(\"application/json\")\n public void putJson(String content) {\n }", "@PUT\n @Consumes(\"application/json\")\n public void putJson(String content) {\n }", "@PUT\n @Consumes(\"application/json\")\n public void putJson(String content) {\n }", "@PUT\n @Consumes(\"application/json\")\n public void putJson(String content) {\n }", "@Test\n\t@Override\n\tpublic void testUpdateObjectWrongIdJson() throws Exception {\n\t}", "Response put(String repoName, String repoPath, String lockTokenHeader, String ifHeader, String fileNodeTypeHeader,\r\n String contentNodeTypeHeader, String mixinTypes, MediaType mediaType, String userAgent, InputStream inputStream,\r\n UriInfo uriInfo);", "@PUT\r\n @Consumes(\"text/plain\")\r\n public void putText(String content) {\r\n }", "public ResponseBody httpPut(String aPI, String body)\n\t{\n\t\tString errorMsg = null;\n\t\ttry\n\t\t{\t\n\t\t\tHttpClient client=new DefaultHttpClient();\n\t\t\tString url=aPI;\n\t\t\torg.apache.http.client.methods.HttpPut httpput = new HttpPut(url);\n\t\t\thttpput.addHeader(\"Content-Type\", \"application/json\");\n\t\t\tStringEntity setcontent = new StringEntity(body);\n\t\t\tsetcontent.setContentType(new BasicHeader(HTTP.CONTENT_TYPE, \"application/json\"));\n\t\t\thttpput.setEntity(setcontent);\n\t\t\tif(key!=null && value!=null)\n\t\t\t\thttpput.setHeader(key, value);\n\t\t\tHttpResponse response=client.execute(httpput);\n\t\t\tint statuscode=response.getStatusLine().getStatusCode();\n\t\t\tInputStream in = response.getEntity().getContent();\n\t\t\tString responseStr = Readjson.readInputStreamAsString(in);\n\t\t\trb.setResponseCode(statuscode);\n\t\t\trb.setResponseBody(responseStr);\n\t\t\treturn rb;\n\t\t}\n\t\tcatch(ClientProtocolException cp)\n\t\t{\n\t\t\tlog.error(\"Connection failed : \" ,cp);\n\t\t}\n\t\tcatch(IOException ioe)\n\t\t{\n\t\t\t log.error(\"Invalid Data : \" ,ioe);\n\t\t}\n\t\tcatch(Exception ex)\n\t\t{\n\t\t\tlog.error(\"Exception\",ex);\n\t\t}\n\t\trb.setResponseCode(500);\n\t\trb.setResponseBody(\"Internal Error : \" + errorMsg);\n\t\treturn rb;\n\t}", "@Test\n public void editMeasurementUsingPUTTest() throws ApiException {\n MeasurementDTO measurementDTO = null;\n api.editMeasurementUsingPUT(measurementDTO);\n\n // TODO: test validations\n }", "@Test\n public void gTestUpdatePlaylist() {\n MultiValueMap<String, String> body = new LinkedMultiValueMap<>();\n body.add(\"name\", \"Updated Test\");\n\n given()\n .header(\"X-Authorization\", token)\n .formParam(\"name\", \"Updated Playlist\")\n .put(\"/playlists/\" + playlistId)\n .then()\n .statusCode(200);\n }", "private void putCommand(String cmd) {\n try {\n stream.write((cmd).getBytes(StandardCharsets.UTF_8));\n } catch (IOException | InterruptedException e) {\n e.printStackTrace();\n }\n }", "public abstract Response update(Request request, Response response);", "@Test\n public void testUpdateDietStatusById() throws Exception{\n\n String URI = \"/healthreminder/followup_dietstatus_update/{patientId}/status/{dietStatus}\";\n FollowUpDietStatusInfo followUpDietStatusInfo = new FollowUpDietStatusInfo();\n followUpDietStatusInfo.setPatientId(1);\n followUpDietStatusInfo.setDietStatus(false);\n \n String jsonInput = this.converttoJson(followUpDietStatusInfo);\n\n Mockito.when(followUpDietStatusInfoServices.updateDietStatusById(Mockito.any(),Mockito.anyBoolean())).thenReturn(followUpDietStatusInfo);\n MvcResult mvcResult = this.mockMvc.perform(MockMvcRequestBuilders.put(URI, 1, true).accept(MediaType.APPLICATION_JSON).content(jsonInput).contentType(MediaType.APPLICATION_JSON))\n .andReturn();\n MockHttpServletResponse mockHttpServletResponse = mvcResult.getResponse();\n String jsonOutput = mockHttpServletResponse.getContentAsString();\n\n assertThat(jsonInput).isEqualTo(jsonOutput);\n }", "@Test\n void updateSuccess() {\n String Vin = \"1111111111111111X\";\n Car carToUpdate = carDao.getById(1);\n carToUpdate.setVin(Vin);\n carDao.saveOrUpdate(carToUpdate);\n Car retrievedCar = carDao.getById(1);\n assertEquals(carToUpdate, retrievedCar);\n }", "public static boolean edit(String name, String id) {\n Boolean flag = true;\n if(doPut(name,id) == 200) {\n System.out.println(\"Response Body:\");\n String res = \"\";\n String print = read(id);\n try {\n JSONObject json = new JSONObject(print);\n json.put(\"success\", flag);\n res = json.toString();\n } catch (JSONException ex) {\n Logger.getLogger(RestaurantApiClient.class.getName()).log(Level.SEVERE, null, ex);\n }\n System.out.println(res);\n return true;\n }\n \n return false;\n }", "@RequestMapping(value = \"/{id}\", method = RequestMethod.PUT)\n public void put(@PathVariable(\"id\") String id, HttpServletRequest req){\n throw new NotImplementedException(\"To be implemented\");\n }", "private static void sendPuts(HttpClient httpClient) {\n HttpTextResponse httpResponse = httpClient.put(\"/hello/mom\");\n puts(httpResponse);\n\n\n /* Send one param post. */\n httpResponse = httpClient.putWith1Param(\"/hello/singleParam\", \"hi\", \"mom\");\n puts(\"single param\", httpResponse);\n\n\n /* Send two param post. */\n httpResponse = httpClient.putWith2Params(\"/hello/twoParams\",\n \"hi\", \"mom\", \"hello\", \"dad\");\n puts(\"two params\", httpResponse);\n\n\n /* Send two param post. */\n httpResponse = httpClient.putWith3Params(\"/hello/3params\",\n \"hi\", \"mom\",\n \"hello\", \"dad\",\n \"greetings\", \"kids\");\n puts(\"three params\", httpResponse);\n\n\n /* Send four param post. */\n httpResponse = httpClient.putWith4Params(\"/hello/4params\",\n \"hi\", \"mom\",\n \"hello\", \"dad\",\n \"greetings\", \"kids\",\n \"yo\", \"pets\");\n puts(\"4 params\", httpResponse);\n\n /* Send five param post. */\n httpResponse = httpClient.putWith5Params(\"/hello/5params\",\n \"hi\", \"mom\",\n \"hello\", \"dad\",\n \"greetings\", \"kids\",\n \"yo\", \"pets\",\n \"hola\", \"neighbors\");\n puts(\"5 params\", httpResponse);\n\n\n /* Send six params with post. */\n\n final HttpRequest httpRequest = httpRequestBuilder()\n .setUri(\"/sixPost\")\n .setMethod(\"PUT\")\n .addParam(\"hi\", \"mom\")\n .addParam(\"hello\", \"dad\")\n .addParam(\"greetings\", \"kids\")\n .addParam(\"yo\", \"pets\")\n .addParam(\"hola\", \"pets\")\n .addParam(\"salutations\", \"all\").build();\n\n\n httpResponse = httpClient.sendRequestAndWait(httpRequest);\n puts(\"6 params\", httpResponse);\n\n\n //////////////////\n //////////////////\n\n\n /* Using Async support with lambda. */\n httpClient.putAsync(\"/hi/async\", (code, contentType, body) -> puts(\"Async text with lambda\", body));\n\n Sys.sleep(100);\n\n\n /* Using Async support with lambda. */\n httpClient.putFormAsyncWith1Param(\"/hi/async\", \"hi\", \"mom\", (code, contentType, body) -> puts(\"Async text with lambda 1 param\\n\", body));\n\n Sys.sleep(100);\n\n\n\n /* Using Async support with lambda. */\n httpClient.putFormAsyncWith2Params(\"/hi/async\",\n \"p1\", \"v1\",\n \"p2\", \"v2\",\n (code, contentType, body) -> puts(\"Async text with lambda 2 params\\n\", body));\n\n Sys.sleep(100);\n\n\n\n\n /* Using Async support with lambda. */\n httpClient.putFormAsyncWith3Params(\"/hi/async\",\n \"p1\", \"v1\",\n \"p2\", \"v2\",\n \"p3\", \"v3\",\n (code, contentType, body) -> puts(\"Async text with lambda 3 params\\n\", body));\n\n Sys.sleep(100);\n\n\n /* Using Async support with lambda. */\n httpClient.putFormAsyncWith4Params(\"/hi/async\",\n \"p1\", \"v1\",\n \"p2\", \"v2\",\n \"p3\", \"v3\",\n \"p4\", \"v4\",\n (code, contentType, body) -> puts(\"Async text with lambda 4 params\\n\", body));\n\n Sys.sleep(100);\n\n\n /* Using Async support with lambda. */\n httpClient.putFormAsyncWith5Params(\"/hi/async\",\n \"p1\", \"v1\",\n \"p2\", \"v2\",\n \"p3\", \"v3\",\n \"p4\", \"v4\",\n \"p5\", \"v5\",\n (code, contentType, body) -> {\n puts(\"Async text with lambda 5 params\\n\", body);\n });\n\n Sys.sleep(100);\n\n\n }", "public static boolean update(Car newCar, CarModel model) {\n\n Map<String, String> carToUpdate = new HashMap<>();\n carToUpdate.put(\"idCar\", \"\"+newCar.getId());\n carToUpdate.put(\"brand\", newCar.getBrand());\n carToUpdate.put(\"year\", \"\" + newCar.getYear());\n carToUpdate.put(\"idUser\", \"\" + newCar.getId_user());\n carToUpdate.put(\"model\", model.getModel_name());\n RequestPutObject task = new RequestPutObject(carToUpdate);\n try {\n String response = task.execute(\"https://waiting-list-garage.herokuapp.com/car\").get();\n Log.d(\"response\",response);\n } catch (ExecutionException e) {\n e.printStackTrace();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n return false;\n }", "@PutMapping(\"/Mensajeros/actualizar/{id}\")\r\npublic Mensajeros update(@RequestBody Mensajeros ms, @PathVariable(\"id\") Long id) {\r\n\tMensajeros oldM = mService.buscarM_Id(id);\r\n\tString nombreM = ms.getNombreM();\r\n\toldM.setNombreM(nombreM);\r\n\tString cedulaM = ms.getCedulaM();\r\n\toldM.setCedulaM(cedulaM);\r\n\tString celularM = ms.getCelularM();\r\n\toldM.setCelularM(celularM);\r\n\tString placa = ms.getPlaca();\r\n\toldM.setPlaca(placa);\r\n\tString direccionM = ms.getDireccionM();\r\n\toldM.setDireccionM(direccionM);\r\n\treturn mService.actualizarM(oldM);\r\n}", "@Test\n\t@Override\n\tpublic void testUpdateObjectNotFoundJson() throws Exception {\n\t}", "@PUT\n @Path(\"/{requirementId}\")\n @Consumes(MediaType.APPLICATION_JSON)\n @Produces(MediaType.APPLICATION_JSON)\n @ApiOperation(value = \"This method updates a specific requirement.\")\n @ApiResponses(value = {\n @ApiResponse(code = HttpURLConnection.HTTP_OK, message = \"Returns the updated requirement\", response = RequirementEx.class),\n @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = \"Unauthorized\"),\n @ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = \"Not found\"),\n @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = \"Internal server problems\")\n })\n public Response updateRequirement(@PathParam(\"requirementId\") int requirementId,\n @ApiParam(value = \"Requirement entity\", required = true) Requirement requirementToUpdate) {\n DALFacade dalFacade = null;\n try {\n String registratorErrors = service.bazaarService.notifyRegistrators(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING));\n if (registratorErrors != null) {\n ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registratorErrors);\n }\n UserAgent agent = (UserAgent) Context.getCurrent().getMainAgent();\n long userId = agent.getId();\n Gson gson = new Gson();\n Vtor vtor = service.bazaarService.getValidators();\n vtor.validate(requirementToUpdate);\n if (vtor.hasViolations()) {\n ExceptionHandler.getInstance().handleViolations(vtor.getViolations());\n }\n dalFacade = service.bazaarService.getDBConnection();\n Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId);\n boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Modify_REQUIREMENT, dalFacade);\n if (!authorized) {\n ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString(\"error.authorization.requirement.modify\"));\n }\n if (requirementToUpdate.getId() != 0 && requirementId != requirementToUpdate.getId()) {\n ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, \"Id does not match\");\n }\n dalFacade.followRequirement(internalUserId, requirementToUpdate.getId());\n RequirementEx updatedRequirement = dalFacade.modifyRequirement(requirementToUpdate, internalUserId);\n service.bazaarService.getNotificationDispatcher().dispatchNotification(service, updatedRequirement.getLastupdated_time(), Activity.ActivityAction.UPDATE, updatedRequirement.getId(),\n Activity.DataType.REQUIREMENT, updatedRequirement.getComponents().get(0).getId(), Activity.DataType.COMPONENT, internalUserId);\n return Response.ok(gson.toJson(updatedRequirement)).build();\n } catch (BazaarException bex) {\n if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) {\n return Response.status(Response.Status.UNAUTHORIZED).entity(ExceptionHandler.getInstance().toJSON(bex)).build();\n } else if (bex.getErrorCode() == ErrorCode.NOT_FOUND) {\n return Response.status(Response.Status.NOT_FOUND).entity(ExceptionHandler.getInstance().toJSON(bex)).build();\n } else {\n return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build();\n }\n } catch (Exception ex) {\n BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, \"\");\n return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build();\n } finally {\n service.bazaarService.closeDBConnection(dalFacade);\n }\n }", "@Test\r\n\tpublic void updateUpdate() throws InterruptedException, ExecutionException {\r\n\t\tLOGGER.debugf(\"BEGINN\");\r\n\t\t\r\n\t\t// Given\r\n\t\tfinal Long zahlId = ZAHLUNGSINFORMATION_ID_UPDATE;\r\n \tfinal String neuerKontoinhaber = NEUER_KONTOINHABER;\r\n \tfinal String neuerKontoinhaber2 = NEUER_KONTOINHABER_2;\r\n\t\tfinal String username = USERNAME_ADMIN;\r\n\t\tfinal String password = PASSWORD_ADMIN;\r\n\t\t\r\n\t\t// When\r\n\t\tResponse response = given().header(ACCEPT, APPLICATION_JSON)\r\n\t\t\t\t .pathParameter(ZAHLUNGSINFORMATIONEN_ID_PATH_PARAM, zahlId)\r\n .get(ZAHLUNGSINFORMATIONEN_ID_PATH);\r\n\t\tJsonObject jsonObject;\r\n\t\ttry (final JsonReader jsonReader =\r\n\t\t\t\t getJsonReaderFactory().createReader(new StringReader(response.asString()))) {\r\n\t\t\tjsonObject = jsonReader.readObject();\r\n\t\t}\r\n\r\n \t// Konkurrierendes Update\r\n\t\t// Aus den gelesenen JSON-Werten ein neues JSON-Objekt mit neuem Nachnamen bauen\r\n \tfinal JsonObjectBuilder job2 = getJsonBuilderFactory().createObjectBuilder();\r\n \tSet<String> keys = jsonObject.keySet();\r\n \tfor (String k : keys) {\r\n \t\tif (\"kontoinhaber\".equals(k)) {\r\n \t\t\tjob2.add(\"kontoinhaber\", neuerKontoinhaber2);\r\n \t\t}\r\n \t\telse {\r\n \t\t\tjob2.add(k, jsonObject.get(k));\r\n \t\t}\r\n \t}\r\n \tfinal JsonObject jsonObject2 = job2.build();\r\n \tfinal ConcurrentUpdate concurrentUpdate = new ConcurrentUpdate(jsonObject2, ZAHLUNGSINFORMATIONEN_PATH,\r\n \t\t\t username, password);\r\n \tfinal ExecutorService executorService = Executors.newSingleThreadExecutor();\r\n\t\tfinal Future<Response> future = executorService.submit(concurrentUpdate);\r\n\t\tresponse = future.get(); // Warten bis der \"parallele\" Thread fertig ist\r\n\t\tassertThat(response.getStatusCode(), is(HTTP_NO_CONTENT));\r\n\t\t\r\n \t// Fehlschlagendes Update\r\n\t\t// Aus den gelesenen JSON-Werten ein neues JSON-Objekt mit neuem Nachnamen bauen\r\n\t\tfinal JsonObjectBuilder job1 = getJsonBuilderFactory().createObjectBuilder();\r\n \tkeys = jsonObject.keySet();\r\n \tfor (String k : keys) {\r\n \t\tif (\"kontoinhaber\".equals(k)) {\r\n \t\t\tjob1.add(\"kontoinhaber\", neuerKontoinhaber);\r\n \t\t}\r\n \t\telse {\r\n \t\t\tjob1.add(k, jsonObject.get(k));\r\n \t\t}\r\n \t}\r\n \tjsonObject = job1.build();\r\n\t\tresponse = given().contentType(APPLICATION_JSON)\r\n\t\t\t\t .body(jsonObject.toString())\r\n\t\t .auth()\r\n\t\t .basic(username, password)\r\n\t\t .put(ZAHLUNGSINFORMATIONEN_PATH);\r\n \t\r\n\t\t// Then\r\n\t\tassertThat(response.getStatusCode(), is(HTTP_CONFLICT));\r\n\t\t\r\n\t\tLOGGER.debugf(\"ENDE\");\r\n\t}", "private void updatePostPut() {\n PostModel model = new PostModel(12, null, \"This is the newest one.\");\n Call<PostModel> call = jsonPlaceHolderAPI.putPosts(5, model);\n call.enqueue(new Callback<PostModel>() {\n @Override\n @EverythingIsNonNull\n public void onResponse(Call<PostModel> call, Response<PostModel> response) {\n if (!response.isSuccessful()) {\n textResult.setText(response.code());\n return;\n }\n PostModel postResponse = response.body();\n String content = \"\";\n assert postResponse != null;\n content += \"Code: \" + response.code() + \"\\n\";\n content += \"ID: \" + postResponse.getId() + \"\\n\";\n content += \"User ID: \" + postResponse.getUserId() + \"\\n\";\n content += \"Title: \" + postResponse.getTitle() + \"\\n\";\n content += \"Body: \" + postResponse.getText();\n textResult.append(content);\n }\n\n @Override\n @EverythingIsNonNull\n public void onFailure(Call<PostModel> call, Throwable t) {\n textResult.setText(t.getMessage());\n }\n });\n }", "@Test\n\tpublic void test_update_user_success(){\n\t\tUser user = new User(null, \"fengt\", \"fengt2@itiaoling.com\", \"12345678\");\n\t\ttemplate.put(REST_SERVICE_URI + \"/20\" + ACCESS_TOKEN + token, user);\n\t}", "@Test\n public void testUpdateExample() throws Exception{\n MvcResult result = this.mockMvc.perform(get(\"/api/example/{id}\",50))\n .andExpect(status().is2xxSuccessful())\n .andReturn();\n\n // Parses it\n Example example = convertFromJson(result.getResponse().getContentAsString(), Example.class);\n \n // Change name value\n example.setName(\"Test 27\");\n\n // Updates it and checks if it was updated\n this.mockMvc.perform(put(\"/api/example\")\n .contentType(MediaType.APPLICATION_JSON)\n .content(convertToJson(example)))\n .andDo(print())\n .andExpect(status().isOk())\n .andExpect(jsonPath(\"$.name\", equalTo(\"Test 27\")));\n }", "@PUT\n @Consumes(MediaType.APPLICATION_JSON)\n public void putJson(String content) {\n }", "@PUT\n @Consumes(MediaType.APPLICATION_JSON)\n public void putJson(String content) {\n }", "@PUT\n @Consumes(MediaType.APPLICATION_JSON)\n public void putJson(String content) {\n }", "@PUT\n @Consumes(MediaType.APPLICATION_JSON)\n public void putJson(String content) {\n }", "@Test(expected = JargonFileOrCollAlreadyExistsException.class)\n\tpublic void testExecuteRequestClientActionPutWithNoOverwriteFileExists() throws Exception {\n\t\tString testFileName = \"testExecuteRequestClientActionPutWithNoOverwriteFileExists.txt\";\n\n\t\tString absPath = scratchFileUtils.createAndReturnAbsoluteScratchPath(IRODS_TEST_SUBDIR_PATH);\n\t\tString putFileName = FileGenerator.generateFileOfFixedLengthGivenName(absPath, testFileName, 1);\n\n\t\tString targetIrodsFileName = testingPropertiesHelper.buildIRODSCollectionAbsolutePathFromTestProperties(\n\t\t\t\ttestingProperties, IRODS_TEST_SUBDIR_PATH) + \"/\" + testFileName;\n\n\t\tIRODSAccount irodsAccount = testingPropertiesHelper.buildIRODSAccountFromTestProperties(testingProperties);\n\n\t\tIRODSAccessObjectFactory accessObjectFactory = irodsFileSystem.getIRODSAccessObjectFactory();\n\n\t\tIRODSFile targetFile = accessObjectFactory.getIRODSFileFactory(irodsAccount)\n\t\t\t\t.instanceIRODSFile(targetIrodsFileName);\n\t\tFile sourceFile = new File(putFileName);\n\n\t\t// put the file first to set up the overwrite\n\t\tDataTransferOperations dto = accessObjectFactory.getDataTransferOperations(irodsAccount);\n\t\tdto.putOperation(sourceFile, targetFile, null, null);\n\n\t\tStringBuilder builder = new StringBuilder();\n\t\tbuilder.append(\"testClientAction||msiDataObjPut(\");\n\t\tbuilder.append(targetIrodsFileName);\n\t\tbuilder.append(\",null,\");\n\t\tbuilder.append(\"\\\"localPath=\");\n\t\tbuilder.append(putFileName);\n\t\tbuilder.append(\"\\\"\");\n\t\tbuilder.append(\",*status)|nop\\n\");\n\t\tbuilder.append(\"*A=null\\n\");\n\t\tbuilder.append(\"*ruleExecOut\");\n\t\tRuleProcessingAO ruleProcessingAO = accessObjectFactory.getRuleProcessingAO(irodsAccount);\n\t\tRuleInvocationConfiguration context = new RuleInvocationConfiguration();\n\t\tcontext.setIrodsRuleInvocationTypeEnum(IrodsRuleInvocationTypeEnum.IRODS);\n\t\tcontext.setEncodeRuleEngineInstance(true);\n\n\t\truleProcessingAO.executeRule(builder.toString(), null, context);\n\n\t}", "@Override\n protected void doPut(HttpServletRequest requete, HttpServletResponse reponse) throws ServletException, IOException {\n Integer idSousTournoiAValider = tentativeRecuperationIdSousTournoi(requete);\n if (idSousTournoiAValider == null){\n envoyerReponseMauvaisId(reponse);\n }\n else{\n SousTournoiSimplifieDto sousTournoiValide = sousTournoiService.validerSousTournoi(idSousTournoiAValider);\n if(sousTournoiValide != null){\n envoyerReponseRecuperationSousTournoiSimplifie(sousTournoiValide, reponse);\n }\n else{\n envoyerReponseSousTournoiIntrouvable(reponse);\n }\n }\n }", "public void test_01() {\n\t\tpostobject jsonobjectdata = new postobject();\n\n\t\tjsonobjectdata.setID(\"5\");\n\t\tjsonobjectdata.settitle(\"updated Mr\");\n\t\tjsonobjectdata.setfirst_name(\"updated Rahaman\");\n\t\tjsonobjectdata.setauthor(\"updated Ata\");\n\n\t\tResponse reponse = given().\n\t\t\t\tbody(jsonobjectdata).\n\t\t\t\twhen().\n\t\t\t\tcontentType(ContentType.JSON).\n\t\t\t\tput(\"http://localhost:3000/posts/05\");\n\n\t\tSystem.out.println(\"updated response data \"+ reponse.asString());\t\t\n\t}", "public String putRest(String uri) {\n WebResource.Builder builder = getClientBuilder(uri);\n ClientResponse response;\n\n try {\n response = builder.put(ClientResponse.class);\n } catch (ClientHandlerException e) {\n log.warn(\"Unable to contact REST server: {}\", e.getMessage());\n return \"\";\n }\n\n if (response.getStatus() != HTTP_OK) {\n log.info(\"REST PUT request returned error code {}\",\n response.getStatus());\n }\n return response.getEntity(String.class);\n }", "@PutMapping(\"/update\")\n @ResponseStatus(HttpStatus.CREATED)//status 201\n public AsociadosProyecto update(@RequestBody AsociadosProyecto asociadosProyecto){\n return asociadosProyectoService.update(asociadosProyecto);\n }", "@PUT\n @Consumes({\"application/xml\", \"application/json\"})\n @Path(\"/{version}\")\n public String commit(@PathParam(\"version\") String version) {\n throw new UnsupportedOperationException();\n }", "@Test\r\n void testUpdateMedicine() throws Exception{\r\n\r\n String URI = \"/medicine/update/{medicineId}\";\r\n Medicine medicine = new Medicine();\r\n\t\tmedicine.setMedicineId(134);\r\n\t\tmedicine.setMedicineName(\"crosin\");\r\n\t\tmedicine.setMedicineCost(200);\r\n\t\t\r\n\t\tString jsonInput = this.converttoJson(medicine);\r\n Mockito.when(medicineService.updateMedicineById(Mockito.any(),Mockito.anyString())).thenReturn(medicine);\r\n MvcResult mvcResult = this.mockMvc.perform(MockMvcRequestBuilders.put(URI ,105).accept(MediaType.APPLICATION_JSON).content(jsonInput).contentType(MediaType.APPLICATION_JSON)).andReturn();\r\n MockHttpServletResponse mockHttpServletResponse = mvcResult.getResponse();\r\n String jsonOutput = mockHttpServletResponse.getContentAsString();\r\n assertNotNull(jsonOutput);\r\n }", "public boolean update(Object obj) throws Exception;", "@Test\n\tpublic void testUpdateIncorrectParam() {\n\t\tfinal String owner = \"\"+1;\n\t\tfinal Long piiUniqueId = (long) 12345789;\n\t\t\n\t\tFormDataContentDisposition fileDetail = FormDataContentDisposition.name(\"file\").fileName(\"newFile.jpg\").build();\n\t\t\n\t\tResponse response = piiController.updateFile(piiUniqueId.toString(), null, fileDetail, null, owner);\n\t\t\n\t\tverifyZeroInteractions(mPiiService);\n\t\tverifyZeroInteractions(mPuidDao);\n\t\tassertEquals(400, response.getStatus());\n\t\t\n\t\tObject entity = response.getEntity();\n\t\tassertNull(entity);\n\t}", "@PUT\n\t@Path(\"/\") \n\t@Consumes(MediaType.APPLICATION_JSON) \n\t@Produces(MediaType.TEXT_PLAIN) \n\tpublic String updatesystem_editor(String systData) \n\t{\n\t\tJsonObject itemObject = new JsonParser().parse(systData).getAsJsonObject(); \n\t\t\n\t\t//Read the values from the JSON object\n\t\tString sid = itemObject.get(\"sid\").getAsString(); \n\t\tString username = itemObject.get(\"username\").getAsString(); \n\t\tString email = itemObject.get(\"email\").getAsString(); \n\t\tString password = itemObject.get(\"password\").getAsString(); \n\t\t\n\t\tString output = sysObj.updatesystem_editor(sid, username, email,password);\n\t\t\n\t\treturn output; \n\t}", "@Transactional\n @PutMapping(value = \"/updatepigininvoicepig/\")\n public ResponseEntity<Object> updatePigInInvoicePig(@RequestBody PigsInvoicePigDetailDTORequest pigsInvoicePigDetailDTORequest){\n\n PigsInvoicePigDetailDTOResponse temp = invoicePigDetailService.updatePigInInvoicePig(pigsInvoicePigDetailDTORequest);\n if(temp == null){\n return ResponseEntity.status(HttpStatus.BAD_REQUEST).build();\n }\n return ResponseEntity.ok(temp);\n }", "@RestAPI\n \t@PreAuthorize(\"hasAnyRole('A')\")\n \t@RequestMapping(value = \"/api/{id}\", params = \"action=update\", method = RequestMethod.PUT)\n \tpublic HttpEntity<String> update(@PathVariable(\"id\") Long id) {\n \t\tagentManagerService.update(id);\n \t\treturn successJsonHttpEntity();\n \t}" ]
[ "0.7369252", "0.7266874", "0.69910276", "0.6757672", "0.6671782", "0.6598355", "0.65960217", "0.6530578", "0.64718676", "0.64094293", "0.6358171", "0.635375", "0.6339657", "0.63294095", "0.6293085", "0.62762725", "0.6268099", "0.62553525", "0.6193212", "0.6187452", "0.6164462", "0.6150706", "0.6142548", "0.61366624", "0.61319333", "0.6122499", "0.60916734", "0.6071327", "0.6021014", "0.59962726", "0.5993337", "0.5992291", "0.598527", "0.5973923", "0.596116", "0.5950819", "0.5936013", "0.58987755", "0.5888785", "0.5865742", "0.585002", "0.5848001", "0.5839665", "0.5837099", "0.5830592", "0.5814147", "0.57867897", "0.5784394", "0.57633644", "0.5759658", "0.5759217", "0.575037", "0.57386464", "0.57358074", "0.57346654", "0.5734156", "0.5732993", "0.57305264", "0.5708739", "0.5708739", "0.5708739", "0.5708739", "0.5708739", "0.57067114", "0.5703629", "0.570224", "0.5700509", "0.5695324", "0.56937397", "0.56853473", "0.56848675", "0.5680107", "0.5678316", "0.5669794", "0.56570756", "0.5651917", "0.5650082", "0.5646827", "0.5645694", "0.5644899", "0.5644074", "0.56433564", "0.564158", "0.56359804", "0.56161064", "0.56161064", "0.56161064", "0.56161064", "0.56159705", "0.5606847", "0.55990183", "0.55954885", "0.5584958", "0.55805004", "0.5578994", "0.5577361", "0.5575295", "0.55750054", "0.55749464", "0.5568261" ]
0.5899791
37
"OK" the command REPLACE was performed correctly.
public String REPLACE(String name, String number){ this.clientData.put(name,number); return "OK"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public void selfReplace(Command replacement);", "boolean hasReplace();", "public void replace(String text) {\n\t\tlogger.info(\"REPLACE TODO\");\n\t}", "@Test\n public void shouldReplaceNoWords() throws IOException {\n String searchStr = \"spinach\";\n\n // replace all occurrences of search word with replacement\n String expected = srcContent.replaceAll(searchStr, replacementStr);\n\n // call main()\n invoke(searchStr);\n\n // read destination file\n String destContent = Files.readString(destFile.toPath());\n\n // does the expected content of the destination file meet the expected.\n assertEquals(expected.trim(),destContent.trim());\n }", "String getReplaced();", "@Override\n\tpublic boolean replace(String arg0, int arg1, Object arg2)\n\t\t\tthrows TimeoutException, InterruptedException, MemcachedException {\n\t\treturn false;\n\t}", "protected abstract boolean replace(String string, Writer w, Status status) throws IOException;", "@Handler\n private void replace( ReceivePrivmsg event )\n {\n String text = event.getText();\n Matcher sedMatcher = replacePattern.matcher( text );\n\n String nick = event.getSender();\n\n if ( sedMatcher.matches() )\n {\n String correction = \"Correction: \";\n\n /**\n * If the last group of the regex captures a non-null string, the user is fixing another user's message.\n */\n if ( sedMatcher.group( 5 ) != null )\n {\n nick = sedMatcher.group( 5 );\n correction = nick + \", ftfy: \";\n }\n\n if ( lastMessageMapByNick.containsKey( nick ) )\n {\n String regexp = sedMatcher.group( 2 );\n String replacement = sedMatcher.group( 3 );\n String endFlag = sedMatcher.group( 4 );\n\n synchronized ( lastMessageMapByNickMutex )\n {\n String lastMessage = lastMessageMapByNick.get( nick );\n\n if ( !lastMessage.contains( regexp ) )\n {\n event.reply( \"Wow. Seriously? Try subbing out a string that actually occurred. Do you even sed, bro?\" );\n }\n else\n {\n String replacedMsg;\n String replacedMsgWHL;\n\n String replacementWHL = Colors.bold( replacement );\n\n // TODO: Probably can be simplified via method reference in Java 8\n if ( \"g\".equals( endFlag ) )\n {\n replacedMsg = lastMessage.replaceAll( regexp, replacement );\n replacedMsgWHL = lastMessage.replaceAll( regexp, replacementWHL );\n }\n else\n {\n replacedMsg = lastMessage.replaceFirst( regexp, replacement );\n replacedMsgWHL = lastMessage.replaceFirst( regexp, replacementWHL );\n }\n\n event.reply( correction + replacedMsgWHL );\n lastMessageMapByNick.put( nick, replacedMsg );\n }\n }\n }\n }\n else\n {\n synchronized ( lastMessageMapByNickMutex )\n {\n lastMessageMapByNick.put( nick, text );\n }\n }\n }", "WriteExecutor<R> replace(T newValue);", "@Test\n public void shouldReplaceSingleWord() throws IOException {\n String searchStr = \"Bacon\";\n\n // replace all occurrences of search word with replacement\n String expected = srcContent.replaceAll(searchStr, replacementStr);\n\n // call main()\n invoke(searchStr);\n\n // read destination file\n String destContent = Files.readString(destFile.toPath());\n\n // does the expected content of the destination file meet the expected.\n assertEquals(expected.trim(),destContent.trim());\n }", "private void ReplaceJob()\r\n\t{\n\t\tif (check_Gui_Field_value() == true)\r\n\t\t{ //file exist yes/no\r\n\t\t\tif (check_file_existence(frm1txtSelectFile.getText()) == true)\r\n\t\t\t{\t\t\t\t\t\t\r\n\t\t\t\tStSourceFileName = frm1txtSelectFile.getText();\r\n\r\n\t\t\t\tSplit_Seek_value(); //erase old file + split seek\r\n\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\t//check if file/folder/other.\r\n\t\t\t\t\tif (check_file_status(frm1txtSelectFile.getText().toString()) == true)\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//snr s = new snr();\r\n\t\t\t\t\t\tsnr r = new snr();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tr.setParameters(StSourceFileName,StStrSplit[0]);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tr.getparameters();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tr.setParametersGui();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tl = new log(\"info\",\"Replace Button\" ,\"opened the a Seek and Replace Window\");\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tcatch (Exception e)\r\n\t\t\t\t{\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "@Override\n\tpublic boolean replace(String arg0, int arg1, Object arg2, long arg3)\n\t\t\tthrows TimeoutException, InterruptedException, MemcachedException {\n\t\treturn false;\n\t}", "String getReplacementString();", "boolean canReplace(SearchResult result);", "@Test\n public void testReplacingFailure()\n {\n String expectedValue=\"datly fry\",actualValue;\n actualValue=replaceingchar.replaceChar(inputString);\n assertNotEquals(expectedValue,actualValue);\n }", "void replace(int offset, int length, String text) throws BadLocationException;", "SearchResult replace(SearchResult result, String replacement);", "public String replace(String input);", "@DISPID(1611006080) //= 0x60060080. The runtime will prefer the VTID if present\n @VTID(155)\n boolean replaceOnlyAfterCurrent();", "public native String replaceItem(String newItem, Number index);", "protected void replaceText(CharSequence text) {\n/* 564 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public void testMoveFileWithReplace() throws Exception {\n IPackageFragment fragment = getRoot().createPackageFragment(\"org.test\", true, null);\n IPackageFragment otherFragment = getRoot().createPackageFragment(\"org.test1\", true, null);\n IFile file = ((IFolder) fragment.getResource()).getFile(\"x.properties\");\n String content = \"A file with no references\";\n file.create(getStream(content), true, null);\n setReadOnly(file);\n IFile file2 = ((IFolder) otherFragment.getResource()).getFile(\"x.properties\");\n file2.create(getStream(content), true, null);\n setReadOnly(file2);\n IMovePolicy policy = ReorgPolicyFactory.createMovePolicy(new IResource[] { file }, new IJavaElement[] {});\n assertTrue(policy.canEnable());\n JavaMoveProcessor javaMoveProcessor = new JavaMoveProcessor(policy);\n javaMoveProcessor.setDestination(ReorgDestinationFactory.createDestination(otherFragment));\n javaMoveProcessor.setReorgQueries(new MockReorgQueries());\n RefactoringStatus status = performRefactoring(new MoveRefactoring(javaMoveProcessor), true);\n if (status != null)\n assertTrue(status.toString(), status.isOK());\n Collection<IPath> validatedEditPaths = RefactoringTestRepositoryProvider.getValidatedEditPaths(getRoot().getJavaProject().getProject());\n assertEquals(1, validatedEditPaths.size());\n // replaced\n assertTrue(validatedEditPaths.contains(file2.getFullPath()));\n }", "@Test\n public void testSubstitute() {\n System.out.println(\"substitute\");\n StringBuilder sb = new StringBuilder();\n String tag = \"__TAG__\";\n String content = \"aa __TAG__ cc\";\n boolean expResult = false;\n boolean result = ConnectionManager.substitute(sb, tag, content);\n assertEquals(expResult, result);\n }", "public static void replaceAll1(){\n System.out.println(\">>>>>>>>>>>>\");\n String class0 = \"this is an example\";\n String ret0 = class0.replaceAll(\"are\", \"ARE\");\n assert(ret0.equals(\"this is an example\"));\n System.out.println(ret0);\n }", "@Override\n\tpublic <T> boolean replace(String arg0, int arg1, T arg2, Transcoder<T> arg3)\n\t\t\tthrows TimeoutException, InterruptedException, MemcachedException {\n\t\treturn false;\n\t}", "public static void main(String[] args) {\nScanner s1 = new Scanner(System.in);\r\nSystem.out.println(\"Enter the string \");\r\nString str1 = s1.nextLine();\r\n//s1.close();\r\n\r\n//Scanner s2 = new Scanner(System.in);\r\nSystem.out.println(\"enter part to be replaced\");\r\n\r\nString str2 = s1.nextLine();\r\n//s2.close();\r\n\r\n\r\nSystem.out.println(\"replace with\");\r\n//Scanner s3 = new Scanner(System.in);\r\nString str3 = s1.nextLine();\r\n//s3.close();\r\n\r\n\r\nstr1 = str1.replace(str2,str3);\r\nSystem.out.println(str1);\r\n\t}", "void replaceNext() {\n if (mte.getJtext().getSelectionStart() == mte.getJtext().getSelectionEnd()) {\n findNextWithSelection();\n return;\n }\n String searchText = findWhat.getText();\n String temp = mte.getJtext().getSelectedText(); //get selected text\n\n//check if the selected text matches the search text then do replacement\n if ((matchCase.isSelected() && temp.equals(searchText))\n || (!matchCase.isSelected() && temp.equalsIgnoreCase(searchText))) {\n mte.getJtext().replaceSelection(replaceWith.getText());\n }\n\n findNextWithSelection();\n }", "private String DoFindReplace(String line)\n {\n String newLine = line;\n\n for (String findKey : lineFindReplace.keySet())\n {\n String repValue = lineFindReplace.get(findKey).toString();\n\n Pattern findPattern = Pattern.compile(findKey);\n Matcher repMatcher = findPattern.matcher(newLine);\n\n newLine = repMatcher.replaceAll(repValue);\n }\n return(newLine);\n }", "@Override\n\tpublic void replaceAt(int index, int e) {\n\t\t\n\t}", "com.google.spanner.v1.Mutation.Write getReplace();", "public String replaceFrom(CharSequence sequence, CharSequence replacement) {\n/* 150 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public boolean isLegalReplacement(byte[] repl) {\n return true;\n }", "public void replaceSelection(CharSequence replacement) {\n getLock().getWriteLock();\n try {\n replaceRange(replacement, getSelectionStart(), getSelectionEnd());\n } finally {\n getLock().relinquishWriteLock();\n }\n }", "public boolean isReplaced() {\n return REPLACED.equals(message);\n }", "protected void replace(char c1, char c2) {\n\n // Search for instances of 'c1'\n for(int i=0; i < message.size(); ++i) {\n\n // Check if match\n if(message.get(i) == c1) {\n \n // Replace data in node with new char\n message.deleteAt(i);\n message.insertAt(i, c2);\n }\n }\n\n // Record inverse command\n this.undoCommands += \"r \" + c2 + \" \" + c1 + \"\\n\";\n }", "@Override\n\tpublic <T> boolean replace(String arg0, int arg1, T arg2,\n\t\t\tTranscoder<T> arg3, long arg4) throws TimeoutException,\n\t\t\tInterruptedException, MemcachedException {\n\t\treturn false;\n\t}", "private void replace( int ix, int len, short code, boolean deleted[] )\n {\n text[ix] = code;\n \n Arrays.fill( deleted, ix+1, ix+len, true );\n }", "protected void redoTextChange() {\n \t\t\ttry {\n \t\t\t\tif (fDocumentUndoManager.fDocument instanceof IDocumentExtension4)\n \t\t\t\t\t((IDocumentExtension4) fDocumentUndoManager.fDocument).replace(fStart, fEnd - fStart, fText, fRedoModificationStamp);\n \t\t\t\telse\n \t\t\t\t\tfDocumentUndoManager.fDocument.replace(fStart, fEnd - fStart, fText);\n \t\t\t} catch (BadLocationException x) {\n \t\t\t}\n \t\t}", "private static void replace(\r\n \t\tStringBuffer orig,\r\n \t\tString o,\r\n \t\tString n,\r\n \t\tboolean all) {\r\n \t\tif (orig == null || o == null || o.length() == 0 || n == null)\r\n \t\t\tthrow new IllegalArgumentException(\"Null or zero-length String\");\r\n \r\n \t\tint i = 0;\r\n \r\n \t\twhile (i + o.length() <= orig.length()) {\r\n \t\t\tif (orig.substring(i, i + o.length()).equals(o)) {\r\n \t\t\t\torig.replace(i, i + o.length(), n);\r\n \t\t\t\tif (!all)\r\n \t\t\t\t\tbreak;\r\n \t\t\t\telse\r\n \t\t\t\t\ti += n.length();\r\n \t\t\t} else\r\n \t\t\t\ti++;\r\n \t\t}\r\n \t}", "protected void undoTextChange() {\n \t\t\ttry {\n \t\t\t\tif (fDocumentUndoManager.fDocument instanceof IDocumentExtension4)\n \t\t\t\t\t((IDocumentExtension4) fDocumentUndoManager.fDocument).replace(fStart, fText\n \t\t\t\t\t\t\t.length(), fPreservedText, fUndoModificationStamp);\n \t\t\t\telse\n \t\t\t\t\tfDocumentUndoManager.fDocument.replace(fStart, fText.length(),\n \t\t\t\t\t\t\tfPreservedText);\n \t\t\t} catch (BadLocationException x) {\n \t\t\t}\n \t\t}", "@Override\n\tpublic String strreplace(String str, int start, int end, String with) {\n\t\treturn null;\n\t}", "public static void main(String[] args) {\n\t\tString lyrics = \"Let it go!Let it go!Cannot hold it back anymore\";\r\n\t\t\r\n\t\tSystem.out.println(lyrics);\r\n\t\t\r\n\t\tString changeher = lyrics.replace(\"it\", \"\\\"her\\\"\");\r\n\t\t\r\n\t\tSystem.out.println(changeher);\r\n\t\t\r\n\t\tString changecannot = changeher.replace(\"Cannot\", \"can't\");\r\n\t\t\r\n\t\tSystem.out.println(changecannot);\r\n\t}", "@Test\n public void testReplacingSuccess()\n {\n String expectedValue=\"fatly fry\",actualValue;\n actualValue=replaceingchar.replaceChar(inputString);\n assertEquals(expectedValue,actualValue);\n }", "int replaceAll(SearchOptions searchOptions, String replacement);", "public void markOdbPsReplace() throws JNCException {\n markLeafReplace(\"odbPs\");\n }", "public static void replace(StringBuffer orig, String o, String n,\n boolean all) {\n if (orig == null || o == null || o.length() == 0 || n == null) {\n throw new XDBServerException(\n ErrorMessageRepository.ILLEGAL_PARAMETER, 0,\n ErrorMessageRepository.ILLEGAL_PARAMETER_CODE);\n }\n\n int i = 0;\n while (i + o.length() <= orig.length()) {\n if (orig.substring(i, i + o.length()).equalsIgnoreCase(o)) {\n orig.replace(i, i + o.length(), n);\n if (!all) {\n break;\n } else {\n i += n.length();\n }\n } else {\n i++;\n }\n }\n }", "public interface BiGULReplace extends BiGULStatement\n{\n}", "@Override\n\tpublic String strreplace(String str, String oldstr, String newstr) {\n\t\treturn null;\n\t}", "@Override\n protected Object replaceObject(Object obj) throws IOException{\n\treturn d.defaultReplaceObject(obj);\n }", "public static void replaceAll0(){\n System.out.println(\">>>>>>>>>>>>\");\n String class0 = \"this is an example\";\n String ret0 = class0.replaceAll(\"is\", \"IS\");\n assert(ret0.equals(\"thIS IS an example\"));\n System.out.println(ret0);\n }", "boolean replace(int pos, SNode node);", "private boolean confirmReplace() {\n\t\tString answer = \"\";\n\t\tint attempts = 3;\n\t\t// takes user input\n\t\t// if string is invalid it loops 3 times before exiting with the false\n\t\t// return\n\t\tdo {\n\t\t\tSystem.out.println(\"Files already exists.Do you want to replace it? y/n\");\n\t\t\tScanner in = new Scanner(System.in);\n\t\t\tanswer = in.nextLine();\n\t\t\tattempts--;\n\t\t} while (isValidEntry(answer) && attempts > 0);\n\t\t\n\t\tif (answer.charAt(0) == 'y')\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public void testMoveCuWithReplace() throws Exception {\n IPackageFragment fragment = getRoot().createPackageFragment(\"org.test\", true, null);\n IPackageFragment otherFragment = getRoot().createPackageFragment(\"org.test1\", true, null);\n StringBuffer buf = new StringBuffer();\n buf.append(\"package org.test;\\n\");\n buf.append(\"public class MyClass {\\n\");\n buf.append(\"}\\n\");\n ICompilationUnit cu1 = fragment.createCompilationUnit(\"MyClass.java\", buf.toString(), true, null);\n setReadOnly(cu1);\n buf = new StringBuffer();\n buf.append(\"package org.test1;\\n\");\n buf.append(\"public class MyClass {\\n\");\n buf.append(\"}\\n\");\n ICompilationUnit cu2 = otherFragment.createCompilationUnit(\"MyClass.java\", buf.toString(), true, null);\n setReadOnly(cu2);\n IMovePolicy policy = ReorgPolicyFactory.createMovePolicy(new IResource[0], new IJavaElement[] { cu1 });\n assertTrue(policy.canEnable());\n JavaMoveProcessor javaMoveProcessor = new JavaMoveProcessor(policy);\n javaMoveProcessor.setDestination(ReorgDestinationFactory.createDestination(otherFragment));\n javaMoveProcessor.setReorgQueries(new MockReorgQueries());\n RefactoringStatus status = performRefactoring(new MoveRefactoring(javaMoveProcessor), false);\n if (status != null)\n assertTrue(status.toString(), status.isOK());\n Collection<IPath> validatedEditPaths = RefactoringTestRepositoryProvider.getValidatedEditPaths(getRoot().getJavaProject().getProject());\n assertEquals(2, validatedEditPaths.size());\n // moved and changed\n assertTrue(validatedEditPaths.contains(cu1.getPath()));\n // replaced\n assertTrue(validatedEditPaths.contains(cu2.getPath()));\n }", "private static void encodeStringForAuditFieldReplaceString(StringBuilder sb, String oldString, String newString) {\n\n\t\tint index = sb.indexOf(oldString);\n\t\twhile (index >= 0) {\n\t\t\tsb.delete(index, index + oldString.length());\n\t\t\tsb.insert(index, newString);\n\t\t\tindex = sb.indexOf(oldString, index + newString.length());\n\t\t}\n\n\t}", "public String onPlaceholderReplace(PlaceholderReplaceEvent event);", "@Override\n public boolean getOrReplace() {\n return orReplace_;\n }", "@Override\n public boolean getOrReplace() {\n return orReplace_;\n }", "@Override\n\tpublic int getReplaceBlock() {\n\t\treturn 0;\n\t}", "private String changeContent(String soapMessage) {\n soapMessage = soapMessage.replaceAll(\"getReportUsedToServerResponse\", \"getReportUsedToClientResponse\");\n System.out.println(\"-------------------------------------------\");\n System.out.println(\"After outgoing message is \" + soapMessage);\n System.out.println(\"-------------------------------------------\");\n return soapMessage;\n }", "public interface SearchReplaceController {\n\n /**\n * <p>Finds next (or first) ocurrence for the given search options.</p>\n * <p>Returns a <code>SearchResult</code> instance with the details or null if the search was not successful.</p>\n * <p>Modifies the given search options in order to match the next result the next time <code>findNext</code> is called</p>\n * @param searchOptions Options of the search\n * @return SearchResult with details of the match or null\n */\n SearchResult findNext(SearchOptions searchOptions);\n\n /**\n * <p>Finds next ocurrence for the given search options contained in a SearchResult.</p>\n * <p>Returns a <code>SearchResult</code> instance with the details or null if the search was not successful.</p>\n * <p>Modifies the given search options in order to match the next result the next time <code>findNext</code> is called</p>\n * @param result Last result of the search\n * @return SearchResult with details of the match or null \n */\n SearchResult findNext(SearchResult result);\n\n /**\n * <p>Indicates if a <code>SearchResult</code> can be replaced or not.</p>\n * <p>Computed columns and id columns cannot be replaced.</p>\n * @param result SearchResult to check before replacing\n * @return True if it can be replaced, false otherwise\n */\n boolean canReplace(SearchResult result);\n\n /**\n * <p>Replaces a <code>SearchResult</code> with the given replacement String.</p>\n * <p>Also tries to find next search result and returns it.</p>\n * <p>If the data has changed and the replacement can't be done it will just return next <code>SearchResult</code> calling <code>findNext</code>.</p>\n * <p>If useRegexReplaceMode is enabled, IndexOutOfBoundsException can be thrown when the replacement is not correct for the regular expression.</p>\n * @param result SearchResult to replace\n * @param replacement Replacement String\n * @return Next SearchResult or null if not successful\n */\n SearchResult replace(SearchResult result, String replacement);\n\n /**\n * <p>Replaces all SearchResults that can be replaced with the given search options from the beginning to the end of the data.</p>\n * <p>If useRegexReplaceMode is enabled, IndexOutOfBoundsException can be thrown when the replacement is not correct for the regular expression.</p>\n * @param searchOptions Search options for the searches\n * @param replacement Replacement String\n * @return Count of made replacements\n */\n int replaceAll(SearchOptions searchOptions, String replacement);\n\n /**\n * Class that wraps the different possible options of search and provides various useful constructors.\n */\n class SearchOptions {\n\n private boolean searchNodes;\n private Node[] nodesToSearch;\n private Edge[] edgesToSearch;\n private Integer startingRow = null, startingColumn = null;\n private HashSet<Integer> columnsToSearch = new HashSet<>();\n private boolean loopToBeginning = true;\n private Pattern regexPattern;\n private boolean useRegexReplaceMode = false;\n private int regionStart = 0;\n private boolean onlyMatchWholeAttributeValue;\n\n public void resetStatus() {\n regionStart = 0;\n startingRow = null;\n startingColumn = null;\n }\n\n /**\n * Sets nodesToSearch as all nodes in the graph if they are null or empty array.\n * Also only search on visible view if data table is showing visible only.\n */\n private void checkNodesToSearch() {\n if (nodesToSearch == null || nodesToSearch.length == 0) {\n Graph graph;\n if (Lookup.getDefault().lookup(DataTablesController.class).isShowOnlyVisible()) {\n graph = Lookup.getDefault().lookup(GraphController.class).getGraphModel().getGraphVisible();\n } else {\n graph = Lookup.getDefault().lookup(GraphController.class).getGraphModel().getGraph();\n }\n nodesToSearch = graph.getNodes().toArray();\n }\n }\n\n /**\n * Sets edgesToSearch as all edges in the graph if they are null or empty array.\n * Also only search on visible view if data table is showing visible only.\n */\n private void checkEdgesToSearch() {\n if (edgesToSearch == null || edgesToSearch.length == 0) {\n Graph hg;\n if (Lookup.getDefault().lookup(DataTablesController.class).isShowOnlyVisible()) {\n hg = Lookup.getDefault().lookup(GraphController.class).getGraphModel().getGraphVisible();\n } else {\n hg = Lookup.getDefault().lookup(GraphController.class).getGraphModel().getGraph();\n }\n edgesToSearch = hg.getEdges().toArray();\n }\n }\n\n /**\n * Setup options to search on nodes with the given pattern.\n * If nodesToSearch is null, all nodes of the graph will be used.\n * @param nodesToSearch\n * @param regexPattern\n */\n public SearchOptions(Node[] nodesToSearch, Pattern regexPattern) {\n this.nodesToSearch = nodesToSearch;\n this.regexPattern = regexPattern;\n searchNodes = true;\n checkNodesToSearch();\n }\n\n /**\n * Setup options to search on edges with the given pattern.\n * If edgesToSearch is null, all edges of the graph will be used.\n * @param edgesToSearch\n * @param regexPattern\n */\n public SearchOptions(Edge[] edgesToSearch, Pattern regexPattern) {\n this.edgesToSearch = edgesToSearch;\n this.regexPattern = regexPattern;\n searchNodes = false;\n checkEdgesToSearch();\n }\n\n /**\n * Setup options to search on nodes with the given pattern.\n * If nodesToSearch is null, all nodes of the graph will be used.\n * @param nodesToSearch\n * @param regexPattern\n * @param onlyMatchWholeAttributeValue \n */\n public SearchOptions(Node[] nodesToSearch, Pattern regexPattern, boolean onlyMatchWholeAttributeValue) {\n this.nodesToSearch = nodesToSearch;\n this.regexPattern = regexPattern;\n this.onlyMatchWholeAttributeValue = onlyMatchWholeAttributeValue;\n searchNodes = true;\n }\n\n /**\n * Setup options to search on edges with the given pattern.\n * If edgesToSearch is null, all edges of the graph will be used.\n * @param edgesToSearch\n * @param regexPattern\n * @param onlyMatchWholeAttributeValue\n */\n public SearchOptions(Edge[] edgesToSearch, Pattern regexPattern, boolean onlyMatchWholeAttributeValue) {\n this.edgesToSearch = edgesToSearch;\n this.regexPattern = regexPattern;\n this.onlyMatchWholeAttributeValue = onlyMatchWholeAttributeValue;\n searchNodes = false;\n }\n\n /************Getters and setters***********/\n public Edge[] getEdgesToSearch() {\n return edgesToSearch;\n }\n\n public Node[] getNodesToSearch() {\n return nodesToSearch;\n }\n\n public boolean isOnlyMatchWholeAttributeValue() {\n return onlyMatchWholeAttributeValue;\n }\n\n public void setOnlyMatchWholeAttributeValue(boolean onlyMatchWholeAttributeValue) {\n this.onlyMatchWholeAttributeValue = onlyMatchWholeAttributeValue;\n }\n\n public Pattern getRegexPattern() {\n return regexPattern;\n }\n\n public void setRegexPattern(Pattern regexPattern) {\n this.regexPattern = regexPattern;\n }\n\n public Integer getStartingColumn() {\n return startingColumn;\n }\n\n public void setStartingColumn(Integer startingColumn) {\n this.startingColumn = startingColumn;\n }\n\n public Integer getStartingRow() {\n return startingRow;\n }\n\n public void setStartingRow(Integer startingRow) {\n this.startingRow = startingRow;\n }\n\n /**\n * Set column indexes that should be used to search with the current options.\n * If columnsToSearch is empty, all columns will be used to search.\n * @param columnsToSearch It is safe to specify invalid columns indexes, they will be ignored\n */\n public void setColumnsToSearch(int[] columnsToSearch) {\n this.columnsToSearch.clear();\n if (columnsToSearch != null) {\n for (Integer i : columnsToSearch) {\n this.columnsToSearch.add(i);\n }\n }\n }\n\n /**\n * Set column that should be used to search with the current options.\n * If columnsToSearch is empty, all columns will be used to search.\n * @param columnsToSearch It is safe to specify invalid columns, they will be ignored\n */\n public void setColumnsToSearch(Column[] columnsToSearch) {\n this.columnsToSearch.clear();\n if (columnsToSearch != null) {\n for (Column c : columnsToSearch) {\n this.columnsToSearch.add(c.getIndex());\n }\n }\n }\n\n /**\n * Returns columns indexes to search\n * @return Set with columns indexes to search\n */\n public Set<Integer> getColumnsToSearch() {\n return columnsToSearch;\n }\n\n public boolean isSearchNodes() {\n return searchNodes;\n }\n\n public int getRegionStart() {\n return regionStart;\n }\n\n public void setRegionStart(int regionStart) {\n this.regionStart = regionStart;\n }\n\n public boolean isUseRegexReplaceMode() {\n return useRegexReplaceMode;\n }\n\n public void setUseRegexReplaceMode(boolean useRegexReplaceMode) {\n this.useRegexReplaceMode = useRegexReplaceMode;\n }\n\n public boolean isLoopToBeginning() {\n return loopToBeginning;\n }\n\n public void setLoopToBeginning(boolean loopToBeginning) {\n this.loopToBeginning = loopToBeginning;\n }\n }\n\n /**\n * <p>Class that wraps the result of a search contaning the search options used for this result\n * and the node or edge, row, column and start-end index of the value where ocurrence was found.</p>\n */\n class SearchResult {\n\n /**\n * searchOptions for finding next match.\n */\n private SearchOptions searchOptions;\n private Node foundNode;\n private Edge foundEdge;\n private int foundRowIndex, foundColumnIndex;\n private int start, end;\n\n public SearchResult(SearchOptions searchOptions, Node foundNode, Edge foundEdge, int foundRowIndex, int foundColumnIndex, int start, int end) {\n this.searchOptions = searchOptions;\n this.foundNode = foundNode;\n this.foundEdge = foundEdge;\n this.foundRowIndex = foundRowIndex;\n this.foundColumnIndex = foundColumnIndex;\n this.start = start;\n this.end = end;\n }\n\n public int getEnd() {\n return end;\n }\n\n public void setEnd(int end) {\n this.end = end;\n }\n\n public int getFoundColumnIndex() {\n return foundColumnIndex;\n }\n\n public void setFoundColumnIndex(int foundColumnIndex) {\n this.foundColumnIndex = foundColumnIndex;\n }\n\n public Edge getFoundEdge() {\n return foundEdge;\n }\n\n public void setFoundEdge(Edge foundEdge) {\n this.foundEdge = foundEdge;\n }\n\n public Node getFoundNode() {\n return foundNode;\n }\n\n public void setFoundNode(Node foundNode) {\n this.foundNode = foundNode;\n }\n\n public int getFoundRowIndex() {\n return foundRowIndex;\n }\n\n public void setFoundRowIndex(int foundRowIndex) {\n this.foundRowIndex = foundRowIndex;\n }\n\n public SearchOptions getSearchOptions() {\n return searchOptions;\n }\n\n public void setSearchOptions(SearchOptions searchOptions) {\n this.searchOptions = searchOptions;\n }\n\n public int getStart() {\n return start;\n }\n\n public void setStart(int start) {\n this.start = start;\n }\n }\n}", "public void testCopyCuWithReplace() throws Exception {\n IPackageFragment fragment = getRoot().createPackageFragment(\"org.test\", true, null);\n IPackageFragment otherFragment = getRoot().createPackageFragment(\"org.test1\", true, null);\n StringBuffer buf = new StringBuffer();\n buf.append(\"package org.test;\\n\");\n buf.append(\"public class MyClass {\\n\");\n buf.append(\"}\\n\");\n ICompilationUnit cu1 = fragment.createCompilationUnit(\"MyClass.java\", buf.toString(), true, null);\n setReadOnly(cu1);\n buf = new StringBuffer();\n buf.append(\"package org.test1;\\n\");\n buf.append(\"public class MyClass {\\n\");\n buf.append(\"}\\n\");\n ICompilationUnit cu2 = otherFragment.createCompilationUnit(\"MyClass.java\", buf.toString(), true, null);\n setReadOnly(cu2);\n ICopyPolicy policy = ReorgPolicyFactory.createCopyPolicy(new IResource[0], new IJavaElement[] { cu1 });\n assertTrue(policy.canEnable());\n JavaCopyProcessor javaCopyProcessor = new JavaCopyProcessor(policy);\n javaCopyProcessor.setDestination(ReorgDestinationFactory.createDestination(otherFragment));\n javaCopyProcessor.setReorgQueries(new MockReorgQueries());\n javaCopyProcessor.setNewNameQueries(new MockReorgQueries());\n RefactoringStatus status = performRefactoring(new CopyRefactoring(javaCopyProcessor), false);\n if (status != null)\n assertTrue(status.toString(), status.isOK());\n Collection<IPath> validatedEditPaths = RefactoringTestRepositoryProvider.getValidatedEditPaths(getRoot().getJavaProject().getProject());\n assertEquals(1, validatedEditPaths.size());\n // replaced\n assertTrue(validatedEditPaths.contains(cu2.getPath()));\n }", "public boolean replaceEdit(UndoableEdit anEdit);", "public boolean replaceEdit(UndoableEdit anEdit);", "public abstract E replace(Position<E> p, E e);", "private void invoke(String searchStr) {\n String userInput = concatWithNewLineFeed(searchStr,replacementStr,srcFile.getAbsolutePath(),destFile.getAbsolutePath());\n System.setIn(new ByteArrayInputStream(userInput.getBytes()));\n FindAndReplace.main(null);\n }", "public void modifyText(ModifyEvent e) {\n Text redefineText = (Text) e.getSource();\n coll.set_value(Key, redefineText.getText());\n\n OtpErlangObject re = parent.getIdeBackend(parent.confCon, coll.type, coll.coll_id, Key, redefineText.getText());\n String reStr = Util.stringValue(re);\n //ErlLogger.debug(\"Ll:\"+document.getLength());\n try {\n parent.document.replace(0, parent.document.getLength(), reStr);\n } catch (BadLocationException e1) {\n // TODO Auto-generated catch block\n e1.printStackTrace();\n }\n }", "public static void main(String[] args) {\n\t\n\tString str=\"Hello Deannochka, How are you? How have you been?\";\n\tSystem.out.println(str.replace(\" y\", \" th\"));\n\tSystem.out.println(str.replace(\"Hello\", \"Hey\"));\n//\tSystem.out.println(str.replaceAll(regex, replacement));\n\t\n}", "@Override\n public boolean getOrReplace() {\n return orReplace_;\n }", "@Override\n public boolean getOrReplace() {\n return orReplace_;\n }", "protected final Object writeReplace() throws ObjectStreamException {\n return replacement;\n }", "@NotNull\n @Override\n public PsiElement replace(@NotNull PsiElement newElement) throws IncorrectOperationException {\n PsiElement parent = getParent();\n if (parent instanceof JetExpression && newElement instanceof JetExpression &&\n JetPsiUtil.areParenthesesNecessary((JetExpression) newElement, this, (JetExpression) parent)) {\n return super.replace(JetPsiFactory(this).createExpression(\"(\" + newElement.getText() + \")\"));\n }\n return super.replace(newElement);\n }", "public void replaceAll(MConstText srcText) {\r\n replace(0, length(), srcText, 0, srcText.length());\r\n }", "private void ReplacePlayer()\n {\n String oldPlayer = GetPlayerString(mTeamsComboBox.getSelectedItem().toString(),\n mPositionComboBox.getSelectedItem().toString());\n if( oldPlayer == null )\n return;\n\n String newPlayer = GetPlayerString_UI();\n String team = mTeamsComboBox.getModel().getElementAt(mTeamsComboBox.getSelectedIndex()).toString();\n ReplacePlayer(team, oldPlayer, newPlayer);\n }", "public void replaceCurrentInterpolationTerm(String replacement) {\n\t\tMessageInterpolationToken token = new MessageInterpolationToken( replacement );\n\t\ttoken.terminate();\n\t\ttokenList.set( currentPosition - 1, token );\n\t}", "@Override\n\tpublic void elementReplaced(int anIndex, Object aNewValue) {\n\t\tListEditObserved.newCase(OperationName.REPLACE, anIndex, aNewValue,\n\t\t\t\tApplicationTags.EDITOR, this);\n\t\tdisplayOutput();\n\t\tListEditDisplayed.newCase(OperationName.REPLACE, anIndex, aNewValue,\n\t\t\t\tApplicationTags.EDITOR, this);\n\t}", "public static void fileEditor(String sourcePath, String targetPath, String search, String replace) {\t \t\n\t\t\ttry {\n\t\t\t\t File log= new File(sourcePath);\n\t\t\t\t File tar= new File(targetPath);\t \t\n\t\t\t FileReader fr = new FileReader(log);\n\t\t\t String s;\n\t\t\t String totalStr = \"\";\n\t\t\t try (BufferedReader br = new BufferedReader(fr)) {\n\t\t\t while ((s = br.readLine()) != null) { totalStr += s + \"\\n\"; }\t \n\t\t\t totalStr = totalStr.replaceAll(search, replace);\n\t\t\t FileWriter fw = new FileWriter(tar);\n\t\t\t fw.write(totalStr);\n\t\t\t fw.close();\n\t\t\t }\n\t\t\t } catch(Exception e) { System.out.println(\"Problem reading file.\"); }\n\t\t\t}", "private String findReplace(String str, String find, String replace)\n/* */ {\n/* 944 */ String des = new String();\n/* 945 */ while (str.indexOf(find) != -1) {\n/* 946 */ des = des + str.substring(0, str.indexOf(find));\n/* 947 */ des = des + replace;\n/* 948 */ str = str.substring(str.indexOf(find) + find.length());\n/* */ }\n/* 950 */ des = des + str;\n/* 951 */ return des;\n/* */ }", "public static void replaceAll(File file, String substitute, String substituteReplacement) throws IOException {\r\n log.debug(\"Replace \" + substitute + \" by \" + substituteReplacement);\r\n\r\n Pattern pattern = Pattern.compile(substitute);\r\n\r\n // Open the file and then get a channel from the stream\r\n FileInputStream fis = new FileInputStream(file);\r\n FileChannel fc = fis.getChannel();\r\n\r\n // Get the file's size and then map it into memory\r\n int sz = (int)fc.size();\r\n MappedByteBuffer bb = fc.map(FileChannel.MapMode.READ_ONLY, 0, sz);\r\n\r\n // Decode the file into a char buffer\r\n // Charset and decoder for ISO-8859-15\r\n Charset charset = Charset.forName(\"ISO-8859-15\");\r\n CharsetDecoder decoder = charset.newDecoder();\r\n CharBuffer cb = decoder.decode(bb);\r\n\r\n Matcher matcher = pattern.matcher(cb);\r\n String outString = matcher.replaceAll(substituteReplacement);\r\n log.debug(outString);\r\n\r\n\r\n FileOutputStream fos = new FileOutputStream(file.getAbsolutePath());\r\n PrintStream ps =new PrintStream(fos);\r\n ps.print(outString);\r\n ps.close();\r\n fos.close();\r\n }", "public native final String SRC_REPLACE() /*-{\n\t\treturn this.SRC_REPLACE;\n\t}-*/;", "@Test\n public void testReplaceStampseudonymNow() {\n // Use the initial dataset to retrieve the Stampseudonym\n String initialStampseudonym = eckIdServiceUtil.generateStampseudonym(validHpgnOld);\n\n // Submit the substitution\n String processedStampseudonym = eckIdServiceUtil.replaceStampseudonym(validHpgnNew, validHpgnOld, null);\n\n // Retrieve the Stampseudonym based on the new Hpgn, and check the result\n String finalStampseudonym = eckIdServiceUtil.generateStampseudonym(validHpgnNew);\n\n // Assert that the Stampseudonym retrieved from the Replace Stampseudonym operation is correct\n assertEquals(initialStampseudonym, processedStampseudonym);\n\n // Assert that the Stampseudonym retrieved based on the new Hpgn equals the old Hpgn\n assertEquals(initialStampseudonym, finalStampseudonym);\n }", "public final void replaceText(CharSequence charSequence) {\n if (this.f152273r) {\n super.replaceText(charSequence);\n }\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(\"abcabc\".replace('a', 'A')); // AbcAbc\n\t\tSystem.out.println(\"abcabc\".replace(\"a\", \"A\")); // AbcAbc\n\t\t\n\t}", "public String replaceFrom(CharSequence sequence, CharSequence replacement, CountMethod countMethod) {\n/* 165 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "protected void pretendCommit() {\n \t\t\tif (fStart > -1) {\n \t\t\t\tfText= fDocumentUndoManager.fTextBuffer.toString();\n \t\t\t\tfPreservedText= fDocumentUndoManager.fPreservedTextBuffer.toString();\n \t\t\t}\n \t\t}", "@Override // java.time.chrono.AbstractChronology\n public Object writeReplace() {\n return super.writeReplace();\n }", "@Override\n public void replace(FilterBypass fb, int offset, int length, String text, AttributeSet attrs)\n throws BadLocationException {\n if (text.equals(last) && last.equals(\"^\")) {\n text = \"\";\n }\n last = text;\n super.replace(fb, offset, length, text, attrs);\n }", "public static String replace(String orig, String o, String n) {\n\n if (orig == null) {\n return null;\n }\n StringBuffer origSB = new StringBuffer(orig);\n replace(origSB, o, n, true);\n String newString = origSB.toString();\n\n return newString;\n }", "@Override\n\tpublic void editorInsert(String substring)\n\t{\n\t stringBuffer.replace(selectionStart,selectionEnd,substring);\n\t selectionEnd=selectionStart+substring.length();\n\t selectionStart=selectionEnd;\n\t\tSystem.out.println(\"DEBUG: inserting text [\" + substring + \"]\");\n\t}", "public void replace(String cText, GenericObject newObject,\n boolean matchSubstring )\n throws IllegalArgumentException {\n SIPHeader siphdr;\n if (cText == null || newObject == null) {\n throw new IllegalArgumentException(\"null arguments\");\n }\n if (SIPHeader.class.isAssignableFrom(newObject.getClass())) {\n throw new IllegalArgumentException\n (\"Cannot replace object of class\" + newObject.getClass());\n } else if (SIPHeaderList.class.\n isAssignableFrom(newObject.getClass())) {\n throw new IllegalArgumentException\n (\"Cannot replace object of class \" + newObject.getClass());\n } else {\n // not a sipheader or a sipheaderlist so do a find and replace.\n synchronized (this.headers) {\n // Concurrent modification exception noticed by Lamine Brahimi\n ListIterator li = this.headers.listIterator();\n while (li.hasNext()) {\n siphdr = (SIPHeader) li.next();\n siphdr.replace(cText,newObject,matchSubstring);\n }\n }\n }\n }", "public String replaceFrom(CharSequence sequence, CharSequence replacement, CountMethod countMethod, UnicodeSet.SpanCondition spanCondition) {\n/* 182 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "String replaceOnException(String sql);", "public static void main(String[] args){\n File testFile = new File(args[1]);\n File testFile_new = new File(args[2]);\n String all = \"\";\n // read all data\n try {\n Scanner input = null;\n input = new Scanner(testFile);\n while (input.hasNext()){\n all += input.nextLine() + \"\\r\\n\";\n }\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n // print and replace\n System.out.println(all);\n all = all.replaceAll(args[0], \"\");\n // save to other file with replaced\n try{\n PrintWriter output = new PrintWriter(testFile_new);\n output.write(all);\n output.close();\n } catch (FileNotFoundException ex){\n ex.printStackTrace();\n }\n }", "public static void main(String[] args) {\n Scanner input=new Scanner (System.in);\n System.out.println(\"Give me a value:\");\n\n String success=input.nextLine();\n success=success.trim();\n\n System.out.println(success);\n\n success=success.replace(\"Zero\",\"One\");\n\n System.out.println(success);\n\n System.out.println(success.toUpperCase());\n\n boolean condition=success.contains(\"Zero to Hero\");\n\n System.out.println(condition);\n\n success=success.replace(\"One to Hero\",\"Zero to Hero\");\n\n System.out.println(success);\n boolean condition1=success.contains(\"Zero to Hero\");\n\n System.out.println(condition1);\n }", "protected void doTextOperation(IDocument doc, String actionID,\r\n TextReplaceResultSet resultSet) throws BadLocationException {\r\n int maxNbr = resultSet.getStartLine() + resultSet.getNumberOfLines();\r\n boolean removeTrailing;\r\n boolean convertEnabled;\r\n boolean tabsToSpaces;\r\n boolean addLineEnabled;\r\n CombinedPreferences prefs = getCombinedPreferences();\r\n boolean replaceAllTabs = isReplaceAllTabsEnabled(prefs);\r\n boolean replaceAllSpaces = isReplaceAllSpacesEnabled(prefs);\r\n boolean useModulo4Tabs = prefs.getBoolean(IAnyEditConstants.USE_MODULO_CALCULATION_FOR_TABS_REPLACE);\r\n\r\n boolean usedOnSave = isUsedOnSave();\r\n if (usedOnSave) {\r\n removeTrailing = isSaveAndTrimEnabled(prefs);\r\n tabsToSpaces = isDefaultTabToSpaces(prefs);\r\n convertEnabled = isSaveAndConvertEnabled(prefs);\r\n addLineEnabled = isSaveAndAddLineEnabled(prefs);\r\n } else {\r\n removeTrailing = isRemoveTrailingSpaceEnabled(prefs);\r\n tabsToSpaces = actionID.startsWith(ACTION_ID_CONVERT_TABS);\r\n convertEnabled = true;\r\n addLineEnabled = isAddLineEnabled(prefs);\r\n }\r\n\r\n int tabWidth = getTabWidth(getFile(), prefs);\r\n\r\n StringBuffer sb = new StringBuffer();\r\n if (!tabsToSpaces && tabWidth == 0) {\r\n // TODO: prevent division by zero - probably on another place?\r\n tabWidth = 1;\r\n }\r\n String line;\r\n IRegion lineInfo;\r\n\r\n for (int i = resultSet.getStartLine(); i < maxNbr; i++) {\r\n lineInfo = doc.getLineInformation(i);\r\n // whole line text will be \"replaced\"\r\n int rangeToReplace = lineInfo.getLength();\r\n line = doc.get(lineInfo.getOffset(), rangeToReplace);\r\n if (line == null) {\r\n resultSet.add(null);\r\n continue;\r\n }\r\n sb.append(line);\r\n boolean changed;\r\n if (convertEnabled) {\r\n if (tabsToSpaces) {\r\n changed = TextUtil.convertTabsToSpaces(sb, tabWidth, removeTrailing,\r\n replaceAllTabs, useModulo4Tabs);\r\n } else {\r\n changed = TextUtil.convertSpacesToTabs(sb, tabWidth, removeTrailing,\r\n replaceAllSpaces);\r\n }\r\n } else {\r\n if (!usedOnSave || removeTrailing) {\r\n changed = TextUtil.removeTrailingSpace(sb);\r\n } else {\r\n changed = false;\r\n }\r\n }\r\n\r\n // on the last NON empty line add new line character(s)\r\n if (addLineEnabled && i == maxNbr - 1 && sb.length() != 0) {\r\n String terminator;\r\n if(i - 1 >= 0) {\r\n // use same terminator as line before\r\n terminator = doc.getLineDelimiter(i - 1);\r\n } else {\r\n // use system one, which is not so good...\r\n terminator = System.getProperty(\"line.separator\", null);\r\n }\r\n if(terminator != null) {\r\n sb.append(terminator);\r\n changed = true;\r\n }\r\n }\r\n\r\n if (changed) {\r\n LineReplaceResult result = new LineReplaceResult();\r\n result.rangeToReplace = rangeToReplace;\r\n result.textToReplace = sb.toString();\r\n resultSet.add(result);\r\n } else {\r\n resultSet.add(null);\r\n }\r\n // cleanup\r\n sb.setLength(0);\r\n }\r\n }", "public boolean replaceEdit(UndoableEdit anEdit) {\n throw new UnsupportedOperationException(\"The replaceEdit(UndoableEdit) method is not supported.\");\n }", "public void setReplacement(String pReplacement) {\n replacement = pReplacement;\n }", "public static void main(String[] args) {\n\t\t\n\t\tString s =\"Hello\";\n\t\ts= s.concat(\"How\");\n\t\tSystem.out.println(s);\n\t\ts=s.concat(\"No\");\n\t\tSystem.out.println(s);\n\t\ts=s.replace(\"No\", \"Hello\");\n\t\tSystem.out.println(s);\n\n\n\t}", "private byte[] updateContent(byte[] request) {\n if (replaceFirst()) {\n return Utils.byteArrayRegexReplaceFirst(request, this.match, this.replace);\n } else {\n return Utils.byteArrayRegexReplaceAll(request, this.match, this.replace);\n }\n }", "@Test\n public void testReplacingEmptyString()\n {\n String expectedValue=null,actualValue;\n actualValue=replaceingchar.replaceChar(\" \");\n assertEquals(expectedValue,actualValue);\n }", "private String findReplace(String str, String find, String replace)\n/* */ {\n/* 938 */ String des = new String();\n/* 939 */ while (str.indexOf(find) != -1) {\n/* 940 */ des = des + str.substring(0, str.indexOf(find));\n/* 941 */ des = des + replace;\n/* 942 */ str = str.substring(str.indexOf(find) + find.length());\n/* */ }\n/* 944 */ des = des + str;\n/* 945 */ return des;\n/* */ }" ]
[ "0.63565904", "0.61056453", "0.5991556", "0.59777397", "0.59662485", "0.59548694", "0.5949056", "0.59005237", "0.58470404", "0.57397914", "0.569725", "0.56916803", "0.5644991", "0.5637825", "0.5605717", "0.5579875", "0.5571867", "0.5559455", "0.5558127", "0.55523366", "0.55202574", "0.5475915", "0.5468536", "0.54671526", "0.54404134", "0.5432476", "0.5431505", "0.5406242", "0.53882843", "0.53870034", "0.5380007", "0.53691787", "0.5359375", "0.5352054", "0.53486603", "0.5347168", "0.5345596", "0.53266406", "0.5319979", "0.53135145", "0.5295525", "0.52954495", "0.5289152", "0.5281356", "0.52771175", "0.52579427", "0.5253708", "0.5253222", "0.5251877", "0.524214", "0.52320343", "0.52010834", "0.5194358", "0.51856035", "0.51834226", "0.5180155", "0.5180155", "0.51788074", "0.5175377", "0.51621777", "0.5158769", "0.5150448", "0.5150448", "0.5148133", "0.51420546", "0.5141377", "0.5126082", "0.51240563", "0.51240563", "0.51156193", "0.5115491", "0.5106058", "0.51012886", "0.5094421", "0.5086067", "0.5076952", "0.5073603", "0.50714195", "0.50683415", "0.5065359", "0.50506425", "0.5049031", "0.5033609", "0.50187176", "0.5018631", "0.50107306", "0.5004687", "0.49974626", "0.49817836", "0.4980333", "0.49768746", "0.49734735", "0.49695915", "0.49661162", "0.4960008", "0.49367067", "0.49350816", "0.49323285", "0.49297395", "0.49294397" ]
0.51394427
66
"OK" the command DELETE was performed correctly.
public String DELETE(String name){ this.clientData.remove(name); return "OK"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void operationDelete() {\n\r\n\t\tstatusFeldDelete();\r\n\t}", "private Delete() {}", "private Delete() {}", "@Override\r\n\tpublic String delete() {\n\t\treturn \"delete\";\r\n\t}", "public void delete()\n {\n call(\"Delete\");\n }", "public ResponseTranslator delete() {\n setMethod(\"DELETE\");\n return doRequest();\n }", "String delete(String request) throws RemoteException;", "@Test\n void deleteTest() {\n URI uri = URI.create(endBody + \"/delete\");\n\n // get the response\n HttpResponse<String> response = HttpMethods.delete(uri);\n\n assertEquals(200, response.statusCode());\n }", "public void deleteRequest() {\n assertTrue(true);\n }", "public void testDelete() {\n TDelete_Return[] PriceLists_delete_out = priceListService.delete(new String[] { path + alias });\n\n // test if deletion was successful\n assertEquals(\"delete result set\", 1, PriceLists_delete_out.length);\n\n TDelete_Return PriceList_delete_out = PriceLists_delete_out[0];\n\n assertNoError(PriceList_delete_out.getError());\n\n assertEquals(\"deleted?\", true, PriceList_delete_out.getDeleted());\n }", "@Test\r\n\tpublic void testDelete() {\n\t\tint todos = modelo.getAll().size();\r\n\r\n\t\tassertTrue(modelo.delete(1));\r\n\r\n\t\t// comprobar que este borrado\r\n\t\tassertNull(modelo.getById(1));\r\n\r\n\t\t// borrar un registro que no existe\r\n\t\tassertFalse(modelo.delete(13));\r\n\t\tassertNull(modelo.getById(13));\r\n\r\n\t\tassertEquals(\"debemos tener un registro menos\", (todos - 1), modelo\r\n\t\t\t\t.getAll().size());\r\n\r\n\t}", "@Test\n void deleteSuccess() {\n dao.delete(dao.getById(3));\n assertNull(dao.getById(3));\n }", "@Override\r\n\tpublic int delete() throws Exception {\n\t\treturn 0;\r\n\t}", "@Override\r\n\tpublic int delete(ActionContext arg0) throws Exception {\n\t\treturn 0;\r\n\t}", "void deleteCommand(String commandID);", "public void testDelete() {\n TDelete_Return[] Basket_delete_out = basketService.delete(new String[] { BasketPath });\n assertNoError(Basket_delete_out[0].getError());\n }", "@Test\n void deleteSuccess() {\n dao.delete(dao.getById(2));\n assertNull(dao.getById(2));\n }", "private void delete() {\n\n\t}", "@Override\n public int delete( J34SiscomexOrigemDi j34SiscomexOrigemDi ) {\n return super.doDelete(j34SiscomexOrigemDi);\n }", "@Test\r\n\tpublic void testExecuteCommandsDeleteAdl() throws Exception {\r\n\t\t\r\n\t\tadvertising.executeCommand(advertising, \"adl delete --Name L1-r-medical\");\r\n\t\tassertTrue(\"adc all\", true);\r\n\t\t\r\n\t}", "@DELETE\n\tResponse delete();", "public void deleteMessageTest(){\n\t\tint messageId = 102;\n\t\tgiven()\n\t\t\t.pathParam(\"messageId\", messageId)\n\t\t.when()\n\t\t\t.delete(\"/message/{messageId}\")\n\t\t.then()\n\t\t\t.statusCode(200)\n\t\t\t.body(\"message\", is(\"Message Deleted \"+messageId));\n\t}", "public void delete() {\n\n\t}", "public abstract boolean delete(long arg, Connection conn) throws DeleteException;", "@Test\n public void delete01() {\n Response responseGet = given().\n spec(spec03).\n when().\n get(\"/3\");\n responseGet.prettyPrint();\n\n Response responseDel = given().\n spec(spec03).\n when().\n delete(\"/3\");\n responseDel.prettyPrint();\n\n\n // responseDel yazdirildiginda not found cevabi gelirse status code 404 ile test edilir.\n // Eger bos bir satir donerse status code 200 ile test edilir.\n\n responseDel.\n then().\n statusCode(200);\n\n\n // hard assert\n\n assertTrue(responseDel.getBody().asString().contains(\" \"));\n\n // soft assertion\n\n SoftAssert softAssert = new SoftAssert();\n softAssert.assertTrue(responseDel.getBody().asString().contains(\" \"));\n softAssert.assertAll();\n }", "@Override\n\tpublic String delete() throws Exception {\n\t\treturn null;\n\t}", "public abstract void delete(int msg);", "@Override\n\tpublic void delete(String arg0) {\n\t\t\n\t}", "@org.junit.Test\r\n public void testDelete() {\r\n System.out.println(\"delete\");\r\n String emailid = \"dnv3@gmail.com\";\r\n ContactDao instance = new ContactDao();\r\n List<ContactResponse> expResult = new ArrayList<ContactResponse>();\r\n ContactResponse c = new ContactResponse(\"Contact Deleted\");\r\n expResult.add(c);\r\n List<ContactResponse> result = instance.delete(emailid);\r\n String s=\"No such contact ID found\";\r\n if(!result.get(0).getMessage().equals(s))\r\n assertEquals(expResult.get(0).getMessage(), result.get(0).getMessage());\r\n // TODO review the generated test code and remove the default call to fail.\r\n }", "public void delete(String so_cd);", "@Override\n\tpublic void delete(String query) {\n\t\t\n\t}", "private CommandResult executeDeleteCommand(Command userCommand) {\n int taskNumber;\n String deletedTask;\n try {\n taskNumber = Integer.parseInt(userCommand.getCommandDescription());\n deletedTask = tasks.get(taskNumber - 1).toString();\n tasks.remove(taskNumber - 1);\n } catch (NumberFormatException | IndexOutOfBoundsException e) {\n return new CommandResult(userCommand, CommandResult.EXECUTION_FAIL, CommandResult.INVALID_NUMBER);\n }\n return new CommandResult(userCommand, CommandResult.EXECUTION_SUCCESS, deletedTask);\n }", "@DELETE\n public void delete() {\n }", "@DELETE\n public void delete() {\n }", "@Override\n public int delete(String arg0) {\n return 0;\n }", "@DELETE\n public void delete() {\n }", "@Test\n\tpublic void testDeleteCorrectParamNoDeletePb() {\n\t\tfinal String owner = \"1\";\n\t\tfinal Long piiUniqueId = (long) 12345789;\n\t\t\n\t\tPiiDeleteRequest piiRequest = new PiiDeleteRequest();\n\t\tpiiRequest.setOwner(owner);\n\t\tpiiRequest.setPiiUniqueId(piiUniqueId);\n\t\t\n\t\tPiiDeleteResponse piiDeleteResponse = new PiiDeleteResponse();\n\t\tpiiDeleteResponse.setDeleted(true);\n\t\twhen(mPiiService.delete(piiRequest)).thenReturn(piiDeleteResponse);\n\t\t\n\t\tResponse response = piiController.delete(piiRequest);\n\t\t\n\t\tverify(mPiiService).delete(piiRequest);\n\t\tverifyZeroInteractions(mPuidDao);\n\t\tassertEquals(200, response.getStatus());\n\t\t\n\t\tPiiDeleteResponse returnedResponse = (PiiDeleteResponse) response.getEntity();\n\t\tassertTrue(returnedResponse.isDeleted());\n\t}", "public int delete( Integer idConge ) ;", "protected boolean afterDelete() throws DBSIOException{return true;}", "@SmallTest\n public void testDelete() {\n int result = -1;\n if (this.entity != null) {\n result = (int) this.adapter.remove(this.entity.getId());\n Assert.assertTrue(result >= 0);\n }\n }", "protected abstract void doDelete();", "public boolean delete(T data) throws MIDaaSException;", "@Override\n\tpublic String Delete(String[] args) throws RemoteException {\n\t\tSystem.out.println(\"Trying to Delete with args: \" + args[2]);\n\t\treturn null;\n\t}", "void delete() throws ClientException;", "void onDELETEFinish(String result, int requestCode, boolean isSuccess);", "public int delete( Conge conge ) ;", "@Test\n public void deleteTest() throws SQLException {\n manager = new TableServizioManager(mockDb);\n manager.delete(1);\n Servizio servizio= manager.retriveById(1);\n assertNull(servizio,\"Should return true if delete Servizio\");\n }", "@Override\n\tpublic int delete(Uri uri, String selection, String[] selectionArgs) {\n\t\treturn 0;\n\t}", "@Override\n\tpublic int delete(Uri uri, String selection, String[] selectionArgs) {\n\t\treturn 0;\n\t}", "@Override\n\tpublic int delete(Uri uri, String selection, String[] selectionArgs) {\n\t\treturn 0;\n\t}", "@Override\n\tpublic int delete(Uri uri, String selection, String[] selectionArgs) {\n\t\treturn 0;\n\t}", "@Test\n void deleteSuccess() {\n genericDAO.delete(genericDAO.getByID(2));\n assertNull(genericDAO.getByID(2));\n }", "@Override\r\n\tpublic int delete(Uri arg0, String arg1, String[] arg2) {\n\t\treturn 0;\r\n\t}", "@Override\n\tpublic int delete(Uri arg0, String arg1, String[] arg2) {\n\t\treturn 0;\n\t}", "@Override\n\tpublic int delete(Uri arg0, String arg1, String[] arg2) {\n\t\treturn 0;\n\t}", "@DELETE\n @Path(\"/remove\")\n public void delete() {\n System.out.println(\"DELETE invoked\");\n }", "boolean delete();", "public void delete()\n\t{\n\t\t_Status = DBRowStatus.Deleted;\n\t}", "int delete(String clientId);", "private void doDeleteSong() {\n int result = dbHelper.deleteSong(selectedSong.getId());\n Log.d(TAG + \"in doDeleteSong\", \"Result > \" + result);\n\n // Check Status\n if (result == 1) {\n Toast.makeText(this, \"Successfully deleted the song\", Toast.LENGTH_SHORT).show();\n } else {\n Toast.makeText(this, \"Failed to delete the song\", Toast.LENGTH_SHORT).show();\n }\n }", "public void delete() {\n\n }", "private void deleteRequest() {\n\t\tboolean res = false;\n\t\tMessage messageToServer = new Message();\n\t\tmessageToServer.setMsg(req.getEcode());\n\t\tmessageToServer.setOperation(\"DeleteRequest\");\n\t\tmessageToServer.setControllerName(\"PrincipalController\");\n\t\tres = (boolean) ClientUI.client.handleMessageFromClientUI(messageToServer);\n\t\tif (res) {\n\t\t\t// success pop up\n\t\t\tTheRequestWasHandledSuccessfullyWindowController popUp = new TheRequestWasHandledSuccessfullyWindowController();\n\t\t\ttry {\n\t\t\t\tpopUp.start(new Stage());\n\t\t\t} catch (Exception e) {\n\t\t\t\tUsefulMethods.instance().printException(e);\n\t\t\t}\n\t\t} else {\n\t\t\tUsefulMethods.instance().display(\"error in deleting request!\");\n\t\t}\n\t}", "@Test\n void deleteSuccess() {\n genericDao.delete(genericDao.getById(3));\n assertNull(genericDao.getById(3));\n }", "@Test\n public void testDelete() throws Exception {\n // pretend the entity was deleted\n doNothing().when(Service).deleteCitation(any(String.class));\n\n // call delete\n ModelAndView mav = Controller.delete(\"\");\n\n // test to see that the correct view is returned\n Assert.assertEquals(\"result\", mav.getViewName());\n\n // test to see that Json is formated properly\n Map<String, Object> map = mav.getModel();\n String result = (String) map.get(\"message\");\n\n Assert.assertEquals(\"{\\\"result\\\":\\\"deleted\\\"}\", result);\n }", "public void test_03() {\n\n\t\tResponse reponse = given().\n\t\t\t\twhen().\n\t\t\t\tdelete(\"http://localhost:3000/posts/_3cYk0W\");\n\n\t\tSystem.out.println(\"updated response data \"+ reponse.asString());\t\t\n\t}", "@Override\n public CompletableFuture<Void> delete() {\n return delete(false);\n }", "boolean hasDelete();", "boolean hasDelete();", "@Test\r\n public void testDelete() {\r\n System.out.println(\"delete\");\r\n String doc = \"\";\r\n IwRepoDAOMarkLogicImplStud instance = new IwRepoDAOMarkLogicImplStud();\r\n boolean expResult = false;\r\n boolean result = instance.delete(doc);\r\n assertEquals(expResult, result);\r\n // TODO review the generated test code and remove the default call to fail.\r\n fail(\"The test case is a prototype.\");\r\n }", "public void delete(){\r\n\r\n }", "public boolean delete();", "@Override\n\tpublic void delete(CorsoDiLaurea corso) {\n\t\t\n\t}", "public void testDelete() {\n\t\ttry {\n\t\t\tServerParameterTDG.create();\n\n\t\t\t// insert\n\t\t\tServerParameterTDG.insert(\"paramName\", \"A description\", \"A value\");\n\t\t\t// delete\n\t\t\tassertEquals(1, ServerParameterTDG.delete(\"paramName\"));\n\t\t\t\t\n\t\t\tServerParameterTDG.drop();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\tfail();\t\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tServerParameterTDG.drop();\n\t\t\t} catch (SQLException e) {\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic int delete() {\n\t\treturn 0;\n\t}", "@Test\n final void testDeleteDevice() {\n when(deviceDao.deleteDevice(user, DeviceFixture.SERIAL_NUMBER)).thenReturn(Long.valueOf(1));\n ResponseEntity<String> response = deviceController.deleteDevice(DeviceFixture.SERIAL_NUMBER);\n assertEquals(200, response.getStatusCodeValue());\n assertEquals(\"Device with serial number 1 deleted\", response.getBody());\n }", "@Test\n\tpublic void testDeleteCorrectParamDeletePb() {\n\t\tfinal String owner = \"1\";\n\t\tfinal Long piiUniqueId = (long) 12345789;\n\t\t\n\t\tPiiDeleteRequest piiRequest = new PiiDeleteRequest();\n\t\tpiiRequest.setOwner(owner);\n\t\tpiiRequest.setPiiUniqueId(piiUniqueId);\n\t\t\n\t\tPiiDeleteResponse piiDeleteResponse = new PiiDeleteResponse();\n\t\tpiiDeleteResponse.setDeleted(false);\n\t\twhen(mPiiService.delete(piiRequest)).thenReturn(piiDeleteResponse);\n\t\t\n\t\tResponse response = piiController.delete(piiRequest);\n\t\t\n\t\tverify(mPiiService).delete(piiRequest);\n\t\tverifyZeroInteractions(mPuidDao);\n\t\tassertEquals(200, response.getStatus());\n\t\t\n\t\tPiiDeleteResponse returnedResponse = (PiiDeleteResponse) response.getEntity();\n\t\tassertFalse(returnedResponse.isDeleted());\n\t}", "@Override\n\tpublic void delete(String code) {\n\n\t}", "public String delete() {\r\n\t\tVendorMasterModel model = new VendorMasterModel();\r\n\t\tmodel.initiate(context, session);\r\n\t\tboolean result = model.delete(vendorMaster);\r\n\t\tif (result) {\r\n\t\t\taddActionMessage(\"Record Deleted Successfully.\");\r\n\t\t\treset();\r\n\t\t}// end of if\r\n\t\telse {\r\n\t\t\taddActionMessage(\"This record is referenced in other resources.So can't delete.\");\r\n\t\t\treset();\r\n\t\t}// end of else\r\n\t\tmodel.Data(vendorMaster, request);\r\n\t\tmodel.terminate();\r\n\t\tgetNavigationPanel(1); \r\n\t\treturn \"success\";\r\n\t}", "@Override\n public int delete( J34SiscomexMercadoriaAdi j34SiscomexMercadoriaAdi ) {\n return super.doDelete(j34SiscomexMercadoriaAdi);\n }", "@Test\n void deleteSuccess() {\n\n UserDOA userDao = new UserDOA();\n User user = userDao.getById(1);\n String orderDescription = \"February Large Test-Tshirt Delete\";\n\n Order newOrder = new Order(orderDescription, user, \"February\");\n user.addOrder(newOrder);\n\n dao.delete(newOrder);\n List<Order> orders = dao.getByPropertyLike(\"description\", \"February Large Test-Tshirt Delete\");\n assertEquals(0, orders.size());\n }", "@Override\n\tpublic boolean delete(Message entity) throws SQLException {\n\t\treturn false;\n\t}", "private CommandResult deleteLesson() throws KolinuxException {\n timetable.executeDelete(parsedArguments);\n logger.log(Level.INFO, \"User has deleted\" + parsedArguments[0].toUpperCase()\n +\n \" from the timetable.\");\n return new CommandResult(parsedArguments[0].toUpperCase()\n +\n \" \" + parsedArguments[1].toUpperCase() + \" \" + parsedArguments[3] + \" \"\n +\n parsedArguments[2].toLowerCase()\n +\n \" has been deleted from timetable\");\n }", "@Override\n\tpublic void delete(String id) throws Exception {\n\n\t}", "public String delete1() throws Exception {\r\n\t\tString code[] = request.getParameterValues(\"hdeleteCode\");\r\n\t\tVendorMasterModel model = new VendorMasterModel();\r\n\t\tmodel.initiate(context, session);\r\n\t\tboolean result = model.deletecheckedRecords(vendorMaster, code);\r\n\t\tif (result) {\r\n\t\t\taddActionMessage(getText(\"delMessage\", \"\"));\r\n\t\t}// end of if\r\n\t\telse {\r\n\t\t\taddActionMessage(\"One or more records can't be deleted \\n as they are associated with some other records. \");\r\n\t\t}// end of else\r\n\r\n\t\tmodel.Data(vendorMaster, request);\r\n\t\tmodel.terminate();\r\n\t\treset();\r\n\t\tgetNavigationPanel(1);\r\n\t\treturn \"success\";\r\n\r\n\t}", "@Override\r\n public int delete(Uri uri, String where, String[] whereArgs) {\n return 0;\r\n }", "@Override\n\tpublic void delete(String... args) throws SQLException {\n\t\t\n\t}", "@Override\n\tpublic boolean delete(int rno) {\n\t\treturn replyMapper.delete(rno)>0?true:false;\n\t}", "@DISPID(13)\n\t// = 0xd. The runtime will prefer the VTID if present\n\t@VTID(23)\n\tboolean deleted();", "public int delete(o dto);", "@Override\n\tpublic void delete(Integer arg0) {\n\t\t\n\t}", "@Override\n\tpublic void delete() {\n\n\t}", "@Test\n\t@Override\n\tpublic void testDeleteObjectOKJson() throws Exception {\n\t}", "@Test\r\n public void testDelete() {\r\n assertTrue(false);\r\n }", "@Override\n\tpublic void delete() {\n\t\tSystem.out.println(\"no goin\");\n\t\t\n\t}", "@Test\r\n\tpublic void checkDeleteTest() {\n\t\tassertFalse(boardService.getGameRules().checkDelete(board.field[13][13])); \r\n\t}", "@Test\n public void delete01(){\n Response responseGet=given().\n spec(spec03).\n when().\n get(\"/198\");\n responseGet.prettyPrint();\n //delete islemi\n Response responseDel =given().\n spec(spec03).\n when().\n delete(\"/198\");\n responseDel.prettyPrint();\n //responseDel yazdirildiginda \"Not Found\" cevabi gelirse status code 404 ile test edilir. Eger bos bir\n // satir donerse Ststus code 200 ile test edilir.\n responseDel.then().assertThat().statusCode(200);\n // Hard assert\n assertTrue(responseDel.getBody().asString().contains(\"\"));\n //softAssertion\n SoftAssert softAssert = new SoftAssert();\n softAssert.assertTrue(responseDel.getBody().asString().contains(\"\"));\n softAssert.assertAll();\n\n\n }", "@Override\n\tpublic void delete(Object entidade) {\n\t\t\n\t}", "@Override\n\tpublic int delete(ReplyVO vo) throws Exception {\n\t\tlog.info(\"delete().vo : \" + vo);\n\t\treturn mapper.delete(vo);\n\t}", "@Test\r\n public void testDelete() throws PAException {\r\n Ii spIi = IiConverter.convertToStudyProtocolIi(TestSchema.studyProtocolIds.get(0));\r\n List<StudyDiseaseDTO> dtoList = bean.getByStudyProtocol(spIi);\r\n int oldSize = dtoList.size();\r\n Ii ii = dtoList.get(0).getIdentifier();\r\n bean.delete(ii);\r\n dtoList = bean.getByStudyProtocol(spIi);\r\n assertEquals(oldSize - 1, dtoList.size());\r\n }", "@Test\n\tpublic void deleteBook() {\n\t\tRestAssured.baseURI = \"http://216.10.245.166\";\n\t\t given().log().all().queryParam(\"ID\", \"321wergt\")\n\t\t\t\t.header(\"Content-Type\", \"application/json\").when()\n\t\t\t\t.delete(\"/Library/DeleteBook.php\").then().log().all()\n\t\t\t\t.assertThat().statusCode(200);\n\n\t\n\t /*JsonPath js = new JsonPath(response); \n\t String id = js.get(\"ID\");\n\t System.out.println(id);*/\n\t \n\t }", "@Override\n\t\tpublic void delete() {\n\n\t\t}" ]
[ "0.7458007", "0.72884077", "0.72884077", "0.7278334", "0.7261688", "0.7240369", "0.7236956", "0.7221598", "0.7178083", "0.70730555", "0.70717", "0.70500326", "0.70489645", "0.7038252", "0.7023407", "0.70165086", "0.7012192", "0.7008638", "0.6987187", "0.6985209", "0.6983802", "0.69455475", "0.6932029", "0.6920136", "0.69134754", "0.6912745", "0.6905805", "0.6904441", "0.6898218", "0.6894952", "0.68823045", "0.68742114", "0.6863048", "0.6863048", "0.68500435", "0.68458337", "0.6836755", "0.68229264", "0.681456", "0.6804016", "0.67971265", "0.6792679", "0.6788559", "0.67838085", "0.67807925", "0.6766877", "0.6762129", "0.6758823", "0.6758823", "0.6758823", "0.6758823", "0.6757381", "0.67547095", "0.6754603", "0.6754603", "0.6750314", "0.6742405", "0.67422265", "0.67384875", "0.67329574", "0.67251784", "0.6724528", "0.67144257", "0.67116106", "0.6709554", "0.67058873", "0.67030996", "0.67030996", "0.66984963", "0.6697073", "0.66941637", "0.66904205", "0.6688069", "0.6683702", "0.667403", "0.6672212", "0.6671335", "0.6667065", "0.6665979", "0.6664353", "0.6660472", "0.66600585", "0.6650208", "0.66490835", "0.6643324", "0.66429114", "0.6639895", "0.66373", "0.6628621", "0.66230154", "0.6622356", "0.66209376", "0.66206145", "0.66198075", "0.6615141", "0.6608652", "0.6607588", "0.66036326", "0.6591677", "0.6584382", "0.6583387" ]
0.0
-1
"OK name1 name2 ..." the LIST command was performed correctly. The message contains a list of names of people remembered in the collection.
public String LIST(){ String nameList = ""; Enumeration keys = this.clientData.keys(); while(keys.hasMoreElements()){ nameList += keys.nextElement() + " "; } return "OK " + nameList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "edu.usfca.cs.dfs.StorageMessages.List getList();", "void handle_note_list(LinkedList<Object> args) {\n args.clear();\n args.add(\"note_list\");\n try {\n rsl = sql.executeQuery(\"SELECT note_name FROM data \" +\n \"WHERE user_id=\" + userid);\n String note_name;\n args.add(\"yes\");\n while (rsl.next()) {\n note_name = rsl.getString(1);\n args.add(note_name);\n }\n } catch (Exception e) {\n e.printStackTrace();\n args.add(1, \"no\");\n args.add(2, e.toString());\n }\n }", "public Wrapper listNames() {\n Wrapper<List<HashMap<String, String>>> wrapper = new Wrapper();\n try {\n List<String> userListIds = user.getWordLists();\n List<HashMap<String, String>> listNames = new ArrayList<HashMap<String, String>>();\n\n for (String stringId : userListIds) {\n ObjectId id = new ObjectId(stringId);\n WordList wl = mongoOperations.findById(id, WordList.class, \"entries\");\n\n HashMap<String, String> object = new HashMap<>();\n object.put(\"name\", wl.getName());\n object.put(\"id\", wl.getId());\n listNames.add(object);\n }\n\n wrapper.setData(listNames);\n wrapper.setSucces(true);\n } catch (Exception e) {\n wrapper.setSucces(false);\n wrapper.setMsg(e.toString());\n }\n\n return wrapper;\n }", "public String showList() {\n String listMessage = \"Here yer go! These are all your tasks!\";\n return listMessage;\n }", "public final synchronized String list()\r\n { return a_info(true); }", "@Override\n public String getName() {\n return \"list\";\n }", "public void getUserNames(){\n //populate all the usernames in here\n if(dbConnection.ConnectDB()){\n //we are connected to the database\n //get the userList from the database\n if(this.dbConnection.populateUserList()){\n //the list was created by the database method \n this.userNames = this.dbConnection.getUserNames();\n \n }\n }else{\n System.out.println(\"Connected to database\");\n \n }\n }", "@Override\n\tpublic String list() throws Throwable {\n\t\treturn SUCCESS;\n\t}", "void showWaitingPlayerList(List<String> waitingPlayerUsernames);", "Collection<String> getUsernames();", "private List<String> getListOfAuthorizedByName(\n List<String> names,\n String username,\n ResponseToFailedAuthorization failureResponse,\n AccessLevel accessLevel,\n Session session,\n String securedQuery,\n String openAndSecuredQuery,\n String returnVarName,\n String securedParamListName,\n String openParamListName)\n throws Exception {\n\n // Need to avoid sending same name multiple times.\n names = uniquifyNames(names);\n\n String queryStr;\n if ( accessLevel == AccessLevel.View ) {\n queryStr = openAndSecuredQuery.replace( PROJ_GRP_SUBST_STR, VIEW_PROJECT_GROUP_FIELD );\n }\n else {\n queryStr = securedQuery.replace( PROJ_GRP_SUBST_STR, EDIT_PROJECT_GROUP_FIELD );\n }\n NativeQuery query = session.createNativeQuery( queryStr );\n query.addScalar(returnVarName, StandardBasicTypes.STRING );\n\n query.setParameterList( securedParamListName, names );\n if ( accessLevel == AccessLevel.View ) {\n query.setParameterList( openParamListName, names );\n }\n String queryUsername = username == null ? UNLOGGED_IN_USER : username;\n query.setParameter( USERNAME_PARAM, queryUsername );\n\n List<String> rtnVal = query.list();\n if ( failureResponse == ResponseToFailedAuthorization.ThrowException &&\n rtnVal.size() < names.size() ) {\n\n String nameStr = joinNameList(names);\n String message = makeUserReadableMessage( username, nameStr );\n logger.error( message );\n throw new ForbiddenResourceException( message );\n }\n\n return rtnVal;\n }", "edu.usfca.cs.dfs.StorageMessages.ListResponse getListResponse();", "java.util.List<Res.Msg>\n getMsgList();", "public List<String> nicknames();", "private void fillUserList(UserListMessage msg)\n {\n allUsers = msg.getUsers();\n String userListText = \"Connected users:\\n\";\n\n for (String user : allUsers)\n {\n if(user.equals(nickname))\n userListText += user + \" (YOU)\\n\";\n else\n userListText += user + \"\\n\";\n }\n ChatGUI.getInstance().getUserList().setText(userListText);\n }", "public void receiveResultRenameHistoryListMessage(\r\n\t\t\tcom.autometrics.analytics.v9.j2ee.webservices.v1_0.RenameHistoryListMessageResponse result) {\r\n\t}", "public void testLst() {\n System.out.println(\"\");\n EcgCheck chk = EcgCheck.getInstance();\n System.out.println(\" Show TEstlist\");\n\n mail_lst.forEach(m -> {\n System.out.println(\"[\" + new String(chk.sha(m.getBytes())) + \"]\");\n });\n }", "public void viewList() {\n\t\tSystem.out.println(\"Your have \" + contacts.size() + \" contacts:\");\n\t\tfor (int i=0; i<contacts.size(); i++) {\n\t\t\tSystem.out.println((i+1) + \". \" \n\t\t\t\t\t+ contacts.get(i).getName() + \" number: \" \n\t\t\t\t\t+ contacts.get(i).getPhoneNum());\n\t\t}\n\t}", "java.util.List<io.dstore.engine.Message> \n getMessageList();", "java.util.List<io.dstore.engine.Message> \n getMessageList();", "java.util.List<io.dstore.engine.Message> \n getMessageList();", "java.util.List<io.dstore.engine.Message> \n getMessageList();", "java.util.List<io.dstore.engine.Message> \n getMessageList();", "edu.usfca.cs.dfs.StorageMessages.ListOrBuilder getListOrBuilder();", "public void displayUSerList(List<User> userList) {\n for (User currentUser : userList) {\n String userInfo = \"\"; \n \n userInfo = currentUser.getUserId()+\" \"+currentUser.getName();\n for(String s : currentUser.getBorrowedItem()){\n userInfo = userInfo + s; \n }\n \n\n\n\n io.print(userInfo);\n }\n io.readString(\"Please hit enter to continue.\");\n }", "public Vector<String> list(){\n\t\ttry\n\t\t{\n\t\t\tif( sock.isConnected() )\n\t\t\t{\n\t\t\t\t// send K{LIST} to server\n\t\t\t\tOutputStream sout = sock.getOutputStream();\t\t\t\t\n\t\t\t\tByteArrayOutputStream out = new ByteArrayOutputStream();\n\t\t\t\tHashHelper.WriteInt(out, LIST);\n\t\t\t\tCryptoHelper ch = new CryptoHelper();\n\t\t\t\tbyte[] msg = ch.symEncrypt(symK, out.toByteArray());\n\t\t\t\tout = new ByteArrayOutputStream();\n\t\t\t\tHashHelper.WriteInt(out, msg.length);\n\t\t\t\tout.write(msg);\n\t\t\t\tsout.write(out.toByteArray());\n\t\t\t\t\n\t\t\t\t// receive K{list of users} from server\n\t\t\t\tDataInputStream dis = new DataInputStream(sock.getInputStream());\n\t\t\t\t\n\t\t\t\t// read the message encrypted with the symmetric key\n\t\t\t\tbyte[] msgiv = new byte[HashHelper.ReadInt(dis)];\n\t\t\t\tdis.readFully(msgiv);\n\t\t\t\t\n\t\t\t\t// Decrypt the message\n\t\t\t\tByteArrayInputStream bais = new ByteArrayInputStream(msgiv);\n\t\t\t\tDataInputStream dis2 = new DataInputStream(bais);\n\t\t\t\tbyte[] iv = new byte[HashHelper.ReadInt(dis2)];\n\t\t\t\tdis2.readFully(iv);\n\t\t\t\tbyte[] msg_en = new byte[HashHelper.ReadInt(dis2)]; \n\t\t\t\tdis2.readFully(msg_en);\n\t\t\t\tbyte[] msg1 = ch.symDecrypt(symK, iv, msg_en);\n\t\t\t\t\n\t\t\t\tbais = new ByteArrayInputStream(msg1);\n\t\t\t\tObjectInputStream deserializer = new ObjectInputStream(bais);\n\t\t\t\tVector<String> userList = (Vector<String>) deserializer.readObject();\n\t\t\t\treturn userList;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tSystem.out.println(\"Request failed\");\n\t\t\treturn null;\n\t\t}\n\t}", "private void updateUserList() {\n\t\tUser u = jdbc.get_user(lastClickedUser);\n\t\tString s = String.format(\"%s, %s [%s]\", u.get_lastname(), u.get_firstname(), u.get_username());\n\t\tuserList.setElementAt(s, lastClickedIndex);\n\t}", "java.util.List<com.ljzn.grpc.personinfo.PersoninfoMessage> \n getPersonInfoList();", "void showWaitingRoom(ArrayList<String> usernames);", "java.util.List<protocol.Data.Friend.FriendItem> \n getFriendList();", "com.google.protobuf.ProtocolStringList\n getListList();", "private CommandResult executeListCommand(Command userCommand) {\n return new CommandResult(userCommand, CommandResult.EXECUTION_SUCCESS, CommandResult.BLANK_DESCRIPTION);\n }", "List<CommandInfo> list();", "FriendList.Rsp getFriendlistRes();", "public static void printToScreen(List<String> list1){\n\t\tJOptionPane.showMessageDialog(null, \"ArrayList has \" + list1.size() + \" Names\");\n\t\tJOptionPane.showMessageDialog(null, \"Here is the List \" + list1);\n\t}", "protected void messageList() {\r\n\t\tif (smscListener != null) {\r\n\t\t\tmessageStore.print();\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"You must start listener first.\");\r\n\t\t}\r\n\t}", "java.util.List<People>\n getUserList();", "public synchronized String list(String name) {\n\t\tString result = \"\";\n\t\tboolean found = false;\n\t\tfor (Record r : record) {\n\t\t\tif (r.student.equals(name)) {\n\t\t\t\tfound = true;\n\t\t\t\tresult = result + r.ID + \" \" + r.book + \"*\";\n\t\t\t}\n\t\t}\n\t\tif (!found) {\n\t\t\tresult = \"No record found for \" + name;\n\t\t}\n\t\treturn result;\n\t}", "public UserList list();", "public String[] list(String text, String von, String bis) throws RemoteException;", "public String getLists(String name){\n return \"\";\n }", "private ArrayList<String> getNames() {\n\t\tNameDialog n = new NameDialog();\n\t\tnameList = new ArrayList<String>();\n\t\ttry {\n\t\t\tnameList = n.getNames(inputs[1]);\n\t\t}catch(GameException ex) {\n\t\t\tview.close();\n\t\t\tmenuStage.show();\n\t\t}\n\t\treturn nameList;\n\t}", "public void listGroup() {\r\n List<Group> groupList = groups;\r\n EventMessage evm = new EventMessage(\r\n EventMessage.EventAction.FIND_MULTIPLE,\r\n EventMessage.EventType.OK,\r\n EventMessage.EventTarget.GROUP,\r\n groupList);\r\n notifyObservers(evm);\r\n }", "java.util.List<java.lang.String> getContentsList();", "POGOProtos.Rpc.GetFriendsListOutProto.Result getResult();", "public boolean hasList() {\n return msgCase_ == 5;\n }", "java.util.List<Rsp.Msg>\n getMsgList();", "public List<User> list(String currentUsername);", "java.lang.String listMessageCounter() throws java.lang.Exception;", "public void sendList(String msg, int count) {\n\t\t\toutput.println((count + 1) + \". \" + msg);\n\t\t}", "public static String listplaylists() { \r\n MPDRequest mpdRequest = new MPDRequest(LISTPLAYLISTS);\r\n return mpdRequest.getRequest();\r\n }", "public String memberList() {\n\treturn roomMembers.stream().map(id -> {\n\t try {\n\t\treturn api.getUserById(id).get().getNicknameMentionTag();\n\t } catch (InterruptedException | ExecutionException e) {\n\t\te.printStackTrace();\n\t }\n\t return \"\";\n\t}).collect(Collectors.joining(\"\\n\"));\n }", "public String getName() {\n return list;\n }", "java.util.List<POGOProtos.Rpc.GetFriendsListOutProto.FriendProto> \n getFriendList();", "public boolean hasList() {\n return msgCase_ == 5;\n }", "public String list() {\n final StringBuilder list = new StringBuilder(\"Here are the tasks in your list:\\n\\t\");\n records.forEach((el) -> list.append(\n String.format(\"%1$d. %2$s \\n\\t\",\n records.indexOf(el) + 1, el.toString())));\n return list.toString();\n }", "public String getName() {\r\n return listName;\r\n }", "public void listMessages() {\n\t\tSystem.out.println(\"== The wall of \" + name + \" ==\");\n\t\tfor(String msg : messages)\n\t\t{\n\t\t\tSystem.out.println(msg);\n\t\t}\n\t}", "public synchronized void sendUserList()\n {\n String userString = \"USERLIST#\" + getUsersToString();\n for (ClientHandler ch : clientList)\n {\n ch.sendUserList(userString);\n }\n }", "public edu.usfca.cs.dfs.StorageMessages.List getList() {\n if (listBuilder_ == null) {\n if (msgCase_ == 5) {\n return (edu.usfca.cs.dfs.StorageMessages.List) msg_;\n }\n return edu.usfca.cs.dfs.StorageMessages.List.getDefaultInstance();\n } else {\n if (msgCase_ == 5) {\n return listBuilder_.getMessage();\n }\n return edu.usfca.cs.dfs.StorageMessages.List.getDefaultInstance();\n }\n }", "public String[] listUsers();", "public void onFriendListReceived(String erroMessage);", "public void printList(){\n\t\tfor(User u : userList){\r\n\t\t\tSystem.out.println(\"Username: \" + u.getUsername() + \" | User ID: \" + u.getUserID() + \" | Hashcode: \" + u.getHashcode() + \" | Salt: \" + u.getSalt());\r\n\t\t}\r\n\t}", "public void mem_list() {\n synchronized(chat_room) {\n Set id_set = cur_chat_room.keySet();\n Iterator iter = id_set.iterator();\n clearScreen(client_PW);\n client_PW.println(\"------------online member-----------\");\n while(iter.hasNext()) {\n String mem_id = (String)iter.next();\n if(mem_id != client_ID) {\n client_PW.println(mem_id);\n }\n }\n client_PW.flush();\n }\n }", "public ListCmd(String argumentInput) {\n super(CommandType.LIST, argumentInput);\n }", "public HashMap<String, Object> sendListFacilityNames(){\n\t\tHashMap<String, Object> request = new HashMap<String, Object>();\n\t\trequest.put(\"service_type\", Constants.LIST_FACILITY);\n\t\t\n\t\treturn this.sendRequest(request);\n\t}", "public void printClientList(){\n for(String client : clientList){\n System.out.println(client);\n }\n System.out.println();\n }", "public String listUsers(){\n \tStringBuilder sb = new StringBuilder();\n \tif(users.isEmpty()){\n \t\tsb.append(\"No existing Users yet\\n\");\n \t}else{\n \t\tsb.append(\"Meeting Manager Users:\\n\");\n \t\tfor(User u : users){\n \t\t\tsb.append(\"*\"+u.getEmail()+\" \"+ u.getPassword()+\" \\n\"+u.listInterests()+\"\\n\");\n \t\t}\n \t}\n \treturn sb.toString();\n }", "public void chat_list() {\n\n synchronized(chat_room) {\n Set chat_room_set = chat_room.keySet();\n Iterator iter = chat_room_set.iterator();\n\n clearScreen(client_PW);\n client_PW.println(\"------------Chat Room List-----------\");\n while(iter.hasNext()) {\n client_PW.println(iter.next());\n }\n client_PW.flush();\n }\n }", "Collection<String> getVoicedCommandList();", "java.util.List<People>\n getFriendListList();", "private void responseMonitor(List<User> returnedUsers, User returnedUserFromEdit){\n String USER_NAME= returnedUserFromEdit.getName();\n String USER_EMAIL = returnedUserFromEdit.getEmail();\n Long UserID = returnedUserFromEdit.getId();\n Toast.makeText(this,getString(R.string.returned)+ USER_NAME+ \" , \"+ USER_EMAIL+\" , \"+ UserID,Toast.LENGTH_LONG).show();\n }", "public void setListName(java.lang.String listName) {\r\n this.listName = listName;\r\n }", "public void afficherReclamationAdmin(ObservableList<Reclamation> oblist1){\n try {\n PreparedStatement pt1 = c.prepareStatement(\"SELECT id_r, message, etat, date_rec, reponse, prenom, nom FROM reclamation, user where idch=id_u and etat != 'Archivée'\");\n ResultSet rs = pt1.executeQuery();\n while (rs.next()) {\n String fetch = rs.getString(\"prenom\")+\" \"+rs.getString(\"nom\");\n System.out.println(rs.getString(\"reponse\"));\n oblist1.add(new Reclamation(rs.getInt(\"id_r\"), rs.getString(\"message\"), rs.getString(\"etat\"), rs.getString(\"date_rec\"), rs.getString(\"reponse\"), fetch));\n }\n } catch (SQLException ex) {\n Logger.getLogger(ReclamationCRUD.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "private void list() throws JSONException, InterruptedException {\r\n\t /**Database Manager Object used to access mlab.com*/\r\n db.setDataBaseDestination(cDatabase, null, true);\r\n db.accessDatabase();\r\n MongoCollection<Document> col = db.getEntireDatabaseResults();\r\n \r\n // iterator to go through clubs in database\r\n Iterable<Document> iter;\r\n iter = col.find();\r\n \r\n // ArrayList of clubs names \r\n ArrayList<String> clubs = new ArrayList<>();\r\n \r\n // add names to list\r\n for (Document doc : iter) {\r\n JSONObject profile = new JSONObject(doc);\r\n clubs.add(profile.get(cName).toString());\r\n }\r\n \r\n Collections.sort(clubs);\r\n \r\n for (String name : clubs)\r\n \t logger.log(Level.INFO, name);\r\n \r\n displayOpen();\r\n }", "public void receiveUsernames() throws Exception{\n BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n String serverMsg = in.readLine();\n while (!serverMsg.equals(\"END\")){\n users.add(serverMsg);\n notifyObservers(ObserverEnum.ADD, serverMsg);\n serverMsg = in.readLine();\n }\n }", "com.example.nettyserver.protobuf.Employee.EmployeeInfo getEmployeelist();", "private void updateLists(){\n subjects.clear();\n for(Message m : user.getMessages()){\n subjects.add(String.format(\"From - %-\" + (40 - m.getFrom().length()) +\"s %20s\", m.getFrom(), m.getTimestamp().substring(0,16)));\n }\n listViewAdapter.notifyDataSetChanged();\n }", "public void getRecentNames() {\r\n try {\r\n URLConnection conn = new URL(\"http://example.com/recent?ssid=\" + session_slot_id).openConnection();\r\n conn.setConnectTimeout(5000);\r\n conn.setReadTimeout(5000);\r\n BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));\r\n String line;\r\n while ((line = in.readLine()) != null) {\r\n if (line.contains(\",\")) {\r\n names = line.split(\",\");\r\n }\r\n }\r\n in.close();\r\n } catch (MalformedURLException e) {\r\n System.out.println(\"MalformedURLException while fetching list\");\r\n } catch (SocketTimeoutException e) {\r\n System.out.println(\"SocketTimeoutException while fetching list\");\r\n } catch (IOException e) {\r\n System.out.println(\"IOException while fetching list\");\r\n e.printStackTrace();\r\n }\r\n }", "public edu.usfca.cs.dfs.StorageMessages.ListResponse getListResponse() {\n if (listResponseBuilder_ == null) {\n if (msgCase_ == 6) {\n return (edu.usfca.cs.dfs.StorageMessages.ListResponse) msg_;\n }\n return edu.usfca.cs.dfs.StorageMessages.ListResponse.getDefaultInstance();\n } else {\n if (msgCase_ == 6) {\n return listResponseBuilder_.getMessage();\n }\n return edu.usfca.cs.dfs.StorageMessages.ListResponse.getDefaultInstance();\n }\n }", "@Override\n\tpublic String getFriendListDescription() {\n\t\treturn \"Friends known from work\";\n\t}", "public List<User> listUsers(String userName);", "public LiveData<Resource<NameListResponse>> getNameList(Boolean refresh) {\n LiveData<Resource<NameListResponse>> liveDataOrders = new NetworkBoundResource<NameListResponse, NameListResponse>() {\n\n @Override\n protected void saveCallResult(@NonNull NameListResponse item) {\n nameListResponseMutableLiveData.postValue(item);\n }\n\n @Override\n protected boolean shouldFetch(@Nullable NameListResponse data) {\n if (refresh)\n return true;\n\n if (nameListResponseMutableLiveData.getValue() != null) {\n return false;\n }\n return true;\n }\n\n @NonNull\n @Override\n protected LiveData<NameListResponse> loadFromDb() {\n nameListResponseMutableLiveData.setValue(nameListResponseMutableLiveData.getValue());\n return nameListResponseMutableLiveData;\n }\n\n @NonNull\n @Override\n protected LiveData<ApiResponse<NameListResponse>> createCall() {\n return userRestService.getNameList(Constants.API_KEY);\n }\n }.getAsLiveData();\n\n return liveDataOrders;\n }", "public java.lang.String getListName() {\r\n return listName;\r\n }", "private void carregaLista(Boolean mensagemPrivada) {\n\t\trecuperarListaDeMensagens();\n\t}", "public String list(User user) {\n\t\treturn user.getMailbox().list();\n\t}", "public String ListUsers(){\r\n StringBuilder listUsers = new StringBuilder();\r\n for (Utente u: utenti) { // crea la lista degli utenti registrati al servizio\r\n listUsers.append(u.getUsername()).append(\" \");\r\n \tlistUsers.append(u.getStatus()).append(\"\\n\");\r\n }\r\n return listUsers.toString(); \r\n }", "public edu.usfca.cs.dfs.StorageMessages.List getList() {\n if (msgCase_ == 5) {\n return (edu.usfca.cs.dfs.StorageMessages.List) msg_;\n }\n return edu.usfca.cs.dfs.StorageMessages.List.getDefaultInstance();\n }", "public List<MessageResource> listMessageResource();", "private void getUserList() {\n // GET ENTRIES FROM DB AND TURN THEM INTO LIST \n DefaultListModel listModel = new DefaultListModel();\n Iterator itr = DBHandler.getListOfObjects(\"FROM DBUser ORDER BY xname\");\n while (itr.hasNext()) {\n DBUser user = (DBUser) itr.next();\n listModel.addElement(user.getUserLogin());\n }\n // SET THIS LIST FOR INDEX OF ENTRIES\n userList.setModel(listModel);\n }", "public List<Object> getMessageList()\r\n\t{\r\n\t\treturn messageList;\r\n\t}", "public String showPlayListNames(){\n String namePlayList = \"\";\n for(int i = 0; i<MAX_PLAYLIST; i++){\n if(thePlayLists[i] != null){\n namePlayList += \"[\"+(i+1)+\"]\"+thePlayLists[i].getNamePlayList()+\"\\n\";\n }\n }\n return namePlayList;\n }", "public void displayList() {\n\n\t\tIterator<SimplePacket> itr = list.iterator();\n\n\t\twhile(itr.hasNext()) {\n\t\t\tSimplePacket packet = itr.next();\n\t\t\tif(!packet.isValidCheckSum()){\n\t\t\t\tSystem.out.print(\"[\" + packet.getSeq() + \"], \");\n\t\t\t}else{\n\t\t\t\tSystem.out.print(packet.getSeq() + \", \");\n\t\t\t}\n\t\t}\n\t}", "public static void printList(){\n ui.showToUser(ui.DIVIDER, \"Here are the tasks in your list:\");\n for (int i=0; i<Tasks.size(); ++i){\n Task task = Tasks.get(i);\n Integer taskNumber = i+1;\n ui.showToUser(taskNumber + \".\" + task.toString());\n }\n ui.showToUser(ui.DIVIDER);\n }", "private void printAllOwners(ArrayList<String> ownerList){\n for(int i = 0; i < ownerList.size(); i++){\n System.out.println(ownerList.get(i));\n }\n }", "public interface ChatList extends Remote {\r\n\r\n Chat newChat(String s) throws RemoteException;\r\n\r\n Vector allChats() throws RemoteException;\r\n\r\n int getVersion() throws RemoteException;\r\n\r\n boolean newName(String s) throws RemoteException;\r\n \r\n boolean deleteName(String s) throws RemoteException;\r\n\r\n void print() throws RemoteException;\r\n\r\n void registration(ChatList l) throws RemoteException;\r\n}", "void mo29842a(IObjectWrapper iObjectWrapper, zzatk zzatk, List<String> list) throws RemoteException;", "public void afficherListeNoms(){\r\n\t\tfor (String nom: noms){\r\n\t\t\tSystem.out.println(nom);\r\n\t\t}\r\n\t}", "public static void printContactList()\n {\n if(myList.size() < 1)\n System.out.println(\"~empty list~\");\n else\n {\n System.out.println(\"Current Items\");\n System.out.println(\"-------------\");\n for(int i = 0; i < myList.size(); i++)\n {\n System.out.printf(i+\")\");\n Item itemPrint = myList.get(i);\n itemPrint.printItem(itemPrint.getFirstName(), itemPrint.getLastName(), itemPrint.getPhoneNumber(), itemPrint.getEmail());\n }\n }\n }", "@Override\n\t\t\tpublic void onSuccess(List<ClientMessageDecorator> result) {\n\t\t\t\tfor (int i = result.size()-1; i >= 0; i--) {\n\t\t\t\t\taddMessage(result.get(i), false);\n\t\t\t\t}\n\t\t\t}" ]
[ "0.63564557", "0.6045528", "0.5894846", "0.5838253", "0.5800592", "0.57204497", "0.571061", "0.5695515", "0.5613821", "0.56111866", "0.5608969", "0.5605865", "0.5588317", "0.5585201", "0.55385333", "0.55308396", "0.5515329", "0.5513196", "0.55130225", "0.55130225", "0.55130225", "0.55130225", "0.55130225", "0.5492516", "0.5487809", "0.54875314", "0.5483749", "0.54547906", "0.5438883", "0.543807", "0.54122484", "0.5407423", "0.54062104", "0.53899974", "0.5387366", "0.53866804", "0.538", "0.5369647", "0.5311462", "0.5309917", "0.530616", "0.5304333", "0.53013736", "0.5300869", "0.5285982", "0.52841276", "0.52820253", "0.5280898", "0.5275442", "0.52718437", "0.5267574", "0.52639675", "0.52613276", "0.5258229", "0.5243731", "0.52430606", "0.5241729", "0.5235165", "0.52255553", "0.5225186", "0.5199407", "0.5195553", "0.5178266", "0.51771253", "0.51610214", "0.51602536", "0.5159287", "0.5158208", "0.51554507", "0.51525265", "0.51522195", "0.5151838", "0.5151235", "0.514809", "0.51443756", "0.5142366", "0.5125362", "0.5125108", "0.51241547", "0.5116692", "0.5116524", "0.5116367", "0.5116209", "0.51110494", "0.51109976", "0.5101831", "0.5089303", "0.5087772", "0.5084571", "0.50835276", "0.50785846", "0.5075438", "0.5074595", "0.5074548", "0.5074386", "0.50687176", "0.50682193", "0.5064031", "0.50629884", "0.5062798" ]
0.66983014
0
Makes easier to print in the expose format " Name " " Number "
public String getTableFormat(){ String tableToPrint = ""; Enumeration keys = this.clientData.keys(); while(keys.hasMoreElements()){ String clientName = (String) keys.nextElement(); tableToPrint += "\t" + clientName + this.clientData.get(clientName) + '\n'; } return tableToPrint.substring(0,tableToPrint.length() - 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public String toString() {\n return name + \"\\t\\t\\t\" + number;\n }", "public String toString() {\n return name + \": \"+ number; //This will format the names and numbers beside eachother as a telephone directory would\n }", "@Override\n\tpublic String toString() {\n\t\treturn name + \"_\" + num;\n\t}", "public String toString()\n\t{\n\t\treturn Name+\",\"+Number+\",\";\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn name + \": \" + number;\n\t}", "@Override\n public String toString()\n {\n return String.format(\"%-20s\\t\\t%-30s%-30s\",number, name, party);\n}", "@Override\r\n public String toString() {\r\n return getName() + \"(\" + getNumber() + \")\";\r\n }", "public void display() {\n \t\tSystem.out.printf(\"|%6s \", String.valueOf(idNumber));\n\t\tSystem.out.printf(\"|%13s |\", name);\n\t\tSystem.out.printf(\"%10s |\", quantity);\n\t\tSystem.out.printf(\"%8.2f |\", price);\n\t\tSystem.out.printf(\"%16s |\", \" \");\n\t\tSystem.out.printf(\"%16s |\", \" \");\n\t\tSystem.out.println();\n }", "public String print(){\r\n\t\t\r\n\t\treturn String.format(\"%9d\\t%-5s\\t\\t%-3d\\t\\t%-15s\",\r\n\t\t\t\tthis.engineNumber, \r\n\t\t\t\tthis.companyName, \r\n\t\t\t\tthis.numberOfRailCars, \r\n\t\t\t\tthis.destinationCity);\r\n\t}", "public void formatPrint() {\n\t\tSystem.out.printf(\"%8d \", codigo);\n\t\tSystem.out.printf(\"%5.5s \", clase);\n\t\tSystem.out.printf(\"%5.5s \", par);\n\t\tSystem.out.printf(\"%5.5s \", nombre);\n\t\tSystem.out.printf(\"%8d \", comienza);\n\t\tSystem.out.printf(\"%8d\", termina);\n\t}", "public String toString(){\n\t\treturn String.format(\"%d: %s\", index, name);\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 public String toString()\n {\n \treturn getName() + \" (\" + numItem + \")\";\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 String toString() {\r\n\t\treturn \"Name : \"+name+\"\\nEmp# : \"+employeeNum;\r\n\t}", "@Override public String toString() {\r\n\t\tif(getID()<0) return new String(String.format(\"%s\", getName()));\r\n\t\treturn new String(String.format(\"%02d - %s\", getID() , getName()));\r\n\t}", "public static void printNum() {\n\t\tfor(int i = 1; i<= 20; i++) {\n\t\t\tSystem.out.print(\" \" + i);\n\t\t}\n\t\tSystem.out.println(\"\\n\");\n\t\t}", "public String toString(){\r\n return getNumber() + \":\" + getLastName() + \",\" + getFirstName() + \",\" + \"Sales Employee\";\r\n }", "@Override\n public String toString() {\n String s = \"\";\n if(this.numPizzas < 10)\n s = \" \"; // Add space so that numbers line up\n s += String.format(\"%d \", this.getNumber()) + this.pizzaType.toString();\n return s;\n }", "public String toString()\n {\n \tNumberFormat fmt = NumberFormat.getCurrencyInstance();\n \tString item;\n \tif (name.length() >= 8)\n \t\titem = name + \"\\t\";\n \telse\n \t\titem = name + \"\\t\\t\";\n \treturn (item + \" \" + fmt.format(price) + \"\\t \" + quantity \n \t\t\t+ \"\\t\\t\" + fmt.format(price*quantity));\n }", "public String printInfo()\r\n {\r\n String info;\r\n \r\n info = \"Inputed number = \" + mark;\r\n \r\n return info;\r\n }", "public String toString() {\n\t\treturn \"\\t\" + this.getName() + \" \" + this.getAmount();\n\t}", "public void outputNames(){\n System.out.printf(\"\\n%9s%11s\\n\",\"Last Name\",\"First Name\");\n pw.printf(\"\\n%9s%11s\",\"Last Name\",\"First Name\");\n ObjectListNode p=payroll.getFirstNode();\n while(p!=null){\n ((Employee)p.getInfo()).displayName(pw);\n p=p.getNext();\n }\n System.out.print(\"\\nNumber of Employees: \"+payroll.size()+\"\\n\");\n pw.print(\"\\nNumber of Employees: \"+payroll.size()+\"\\n\");\n }", "public String toString (){\r\n \r\n DecimalFormat formatter = new DecimalFormat(\"$###,###.00\");\r\n String formatTotal = formatter.format(total);\r\n \r\n String spacer = \"--------------------\";\r\n String printName = \"Name: \" + this.name;\r\n String printTriage = \"Urgency of visit (1 = urgent, 5 = routine): \" + this.triage;\r\n String printCoverage = \"Percent of bill covered by insurance: \" + this.coverage;\r\n String printTotal = \"Amount owed to hospital before insurance: \" + formatTotal;\r\n String combined = spacer + \"\\n\\n\" + printName + \"\\n\\n\" + printTriage + \"\\n\\n\" + printCoverage + \"\\n\\n\" + printTotal + \"\\n\\n\" + spacer;\r\n return combined;\r\n }", "@Override\n public String toString (int num)\n {\n String format = \"Weekly pay for %s, %s employee id %s is $%.2f\\n\";\n return String.format(format, this.getLastName(), this.getFirstName(), this.getId(), this.calculatePay());\n }", "@Override\n public String toString() {\n return String.format(\"%-4s %-35s %-20s %-20s\\n\", this.pokeNumber, this.pokeName,\n this.pokeType_1, this.hitPoints);\n }", "@Override\n public String toString(){\n \n return String.format(\"%-8d%-10s%-10s%-10s %.2f\\t%-6b\", getCustNumber(), getFirstName(), getSurname(),\n getPhoneNum(), getCredit(), canRent);\n }", "public void print() {\n\t\tSystem.out.println(name + \" -- \" + rating + \" -- \" + phoneNumber);\n\t}", "@Override //indicates that this method overrides a superclass method\n public String toString(){\n\n return String.format(\"%s: %s %s%n%s : %s%n%s: %.2f%n%s: %.2f\",\"commission employee\",firstName,lastName,\n \"pan number\",panCardNumber,\"gross sales\",grossSales,\"commission rate\",commissionRate);\n }", "@Override\n public void print() {\n for (int i = 1; i <= itertion; i++) {\n if(n <0){\n this.result = String.format(\"%-3d %-3s (%-3d) %-3s %d \", i, \"*\", n, \"=\", (n * i));\n System.out.println(this.result);\n }else {\n this.result = String.format(\"%-3d %-3s %-3d %-3s %d \", i, \"*\", n, \"=\", (n * i));\n System.out.println(this.result);\n }\n }\n }", "public void numbersToString(Context ctx){\n\t\t\tboolean first = true;\t\t\t\t\t\t\t\t// if the first dont put a comma\n\t\t\tnamesText = \"\";\t\t\t\t\t\t\t\t\t\t// start of namestext\n\t\t\tfor(String n : numbers.keySet()){\t\t\t\t\t// for all the numbers\n\t\t\t\tString name = numberToString(n,ctx);\t\t\t// get the contact\n\t\t\t\tif(name == null)\t\t\t\t\t\t\t\t// if its null\n\t\t\t\t\tname = n;\t\t\t\t\t\t\t\t\t// name is number\n\t\t\t\tif(!first)\t\t\t\t\t\t\t\t\t\t// if it isnt the first\n\t\t\t\t\tnamesText = namesText + \",\" + name;\t\t\t// put a comma in between\n\t\t\t\telse{\t\t\t\t\t\t\t\t\t\t\t// if it is the fist\n\t\t\t\t\tnamesText = name;\t\t\t\t\t\t\t// put it with no comma\n\t\t\t\t\tfirst = false;\t\t\t\t\t\t\t\t// and say that its not the first\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public String toString()\n {\n int spaceLength = this.lengthToSecondCol - this.name.length();\n String space = \" \";\n String n = \" \";\n String s;\n if(showName)\n {\n n = this.name;\n while(spaceLength > 1)\n {\n spaceLength--;\n space += \" \";\n }\n }\n\n switch (this.type)\n {\n case Pwr.eType_Float32:\n case Pwr.eType_Float64:\n s = n + space + this.valueFloat;\n break;\n case Pwr.eType_UInt32:\n case Pwr.eType_UInt64:\n case Pwr.eType_Int32:\n case Pwr.eType_Int64:\n case Pwr.eType_Enum:\n case Pwr.eType_Mask:\n\n //s = n + space + this.valueInt;\n\ts = n + space + (new Integer( (this.valueInt & 65535) )).intValue();\n break;\n\n case Pwr.eType_UInt16:\n s = n + space + (new Integer( (this.valueInt & 65535) )).intValue();\n break;\n case Pwr.eType_Int8:\n case Pwr.eType_UInt8:\n s = n + space + (new Integer(this.valueInt)).byteValue();\n break;\n case Pwr.eType_Int16:\n s = n + space + (new Integer(this.valueInt)).shortValue();\n break;\n case Pwr.eType_Boolean:\n if(this.valueBoolean)\n {\n s = n + space + \"1\";\n }\n else\n {\n s = n + space + \"0\";\n }\n break;\n default:\n s = n + space + this.valueString;\n break;\n }\n return s;\n }", "public String toString(){\n return ( \"\\nName: \" + name \n + \"\\nPhone Number: \" + phoneNumber\n + \"\\nAge: \" + age \n + \"\\nWeight: \" + weight );\n }", "private String createNumberLine(){\n StringBuilder numberLine = new StringBuilder();\n for(int i = 0; i < this.columns; i++){\n numberLine.append(i + 1).append(\" \");\n }\n return numberLine.toString();\n }", "public String toString()\r\n\t{\r\n\t\tString output = \" \";\r\n\t\tString specialModifier = \" \";\r\n\t\tif(this.isSpecial())\r\n\t\t{\r\n\t\t\tspecialModifier = \" *\";\r\n\t\t}\r\n\t\t\t\r\n\t\toutput = String.format(\"%-9s%-5s%-19s%s%.2f\",getType(), specialModifier, this.getName(),\"$ \", this.getPrice());\r\n\t\t//code to be done here\r\n\t\t\r\n\t\t\r\n\t\treturn output;\r\n\t}", "@Override\n public String toString() {\n String title = \"\\n#\" + mokedexNo + \" \" + name + \"\\n\";\n StringBuffer outputBuffer = new StringBuffer(title.length());\n for (int i = 0; i < title.length(); i++){\n outputBuffer.append(\"-\");\n }\n String header = outputBuffer.toString();\n String levelStats = \"\\nLevel: \" + level;\n String hpStats = \"\\nHP: \" + hp;\n String attStats = \"\\nAttack: \" + attack;\n String defStats = \"\\nDefense: \" + defense;\n String cpStats = \"\\nCP: \" + cp;\n return title + header + levelStats + hpStats + attStats + defStats + cpStats + \"\\n\";\n }", "public String toString()\n {\n //creates a string of the class's variables in a readable format.\n String s = String.format(\"%-14s%-3d%3s\" +lineNums.toString(), word, count,\"\");\n return s.toString();\n }", "public void print()\n {\n System.out.println(name + \"\\n\");\n for(int iterator = 0; iterator < bookList.size() ; iterator++)\n {\n System.out.println((iterator+1) +\". \" + bookList.get(iterator).getTitle()+\" by \" +bookList.get(iterator).getAuthor()); \n }\n }", "@Override\n public String toString() {\n // TODO this is a sudo method only for testing puroposes\n return \"{name: 5aled, age:15}\";\n }", "@Override\n public String getRecordDetail() {\n return \"[\" + type + \"] \"\n + \"[\" + people + \" pax] \"\n + \"[\" + \"Total: $\" + amount + \"] \"\n + \"[\" + amountToMoney() + \" per person] \"\n + nameList;\n }", "public String toString() {\n return String.format(\"%4d: %s\", id, name);\n }", "public String prettyPrint (){\n\t\tString nums = this.getInt() + \"\\n\";\n\t\tif(this.getNext() == null) {\n\t\t\treturn nums;\n\t\t}else {\n\t\t\treturn nums + this.getNext().prettyPrint();\n\t\t}\n\t}", "public String toString() {\n\t\tif(useNum < 10) {\n\t\t\treturn \"0\" + useNum + useStr + \" \" + idNum;\n\t\t} else {\n\t\t\treturn useNum + useStr + \" \" + idNum;\n\t\t}\n\t}", "@Override\n public void infixDisplay() {\n System.out.print(name);\n }", "public void toStrings() {\n String output = \"\";\n output += \"Gen Price: $\" + genPrice + \"0\"+ \"\\n\";\n output += \"Bronze Price: $\" + bronzePrice +\"0\"+ \"\\n\";\n output += \"Silver Price: $\" + silverPrice +\"0\"+ \"\\n\";\n output += \"Gold Price: $\" + goldPrice +\"0\"+ \"\\n\";\n output += \"Vip Price: $\" + vipPrice +\"0\"+ \"\\n\";\n System.out.println(output);\n }", "public String print(int format);", "public void printString() {\n\t\tSystem.out.println(name);\n\t\t\n\t\t\n\t}", "public String toDisplay(){\n\t\treturn String.format(\"%s | %c | %.2f | %.2f\",name ,gender ,taxableIncome ,taxAmount);\n\t}", "public String display(){\n StringBuilder str = new StringBuilder();\n\n for(int i = 0; i < 3; ++i){\n if( Array[i] != null ) {\n str.append('\\n' + Names[i] + '\\n');\n str.append(Array[i].display());\n }\n }\n return str.toString();\n }", "public String toString() {\r\n\t\treturn \"\\n\\tName: \" + lastName + \", \" + firstName;\r\n\t}", "@Override\n public String toString()\n {\n\n String str = String.format(\"%5d %-20s %2c %11.2f\",id,name,rarity,value);\n\n return str;\n }", "public String getPrintableFormat() {\n String output = new String(\"Articoli del gruppo \" + groupName + \":\\n\");\n for (int i = 0; i < list.size(); i++) {\n Article article = list.get(i);\n output += String.format(\"%2d %s\\n\",i,article.getPrintableFormat());\n }\n return output;\n }", "public String toString(){\n return getName() + getDetails() + getPhone();\n }", "public static void outputRecord() {\r\n System.out.println(\"First Name: Len\");\r\n System.out.println(\"Last Name: Payne\");\r\n System.out.println(\"College: Lambton College\");\r\n }", "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 String toString() { return \"Name: \" + firstName + ' ' + lastName + \"\\tGrade: \" + grade; }", "public String toString() {\n\t\treturn \" Student: \" + getName() + \"\\t ID: \" + getIDnumber();\t\n\t}", "public String toString()\n {\n return \"\\nName: \" + name + \"\\n\";\n }", "public String toString() {\r\n\t\treturn name + \" @\" + worth; \r\n\t}", "@Override\n public String toString() {\n return \"rollno:\" + rollno + \"and name : \" + name;\n }", "public void printSpace(){\n\t\tSystem.out.println(\"Current Space: \"+number);\n\t\tSystem.out.print(\"Type: \"+type);\n\t\tSystem.out.print(\"\\nNext Space(s): \");\n\t\tfor(String n: next){\n\t\t\tSystem.out.print(n +\" \");\t\n\t\t}\n\t\tSystem.out.println(\" \");\n\t}", "public String toString(){\n return\"Name \"+name+ \"Address \" +address+ \"Floor \" +floor;\n }", "public void print(){\n String res = \"\" + this.number;\n for(Edge edge: edges){\n res += \" \" + edge.toString() + \" \";\n }\n System.out.println(res.trim());\n }", "@Override\n\tpublic String toString() {\n\t\treturn String.format(\"%s: $%.2f\", name, price);\n\t}", "public String toString(){\r\n return \"(\" + num + \")\";\r\n }", "@Override\n public String toString(){\n return String.format(\"%-8s %-8s %4d %7d %8.1f %s\",\n name, nationality, birthYear, yearsServed, height, validate());\n }", "@Override\n public String toString() {\n return String.format(\"[%d] [%d]\", dameFila(), dameColumna());\n }", "public void display()\n\t{\n\t\tSystem.out.println(\"Bike No.\\t\"+\n\t\t\t\t\"Phone no.\\t\"+\n\t\t\t\t\"Name\\t\"+\n\t\t\t\t\"No. of days\\t\"+\n\t\t\t\t\"Charge\");\n\t\tSystem.out.println(bno+\n\t\t\t\t\"\\t\"+phno+\n\t\t\t\t\"\\t\"+name+\n\t\t\t\t\"\\t\"+days+\n\t\t\t\t\"\\t\"+charge);\n\t}", "public String toString() {\n\t\tString fin = String.format(\"%-15d | %-20s | %-15d | %-15s | %-15s |\"\n\t\t\t\t, ID, name, age, organ,\n\t\t\t\tbloodType.getBloodType() );\n\t\treturn fin;\n\t}", "@Override\n public String toString(){\n return '+' + code + number.substring(0, 3) + '-' + number.substring(3, 6) + '-' +number.substring(6);\n }", "public String printInfo() {\n\t\treturn \"\\n=====================================================================\"+\r\n\t\t\t\t\"\\n Gaming Center Information\"+\r\n\t\t\t\t\"\\n=====================================================================\"+\r\n\t\t\t\t\"\\n Gaming center Name \\t= \" + centerName +\r\n\t\t\t\t\"\\n Location \\t\\t= \" + location + \r\n\t\t\t\t\"\\n Contact Number \\t= \" + contact+\r\n\t\t\t\t\"\\n Operating hour \\t= \"+ operatingHour+\r\n\t\t\t\t\"\\n Number of Employee \\t= \"+ noOfEmployee+ \" pax\";\r\n\t}", "public String toString() {\r\n \r\n String resultn = \"\";\r\n int index = 0;\r\n while (index < list.size()) {\r\n resultn += \"\\n\" + list.get(index) + \"\\n\"; \r\n index++; \r\n } \r\n return getName() + \"\\n\" + resultn + \"\\n\";\r\n \r\n }", "public String toString()\r\n\t\t{\r\n\t\t\tString str = \" \" ;\r\n\t\t\tif (this.num.size() == 0)\r\n\t\t\t\tstr = \"<vacia>\";\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\tfor (int i = 0; i < this.num.size(); i++) \r\n\t\t\t\t\tstr = str + this.num.get(i) + \" \";\r\n\t\t\t}\r\n\t\t\treturn str;\r\n\t\t}", "@Override\n\tpublic String toString() {\n\t\tString out = \"Name: \" + name + \"\\tPosition\" + getPosition();\n\t\treturn out;\n\t}", "private static void print(String valNames, Object... objects) {\n\t\tvalNames = valNames.trim();\n\t\tString[] arr = valNames.split(\":\");\n\t\tString format = valNames + \" \";\n\t\tString prefix = \"\";\n\t\tfor(String str : arr ) {\n\t\t\tformat += prefix + \"%2s\";\n\t\t\tprefix = \":\";\n\t\t}\t\t\n\t\tSystem.out.println(\"\"+String.format(format, objects)); \n\t}", "@Override\r\n public String toString() \r\n {\r\n return (String.format(\"#%d\\t %-20s\\t %-10s\\n\", this.studentId, this.studentName, this.studentMajor));\r\n }", "@Override\n public String toString() {\n String temp;\n int nb_new_lines, i;\n String result = \"\";\n\n String res = \"%-\" + Manager.ALINEA_DISHNAME + \"s %-\" +\n Manager.DISHNAME_TEXT + \"s %-\" +\n Manager.PRICE + \"s %-\" +\n Manager.CURRENCY_SIZE +\"s\";\n\n if (getName().length() > Manager.DISHNAME_TEXT) {\n\n //Number of lines necessary to write the dish's name\n nb_new_lines = dishName.length() / Manager.DISHNAME_TEXT;\n\n //For each line\n for (i = 0; i< nb_new_lines; i++) {\n\n //If it is not the line finishing printing the dish's name: format the line without the price\n //If it is the line finishing printing the dish's name: format the line with the price\n if (i < nb_new_lines-1 | i == nb_new_lines-1) {\n temp = dishName.substring(i*(Manager.DISHNAME_TEXT-1), (i+1)*(Manager.DISHNAME_TEXT-1));\n result += String.format(res, \"\", temp.toUpperCase(), \"\", \"\") + \"\\n\";\n }\n }\n\n temp = dishName.substring((nb_new_lines)*(Manager.DISHNAME_TEXT-1), dishName.length());\n result += String.format(res, \"\", temp.toUpperCase(), price, Manager.CURRENCY) + \"\\n\";\n\n } else {\n result += String.format(res, \"\", dishName.toUpperCase(), price, Manager.CURRENCY) + \"\\n\";\n }\n\n return result;\n }", "public String toString() { \r\n return \"\\n\\tId: \" + id + name;\r\n }", "public String toString() {\r\n\t\treturn \"Name: \" + name + \"\\nAddress: \" + addr + \"\\n\" + city + \"\\n\"\r\n\t\t\t\t+ state + \"\\n\" + zip + \"\\nPhone: \" + phone + \"\\nId: \" + id\r\n\t\t\t\t+ \"\\nMajor: \" + major + \"\\nGPA: \" + gpa;\r\n\t}", "@Override\r\n\tpublic String toString() {\n\t\tString string=\"[\"+product.getName()+\" \"+number+\"]\";\r\n\t\treturn string;\r\n\t}", "public String printSortedResult() {\n\t\tStringBuilder sb = new StringBuilder();\n\n\t\tsb.append(printStartNumberAndName() + \"; \");\n\t\tsb.append(printInfo());\n\t\t\n\t\tsb.append(printTotalTime());\n\t\t\n\t\tsb.append(errorHandler.print());\n\t\t\n\t\treturn sb.toString();\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn \"\" + nome + \",\" + String.format(\"%.2f\", getPrecoTotal());\n\t}", "void printInfo() {\n\t\tdouble salary=120000;\n\t System.out.println(salary);\n\t\tSystem.out.println(name+\" \"+age);\n\t}", "@Override\n public String toString() {\n StringBuilder sb = new StringBuilder();\n\n sb.append(String.format(\"#Name: %s\", this.name))\n .append(\"\\n\");\n sb.append(String.format(\"##Health: %.2f// Energy: %d// Intelligence: %.2f\", this.health, this.energy, this.intelligence))\n .append(\"\\n\");\n\n return sb.toString();\n }", "public String toString() {\n\t\treturn String.format(\"%s = %d\",name,value);\n\t}", "public String toString() {\r\n String output = \"\";\r\n int index = 0;\r\n output = getName() + \"\\n\\n\";\r\n while (index < list.size()) {\r\n output += (list.get(index) + \"\\n\\n\");\r\n index++;\r\n }\r\n return output;\r\n }", "public String toString() {\n\t\tNumberFormat currency = NumberFormat.getCurrencyInstance();\n return \"\" + id + \"\\t\\t\" + currency.format(income) + \"\\t\" + members;\n }", "@Override\n\tpublic void display() {\n\t\tSystem.out.println(name);\n\t}", "public void print() {\n \tfor (int i=0; i < this.table.height; i++) {\n \t\tfor (int j=0; j < this.table.width; j++) {\n \t\t\tString tmp = \"e\";\n \t\t\tif(this.table.field[i][j].head != null) {\n \t\t\t\ttmp = \"\";\n \t\t\t\tswitch (this.table.field[i][j].head.direction) {\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\ttmp+=\"^\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\ttmp+=\">\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\ttmp+=\"V\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 4:\n\t\t\t\t\t\ttmp+=\"<\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n \t\t\t}\n \t\t\telse if(this.table.field[i][j].obj != null) {\n \t\t\t\ttmp = this.table.field[i][j].obj.name;\n \t\t\t}\n \t\t\tSystem.out.print(\" \" + tmp);\n \t\t}\n \t\t\tSystem.out.println(\"\");\n \t}\n }", "public String toString() {\r\n\t\treturn \"Name\t:\" + this.name + \"\\n\" +\r\n\t\t\t\t\"Salary\t:\" + this.salary;\r\n\t}", "@Override\n public String toString() {\n return String.format(\"size = %s, numOfCheese = %d, numOfPepperoni = %d, numOfHam = %d\", this.size, this.cheese,\n this.pepperoni, this.ham);\n }", "public String toString() {\n DecimalFormat f1 = new DecimalFormat(\"#,###\");\n if (gender) {\n return \"\" + f1.format(numsBaby) + \" girls named \" + name + \" in \" + year;\n } else {\n return \"\" + f1.format(numsBaby) + \" boys named \" + name + \" in \" + year;\n\n }\n }", "public void DisplayAllEmployees(){\r\n String format = \"%-20s %-20s %-9s\";\r\n System.out.println(\"\\n\");\r\n System.out.printf(format, \"|\"+\" Name \", \"|\"+\" Department \", \"|\"+\" phone number|\"+\"\\n\");\r\n System.out.println(\"----------------------------------------------------------\");\r\n for(Employee employee: listOfEmployees){\r\n System.out.format(format,\"|\"+employee.name,\"|\"+employee.departmentName,\"|\"+employee.contactNumber+\" |\"+ \"\\n\");\r\n }\r\n }", "public void print()\r\n {\r\n int i = numar.length()/3;\r\n while( i != 0 ){\r\n String n = numar.substring(0,3);\r\n numar = numar.substring(3);\r\n printNo(n);\r\n if( i == 3){\r\n System.out.print(\"million \");\r\n }\r\n else if( i == 2 ){\r\n System.out.print(\"thousand \");\r\n }\r\n i--;\r\n }\r\n }", "@Override\n\tpublic String toString()\n\t{\n\t\treturn String.format(\"%-25s: %d\", this.getSequence(), this.getWeight());\n\t}", "public String getName(){\n if(number == 1) return \"ace\";\n if(number == 13) return \"king\";\n if(number == 12) return \"queen\";\n if(number == 11) return \"jack\";\n else return \"\" + number;\n }", "@Override\n public String toString() {\n // Returns \"Name: {name} Grade: {grade}\"\n return String.format(\"Name: %s %s Grade: %d\", this.firstName, this.lastName, this.grade);\n }", "public String toString(){\r\n String s=\"\";\r\n\r\n System.out.printf(\"Name: %s \\t Nickname: %s \\t\",getName(),getNickname());\r\n\r\n return s;\r\n }", "public void print() {\r\n\t\tSystem.out.print(getUID());\r\n\t\tSystem.out.print(getTITLE());\r\n\t\tSystem.out.print(getNOOFCOPIES());\r\n\t}", "public String toString() {\r\n\t\treturn \"Name: \" + getName() + \"\\nAddress: \" + getAddress() + \"\\nPhone Number: \" + getPhoneNumber();\r\n\t}", "@Override\r\n public String toString()\r\n {\r\n return String.format(\"%s: %n%s: %s (%s) %n%s: %d %n%s: $%,.2f\", \r\n \"invoice\", \"part number\", getPartNumber(), getPartDescription(), \r\n \"quantity\", getQuantity(), \"price per item\", getPricePerItem());\r\n }" ]
[ "0.800814", "0.759097", "0.7587933", "0.75803226", "0.7423947", "0.7414693", "0.7297674", "0.71514946", "0.7138192", "0.6955554", "0.6937284", "0.69247955", "0.6858802", "0.6809406", "0.675945", "0.6735139", "0.6734531", "0.6727889", "0.67183304", "0.6699481", "0.6692311", "0.66880506", "0.6678262", "0.66763926", "0.6627118", "0.6617179", "0.6610354", "0.65801424", "0.6579726", "0.65792775", "0.655881", "0.65506494", "0.6550428", "0.65463626", "0.6541881", "0.6536912", "0.65347046", "0.65322757", "0.65253234", "0.65090823", "0.65020573", "0.647635", "0.647162", "0.6471188", "0.64684266", "0.64667815", "0.6458646", "0.6455846", "0.64551705", "0.64499635", "0.64361185", "0.6423096", "0.6418886", "0.64183515", "0.640941", "0.64066017", "0.6404471", "0.64041245", "0.6392622", "0.6392148", "0.63898546", "0.63879776", "0.63759613", "0.6375891", "0.63692135", "0.6362247", "0.6360055", "0.6354884", "0.6354836", "0.63523954", "0.63471043", "0.6340888", "0.6339068", "0.6334679", "0.63308495", "0.6327595", "0.63275045", "0.6323899", "0.63172406", "0.6314071", "0.6308485", "0.63076675", "0.6302259", "0.6293554", "0.62885153", "0.6287841", "0.6277871", "0.62704915", "0.6266968", "0.6264065", "0.62633497", "0.62619346", "0.6260688", "0.62586427", "0.6253169", "0.62521327", "0.625171", "0.62457883", "0.62457675", "0.6244698", "0.6242672" ]
0.0
-1
TODO Autogenerated method stub
@Override public Authentication authenticate(Authentication auth) throws AuthenticationException { username = auth.getName(); String pass = auth.getCredentials().toString(); if(AppController.users.containsKey(username)) { String password = AppController.users.get(username); if(password.equals(pass)) return new UsernamePasswordAuthenticationToken(username,pass,Collections.EMPTY_LIST); else throw new BadCredentialsException("authentication failed"); } else throw new BadCredentialsException("authentication failed"); }
{ "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 boolean supports(Class<?> auth) { return auth.equals(UsernamePasswordAuthenticationToken.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
Creates an instance of DefaultProfileCompletenessRetriever.
public DefaultProfileCompletenessRetriever() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ProfileServiceWithDefaults profileWithDefaults() {\n return service.getProfileServiceWithDefaultsAndCallbacks();\n }", "public ProfileService() {\n\t\tthis(DEFAULT_ENDPOINT_NAME, DEFAULT_CACHE_SIZE);\n\t}", "public ProfileService() {\n \t\tthis(DEFAULT_ENDPOINT_NAME, DEFAULT_CACHE_SIZE);\n \t\tinitializeCache(DEFAULT_CACHE_SIZE);\n \t}", "public ConfigProfile buildProfileDefault() {\n this.topics = \"mytopic\";\n this.token = \"mytoken\";\n this.uri = \"https://dummy:8088\";\n this.raw = false;\n this.ack = true;\n this.indexes = \"\";\n this.sourcetypes = \"\";\n this.sources = \"\";\n this.httpKeepAlive = true;\n this.validateCertificates = true;\n this.hasTrustStorePath = true;\n this.trustStorePath = \"./src/test/resources/keystoretest.jks\";\n this.trustStoreType = \"JKS\";\n this.trustStorePassword = \"Notchangeme\";\n this.eventBatchTimeout = 1;\n this.ackPollInterval = 1;\n this.ackPollThreads = 1;\n this.maxHttpConnPerChannel = 1;\n this.totalHecChannels = 1;\n this.socketTimeout = 1;\n this.enrichements = \"ni=hao,hello=world\";\n this.enrichementMap = new HashMap<>();\n this.trackData = true;\n this.maxBatchSize = 1;\n this.numOfThreads = 1;\n this.lineBreaker = \"\\n\";\n return this;\n }", "public AbstractRetriever() {\n }", "public static ParkingProfile init(String pathToParkingProfilePropertiesFile) throws Exception {\n if(\"Check for multiprofile enabled in propetties file\") {\n // Create singleton and set values\n return parkingProfile;\n } else {\n // Allow to create nultiple and set values\n return new ParkingProfile();\n }\n }", "public static synchronized TrustedCertificates getDefault() {\n if (trustedCertificates == null) {\n trustedCertificates = new DefaultTrustedCertificates();\n }\n trustedCertificates.refresh();\n return trustedCertificates;\n }", "public interface ProfileServiceWithDefaults {\n\n /**\n * Get profile details from the service.\n *\n * @param profileId Profile Id of the user.\n * @param callback Callback with the result.\n */\n void getProfile(@NonNull final String profileId, @Nullable Callback<ComapiResult<ComapiProfile>> callback);\n\n /**\n * Query user profiles on the services.\n *\n * @param queryString Query string. See https://www.npmjs.com/package/mongo-querystring for query syntax. You can use {@link QueryBuilder} helper class to construct valid query string.\n * @param callback Callback with the result.\n */\n void queryProfiles(@NonNull final String queryString, @Nullable Callback<ComapiResult<List<ComapiProfile>>> callback);\n\n /**\n * Updates profile for an active session.\n *\n * @param profileDetails Profile details.\n * @param callback Callback with the result.\n */\n void updateProfile(@NonNull final ComapiProfile profileDetails, final String eTag, @Nullable Callback<ComapiResult<ComapiProfile>> callback);\n\n /**\n * Applies given profile patch if required permission is granted.\n *\n * @param profileId Id of an profile to patch.\n * @param profileDetails Profile details.\n * @param callback Callback with the result.\n */\n void patchProfile(@NonNull final String profileId, @NonNull final ComapiProfile profileDetails, final String eTag, @Nullable Callback<ComapiResult<ComapiProfile>> callback);\n\n /**\n * Applies profile patch for an active session.\n *\n * @param profileDetails Profile details.\n * @param callback Callback with the result.\n */\n void patchMyProfile(@NonNull final ComapiProfile profileDetails, final String eTag, @Nullable Callback<ComapiResult<ComapiProfile>> callback);\n }", "@NonNull\n @RequiresFeature(PackageManager.FEATURE_IPSEC_TUNNELS)\n public Ikev2VpnProfile build() {\n return new Ikev2VpnProfile(\n mType,\n mServerAddr,\n mUserIdentity,\n mPresharedKey,\n mServerRootCaCert,\n mUsername,\n mPassword,\n mRsaPrivateKey,\n mUserCert,\n mProxyInfo,\n mAllowedAlgorithms,\n mIsBypassable,\n mIsMetered,\n mMaxMtu,\n mIsRestrictedToTestNetworks,\n mExcludeLocalRoutes,\n mRequiresInternetValidation,\n mIkeTunConnParams,\n mAutomaticNattKeepaliveTimerEnabled,\n mAutomaticIpVersionSelectionEnabled);\n }", "public static PluginConsistencyActivator getDefault()\n {\n return plugin;\n }", "public static UpdateCheckActivator getDefault() {\n\t\treturn plugin;\n\t}", "ProfileStatusManager create( ProfileConfiguration profileConfiguration ) throws ProfileCreationException;", "public static DataFilter createDefault() {\n\t\tString type = Config.get(Key.LATENCY_FILTER_TYPE);\n\t\tswitch(type) {\n\t\t\tcase \"average\" : \n\t\t\t\treturn new MovingAverageFilter();\n\t\t\tcase \"median\" : \n\t\t\t\treturn new MovingMedianFilter();\n\t\t\tcase \"none\" : \n\t\t\t\treturn new NoFilter();\n\t\t\tdefault:\n\t\t\t\tthrow new IllegalArgumentException(\"Invalid latency filter type in config file\");\n\t\t}\n\t}", "private SpringProfile() {}", "public static GenericBootstrap byDefaultProvider() {\n return new GenericBootstrapImpl();\n }", "@Test\n\tpublic void testDefaultKernel() {\n\t\t// The profile collector must not be null and the level must be \"min\"\n\t\tassertNotNull(profileCollector);\n\t\tassertSame(ProfileLevel.MIN, profileCollector.getDefaultProfileLevel());\n\t}", "public static OperatorChecker getDefault() {\n synchronized (MccMncConfig.class) {\n if (sChecker != null) {\n OperatorChecker operatorChecker = sChecker;\n return operatorChecker;\n }\n }\n }", "public DefaultSimplePolicyValueTestAbstract() {\n }", "public static RAPCorePlugin getDefault() {\n\t\treturn plugin;\n\t}", "@Test\n public void testDefaultConstructor() {\n final ConfigSearchResult<?> result = new ConfigSearchResult<>();\n assertTrue(result.getDocuments().isEmpty());\n assertNull(result.getPaging());\n assertEquals(result.getVersionCorrection(), VersionCorrection.LATEST);\n }", "public Boolean proactiveDetection() {\n return this.proactiveDetection;\n }", "private VerifierFactory() {\n }", "public DefaultConnectionProvider() {\n loadProperties();\n }", "public Profile() {}", "public static SubscriptionPolicy createDefaultSubscriptionPolicy() {\n SubscriptionPolicy subscriptionPolicy = new SubscriptionPolicy(SAMPLE_SUBSCRIPTION_POLICY);\n subscriptionPolicy.setUuid(UUID.randomUUID().toString());\n subscriptionPolicy.setDisplayName(SAMPLE_SUBSCRIPTION_POLICY);\n subscriptionPolicy.setDescription(SAMPLE_SUBSCRIPTION_POLICY_DESCRIPTION);\n QuotaPolicy defaultQuotaPolicy = new QuotaPolicy();\n defaultQuotaPolicy.setType(REQUEST_COUNT_TYPE);\n RequestCountLimit requestCountLimit = new RequestCountLimit(TIME_UNIT_SECONDS, 10000, 1000);\n defaultQuotaPolicy.setLimit(requestCountLimit);\n subscriptionPolicy.setDefaultQuotaPolicy(defaultQuotaPolicy);\n return subscriptionPolicy;\n }", "final Truerandomness defaultInstance() {\n\n\t\ttry {\n\t\t\treturn newInstance();\n\t\t} catch (Throwable t) {\n\t\t\t// hide\n\t\t}\n\n\t\t// not supported\n\t\treturn null;\n\t}", "protected void testCtor_1() {\n\t\t\n\t\tPreferenceService ps = null;\n\t\t\n\t\ttry {\n\t\t\tps = new PreferenceService(null);\n\t\t} catch (Exception e) {\n\t\t}\n\t\t\n\t\tassertEquals(\"\", true, ps == null);\n\t\t\n\t}", "public static Activator getDefault()\r\n\t{\r\n\t\treturn plugin;\r\n\t}", "public static APIPolicy createDefaultAPIPolicy() {\n APIPolicy apiPolicy = new APIPolicy(SAMPLE_API_POLICY);\n apiPolicy.setUuid(UUID.randomUUID().toString());\n apiPolicy.setDisplayName(SAMPLE_API_POLICY);\n apiPolicy.setDescription(SAMPLE_API_POLICY_DESCRIPTION);\n apiPolicy.setUserLevel(APIMgtConstants.ThrottlePolicyConstants.API_LEVEL);\n QuotaPolicy defaultQuotaPolicy = new QuotaPolicy();\n defaultQuotaPolicy.setType(REQUEST_COUNT_TYPE);\n RequestCountLimit requestCountLimit = new RequestCountLimit(TIME_UNIT_SECONDS, 1000, 10000);\n defaultQuotaPolicy.setLimit(requestCountLimit);\n apiPolicy.setDefaultQuotaPolicy(defaultQuotaPolicy);\n apiPolicy.setPipelines(createDefaultPipelines());\n return apiPolicy;\n }", "protected KeyDecodingProfile getDefaultKeyDecodingProfile() {\n return new DefaultKeyDecodingProfile();\n }", "public interface ProfilingService {\n String PROFILES = \"profiles\";\n\n /**\n * Get the profile factory for a given data source\n *\n * @param dataSourceMetadata the data source metadata\n * @return a ProfileFactory that accepts the reference (or null if it doesn't exist)\n */\n ProfileFactory getProfileFactory( DataSourceMetadata dataSourceMetadata );\n\n /**\n * Return a boolean indicating whether a ProfileFactory exists for the given data source\n *\n * @param dataSourceMetadata the data source metadata\n * @return true iff there is a ProfileFactory that accepts the reference\n */\n boolean accepts( DataSourceMetadata dataSourceMetadata );\n\n /**\n * Creates a profile from the ProfileConfiguration and returns its initial status\n *\n * @param profileConfiguration the profile configuration\n * @return a ProfileStatusManager for the created profile\n * @throws ProfileCreationException if there is an error during profile creation\n */\n ProfileStatusManager create( ProfileConfiguration profileConfiguration ) throws ProfileCreationException;\n\n /**\n * Returns a list of the currently active profiles\n *\n * @return a list of the currently active profiles\n */\n List<ProfileStatusReader> getActiveProfiles();\n\n /**\n * Returns the profile for a given profileId\n *\n * @param profileId the profileId\n * @return the Profile\n */\n Profile getProfile( String profileId );\n\n /**\n * Returns the a ProfileStatusReader for the given profileId\n *\n * @param profileId the profileId\n * @return the ProfileStatusReader\n */\n ProfileStatusReader getProfileUpdate( String profileId );\n\n /**\n * Stops the profile with the given id\n *\n * @param profileId the profileId to stop\n */\n void stop( String profileId );\n\n /**\n * Stops all the running profiles\n */\n void stopAll();\n\n /**\n * Returns a boolean indicating whether a profile is running\n *\n * @param profileId the profileId to check\n * @return a boolean indicating whether a profile is running\n */\n boolean isRunning( String profileId );\n\n /**\n * Discards the profile with the given id\n *\n * @param profileId the profileId to discard\n */\n void discardProfile( String profileId );\n\n /**\n * Discards all profiles\n */\n void discardProfiles();\n}", "public static CPCTrackPlugin getDefault()\n\t{\n\t\treturn plugin;\n\t}", "public static Service newInstance() {\n return newInstance(DEFAULT_PROVIDER_NAME);\n }", "public static ValidatorFactory buildDefaultValidatorFactory() {\n return byDefaultProvider().configure().buildValidatorFactory();\n }", "public static Activator getDefault() {\n \t\treturn plugin;\n \t}", "public ConfigProfile buildProfileOne() {\n this.topics = \"kafka-data\";\n this.token = \"mytoken\";\n this.uri = \"https://dummy:8088\";\n this.raw = true;\n this.ack = false;\n this.indexes = \"index-1\";\n this.sourcetypes = \"kafka-data\";\n this.sources = \"kafka-connect\";\n this.httpKeepAlive = true;\n this.validateCertificates = true;\n this.hasTrustStorePath = true;\n this.trustStorePath = \"./src/test/resources/keystoretest.p12\";\n this.trustStoreType = \"PKCS12\";\n this.trustStorePassword = \"Notchangeme\";\n this.eventBatchTimeout = 1;\n this.ackPollInterval = 1;\n this.ackPollThreads = 1;\n this.maxHttpConnPerChannel = 1;\n this.totalHecChannels = 1;\n this.socketTimeout = 1;\n this.enrichements = \"hello=world\";\n this.enrichementMap = new HashMap<>();\n this.trackData = false;\n this.maxBatchSize = 1;\n this.numOfThreads = 1;\n return this;\n }", "static synchronized Statistics getDefault() {\n if (INSTANCE == null) {\n INSTANCE = new Statistics();\n }\n return INSTANCE;\n }", "public ProfileServiceBootstrap()\n {\n }", "public static Activator getDefault() {\n\treturn plugin;\n }", "public static FavoriteSearchActivator getDefault() {\r\n\t\treturn plugin;\r\n\t}", "public static IHttpSimpleFetcher getHttpFetcher()\r\n {\r\n if (_httpFetcher == null)\r\n {\r\n _httpFetcher = new SimpleHttpFetcher();\r\n }\r\n\r\n return _httpFetcher;\r\n }", "private CardReaderMonitorFactory() {\t\t\n\t}", "public static Activator getDefault() {\r\n return plugin;\r\n }", "public static Activator getDefault() {\r\n\t\treturn plugin;\r\n\t}", "public static Activator getDefault() {\r\n\t\treturn plugin;\r\n\t}", "private CandidateGenerator() {\n\t}", "private Properties loadDefaultProperties() {\n Properties pref = new Properties();\n try {\n String path = \"resources/bundle.properties\";\n InputStream stream = PreferenceInitializer.class.getClassLoader().getResourceAsStream(path);\n pref.load(stream);\n } catch (IOException e) {\n ExceptionHandler.logAndNotifyUser(\"The default preferences for AgileReview could not be initialized.\"\n + \"Please try restarting Eclipse and consider to write a bug report.\", e, Activator.PLUGIN_ID);\n return null;\n }\n return pref;\n }", "public static Activator getDefault() {\n\t\treturn plugin;\n\t}", "public static Activator getDefault() {\n\t\treturn plugin;\n\t}", "public static Activator getDefault() {\n\t\treturn plugin;\n\t}", "public static Activator getDefault() {\n\t\treturn plugin;\n\t}", "public static Activator getDefault() {\n\t\treturn plugin;\n\t}", "public static Activator getDefault() {\n\t\treturn plugin;\n\t}", "public static Activator getDefault() {\n\t\treturn plugin;\n\t}", "public static Activator getDefault() {\n\t\treturn plugin;\n\t}", "public ProfileResource() {\n }", "@Override\n\tpublic ISpecies getDefault() {\n\t\treturn null;\n\t}", "public static Activator getDefault() {\n return plugin;\n }", "public static NatpPlugin getDefault() {\r\n\t\treturn plugin;\r\n\t}", "@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n public static TransportReader<TransportMessage>\n createExperimentalDefault() {\n\n /*\n * TODO Remove raw types and unchecked conversion. Unfortunately I could\n * not find a way around using raw types and unchecked conversion my be\n * some one else can.\n */\n\n PtTlsReader reader = (PtTlsReader) createProductionDefault();\n\n reader.add(IETFConstants.IETF_PEN_VENDORID,\n PtTlsMessageTypeEnum.IETF_PT_TLS_EXERIMENTAL.id(),\n (TransportReader) new PtTlsMessageExperimentalValueReader(\n new PtTlsMessageValueExperimentalBuilderIetf()));\n\n return reader;\n }", "public ProfileService(String endpoint) {\n \t\tthis(endpoint, DEFAULT_CACHE_SIZE);\n \t\tinitializeCache(DEFAULT_CACHE_SIZE);\n \t}", "public static FailoverConnectionMonitor getInstance(ProtocolProviderServiceJabberImpl provider)\n\t{\n\t\tFailoverConnectionMonitor fov;\n\n\t\tsynchronized (providerFailOvers) {\n\t\t\tfov = providerFailOvers.get(provider);\n\n\t\t\tif (fov == null) {\n\t\t\t\tfov = new FailoverConnectionMonitor(provider);\n\t\t\t\tproviderFailOvers.put(provider, fov);\n\t\t\t}\n\t\t}\n\t\treturn fov;\n\t}", "public ProfileCompletenessReport getProfileCompletenessReport(User user)\n throws ProfileCompletenessRetrievalException {\n ParameterCheckUtility.checkNotNull(user, \"user\");\n // Prepare report entity\n ProfileCompletenessReport report = new ProfileCompletenessReport();\n report.setTaskCompletionStatuses(new ArrayList<TaskCompletionStatus>());\n // Prepare calculation fields:\n int totalFields = 0;\n int totalCompletedFields = 0;\n for (ProfileTaskChecker checker : profileTaskCheckers) {\n ProfileTaskReport profileTaskReport = checker.getTaskReport(user);\n totalFields += profileTaskReport.getTotalFieldCount();\n totalCompletedFields += profileTaskReport.getCompletedFieldCount();\n TaskCompletionStatus taskCompletionStatus = new TaskCompletionStatus();\n taskCompletionStatus.setTaskName(profileTaskReport.getTaskName());\n taskCompletionStatus.setCompleted(profileTaskReport.getCompleted());\n report.getTaskCompletionStatuses().add(taskCompletionStatus);\n }\n // Perform calculation:\n report.setCompletionPercentage(totalCompletedFields * 100 / totalFields);\n return report;\n }", "public DefaultPolicyFilter()\n\t{\n\t\tthis.compiler = new StackMachineCompiler();\n\t\tthis.executionEngine = new StackMachine();\n\t}", "public RelyingPartyConfiguration getDefaultRelyingPartyConfiguration();", "Duration getDefaultPollInterval();", "public SpecificationFactoryImpl()\r\n {\r\n super();\r\n }", "public static synchronized TrustedCertificates \n getDefaultTrustedCertificates() {\n\n return getDefault();\n }", "com.google.protobuf2.Any getProfile();", "public void setServiceCompleteness(ServiceCompleteness completeness);", "public void testConstructor() {\r\n assertNotNull(\"DefaultReviewApplicationProcessor instance should be created successfully.\", processor);\r\n }", "MeterProvider create();", "public static Profile m2911j() {\n if (OP2.a(1).mo9662a()) {\n return (Profile) nativeGetLastUsedProfile();\n }\n throw new IllegalStateException(\"Browser hasn't finished initialization yet!\");\n }", "public ProfileRequests() {\n }", "private Default()\n {}", "private WebSSOProfileConsumer getWebSSOprofileConsumer() {\n\t\tlong maxAuthAge = 24;\n\t\tif (samlProps != null) {\n\t\t\tString maxAuthAgeStr = samlProps.getOrDefault(\"maxAuthAge\", \"24\");\n\n\t\t\ttry {\n\t\t\t\tmaxAuthAge = Long.parseLong(maxAuthAgeStr);\n\t\t\t} catch (Exception e) {\n\t\t\t\tlogger.error(\"Invalid max. authentication age: \" + maxAuthAgeStr + \". Defaulting to 24 hours\", e);\n\t\t\t}\n\t\t}\n\n\t\tWebSSOProfileConsumerImpl consumer = new WebSSOProfileConsumerImpl();\n\t\tconsumer.setMaxAuthenticationAge(maxAuthAge * 60 * 60);\n\t\treturn consumer;\n\t}", "public PaymentStatusPoll() {\n }", "public ProfileService(String endpoint) {\n\t\tthis(endpoint, DEFAULT_CACHE_SIZE);\n\t}", "@Test\n public void testGetDefaultRegistrationStatus() throws Exception {\n DefaultPersonBizPolicyConsultant underTest = new DefaultPersonBizPolicyConsultant();\n\n underTest.setDefaultRegistrationStatus(null);\n assertEquals(null, underTest.getDefaultRegistrationStatus());\n\n underTest.setDefaultRegistrationStatus(APPROVED);\n assertEquals(APPROVED, underTest.getDefaultRegistrationStatus());\n\n underTest.setDefaultRegistrationStatus(BLACK_LISTED);\n assertEquals(BLACK_LISTED, underTest.getDefaultRegistrationStatus());\n\n underTest.setDefaultRegistrationStatus(PENDING);\n assertEquals(PENDING, underTest.getDefaultRegistrationStatus());\n }", "public void initializeDefault() {\n\t\tthis.numAuthorsAtStart = 5;\n\t\tthis.numPublicationsAtStart = 20;\n\t\tthis.numCreationAuthors = 0;\n\t\tthis.numCreationYears = 10;\n\n\t\tyearInformation = new DefaultYearInformation();\n\t\tyearInformation.initializeDefault();\n\t\tpublicationParameters = new DefaultPublicationParameters();\n\t\tpublicationParameters.initializeDefault();\n\t\tpublicationParameters.setYearInformation(yearInformation);\n\t\tauthorParameters = new DefaultAuthorParameters();\n\t\tauthorParameters.initializeDefault();\n\t\ttopicParameters = new DefaultTopicParameters();\n\t\ttopicParameters.initializeDefault();\n\t}", "protected ConnectionProvider createConnectionProviderIfNotSupplied() {\n\t\tif (connectionProviderSupplier != null) {\n\t\t\treturn connectionProviderSupplier.get();\n\t\t}\n\t\treturn new CoreConnectionPool();\n\t}", "@Test\n public void testGetDefault() {\n System.out.println(\"getDefault\");\n\n final LayersViewController instance1 = LayersViewController.getDefault();\n final LayersViewController instance2 = LayersViewController.getDefault();\n assertEquals(instance1, instance2);\n }", "private CpuInfoProvider() {\r\n\t\t\r\n\t}", "public static ProfileStore getInstance() {\n if (instance == null) {\n instance = new ProfileStore(PersistentStorageAgent.getInstance());\n }\n return instance;\n }", "public DefaultJobSelectionStrategy() {\n }", "public void testConstructors()\n {\n VectorThresholdInformationGainLearner<String> subLearner = null;\n double percentToSample = RandomSubVectorThresholdLearner.DEFAULT_PERCENT_TO_SAMPLE;\n VectorFactory<?> vectorFactory = VectorFactory.getDefault();\n int[] dimensionsToConsider = null;\n RandomSubVectorThresholdLearner<String> instance = new RandomSubVectorThresholdLearner<String>();\n assertSame(subLearner, instance.getSubLearner());\n assertEquals(percentToSample, instance.getPercentToSample());\n assertSame(dimensionsToConsider, instance.getDimensionsToConsider());\n assertNotNull(instance.getRandom());\n assertSame(vectorFactory, instance.getVectorFactory());\n\n subLearner = new VectorThresholdInformationGainLearner<String>();\n percentToSample = percentToSample / 2.0;\n instance = new RandomSubVectorThresholdLearner<String>(subLearner,\n percentToSample, random);\n assertSame(subLearner, instance.getSubLearner());\n assertEquals(percentToSample, instance.getPercentToSample());\n assertSame(dimensionsToConsider, instance.getDimensionsToConsider());\n assertSame(random, instance.getRandom());\n assertSame(vectorFactory, instance.getVectorFactory());\n\n vectorFactory = VectorFactory.getSparseDefault();\n instance = new RandomSubVectorThresholdLearner<String>(subLearner,\n percentToSample, random, vectorFactory);\n assertSame(subLearner, instance.getSubLearner());\n assertEquals(percentToSample, instance.getPercentToSample());\n assertSame(dimensionsToConsider, instance.getDimensionsToConsider());\n assertSame(random, instance.getRandom());\n assertSame(vectorFactory, instance.getVectorFactory());\n \n dimensionsToConsider = new int[] {5, 12};\n vectorFactory = VectorFactory.getSparseDefault();\n instance = new RandomSubVectorThresholdLearner<String>(subLearner,\n percentToSample, dimensionsToConsider, random, vectorFactory);\n assertSame(subLearner, instance.getSubLearner());\n assertEquals(percentToSample, instance.getPercentToSample());\n assertSame(dimensionsToConsider, instance.getDimensionsToConsider());\n assertSame(random, instance.getRandom());\n assertSame(vectorFactory, instance.getVectorFactory());\n }", "@Test\n public void testDetectTestDefaults() throws Exception {\n\n Config testConfig = ConfigFactory.load(\"componentTest\");\n\n StreamsConfigurator.addConfig(testConfig);\n\n ComponentConfigurator<ComponentConfiguration> configurator = new ComponentConfigurator<>(ComponentConfiguration.class);\n ComponentConfiguration defaultPojo = configurator.detectConfiguration();\n\n assert(defaultPojo != null);\n\n ComponentConfiguration configuredPojo = configurator.detectConfiguration(testConfig.getConfig(\"configuredComponent\"));\n\n assert(configuredPojo != null);\n\n }", "public ProPoolExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "@Test\n public void testConstructor() {\n RANSACRadialDistortionRobustEstimator estimator =\n new RANSACRadialDistortionRobustEstimator();\n\n // check correctness\n assertEquals(estimator.getThreshold(),\n RANSACRadialDistortionRobustEstimator.DEFAULT_THRESHOLD, 0.0);\n assertEquals(estimator.getMethod(), RobustEstimatorMethod.RANSAC);\n assertNull(estimator.getListener());\n assertFalse(estimator.isListenerAvailable());\n assertFalse(estimator.isLocked());\n assertEquals(estimator.getProgressDelta(),\n RANSACRadialDistortionRobustEstimator.DEFAULT_PROGRESS_DELTA,\n 0.0);\n assertEquals(estimator.getConfidence(),\n RANSACRadialDistortionRobustEstimator.DEFAULT_CONFIDENCE, 0.0);\n assertEquals(estimator.getMaxIterations(),\n RANSACRadialDistortionRobustEstimator.DEFAULT_MAX_ITERATIONS);\n assertNull(estimator.getDistortedPoints());\n assertNull(estimator.getUndistortedPoints());\n assertNull(estimator.getDistortionCenter());\n assertEquals(estimator.getHorizontalFocalLength(),\n RadialDistortionRobustEstimator.DEFAULT_FOCAL_LENGTH, 0.0);\n assertEquals(estimator.getVerticalFocalLength(),\n RadialDistortionRobustEstimator.DEFAULT_FOCAL_LENGTH, 0.0);\n assertEquals(estimator.getSkew(),\n RadialDistortionRobustEstimator.DEFAULT_SKEW, 0.0);\n assertEquals(estimator.getIntrinsic().getHorizontalPrincipalPoint(),\n 0.0, 0.0);\n assertEquals(estimator.getIntrinsic().getVerticalPrincipalPoint(),\n 0.0, 0.0);\n assertEquals(estimator.getIntrinsic().getHorizontalFocalLength(),\n RadialDistortionRobustEstimator.DEFAULT_FOCAL_LENGTH, 0.0);\n assertEquals(estimator.getIntrinsic().getVerticalFocalLength(),\n RadialDistortionRobustEstimator.DEFAULT_FOCAL_LENGTH, 0.0);\n assertEquals(estimator.getIntrinsic().getSkewness(),\n RadialDistortionRobustEstimator.DEFAULT_SKEW, 0.0);\n assertEquals(estimator.getNumKParams(),\n RadialDistortionRobustEstimator.DEFAULT_NUM_K_PARAMS);\n assertFalse(estimator.arePointsAvailable());\n assertFalse(estimator.isReady());\n assertNull(estimator.getQualityScores());\n\n // test constructor with listener\n estimator = new RANSACRadialDistortionRobustEstimator(this);\n\n // check correctness\n assertEquals(estimator.getThreshold(),\n RANSACRadialDistortionRobustEstimator.DEFAULT_THRESHOLD, 0.0);\n assertEquals(estimator.getMethod(), RobustEstimatorMethod.RANSAC);\n assertSame(estimator.getListener(), this);\n assertTrue(estimator.isListenerAvailable());\n assertFalse(estimator.isLocked());\n assertEquals(estimator.getProgressDelta(),\n RANSACRadialDistortionRobustEstimator.DEFAULT_PROGRESS_DELTA,\n 0.0);\n assertEquals(estimator.getConfidence(),\n RANSACRadialDistortionRobustEstimator.DEFAULT_CONFIDENCE, 0.0);\n assertEquals(estimator.getMaxIterations(),\n RANSACRadialDistortionRobustEstimator.DEFAULT_MAX_ITERATIONS);\n assertNull(estimator.getDistortedPoints());\n assertNull(estimator.getUndistortedPoints());\n assertNull(estimator.getDistortionCenter());\n assertEquals(estimator.getHorizontalFocalLength(),\n RadialDistortionRobustEstimator.DEFAULT_FOCAL_LENGTH, 0.0);\n assertEquals(estimator.getVerticalFocalLength(),\n RadialDistortionRobustEstimator.DEFAULT_FOCAL_LENGTH, 0.0);\n assertEquals(estimator.getSkew(),\n RadialDistortionRobustEstimator.DEFAULT_SKEW, 0.0);\n assertEquals(estimator.getIntrinsic().getHorizontalPrincipalPoint(),\n 0.0, 0.0);\n assertEquals(estimator.getIntrinsic().getVerticalPrincipalPoint(),\n 0.0, 0.0);\n assertEquals(estimator.getIntrinsic().getHorizontalFocalLength(),\n RadialDistortionRobustEstimator.DEFAULT_FOCAL_LENGTH, 0.0);\n assertEquals(estimator.getIntrinsic().getVerticalFocalLength(),\n RadialDistortionRobustEstimator.DEFAULT_FOCAL_LENGTH, 0.0);\n assertEquals(estimator.getIntrinsic().getSkewness(),\n RadialDistortionRobustEstimator.DEFAULT_SKEW, 0.0);\n assertEquals(estimator.getNumKParams(),\n RadialDistortionRobustEstimator.DEFAULT_NUM_K_PARAMS);\n assertFalse(estimator.arePointsAvailable());\n assertFalse(estimator.isReady());\n assertNull(estimator.getQualityScores());\n\n // test constructor with points\n final List<Point2D> distortedPoints = new ArrayList<>();\n final List<Point2D> undistortedPoints = new ArrayList<>();\n for (int i = 0; i < RadialDistortionRobustEstimator.MIN_NUMBER_OF_POINTS; i++) {\n distortedPoints.add(Point2D.create());\n undistortedPoints.add(Point2D.create());\n }\n\n estimator = new RANSACRadialDistortionRobustEstimator(distortedPoints,\n undistortedPoints);\n\n // check correctness\n assertEquals(estimator.getThreshold(),\n RANSACRadialDistortionRobustEstimator.DEFAULT_THRESHOLD, 0.0);\n assertEquals(estimator.getMethod(), RobustEstimatorMethod.RANSAC);\n assertNull(estimator.getListener());\n assertFalse(estimator.isListenerAvailable());\n assertFalse(estimator.isLocked());\n assertEquals(estimator.getProgressDelta(),\n RANSACRadialDistortionRobustEstimator.DEFAULT_PROGRESS_DELTA,\n 0.0);\n assertEquals(estimator.getConfidence(),\n RANSACRadialDistortionRobustEstimator.DEFAULT_CONFIDENCE, 0.0);\n assertEquals(estimator.getMaxIterations(),\n RANSACRadialDistortionRobustEstimator.DEFAULT_MAX_ITERATIONS);\n assertSame(estimator.getDistortedPoints(), distortedPoints);\n assertSame(estimator.getUndistortedPoints(), undistortedPoints);\n assertNull(estimator.getDistortionCenter());\n assertEquals(estimator.getHorizontalFocalLength(),\n RadialDistortionRobustEstimator.DEFAULT_FOCAL_LENGTH, 0.0);\n assertEquals(estimator.getVerticalFocalLength(),\n RadialDistortionRobustEstimator.DEFAULT_FOCAL_LENGTH, 0.0);\n assertEquals(estimator.getSkew(),\n RadialDistortionRobustEstimator.DEFAULT_SKEW, 0.0);\n assertEquals(estimator.getIntrinsic().getHorizontalPrincipalPoint(),\n 0.0, 0.0);\n assertEquals(estimator.getIntrinsic().getVerticalPrincipalPoint(),\n 0.0, 0.0);\n assertEquals(estimator.getIntrinsic().getHorizontalFocalLength(),\n RadialDistortionRobustEstimator.DEFAULT_FOCAL_LENGTH, 0.0);\n assertEquals(estimator.getIntrinsic().getVerticalFocalLength(),\n RadialDistortionRobustEstimator.DEFAULT_FOCAL_LENGTH, 0.0);\n assertEquals(estimator.getIntrinsic().getSkewness(),\n RadialDistortionRobustEstimator.DEFAULT_SKEW, 0.0);\n assertEquals(estimator.getNumKParams(),\n RadialDistortionRobustEstimator.DEFAULT_NUM_K_PARAMS);\n assertTrue(estimator.arePointsAvailable());\n assertTrue(estimator.isReady());\n assertNull(estimator.getQualityScores());\n\n // Force IllegalArgumentException\n final List<Point2D> emptyPoints = new ArrayList<>();\n estimator = null;\n try {\n estimator = new RANSACRadialDistortionRobustEstimator(emptyPoints,\n undistortedPoints);\n fail(\"IllegalArgumentException expected but not thrown\");\n } catch (final IllegalArgumentException ignore) {\n }\n try {\n estimator = new RANSACRadialDistortionRobustEstimator(emptyPoints,\n emptyPoints);\n fail(\"IllegalArgumentException expected but not thrown\");\n } catch (final IllegalArgumentException ignore) {\n }\n try {\n estimator = new RANSACRadialDistortionRobustEstimator(\n null, undistortedPoints);\n fail(\"IllegalArgumentException expected but not thrown\");\n } catch (final IllegalArgumentException ignore) {\n }\n try {\n estimator = new RANSACRadialDistortionRobustEstimator(\n distortedPoints, null);\n fail(\"IllegalArgumentException expected but not thrown\");\n } catch (final IllegalArgumentException ignore) {\n }\n assertNull(estimator);\n\n // test constructor with points and listener\n estimator = new RANSACRadialDistortionRobustEstimator(distortedPoints,\n undistortedPoints, this);\n\n // check correctness\n assertEquals(estimator.getThreshold(),\n RANSACRadialDistortionRobustEstimator.DEFAULT_THRESHOLD, 0.0);\n assertEquals(estimator.getMethod(), RobustEstimatorMethod.RANSAC);\n assertSame(estimator.getListener(), this);\n assertTrue(estimator.isListenerAvailable());\n assertFalse(estimator.isLocked());\n assertEquals(estimator.getProgressDelta(),\n RANSACRadialDistortionRobustEstimator.DEFAULT_PROGRESS_DELTA,\n 0.0);\n assertEquals(estimator.getConfidence(),\n RANSACRadialDistortionRobustEstimator.DEFAULT_CONFIDENCE, 0.0);\n assertEquals(estimator.getMaxIterations(),\n RANSACRadialDistortionRobustEstimator.DEFAULT_MAX_ITERATIONS);\n assertSame(estimator.getDistortedPoints(), distortedPoints);\n assertSame(estimator.getUndistortedPoints(), undistortedPoints);\n assertNull(estimator.getDistortionCenter());\n assertEquals(estimator.getHorizontalFocalLength(),\n RadialDistortionRobustEstimator.DEFAULT_FOCAL_LENGTH, 0.0);\n assertEquals(estimator.getVerticalFocalLength(),\n RadialDistortionRobustEstimator.DEFAULT_FOCAL_LENGTH, 0.0);\n assertEquals(estimator.getSkew(),\n RadialDistortionRobustEstimator.DEFAULT_SKEW, 0.0);\n assertEquals(estimator.getIntrinsic().getHorizontalPrincipalPoint(),\n 0.0, 0.0);\n assertEquals(estimator.getIntrinsic().getVerticalPrincipalPoint(),\n 0.0, 0.0);\n assertEquals(estimator.getIntrinsic().getHorizontalFocalLength(),\n RadialDistortionRobustEstimator.DEFAULT_FOCAL_LENGTH, 0.0);\n assertEquals(estimator.getIntrinsic().getVerticalFocalLength(),\n RadialDistortionRobustEstimator.DEFAULT_FOCAL_LENGTH, 0.0);\n assertEquals(estimator.getIntrinsic().getSkewness(),\n RadialDistortionRobustEstimator.DEFAULT_SKEW, 0.0);\n assertEquals(estimator.getNumKParams(),\n RadialDistortionRobustEstimator.DEFAULT_NUM_K_PARAMS);\n assertTrue(estimator.arePointsAvailable());\n assertTrue(estimator.isReady());\n assertNull(estimator.getQualityScores());\n\n // Force IllegalArgumentException\n estimator = null;\n try {\n estimator = new RANSACRadialDistortionRobustEstimator(emptyPoints,\n undistortedPoints, this);\n fail(\"IllegalArgumentException expected but not thrown\");\n } catch (final IllegalArgumentException ignore) {\n }\n try {\n estimator = new RANSACRadialDistortionRobustEstimator(emptyPoints,\n emptyPoints, this);\n fail(\"IllegalArgumentException expected but not thrown\");\n } catch (final IllegalArgumentException ignore) {\n }\n try {\n estimator = new RANSACRadialDistortionRobustEstimator(\n null, undistortedPoints, this);\n fail(\"IllegalArgumentException expected but not thrown\");\n } catch (final IllegalArgumentException ignore) {\n }\n try {\n estimator = new RANSACRadialDistortionRobustEstimator(\n distortedPoints, null, this);\n fail(\"IllegalArgumentException expected but not thrown\");\n } catch (final IllegalArgumentException ignore) {\n }\n assertNull(estimator);\n\n // test constructor with points and center\n final Point2D center = Point2D.create();\n\n estimator = new RANSACRadialDistortionRobustEstimator(distortedPoints,\n undistortedPoints, center);\n\n // check correctness\n assertEquals(estimator.getThreshold(),\n RANSACRadialDistortionRobustEstimator.DEFAULT_THRESHOLD, 0.0);\n assertEquals(estimator.getMethod(), RobustEstimatorMethod.RANSAC);\n assertNull(estimator.getListener());\n assertFalse(estimator.isListenerAvailable());\n assertFalse(estimator.isLocked());\n assertEquals(estimator.getProgressDelta(),\n RANSACRadialDistortionRobustEstimator.DEFAULT_PROGRESS_DELTA,\n 0.0);\n assertEquals(estimator.getConfidence(),\n RANSACRadialDistortionRobustEstimator.DEFAULT_CONFIDENCE, 0.0);\n assertEquals(estimator.getMaxIterations(),\n RANSACRadialDistortionRobustEstimator.DEFAULT_MAX_ITERATIONS);\n assertSame(estimator.getDistortedPoints(), distortedPoints);\n assertSame(estimator.getUndistortedPoints(), undistortedPoints);\n assertSame(estimator.getDistortionCenter(), center);\n assertEquals(estimator.getHorizontalFocalLength(),\n RadialDistortionRobustEstimator.DEFAULT_FOCAL_LENGTH, 0.0);\n assertEquals(estimator.getVerticalFocalLength(),\n RadialDistortionRobustEstimator.DEFAULT_FOCAL_LENGTH, 0.0);\n assertEquals(estimator.getSkew(),\n RadialDistortionRobustEstimator.DEFAULT_SKEW, 0.0);\n assertEquals(estimator.getIntrinsic().getHorizontalPrincipalPoint(),\n center.getInhomX(), 0.0);\n assertEquals(estimator.getIntrinsic().getVerticalPrincipalPoint(),\n center.getInhomY(), 0.0);\n assertEquals(estimator.getIntrinsic().getHorizontalFocalLength(),\n RadialDistortionRobustEstimator.DEFAULT_FOCAL_LENGTH, 0.0);\n assertEquals(estimator.getIntrinsic().getVerticalFocalLength(),\n RadialDistortionRobustEstimator.DEFAULT_FOCAL_LENGTH, 0.0);\n assertEquals(estimator.getIntrinsic().getSkewness(),\n RadialDistortionRobustEstimator.DEFAULT_SKEW, 0.0);\n assertEquals(estimator.getNumKParams(),\n RadialDistortionRobustEstimator.DEFAULT_NUM_K_PARAMS);\n assertTrue(estimator.arePointsAvailable());\n assertTrue(estimator.isReady());\n assertNull(estimator.getQualityScores());\n\n // Force IllegalArgumentException\n estimator = null;\n try {\n estimator = new RANSACRadialDistortionRobustEstimator(emptyPoints,\n undistortedPoints, center);\n fail(\"IllegalArgumentException expected but not thrown\");\n } catch (final IllegalArgumentException ignore) {\n }\n try {\n estimator = new RANSACRadialDistortionRobustEstimator(emptyPoints,\n emptyPoints, center);\n fail(\"IllegalArgumentException expected but not thrown\");\n } catch (final IllegalArgumentException ignore) {\n }\n try {\n estimator = new RANSACRadialDistortionRobustEstimator(\n null, undistortedPoints, center);\n fail(\"IllegalArgumentException expected but not thrown\");\n } catch (final IllegalArgumentException ignore) {\n }\n try {\n estimator = new RANSACRadialDistortionRobustEstimator(\n distortedPoints, null, center);\n fail(\"IllegalArgumentException expected but not thrown\");\n } catch (final IllegalArgumentException ignore) {\n }\n assertNull(estimator);\n\n // test constructor with points, center and listener\n estimator = new RANSACRadialDistortionRobustEstimator(distortedPoints,\n undistortedPoints, center, this);\n\n // check correctness\n assertEquals(estimator.getThreshold(),\n RANSACRadialDistortionRobustEstimator.DEFAULT_THRESHOLD, 0.0);\n assertEquals(estimator.getMethod(), RobustEstimatorMethod.RANSAC);\n assertSame(estimator.getListener(), this);\n assertTrue(estimator.isListenerAvailable());\n assertFalse(estimator.isLocked());\n assertEquals(estimator.getProgressDelta(),\n RANSACRadialDistortionRobustEstimator.DEFAULT_PROGRESS_DELTA,\n 0.0);\n assertEquals(estimator.getConfidence(),\n RANSACRadialDistortionRobustEstimator.DEFAULT_CONFIDENCE, 0.0);\n assertEquals(estimator.getMaxIterations(),\n RANSACRadialDistortionRobustEstimator.DEFAULT_MAX_ITERATIONS);\n assertSame(estimator.getDistortedPoints(), distortedPoints);\n assertSame(estimator.getUndistortedPoints(), undistortedPoints);\n assertSame(estimator.getDistortionCenter(), center);\n assertEquals(estimator.getHorizontalFocalLength(),\n RadialDistortionRobustEstimator.DEFAULT_FOCAL_LENGTH, 0.0);\n assertEquals(estimator.getVerticalFocalLength(),\n RadialDistortionRobustEstimator.DEFAULT_FOCAL_LENGTH, 0.0);\n assertEquals(estimator.getSkew(),\n RadialDistortionRobustEstimator.DEFAULT_SKEW, 0.0);\n assertEquals(estimator.getIntrinsic().getHorizontalPrincipalPoint(),\n center.getInhomX(), 0.0);\n assertEquals(estimator.getIntrinsic().getVerticalPrincipalPoint(),\n center.getInhomY(), 0.0);\n assertEquals(estimator.getIntrinsic().getHorizontalFocalLength(),\n RadialDistortionRobustEstimator.DEFAULT_FOCAL_LENGTH, 0.0);\n assertEquals(estimator.getIntrinsic().getVerticalFocalLength(),\n RadialDistortionRobustEstimator.DEFAULT_FOCAL_LENGTH, 0.0);\n assertEquals(estimator.getIntrinsic().getSkewness(),\n RadialDistortionRobustEstimator.DEFAULT_SKEW, 0.0);\n assertEquals(estimator.getNumKParams(),\n RadialDistortionRobustEstimator.DEFAULT_NUM_K_PARAMS);\n assertTrue(estimator.arePointsAvailable());\n assertTrue(estimator.isReady());\n assertNull(estimator.getQualityScores());\n\n // Force IllegalArgumentException\n estimator = null;\n try {\n estimator = new RANSACRadialDistortionRobustEstimator(emptyPoints,\n undistortedPoints, center, this);\n fail(\"IllegalArgumentException expected but not thrown\");\n } catch (final IllegalArgumentException ignore) {\n }\n try {\n estimator = new RANSACRadialDistortionRobustEstimator(emptyPoints,\n emptyPoints, center, this);\n fail(\"IllegalArgumentException expected but not thrown\");\n } catch (final IllegalArgumentException ignore) {\n }\n try {\n estimator = new RANSACRadialDistortionRobustEstimator(\n null, undistortedPoints, center, this);\n fail(\"IllegalArgumentException expected but not thrown\");\n } catch (final IllegalArgumentException ignore) {\n }\n try {\n estimator = new RANSACRadialDistortionRobustEstimator(\n distortedPoints, null, center, this);\n fail(\"IllegalArgumentException expected but not thrown\");\n } catch (final IllegalArgumentException ignore) {\n }\n assertNull(estimator);\n }", "public static ServerActivator getDefault() {\n\t\treturn plugin;\n\t}", "@Test\n public void testCompacity() {\n System.out.println(\"compacity\");\n RecordFile instance = new RecordFile();\n \n Assert.assertEquals(RecordFile.DEFAULT_RECORDS, instance.compacity());\n \n instance = new RecordFile(1000);\n Assert.assertEquals(1000, instance.compacity());\n }", "public static ValidatorFactory getDefault() {\n return DEFAULT_FACTORY;\n }", "private void instantiateProbes() {\n\t\tString probe_str = this.config.getProperty(\"probes.include\", \"all\");\n\t\tString probe_exclude_str = this.config.getProperty(\"probes.exclude\", \"\");\n\t\tString probe_external = this.config.getProperty(\"probes.external\", \"\");\n\t\t\t\t\n\t\ttry {\n\t\t\tArrayList<String> availableProbeList = this.listAvailableProbeClasses();\n\t\t\t//user wants to instantiate all available probes with default params\n\t\t\t//TODO - allow user to parameterize probes when selecting to add all probes\n\t\t\tif (probe_str.equals(\"all\")) {\n\t\t\t\tfor(String s : availableProbeList) \n\t\t\t\t\tthis.probes.put(s, null);\n\t\t\t\t\n\t\t\t\t//user wants to instantiate all available probes except the ones specified for exclusion\n\t\t\t\tif (!probe_exclude_str.equals(\"\")) {\n\t\t\t\t\tString[] probe_list = probe_exclude_str.split(\";\");\n\t\t\t\t\tfor(String s:probe_list)\n\t\t\t\t\t\tthis.probes.remove(s.split(\",\")[0]);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//instantiate\n\t\t\t\tfor(Entry<String,IProbe> p:this.probes.entrySet()){\n\t\t\t\t\ttry{\n\t\t\t\t\t\tIProbe tempProbe = JCProbeFactory.newInstance(PROBE_LIB_PATH, p.getKey());\n\t\t\t\t\t\ttempProbe.attachQueue(this.queue);\n\t\t\t\t\t\ttempProbe.attachLogger(this.logger);\n\t\t\t\t\t\tp.setValue(tempProbe);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (CatascopiaException e) {\n\t\t\t\t\t\tthis.writeToLog(Level.SEVERE, e);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t//user wants to instantiate specific probes (and may set custom params)\n\t\t\telse{\n\t\t\t\tString[] probe_list = probe_str.split(\";\");\n\t\t\t\tfor(String s:probe_list) {\n\t\t\t\t\ttry{\n\t\t\t\t\t\tString[] params = s.split(\",\");\n\t\t\t\t\t\tIProbe tempProbe = JCProbeFactory.newInstance(PROBE_LIB_PATH,params[0]);\n\t\t\t\t\t\ttempProbe.attachQueue(this.queue);\n\t\t\t\t\t\ttempProbe.attachLogger(this.logger);\n\t\t\t\t\t\tif(params.length > 1) //user wants to define custom collecting period\n\t\t\t\t\t\t\ttempProbe.setCollectPeriod(Integer.parseInt(params[1]));\n\t\t\t\t\t\tthis.probes.put(params[0], tempProbe);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (CatascopiaException e) {\n\t\t\t\t\t\tthis.writeToLog(Level.SEVERE, e);\n\t\t\t\t\t\tcontinue;\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\t\t\t\n\t\t\t//activate Agent probes\n\t\t\tthis.activateAllProbes();\n\t\t\t\n\t\t\t//deploy external probes located in a custom user-defined path\n\t\t\tif (!probe_external.equals(\"\")) {\n\t\t\t\tString[] probe_list = probe_external.split(\";\");\n\t\t\t\tfor(String s:probe_list){\n\t\t\t\t\ttry{\n\t\t\t\t\t\tString[] params = s.split(\",\");\n\t\t\t\t\t\tString pclass = params[0];\n\t\t\t\t\t\tString ppath = params[1];\n\t\t\t\t\t\tthis.deployProbeAtRuntime(ppath, pclass);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (ArrayIndexOutOfBoundsException e){\n\t\t\t\t\t\tthis.writeToLog(Level.SEVERE, \"External Probe deployment error. Either the probe class name of classpath are not correctly provided\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\t\t\t\n\t\t\t\n\t\t\t//log probe list added to Agent\n\t\t\tString l = \" \";\n\t\t\tfor(Entry<String,IProbe> entry:this.probes.entrySet())\n\t\t\t\tl += entry.getKey() + \",\";\n\t\t\tthis.writeToLog(Level.INFO,\"Probes Activated: \"+l.substring(0, l.length()-1));\n\t\t}\n\t\tcatch (CatascopiaException e){\n\t\t\tthis.writeToLog(Level.SEVERE, e);\n\t\t}\n\t}", "static RetryPolicy getDefaultRetry() {\n return new ExponentialBackoffRetry(\n CuratorUtils.DEFAULT_CURATOR_POLL_DELAY_MS, CuratorUtils.DEFAULT_CURATOR_MAX_RETRIES);\n }", "public DefaultResponsibleParty() {\n }", "public static MetricTransformation2DRobustEstimator create() {\n return create(DEFAULT_ROBUST_METHOD);\n }", "public DefaultLoaderDefinition() {\n\t\t// nothing to do\n\t}", "Properties defaultProperties();", "public ConfigProfile buildProfileFour() {\n this.topicsRegex = \"^kafka-data[0-9]$\";\n this.token = \"mytoken\";\n this.uri = \"https://dummy:8088\";\n this.raw = true;\n this.ack = false;\n this.indexes = \"index-1\";\n this.sourcetypes = \"kafka-data\";\n this.sources = \"kafka-connect\";\n this.httpKeepAlive = true;\n this.validateCertificates = false;\n this.eventBatchTimeout = 1;\n this.ackPollInterval = 1;\n this.ackPollThreads = 1;\n this.maxHttpConnPerChannel = 1;\n this.totalHecChannels = 1;\n this.socketTimeout = 1;\n this.enrichements = \"hello=world\";\n this.enrichementMap = new HashMap<>();\n this.trackData = false;\n this.maxBatchSize = 1;\n this.numOfThreads = 1;\n this.headerSupport = true;\n this.headerIndex = \"splunk.header.index\";\n this.headerSource = \"splunk.header.source\";\n this.headerSourcetype = \"splunk.header.sourcetype\";\n this.headerHost = \"splunk.header.host\";\n\n return this;\n }", "public static FirefoxProfile firefoxProfile() {\r\n\r\n\t\tFirefoxProfile firefoxProfile = new FirefoxProfile();\r\n\t\tfirefoxProfile.setPreference(\"browser.download.folderList\", 2);\r\n\t\tfirefoxProfile.setPreference(\"browser.download.dir\", testAdminReportPath);\r\n\t\tfirefoxProfile.setPreference(\"browser.helperApps.neverAsk.saveToDisk\", \"text/csv;application/vnd.ms-excel\");\r\n\t\tfirefoxProfile.setPreference(\"browser.helperApps.alwaysAsk.force\", false);\r\n\t\tfirefoxProfile.setPreference(\"geo.enabled\", false);\r\n\t\treturn firefoxProfile;\r\n\t}" ]
[ "0.5725135", "0.53864586", "0.5321977", "0.5111578", "0.49090052", "0.4901311", "0.48924038", "0.48229298", "0.47879207", "0.47431985", "0.47391343", "0.47267738", "0.47077838", "0.46937802", "0.4675973", "0.46682188", "0.4642879", "0.46214217", "0.4620227", "0.46110964", "0.46082866", "0.45977047", "0.4595685", "0.4581968", "0.45340443", "0.45326376", "0.4525329", "0.4520191", "0.4500332", "0.44919047", "0.44855085", "0.44641483", "0.44511083", "0.44419825", "0.4439693", "0.44392794", "0.44386014", "0.4429269", "0.44187665", "0.44182953", "0.44110805", "0.44036925", "0.4401779", "0.43952334", "0.43952334", "0.4382135", "0.4380093", "0.43779904", "0.43779904", "0.43779904", "0.43779904", "0.43779904", "0.43779904", "0.43779904", "0.43779904", "0.4358072", "0.43512172", "0.4349059", "0.4341941", "0.43365893", "0.4335044", "0.4326211", "0.43113223", "0.42995974", "0.42814562", "0.42694566", "0.4268109", "0.42678374", "0.42643058", "0.42409527", "0.4236861", "0.42336026", "0.42311332", "0.42176032", "0.420576", "0.4202118", "0.41990012", "0.41977146", "0.41901687", "0.41826043", "0.41824582", "0.41807655", "0.41791812", "0.41758952", "0.41689292", "0.41586995", "0.41564438", "0.41498366", "0.4149502", "0.4144432", "0.41440472", "0.41418752", "0.4132552", "0.4131964", "0.41255736", "0.41255137", "0.4123899", "0.41215014", "0.4121025", "0.41184196" ]
0.88312846
0
This method checks that all required values have been injected by the system right after construction and injection. This is used to obviate the need to check these values each time in the getProfileCompletenessReport().
@PostConstruct protected void checkInitialization() { ValidationUtility.checkNotNullNorEmpty(profileTaskCheckers, "profileTaskCheckers", ProfileActionConfigurationException.class); ValidationUtility.checkNotNullElements(profileTaskCheckers, "profileTaskCheckers", ProfileActionConfigurationException.class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void performSanityCheck()\n\t{\n\t\tif (variableNames != null && domainSizes != null\n\t\t\t\t&& propositionNames != null)\n\t\t{\n\t\t\tcheckStateSizes();\n\t\t\tcheckDomainSizes();\n\t\t}\n\t}", "public void checkParameters() {\n }", "@Test\n\tpublic void testInjectedComponentsAreNotNull() {\n\t\tassertThat(dataSource).isNotNull();\n\t\tassertThat(jdbcTemplate).isNotNull();\n\t\tassertThat(entityManager).isNotNull();\n\t\tassertThat(productRepository).isNotNull();\n\t\tassertThat(reviewRepository).isNotNull();\n\t}", "private void checkParameters()\n\t\tthrows DiameterMissingAVPException {\n\t\tDiameterClientRequest request = getRequest();\n\t\tDiameterAVPDefinition def = ShUtils.getUserIdentityAvpDefinition(getVersion());\n\t\tif (request.getDiameterAVP(def) == null) {\n\t\t\tthrow new DiameterMissingAVPException(def.getAVPCode());\n\t\t}\n\t\tdef = ShUtils.getDataReferenceAvpDefinition(getVersion());\n\t\tif (request.getDiameterAVP(def) == null) {\n\t\t\tthrow new DiameterMissingAVPException(def.getAVPCode());\n\t\t}\n\t}", "@Inject\n\tvoid setInjectorAndCheckUnboundParametersAreInjectable(Injector injector) {\n\t\tthis.injector = injector;\n\t\tfor (AssistedConstructor<?> c : factoryMethodToConstructor.values()) {\n\t\t\tfor (Parameter p : c.getAllParameters()) {\n\t\t\t\tif (!p.isProvidedByFactory() && !paramCanBeInjected(p, injector)) {\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tthrow newConfigurationException(\"Parameter of type '%s' is not injectable or annotated \"\n\t\t\t\t\t\t\t+ \"with @Assisted for Constructor '%s'\", p, c);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void checkInitialization()\n {\n if (!initialized)\n throw new SecurityException(\"ArrayBag object is not initialized \" +\n \"properly.\");\n }", "boolean isInjected();", "public void doRequiredCheck() {\n\t\tthis.checkValue(listener);\n\t}", "@Value.Check\n default void checkPreconditions()\n {\n RangeCheck.checkIncludedInInteger(\n this.feedback(),\n \"Feedback\",\n RangeInclusiveI.of(0, 7),\n \"Valid feedback values\");\n\n RangeCheck.checkIncludedInInteger(\n this.transpose(),\n \"Transpose\",\n RangeInclusiveI.of(-24, 24),\n \"Valid transpose values\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR1Level(),\n \"Pitch R1 Level\",\n RangeInclusiveI.of(0, 99),\n \"Valid levels\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR1Rate(),\n \"Pitch R1 Rate\",\n RangeInclusiveI.of(0, 99),\n \"Valid rates\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR2Level(),\n \"Pitch R2 Level\",\n RangeInclusiveI.of(0, 99),\n \"Valid levels\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR2Rate(),\n \"Pitch R2 Rate\",\n RangeInclusiveI.of(0, 99),\n \"Valid rates\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR3Level(),\n \"Pitch R3 Level\",\n RangeInclusiveI.of(0, 99),\n \"Valid levels\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR3Rate(),\n \"Pitch R3 Rate\",\n RangeInclusiveI.of(0, 99),\n \"Valid rates\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR4Level(),\n \"Pitch R4 Level\",\n RangeInclusiveI.of(0, 99),\n \"Valid levels\");\n\n RangeCheck.checkIncludedInInteger(\n this.pitchEnvelopeR4Rate(),\n \"Pitch R4 Rate\",\n RangeInclusiveI.of(0, 99),\n \"Valid rates\");\n\n RangeCheck.checkIncludedInInteger(\n this.lfoPitchModulationDepth(),\n \"LFO Pitch Modulation Depth\",\n RangeInclusiveI.of(0, 99),\n \"Valid pitch modulation depth values\");\n\n RangeCheck.checkIncludedInInteger(\n this.lfoPitchModulationSensitivity(),\n \"LFO Pitch Modulation Sensitivity\",\n RangeInclusiveI.of(0, 7),\n \"Valid pitch modulation sensitivity values\");\n\n RangeCheck.checkIncludedInInteger(\n this.lfoAmplitudeModulationDepth(),\n \"LFO Amplitude Modulation Depth\",\n RangeInclusiveI.of(0, 99),\n \"Valid amplitude modulation depth values\");\n\n RangeCheck.checkIncludedInInteger(\n this.lfoSpeed(),\n \"LFO Speed\",\n RangeInclusiveI.of(0, 99),\n \"Valid LFO speed values\");\n\n RangeCheck.checkIncludedInInteger(\n this.lfoDelay(),\n \"LFO Delay\",\n RangeInclusiveI.of(0, 99),\n \"Valid LFO delay values\");\n }", "private void check()\n {\n Preconditions.checkArgument(name != null, \"Property name missing\");\n Preconditions.checkArgument(valueOptions != null || valueMethod != null, \"Value method missing\");\n Preconditions.checkArgument(\n !(this.validationRegex != null && this.valueOptions != null && this.valueOptionsMustMatch),\n \"Cant have regexp validator and matching options at the same time\");\n\n if (required == null)\n {\n /*\n If a property has a default value, the common case is that it's required.\n However, we need to allow for redundant calls of required(): defaultOf(x).required();\n and for unusual cases where a property has a default value but it's optional: defaultOf(x).required(false).\n */\n required = this.defaultValue != null;\n }\n\n if (description == null)\n description = \"Property name: \" + name + \", required = \" + required;\n\n if (valueOptions != null && defaultValue != null)\n {\n for (PropertySpec.Value v : valueOptions)\n {\n if (v.value.equals(defaultValue.value))\n v.isDefault = true;\n }\n }\n\n if (dependsOn != null)\n {\n if (category == null)\n throw new IllegalArgumentException(\"category required when dependsOn is set \" + name);\n\n if (!dependsOn.isOptionsOnly())\n throw new IllegalArgumentException(\n \"Invalid dependsOn propertySpec (must be optionsOnly) \" + dependsOn.name());\n }\n }", "private void checkValid() {\n getSimType();\n getInitialConfig();\n getIsOutlined();\n getEdgePolicy();\n getNeighborPolicy();\n getCellShape();\n }", "protected void check() throws IOException, ServletException {\n if(value.length()==0)\n error(\"please specify a configuration\");\n else {\n \t\t//TODO add more checks\n \t\tok();\n }\n }", "@Override\n public void checkProfileUserData() {\n mProfilePresenter.checkProfileUserData();\n }", "@PostConstruct\n private void postConstruct() {\n if (customValue == null) {\n throw new RuntimeException(\"[customValue] property is not set \");\n }\n if (customSecondValue == null) {\n throw new RuntimeException(\"[customSecondValue] property is not set \");\n }\n }", "@Override\n protected void postInitializeMethod() {\n Debug.printLogError(TAG, \"postInitializeMethod_1: \" + Validator.getInstance().checkEmpty(\"\", 0), false);\n Debug.printLogError(TAG, \"postInitializeMethod_2: \" + Validator.getInstance().checkEmpty(\"\", 0.00), false);\n Debug.printLogError(TAG, \"postInitializeMethod_3: \" + Validator.getInstance().checkEmpty(\"\", \"no_data\"), false);\n\n ValueExtractor valueExtractor = new ValueExtractor(this);\n Debug.printLogError(TAG, \"postInitializeMethod_4: \"\n + valueExtractor.getValue(\"hasValue\", \"\"), false);\n\n /*\n * Fetch value on second screen which is passed through intent.putExtra();\n * */\n String firstValue = valueExtractor.getValue(\"value1\", \"1\");\n int secondValue = valueExtractor.getValue(\"value2\", 2);\n boolean isAdd = valueExtractor.getValue(\"value3\", false);\n\n /*\n * SharedPreferences class\n * */\n SharedPreferencesUtility sp = new SharedPreferencesUtility(mContext);\n sp.setString(\"key1\", \"komal\");\n sp.setInteger(\"key2\", 1224);\n sp.setBoolean(\"isPass\", false);\n\n String str1 = sp.getString(\"key1\", \"komal\");\n int int1 = sp.getInteger(\"key2\", 0);\n boolean b1 = sp.getBoolean(\"isPass\", false);\n }", "private void validateContext() {\n\t\tif (irodsAccessObjectFactory == null) {\n\t\t\tthrow new JargonRuntimeException(\"null irodsAccessObjectFactory\");\n\t\t}\n\n\t\tif (dataProfilerSettings == null) {\n\t\t\tthrow new JargonRuntimeException(\"null dataProfilerSettings\");\n\t\t}\n\n\t\tif (dataTypeResolutionServiceFactory == null) {\n\t\t\tthrow new IllegalArgumentException(\"null dataTypeResolutionServiceFactory\");\n\t\t}\n\n\t}", "private static void assertContextInjected() {\n if (applicationContext == null) {\n throw new IllegalStateException(\"applicaitonContext attribute is not injected, please enter applicationContext\" +\n \"Define SpringContextHolder in .xml or register SpringContextHolder in SpringBoot startup class.\");\n }\n }", "private void validateBuildParameters() {\n if (TextUtils.isEmpty(consumerKey)) {\n throw new IllegalArgumentException(\"CONSUMER_KEY not set\");\n }\n if (TextUtils.isEmpty(consumerSecret)) {\n throw new IllegalArgumentException(\"CONSUMER_SECRET not set\");\n }\n if (TextUtils.isEmpty(token)) {\n throw new IllegalArgumentException(\"TOKEN not set, the user must be logged it\");\n }\n if (TextUtils.isEmpty(tokenSecret)) {\n throw new IllegalArgumentException(\"TOKEN_SECRET not set, the user must be logged it\");\n }\n }", "private void checkInitialization()\r\n\t{\r\n\t\tif ( !initialized )\r\n\t\t{\r\n\t\t\tthrow new SecurityException( \"Calculator is not properly initialized.\" );\r\n\t\t}//end if\r\n\t}", "private void checkMandatoryArgs(UserResource target, Errors errors) {\n final String proc = PACKAGE_NAME + \".checkMandatoryArgs.\";\n final String email = target.getEmail();\n final String password = target.getPassword();\n final String lastName = target.getLastName();\n\n logger.debug(\"Entering: \" + proc + \"10\");\n\n if (TestUtils.isEmptyOrWhitespace(email)) {\n errors.rejectValue(\"email\", \"user.email.required\");\n }\n logger.debug(proc + \"20\");\n\n if (TestUtils.isEmptyOrWhitespace(password)) {\n errors.rejectValue(\"password\", \"user.password.required\");\n }\n logger.debug(proc + \"30\");\n\n if (TestUtils.isEmptyOrWhitespace(lastName)) {\n errors.rejectValue(\"lastName\", \"userLastName.required\");\n }\n logger.debug(\"Leaving: \" + proc + \"40\");\n }", "protected void check() throws IOException, ServletException {\n if(value.length()==0)\n error(\"please specify at least one component\");\n else {\n \t\t//TODO add more checks\n \t\tok();\n }\n }", "protected void validateAndSetValues()\n\t\t{\n\t\t\tif (null == eventDispatcher)\n\t\t\t{\n\t\t\t\teventDispatcher = new DefaultEventDispatcher();\n\t\t\t}\n\t\t\tif (null == sessionAttributes)\n\t\t\t{\n\t\t\t\tsessionAttributes = new HashMap<String, Object>();\n\t\t\t}\n\t\t\tif (null == reconnectPolicy)\n\t\t\t{\n\t\t\t\treconnectPolicy = ReconnectPolicy.NO_RECONNECT;\n\t\t\t}\n\t\t\tcreationTime = System.currentTimeMillis();\n\t\t}", "private static void checkRequiredProperties()\n\t{\n\t\tfor (ServerProperty prop : ServerProperty.values())\n\t\t{\n\t\t\tif (prop.isRequired())\n\t\t\t{\n\t\t\t\t// TODO\n//\t\t\t\tswitch (prop)\n//\t\t\t\t{\n//\t\t\t\t\tcase GERMINATE_AVAILABLE_PAGES:\n//\t\t\t\t\t\tSet<Page> availablePages = getSet(prop, Page.class);\n//\t\t\t\t\t\tif (CollectionUtils.isEmpty(availablePages))\n//\t\t\t\t\t\t\tthrowException(prop);\n//\t\t\t\t\t\tbreak;\n//\n//\t\t\t\t\tcase GERMINATE_USE_AUTHENTICATION:\n//\t\t\t\t\t\tboolean useAuthentication = getBoolean(prop);\n//\t\t\t\t\t\tif (useAuthentication)\n//\t\t\t\t\t\t{\n//\t\t\t\t\t\t\tif (StringUtils.isEmpty(get(ServerProperty.GERMINATE_GATEKEEPER_SERVER)))\n//\t\t\t\t\t\t\t\tthrowException(ServerProperty.GERMINATE_GATEKEEPER_SERVER);\n//\t\t\t\t\t\t\tif (StringUtils.isEmpty(get(ServerProperty.GERMINATE_GATEKEEPER_NAME)))\n//\t\t\t\t\t\t\t\tthrowException(ServerProperty.GERMINATE_GATEKEEPER_NAME);\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\tbreak;\n//\n//\t\t\t\t\tcase GERMINATE_GATEKEEPER_REGISTRATION_ENABLED:\n//\t\t\t\t\t\tboolean registrationNeedsGatekeeper = getBoolean(prop);\n//\n//\t\t\t\t\t\tif (registrationNeedsGatekeeper)\n//\t\t\t\t\t\t{\n//\t\t\t\t\t\t\tString gatekeeperUrl = get(ServerProperty.GERMINATE_GATEKEEPER_URL);\n//\n//\t\t\t\t\t\t\tif (StringUtils.isEmpty(gatekeeperUrl))\n//\t\t\t\t\t\t\t\tthrowException(ServerProperty.GERMINATE_GATEKEEPER_URL);\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\tbreak;\n//\n//\t\t\t\t\tdefault:\n\t\t\t\tif (StringUtils.isEmpty(get(prop)))\n\t\t\t\t\tthrowException(prop);\n//\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@PostConstruct\n public void init() {\n hasLength(env.getProperty(\"grouperClient.webService.url\"),\n \"property 'grouperClient.webService.url' is required\");\n hasLength(env.getProperty(\"grouperClient.webService.login\"),\n \"property 'grouperClient.webService.login' is required\");\n hasLength(env.getProperty(\"grouperClient.webService.password\"),\n \"property 'grouperClient.webService.password' is required\");\n }", "@Test(expected = CopilotServiceInitializationException.class)\n public void testCheckNullForInjectedValueFailure() {\n Helper.checkNullForInjectedValue(null, \"obj\");\n }", "private void checkIntentHelperInitializedAndReliabilityTrackingEnabled() {\n mFakeIntentHelper.assertInitialized(UPDATE_APP_PACKAGE_NAME, DATA_APP_PACKAGE_NAME);\n\n // Assert that reliability tracking is always enabled after initialization.\n mFakeIntentHelper.assertReliabilityTriggerScheduled();\n }", "@Override\n\tprotected void validateParameterValues() {\n\t\t\n\t}", "@Override\n\t\tpublic void checkPreconditions() {\n\t\t}", "@Override\r\n\tpublic boolean CheckConditions() {\n\t\treturn true;\r\n\t}", "public void verifyValues() {\r\n // update the values view to the latest version, then proceed to verify\r\n // as usual. \r\n values = map.values();\r\n super.verifyValues();\r\n }", "public void validateAttributes() {\n if ((totalNumBuckets <= 0)) {\n throw new IllegalStateException(\n String.format(\n \"TotalNumBuckets %s is an illegal value, please choose a value greater than 0\",\n totalNumBuckets));\n }\n if ((redundancy < 0) || (redundancy >= 4)) {\n throw new IllegalStateException(\n String.format(\n \"RedundantCopies %s is an illegal value, please choose a value between 0 and 3\",\n redundancy));\n }\n for (final Object value : getLocalProperties().keySet()) {\n String propName = (String) value;\n if (!PartitionAttributesFactory.LOCAL_MAX_MEMORY_PROPERTY.equals(propName)) {\n throw new IllegalStateException(\n String.format(\"Unknown local property: '%s'\",\n propName));\n }\n }\n for (final Object o : getGlobalProperties().keySet()) {\n String propName = (String) o;\n if (!PartitionAttributesFactory.GLOBAL_MAX_BUCKETS_PROPERTY.equals(propName)\n && !PartitionAttributesFactory.GLOBAL_MAX_MEMORY_PROPERTY.equals(propName)) {\n throw new IllegalStateException(\n String.format(\"Unknown global property: '%s'\",\n propName));\n }\n }\n if (recoveryDelay < -1) {\n throw new IllegalStateException(\"RecoveryDelay \" + recoveryDelay\n + \" is an illegal value, please choose a value that is greater than or equal to -1\");\n }\n if (startupRecoveryDelay < -1) {\n throw new IllegalStateException(\"StartupRecoveryDelay \" + startupRecoveryDelay\n + \" is an illegal value, please choose a value that is greater than or equal to -1\");\n }\n if (fixedPAttrs != null) {\n List<FixedPartitionAttributesImpl> duplicateFPAattrsList =\n new ArrayList<>();\n Set<FixedPartitionAttributes> fpAttrsSet = new HashSet<>();\n for (FixedPartitionAttributesImpl fpa : fixedPAttrs) {\n if (fpa == null || fpa.getPartitionName() == null) {\n throw new IllegalStateException(\n \"Fixed partition name cannot be null\");\n }\n if (fpAttrsSet.contains(fpa)) {\n duplicateFPAattrsList.add(fpa);\n } else {\n fpAttrsSet.add(fpa);\n }\n }\n if (duplicateFPAattrsList.size() != 0) {\n throw new IllegalStateException(\n String.format(\"Partition name %s can be added only once in FixedPartitionAttributes\",\n duplicateFPAattrsList));\n }\n }\n }", "private static boolean verifyProperties(Properties pProperties){\n boolean completeParams = false;\n if (pProperties.getProperty(UtilsConnection.CONSUMER_KEY) != null &&\n pProperties.getProperty(UtilsConnection.CONSUMER_SECRET) != null &&\n pProperties.getProperty(UtilsConnection.ACCESS_TOKEN) != null &&\n pProperties.getProperty(UtilsConnection.ACCESS_TOKEN_SECRET) != null )\n completeParams = true;\n return completeParams;\n }", "protected void checkComponents() throws Exception {\r\n if (InitialData == null) {\r\n throw new Exception(\"Initial data not set.\");\r\n }\r\n if (Oracle == null) {\r\n throw new Exception(\"Oracle not set.\");\r\n }\r\n if (SearchSpace == null) {\r\n throw new Exception(\"Search space not set.\");\r\n }\r\n if (ObjectiveFunction == null) {\r\n throw new Exception(\"Ranker not set.\");\r\n }\r\n }", "void check()\n {\n final ScopeSymbolValidator validator = new ScopeSymbolValidator();\n for (ServiceMethod method : methods)\n validator.validate(method.getName(), method);\n }", "protected void initialize() {\n SystemParameterDTO oysterGoodwillNoApprovalRequiredLowerLimitDTO = systemParameterService.findByCode(OYSTER_GOODWILL_NO_APPROVALREQD_LOWER_LIMIT);\r\n SystemParameterDTO oysterGoodwillNoApprovalRequiredUpperLimitDTO = systemParameterService.findByCode(OYSTER_GOODWILL_NO_APPROVALREQD_UPPER_LIMIT);\r\n SystemParameterDTO oysterGoodwillFirstStageApprovalUpperLimitDTO = systemParameterService.findByCode(OYSTER_GOODWILL_FIRSTSTAGEAPPROVAL_UPPER_LIMIT);\r\n SystemParameterDTO oysterOtherrefundsNoApprovalRequiredLowerLimitDTO = systemParameterService.findByCode(OYSTER_OTHERREFUNDS_NO_APPROVALREQD_LOWER_LIMIT);\r\n SystemParameterDTO oysterOtherrefundsNoApprovalRequiredUpperLimitDTO = systemParameterService.findByCode(OYSTER_OTHERREFUNDS_NO_APPROVALREQD_UPPER_LIMIT);\r\n SystemParameterDTO oysterOtherrefundsFirstStageApprovalUpperLimitDTO = systemParameterService.findByCode(OYSTER_OTHERREFUNDS_FIRSTSTAGEAPPROVAL_UPPER_LIMIT);\r\n SystemParameterDTO luGoodwillNoApprovalRequiredLowerLimitDTO = systemParameterService.findByCode(LU_GOODWILL_NO_APPROVALREQD_LOWER_LIMIT);\r\n SystemParameterDTO luGoodwillNoApprovalRequiredUpperLimitDTO = systemParameterService.findByCode(LU_GOODWILL_NO_APPROVALREQD_UPPER_LIMIT);\r\n SystemParameterDTO luGoodwillFirstStageApprovalUpperLimitDTO = systemParameterService.findByCode(LU_GOODWILL_FIRSTSTAGEAPPROVAL_UPPER_LIMIT);\r\n SystemParameterDTO ccsGoodwillNoApprovalRequiredLowerLimitDTO = systemParameterService.findByCode(CCS_GOODWILL_NO_APPROVALREQD_LOWER_LIMIT);\r\n SystemParameterDTO ccsGoodwillNoApprovalRequiredUpperLimitDTO = systemParameterService.findByCode(CCS_GOODWILL_NO_APPROVALREQD_UPPER_LIMIT);\r\n SystemParameterDTO ccsGoodwillFirstStageApprovalUpperLimitDTO = systemParameterService.findByCode(CCS_GOODWILL_FIRSTSTAGEAPPROVAL_UPPER_LIMIT);\r\n\r\n oysterGoodwillNoApprovalRequiredLowerLimit = Integer.valueOf(oysterGoodwillNoApprovalRequiredLowerLimitDTO.getValue());\r\n oysterGoodwillNoApprovalRequiredUpperLimit = Integer.valueOf(oysterGoodwillNoApprovalRequiredUpperLimitDTO.getValue());\r\n oysterGoodwillFirstStageApprovalLowerLimit = oysterGoodwillNoApprovalRequiredUpperLimit + SINGLE_PENNY_OFFSET;\r\n oysterGoodwillFirstStageApprovalUpperLimit = Integer.valueOf(oysterGoodwillFirstStageApprovalUpperLimitDTO.getValue());\r\n oysterGoodwillSecondStageApprovalLowerLimit = oysterGoodwillFirstStageApprovalUpperLimit + SINGLE_PENNY_OFFSET;\r\n \r\n oysterOtherrefundsNoApprovalRequiredLowerLimit = Integer.valueOf(oysterOtherrefundsNoApprovalRequiredLowerLimitDTO.getValue());\r\n oysterOtherrefundsNoApprovalRequiredUpperLimit = Integer.valueOf(oysterOtherrefundsNoApprovalRequiredUpperLimitDTO.getValue());\r\n oysterOtherrefundsFirstStageApprovalLowerLimit = oysterOtherrefundsNoApprovalRequiredUpperLimit + SINGLE_PENNY_OFFSET;\r\n oysterOtherrefundsFirstStageApprovalUpperLimit = Integer.valueOf(oysterOtherrefundsFirstStageApprovalUpperLimitDTO.getValue());\r\n oysterOtherrefundsSecondStageApprovalLowerLimit = oysterOtherrefundsFirstStageApprovalUpperLimit + SINGLE_PENNY_OFFSET;\r\n \r\n luGoodwillNoApprovalRequiredLowerLimit = Integer.valueOf(luGoodwillNoApprovalRequiredLowerLimitDTO.getValue());\r\n luGoodwillNoApprovalRequiredUpperLimit = Integer.valueOf(luGoodwillNoApprovalRequiredUpperLimitDTO.getValue());\r\n luGoodwillFirstStageApprovalLowerLimit = luGoodwillNoApprovalRequiredUpperLimit + SINGLE_PENNY_OFFSET;\r\n luGoodwillFirstStageApprovalUpperLimit = Integer.valueOf(luGoodwillFirstStageApprovalUpperLimitDTO.getValue());\r\n luGoodwillSecondStageApprovalLowerLimit = luGoodwillFirstStageApprovalUpperLimit + SINGLE_PENNY_OFFSET;\r\n \r\n ccsGoodwillNoApprovalRequiredLowerLimit = Integer.valueOf(ccsGoodwillNoApprovalRequiredLowerLimitDTO.getValue());\r\n ccsGoodwillNoApprovalRequiredUpperLimit = Integer.valueOf(ccsGoodwillNoApprovalRequiredUpperLimitDTO.getValue());\r\n ccsGoodwillFirstStageApprovalLowerLimit = ccsGoodwillNoApprovalRequiredUpperLimit + SINGLE_PENNY_OFFSET;\r\n ccsGoodwillFirstStageApprovalUpperLimit = Integer.valueOf(ccsGoodwillFirstStageApprovalUpperLimitDTO.getValue());\r\n ccsGoodwillSecondStageApprovalLowerLimit= ccsGoodwillFirstStageApprovalUpperLimit + SINGLE_PENNY_OFFSET ;\r\n\r\n RULE_BREACH_DESCRIPTION_MAXIMUM_LIMIT_TEXT = contentDataService.findByLocaleAndCode(RULE_BREACH_DESCRIPTION_MAXIUMUM_LIMIT_KEY,\r\n LocaleConstant.ENGLISH_UNITED_KINGDOM_LOCALE.toString()).getContent();\r\n }", "private void checkInitialization()\n {\n if (!initialized)\n throw new SecurityException(\"VectorStack object is not initialized \" +\n \"properly.\");\n }", "public void afterPropertiesSet() {\n super.afterPropertiesSet();\n\n debug(\"Plugin validated\");\n\n }", "void check()\n {\n checkUsedType(responseType);\n checkUsedType(requestType);\n }", "private void validate() throws IllegalStateException {\n if (StringUtils.isBlank(this.experimentKey)) {\n throw new IllegalStateException(\"Experiment key must be present!\");\n }\n if (!this.alive) {\n throw new IllegalStateException(\"Experiment was not initialized. You need to call init().\");\n }\n }", "private void validateDependencies() throws ReportingSystemException {\r\n\r\n\t\tif (calculationService == null || manipulationService == null || incomingRankingService == null\r\n\t\t\t\t|| outgoingRankingService == null || dataReader == null || dataWriter == null)\r\n\t\t\tthrow new ReportingSystemException(\r\n\t\t\t\t\tReportingSystemResourceUtil.getValue(ReportingSystemConstants.EXCEPTION_DEPENDENCY_INJECTION));\r\n\r\n\t}", "private void checkLanguagePreferences() {\n if (submitter.languagePref == null) {\n if (rootValidator.autorepair) {\n submitter.languagePref = new ArrayList<StringWithCustomTags>();\n addInfo(\"Submitter language preference collection was null - autorepaired\", submitter);\n } else {\n addInfo(\"Submitter language preference collection is null\", submitter);\n }\n } else {\n if (submitter.languagePref.size() > 3) {\n addError(\"Submitter exceeds limit on language preferences (3)\", submitter);\n }\n for (StringWithCustomTags s : submitter.languagePref) {\n checkRequiredString(s, \"language pref\", submitter);\n }\n }\n }", "private void validate() {\n Validate.notNull(uriLocatorFactory);\n Validate.notNull(preProcessorExecutor);\n }", "public void checkInit() {\r\n super.checkInit();\r\n ValidationUtility.checkNotNull(groupService, \"groupService\",\r\n SecurityGroupsActionConfigurationException.class);\r\n }", "private void checkRequiredFields() {\n // check the fields which should be non-null\n if (configFileName == null || configFileName.trim().length() == 0) {\n throw new DAOConfigurationException(\n \"The 'configFileName' should not be null.\");\n }\n if (configNamespace == null || configNamespace.trim().length() == 0) {\n throw new DAOConfigurationException(\n \"The 'configNamespace' should not be null.\");\n }\n if (searchBundleManagerNamespace == null\n || searchBundleManagerNamespace.trim().length() == 0) {\n throw new DAOConfigurationException(\n \"The 'searchBundleManagerNamespace' should not be null.\");\n }\n if (entityManager == null) {\n throw new DAOConfigurationException(\n \"The 'entityManager' should not be null.\");\n }\n }", "@Override\n public void afterPropertiesSet() {\n validateProperties();\n }", "public void validate() {\n transportStats.validate(this);\n\n for (String unitName : produces) {\n Args.validate(!UnitFactory.hasUnitForName(unitName), \"Illegal unit name \" + unitName + \" in build unit stats\");\n }\n\n for (Map.Entry<String, String> entry : buildCities.entrySet()) {\n String terrainName = entry.getKey();\n String cityName = entry.getValue();\n Args.validate(!TerrainFactory.hasTerrainForName(terrainName), \"Illegal terrain \" + terrainName + \" in build cities stats\");\n Args.validate(!CityFactory.hasCityForName(cityName), \"Illegal city \" + cityName + \" in build cities stats\");\n }\n\n for (String unitName : supplyUnits) {\n Args.validate(!UnitFactory.hasUnitForName(unitName), \"Illegal unit \" + unitName + \" in supply units stats\");\n }\n\n for (String unitName : supplyUnitsInTransport) {\n Args.validate(!UnitFactory.hasUnitForName(unitName), \"Illegal unit \" + unitName + \" in supply units in transport stats\");\n }\n\n Args.validate(StringUtil.hasContent(primaryWeaponName) && !WeaponFactory.hasWeapon(primaryWeaponName),\n \"Illegal primary weapon \" + primaryWeaponName + \" for unit \" + name);\n Args.validate(StringUtil.hasContent(secondaryWeaponName) && !WeaponFactory.hasWeapon(secondaryWeaponName),\n \"Illegal secondary weapon \" + secondaryWeaponName + \" for unit \" + name);\n }", "protected void checkConfiguration() {\n \tsuper.checkConfiguration();\n \t\n if (this.customizations == null) {\n this.customizations = new ArrayList<String>();\n }\n if (this.options == null) {\n this.options = new HashMap<String, String>();\n }\n if (this.sourceDirectories == null) {\n \tthis.sourceDirectories = new ArrayList<String>();\n \tthis.sourceDirectories.add(DEFAULT_SOURCE_DIRECTORY);\n }\n }", "@Override\r\n public void validateParameters(PluginRequest request) {\n }", "@Override\n\tpublic boolean hasParameterGuard() {\n\t\treturn true;\n\t}", "@Override\n\tprotected boolean validateRequiredParameters() throws Exception {\n\t\treturn true;\n\t}", "@Override\n @SuppressWarnings(\"PMD.SignatureDeclareThrowsException\")\n public void afterPropertiesSet() throws Exception {\n Assert.hasText(this.projectIdKey, \"projectIdKey must not be empty\");\n }", "@PostConstruct\r\n\t public void initApplication() {\r\n\t log.info(\"Running with Spring profile(s) : {}\", Arrays.toString(env.getActiveProfiles()));\r\n\t Collection<String> activeProfiles = Arrays.asList(env.getActiveProfiles());\r\n\t if (activeProfiles.contains(Constants.SPRING_PROFILE_DEVELOPMENT) && activeProfiles.contains(Constants.SPRING_PROFILE_PRODUCTION)) {\r\n\t log.error(\"You have misconfigured your application! It should not run \" +\r\n\t \"with both the 'dev' and 'prod' profiles at the same time.\");\r\n\t }\r\n\t if (activeProfiles.contains(Constants.SPRING_PROFILE_DEVELOPMENT) && activeProfiles.contains(Constants.SPRING_PROFILE_CLOUD)) {\r\n\t log.error(\"You have misconfigured your application! It should not\" +\r\n\t \"run with both the 'dev' and 'cloud' profiles at the same time.\");\r\n\t }\r\n\t }", "boolean hasPredefinedValues();", "private void validateInputParameters(){\n\n }", "private void checkParams() throws InvalidParamException{\r\n String error = svm.svm_check_parameter(this.problem, this.param);\r\n if(error != null){\r\n throw new InvalidParamException(\"Invalid parameter setting!\" + error);\r\n }\r\n }", "public boolean checkSelf() {\n\t\tboolean ok = true;\n\t\tif (controller == null) {\n\t\t\tSystem.err.println(\"CRParameters :: controller not set\");\n\t\t\tok = false;\n\t\t}\n\t\tif (scenario.length() == 0 && controller.getWorld().getHasScenarios()) {\n\t\t\tSystem.err.println(\"CRParameters :: scenario not set\");\n\t\t\tok = false;\n\t\t}\n\t\tif (reportFolderName.length() == 0) {\n\t\t\tSystem.err.println(\"CRParameters :: report folder not set\");\n\t\t\tok = false;\n\t\t}\n\t\tif (trialDuration <= 0) {\n\t\t\tSystem.err.println(\"CRParameters :: trial duration not set or 0\");\n\t\t\tok = false;\n\t\t}\n\t\tif (numOfRuns <= 0) {\n\t\t\tSystem.err.println(\"CRParameters :: number of runs not set or 0\");\n\t\t\tok = false;\n\t\t}\n\t\tif (numOfTrials <= 0) {\n\t\t\tSystem.err.println(\"CRParameters :: number of trials not set or 0\");\n\t\t\tok = false;\n\t\t}\n\t\treturn ok;\n\t}", "private void validateParameters() {\r\n if (command == null) {\r\n throw new BuildException(\r\n \"'command' parameter should not be null for coverity task.\");\r\n }\r\n\r\n }", "private void checkStateSizes()\n\t{\n\t\tif (variableNames.size() != domainSizes.size())\n\t\t{\n\t\t\tif (DEBUG)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Variable names length = \"\n\t\t\t\t\t\t+ variableNames.size());\n\t\t\t\tSystem.out\n\t\t\t\t\t\t.println(\"Domain size length = \" + domainSizes.size());\n\t\t\t}\n\t\t\tSystem.err.println(\"Numbers of state variables in inputs differ.\");\n\t\t\tSystem.exit(1);\n\t\t}\n\n\t}", "private void validateOptionalParams(StringBuilder errors) throws Exception {\n // Validate RECON_PARTIAL_TRIGGER Option configuration.\n String paramValue = inputParams.getProperty(\"RECON_PARTIAL_TRIGGER\");\n if(paramValue!=null && !paramValue.trim().isEmpty()){\n StringTokenizer tokens = new StringTokenizer(paramValue, Constants.TOKEN_SEPARATOR);\n while(tokens.hasMoreElements()){\n try{\n PartialTriggerOptions.valueOf(tokens.nextToken());\n }catch(Exception ex){\n errors.append(\"Invalid Parameter Configuration for RECON_PARTIAL_TRIGGER. Please correct.\"\n + System.getProperty(\"line.separator\"));\n }\n }\n }\n // Validate TARGET_SHARED_IDSTORE_SEARCHBASE\n paramValue = inputParams.getProperty(\"TARGET_SHARED_IDSTORE_SEARCHBASE\");\n if(paramValue==null || paramValue.trim().isEmpty()){\n Logger.getLogger(IdentityReconciliationProcessor.class.getName()).log(Level.INFO, \n \"Parameter [Optional] TARGET_SHARED_IDSTORE_SEARCHBASE not configured. \" +\n \"Highly recommended to configure this parameter. Note that - This may result in performance issue.\");\n }\n paramValue = inputParams.getProperty(Constants.BATCH_SIZE_ATTR);\n if(paramValue!=null && !paramValue.trim().isEmpty()){\n try{\n getBatchSize(paramValue);\n }catch(Exception ex){\n errors.append(\"Invalid Parameter Configuration for Batch Size. Please correct.\"\n + System.getProperty(\"line.separator\"));\n }\n }\n }", "protected void validateCredentials() throws BittrexApiException {\n String humanMessage = \"Please check environment variables or VM options\";\n if (Strings.isNullOrEmpty(this.getApiKey()))\n throw new BittrexApiException(\"Missing BITTREX_API_KEY. \" + humanMessage);\n if (Strings.isNullOrEmpty(this.getSecretKey()))\n throw new BittrexApiException(\"Missing BITTREX_SECRET_KEY. \" + humanMessage);\n }", "private void validateInitialParams() throws IllegalArgumentException {\n if (StringUtils.isBlank(this.apiKey)) {\n throw new IllegalArgumentException(\"API key is not specified!\");\n }\n if (StringUtils.isBlank(this.baseUrl)) {\n throw new IllegalArgumentException(\"The Comet base URL is not specified!\");\n }\n }", "@Test\n @SmallTest\n public void tesUiccCartdInfoSanity() {\n assertEquals(0, mUicccard.getNumApplications());\n assertNull(mUicccard.getCardState());\n assertNull(mUicccard.getUniversalPinState());\n assertNull(mUicccard.getOperatorBrandOverride());\n /* CarrierPrivilegeRule equals null, return true */\n assertTrue(mUicccard.areCarrierPriviligeRulesLoaded());\n for (IccCardApplicationStatus.AppType mAppType :\n IccCardApplicationStatus.AppType.values()) {\n assertFalse(mUicccard.isApplicationOnIcc(mAppType));\n }\n }", "protected void checkInitialized() {\n \tcheckState(this.breeder!=null && this.threads!=null, \"Local state was not correctly set after being deserialized.\");\n }", "public void verifyBugerList()\n\t{\n\t\t\n\t}", "protected void validateConfig() {\n A.notNull(getStreamer(), \"Streamer\");\n A.notNull(getIgnite(), \"Ignite\");\n A.notNull(endpointUrl, \"Twitter Streaming API endpoint\");\n\n A.ensure(getSingleTupleExtractor() != null || getMultipleTupleExtractor() != null, \"Twitter extractor\");\n\n String followParam = apiParams.get(SITE_USER_ID_KEY);\n\n A.ensure(followParam != null && followParam.matches(\"^(\\\\d+,? ?)+$\"),\n \"Site streaming endpoint must provide 'follow' param with value as comma separated numbers\");\n }", "public void checkExistingParameter() {\n parameterList.clear();\n if (!attribute[13].equalsIgnoreCase(\"NA\")) {\n parameterList.add(parameterStore.getParameterWithCode(\"HB000\"));\n }\n\n if (!attribute[14].equalsIgnoreCase(\"NA\")) {\n parameterList.add(parameterStore.getParameterWithCode(\"WBC00\"));\n }\n\n if (!attribute[15].equalsIgnoreCase(\"NA\")) {\n parameterList.add(parameterStore.getParameterWithCode(\"PLT00\"));\n }\n\n if (!attribute[16].equalsIgnoreCase(\"NA\")) {\n parameterList.add(parameterStore.getParameterWithCode(\"RBC00\"));\n }\n\n if (!attribute[20].equalsIgnoreCase(\"NA\")) {\n parameterList.add(parameterStore.getParameterWithCode(\"IgGAN\"));\n }\n }", "public void initialiseValues() {\n\t\tif (validationRule == null) { // NOSONAR\n\t\t\tvalidationRule = Optional.empty();\n\t\t}\n\t}", "private void validateProperties() throws BuildException {\r\n if (this.port == null || this.port.length() == 0) {\r\n throw new BuildException(\"Attribute 'port' must be set.\");\r\n }\r\n if (this.depotPath == null || this.depotPath.length() == 0) {\r\n throw new BuildException(\"Attribute 'repositoryUrl' must be set.\");\r\n }\r\n if (this.userName == null || this.userName.length() == 0) {\r\n throw new BuildException(\"Attribute 'userName' must be set.\");\r\n }\r\n if (this.password == null || this.password.length() == 0) {\r\n throw new BuildException(\"Attribute 'password' must be set.\");\r\n }\r\n if (this.depotPath == null || this.depotPath.length() == 0) {\r\n throw new BuildException(\"Attribute 'repositoryUrl' must be set.\");\r\n }\r\n if (this.p4ExecutablePath == null || this.p4ExecutablePath.length() == 0) {\r\n throw new BuildException(\"Attribute 'p4ExecutablePath' must be set.\");\r\n }\r\n File p4Executable = new File(this.p4ExecutablePath);\r\n if (!p4Executable.exists()) {\r\n throw new BuildException(\"Attribute 'p4ExecutablePath' \" + this.p4ExecutablePath +\r\n \" does not appear to point to an actual file.\");\r\n }\r\n \r\n // If default* is specified, then all should be specified. \r\n if (((this.defaultHackystatAccount != null) || \r\n (this.defaultHackystatPassword != null) ||\r\n (this.defaultHackystatSensorbase != null)) &&\r\n ((this.defaultHackystatAccount == null) || \r\n (this.defaultHackystatPassword == null) ||\r\n (this.defaultHackystatSensorbase == null))) {\r\n throw new BuildException (\"If one of default Hackystat account, password, or sensorbase \" +\r\n \"is specified, then all must be specified.\");\r\n }\r\n \r\n // Check to make sure that defaultHackystatAccount looks like a real email address.\r\n if (!ValidateEmailSyntax.isValid(this.defaultHackystatAccount)) {\r\n throw new BuildException(\"Attribute 'defaultHackystatAccount' \" + this.defaultHackystatAccount\r\n + \" does not appear to be a valid email address.\");\r\n }\r\n \r\n // If fromDate and toDate not set, we extract commit information for the previous day.\r\n if (this.fromDateString == null && this.toDateString == null) {\r\n Day previousDay = Day.getInstance().inc(-1);\r\n this.fromDate = new Date(previousDay.getFirstTickOfTheDay() - 1);\r\n this.toDate = new Date(previousDay.getLastTickOfTheDay());\r\n }\r\n else {\r\n try {\r\n if (this.hasSetToAndFromDates()) {\r\n this.fromDate = new Date(Day.getInstance(this.dateFormat.parse(this.fromDateString))\r\n .getFirstTickOfTheDay() - 1);\r\n this.toDate = new Date(Day.getInstance(this.dateFormat.parse(this.toDateString))\r\n .getLastTickOfTheDay());\r\n }\r\n else {\r\n throw new BuildException(\r\n \"Attributes 'fromDate' and 'toDate' must either be both set or both not set.\");\r\n }\r\n }\r\n catch (ParseException ex) {\r\n throw new BuildException(\"Unable to parse 'fromDate' or 'toDate'.\", ex);\r\n }\r\n\r\n if (this.fromDate.compareTo(this.toDate) > 0) {\r\n throw new BuildException(\"Attribute 'fromDate' must be a date before 'toDate'.\");\r\n }\r\n }\r\n }", "public DefaultProfileCompletenessRetriever() {\n }", "protected void thoroughInspection() {}", "@Override\n protected void runHandler() {\n checkContainsAny(MSG_ILLEGAL_CLASS_LEVEL_ANNOTATION,\n NullnessAnnotation.CHECK_FOR_NULL, NullnessAnnotation.CHECK_RETURN_VALUE,\n NullnessAnnotation.NONNULL, NullnessAnnotation.NULLABLE);\n checkContainsAll(MSG_CONTRADICTING_CLASS_LEVEL_ANNOTATIONS,\n NullnessAnnotation.PARAMETERS_ARE_NONNULL_BY_DEFAULT,\n NullnessAnnotation.PARAMETERS_ARE_NULLABLE_BY_DEFAULT);\n }", "private void checkInitialization()\n {\n if (!initialized)\n throw new SecurityException(\"ArrayQueue object is corrupt.\");\n }", "void initSafeties(){\n gyroSafety();\n tensorFlowSafety();\n\n telemetry.addLine(\"Init finalized successfully\");\n telemetry.update();\n }", "private void checkNoGettersSetters() {\n if (getters != null || setters != null)\n throw new AnalysisException(\"Unexpected getter/setter value!\");\n }", "private ErrorCode checkParameters() {\n\t\t\n\t\t// Check Batch Size\n\t\ttry {\n\t\t\tInteger.parseInt(batchSizeField.getText());\n\t\t\t\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn ErrorCode.BatchSize;\n\t\t}\n\t\t\n\t\t// Check confidenceFactor\n\t\ttry {\n\t\t\tDouble.parseDouble(confidenceFactorField.getText());\n\t\t\t\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn ErrorCode.ConfidenceFactor;\n\t\t}\n\t\t\n\t\t// Check minNumObj\n\t\ttry {\n\t\t\tInteger.parseInt(minNumObjField.getText());\n\t\t\t\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn ErrorCode.MinNumObj;\n\t\t}\n\t\t\n\t\t// Check numDecimalPlaces\n\t\ttry {\n\t\t\tInteger.parseInt(numDecimalPlacesField.getText());\n\t\t\t\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn ErrorCode.NumDecimalPlaces;\n\t\t}\n\t\t\n\t\t// Check numFolds\n\t\ttry {\n\t\t\tInteger.parseInt(numFoldsField.getText());\n\t\t\t\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn ErrorCode.NumFolds;\n\t\t}\n\t\t\n\t\t// Check seed\n\t\ttry {\n\t\t\tInteger.parseInt(seedField.getText());\n\t\t\t\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn ErrorCode.Seed;\n\t\t}\n\t\t\n\t\treturn ErrorCode.Fine;\n\t\t\n\t}", "protected void InitValuables() {\n\t\tsuper.InitValuables();\n\t\t\n\t}", "@SuppressWarnings(\"unused\")\n private Object[] parametersTestHasEnough() {\n return new Object[] { \n new Object[] { new Ingredient(\"have\", 100, \"tbsp.\"), new Ingredient(\"needed\", 1, \"cup\"), true}, \n new Object[] { new Ingredient(\"have\", 5, \"\"), new Ingredient(\"needed\", 10, \"tsp\"), false}, \n new Object[] { new Ingredient(\"have\", 3, \"cups.\"), new Ingredient(\"needed\", 1, \"gallon\"), false},\n new Object[] { new Ingredient(\"have\", 3, \"ounces.\"), new Ingredient(\"needed\", 1, \"gallon\"), false},\n new Object[] { new Ingredient(\"have\", 100, \"tbsp.\"), new Ingredient(\"needed\", 100, \"tbsp\"), true},\n new Object[] { new Ingredient(\"have\", 100, \"\"), new Ingredient(\"needed\", 100, \"tbsp\"), true},\n new Object[] { new Ingredient(\"have\", 100, \"oz\"), new Ingredient(\"needed\", 50, null), true},\n new Object[] { new Ingredient(\"have\", 3, \"ct.\"), new Ingredient(\"needed\", 2, \"fake\"), true},\n new Object[] { new Ingredient(\"have\", 3, \"ct.\"), null, true},\n };\n }", "void verifyIntProperties() throws IllegalStateException {\n if (mProperties.size() < 2) {\n return;\n }\n int last = getIntPropertyValue(0);\n for (int i = 1; i < mProperties.size(); i++) {\n int v = getIntPropertyValue(i);\n if (v < last) {\n throw new IllegalStateException(String.format(\"Parallax Property[%d]\\\"%s\\\" is\"\n + \" smaller than Property[%d]\\\"%s\\\"\",\n i, mProperties.get(i).getName(),\n i - 1, mProperties.get(i - 1).getName()));\n } else if (last == IntProperty.UNKNOWN_BEFORE && v == IntProperty.UNKNOWN_AFTER) {\n throw new IllegalStateException(String.format(\"Parallax Property[%d]\\\"%s\\\" is\"\n + \" UNKNOWN_BEFORE and Property[%d]\\\"%s\\\" is UNKNOWN_AFTER\",\n i - 1, mProperties.get(i - 1).getName(),\n i, mProperties.get(i).getName()));\n }\n last = v;\n }\n }", "@Override\n public boolean preconditionsSatisfied() {\n return true;\n }", "private boolean checkFields() {\n\t\tboolean status = true;\n\n\t\treturn status;\n\t}", "private boolean hasRequirements() {\n \t\tif (checkHasRequirements) {\n \t\t\thasRequirements = pullRequired(requiredInput, false);\n \t\t\tcheckHasRequirements = false;\n \t\t}\n \t\treturn hasRequirements;\n \t}", "@Override\n\tprotected boolean verifyFields() {\n\t\treturn false;\n\t}", "@BeforeClass\r\n\tpublic void setPreconditions() {\r\n\t\tlogger.info(\"In the class ---> {}\", className);\r\n\t\treporter = getReporter(\"Verifytx Test\", \"Tests verifytx Method of SuperNET API\");\r\n\t\t}", "private void checkDataBase() {\n final Config dbConfig = config.getConfig(\"db\");\n\n checkArgument(!isNullOrEmpty(dbConfig.getString(\"driver\")), \"db.driver is not set!\");\n checkArgument(!isNullOrEmpty(dbConfig.getString(\"url\")), \"db.url is not set!\");\n\n dbConfig.getString(\"user\");\n dbConfig.getString(\"password\");\n dbConfig.getObject(\"additional\");\n }", "protected void checkIfReady() throws Exception {\r\n checkComponents();\r\n }", "private void checkAttributes() throws JellyTagException\n {\n if (getField() == null)\n {\n throw new MissingAttributeException(\"field\");\n }\n if (getVar() == null)\n {\n if (!(getParent() instanceof ValueSupport))\n {\n throw new JellyTagException(\n \"No target for the resolved value: \"\n + \"Specify the var attribute or place the tag \"\n + \"in the body of a ValueSupport tag.\");\n }\n }\n }", "@Test\n public void testFieldMissingToBuildAccount() throws Exception {\n // test when required fields are null\n buildAccountWithMissingFieldsAndFail(null, refAccountStatus, IllegalStateException.class);\n buildAccountWithMissingFieldsAndFail(refAccountName, null, IllegalStateException.class);\n }", "@Test\n\tpublic void testValidatePrivacyState() {\n\t\ttry {\n\t\t\tfor(String emptyValue : ParameterSets.getEmptyValues()) {\n\t\t\t\tAssert.assertNull(SurveyResponseValidators.validatePrivacyState(emptyValue));\n\t\t\t}\n\t\t\t\n\t\t\ttry {\n\t\t\t\tSurveyResponseValidators.validatePrivacyState(\"Invalid value.\");\n\t\t\t\tfail(\"The privacy state was invalid.\");\n\t\t\t}\n\t\t\tcatch(ValidationException e) {\n\t\t\t\t// Passed.\n\t\t\t}\n\t\t\t\n\t\t\tfor(SurveyResponse.PrivacyState privacyState: SurveyResponse.PrivacyState.values()) {\n\t\t\t\tAssert.assertEquals(privacyState, SurveyResponseValidators.validatePrivacyState(privacyState.toString()));\n\t\t\t}\n\t\t}\n\t\tcatch(ValidationException e) {\n\t\t\tfail(\"A validation exception was thrown: \" + e.getMessage());\n\t\t}\n\t}", "private boolean validateArguments() {\n return !isEmpty(getWsConfig()) && !isEmpty(getVirtualServer()) && !isEmpty(getVirtualServer()) && !isEmpty(getAppContext()) && !isEmpty(getWarFile()) && !isEmpty(getUser()) && !isEmpty(getPwdLocation());\n }", "@After\n public void validate()\n {\n validateMockitoUsage();\n }", "private SettingsContainer valueChecker() {\n String generationCount = jTextFieldGenerationsCount.getText();\n String refreshTime = jTextFieldRefreshTime.getText();\n return checkSettingsFieldsValue(settingsContainer, jLabelCommunicats,\n generationCount, refreshTime);\n }", "void validate(Supplier<Object> instanceCreator, Config config, String prefix) {\n String prefixedKey = prefixed(prefix, configKey);\n Optional<String> value = config.getOptionalValue(prefixedKey, String.class)\n .or(() -> Optional.ofNullable(defaultValue));\n\n if (value.isPresent()) {\n // there is a configured value, fine\n return;\n }\n\n if (isOptional) {\n // there is no configured value, but the field is optional\n return;\n }\n\n if (hasFieldValue(instanceCreator, field)) {\n // there is an explicit initializer of the field (or it is a primitive type)\n return;\n }\n\n throw new DeploymentException(\"Cannot find configuration key \" + prefixedKey + \" for field \" + field);\n }", "@Override\n public void checkConfiguration() {\n }", "private void verifyInput(){\n String firstName = mFirstNameField.getText().toString();\n String lastName = mLastNameField.getText().toString();\n\n mNameFieldsFilled = !TextUtils.isEmpty(firstName) && !TextUtils.isEmpty(lastName);\n\n }", "@Override\n protected void validateConfig() {\n super.validateConfig();\n final int iterations = commonConfig.getIterations();\n queryInstancesAggregates = new MetricAggregates(iterations);\n firstResponseAggregates = new MetricAggregates(iterations);\n firstFrameAggregates = new MetricAggregates(iterations);\n totalAggregates = new MetricAggregates(iterations);\n transferRateAggregates = new MetricAggregates(iterations);\n frameRateAggregates = new MetricAggregates(iterations);\n }", "@Test\n public void testActualPropertiesValues() { // wipe everything other\n testEnv = null;\n resolver = null;\n // use the default ctor to grab discoveryenvironment.properties\n // resolver = new DefaultServiceCallResolver();\n resolver = new ServiceCallResolver();\n resolver.setAppProperties(createFromExpected());\n // ensure it was set\n assertNotNull(resolver);\n verifyExpectedValues(EXPECTED);\n\n }", "@Override\n\tpublic void initVerify() {\n\t\t\n\t}", "public boolean validatePageElements() {\n boolean nameCheck = name.isDisplayed() && name.isEnabled();\n boolean emailCheck = email.isDisplayed() && email.isEnabled();\n boolean passwordCheck = password.isDisplayed() && password.isEnabled();\n boolean signupGoogleCheck = signupGoogle.isDisplayed() && signupGoogle.isEnabled();\n boolean signupSlackCheck = signupSlack.isDisplayed() && signupSlack.isEnabled();\n boolean signupOutlookCheck = signupOutlook.isDisplayed() && signupOutlook.isEnabled();\n boolean signupAppleCheck = signupApple.isDisplayed() && signupApple.isEnabled();\n boolean signupFacebookCheck = signupFacebook.isDisplayed() && signupFacebook.isEnabled();\n boolean logoCheck = miroLogo.isDisplayed();\n\n return nameCheck && emailCheck && passwordCheck && signupGoogleCheck && signupSlackCheck && signupOutlookCheck && signupAppleCheck && signupFacebookCheck && logoCheck;\n\n }", "protected void doExtraValidation(Properties props) {\n /* nothing by default */\n }", "public void lookupComponents() throws Exception\n {\n _parameterCheckerManager.initialize();\n \n for (Map.Entry<ParameterCheckerDescriptor, String> entry : _parameterCheckersToLookup.entrySet())\n {\n ParameterCheckerDescriptor parameterChecker = entry.getKey();\n String parameterCheckerRole = entry.getValue();\n \n try\n {\n parameterChecker.setParameterChecker(_parameterCheckerManager.lookup(parameterCheckerRole));\n }\n catch (ComponentException e)\n {\n throw new Exception(\"Unable to lookup parameter checker role: '\" + parameterCheckerRole + \"' for parameter: \" + parameterChecker, e);\n }\n }\n }" ]
[ "0.6165346", "0.58877915", "0.5842284", "0.5812219", "0.5787548", "0.5764469", "0.5682894", "0.56620777", "0.56580234", "0.5654724", "0.56186306", "0.556262", "0.5539096", "0.5530713", "0.5518262", "0.551501", "0.5498952", "0.5492484", "0.54689014", "0.54530233", "0.5439578", "0.5433312", "0.54196966", "0.54167855", "0.5407123", "0.5366118", "0.5350422", "0.5307139", "0.5301634", "0.5280922", "0.5263223", "0.5251404", "0.52469265", "0.5233895", "0.52306306", "0.5147687", "0.5104657", "0.5092145", "0.5086813", "0.50818586", "0.50805503", "0.50726265", "0.5060339", "0.5058612", "0.5055863", "0.5053576", "0.5049639", "0.50483894", "0.50460905", "0.5039457", "0.5030054", "0.5026963", "0.5022199", "0.5008218", "0.49994248", "0.4987823", "0.49856144", "0.4985128", "0.49767447", "0.49750587", "0.49712408", "0.4963868", "0.49631044", "0.49595115", "0.49590757", "0.49570426", "0.4948131", "0.49470493", "0.49450323", "0.4940366", "0.49373347", "0.49322742", "0.49291122", "0.49289504", "0.4913948", "0.49065593", "0.48921138", "0.48903596", "0.48828512", "0.48731357", "0.4870815", "0.48651528", "0.4864342", "0.48598623", "0.48521197", "0.4847435", "0.48403594", "0.48377824", "0.48361623", "0.48259738", "0.4824443", "0.4817293", "0.4817244", "0.48133796", "0.48081547", "0.4807386", "0.48038787", "0.4799592", "0.47935745", "0.47871324" ]
0.6654993
0
Retrieves the profile completeness report for the given user. The complete User instance is passed to it.
public ProfileCompletenessReport getProfileCompletenessReport(User user) throws ProfileCompletenessRetrievalException { ParameterCheckUtility.checkNotNull(user, "user"); // Prepare report entity ProfileCompletenessReport report = new ProfileCompletenessReport(); report.setTaskCompletionStatuses(new ArrayList<TaskCompletionStatus>()); // Prepare calculation fields: int totalFields = 0; int totalCompletedFields = 0; for (ProfileTaskChecker checker : profileTaskCheckers) { ProfileTaskReport profileTaskReport = checker.getTaskReport(user); totalFields += profileTaskReport.getTotalFieldCount(); totalCompletedFields += profileTaskReport.getCompletedFieldCount(); TaskCompletionStatus taskCompletionStatus = new TaskCompletionStatus(); taskCompletionStatus.setTaskName(profileTaskReport.getTaskName()); taskCompletionStatus.setCompleted(profileTaskReport.getCompleted()); report.getTaskCompletionStatuses().add(taskCompletionStatus); } // Perform calculation: report.setCompletionPercentage(totalCompletedFields * 100 / totalFields); return report; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ProfileTaskReport getTaskReport(User user) {\n ParameterCheckUtility.checkNotNull(user, \"user\");\n ProfileTaskReport report = new ProfileTaskReport();\n report.setTaskName(getTaskName());\n int totalFieldCount = 1;\n int completedFieldCount = 0;\n // check demographic answer for School\n for (DemographicResponse demographicResponse : user.getDemographicResponses()) {\n if (SHOW_HIDE_MY_SCHOOL_QUESTION.equals(demographicResponse.getQuestion().getText())) {\n if (Helper.checkNotNullNorEmpty(demographicResponse.getAnswer().getText())) {\n completedFieldCount++;\n }\n }\n }\n report.setTotalFieldCount(totalFieldCount);\n report.setCompletedFieldCount(completedFieldCount);\n report.setCompleted(totalFieldCount == completedFieldCount);\n return report;\n }", "@ApiMethod(name = \"getProfile\", path = \"profile\", httpMethod = HttpMethod.GET)\n public Profile getProfile(final User user) throws UnauthorizedException {\n if (user == null) {\n throw new UnauthorizedException(\"Authorization required\");\n }\n\n // load the Profile Entity\n String userId = user.getUserId();\n Key key = Key.create(Profile.class, userId);\n\n Profile profile = (Profile) ofy().load().key(key).now();\n return profile;\n }", "public SPResponse getProfileBalance(User user, Object[] params) {\n \n String userCompany = user.getCompanyId();\n \n Company company = companyFactory.getCompany(userCompany);\n SPResponse profileResponse = new SPResponse();\n \n if (company != null && company.getFeatureList().contains(SPFeature.Prism)) {\n ProfileBalance profileBalance = spectrumFactory.getProfileBalance(userCompany, false);\n \n LOG.debug(\"PRofile Balance returened is \" + profileBalance);\n \n profileResponse.add(\"profileBalance\", profileBalance);\n profileResponse.isSuccess();\n } else {\n LOG.debug(\"User \" + user.getId() + \" does not have access to Prism\");\n profileResponse.addError(new SPException(\"User does not have access to Prism\"));\n \n }\n \n return profileResponse;\n }", "private static Profile getProfileFromUser(User user) {\n // First fetch the user's Profile from the datastore.\n Profile profile = ofy().load().key(\n Key.create(Profile.class, user.getUserId())).now();\n if (profile == null) {\n // Create a new Profile if it doesn't exist.\n // Use default displayName and teeShirtSize\n String email = user.getEmail();\n\n profile = new Profile(user.getUserId(),\n extractDefaultDisplayNameFromEmail(email), email, null, null, null, null);\n }\n return profile;\n }", "public Profile getProfile(User user){\n\t\t\n\t\treturn profiles.get(user.getProfile());\n\t}", "@Override\n\tpublic Profile getProfile(Users user) {\n\t\treturn null;\n\t}", "@ApiMethod(\n \t\tname = \"getProfileDetail\", \n \t\tpath = \"profile/{websafeProfileKey}\", \n \t\thttpMethod = HttpMethod.GET\n \t\t)\n public Profile getProfileDetail(final User user, \n \t\t@Named(\"websafeProfileKey\") final String websafeProfileKey) throws UnauthorizedException {\n System.out.println(\"Pow\");\n \tif (user == null) {\n throw new UnauthorizedException(\"Authorization required to view profiles\");\n }\n System.out.println(\"\\n\\nwebsafeProfileKey\" + websafeProfileKey + \"\\n\\n\");\n // load the Profile Entity from the websafeProfileKey\n String userId = user.getUserId();\n Key key = Key.create(websafeProfileKey);\n\n Profile profile = (Profile) ofy().load().key(key).now();\n return profile;\n }", "public SPResponse getHirngFilterProfileBalance(User user, Object[] params) {\n \n String userCompanyId = user.getCompanyId();\n Company company = companyFactory.getCompany(user.getCompanyId());\n \n Account account = null;\n if (company != null) {\n account = accountRepository.findAccountByCompanyId(company.getId());\n } else {\n throw new InvalidRequestException(\"Company cannot be null\");\n }\n \n String role = (String) params[0];\n \n SPResponse profileResponse = new SPResponse();\n HiringFilterProfileBalance hiringFilterProfileBalance = null;\n \n // access to hiring profile balance is available only for Plan type IntelligentHiring\n if (account != null && account.getSpPlanMap().containsKey(SPPlanType.IntelligentHiring)) {\n \n hiringFilterProfileBalance = spectrumFactory.getHiringProfileBalance(role, userCompanyId);\n \n LOG.debug(\"Hiring Filter profile balance returened is \" + hiringFilterProfileBalance);\n \n profileResponse.add(\"hringFiterProfileBalance\", hiringFilterProfileBalance);\n profileResponse.isSuccess();\n } else {\n LOG.debug(\"User \" + user.getId() + \" does not have access to Hiring Filter Profile Balance\");\n profileResponse.addError(new SPException(\n \"User does not have access to Hiring Filter Profile Balance\"));\n \n }\n return profileResponse;\n }", "private static double checkUserBalance(User user, Document doc, Printer printer) {\n\t\t\n\t\tdouble balance = user.getBalance().doubleValue();\n\t\tint pagesToPrint = printer.numPagesToPrint(doc).intValue();\n\t\t\n\t\tchar format = doc.getPageFormat();\n\t\tchar toner = doc.getPageToner();\n\n\t\tdouble pricing = 0.0;\n\n\t\t// Get printer pricing\n\t\tif(format == '4' && toner == 'B') {\n\t\t\tpricing = printer.getPrinterPricing().getPriceA4Black().doubleValue();\n\t\t} else if(format == '4' && toner == 'C') {\n\t\t\tpricing = printer.getPrinterPricing().getPriceA4Color().doubleValue();\n\t\t} else if(format == '3' && toner == 'B') {\n\t\t\tpricing = printer.getPrinterPricing().getPriceA3Black().doubleValue();\n\t\t} else if(format == '3' && toner == 'C') {\n\t\t\tpricing = printer.getPrinterPricing().getPriceA3Color().doubleValue();\n\t\t}\n\t\t\n\t\t// Calc total cost\n\t\tdouble totalCost = pricing * pagesToPrint;\n\t\t\n\t\tif(balance >= totalCost) return 0;\n\t\telse return totalCost;\n\t}", "public static void fullnessCalc(User user) {\n /*\n * Fullness :\n * for every attribute of the record that is missing\n * the fullness rate of the record drops by 1.\n */\n\n fullness = 11;\n if (user.getFirstName().equals(\"\")) fullness -= 1;\n if (user.getLastName().equals(\"\")) fullness -= 1;\n if (user.getEmail().equals(\"\")) fullness -= 1;\n if (user.getCompany().equals(\"\")) fullness -= 1;\n if (user.getAddressOne().equals(\"\")) fullness -= 1;\n if (user.getAddressTwo().equals(\"\")) fullness -= 1;\n if (user.getCity().equals(\"\")) fullness -= 1;\n if (user.getStateShort().equals(\"\")) fullness -= 1;\n if (user.getStateLong().equals(\"\")) fullness -= 1;\n if (user.getPhone().equals(\"\")) fullness -= 1;\n if (user.getZipCode() == 0) fullness -= 1;\n user.setFullness(fullness);\n }", "private void retrieveProfile() {\r\n\r\n FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();\r\n\r\n if (user == null) {\r\n return;\r\n }\r\n\r\n String userId = user.getUid();\r\n String email = user.getEmail();\r\n DocumentReference reference = mFirebaseFirestore.collection(\"users\").document(userId);\r\n reference.get().addOnCompleteListener(new OnCompleteListener<DocumentSnapshot>() {\r\n @Override\r\n public void onComplete(@NonNull Task<DocumentSnapshot> task) {\r\n if (task.isSuccessful()) {\r\n DocumentSnapshot documentSnapshot = task.getResult();\r\n mTextViewName.setText((CharSequence) documentSnapshot.get(\"name\"));\r\n mTextViewContact.setText((CharSequence) documentSnapshot.get(\"contact\"));\r\n mTextViewEstate.setText((CharSequence) documentSnapshot.get(\"estate\"));\r\n mTextViewHouseNo.setText((CharSequence) documentSnapshot.get(\"houseno\"));\r\n }\r\n Toast.makeText(Testing.this, \"Profile data loaded successfully!\", Toast.LENGTH_LONG).show();\r\n }\r\n })\r\n .addOnFailureListener(new OnFailureListener() {\r\n @Override\r\n public void onFailure(@NonNull Exception e) {\r\n Toast.makeText(Testing.this, \"Error fetching profile data. Check your internet connection!\" + e.toString(), Toast.LENGTH_LONG).show();\r\n }\r\n });\r\n\r\n }", "@Override\n\tpublic String countProfile(String user_id) throws Exception {\n\t\tint boardC = sqlSession.selectOne(namespace+\".board_count\", user_id);\n\t\tint friendC = sqlSession.selectOne(namespace+\".friend_count\", user_id);\n\t\t\n\t\tString result = boardC +\",\" + friendC;\n\t\treturn result;\n\t}", "UserDTO getProfile(final int userId) throws DataUnreachableException;", "@Override\r\n\tpublic boolean checkUser(User user) {\n\t\tint age = user.getAge();\r\n\t\tint height = user.getHeight();\r\n\t\tint weight = user.getWeight();\r\n\t\tString country =user.getCountry();\r\n\t\t if((age>=18 && age<=35) && (height>=155 && height<=170) && (weight>=55 && weight<=90) && country.equals(\"ProGrad\")) \r\n\t\t\t return true;\r\n\t\t else \r\n\t\t\t return false;\r\n\t }", "protected Map<String, Object> getUserProfile() {\r\n\t\tTimeRecorder timeRecorder = RequestContext.getThreadInstance()\r\n\t\t\t\t\t\t\t\t\t\t\t\t .getTimeRecorder();\r\n\t\tString profileId = (String)userProfile.get(AuthenticationConsts.KEY_PROFILE_ID);\r\n\r\n\t\tSite site = Utils.getEffectiveSite(request);\r\n\t\tString siteDNSName = (site == null ? null : site.getDNSName());\r\n\r\n\t\tIUserProfileRetriever retriever = UserProfileRetrieverFactory.createUserProfileImpl(AuthenticationConsts.USER_PROFILE_RETRIEVER, siteDNSName);\r\n\t\ttry {\r\n\t\t\ttimeRecorder.recordStart(Operation.PROFILE_CALL);\r\n\t\t\tMap<String, Object> userProfile = retriever.getUserProfile(profileId,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t request);\r\n\t\t\ttimeRecorder.recordEnd(Operation.PROFILE_CALL);\r\n\t\t\treturn userProfile;\r\n\t\t} catch (UserProfileException ex) {\r\n\t\t\ttimeRecorder.recordError(Operation.PROFILE_CALL, ex);\r\n\t\t\tRequestContext.getThreadInstance()\r\n\t\t\t\t\t\t .getDiagnosticContext()\r\n\t\t\t\t\t\t .setError(ErrorCode.PROFILE001, ex.toString());\r\n\t\t\tthrow ex;\r\n\t\t}\r\n\t}", "public void user_details()\n {\n\t boolean userdetpresent =userdetails.size()>0;\n\t if(userdetpresent)\n\t {\n\t\t //System.out.println(\"User details report is PRESENT\");\n\t }\n\t else\n\t {\n\t\t System.out.println(\"User details report is not present\");\n\t }\n }", "public Profile getProfile(String userId, boolean loaded) {\n\t\tif (logger.isLoggable(Level.FINEST)) {\n\t\t\tlogger.entering(sourceClass, \"getProfile\", new Object[] { userId, loaded });\n\t\t}\n\t\tif (StringUtil.isEmpty(userId)) {\n\t\t\tlogger.fine(\"User id is empty, returning null profile\");\n\t\t\treturn null;\n\t\t}\n\t\tProfile profile = new Profile(this, userId);\n\t\tif (loaded) {\n\t\t\tload(profile); // fetches profile content from server and populates\n\t\t\t\t\t\t\t// content of data member\n\t\t}\n\n\t\tif (logger.isLoggable(Level.FINEST)) {\n\t\t\tString log = \"\";\n\t\t\tif (profile.getId() != null) {\n\t\t\t\tlog = \"returning requested profile\";\n\t\t\t} else {\n\t\t\t\tlog = \"empty response from server for requested profile\";\n\t\t\t}\n\t\t\tlogger.exiting(sourceClass, \"getProfile\", log);\n\t\t}\n\t\treturn profile;\n\t}", "@Override\n\tpublic UserProfileResponse updateProfile(User user) {\n\t\t// datasource is used to connect with database\n\t\tdatasource = getDataSource();\n\t\tjdbcTemplate = new JdbcTemplate(datasource);\n\t\tUserProfileResponse gcmres = new UserProfileResponse();\n\t\tlogger.info(\"IN updateProfile METHOD \");\n\t\t// check if user exists in database with user_id\n\t\tString sql = \"select count(1) from user where user_id = ? \";\n\t\tint result = jdbcTemplate.queryForObject(sql, new Object[] { user.getUserid() }, Integer.class);\n\t\t// if user exists, return userId\n\t\tlogger.info(\"Query Count : \" + result);\n\t\tif (result > 0) {\n\t\t\tString update_gcm_query = \"Update user set emailid = ?, mobileno = ?, username = ?, uuid = ?, appversion = ?, gcmregistartionkey = ? where user_id = ?\";\n\t\t\tint rowcount = jdbcTemplate.update(update_gcm_query, user.getEmailid(), user.getMobileno(),\n\t\t\t\t\tuser.getUsername(), user.getUuid(), user.getAppversion(), user.getGcmregistartionkey(),\n\t\t\t\t\tuser.getUserid());\n\t\t\tlogger.info(\"updateProfile Update Row Count : \" + rowcount);\n\t\t\tif (rowcount > 0) {\n\t\t\t\tgcmres.setStatus(true);\n\t\t\t\tgcmres.setMessage(\"User Profile IS Updated Successfully For User Id:\" + user.getUserid());\n\t\t\t\tlogger.info(\"User Profile IS Updated Successfully\");\n\t\t\t} else {\n\t\t\t\tgcmres.setStatus(false);\n\t\t\t\tgcmres.setMessage(\"User Profile Is Not Updated Successfully For User Id:\" + user.getUserid());\n\t\t\t\tlogger.info(\"User Profile Is Not Updated Successfully For User Id:\" + user.getUserid());\n\t\t\t}\n\n\t\t} else {\n\t\t\tgcmres.setStatus(false);\n\t\t\tgcmres.setMessage(\"User Profile Is Not Updated Successfully For User Id:\" + user.getUserid());\n\t\t\tlogger.info(\"User Profile Is Not Updated Successfully For User Id:\" + user.getUserid());\n\t\t}\n\n\t\treturn gcmres;\n\n\t}", "com.google.protobuf2.Any getProfile();", "public UserProfile getUserProfile() {return userProfile;}", "public void acctCheck(User user) {\n\t\tif (user.getExec() == 0)\n\t\t\tLogging.logger.info(\"User \" + user.getuName() + \" has logged in\");\n\t\telse\n\t\t\tLogging.logger.info(\"Employee \" + user.getuName() + \" has logged in\");\n\t\tList<Account> accounts = udao.viewAcct(user);\n\n\t\tfor (int i = 0; i != 60; i++) {\n\t\t\tSystem.out.println();\n\t\t}\n\t\tSystem.out.println(\"Welcome \" + user.getfName() + \" \" + user.getlName() + \"\\n\");\n\n\t\t// If the user has no account, tell them to go find a staff member\n\t\tif (accounts.isEmpty() && user.getExec() == 0) {\n\n\t\t\tLogging.logger.info(user.getuName() + \" has no active accounts\");\n\t\t\tSystem.out.println(\"You currently have no accounts with our bank. \\n \"\n\t\t\t\t\t+ \"Please see one of our representitives to open a new account.\");\n\t\t\ttry {\n\t\t\t\tThread.sleep(6000);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t\t// Otherwise, lets do business\n\t\t} else {\n\t\t\tAccounting act = new Accounting(user);\n\t\t\ttry {\n\t\t\t\tact.accounting(accounts);\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "TasteProfile.UserProfile getUserProfile (String user_id);", "public int getUserProfile(String user_id, String song_id,\n\t\t\tno.uio.inf5040.obl1.tasteprofile.UserHolder user) {\n\t\torg.omg.CORBA.portable.InputStream $in = null;\n\t\ttry {\n\t\t\torg.omg.CORBA.portable.OutputStream $out = _request(\n\t\t\t\t\t\"getUserProfile\", true);\n\t\t\t$out.write_string(user_id);\n\t\t\t$out.write_string(song_id);\n\t\t\t$in = _invoke($out);\n\t\t\tint $result = $in.read_long();\n\t\t\tuser.value = no.uio.inf5040.obl1.tasteprofile.UserHelper.read($in);\n\t\t\treturn $result;\n\t\t} catch (org.omg.CORBA.portable.ApplicationException $ex) {\n\t\t\t$in = $ex.getInputStream();\n\t\t\tString _id = $ex.getId();\n\t\t\tthrow new org.omg.CORBA.MARSHAL(_id);\n\t\t} catch (org.omg.CORBA.portable.RemarshalException $rm) {\n\t\t\treturn getUserProfile(user_id, song_id, user);\n\t\t} finally {\n\t\t\t_releaseReply($in);\n\t\t}\n\t}", "public Profile getProfile(String userId) {\n\t\treturn getProfile(userId, true);\n\t}", "public SPResponse getBlueprintAnalytics(User user, Object[] params) {\n \n String userCompany = user.getCompanyId();\n \n Company company = companyFactory.getCompany(userCompany);\n SPResponse blueprintAnalyticsResponse = new SPResponse();\n \n if (company != null && company.getFeatureList().contains(SPFeature.Blueprint)) {\n BlueprintAnalytics blueprintAnalytics = spectrumFactory.getBlueprintAnalytics(userCompany);\n \n LOG.debug(\"Blueprint returened is \" + blueprintAnalytics);\n \n blueprintAnalyticsResponse.add(\"bluePrintAnalytics\", blueprintAnalytics);\n blueprintAnalyticsResponse.isSuccess();\n } else {\n LOG.debug(\"User \" + user.getId() + \" does not have access to Blueprint\");\n blueprintAnalyticsResponse\n .addError(new SPException(\"User does not have access to Blueprint\"));\n }\n \n return blueprintAnalyticsResponse;\n }", "@Override\n\tpublic UserProfile getUserInformations(UserProfile userProfile)\n\t\t\tthrows Exception {\n\t\treturn null;\n\t}", "@java.lang.Override\n public com.google.protobuf2.Any getProfile() {\n return profile_ == null ? com.google.protobuf2.Any.getDefaultInstance() : profile_;\n }", "@ApiModelProperty(value = \"Full name of the user who created the predefined profile\")\n public String getUserCompleteName() {\n return userCompleteName;\n }", "HumanProfile getUserProfile();", "public UserProfile getUserProfile() {\n\t\tif (user == null) {\n\t\t\tUserProfileInterface intf;\n\t\t\tswitch (imsAuthentMode) {\n\t\t\tcase GIBA:\n//\t\t\t\tif (logger.isActivated()) {\n//\t\t\t\t\tlogger.debug(\"Load user profile derived from IMSI (GIBA)\");\n//\t\t\t\t}\n\t\t\t\tintf = new GibaUserProfileInterface();\n\t\t\t\tbreak;\n\t\t\tcase DIGEST:\n\t\t\tdefault:\n//\t\t\t\tif (logger.isActivated()) {\n//\t\t\t\t\tlogger.debug(\"Load user profile from RCS settings database\");\n//\t\t\t\t}\n\t\t\t\tintf = new SettingsUserProfileInterface();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tuser = intf.read();\n\t\t}\n \t\n \treturn user; \t\n\t}", "public User getProf(String name) { return userDAO.getProfile(name); }", "boolean hasProfile();", "@ApiMethod(name = \"saveProfile\", path = \"profile\", httpMethod = HttpMethod.POST)\n // The request that invokes this method should provide data that\n // conforms to the fields defined in ProfileForm\n public Profile saveProfile(final User user, ProfileForm profileForm)\n throws UnauthorizedException {\n\n // If the user is not logged in, throw an UnauthorizedException\n if (user == null) {\n throw new UnauthorizedException(\"Authorization required\");\n }\n\n // Get the userId and mainEmail\n String mainEmail = user.getEmail();\n String userId = user.getUserId();\n\n // Get the displayName, city, state, & phone number sent by the request.\n String displayName = profileForm.getDisplayName();\n String phoneNumber = profileForm.getPhoneNumber();\n String city = profileForm.getCity();\n String state = profileForm.getState();\n String pictureUrl = profileForm.getPictureUrl();\n \n // Get the Profile from the datastore if it exists\n // otherwise create a new one\n Profile profile = ofy().load().key(Key.create(Profile.class, userId))\n .now();\n\n if (profile == null) {\n // Populate the displayName with default values\n // if not sent in the request\n if (displayName == null) {\n displayName = extractDefaultDisplayNameFromEmail(user\n .getEmail());\n }\n\n // Now create a new Profile entity\n profile = new Profile(userId, displayName, mainEmail, city, state, phoneNumber, pictureUrl);\n } else {\n // The Profile entity already exists\n // Update the Profile entity\n profile.update(displayName, city, state, phoneNumber, pictureUrl);\n }\n\n // Save the entity in the datastore\n ofy().save().entity(profile).now();\n // Return the profile\n return profile;\n }", "public UserModel getUserProfile(){\n\n UserAPI userAPI = RetrofitUrl.getInstance().create(UserAPI.class);\n Call<UserModel> usersCall = userAPI.getUserProfile(RetrofitUrl.token);\n\n usersCall.enqueue(new Callback<UserModel>() {\n @Override\n public void onResponse(Call<UserModel> call, Response<UserModel> response) {\n if(!response.isSuccessful()){\n Toast.makeText(MainActivity.this, \"Error loading profile!!\", Toast.LENGTH_SHORT).show();\n return;\n }\n userProfile = response.body();\n showdetail(userProfile.getFullName());\n getBalanceDetail(userProfile);\n refresh(5000);\n }\n\n @Override\n public void onFailure(Call<UserModel> call, Throwable t) {\n Toast.makeText(MainActivity.this, \"Error loading profile...\", Toast.LENGTH_SHORT).show();\n\n }\n });\n return userProfile;\n }", "public com.google.protobuf2.Any getProfile() {\n if (profileBuilder_ == null) {\n return profile_ == null ? com.google.protobuf2.Any.getDefaultInstance() : profile_;\n } else {\n return profileBuilder_.getMessage();\n }\n }", "public String status(User user) {\n\t\treturn user.getMailbox().status();\n\n\t}", "com.google.protobuf2.AnyOrBuilder getProfileOrBuilder();", "@Query(\"select ((select count(distinct r.user) from Rendezvous r) * 100)/ count(u) from User u\")\n\tCollection<Double> dashboardRendezvousesRatioCreation();", "@Override\r\n\tpublic Account getInfoByUser(User user) {\n\t\tString hql = \"from Account as account where account.user = :user\";\r\n\t\t\r\n\t\treturn (Account) getSession().createQuery(hql).setParameter(\"user\", user).uniqueResult();\r\n\t}", "@GET\n\t @Path(\"/topUser\")\n\t public Response getProfile() throws ProfileDaoException {\n\t return Response\n\t .ok(api.getTopUser(datastore))\n\t .build();\n\t }", "public double getCredits(User user) throws Exception;", "public Boolean getProfile()\n {\n return profile;\n }", "@java.lang.Override\n public com.google.protobuf2.AnyOrBuilder getProfileOrBuilder() {\n return getProfile();\n }", "@Override\n public void userLoaded(User user) {\n nameText.setText(user.getDisplayName());\n\n String profileImageUrl = user.getDisplayPhoto();\n if (profileImageUrl != null) {\n Glide.with(messageImage.getContext())\n .load(profileImageUrl)\n .into(profileImage);\n }\n }", "public String progressReport(User _user, String _prefix,\r\n\t\tint _level_mask)\r\n\t{// progressReport\r\n\t\tString result = \"\";\r\n\t\tif(_user == null)\r\n\t\t{\r\n\t\t\tresult += \"[CBUM] Concept.progressReport ERROR! \" +\r\n\t\t\t\t\"User specified is NULL.\\n\";\r\n\t\t}\r\n\t\tresult += _prefix + \"<concept>\\n\";\r\n\t\tresult += _prefix + \"\\t\" + \"<name>\" + this.getTitle() + \"</name>\\n\";\r\n\t\tUserProgressEstimator upe = getUserProgressEstimator(_user);\r\n\t\tresult += _prefix + \"\\t\" + \"<cog_levels>\\n\";\r\n\t\tif(upe != null)\r\n\t\t\tresult += upe.progressReport(_prefix + \"\\t\", _level_mask);\r\n\t\telse\r\n\t\t\tresult += UserProgressEstimator.progressReportDefault( \r\n\t\t\t\t_prefix + \"\\t\\t\", _level_mask);\r\n\t\tresult += _prefix + \"\\t\" + \"</cog_levels>\\n\";\r\n\t\tresult += _prefix + \"</concept>\\n\";\r\n\t\treturn result;\r\n\t}", "public UserCredentials getProfileDetails() {\n return profile.getProfileDetails(currentUser);\n }", "public void getProfileWithCompletion(\n final ServiceClientCompletion<ResponseResult> completion)\n {\n // Create request headers.\n final HashMap<String, String> headers = new HashMap<String, String>(2);\n headers.put(\"Authorization\", AUTHORIZATION_HEADER);\n headers.put(\"Content-Type\", \"application/json\");\n\n // Create request parameters.\n final HashMap<String, String> parameters =\n new HashMap<String, String>(2);\n parameters.put(\"grant_type\", \"bearer\");\n parameters.put(\"access_token\", mSharecareToken.accessToken);\n\n // Create endpoint.\n final String endPoint =\n String.format(PROFILE_ENDPOINT, mSharecareToken.accountID);\n\n this.beginRequest(endPoint, ServiceMethod.GET, headers, parameters,\n (String)null, ServiceResponseFormat.GSON,\n new ServiceResponseTransform<JsonElement, ResponseResult>()\n {\n @Override\n public ResponseResult transformResponseData(\n final JsonElement json)\n throws ServiceResponseTransformException\n {\n final ResponseResult result =\n checkResultFromAuthService(json);\n if (result.success)\n {\n // Extract profile info to create profile object.\n final JsonObject jsonObject = json.getAsJsonObject();\n final String firstName =\n getStringFromJson(jsonObject, FIRST_NAME);\n final String lastName =\n getStringFromJson(jsonObject, LAST_NAME);\n final String email =\n getStringFromJson(jsonObject, EMAIL);\n final String gender =\n getStringFromJson(jsonObject, GENDER);\n final Date dateOfBirth =\n getDateFromJson(jsonObject, DATE_OF_BIRTH);\n final double height =\n getDoubleFromJson(jsonObject, HEIGHT, 0);\n final double weight =\n getDoubleFromJson(jsonObject, WEIGHT, 0);\n\n if (firstName != null && lastName != null\n && email != null)\n {\n final Profile profile = new Profile();\n profile.firstName = firstName;\n profile.lastName = lastName;\n profile.email = email;\n profile.heightInMeters = height;\n profile.weightInKg = weight;\n profile.gender = gender;\n profile.dateOfBirth = dateOfBirth;\n updateAskMDProfileWithCompletion(null);\n final HashMap<String, Object> parameters =\n new HashMap<String, Object>(1);\n parameters.put(PROFILE, profile);\n result.parameters = parameters;\n }\n else\n {\n result.success = false;\n result.errorMessage = \"Bad profile data.\";\n result.responseCode =\n ServiceClientConstants.SERVICE_RESPONSE_STATUS_CODE_BAD_DATA;\n }\n }\n\n LogError(\"getProfileWithCompletion\", result);\n return result;\n }\n }, completion);\n }", "private void userReport() {\n reportText.appendText(\"Report of appointments per User\\n\\n\");\n for (User user: Data.getUsers()) {\n reportText.appendText(\"\\n\\nUser: \" + user.getUsername() + \"\\n\");\n for (Appointment appointment: Data.getAppointments()) {\n if (appointment.getUser() == user.getId()) {\n reportText.appendText(\"Appointment ID: \" + appointment.getId() +\n \" \\tTitle: \" + appointment.getTitle() +\n \"\\tType: \" + appointment.getType() +\n \"\\tDescription: \" + appointment.getDescription() +\n \"\\tStart: \" + appointment.getStart() +\n \"\\tEnd: \" + appointment.getEnd() +\n \"\\tCustomer: \" + appointment.getCustomer() + \"\\n\");\n }\n System.out.println(\"\\n\\n\");\n }\n }\n\n }", "String getProfile();", "public final double getPercentageComplete() {\n \t\tdouble percentageComplete = 0;\n \t\tfor (StoppingCondition condition : stoppingConditions) {\n \t\t\tif (condition.getPercentageCompleted() > percentageComplete) {\n \t\t\t\tpercentageComplete = condition.getPercentageCompleted();\n \t\t\t}\n \t\t}\n \t\treturn percentageComplete;\n \t}", "public User checkUserExists(User u) \n\t{\t\t\t\n\t\t\tSQLiteDatabase db = this.getReadableDatabase();\t\t \n\t\t Cursor cursor = db.query(CCH_USER_TABLE, new String[] { CCH_USER_ID, CCH_STAFF_ID, CCH_USER_PASSWORD, CCH_USER_APIKEY, CCH_USER_FIRSTNAME, CCH_USER_LASTNAME, CCH_USER_POINTS, CCH_USER_BADGES, CCH_USER_SCORING }, CCH_STAFF_ID + \"=?\",\n\t\t new String[] { String.valueOf(u.getUsername()) }, null, null, null, null); \t \n\t\t if (cursor == null || cursor.getCount()==0)\n\t\t\t return null;\t \t\n\t\t cursor.moveToFirst();\n\t\t \n\t\t // load preferences\n\t\t u.setApi_key(cursor.getString(3));\n\t\t u.setFirstname(cursor.getString(4));\n\t\t u.setLastname(cursor.getString(5));\n\t\t u.setPoints(cursor.getInt(6));\n\t\t u.setBadges(cursor.getInt(7)); \n\t\t u.setScoringEnabled((cursor.getInt(8)==1 ? true: false));\n\t\t \n\t\t if (!(u.getPassword().equals(cursor.getString(2)))) {\n\t\t\t u.setPasswordRight(false);\t \n\t\t } \n\t\t \n\t\t return u;\n }", "public String getPeriod() throws Exception\r\n\t{\r\n\t\tString SQL_USER = \"SELECT period FROM user WHERE id=?;\";\t\t\r\n\t\tString returnValue = \"\";\r\n\t\ttry\r\n\t\t{\r\n\t\t\tPreparedStatement statement = this.getConn().prepareStatement(SQL_USER);\r\n\t\t\tstatement.setInt(1, userId);\r\n\t\t\tResultSet result = statement.executeQuery();\r\n\r\n\t\t\t// If this returns true, then the user already exists.\r\n\t\t\tif (!result.next())\r\n\t\t\t{\r\n\t\t\t\tthrow new Exception(\"No student found! (getPeriod)\");\r\n\t\t\t}\r\n\r\n\t\t\t// Return the successfully user.\r\n\t\t\treturnValue = result.getString(\"period\");\r\n\t\t} catch (SQLException e)\r\n\t\t{\r\n\t\t\tGWT.log(\"Error in getPeriod()\", e);\r\n\t\t\tthis.getConn().rollback();\r\n\t\t\tthrow e;\r\n\t\t}\r\n\t\treturn returnValue;\r\n\t}", "public void printReport(){\n\t\tSystem.out.println(\"This is \" + name + \", UPENN \" + graduationYear);\n\t\tSystem.out.println(\"Their GPA is \" + GPA);\n\t\tString numCoursesString = \"\";\n\t\tif (numCoursesCompleted == 1){\n\t\t\tnumCoursesString=\"course\";\t//if the student has only taken one course, just print course\n\t\t}\n\t\telse{\n\t\t\tnumCoursesString=\"courses\"; //if the student has taken more than one course, print courses when called\n\t\t}\n\t\tSystem.out.println(\"They have taken \" + numCoursesCompleted + \" \" + numCoursesString); \n\t}", "public Long getContributingUserCount(){\n\n return User.count(\"from User u where u.status in (?1) and u.company = ?2 AND exists(select id from Question q where q.user = u and status = ?3)\",\n UserStatus.getStatusesConsideredInUse(), this, QuestionStatus.ACCEPTED);\n }", "public UserProfile getUserProfile(String username);", "@Override\n\tpublic UserHistory getLatestUserHistory(User user) {\n\t\tUserHistory userHistory = new UserHistory();\n\t\tlog.info(\"User id:\" + user.getId());\n\t\ttry{userHistory = (UserHistory) em.createQuery(\n\t\t\t\t\"select uh from UserHistory uh where uh.userId is :userId order by cartId desc\")\n\t\t\t\t.setParameter(\"userId\", user.getId()).getSingleResult();\n\t\t//return userHistoryList.get(0);\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t\treturn userHistory;\n\t}", "public Profile getProfile() {\n return _profile;\n }", "public User getPrefsUser() {\n Gson gson = new Gson();\n String json = prefs.getString(USER_PREFS, \"\");\n return gson.fromJson(json, User.class);\n }", "public User getCheckLevel4(int idUser) {\n\t\treturn new User();\n\n\t}", "public Number getPercentageComplete()\r\n {\r\n return (m_percentageComplete);\r\n }", "public static Task<Map<String, Object>> loadUserProfile(String userId) {\n return FirebaseFirestore.getInstance()\n .collection(Const.USERS_COLLECTION)\n .document(userId)\n .get()\n .continueWith(new Continuation<DocumentSnapshot, Map<String, Object>>() {\n @Override\n public Map<String, Object> then(@NonNull Task<DocumentSnapshot> task) {\n if (task.getResult() != null) {\n return task.getResult().getData();\n } else return new HashMap<>();\n }\n });\n }", "public com.google.protobuf2.AnyOrBuilder getProfileOrBuilder() {\n if (profileBuilder_ != null) {\n return profileBuilder_.getMessageOrBuilder();\n } else {\n return profile_ == null ?\n com.google.protobuf2.Any.getDefaultInstance() : profile_;\n }\n }", "private String profileTest() {\n BufferedReader br = null;\n try {\n br = new BufferedReader(new FileReader(\n \"/home/pascal/bin/workspace_juno/pgu-geo/war/WEB-INF/pgu/profile.json\"));\n } catch (final FileNotFoundException e) {\n throw new RuntimeException(e);\n }\n\n final StringBuilder sb = new StringBuilder();\n String line = null;\n\n try {\n while ((line = br.readLine()) != null) {\n sb.append(line);\n }\n } catch (final IOException e) {\n throw new RuntimeException(e);\n }\n return sb.toString();\n }", "public String getProfile();", "public ProjectProfileBO getProfile()\r\n {\r\n return mProfile;\r\n }", "@GET\n @Path(\"/scorecard/breakdown/{user}\")\n public Response getUserBreakdown(@PathParam(\"user\") String user) throws JsonGenerationException, JsonMappingException, IOException{\n Database2 db=Database2.get();\n Map<String, Integer> scorecard=db.getScoreCards().get(user);\n \n Chart2Json chart=new Chart2Json();\n chart.getDatasets().add(new DataSet2());\n chart.getDatasets().get(0).setBorderWidth(1);\n if (null!=scorecard){\n for(Entry<String, Integer> s:scorecard.entrySet()){\n chart.getLabels().add(s.getKey());\n chart.getDatasets().get(0).getData().add(s.getValue());\n }\n }else{\n chart.getLabels().add(\"No Points\");\n chart.getDatasets().get(0).getData().add(0);\n }\n return Response.status(200)\n .header(\"Access-Control-Allow-Origin\", \"*\")\n .header(\"Content-Type\",\"application/json\")\n .header(\"Cache-Control\", \"no-store, must-revalidate, no-cache, max-age=0\")\n .header(\"Pragma\", \"no-cache\")\n .entity(Json.newObjectMapper(true).writeValueAsString(chart)).build();\n }", "private void loadUserInformation() {\n FirebaseUser user = mAuth.getCurrentUser();\n\n if (user != null) {\n if (user.getPhotoUrl() != null) {\n Glide.with(this).load(user.getPhotoUrl().toString()).into(profilePic);\n }\n if (user.getDisplayName() != null) {\n name.setText(user.getDisplayName());\n }\n\n }\n\n }", "public Long getSize(UserAccount user) {\n Long sum = 0L;\n for (Job j : userJobList(user)) {\n sum += getSize(j);\n }\n return sum;\n }", "private User retrievePersonalProfileData() {\n if (checkIfProfileExists()) {\n return SharedPrefsUtils.convertSharedPrefsToUserModel(context);\n } else {\n return null;\n }\n }", "public int getUserCountByPage(User user) {\n\t\treturn userDao.getUserCountByPage(user);\r\n\t}", "com.lxd.protobuf.msg.result.user.User.User_OrBuilder getUserOrBuilder();", "public Long getUserProfileId(WikiUser user, String ns, boolean nullIfUnset) throws Exception\n {\n String login = user.getLogin();\n if (!profileAssignments.containsKey(login))\n {\n synchronized (this)\n {\n JOTLogger.log(JOTLogger.DEBUG_LEVEL, this, \"Caching profile assignments for: \" + user.getLogin());\n\n TreeMap assignments = new TreeMap();\n JOTSQLCondition cond=new JOTSQLCondition(\"user\", JOTSQLCondition.IS_EQUAL, new Long(user.getId()));\n Vector userProfiles = JOTQueryBuilder.selectQuery(null, WikiProfileSet.class).where(cond).find().getAllResults();\n if (userProfiles != null)\n {\n for (int i = 0; i != userProfiles.size(); i++)\n {\n WikiProfileSet set = (WikiProfileSet) userProfiles.get(i);\n assignments.put(set.getNameSpace(), new Long(set.getProfile()));\n }\n }\n profileAssignments.put(login, assignments);\n }\n }\n TreeMap assignment = (TreeMap) profileAssignments.get(login);\n Long result = (Long) assignment.get(ns);\n // if no assignment for this NS, then try the defaultNS assignment\n if (!nullIfUnset && result == null)\n {\n result = (Long) assignment.get(WikiUser.__ANY_NS__);\n }\n return result;\n }", "private void updateProfileReview() {\n mBinding.submit.startAnimation();\n HashMap<String, Object> body = new HashMap<>();\n body.put(\"profile_completion\", \"complete\");\n enqueue(getApi().updateProfile(body), new CallBack<User>() {\n @Override\n public void onSuccess(User user) {\n updateUser(user);\n mBinding.submit.revertAnimation();\n if (user.account_status.equalsIgnoreCase(\"APPROVED\")) {\n replaceFragment(new AccountVerifiedFragment());\n } else if (user.account_status.equalsIgnoreCase(\"REJECTED\")) {\n replaceFragment(new KycRejectedFragment());\n } else {\n replaceFragment(new UnderReviewFragment());\n }\n }\n\n @Override\n public boolean onError(RetrofitError error, boolean isInternetIssue) {\n mBinding.submit.revertAnimation();\n return super.onError(error, isInternetIssue);\n\n }\n });\n }", "public Float percentComplete() {\n return this.percentComplete;\n }", "@NoProxy\n public String getPeruserTransparency(final String userHref) {\n if ((userHref == null) ||\n userHref.equals(getOwnerHref())) {\n return getTransparency();\n }\n\n final BwXproperty pu = findPeruserXprop(userHref,\n BwXproperty.peruserPropTransp);\n\n if (pu == null) {\n return getTransparency();\n }\n\n return pu.getValue();\n }", "@Override\n protected UserDetails getDetails(User user, boolean viewOwnProfile, PasswordPolicy passwordPolicy, Locale requestLocale, boolean preview) {\n return userService.getUserDetails(user);\n }", "public Profile getProfile() {\n return m_profile;\n }", "public CompletionStage<Result> getUserProfile(String userName) throws TwitterException{\n\t\treturn FutureConverters.toJava(ask(userProfileActor,new UserProfileActor.UserProfileQuery(userName),10000))\n\t\t\t\t.thenApply(response->ok(userProfilePage.render((UserProfileResult)response)));\n\t}", "@Override\n\tpublic UserProfile getQuickProfile(String userName) throws Exception {\n\t\treturn null;\n\t}", "public String getUserProperty(final UserDataAttrib dataAttrib,\n final User user)\n throws BackendRequestException {\n return getUserProperty(dataAttrib, user.getEmail(), user.getTok());\n }", "@ResponseStatus(HttpStatus.OK)\r\n\t@RequestMapping(value = UrlHelpers.USER_PROFILE_ID, method = RequestMethod.GET)\r\n\tpublic @ResponseBody\r\n\tUserProfile getUserProfileByOwnerId(\r\n\t\t\t@RequestParam(value = AuthorizationConstants.USER_ID_PARAM, required = false) String userId,\r\n\t\t\t@PathVariable String profileId) throws DatastoreException, UnauthorizedException, NotFoundException {\r\n\t\tUserInfo userInfo = userManager.getUserInfo(userId);\r\n\t\treturn userProfileManager.getUserProfile(userInfo, profileId);\r\n\t}", "public Customer fetchProfileDetails(Long userId) {\n\t\tCustomer cust = null;\n\t\ttry (Connection con = DBUtil.getInstance().getDbConnection()) {\n\t\t\t//Create object of Customer DAO & call respective method\n\t\t\tCustomerDAO customerDAO = new CustomerDAO(con); \n\t\t\tcust=customerDAO.getCustomerById(userId);\n\t\t} catch (SQLException e) {\n\t\t\tthrow new ServiceException(\"Internal Server issue to validate CRM User, Please contact admin\");\n\t\t}\n\t\treturn cust;\n\t}", "public String check(User user) {\n\t\ttry {\n\t\t\tSession session=this.sessionFactory.getCurrentSession();\n\t\t\tQuery query = session.createQuery(\"from User\");\n\t\t\tSystem.out.println(user.getUsername()+\"???\");\n\n\t\t\tSystem.out.println(query.list().size());\n\t\t\t\n\t\t\tUser user1 = (User) query.list().get(0);\n\t\t\tString passwd = user1.getPassword();\n\t\t\treturn passwd;\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturn \"error\";\n\t\t\t// TODO: handle exception\n\t\t}\n\t\t\n\t}", "public User getUserHealthInfo(String userId){\n\t\tRestTemplate restTemplate = new RestTemplate();\n\t\t\n\t\t/*\n\t\t * This API collect data from more than one web services, so, it applies the services composition\n\t\t */\n\t\t\n\t\t// Get user Recipe\n\t\tResponseEntity<Recipe> rateResponse =\n\t\t restTemplate.exchange(BASE_URL + RECIPE_URL + \"/\" + userId, HttpMethod.GET, \n\t\t \t\tnull, new ParameterizedTypeReference<Recipe>() {\n\t\t });\n\t\tRecipe recipe = rateResponse.getBody();\n\t\tlogger.debug(\"RECIPE Info :\" + recipe);\n\t\t\n\t\t// Get user info\n\t\tResponseEntity<User> userInfoResponse =\n\t\t restTemplate.exchange(BASE_URL + USER_URL + \"/\" + userId, HttpMethod.GET, \n\t\t \t\tnull, new ParameterizedTypeReference<User>() {\n\t\t });\n\t\tUser user = userInfoResponse.getBody();\n\t\tlogger.debug(\"User Info :\" + user);\n\t\t\n\t\tuser.setRecipe(recipe);\n\t\t\n\t\t\n\t\t// Get User health status info\n\t\tHealth healthInfo = restTemplate.getForObject(BASE_URL + HEALTH_STATUS_URL, Health.class, userId);\n\t\tuser.setHealth(healthInfo);\n\t\tlogger.debug(\"User Info :\" + healthInfo);\n\t\t\n\t\treturn user;\n\t}", "UserStatus getStatus();", "private Profile[] getProfiles(String[] userIds) throws ProfileServiceException{\n \t\tif (logger.isLoggable(Level.FINEST)) {\n \t\t\tlogger.entering(sourceClass, \"getProfiles\", userIds);\n \t\t}\n \t\tProfile[] profiles = new Profile[userIds.length];\n \t\tint i = 0;\n \t\tif (userIds != null) {\n \t\t\tfor (String userId : userIds) {\n \t\t\t\tif (userId != null) {\n \t\t\t\t\tprofiles[i] = getProfile(userId);\n \t\t\t\t\ti++;\n \t\t\t\t} else // elementary NP handling. Setting the profile null;\n \t\t\t\t{\n \t\t\t\t\tprofiles[i] = null;\n \t\t\t\t\ti++;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\tif (logger.isLoggable(Level.FINEST)) {\n \t\t\tString log = \"call to retrive profiles successful\";\n \t\t\tif (profiles != null) {\n \t\t\t\tfor (Profile profile : profiles) {\n \t\t\t\t\tif (null == profile) {\n \t\t\t\t\t\tlog = \"Empty response from server for one of the requested profiles\";\n \t\t\t\t\t\tbreak;\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\tlog = \"\";\n \t\t\t}\n \t\t\tlogger.exiting(sourceClass, \"getProfiles\", log);\n \t\t}\n \t\treturn profiles;\n \t}", "private void fetchUser() {\n UserFetcher userFetcher = new UserFetcher();\n userFetcher.setListener(this);\n userFetcher.getUser();\n }", "private void showUserInfo(User user) {\n Picasso\n .with(getContext())\n .load(user.getProfilePicture())\n .transform(new CircleTransformation())\n .into(mUserImageView);\n\n mNameTextView.setText(user.getFullName());\n mWebsiteTextView.setText(user.getWebsite());\n\n if (!TextUtils.isEmpty(user.getBio())) {\n mBioTextView.setText(user.getBio());\n mBioTextView.setMovementMethod(new ScrollingMovementMethod());\n mBioLinearLayout.setVisibility(View.VISIBLE);\n } else {\n mBioLinearLayout.setVisibility(View.GONE);\n }\n\n if (user.getCounts().getMedia() == 0 && user.getCounts().getFollows() == 0 && user.getCounts().getFollowedBy() == 0) {\n mCountsLinearLayout.setVisibility(View.GONE);\n } else {\n String mediaCount = \"\\t\" + \"\\t\" + \"\\t\" + String.valueOf(user.getCounts().getMedia());\n mMediaCountTextView.setText(mediaCount);\n\n String followsCount = \"\\t\" + \"\\t\" + \"\\t\" + String.valueOf(user.getCounts().getFollows());\n mFollowsTextView.setText(followsCount);\n\n String followedByCount = \"\\t\" + \"\\t\" + \"\\t\" + String.valueOf(user.getCounts().getFollowedBy());\n mFollowedByTextView.setText(followedByCount);\n\n mCountsLinearLayout.setVisibility(View.VISIBLE);\n }\n }", "@Given(\"^User should see profile page$\")\n\tpublic void user_should_see_profile_page() throws Throwable {\n\t\twait.WaitForElement(profileTestInsurancePage.gettestinsuranceheading(), 60);\n\t\tprofileTestInsurancePage.verifyprofileTestInsurancePage();\n\t}", "@WebMethod(action=\"http://xmlns.oracle.com/apps/hcm/hwr/coreService/getUserProfile\",\n operationName=\"getUserProfile\")\n @RequestWrapper(targetNamespace=\"http://xmlns.oracle.com/apps/hcm/hwr/coreService/types/\",\n localName=\"getUserProfile\")\n @ResponseWrapper(targetNamespace=\"http://xmlns.oracle.com/apps/hcm/hwr/coreService/types/\",\n localName=\"getUserProfileResponse\")\n @WebResult(name=\"result\")\n @CallbackMethod(exclude=true)\n String getUserProfile(@WebParam(mode = WebParam.Mode.IN, name=\"profileInformation\")\n String profileInformation) throws ServiceException;", "public Double percentComplete() {\n return this.percentComplete;\n }", "public static Profile getProfile() {\n return profile;\n }", "private void getProfileInfo() {\n boolean connectivity=checkConnection();\n if(connectivity){\n progressBar.setVisibility(View.VISIBLE);\n assert currentUser != null;\n String userid = currentUser.getUid();\n databaseReference.child(userid).addValueEventListener(new ValueEventListener() {\n @SuppressLint(\"SetTextI18n\")\n @Override\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n @SuppressLint({\"NewApi\", \"LocalSuppress\"}) String name = Objects.requireNonNull(dataSnapshot.child(\"name\").getValue()).toString();\n @SuppressLint({\"NewApi\", \"LocalSuppress\"}) String number = Objects.requireNonNull(dataSnapshot.child(\"number\").getValue()).toString();\n String email = currentUser.getEmail();\n Name.setText(name);\n Number.setText(\"+92\" + number);\n Email.setText(email);\n progressBar.setVisibility(View.GONE);\n\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n\n }\n });\n }\n else{\n Toast.makeText(getContext(), \"No Internet Connectivity!\", Toast.LENGTH_SHORT).show();\n }\n\n\n }", "@java.lang.Override\n public boolean hasProfile() {\n return profile_ != null;\n }", "public double getPercentComplete() {\n\t\tthis.percent_complete = ((double) lines_produced / (double) height) * 100.0;\n\t\treturn this.percent_complete;\n\t}", "public static void retrieveActiveUser(final Context context){\n FirebaseFirestore firebaseFirestore = FirebaseFirestore.getInstance();\n\n /* Return all users */\n firebaseFirestore.collection(\"users\")\n .get()\n .addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {\n @Override\n public void onComplete(@NonNull Task<QuerySnapshot> task) {\n if (task.isSuccessful()) {\n /* For each user */\n for (QueryDocumentSnapshot document : task.getResult()) {\n /* Get user data */\n Map<String, Object> userData = document.getData();\n\n /* If the correct user */\n // Update not to pull every user back\n if (MainActivity.activeUser.email.toLowerCase().equals(userData.get(\"email\").toString().toLowerCase())) {\n /* Retrieve active users information */\n\n MainActivity.activeUser.email = document.get(\"email\").toString();\n MainActivity.activeUser.username = document.get(\"username\").toString();\n MainActivity.activeUser.password = document.get(\"password\").toString();\n MainActivity.activeUser.profilePictureURL = document.get(\"imageUrl\").toString();\n\n\n\n break;\n }\n }\n } else {\n Toast.makeText(context.getApplicationContext(), \"Firestore retireval failed\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n }", "@Test\n\tpublic void testGetUser() {\n\t\tAbuseReport aReport = Mockito.mock(AbuseReport.class);\n\t\tUser aUser = Mockito.mock(User.class);\n\t\tMockito.when(aReport.getUser()).thenReturn(aUser);\n\t\tUser result = aReport.getUser();\n\t\tassertEquals(result, aUser);\t\n\t}", "@ResponseStatus(HttpStatus.OK)\r\n\t@RequestMapping(value = UrlHelpers.USER_PROFILE, method = RequestMethod.GET)\r\n\tpublic @ResponseBody\r\n\tUserProfile getMyOwnUserProfile(\r\n\t\t\t@RequestParam(value = AuthorizationConstants.USER_ID_PARAM, required = false) String userId\r\n\t\t\t) throws DatastoreException, UnauthorizedException, NotFoundException {\r\n\t\tUserInfo userInfo = userManager.getUserInfo(userId);\r\n\t\treturn userProfileManager.getUserProfile(userInfo, userInfo.getIndividualGroup().getId());\r\n\t}", "H getProfile();", "public DefaultProfileCompletenessRetriever() {\n }" ]
[ "0.6224179", "0.5947719", "0.5893847", "0.5888352", "0.58578753", "0.5580931", "0.55735874", "0.5485757", "0.5329187", "0.53229177", "0.51528907", "0.5127043", "0.49793717", "0.4960725", "0.49530974", "0.4882748", "0.48751557", "0.48743635", "0.48504555", "0.48144796", "0.48018667", "0.4792744", "0.47894397", "0.47784024", "0.4706749", "0.4693465", "0.46847492", "0.46813983", "0.46711087", "0.4670519", "0.46401298", "0.46399185", "0.4636168", "0.46096304", "0.46051896", "0.4592354", "0.45899805", "0.4566038", "0.45629317", "0.4559598", "0.45389625", "0.4538199", "0.451453", "0.45073113", "0.45040452", "0.45023492", "0.4485736", "0.44812885", "0.4478873", "0.4466766", "0.4459092", "0.44566834", "0.44427365", "0.44401637", "0.44349787", "0.44344702", "0.44323292", "0.44318727", "0.44275123", "0.44247273", "0.4421498", "0.44169396", "0.4406754", "0.44063643", "0.4406042", "0.4403185", "0.44030917", "0.439744", "0.439264", "0.4379963", "0.43757764", "0.43727037", "0.43705174", "0.43682873", "0.43652", "0.43634", "0.43618768", "0.43542144", "0.4348753", "0.43389282", "0.43269312", "0.43141082", "0.431232", "0.4305123", "0.43040174", "0.42987207", "0.42981076", "0.42951876", "0.428813", "0.42846155", "0.42844275", "0.42832705", "0.42763612", "0.4267313", "0.42665696", "0.42630932", "0.4261666", "0.42609182", "0.42524916", "0.42516565" ]
0.8243217
0
Retrieves the namesake field instance value.
public List<ProfileTaskChecker> getProfileTaskCheckers() { return profileTaskCheckers; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getFieldValue() {\n return TF_Field_Value;\n }", "String getField();", "public String getFieldValue() {\r\n\t\tString value = textBox.getValue();\r\n\t\t\t\r\n\t\treturn value;\r\n\t}", "@Override\n\tpublic String getValue() {\n\t\treturn name;\n\t}", "public java.lang.String getFieldValue() {\n return fieldValue;\n }", "public String getName(){\n return field.getName();\n }", "public String getField()\n {\n return field;\n }", "public String getField() {\n return field;\n }", "public String get()\n {\n return val;\n }", "String getFieldName();", "public String getFieldValue() {\n return this.fieldValue;\n }", "java.lang.String getField1335();", "public String getFieldValue(LVValue name) throws LRException\n\t{\n\t\tDataHRecordData myData=(DataHRecordData)getData();\n\t\ttry\n\t\t{\n\t\t\tclearStatus();\n\t\t\tLDBRecord record=myData.record;\n\t\t\tif (record!=null) return record.getStringValue(name.getStringValue());\n\t\t}\n\t\tcatch (LDBException e) { setStatus(e); }\n\t\treturn \"\";\n\t}", "java.lang.String getField1337();", "public String name() {\n return myStrVal;\n }", "public String getFieldValue (String sName)\n\t{\n\t\tif(m_Fields.containsKey(sName))\n\t\t{\n\t\t\treturn m_Fields.get(sName);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\t}", "public T getField()\r\n {\r\n return this.field;\r\n }", "public java.lang.Object get(int field$) {\n switch (field$) {\n case 0: return kd_kelas;\n case 1: return hari_ke;\n case 2: return jam_mulai;\n case 3: return jam_selesai;\n case 4: return tgl_mulai_otomatis_buat_jadwal;\n case 5: return tgl_berakhir_otomatis_buat_jadwal;\n case 6: return aktif;\n case 7: return kd_mk;\n case 8: return nama_mk;\n case 9: return nama_kelas;\n case 10: return nama_hari;\n case 11: return ts_update;\n case 12: return kd_org;\n case 13: return thn;\n case 14: return term;\n default: throw new org.apache.avro.AvroRuntimeException(\"Bad index\");\n }\n }", "public String getName(){\n\n //returns the value of the name field\n return this.name;\n }", "@Nullable\n\tObject getFieldValue(String field);", "abstract public String getValue(String fieldname);", "public String getFieldName();", "String getValueName();", "java.lang.String getField1336();", "FieldInstance fieldNamed(String name);", "java.lang.String getField1334();", "String getVal();", "public String getter() {\n\t\treturn name;\n\t}", "public String getFieldName()\n {\n return m_strFieldName;\n }", "java.lang.String getField1339();", "public String get_fieldname() throws Exception {\n\t\treturn this.fieldname;\n\t}", "public String getFieldName() {\r\n return this.strFieldName;\r\n }", "public String valiationOfUsernameField()\n\t{\n\t\twaitForVisibility(validationUsername);\n\t\treturn validationUsername.getText();\n\t}", "public String get(String fieldName) {\n\t\tString xpQuery = getXPathQuery(fieldName);\n\t\treturn getFieldUsingXPath(xpQuery);\n\t}", "public String getValue () { return value; }", "public String getValue(){\n\t\treturn _value;\n\t}", "private static Object getFieldValue(ETApiObject row, String fieldName) {\n try {\n Method method = row.getClass().getMethod(createGetterName(fieldName));\n return method.invoke(row);\n } catch (Exception e) {\n LOG.error(String.format(\"Error while fetching %s.%s value\", row.getClass().getSimpleName(), fieldName), e);\n return null;\n }\n }", "public String getValue()\n {\n return fValue;\n }", "java.lang.String getField1338();", "java.lang.String getValue();", "java.lang.String getValue();", "java.lang.String getValue();", "java.lang.String getValue();", "java.lang.String getValue();", "java.lang.String getValue();", "public String getFieldname(){\n\t\treturn sFeldname;\n\t}", "java.lang.String getField1589();", "public String getName() { return (String)get(\"Name\"); }", "public String getValue() {\n return getMethodValue(\"value\");\n }", "java.lang.String getField1567();", "java.lang.String getField1587();", "String getJavaFieldName();", "public String getValue() { return value; }", "java.lang.String getField1742();", "public Object getValue(String fieldName) {\n try {\n Field field = FieldUtils.getField(object.getClass(), fieldName, true);\n if (field != null) {\n return FieldUtils.readField(field, object, true);\n } else {\n logger.error(\"Unable to get value of field because the field does not exits on class: \" + object.getClass());\n }\n } catch (IllegalAccessException e) {\n logger.error(e);\n }\n return null;\n }", "public String getNameFieldText() {\n return nameField.getText();\n }", "java.lang.String getField1542();", "public String getValue()\n {\n return value;\n }", "java.lang.String getField1342();", "java.lang.String getField1579();", "java.lang.String getField1533();", "public String value()\n {\n return value;\n }", "java.lang.String getField1212();", "java.lang.String getField1279();", "java.lang.String getField1610();", "java.lang.String getField1537();", "java.lang.String getField1015();", "io.dstore.values.StringValue getCampaignName();", "public String getName() {\n/* */ return this.field_176894_i;\n/* */ }", "java.lang.String getField1333();", "java.lang.String getField1588();", "java.lang.String getField1307();", "java.lang.String getField1001();", "java.lang.String getField1574();", "Object getObjectField();", "public String getValue()\n {\n return this.value;\n }", "public Field getField() {\n return field;\n }", "public String getValue() {\n return value;\n }", "java.lang.String getField1577();", "java.lang.String getField1237();", "java.lang.String getField1538();", "java.lang.String getField1789();", "public String getText()\n {\n return field.getText();\n }", "java.lang.String getField1274();", "public String getValue()\n {\n String v = (String)this.getFieldValue(FLD_value);\n return StringTools.trim(v);\n }", "java.lang.String getField1172();", "java.lang.String getField1423();", "java.lang.String getField1067();", "java.lang.String getField1576();", "java.lang.String getField1787();", "java.lang.String getField1569();", "public String getValue();", "public String getValue();", "public String getValue();", "public String getValue();", "public String getValue();", "public String getValue();", "public String getValue();", "public String getValue();", "public String getValue();", "java.lang.String getField1566();" ]
[ "0.64021486", "0.6397135", "0.63505775", "0.63056445", "0.62753963", "0.6271796", "0.6271776", "0.6242486", "0.62098676", "0.6203862", "0.6195688", "0.61673546", "0.61632687", "0.6161515", "0.6138417", "0.6120059", "0.6089148", "0.60752726", "0.60689354", "0.60559404", "0.60541165", "0.60366786", "0.60242534", "0.6023701", "0.6012543", "0.6002995", "0.5984293", "0.59776205", "0.5964418", "0.59631675", "0.59534997", "0.594159", "0.5937702", "0.59320235", "0.5917577", "0.5915869", "0.59157676", "0.5905708", "0.589461", "0.5886093", "0.5886093", "0.5886093", "0.5886093", "0.5886093", "0.5886093", "0.5884905", "0.5878653", "0.5877245", "0.58760345", "0.58712703", "0.5862236", "0.5859603", "0.5858904", "0.5854297", "0.5846423", "0.5842196", "0.5839538", "0.58362293", "0.5834031", "0.5833335", "0.58329284", "0.5831559", "0.5829464", "0.5829197", "0.5828691", "0.5827443", "0.5827228", "0.58183813", "0.58183575", "0.5813363", "0.5807167", "0.58071387", "0.5802804", "0.5800841", "0.58003646", "0.57980216", "0.57949984", "0.5783843", "0.578346", "0.5780014", "0.5779623", "0.5779496", "0.5778795", "0.57772243", "0.57751226", "0.5769187", "0.5769049", "0.57684886", "0.57684773", "0.576805", "0.57679486", "0.5766496", "0.5766496", "0.5766496", "0.5766496", "0.5766496", "0.5766496", "0.5766496", "0.5766496", "0.5766496", "0.5766179" ]
0.0
-1
Sets the namesake field instance value.
public void setProfileTaskCheckers(List<ProfileTaskChecker> profileTaskCheckers) { this.profileTaskCheckers = profileTaskCheckers; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setField(String value) {\n JsoHelper.setAttribute(jsObj, \"field\", value);\n }", "public void setField(String aValue) {\n String oldValue = field;\n field = aValue;\n changeSupport.firePropertyChange(\"field\", oldValue, aValue);\n }", "public void setValue(String fieldName, Object value) {\n try {\n Field field = FieldUtils.getField(object.getClass(), fieldName, true);\n if (field != null) {\n FieldUtils.writeField(field, object, value, true);\n } else {\n logger.error(\"Unable to set value on field because the field does not exits on class: \" + object.getClass());\n }\n } catch (IllegalAccessException e) {\n logger.error(e);\n }\n }", "private void setField( String fieldName, String value )\n {\n JTextField field =\n ( JTextField ) fields.get(fieldName);\n\n field.setText(value);\n }", "@Test\n public void test_setUsername() {\n String value = \"new_value\";\n instance.setUsername(value);\n\n assertEquals(\"'setUsername' should be correct.\",\n value, TestsHelper.getField(instance, \"username\"));\n }", "public void setName(String name) {\n fName= name;\n }", "public void set(String name, Object value) {\n }", "public void setValue(String value);", "public void setValue(String value);", "public void setValue(String value);", "public void setValue(String value);", "public void setFieldValue(String value){\r\n\t\ttextBox.setValue(value);\r\n\t}", "public void setName(String value) {\n\t\tname = value;\n\t}", "public void setName(java.lang.String value);", "public void setName(java.lang.String value);", "public FieldInstruction setFieldName(String name) {\n return setField(getFieldDeclarerName(), name, getFieldTypeName());\n }", "public void setName(String val) {\n name = val;\n }", "public void setFieldName(String fieldName);", "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 setName(String val) {\n this.name = val;\n }", "public void setValue (String Value);", "public void setValue(String value) {\n set (value);\n }", "void setMyField(String val) {\n\t\ttry {\n\t\t\tmyField = Integer.parseInt(val);\n\t\t} catch (NumberFormatException e) {\n\t\t\tmyField = 0;\n\t\t}\n\t}", "@Test\n public void test_setFirstName() {\n String value = \"new_value\";\n instance.setFirstName(value);\n\n assertEquals(\"'setFirstName' should be correct.\",\n value, TestsHelper.getField(instance, \"firstName\"));\n }", "protected Field setName(String name){\n\t\tif (name == null)\n\t\t\tname = \"\";\n\t\tthis.name = name;\n\t\tnameText.setText(name.equals(\"\") ? \"\" : this.name+\": \");\n\t\treturn this;\n\t}", "public void setValue(String value) {\r\n this.value = value;\r\n }", "public void setValue(String value) {\r\n this.value = value;\r\n }", "public void setValue(String value) {\r\n this.value = value;\r\n }", "public void setValue(String value) {\r\n this.value = value;\r\n }", "public void setValue(String value) {\r\n this.value = value;\r\n }", "public void setValue(String value)\n {\n this.value = value;\n }", "public void setDataIntoField(String fieldLabel, String value){\n reporter.info(\"Set data \"+value+\" into field\"+fieldLabel);\n setText(LOCATORS.getBy(COMPONENT_NAME,\"FIELD_INPUT_BY_NAME\",fieldLabel),value,SHORT_TIMEOUT);\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 )\n {\n this.value = value;\n }", "public void setField(final Object target, final String name, final Object value) {\n\n // check if the object is a proxy object\n if (AopUtils.isAopProxy(target) && target instanceof Advised) {\n try {\n ReflectionTestUtils.setField(((Advised) target).getTargetSource().getTarget(), name, value);\n } catch (Exception e) {\n e.printStackTrace();\n }\n } else {\n ReflectionTestUtils.setField(target, name, value);\n }\n }", "public final void setName(String name) {_name = name;}", "public void setValue(String value) {\n\t this.valueS = value;\n\t }", "public void setValue(String name, Object value) {\n\t\tif (this.fields == null)\n\t\t\tthis.fields = new HashMap<String, Object>();\n\t\tif (name != null)\n\t\t\tthis.fields.put(name, value);\n\t}", "public void setName(String value) {\n this.name = value;\n }", "private void setName(java.lang.String name) {\n System.out.println(\"setting name \"+name);\n this.name = name;\n }", "@Test\n public void test_setLastName() {\n String value = \"new_value\";\n instance.setLastName(value);\n\n assertEquals(\"'setLastName' should be correct.\",\n value, TestsHelper.getField(instance, \"lastName\"));\n }", "public void set(String fieldName, Object value) {\n\t\tcommandList.add(new SetCommand(fieldName, value));\n\t}", "public void setName(String Name){\r\n name = Name;\r\n }", "void setValue(String value);", "void setValue(String value);", "public void setValue(String value)\r\n\t\t{ textField.setText(value); }", "@Test\r\n public void testSetfName() {\r\n System.out.println(\"setfName\");\r\n String fName = \"\";\r\n Student instance = new Student();\r\n instance.setfName(fName);\r\n \r\n }", "public void setValue(String value) {\n this.value = value;\n }", "public void setValue(String value) {\n this.value = value;\n }", "public void setValue(String value) {\n this.value = value;\n }", "public void setValue(String value) {\n this.value = value;\n }", "public void setValue(String value) {\n this.value = value;\n }", "public void setName(String name)\n {\n _name = name;\n }", "@Test\r\n public void testSetlName() {\r\n System.out.println(\"setlName\");\r\n String lName = \"\";\r\n Student instance = new Student();\r\n instance.setlName(lName);\r\n \r\n }", "void setValue(java.lang.String value);", "public void setFieldValue(LVValue name,LVValue value) throws LRException\n\t{\n\t\tDataHRecordData myData=(DataHRecordData)getData();\n\t\ttry\n\t\t{\n\t\t\tclearStatus();\n\t\t\tLDBRecord record=myData.record;\n\t\t\tif (record!=null)\n\t\t\t{\n\t\t\t\tString fieldName=name.getStringValue();\n\t\t\t\tObject nValue=new Object();\n\t\t\t\tswitch (record.getFieldSpec(fieldName).getType())\n\t\t\t\t{\n\t\t\t\t\tcase LDBFieldSpec.BYTE:\n\t\t\t\t\t\tnValue=new Byte((byte)value.getIntegerValue());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase LDBFieldSpec.INT:\n\t\t\t\t\t\tnValue=new Integer(value.getIntegerValue());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase LDBFieldSpec.LONG:\n\t\t\t\t\t\tnValue=new Long(value.getNumericValue());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase LDBFieldSpec.CHAR:\n\t\t\t\t\t\tnValue=value.getStringValue();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase LDBFieldSpec.BINARY:\n\t\t\t\t\t\tnValue=value.getBinaryValue();\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\trecord.setValue(background.getClient(),fieldName,nValue);\n\t\t\t}\n\t\t}\n\t\tcatch (LDBException e) { setStatus(e); }\n\t}", "public void setValue(IveObject val){\r\n\tvalue = val;\r\n\tnotifyFromAttr();\r\n }", "public Builder setField1234(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n field1234_ = value;\n onChanged();\n return this;\n }", "public void setFieldName(String newValue) {\n TF_Field_Name = newValue.toUpperCase().trim(); // Field names are all in UPPER CASE.\n }", "public void setValue(String value) {\r\n\t\tthis.value = value;\r\n\t}", "public void setValue(S s) { value = s; }", "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 setValue(Object value) { this.value = value; }", "public void setValue(String value) {\n\t\tthis.text = value;\n\t}", "public void setValue(String value) {\n\t\tthis.value = value;\n\t}", "public void setValue(String value) {\n\t\tthis.value = value;\n\t}", "public void setValue(String value) {\n\t\tthis.value = value;\n\t}", "public void setValue(String value) {\n\t\tthis.value = value;\n\t}", "@JsonSetter(\"name\")\r\n public void setName (String value) { \r\n this.name = value;\r\n }", "public Builder setField1341(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n field1341_ = value;\n onChanged();\n return this;\n }", "public void setValue(String text) {\n\t\tthis.value = text;\n\t}", "public void setName(String name){this.name=name;}", "public void setValue(String value) {\n\t\tthis.value = value;\n\t}", "public void setName(String name){this.name = name;}", "void setValue(final String value);", "public void setName(java.lang.String value) {\n this.name = value;\n }", "public void setName(String newname){\n name = newname; \n }", "@JsonSetter(\"name\")\n public void setName (String value) { \n this.name = value;\n }", "public Builder setName(\n String value) {\n copyOnWrite();\n instance.setName(value);\n return this;\n }", "public Builder setName(\n String value) {\n copyOnWrite();\n instance.setName(value);\n return this;\n }", "public Builder setName(\n String value) {\n copyOnWrite();\n instance.setName(value);\n return this;\n }", "public void setValue(Object val);", "@Override\n public void setField (String fieldToModify, String value, Double duration) {\n\n }", "public void setValue(java.lang.String value) {\n this.value = value;\n }", "public Builder setField1415(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n field1415_ = value;\n onChanged();\n return this;\n }", "public void setName(String newValue);", "public void setName(String newValue);", "void setName(String name_);", "public void set(Object requestor, String field);", "public Builder setField1337(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n field1337_ = value;\n onChanged();\n return this;\n }", "@Override\n public void setValue(Object val)\n {\n value = val;\n }", "public void setName(String name){\n this.name = name;\n }", "public void setName(String newName){\n\n //assigns the value newName to the name field\n this.name = newName;\n }", "public void set (String Value)\n\t\t{\n\t\tthis.Value = Value;\t\t\n\t\t}", "public void setName(String name){\r\n this.name = name;\r\n }", "public void setName(String name){\r\n this.name = name;\r\n }", "public void setName(String name){\r\n this.name = name;\r\n }", "public void setName(String s) {\n\t\t\n\t\tname = s;\n\t}" ]
[ "0.650908", "0.64881486", "0.63271534", "0.6280422", "0.6256478", "0.6243453", "0.6235045", "0.62012136", "0.62012136", "0.62012136", "0.62012136", "0.61756396", "0.6153644", "0.6125439", "0.6125439", "0.6123915", "0.612076", "0.6120531", "0.61171013", "0.61171013", "0.61171013", "0.6109992", "0.6098699", "0.6097736", "0.60919434", "0.6087882", "0.60696924", "0.604928", "0.604928", "0.604928", "0.604928", "0.604928", "0.60476345", "0.60471624", "0.60427976", "0.6024302", "0.6017715", "0.60144645", "0.6013978", "0.6005724", "0.60050833", "0.60016865", "0.5991953", "0.5981063", "0.59744006", "0.5965682", "0.5965682", "0.5956023", "0.5953628", "0.5936809", "0.5936809", "0.5936809", "0.5936809", "0.5936809", "0.5933316", "0.5926902", "0.59076035", "0.5907366", "0.590589", "0.5900258", "0.58885604", "0.5881978", "0.5857389", "0.58488053", "0.58488053", "0.58433384", "0.5831944", "0.5810765", "0.5810765", "0.5810765", "0.5810765", "0.5802536", "0.5801784", "0.5793395", "0.57812184", "0.5776481", "0.5775739", "0.5762174", "0.57578045", "0.57577455", "0.57537884", "0.57499224", "0.57499224", "0.57499224", "0.5746039", "0.57431865", "0.5737777", "0.573077", "0.5730091", "0.5730091", "0.5725546", "0.5718599", "0.57171994", "0.5716484", "0.5714929", "0.57135385", "0.5707263", "0.57070553", "0.57070553", "0.57070553", "0.57036257" ]
0.0
-1
Prepare e.g., get Parameters.
protected void prepare() { ProcessInfoParameter[] para = getParameter(); for (int i = 0; i < para.length; i++) { String name = para[i].getParameterName(); if (name.equals("DeleteOldImported")) p_deleteOldImported = "Y".equals(para[i].getParameter()); else if (name.equals("IsValidateOnly")) p_IsValidateOnly = para[i].getParameterAsBoolean(); else log.log(Level.SEVERE, "Unknown Parameter: " + name); } m_AD_Client_ID = getProcessInfo().getAD_Client_ID(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void prepare()\n\t{\n\t\tProcessInfoParameter[] para = getParameter();\n\t\tfor (int i = 0; i < para.length; i++)\n\t\t{\n\t\t\tString name = para[i].getParameterName();\n\t\t\tif (name.equals(\"AD_Client_ID\"))\n\t\t\t\tm_AD_Client_ID = 1000000;\n\t\t\telse if (name.equals(\"AD_Org_ID\"))\n\t\t\t\tm_AD_Org_ID = 1000000;\n\t\t\telse if (name.equals(\"DeleteOldImported\"))\n\t\t\t;//\tm_deleteOldImported = \"Y\".equals(para[i].getParameter());\n\t\t\telse if (name.equals(\"DocAction\"))\n\t\t;//\t\tm_docAction = (String)para[i].getParameter();\n\t\t\telse\n\t\t\t\tlog.log(Level.SEVERE, \"Unknown Parameter: \" + name);\n\t\t}\n\t}", "protected void prepare()\n\t{\n\t\tProcessInfoParameter[] para = getParameter();\n\t\tfor (int i = 0; i < para.length; i++)\n\t\t{\n\t\t\tString name = para[i].getParameterName();\n\t\t\tif (para[i].getParameter() == null)\n\t\t\t\t;\n\t\t\telse if (name.equals(\"M_Requisition_ID\"))\n\t\t\t\tp_M_RequisitionFrom_ID = ((BigDecimal)para[i].getParameter()).intValue();\n\t\t\telse\n\t\t\t\tlog.log(Level.SEVERE, \"Unknown Parameter: \" + name);\n\t\t}\n\t}", "@Override\n\tprotected void prepare() {\n\t\t\n\t\t\n\t\tProcessInfoParameter[] para = getParameter();\n\t\tfor (int i = 0; i < para.length; i++)\n\t\t{\n\t\t\tString name = para[i].getParameterName();\n\t\t\tif (para[i].getParameter() == null);\n\t\t\t\n\t\t\telse if(name.equals(\"AD_Client_ID\"))\n\t\t\t\tp_AD_Client_ID = (int)para[i].getParameterAsInt();\n\t\t\t\n\t\t\telse if(name.equals(\"AD_Org_ID\"))\n\t\t\t\tp_AD_Org_ID = (int)para[i].getParameterAsInt();\n\t\t\t\n\t\t\telse if(name.equals(\"n_param01\"))\n\t\t\t\tparam_01 = (int)para[i].getParameterAsInt();\n\t\t\t\n\t\t\telse if(name.equals(\"n_param02\"))\n\t\t\t\tparam_02 = (int)para[i].getParameterAsInt();\n\t\t\t\n\t\t\telse if(name.equals(\"n_param03\"))\n\t\t\t\tparam_03 = (String)para[i].getParameterAsString();\n\t\t\t\n\t\t\telse if(name.equals(\"n_param04\"))\n\t\t\t\tparam_04 = (String)para[i].getParameterAsString();\n\t\t\t\n\t\t\telse if(name.equals(\"n_param05\"))\n\t\t\t\tparam_05 = (Timestamp)para[i].getParameterAsTimestamp();\n\t\t\t\n\t\t\telse if(name.equals(\"n_param06\"))\n\t\t\t\tparam_06 = (Timestamp)para[i].getParameterAsTimestamp();\n\t\t\t\n\t\t\telse if(name.equals(\"AD_User_ID\"))\n\t\t\t\tp_AD_User_ID = (int)para[i].getParameterAsInt();\n\t\t\t\n\t\t\telse if(name.equals(\"Report\"))\n\t\t\t\tp_Report = (int)para[i].getParameterAsInt();\n\t\t\telse\n\t\t\t\tlog.log(Level.SEVERE, \"Unknown Parameter: \" + name);\n\t\t}\n\t\t\n\t\t\n\t}", "protected void prepare()\n\t{\n\t\tProcessInfoParameter[] para = getParameter();\n\t\tfor (int i = 0; i < para.length; i++)\n\t\t{\n\t\t\tString name = para[i].getParameterName();\n\t\t\tif (para[i].getParameter() == null)\n\t\t\t\t;\n\t\t\telse if (name.equals(\"SRI_Authorization_ID\"))\n\t\t\t\tp_SRI_Authorization_ID = para[i].getParameterAsInt();\n\t\t\telse\n\t\t\t\tlog.log(Level.SEVERE, \"Unknown Parameter: \" + name);\n\t\t}\n\t\t\n\t\tm_AD_Client_ID = getAD_Client_ID();\n\t\t\n\t\tif (p_SRI_Authorization_ID == 0)\n\t\t\tp_SRI_Authorization_ID = getRecord_ID();\n\n\t}", "protected void prepare()\n\t{\n\t\tProcessInfoParameter[] para = getParameter();\n\t\tfor (int i = 0; i < para.length; i++)\n\t\t{\n\t\t\tString name = para[i].getParameterName();\n\t\t\t\n\t\t\tif (name.equals(\"Action\"))\n\t\t\t\tp_Action = para[i].getParameterAsString();\n\t\t\telse\n\t\t\t\tlog.log(Level.SEVERE, \"Unknown Parameter: \" + name);\n\t\t}\n\t\tp_Hospitalization_ID=getRecord_ID();\n\t}", "protected void prepare()\n\t{\n\t\tlog.info(\"\");\n\t\tm_ctx = Env.getCtx();\n\t\tProcessInfoParameter[] para = getParameter();\n\t\tfor (int i = 0; i < para.length; i++)\n\t\t{\n\t\t\tString name = para[i].getParameterName();\n\t\t\tif (name.equals(\"C_BankStatementLoader_ID\"))\n\t\t\t\tm_C_BankStmtLoader_ID = ((BigDecimal)para[i].getParameter()).intValue();\n\t\t\telse if (name.equals(\"FileName\"))\n\t\t\t\tfileName = (String)para[i].getParameter();\n\t\t\telse\n\t\t\t\tlog.log(Level.SEVERE, \"Unknown Parameter: \" + name);\n\t\t}\n\t\tm_AD_Client_ID = Env.getAD_Client_ID(m_ctx);\n\t\tlog.info(\"AD_Client_ID=\" + m_AD_Client_ID);\n\t\tm_AD_Org_ID = Env.getAD_Org_ID(m_ctx);\n\t\tlog.info(\"AD_Org_ID=\" + m_AD_Org_ID);\n\t\tlog.info(\"C_BankStatementLoader_ID=\" + m_C_BankStmtLoader_ID);\n\t}", "@Override\n\tprotected void prepare() {\n\t\tfor(ProcessInfoParameter parameter :getParameter()){\n\t\t\tString name = parameter.getParameterName();\n\t\t\tif(parameter.getParameter() == null){\n\t\t\t\t;\n\t\t\t}else if(name.equals(\"XX_TipoRetencion\")){\n\t\t\t\tp_TypeRetention = (String) parameter.getParameter();\n\t\t\t}\n\t\t\telse if(name.equals(\"C_Invoice_From_ID\"))\n\t\t\t\tp_Invoice_From = parameter.getParameterAsInt();\t\n\t\t\telse if(name.equals(\"C_Invoice_To_ID\"))\n\t\t\t\tp_Invoice_To = parameter.getParameterAsInt();\t\n\t\t\telse if(name.equals(\"DateDoc\"))\n\t\t\t\tp_DateDoc = (Timestamp) parameter.getParameter();\t\t\n\t\t}\n\t}", "public void prepare() {\n\t}", "@Override\n\tprotected void prepare() {\n\t\tOrder_ID = getRecord_ID();\n\t\tEventType = getParameterAsString(\"EventType\");\n\t\t\n\t}", "@Override\r\n\tprotected void prepare()\r\n\t{\r\n\r\n\t}", "public void prepare()\n\t{\n\t\tsuper.prepare();\n\t}", "@Override\n\tprotected void prepare() {\n\t\t\n\t}", "@Override\n\tpublic void prepare() {\n\t}", "@Override\n\tpublic void prepare() {\n\t\t\n\t}", "abstract void prepare();", "public abstract void prepare();", "public void prepare() {\n this.taskHandler.run(this::inlinePrepare);\n }", "protected void setupParameters() {\n \n \n\n }", "@Override\r\n\tpublic void prepare() throws Exception {\n\t\t\r\n\t}", "@Override\r\n\t\tpublic void prepare() throws Exception\r\n\t\t\t{\n\r\n\t\t\t}", "public void prepare() throws Exception {\n\r\n\t}", "private void prepare()\n {\n Victoria victoria = new Victoria();\n addObject(victoria,190,146);\n Salir salir = new Salir();\n addObject(salir,200,533);\n Volver volver = new Volver();\n addObject(volver,198,401);\n }", "private void initParameters() {\n Annotation[][] paramsAnnotations = method.getParameterAnnotations();\n for (int i = 0; i < paramsAnnotations.length; i++) {\n if (paramsAnnotations[i].length == 0) {\n contentBuilder.addUnnamedParam(i);\n } else {\n for (Annotation annotation : paramsAnnotations[i]) {\n Class<?> annotationType = annotation.annotationType();\n if (annotationType.equals(PathParam.class)\n && pathBuilder != null) {\n PathParam param = (PathParam) annotation;\n pathBuilder.addParam(param.value(), i);\n } else if (annotationType.equals(QueryParam.class)) {\n QueryParam param = (QueryParam) annotation;\n queryBuilder.addParam(param.value(), i);\n } else if (annotationType.equals(HeaderParam.class)) {\n HeaderParam param = (HeaderParam) annotation;\n headerBuilder.addParam(param.value(), i);\n } else if (annotationType.equals(NamedParam.class)) {\n NamedParam param = (NamedParam) annotation;\n contentBuilder.addNamedParam(param.value(), i);\n } else {\n contentBuilder.addUnnamedParam(i);\n }\n }\n }\n }\n }", "public void prepare() {\n long millis, nanos;\n TestCaseImpl tc = _testCase;\n \n nanos = Util.currentTimeNanos();\n prepare(tc);\n nanos = Util.currentTimeNanos() - nanos;\n tc.setDoubleParam(Constants.ACTUAL_PREPARE_TIME, \n Util.nanosToMillis(nanos));\n }", "@Override\n protected void prepare()\n throws CommandException, CommandValidationException {\n Set<ValidOption> opts = new LinkedHashSet<ValidOption>();\n addOption(opts, \"file\", 'f', \"FILE\", false, null);\n printPromptOption =\n addOption(opts, \"printprompt\", '\\0', \"BOOLEAN\", false, null);\n addOption(opts, \"encoding\", '\\0', \"STRING\", false, null);\n addOption(opts, \"help\", '?', \"BOOLEAN\", false, \"false\");\n commandOpts = Collections.unmodifiableSet(opts);\n operandType = \"STRING\";\n operandMin = 0;\n operandMax = 0;\n\n processProgramOptions();\n }", "public abstract void prepareInternal() throws IOException;", "public void prepareImagenes(){\n\t\tpreparePersonajes();\n\t\tprepareSorpresas();\n\t\tprepareObjetivos();\n\t\tprepareBloque();\n\t\t\n\t}", "public void prepare() {\n this.shifts = new ArrayList<>();\n this.rates = new ArrayList<>();\n // bootstrap shifts and rates\n this.prepareShifts();\n this.prepareRates();\n }", "public void prepare()\n\t{\n\t\tsuper.prepare();\n\n\t\tojTreeNode_prepare();\n\t\tmenu_prepare();\n\t}", "private void initParameters() {\n jobParameters.setSessionSource(getSession(\"source\"));\n jobParameters.setSessionTarget(getSession(\"target\"));\n jobParameters.setAccessDetailsSource(getAccessDetails(\"source\"));\n jobParameters.setAccessDetailsTarget(getAccessDetails(\"target\"));\n jobParameters.setPageSize(Integer.parseInt(MigrationProperties.get(MigrationProperties.PROP_SOURCE_PAGE_SIZE)));\n jobParameters.setQuery(MigrationProperties.get(MigrationProperties.PROP_SOURCE_QUERY));\n jobParameters.setItemList(getFolderStructureItemList());\n jobParameters.setPropertyFilter(getPropertyFilter());\n jobParameters.setReplaceStringInDestinationPath(getReplaceStringArray());\n jobParameters.setNamespacePrefixMap(getNamespacePrefixList());\n jobParameters.setBatchId(getBatchId());\n jobParameters.getStopWatchTotal().start();\n jobParameters.setSuccessAction(MigrationProperties.get(MigrationProperties.PROP_SOURCE_SUCCESS_ACTION));\n jobParameters.setErrorAction(MigrationProperties.get(MigrationProperties.PROP_SOURCE_ERROR_ACTION));\n jobParameters.setSuccessFolder(MigrationProperties.get(MigrationProperties.PROP_SOURCE_SUCCESS_FOLDER) + \"/\" + jobParameters.getBatchId());\n jobParameters.setErrorFolder(MigrationProperties.get(MigrationProperties.PROP_SOURCE_ERROR_FOLDER) + \"/\" + jobParameters.getBatchId());\n jobParameters.setCurrentFolder(getRootFolder());\n jobParameters.setSkipDocuments(Boolean.valueOf(MigrationProperties.get(MigrationProperties.PROP_MIGRATION_COPY_FOLDERS_ONLY)));\n \n }", "@BeforeAll\n public void prepare() {\n }", "public void getParameters(Parameters parameters) {\n\n }", "public void prepare() {\n if (getRequest().getMethod().equalsIgnoreCase(\"post\")) {\n // prevent failures on new\n String workdayReportId = getRequest().getParameter(\"workdayReport.id\");\n if (workdayReportId != null && !workdayReportId.equals(\"\")) {\n workdayReport = workdayReportManager.get(new Long(workdayReportId));\n }\n }\n }", "private void prepare( ) {\n super.prepare( schema.getCount( ) );\n serializer = new FieldSerializer[ fieldCount ];\n for ( int i = 0; i < fieldCount; i++ ) {\n FieldSchema field = schema.getField( i );\n serializer[i] = serializerByType[ field.getType().ordinal() ];\n }\n }", "public void prepare()\n {\n // First, we assign the payload a new UUID if it does not already have one\n if(getId() == null)\n setId(UUID.randomUUID());\n \n // Set the submission date to now\n setSubmissionDate(new Date());\n }", "public void getParameters(Parameters parameters) {\n\n\t}", "void PrepareRun() {\n }", "final void getParameters()\r\n {\r\n hostName=getParameter(\"hostname\");\r\n\tIPAddress=getParameter(\"IPAddress\");\r\n\tString num=getParameter(\"maxSearch\");\r\n\tString arg=getParameter(\"debug\");\r\n\tserver=getParameter(\"server\");\r\n\tindexName=getParameter(\"indexName\");\r\n\tString colour=getParameter(\"bgColour\");\r\n\r\n\tif(colour==null)\r\n\t{\r\n\t bgColour=Color.lightGray;\r\n }\r\n else\r\n\t{\r\n\t try\r\n\t {\r\n\t bgColour=new Color(Integer.parseInt(colour,16));\r\n\t }\r\n\t catch(NumberFormatException nfe)\r\n\t {\r\n\t bgColour=Color.lightGray;\r\n\t }\r\n\t}\r\n\t\r\n\tcolour=getParameter(\"fgColour\");\r\n\tif(colour==null)\r\n\t{\r\n\t fgColour=Color.black;\r\n\t}\r\n\telse\r\n\t{\r\n\t try\r\n\t {\r\n\t fgColour=new Color(Integer.parseInt(colour,16));\r\n\t }\r\n\t catch(NumberFormatException nfe)\r\n\t {\r\n\t fgColour=Color.black;\r\n\t }\r\n\t}\r\n\r\n\t//Check for missing parameters.\r\n\tif(hostName==null && server==null)\r\n\t{\r\n\t statusArea.setText(\"Error-no host/server\");\r\n\t hostName=\"none\";\r\n\t}\r\n\r\n\tmaxSearch=(num == null) ? MAX_NUMBER_PAGES : Integer.parseInt(num);\r\n }", "void prepare(List<String> fields) throws TransportException;", "private QueryRequest prepareAndValidateInputs() throws AutomicException {\n // Validate Work item type\n String workItemType = getOptionValue(\"workitemtype\");\n AgileCentralValidator.checkNotEmpty(workItemType, \"Work Item type\");\n\n // Validate export file path check for just file name.\n String temp = getOptionValue(\"exportfilepath\");\n AgileCentralValidator.checkNotEmpty(temp, \"Export file path\");\n File file = new File(temp);\n AgileCentralValidator.checkFileWritable(file);\n try {\n filePath = file.getCanonicalPath();\n } catch (IOException e) {\n throw new AutomicException(\" Error in getting unique absolute path \" + e.getMessage());\n }\n\n QueryRequest queryRequest = new QueryRequest(workItemType);\n String workSpaceName = getOptionValue(\"workspace\");\n if (CommonUtil.checkNotEmpty(workSpaceName)) {\n String workSpaceRef = RallyUtil.getWorspaceRef(rallyRestTarget, workSpaceName);\n queryRequest.setWorkspace(workSpaceRef);\n }\n\n String filters = getOptionValue(\"filters\");\n if (CommonUtil.checkNotEmpty(filters)) {\n queryRequest.addParam(\"query\", filters);\n }\n\n String fieldInput = getOptionValue(\"fields\");\n if (CommonUtil.checkNotEmpty(fieldInput)) {\n prepareUserFields(fieldInput);\n Fetch fetchList = new Fetch();\n fetchList.addAll(uniqueFields);\n queryRequest.setFetch(fetchList);\n }\n\n // Validate count\n String rowLimit = getOptionValue(\"limit\");\n limit = CommonUtil.parseStringValue(rowLimit, -1);\n if (limit < 0) {\n throw new AutomicException(String.format(ExceptionConstants.INVALID_INPUT_PARAMETER, \"Maximum Items\",\n rowLimit));\n }\n if (limit == 0) {\n limit = Integer.MAX_VALUE;\n }\n return queryRequest;\n }", "Map<String, String> getParameters();", "@Override\n public void prepare() {\n if (prepared) return;\n ApplicationId applicationId = session.getApplicationId();\n try (ActionTimer timer = applicationRepository.timerFor(applicationId, \"deployment.prepareMillis\")) {\n TimeoutBudget timeoutBudget = new TimeoutBudget(clock, timeout);\n\n PrepareParams.Builder params = new PrepareParams.Builder().applicationId(applicationId)\n .timeoutBudget(timeoutBudget)\n .ignoreValidationErrors(!validate)\n .vespaVersion(version.toString())\n .isBootstrap(isBootstrap);\n dockerImageRepository.ifPresent(params::dockerImageRepository);\n athenzDomain.ifPresent(params::athenzDomain);\n Optional<ApplicationSet> activeApplicationSet = applicationRepository.getCurrentActiveApplicationSet(tenant, applicationId);\n tenant.getSessionRepository().prepareLocalSession(session, logger, params.build(), activeApplicationSet,\n tenant.getPath(), clock.instant());\n this.prepared = true;\n }\n }", "@Override\n\tprotected String getParameters()\n\t{\n\t\tString fields = \" ?, ?, ?, ?, ? \";\n\t\treturn fields;\n\t}", "Map<String, Object> getParameters();", "Map<String, Object> getParameters();", "@Override\n\tprotected String getParameters()\n\t{\n\t\tString fields = \" ?, ?, ?, ?, ?, ? \";\n\t\treturn fields;\n\t}", "@Override\r\n\tpublic void preparer() {\n\t\tSystem.out.println(\"Carre preparer\");\r\n\t}", "protected void preRun() {\r\n\t\tthis.preparePairs();\r\n\t}", "String extractParameters ();", "void setParameters() {\n\t\t\n\t}", "public void prepare() {\n if ((!hasMultipleStatements()) && (getSQLStatement() == null)) {\n throw QueryException.sqlStatementNotSetProperly(getQuery());\n }\n\n // Cannot call super yet as the call is not built.\n }", "private static TransformationContext prepareContext (final JDBCConnectionCredentials clean, final JDBCConnectionCredentials dirty) {\n\t\treturn new SerializableTransformationContext() {\n\t\t\tprivate static final long serialVersionUID = 1L;\n\n\t\t\t@Override\n\t\t\tpublic JDBCConnectionCredentials getDirtyDatabaseCredentials() {\n\t\t\t\treturn dirty;\n\t\t\t}\n\t\t\t@Override\n\t\t\tpublic JDBCConnectionCredentials getCleanDatabaseCredentials() {\n\t\t\t\treturn clean;\n\t\t\t}\n\t\t\t@Override\n\t\t\tpublic String getTransformerConfiguration() {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t@Override\n\t\t\tpublic File getTransformerDirectory() {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t@Override\n\t\t\tpublic EnumTransformationType getTransformationType() {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t};\n\t}", "public void readParameters()\n {\n readParameters(getData());\n }", "private void getParameters(HttpServletRequest request) {\n\t\t// Recoger datos\n\t\tconcepto = request.getParameter(\"concepto\");\n\t\tString importeTexto = request.getParameter(\"importe\");\n\t\ttry {\n\t\t\timporte = Double.parseDouble(importeTexto);\n\n\t\t} catch (NumberFormatException e) {\n\t\t\timporte = (double) 0;\n\t\t}\n\t\tLong idCoche = Long.parseLong(request.getParameter(\"id_coche\"));\n\t\tc = daoCoche.getBYId(idCoche);\n\t\tidAgente = Long.parseLong(request.getParameter(\"id_agente\"));\n\t}", "String [] getParameters();", "void onPrepareForSubmit() {\n\t\t// Create the same list as was rendered.\n\t\t// Loop will write its input field values into the list's objects.\n\n\t\tcreatePersonsList();\n\n\t\t// Prepare to take a copy of each field.\n\n\t\trowNum = -1;\n\t\tfirstNameFieldCopyByRowNum = new HashMap<Integer, FieldCopy>();\n\t\tlastNameFieldCopyByRowNum = new HashMap<Integer, FieldCopy>();\n\t\tregionFieldCopyByRowNum = new HashMap<Integer, FieldCopy>();\n\t\tstartDateFieldCopyByRowNum = new HashMap<Integer, FieldCopy>();\n\t}", "private void prepare()\n {\n AmbulanceToLeft ambulanceToLeft = new AmbulanceToLeft();\n addObject(ambulanceToLeft,717,579);\n Car2ToLeft car2ToLeft = new Car2ToLeft();\n addObject(car2ToLeft,291,579);\n Car3 car3 = new Car3();\n addObject(car3,45,502);\n CarToLeft carToLeft = new CarToLeft();\n addObject(carToLeft,710,262);\n Car car = new Car();\n addObject(car,37,190);\n AmbulanceToLeft ambulanceToLeft2 = new AmbulanceToLeft();\n addObject(ambulanceToLeft2,161,264);\n }", "public Parameters getParameters();", "private CdsHooksPreparedRequest prepareRequest(IGenericClient fhirClient, Service service, CdsHooksContext context) {\n return new CdsHooksPreparedRequest(fhirClient, service, context);\n }", "@Test\r\n \tpublic void testParameters() {\n \t\tParameters params = (Parameters) filter.getParameters();\r\n \t\t\t\t\t\t\r\n \t\tassertEquals(params.unescapeSource, true);\r\n \t\tassertEquals(params.trimLeading, true);\r\n \t\tassertEquals(params.trimTrailing, true);\r\n \t\tassertEquals(params.preserveWS, true);\r\n \t\tassertEquals(params.useCodeFinder, false);\r\n \t\tassertEquals(\t\t\t\t\r\n \t\t\t\t\"#v1\\ncount.i=2\\nrule0=%(([-0+#]?)[-0+#]?)((\\\\d\\\\$)?)(([\\\\d\\\\*]*)(\\\\.[\\\\d\\\\*]*)?)[dioxXucsfeEgGpn]\\n\" +\r\n \t\t\t\t\"rule1=(\\\\\\\\r\\\\\\\\n)|\\\\\\\\a|\\\\\\\\b|\\\\\\\\f|\\\\\\\\n|\\\\\\\\r|\\\\\\\\t|\\\\\\\\v\\nsample=\\nuseAllRulesWhenTesting.b=false\", \r\n \t\t\t\tparams.codeFinderRules);\r\n \t\t\t\t\t\t\t\t\t\r\n \t\t// Check if defaults are set\r\n \t\tparams = new Parameters();\r\n \t\tfilter.setParameters(params);\r\n \t\t\r\n \t\tparams.columnNamesLineNum = 1;\r\n \t\tparams.valuesStartLineNum = 1;\r\n \t\tparams.detectColumnsMode = 1;\r\n \t\tparams.numColumns = 1;\r\n \t\tparams.sendHeaderMode = 1;\r\n \t\tparams.trimMode = 1;\r\n \t\tparams.fieldDelimiter = \"1\";\r\n \t\tparams.textQualifier = \"1\";\r\n \t\tparams.sourceIdColumns = \"1\";\r\n \t\tparams.sourceColumns = \"1\";\r\n \t\tparams.targetColumns = \"1\";\r\n \t\tparams.commentColumns = \"1\";\r\n \t\tparams.preserveWS = true;\r\n \t\tparams.useCodeFinder = true;\r\n \t\t\r\n \t\tparams = getParameters();\r\n \t\t\r\n \t\tassertEquals(params.fieldDelimiter, \"1\");\r\n \t\tassertEquals(params.columnNamesLineNum, 1);\r\n \t\tassertEquals(params.numColumns, 1);\r\n \t\tassertEquals(params.sendHeaderMode, 1);\r\n \t\tassertEquals(params.textQualifier, \"1\");\r\n \t\tassertEquals(params.trimMode, 1);\r\n \t\tassertEquals(params.valuesStartLineNum, 1);\r\n \t\tassertEquals(params.preserveWS, true);\r\n \t\tassertEquals(params.useCodeFinder, true);\r\n \t\t\r\n \t\t// Load filter parameters from a file, check if params have changed\r\n //\t\tURL paramsUrl = TableFilterTest.class.getResource(\"/test_params1.txt\");\r\n //\t\tassertNotNull(paramsUrl); \r\n \t\t\r\n \r\n \t\ttry {\r\n \t\tString st = \"file:\" + getFullFileName(\"test_params1.txt\");\r\n \t\tparams.load(new URI(st), false);\r\n \t} catch (URISyntaxException e) {\r\n \t}\r\n \r\n \t\t\r\n \t\tassertEquals(\"2\", params.fieldDelimiter);\r\n \t\tassertEquals(params.columnNamesLineNum, 2);\r\n \t\tassertEquals(params.numColumns, 2);\r\n \t\tassertEquals(params.sendHeaderMode, 2);\r\n \t\tassertEquals(\"2\", params.textQualifier);\r\n \t\tassertEquals(params.trimMode, 2);\r\n \t\tassertEquals(params.valuesStartLineNum, 2);\r\n \t\tassertEquals(params.preserveWS, false);\r\n \t\tassertEquals(params.useCodeFinder, false);\r\n \t\t\r\n \t\t// Save filter parameters to a file, load and check if params have changed\r\n \t\tURL paramsUrl = TableFilterTest.class.getResource(\"/test_params2.txt\");\r\n \t\tassertNotNull(paramsUrl);\r\n \t\t\r\n \t\tparams.save(paramsUrl.getPath());\r\n \t\t\r\n \t\t// Change params before loading them\r\n \t\tparams = (Parameters) filter.getParameters();\r\n \t\tparams.fieldDelimiter = \"3\";\r\n \t\tparams.columnNamesLineNum = 3;\r\n \t\tparams.numColumns = 3;\r\n \t\tparams.sendHeaderMode = 3;\r\n \t\tparams.textQualifier = \"3\";\r\n \t\tparams.trimMode = 3;\r\n \t\tparams.valuesStartLineNum = 3;\r\n \t\tparams.preserveWS = true;\r\n \t\tparams.useCodeFinder = true;\r\n \t\t\r\n \t\tparams.load(Util.toURI(paramsUrl.getPath()), false);\r\n \t\t\r\n \t\tassertEquals(params.fieldDelimiter, \"2\");\r\n \t\tassertEquals(params.columnNamesLineNum, 2);\r\n \t\tassertEquals(params.numColumns, 2);\r\n \t\tassertEquals(params.sendHeaderMode, 2);\r\n \t\tassertEquals(params.textQualifier, \"2\");\r\n \t\tassertEquals(params.trimMode, 2);\r\n \t\tassertEquals(params.valuesStartLineNum, 2);\r\n \t\tassertEquals(params.preserveWS, false);\r\n \t\tassertEquals(params.useCodeFinder, false);\r\n \t\t\r\n \t\t// Check if parameters type is controlled\r\n \t\t\r\n \t\tfilter.setParameters(new net.sf.okapi.filters.plaintext.base.Parameters());\r\n \t\tInputStream input = TableFilterTest.class.getResourceAsStream(\"/csv_test1.txt\");\r\n \t\ttry {\r\n \t\t\tfilter.open(new RawDocument(input, \"UTF-8\", locEN));\r\n \t\t\tfail(\"OkapiBadFilterParametersException should've been trown\");\r\n \t\t}\r\n \t\tcatch (OkapiBadFilterParametersException e) {\r\n \t\t}\r\n \t\t\r\n \t\tfilter.close();\r\n \t\r\n \t\tfilter.setParameters(new net.sf.okapi.filters.table.csv.Parameters());\r\n \t\tinput = TableFilterTest.class.getResourceAsStream(\"/csv_test1.txt\");\r\n \t\ttry {\r\n \t\t\tfilter.open(new RawDocument(input, \"UTF-8\", locEN));\r\n \t\t}\r\n \t\tcatch (OkapiBadFilterParametersException e) {\r\n \t\t\tfail(\"OkapiBadFilterParametersException should NOT have been trown\");\r\n \t\t}\r\n \t\t\tfilter.close();\r\n \t}", "private void getParameters() {\r\n\t\ttry {\r\n\t\t\tp_encoding = \"ISO-8859-1\";\r\n\t\t\tp_page_encoding = \"utf-8\";\r\n\t\t\tp_labels_data_file = \"resources/units/labels.txt\";\r\n\t\t\tp_multiplier_data_file = \"resources/units/muldata.txt\";\r\n\t\t\tp_category_data_file = \"resources/units/catdata.txt\";\r\n\t\t\tp_unit_data_file = \"resources/units/unitdata.txt\";\r\n\t\t}\r\n\t\tcatch(Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treadDataFile(0, p_multiplier_data_file); //read data from external text file\r\n\t\treadDataFile(1, p_category_data_file); //read data from external text file\r\n\t\treadDataFile(2, p_unit_data_file); //read data from external text file\r\n\t\treadDataFile(3, p_labels_data_file); //read data from external text file\r\n\t}", "private void prepare(AdminCommandContext c, String arg, OutputType type) {\n outputType = type;\n context = c;\n prepareReporter();\n // DAS runs the show on this command. If we are running in an\n // instance -- that means we should call runLocally() AND it also\n // means that the pattern is already perfect!\n\n if (isDas())\n prepareDas(arg);\n else\n prepareInstance(arg);\n }", "@Override\n\tprotected Map getParameters() throws Exception {\n\t\tInteger caseFileId =(Integer) getView().getValue(\"caseFileId\");\n\t\tString sql = \"SELECT cf FROM CaseFile cf WHERE caseFileId = :caseFileId\";\n\t\tQuery query = XPersistence.getManager().createQuery(sql);\n\t\tquery.setParameter(\"caseFileId\", caseFileId);\n\t\tCaseFile caseFile = (CaseFile) query.getSingleResult();\n\t \n\t\tCourtCaseFile cCF = caseFile.getCourtCaseFile();\n\t\tString cName = \"\";\n\t\tString cdate = \"\";\n\t\tString cfile = \"\";\n\t\tString dfile = \"\";\n\t\tString csubject = \"\";\n\t\tString ctot = \"\";\n\n\t\tif (cCF!=null) {\n\t\t\tTypeOfTrial tot=\tcCF.getTypeOfTrial();\n\t\t\tif (tot!=null)\n\t\t\t\tctot = tot.getName();\n\t\t\tCourt court = cCF.getCourt();\n\t\t\tif (court!=null)\n\t\t\t\tcName = court.getName(); \n\t\t\tString courtDate = cCF.getCourtdate();\n\t\t\tif (courtDate!=null) {\n\t\t\t\tcdate = courtDate;\n\t\t\t}\n\n\t\t\tcfile = cCF.getCourtFile();\n\t\t\tdfile = cCF.getDescriptionFile();\n\t\t\tSubject subject = cCF.getSubject();\n\t\t\tif (subject!=null)\n\t\t\t\tcsubject = subject.getName(); \n\t\t}\n\t\t\n\n\t\t\t\n\t\tMap parameters = new HashMap();\t\n\t\tparameters.put(\"descriptionFile\",dfile);\n\t\tparameters.put(\"file\",cfile);\n\t\tparameters.put(\"typeoftrail\", ctot);\n\t\tparameters.put(\"courtday\" ,cdate);\n\t\tparameters.put(\"subject\", csubject);\n\t\tparameters.put(\"court\",cName);\n\t\t\n\t\tAgendaRequest agendaRequest = caseFile.getAgendaRequest();\n\t\t//AgendaRequest agendaRequest = XPersistence.getManager().findByFolderName(AgendaRequest.class, id); \n\t\tGroupLawCenter glc = agendaRequest.getGroupLawCenter();\n\n\t\tConsultantPerson person = agendaRequest.getPerson();\n\t\tString personName = \"\";\n\t\tpersonName = personName.concat(person.getName());\n\t\tpersonName = personName.concat(\" \");\n\t\tpersonName = personName.concat(person.getLastName());\n\n\t\t\t\n\t\tparameters.put(\"agendaRequestId\",agendaRequest.getFolderNumber());\n\t\tparameters.put(\"personName\", personName);\n\t\tString glcName = (String)glc.getName();\n\t\tif (glcName == null)\n\t\t\tglcName = \"\";\n\t\tparameters.put(\"group\", glcName);\n\t\t\n\t\tString glcPlace = (String)glc.getPlace();\n\t\tif (glcPlace == null)\n\t\t\tglcPlace = \"\";\n\t\tparameters.put(\"place\", glcPlace);\n\n\t\t\n\t\tSimpleDateFormat dateFormat = new SimpleDateFormat(\"dd-MM-yyyy\");\n\t\tString date = dateFormat.format(agendaRequest.getDate());\n\t\n\t\tparameters.put(\"day\", date);\n\t\t\n\t\tString hourst = glc.getStartTime();\n\t\thourst = hourst.concat(\" a \");\n\t\thourst = hourst.concat(glc.getEndTime());\n\t\t\n\t\t\n\t\tparameters.put(\"hourst\", hourst);\n\t\tSex sex = person.getSex(); \n\t\tString s;\n\t\tif (sex == null)\n\t\t \ts = \"\";\n\t\telse {\n\t\t\ts = person.getSex().toString() ;\n\t\t\tif (s== \"MALE\")\n\t\t\ts = \"Masculino\" ;\n\t\t\telse\n\t\t\t\ts=\"Femenino\";\n\t\t}\n\t\t\n\t\tparameters.put(\"sex\", s);\n\t\tparameters.put(\"age\", person.getAge());\n\t\t\n\t\tAddress address = person.getAddress();\n\t\tString a = \"\"; \n\t\tString sa = \"\";\n\t\t\n\n\t\tif (address != null) {\n\t\t\tsa = address.getStreet();\n\t\t\tDepartment dep = address.getDepartment();\n\t\t\tNeighborhood nbh =address.getNeighborhood();\n\t\t\tif (nbh != null)\n\t\t\t\ta= a.concat(address.getNeighborhood().getName()).concat(\", \");\n\t\t\t\n\t\t\tif (dep != null)\n\t\t\t\ta= a.concat(address.getDepartment().getName());\n\t\t}\t\n\t\tparameters.put(\"address\", sa);\n\t\tparameters.put(\"addressB\", a);\n\t\tparameters.put(\"salary\", person.getSalary());\n\t\t\n\t\tparameters.put(\"address\", sa);\n\t\tparameters.put(\"addressB\", a);\n\t\tparameters.put(\"salary\", person.getSalary());\n\t\t\n\t\tDocumentType dt = person.getDocumentType();\n\t\tString d = \"\";\n\t\tif (dt != null)\n\t\t\t d= person.getDocumentType().getName();\n\t\td = d.concat(\" \");\n\t\td = d.concat(person.getDocumentId());\n\t\tparameters.put(\"document\", d);\n\t\tparameters.put(\"phone\", person.getPhone());\n\t\tparameters.put(\"mobile\", person.getMobile());\n\t\tparameters.put(\"motive\", agendaRequest.getVisitReason().getReason());\n\t\tparameters.put(\"email\", person.getEmail());\n\t\tparameters.put(\"problem\", (agendaRequest.getProblem()!=null)?agendaRequest.getProblem():\"\");\n\n\t\treturn parameters;\n\t}", "@Override\n\tpublic void prepareKeys() {\n\t\tfor (RecordKey key : paramHelper.getPushingKeys())\n\t\t\taddReadKey(key);\n\t}", "private static final List<ParameterImpl> createParameters() {\n\t\tParameterImpl initialize = new ParameterImpl.Builder()\n\t\t\t\t.setLabel(\"Initialize\") // FIXME: STRING: srogers\n\t\t\t\t.setName(\"INITIALIZE\") // FIXME: STRING: srogers\n\t\t\t\t.setType(\"checkbox\")\n\t\t\t\t.setDefaultValue(\"true\")\n\t\t\t\t.setAcceptableValues(null)\n\t\t\t\t.setRequired(false)\n\t\t\t\t.build();\n\n\t\tParameterImpl run = new ParameterImpl.Builder()\n\t\t\t\t.setLabel(\"Run\") // FIXME: STRING: srogers\n\t\t\t\t.setName(\"RUN\") // FIXME: STRING: srogers\n\t\t\t\t.setType(\"checkbox\")\n\t\t\t\t.setDefaultValue(\"true\")\n\t\t\t\t.setAcceptableValues(null)\n\t\t\t\t.setRequired(false)\n\t\t\t\t.build();\n\n\t\tParameterImpl duration = new ParameterImpl.Builder()\n\t\t\t\t.setLabel(\"Duration (minutes)\") // FIXME: STRING: srogers\n\t\t\t\t.setName(\"DURATION\") // FIXME: STRING: srogers\n\t\t\t\t.setType(\"number\")\n\t\t\t\t.setDefaultValue(\"0\")\n\t\t\t\t.setAcceptableValues(null)\n\t\t\t\t.setRequired(false)\n\t\t\t\t.build();\n\n\t\tParameterImpl retrieveData = new ParameterImpl.Builder()\n\t\t\t\t.setLabel(\"Retrieve Data\") // FIXME: STRING: srogers\n\t\t\t\t.setName(\"RETRIEVE_DATA\") // FIXME: STRING: srogers\n\t\t\t\t.setType(\"checkbox\")\n\t\t\t\t.setDefaultValue(\"true\")\n\t\t\t\t.setAcceptableValues(null)\n\t\t\t\t.setRequired(false)\n\t\t\t\t.build();\n\n\t\tParameterImpl cleanup = new ParameterImpl.Builder()\n\t\t\t\t.setLabel(\"Cleanup\") // FIXME: STRING: srogers\n\t\t\t\t.setName(\"CLEANUP\") // FIXME: STRING: srogers\n\t\t\t\t.setType(\"checkbox\")\n\t\t\t\t.setDefaultValue(\"true\")\n\t\t\t\t.setAcceptableValues(null)\n\t\t\t\t.setRequired(false)\n\t\t\t\t.build();\n\n\t\tParameterImpl cancel = new ParameterImpl.Builder()\n\t\t\t\t.setLabel(\"Cancel\") // FIXME: STRING: srogers\n\t\t\t\t.setName(\"CANCEL\") // FIXME: STRING: srogers\n\t\t\t\t.setType(\"checkbox\")\n\t\t\t\t.setDefaultValue(\"false\")\n\t\t\t\t.setAcceptableValues(null)\n\t\t\t\t.setRequired(false)\n\t\t\t\t.build();\n\n\t\treturn Arrays.asList(initialize, run, duration, retrieveData, cleanup, cancel);\n\t}", "@Override\n\tprotected void _prepare() throws Exception {\n\t\tthrow new Exception (\"SMS::_prepare() not implemented\");\n\t}", "private Map<String, Object> buildResourcesParameters() {\n Map<String, Object> parameters = new HashMap<String, Object>();\n \n parameters.put(\"portalSiteSelectedNodes\", getSelectedResources(StagingService.SITES_PORTAL_PATH));\n parameters.put(\"groupSiteSelectedNodes\", getSelectedResources(StagingService.SITES_GROUP_PATH));\n parameters.put(\"userSiteSelectedNodes\", getSelectedResources(StagingService.SITES_USER_PATH));\n parameters.put(\"siteContentSelectedNodes\", getSelectedResources(StagingService.CONTENT_SITES_PATH));\n parameters.put(\"applicationCLVTemplatesSelectedNodes\", getSelectedResources(StagingService.ECM_TEMPLATES_APPLICATION_CLV_PATH));\n parameters.put(\"applicationSearchTemplatesSelectedNodes\", getSelectedResources(StagingService.ECM_TEMPLATES_APPLICATION_SEARCH_PATH));\n parameters.put(\"documentTypeTemplatesSelectedNodes\", getSelectedResources(StagingService.ECM_TEMPLATES_DOCUMENT_TYPE_PATH));\n parameters.put(\"metadataTemplatesSelectedNodes\", getSelectedResources(StagingService.ECM_TEMPLATES_METADATA_PATH));\n parameters.put(\"taxonomySelectedNodes\", getSelectedResources(StagingService.ECM_TAXONOMY_PATH));\n parameters.put(\"querySelectedNodes\", getSelectedResources(StagingService.ECM_QUERY_PATH));\n parameters.put(\"driveSelectedNodes\", getSelectedResources(StagingService.ECM_DRIVE_PATH));\n parameters.put(\"scriptSelectedNodes\", getSelectedResources(StagingService.ECM_SCRIPT_PATH));\n parameters.put(\"actionNodeTypeSelectedNodes\", getSelectedResources(StagingService.ECM_ACTION_PATH));\n parameters.put(\"nodeTypeSelectedNodes\", getSelectedResources(StagingService.ECM_NODETYPE_PATH));\n parameters.put(\"registrySelectedNodes\", getSelectedResources(StagingService.REGISTRY_PATH));\n parameters.put(\"viewTemplateSelectedNodes\", getSelectedResources(StagingService.ECM_VIEW_TEMPLATES_PATH));\n parameters.put(\"viewConfigurationSelectedNodes\", getSelectedResources(StagingService.ECM_VIEW_CONFIGURATION_PATH));\n parameters.put(\"userSelectedNodes\", getSelectedResources(StagingService.USERS_PATH));\n parameters.put(\"groupSelectedNodes\", getSelectedResources(StagingService.GROUPS_PATH));\n parameters.put(\"roleSelectedNodes\", getSelectedResources(StagingService.ROLE_PATH));\n \n parameters.put(\"selectedResources\", selectedResources);\n parameters.put(\"selectedOptions\", selectedOptions);\n \n return parameters;\n }", "public void prepare(TestCase testCase) {\n }", "@Implementation\n protected String getParameters(String keys) {\n return null;\n }", "public void extractParameters() {\n\t\tString[] parameters = body.split(\"&\");\n\n\n\n\t\t//If there is a value given for every parameter, we extract them\n\t\tString[] huh = parameters[0].split(\"=\");\n\t\tif(huh.length>1) {\n\t\t\tusername = huh[1];\n\t\t}else{allParametersGiven=false;}\t\n\n\t\tString[] hoh = parameters[1].split(\"=\");\n\t\tif(hoh.length>1) {\n\t\t\tpassword = hoh[1];\n\t\t}else{allParametersGiven=false;}\n\n\t}", "@Override\n public void prepare() throws QueryException {\n md = new MemData(data);\n\n final Iterator<Item> d = docs.iterator();\n final Iterator<byte[]> n = names.iterator();\n final Iterator<byte[]> p = paths.iterator();\n\n while(d.hasNext()) {\n md.insert(md.meta.size, -1, docData(d.next(), n.next(), p.next()));\n }\n }", "public void test_prepare() throws Throwable {\r\n\t\tSET_LONG_NAME(\"system.cli.simple\");\r\n\t DECLARE(TEST_PING);\r\n\t DECLARE(TEST_PROCESSLIST);\r\n\t DECLARE(TEST_PROCESSLIST_LOG);\r\n\t}", "protected void processContextParameters()\n {\n JBossWebMetaData local = metaDataLocal.get();\n JBossWebMetaData shared = metaDataShared.get();\n\n Map<String, String> overrideParams = new HashMap<String, String>();\n\n List<ParamValueMetaData> params = local.getContextParams();\n if (params != null)\n {\n for (ParamValueMetaData param : params)\n {\n overrideParams.put(param.getParamName(), param.getParamValue());\n }\n }\n params = shared.getContextParams();\n if (params != null)\n {\n for (ParamValueMetaData param : params)\n {\n if (overrideParams.get(param.getParamName()) == null)\n {\n overrideParams.put(param.getParamName(), param.getParamValue());\n }\n }\n }\n\n for (String key : overrideParams.keySet())\n {\n context.addParameter(key, overrideParams.get(key));\n }\n\n }", "public PreparedStatement prepare(String str, Connection connection) throws SQLException {\n if (this.generatedResultReader == null) {\n return connection.prepareStatement(str, 2);\n }\n if (this.configuration.getPlatform().supportsGeneratedColumnsInPrepareStatement()) {\n return connection.prepareStatement(str, this.generatedResultReader.generatedColumns());\n }\n return connection.prepareStatement(str, 1);\n }", "private void prepare()\n {\n // Add three lines to this doc with your class constructor and your row and seat number\n // Make sure to match your first and last name to the class file you created.\n\n /* Example */\n KilgoreTrout kilgoretrout = new KilgoreTrout(\"Kilgore\", \"Trout\", 1, 1);\n addObject(kilgoretrout, 1, 1);\n kilgoretrout.sitDown();\n \n riajain = new RiaJain(\"Ria\", \"Jain\", 2, 1);\n addObject(riajain, riajain.myRow, riajain.mySeat);\n riajain.sitDown();\n }", "@Override\n protected Map<String, String> getParams() {\n Map<String, String> params = new HashMap<String, String>();\n params.put(\"title\", name);\n params.put(\"ean\", ean);\n params.put(\"supplier\", supplier);\n params.put(\"offer\", offer);\n params.put(\"price\", price);\n\n return params;\n }", "private void prepare(Source s) {\r\n source = s;\r\n input = source.rawText();\r\n ok = true;\r\n start = in = out = marked = lookahead = 0;\r\n failures = new TreeSet<>();\r\n output = new StringBuffer();\r\n outCount = 0;\r\n }", "void prepare(ConnectionInfo info,byte[] reqXml) throws TransportException;", "Parameters genParamatersFromFilters(TableFields tableFields, String filters);", "public void preparePlayer() {\n uriParse();\n dataSourceFactory = buildDataSourceFactory(bandwidthMeter);\n\n switch (tipoVideo) {\n case 0:\n videoSource = new DashMediaSource(uri, dataSourceFactory, new DefaultDashChunkSource.Factory(dataSourceFactory), null, null);\n break;\n case 1:\n videoSource = new HlsMediaSource(uri, dataSourceFactory, null, null);\n break;\n case 2:\n videoSource = new ExtractorMediaSource(uri, dataSourceFactory, new DefaultExtractorsFactory(), null, null);\n break;\n }\n\n player.prepare(videoSource);\n\n }", "private LocalParameters() {\n\n\t}", "protected void preparePainting() {\n if (paintRegion == null) {\n prepareRegionProperties();\n prepareOption();\n }\n\n calculateCameraMatrix();\n }", "private void prepare() {\n Menu menu = new Menu();\n addObject(menu, 523, 518);\n }", "void onPrepare() throws Exception {\n\t\t_person = getPersonService().findPerson(_personId);\n\n\t\tif (_person == null) {\n\t\t\tif (_personId < 4) {\n\t\t\t\tthrow new IllegalStateException(\"Database data has not been set up!\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new Exception(\"Person \" + _personId + \" does not exist.\");\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void initParameters() {\n\t\ttransferDbData = new TransferDbData();\n\t}", "public void prepare() {\r\n\t\tsuper.prepare();\r\n\t\tSystem.out.println(\" - Gather the grains\");\r\n\t\tSystem.out.println(\" - Shape into circles\");\r\n\t\tSystem.out.println(\" - Randomly color circles\");\r\n\t\tSystem.out.println(\" - Let circles dry\");\r\n\t}", "@Before\n\tpublic void prepare() {\n\t\tbomb = new Special(SpecialType.NUKE);\n\t\tcom = new Commander(0, 0, 0, 1);\n\t\tbaseHP = com.getHealth();\n\t}", "@Override\n protected void doPrepare()\n {\n iwriter.prepareToCommit();\n super.doPrepare();\n }", "private String buildParams(){\n HashMap<String,String> items = new HashMap<>();\n if(paramValid(param1name,param1value))\n items.put(param1name,param1value);\n if(paramValid(param2name,param2value))\n items.put(param2name,param2value);\n if(paramValid(param3name,param3value))\n items.put(param3name,param3value);\n return JsonOutput.toJson(items);\n }", "@Override\n\tpublic void prepare() throws Exception {\n\t\tsetMethodName(\"prepare\");\n\t\t//invoco il prepare della super classe:\n\t\tsuper.prepare();\n\t\t\n\t\t//setto il titolo:\n\t\tmodel.setTitolo(\"Aggiorna Subaccertamento\");\n\t}", "public void prepareForDeferredProcessing() {\n\n }", "@Override\n public void prepare(Map conf) {\n this.idToAssignment = new ConcurrentHashMap<>();\n this.idToName = new ConcurrentHashMap<>();\n this.nameToId = new ConcurrentHashMap<>();\n }", "public void fillFromHttpRequest(HttpServletRequest req) {\n\t\tthis.id = prepareString(req.getParameter(\"id\"));\n\t\tthis.firstName = prepareString(req.getParameter(\"firstName\"));\n\t\tthis.lastName = prepareString(req.getParameter(\"lastName\"));\n\t\tthis.nick = prepareString(req.getParameter(\"nick\"));\n\t\tthis.email = prepareString(req.getParameter(\"email\"));\n\t\tthis.password = prepareString(req.getParameter(\"password\"));\n\t}", "public void prepare() {\n System.out.println(\"Preparing: \" + name);\n System.out.println(\"Tossing dough: \" + dough);\n System.out.println(\"Adding sauce: \" + sauce);\n System.out.print(\"Adding Toppings: \");\n toppings.forEach(topping -> System.out.print(topping + \" \"));\n System.out.println();\n }", "@Override\n\tpublic void prepare(TopologyContext context) {\n\t\t\n\t}", "ParameterList getParameters();", "ParamMap createParamMap();", "protected static Map<String, Object> prepareQueryForSelection(JsonObject parameters) {\n Map<String, Object> queryFilters = new HashMap<String, Object>();\n\n // Date fields\n processDateFilter(Entity.CREATION_DATE, parameters, queryFilters);\n processDateFilter(Entity.MODIFICATION_DATE, parameters, queryFilters);\n\n // String fields\n processStringFilter(Consumer.EMAIL, parameters, queryFilters);\n processStringFilter(Consumer.JABBER_ID, parameters, queryFilters);\n processStringFilter(Consumer.NAME, parameters, queryFilters);\n processStringFilter(Consumer.TWITTER_ID, parameters, queryFilters);\n\n // Long fields\n processLongFilter(Consumer.FACEBOOK_ID, parameters, queryFilters);\n\n return queryFilters;\n }", "private void getParameters(final CallbackContext callbackContext) {\n final Activity context = cordova.getActivity();\n this.cordova.getThreadPool().execute(new Runnable() {\n public void run() {\n try {\n\n // TODO: Devolver los SharedPreferences en formato JSON con la estructura de\n // pluginParameters.\n //Object pluginParameters = null; // TODO: Componer objeto desde SharedPreferences.\n //String pluginParametersJson = new Gson().toJson(pluginParameters);\n\n // MOCK:\n String pluginParametersJson = \"{'activityId': 7885478, 'holderId': 778}\";\n\n // Guarda la referencia del contexto de la app web.\n CordovaPluginJavaConnection.getParametersContext = callbackContext;\n\n sendResultSuccess(callbackContext, pluginParametersJson);\n } catch (Exception ex) {\n errorProcess(callbackContext, ex);\n }\n }\n });\n }", "private void prepareScanner() {\r\n\t\tbcLocator = new BCLocator();\r\n\t\tbcGenerator = new BCGenerator();\r\n\t}" ]
[ "0.8212883", "0.79932237", "0.79843354", "0.78787917", "0.7872706", "0.77614075", "0.76453656", "0.6934898", "0.6918707", "0.6801244", "0.67245173", "0.65887225", "0.6576022", "0.6564238", "0.64334375", "0.6431841", "0.6343391", "0.62294173", "0.62157685", "0.61071426", "0.6099404", "0.6060771", "0.60237384", "0.5971766", "0.58621925", "0.5764391", "0.57440984", "0.56929314", "0.56892467", "0.56834406", "0.5675606", "0.56749237", "0.5650185", "0.561388", "0.56066906", "0.5596914", "0.55950725", "0.5564079", "0.5563719", "0.5524651", "0.5523331", "0.548805", "0.54802406", "0.54794675", "0.54794675", "0.5472765", "0.5459271", "0.5446519", "0.5440737", "0.5439284", "0.543693", "0.5428685", "0.54206383", "0.5412442", "0.54120576", "0.540328", "0.5387918", "0.5378189", "0.53723717", "0.53571254", "0.5350181", "0.53476614", "0.53374594", "0.533263", "0.5327761", "0.53230906", "0.53230447", "0.5314261", "0.5305817", "0.5302805", "0.52963966", "0.5284599", "0.5283209", "0.52809197", "0.5280837", "0.5279949", "0.5270735", "0.52686447", "0.52645814", "0.5260998", "0.52599853", "0.5244846", "0.5241126", "0.52362144", "0.523621", "0.52321184", "0.5227606", "0.52275264", "0.52142125", "0.52126366", "0.5211519", "0.5209426", "0.5207705", "0.5202561", "0.5188433", "0.5187645", "0.5186314", "0.5185357", "0.5181781", "0.51779705" ]
0.7861194
5
Reverse Look up Organization From JP_Org_Value
private void reverseLookupAD_Org_ID() throws Exception { StringBuilder sql = new StringBuilder(); String msg = new String(); int no = 0; //Reverese Look up AD_Org ID From JP_Org_Value msg = Msg.getMsg(getCtx(), "Matching") + " : " + Msg.getElement(getCtx(), "AD_Org_ID") + " - " + Msg.getMsg(getCtx(), "MatchFrom") + " : " + Msg.getElement(getCtx(), "JP_Org_Value") ; sql = new StringBuilder ("UPDATE I_LocationJP i ") .append("SET AD_Org_ID=(SELECT AD_Org_ID FROM AD_org p") .append(" WHERE i.JP_Org_Value=p.Value AND (p.AD_Client_ID=i.AD_Client_ID or p.AD_Client_ID=0) ) ") .append(" WHERE i.JP_Org_Value IS NOT NULL") .append(" AND i.I_IsImported='N'").append(getWhereClause()); try { no = DB.executeUpdateEx(sql.toString(), get_TrxName()); if (log.isLoggable(Level.FINE)) log.fine(msg +"=" + no + ":" + sql); }catch(Exception e) { throw new Exception(Msg.getMsg(getCtx(), "Error") + sql ); } //Invalid JP_Org_Value msg = Msg.getMsg(getCtx(), "Invalid")+Msg.getElement(getCtx(), "JP_Org_Value"); sql = new StringBuilder ("UPDATE I_LocationJP ") .append("SET I_ErrorMsg='"+ msg + "'") .append(" WHERE AD_Org_ID = 0 AND JP_Org_Value IS NOT NULL AND JP_Org_Value <> '0' ") .append(" AND I_IsImported<>'Y'").append(getWhereClause()); try { no = DB.executeUpdateEx(sql.toString(), get_TrxName()); if (log.isLoggable(Level.FINE)) log.fine(msg +"=" + no + ":" + sql); }catch(Exception e) { throw new Exception(Msg.getMsg(getCtx(), "Error") + msg +" : " + sql ); } if(no > 0) { commitEx(); throw new Exception(Msg.getMsg(getCtx(), "Error") + msg ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getOrganization();", "public String getJP_OrgTrx_Value();", "public int getAD_Org_ID();", "public int getAD_Org_ID();", "public int getAD_Org_ID();", "public int getAD_Org_ID();", "public int getAD_Org_ID();", "public int getAD_Org_ID();", "public int getAD_Org_ID();", "public int getAD_Org_ID();", "public int getAD_Org_ID();", "public int getAD_Org_ID();", "public int getAD_Org_ID();", "public int getAD_Org_ID();", "public int getAD_Org_ID();", "String organizationName();", "public String getOrganization ()\n {\n return this.organization;\n }", "public String getJdOrg() {\r\n\t\treturn jdOrg;\r\n\t}", "public Value.Builder setKdOrg(java.lang.CharSequence value) {\n validate(fields()[12], value);\n this.kd_org = value;\n fieldSetFlags()[12] = true;\n return this;\n }", "@AutoEscape\n\tpublic String getOrganization();", "public String organization() {\n return this.organization;\n }", "private JComboBox getOrgCmb() {\r\n cmbOrganization = new JComboBox();\r\n \r\n vOrganizations = getProposalSubOrgs();\r\n\r\n CoeusVector cvOrgs = new CoeusVector();\r\n \tcvOrgs.add(0, \"\");\r\n\r\n HashMap mapRow = new HashMap();\r\n \tfor (int c=0;c<vOrganizations.size();c++) {\r\n mapRow = (HashMap) vOrganizations.elementAt(c);\r\n \tcvOrgs.add(c+1,(String)mapRow.get(\"LOCATION_NAME\"));\r\n \t}\r\n \t\r\n \tcmbOrganization.setModel(new DefaultComboBoxModel(cvOrgs));\r\n return cmbOrganization;\r\n }", "public String getOrganization() {\n return organization;\n }", "public int getHC_Org2_ID();", "public void setKdOrg(java.lang.CharSequence value) {\n this.kd_org = value;\n }", "public Resolution linkToOrganization() {\r\n Organization o = this.myIsern.getSingleOrganization(this.linkItem);\r\n if (o == null) {\r\n this.name = this.linkItem;\r\n this.added = false;\r\n return new RedirectResolution(ADD_ORG_PAGE).flash(this);\r\n }\r\n else {\r\n this.name = this.linkItem;\r\n this.type = o.getType();\r\n this.contact = o.getContact();\r\n \r\n this.affiliatedResearchers = \r\n this.converter.listToString(o.getAffiliatedResearchers().getAffiliatedResearcher());\r\n \r\n this.country = o.getCountry();\r\n \r\n this.researchKeywords = \r\n this.converter.listToString(o.getResearchKeywords().getResearchKeyword());\r\n \r\n this.researchDescription = o.getResearchDescription();\r\n this.homePage = o.getHomePage();\r\n \r\n this.edited = false;\r\n this.editing = true;\r\n return new RedirectResolution(EDIT_ORG_PAGE).flash(this);\r\n }\r\n }", "@AutoEscape\n\tpublic String getOrgId();", "public String getOrgNo() {\r\n return orgNo;\r\n }", "public java.lang.CharSequence getKdOrg() {\n return kd_org;\n }", "public StrColumn getOrganisation() {\n return delegate.getColumn(\"organisation\", DelegatingStrColumn::new);\n }", "public java.lang.CharSequence getKdOrg() {\n return kd_org;\n }", "public String getOrgCode() {\n return orgCode;\n }", "public String getOrgCode() {\n return orgCode;\n }", "public void setOrganization(String organization);", "public java.lang.String getOrganizationId()\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(ORGANIZATIONID$4, 0);\r\n if (target == null)\r\n {\r\n return null;\r\n }\r\n return target.getStringValue();\r\n }\r\n }", "public String getOrgname() {\n return orgname;\n }", "public String getOrganization() {\n\t\treturn organization;\n\t}", "public OrgDo getOrg(Integer id);", "public Organization getOrganization(){\r\n\t\treturn organization;\r\n\t}", "String organizationId();", "public com.hps.july.persistence.Organization getOrganization() throws java.rmi.RemoteException, javax.ejb.FinderException;", "public String getOrganizationId(String orgName) {\r\n \tString orgId = \"\";\r\n HashMap map;\r\n \tfor(int g=0; g<this.organizations.size(); g++) {\r\n \tmap = (HashMap) this.organizations.get(g);\r\n \tif (orgName.equals(map.get(\"LOCATION_NAME\"))) {\r\n \t\torgId = (String) map.get(\"ORGANIZATION_ID\");\r\n \t}\r\n }\r\n return orgId;\r\n }", "public int getAD_OrgTrx_ID();", "public int getAD_OrgTrx_ID();", "public String getOrganizationName() {\n return (orgName);\n }", "@Override\n public String toString() {\n return \"RelatedOrg {\"\n + \"}\";\n }", "public Value.Builder clearKdOrg() {\n kd_org = null;\n fieldSetFlags()[12] = false;\n return this;\n }", "public String getOrganizationCode() {\n return organizationCode;\n }", "public String getOrgName() {\r\n return orgName;\r\n }", "public String getJP_SalesRep_Value();", "public void setJP_OrgTrx_Value (String JP_OrgTrx_Value);", "public String getOrganizationName() {\n\n \n return organizationName;\n\n }", "public String getp_org_id() {\n return (String)getNamedWhereClauseParam(\"p_org_id\");\n }", "public String getOrgan() {\n\t\treturn this.organ;\n\t}", "public Number getOrgId() {\n return (Number)getAttributeInternal(ORGID);\n }", "public String getOrgName() {\n return orgName;\n }", "@Override\n\tpublic OrganizationVO getOrganization(String name) throws RemoteException {\n\t\treturn new OrganizationVO(\"1\",Organizationtype.hall);\n\t}", "Party getOrganizationParty();", "public Integer getOrgCode() {\n\t\treturn orgCode;\n\t}", "public String getOrgNm()\n\t{\n\t\treturn mOrgNm;\n\t}", "public String getOrganizationAddress() {\n\n \n return organizationAddress;\n\n }", "Map<String, Result> getOrganizationsMap();", "public String getOrgCd() {\r\n return orgCd;\r\n }", "@Override\n\tpublic TbOrg getOwnOrg() {\n\t\treturn tbOrgMapper.getOwnOrg();\n\t}", "ImmutableList<SchemaOrgType> getSourceOrganizationList();", "public void setJdOrg(String jdOrg) {\r\n\t\tthis.jdOrg = jdOrg;\r\n\t}", "public java.lang.String getOrgName() {\n return OrgName;\n }", "public void setp_org_id(String value) {\n setNamedWhereClauseParam(\"p_org_id\", value);\n }", "public\t Organization getOrganizationHeader()\n { return (Organization) this.getHeader(OrganizationHeader.NAME); }", "@Override\n\tpublic java.lang.String getEsfOrganization() {\n\t\treturn _esfShooterAffiliationChrono.getEsfOrganization();\n\t}", "public Organization getOrganization() {\n return organization;\n }", "public Organization getOrganization() {\n return organization;\n }", "public final void setOrganisation(String value) {\n organisation = value;\n }", "public HashMap getSubOrg() {\n\t\treturn subOrg;\n\t}", "public Number getOrgId() {\n return (Number) getAttributeInternal(ORGID);\n }", "public long getOrganizationId();", "WebElement getOrganizationField();", "public interface OrgIdStrategy {\n int getOrgId(String resourceId );\n}", "private int getBank_Org_ID ()\n\t{\n\t\tif (m_C_BankAccount_ID == 0)\n\t\t\treturn 0;\n\t\t//\n\t\tMBankAccount ba = MBankAccount.get(getCtx(), m_C_BankAccount_ID);\n\t\treturn ba.getAD_Org_ID();\n\t}", "public void setAD_Org_ID (int AD_Org_ID);", "public void setAD_Org_ID (int AD_Org_ID);", "public void setAD_Org_ID (int AD_Org_ID);", "public void setAD_Org_ID (int AD_Org_ID);", "public void setAD_Org_ID (int AD_Org_ID);", "public void setAD_Org_ID (int AD_Org_ID);", "public void setAD_Org_ID (int AD_Org_ID);", "public void setAD_Org_ID (int AD_Org_ID);", "public void setAD_Org_ID (int AD_Org_ID);", "public void setAD_Org_ID (int AD_Org_ID);", "public void setAD_Org_ID (int AD_Org_ID);", "public void setAD_Org_ID (int AD_Org_ID);", "public void setAD_Org_ID (int AD_Org_ID);", "public final String getOrganisation() {\n return organisation;\n }", "public String buyOrgOrRet();", "public String getType() {\n\t\t\treturn \"organization\";\n\t\t}", "public long getOrgId() {\r\n return orgId;\r\n }", "public String getOrganizationText() {\n return organizationText;\n }", "public void setOrgId(String orgId);", "public java.lang.String getOrgName() {\n return orgName;\n }", "public int getOrg(int newId)\n\t{\n\t\treturn getEntry(newId).org;\n\t}" ]
[ "0.65790915", "0.6250744", "0.6074176", "0.6074176", "0.6074176", "0.6074176", "0.6074176", "0.6074176", "0.6074176", "0.6074176", "0.6074176", "0.6074176", "0.6074176", "0.6074176", "0.6074176", "0.59237623", "0.59057885", "0.5884361", "0.5821794", "0.5804259", "0.5771926", "0.5748481", "0.57378113", "0.5729277", "0.5683149", "0.56610024", "0.56480354", "0.56239116", "0.5613509", "0.56095546", "0.55919254", "0.55812013", "0.55812013", "0.5527785", "0.5526128", "0.55209655", "0.5514098", "0.5510769", "0.5494008", "0.54762995", "0.54675347", "0.546514", "0.54587126", "0.54587126", "0.5452441", "0.54309875", "0.5428653", "0.54265934", "0.5416626", "0.54125965", "0.5389252", "0.53689665", "0.53630286", "0.5349546", "0.53448987", "0.53404945", "0.5338021", "0.53337604", "0.53151375", "0.5310296", "0.52989644", "0.5293582", "0.5284607", "0.52638185", "0.526", "0.52586526", "0.52478176", "0.5236999", "0.52287745", "0.52259964", "0.5216776", "0.5216776", "0.520927", "0.52090514", "0.52068543", "0.51830935", "0.51748353", "0.51637447", "0.51598704", "0.51554084", "0.51554084", "0.51554084", "0.51554084", "0.51554084", "0.51554084", "0.51554084", "0.51554084", "0.51554084", "0.51554084", "0.51554084", "0.51554084", "0.51554084", "0.5138471", "0.513723", "0.51330197", "0.5114919", "0.51042825", "0.50906634", "0.5088597", "0.5087779" ]
0.6938386
0
reverseLookupAD_Org_ID Reverse Loog up C_Location_ID From JP_Location_Label
private void reverseLookupC_Location_ID() throws Exception { StringBuilder sql = new StringBuilder(); String msg = new String(); int no = 0; //Reverse Loog up C_Location_ID From JP_Location_Label msg = Msg.getMsg(getCtx(), "Matching") + " : " + Msg.getElement(getCtx(), "C_Location_ID") + " - " + Msg.getMsg(getCtx(), "MatchFrom") + " : " + Msg.getElement(getCtx(), "JP_Location_Label") ; sql = new StringBuilder ("UPDATE I_LocationJP i ") .append("SET C_Location_ID=(SELECT C_Location_ID FROM C_Location p") .append(" WHERE i.JP_Location_Label= p.JP_Location_Label AND p.AD_Client_ID=i.AD_Client_ID) ") .append(" WHERE i.C_Location_ID IS NULL AND JP_Location_Label IS NOT NULL") .append(" AND i.I_IsImported='N'").append(getWhereClause()); try { no = DB.executeUpdateEx(sql.toString(), get_TrxName()); if (log.isLoggable(Level.FINE)) log.fine(msg +"=" + no + ":" + sql); }catch(Exception e) { throw new Exception(Msg.getMsg(getCtx(), "Error") + sql ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void reverseLookupAD_Org_ID() throws Exception\r\n\t{\r\n\t\tStringBuilder sql = new StringBuilder();\r\n\t\tString msg = new String();\r\n\t\tint no = 0;\r\n\r\n\t\t//Reverese Look up AD_Org ID From JP_Org_Value\r\n\t\tmsg = Msg.getMsg(getCtx(), \"Matching\") + \" : \" + Msg.getElement(getCtx(), \"AD_Org_ID\")\r\n\t\t+ \" - \" + Msg.getMsg(getCtx(), \"MatchFrom\") + \" : \" + Msg.getElement(getCtx(), \"JP_Org_Value\") ;\r\n\t\tsql = new StringBuilder (\"UPDATE I_LocationJP i \")\r\n\t\t\t\t.append(\"SET AD_Org_ID=(SELECT AD_Org_ID FROM AD_org p\")\r\n\t\t\t\t.append(\" WHERE i.JP_Org_Value=p.Value AND (p.AD_Client_ID=i.AD_Client_ID or p.AD_Client_ID=0) ) \")\r\n\t\t\t\t.append(\" WHERE i.JP_Org_Value IS NOT NULL\")\r\n\t\t\t\t.append(\" AND i.I_IsImported='N'\").append(getWhereClause());\r\n\t\ttry {\r\n\t\t\tno = DB.executeUpdateEx(sql.toString(), get_TrxName());\r\n\t\t\tif (log.isLoggable(Level.FINE)) log.fine(msg +\"=\" + no + \":\" + sql);\r\n\t\t}catch(Exception e) {\r\n\t\t\tthrow new Exception(Msg.getMsg(getCtx(), \"Error\") + sql );\r\n\t\t}\r\n\r\n\t\t//Invalid JP_Org_Value\r\n\t\tmsg = Msg.getMsg(getCtx(), \"Invalid\")+Msg.getElement(getCtx(), \"JP_Org_Value\");\r\n\t\tsql = new StringBuilder (\"UPDATE I_LocationJP \")\r\n\t\t\t.append(\"SET I_ErrorMsg='\"+ msg + \"'\")\r\n\t\t\t.append(\" WHERE AD_Org_ID = 0 AND JP_Org_Value IS NOT NULL AND JP_Org_Value <> '0' \")\r\n\t\t\t.append(\" AND I_IsImported<>'Y'\").append(getWhereClause());\r\n\t\ttry {\r\n\t\t\tno = DB.executeUpdateEx(sql.toString(), get_TrxName());\r\n\t\t\tif (log.isLoggable(Level.FINE)) log.fine(msg +\"=\" + no + \":\" + sql);\r\n\t\t}catch(Exception e) {\r\n\t\t\tthrow new Exception(Msg.getMsg(getCtx(), \"Error\") + msg +\" : \" + sql );\r\n\t\t}\r\n\r\n\t\tif(no > 0)\r\n\t\t{\r\n\t\t\tcommitEx();\r\n\t\t\tthrow new Exception(Msg.getMsg(getCtx(), \"Error\") + msg );\r\n\t\t}\r\n\r\n\t}", "public Lookup findLookup(String code, String lookupGroup, long lookupParentId);", "String getLookupKey();", "int getLocationID();", "@Test\n public void iPAddressReverseDomainLookupTest() throws Exception {\n String value = null;\n IPReverseDNSLookupResponse response = api.iPAddressReverseDomainLookup(value);\n\n // TODO: test validations\n }", "private String resolveLabel(String aLabel){\n\t\t// Pre-condition\n\t\tif(aLabel == null) return aLabel;\n\t\t// Main code\n\t\tif (aLabel == \"univ\") return null;\n\t\tString actualName = aLabel.contains(\"this/\")?aLabel.substring(\"this/\".length()):aLabel;\n\t\treturn actualName;\n\t}", "String getLocationLabel();", "public int getC_BPartnerRelation_Location_ID() {\n\t\tInteger ii = (Integer) get_Value(\"C_BPartnerRelation_Location_ID\");\n\t\tif (ii == null)\n\t\t\treturn 0;\n\t\treturn ii.intValue();\n\t}", "final public static int linearSearchGeo(DefaultMutableTreeNode parent, String geoLabel) { \t\t\t\t\t\t\t\t\t\t\t\t\n \t\tint childCount = parent.getChildCount();\t\n \t\tfor (int i = 0; i < childCount; i++) {\t\t\t\n \t\t\tDefaultMutableTreeNode node = (DefaultMutableTreeNode) parent.getChildAt(i);\n \t\t\tGeoElement g = (GeoElement) node.getUserObject();\n \t\t\tif (geoLabel.equals(g.getLabel()))\n \t\t\t\treturn i;\n \t\t}\n \t\treturn -1;\n \t}", "Location getLocationById(long id);", "public int getAD_Org_ID();", "public int getAD_Org_ID();", "public int getAD_Org_ID();", "public int getAD_Org_ID();", "public int getAD_Org_ID();", "public int getAD_Org_ID();", "public int getAD_Org_ID();", "public int getAD_Org_ID();", "public int getAD_Org_ID();", "public int getAD_Org_ID();", "public int getAD_Org_ID();", "public int getAD_Org_ID();", "public int getAD_Org_ID();", "private void onFinishReverseGeoCoding(String result) {\n }", "private void onFinishReverseGeoCoding(String result) {\n }", "private void createLookup() {\r\n\t\tcreateLooupMap(lookupMap, objectdef, objectdef.getName());\r\n\t\tcreateChildIndex(childIndex, objectdef, objectdef.getName());\r\n\r\n\t}", "public int getHC_Org2_ID();", "public static int reverseLookup(String phone, Phonebook[] phonebook,int size) \n\t{\n\t\tint position=-1;\n\t\tPhoneNumber temp= new PhoneNumber(phone);\n\t\n\t\tfor(int i=0; i<size;i++) \n\t\t{\n\t\t\tif(phonebook[i].getPhone().equals(temp)) \n\t\t\t{\n\t\t\t position=i;\t\n\t\t\t}\n\t\t}\n\t\treturn position;\n\t}", "public static String getBiblioLng() {\n\t\treturn \"lng\";\n\t}", "java.lang.String getLocation();", "Place resolveLocation( Place place );", "public static void AuId2Id3hop(){\n\t\t\r\n\t\tlong AID=2052648321L;\r\n\t\tlong AID2=2041650587L;\r\n\t\tlong ID=1511277043L;\r\n\t\tlong AFID=97018004L;\r\n\t\tSearchWrapper.search( AID, ID);\r\n\t}", "private void reverseGeocode(final LatLng latLng, final AsyncCallback callback) {\n GWT.log(\"reverseGeocode\");\n geocoder.getLocations(latLng, new LocationCallback() {\n public void onFailure(int statusCode) {\n getMessagePanel().displayError(\"Failed to geocode position \" + latLng.toString()\n + \". Status: \" + statusCode + \" \"\n + StatusCodes.getName(statusCode));\n if (callback != null) {\n callback.onFailure(null);\n }\n //but we can still set the location\n }\n\n public void onSuccess(JsArray<Placemark> locations) {\n GWT.log(\"reverseGeocode onSuccess \" + locations.length());\n // for (int i = 0; i < locations.length(); ++i) {\n //just need to get the very first location!\n Placemark placemark = locations.get(0);\n Location location = new Location();\n location.setLatitude(placemark.getPoint().getLatitude());\n location.setLongitude(placemark.getPoint().getLongitude());\n GWT.log(\"address is \" + placemark.getStreet());\n location.setAddress1(placemark.getStreet());\n location.setCity(placemark.getCity());\n location.setState(placemark.getState());\n location.setZipcode(placemark.getPostalCode());\n location.setCountryCode(placemark.getCountry());\n location.setGeocoded(true);\n //does not fetch data, but will update the top of the app\n mywebapp.setCurrentLocation(location);\n if (callback != null) {\n callback.onSuccess(null);\n }\n //we just reverse geocoded, not that we clicked on map\n // }\n }\n });\n }", "public static String decodeLocation(int val) {\n return \"\" + ((double) val / (double) 1E6);\n }", "private void updateTargetProductGeocoding() {\n }", "private Identifier resolve(Identifier id, String field) throws NotFound, UnrecoverableException, RetryableException {\n \n logger.debug(task.taskLabel() + \" entering resolve...\");\n try {\n ObjectLocationList oll = ((CNRead)nodeCommunications.getCnRead()).resolve(session, id);\n if (logger.isDebugEnabled()) \n logger.debug(task.taskLabel() + String.format(\" %s %s exists on the CN.\", field, id.getValue()));\n return oll.getIdentifier();\n\n } catch (NotFound ex) {\n // assume if identifierReservationService has thrown NotFound exception SystemMetadata does not exist\n if (logger.isDebugEnabled()) \n logger.debug(task.taskLabel() + String.format(\" %s %s does not exist on the CN.\", field, id.getValue()));\n throw ex;\n \n } catch (ServiceFailure e) {\n V2TransferObjectTask.extractRetryableException(e);\n throw new UnrecoverableException(\"Unexpected Exception from CN /resolve !\" + e.getDescription(), e);\n\n } catch ( NotImplemented | InvalidToken | NotAuthorized e) {\n throw new UnrecoverableException(\"Unexpected Exception from CN /resolve ! \" + e.getDescription(), e);\n }\n }", "public String getLookupKey() {\n return queryLookupKey(contactId);\n }", "public java.lang.Integer getLocationPk() {\n return locationPk;\n }", "public int getAD_OrgTrx_ID();", "public int getAD_OrgTrx_ID();", "private String getIxbrlLocationFromDocGeneratorResponse(DocumentGeneratorResponse response) {\n return Optional.of(response)\n .map(DocumentGeneratorResponse::getLinks)\n .map(Links::getLocation)\n .orElse(null);\n }", "public static AdempiereLocation createFromLocation(ResultSet rs) throws SQLException {\r\n\t\tint c = 1;\r\n\t\tAdempiereLocation r = new AdempiereLocation();\r\n\t\tr.adClientId = rs.getInt(c++);\r\n\t\tr.adOrgId = rs.getInt(c++);\r\n\t\tr.locationId = rs.getInt(c++);\r\n\t\tr.address1 = rs.getString(c++);\r\n\t\tr.address2 = rs.getString(c++);\r\n\t\tr.address3 = rs.getString(c++);\r\n\t\tr.address4 = rs.getString(c++);\r\n\t\tr.city = rs.getString(c++);\r\n\t\tr.postal = rs.getString(c++);\r\n\t\tr.countryCode = rs.getString(c++);\r\n\t\tr.isActive = \"Y\".equalsIgnoreCase(rs.getString(c++));\r\n\t\treturn r;\r\n\t}", "@Override\n\t\tpublic void onGetReverseGeoCodeResult(ReverseGeoCodeResult result) {\n\t\t\tif (result == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlocation = result.getAddress();//地理位置\n\t\t\tif (location.equals(\"null\")) {\n\t\t\t\tlocation = \"\";\n\t\t\t}\n\t\t\tLocationUtil.stopReverseGeoCode();\n\t\t}", "private static final Udef uLookup (Parsing t, int len) {\n\t\tString symb = new String(t.a, t.pos, len);\n\t\tUdef u = uLookup(symb);\n\t\tif (u != null) t.pos += len;\n\t\treturn(u);\n\t}", "@AutoEscape\n\tpublic String getLocationId();", "public int getC_BPartner_Location_ID() {\n\t\tInteger ii = (Integer) get_Value(\"C_BPartner_Location_ID\");\n\t\tif (ii == null)\n\t\t\treturn 0;\n\t\treturn ii.intValue();\n\t}", "public String getLocationNumber()\n\t{\n\t\tString locationNo = getContent().substring(OFF_ID27_LOCATION, OFF_ID27_LOCATION + LEN_ID27_LOCATION) ;\n\t\treturn (locationNo);\n\t}", "@Override\n\t\tpublic Integer getLocationID() {\n\t\t\treturn null;\n\t\t}", "private void extractLatLongAndRelativeLocation(Buoy buoy, String value)\n {\n String regexp = \"^(.+?)or\";\n Pattern pat = Pattern.compile(regexp);\n Matcher match = pat.matcher(value);\n\n String latLong = \"\";\n String relativePos = \"\";\n\n if (match.find())\n {\n latLong = match.group(0);\n relativePos = value.substring(value.\n lastIndexOf(latLong) + latLong.length(), value.length()).trim(); \n \n latLong = latLong.replace(\"or\", \"\").trim();\n\n\n } else\n {\n latLong = \"\";\n relativePos = value;\n }\n\n buoy.setLatlong(latLong);\n buoy.setRelativeLocation(relativePos);\n }", "public String extractNavigationLinkName(String lookupName){\r\n final int nameSize = lookupName.length();\r\n if(nameSize <= LOOKUP_NAME_MINSIZE){\r\n return lookupName;\r\n }\r\n\r\n String pref = lookupName.substring(0, LOOKUP_NAME_PREFIX.length());\r\n if(!pref.equals(LOOKUP_NAME_PREFIX)){\r\n return lookupName;\r\n }\r\n\r\n final int endName = nameSize - LOOKUP_NAME_SUFFIX.length();\r\n String suff = lookupName.substring(endName, nameSize);\r\n if(!suff.equals(LOOKUP_NAME_SUFFIX)){\r\n return lookupName;\r\n }\r\n\r\n return lookupName.substring(LOOKUP_NAME_PREFIX.length(), endName);\r\n }", "public void setLocationPk(java.lang.Integer locationPk) {\n this.locationPk = locationPk;\n }", "LocationModel findLocation(final String code);", "public static String getProperLocation(String location) {\n switch (location) {\n case \"newjersey\":\n return \"New Jersey\";\n case \"cnj\":\n return \"Central Jersey\";\n case \"southjersey\":\n return \"South Jersey\";\n case \"longisland\":\n return \"Long Island\";\n default:\n return location;\n }\n }", "public void setLocationId(String value) { _locationId = value; }", "@Override\n\t\t\tpublic void onGetReverseGeoCodeResult(ReverseGeoCodeResult arg0) {\n\t\t\t\tif(arg0==null||arg0.error!=SearchResult.ERRORNO.NO_ERROR||arg0.getLocation().latitude==0||arg0.getLocation().longitude==0)\n\t\t\t\t{\n\t\t\t\t\tdialog.dismiss();\n\t\t\t\t\tToastUtil.shortToast(getApplicationContext(), \"百度地图出现错误了,请重写输入地址\");\n\t\t\t\t}\n\t\t\t\tlatitude=arg0.getLocation().latitude;\n\t\t\t\tlongitude=arg0.getLocation().longitude;\n\t\t\t\tLog.e(\"llll\", latitude+\"\");\n\t\t\t\tLog.e(\"1111\", longitude+\"\");\n\t\t\t\tsendEmptyUiMessage(MsgConstants.MSG_01);\n\t\t\t\t\n\t\t\t}", "int getLngE6();", "int getLngE6();", "public static APIRequestTask requestReverseGeolocation(Location location){\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(location.getLatitude());\n\t\tsb.append(\", \");\n\t\tsb.append(location.getLongitude());\n\t\t\n\t\tURLParameter latlng = new URLParameter(\"latlng\",sb.toString());\n\t\tAPIRequestTask task = new APIRequestTask(geocode_url);\n\t\tURLParameter res_type = new URLParameter(\"result_type\",\"street_address\");\n\n\t\ttask.execute(latlng, res_type);\n\t\treturn task; \n\t}", "String getCountryOfOrigin(long id) throws RemoteException;", "com.google.ads.googleads.v14.common.LocationInfo getLocation();", "public String getLocationCode() {\n\t\treturn locationCode.get(this.unitID.substring(0, 2));\n\t}", "public String getLocationCode() {\n return normalizedBic.substring(LOCATION_CODE_INDEX, LOCATION_CODE_INDEX + LOCATION_CODE_LENGTH);\n }", "gov.nih.nlm.ncbi.www.CodeBreakDocument.CodeBreak.Loc getLoc();", "public void setLocationId(String locationId);", "public abstract String lookupGlobalOrdinal(long ord) throws IOException;", "public Coord addressToCoord(String localisation);", "@MapName(\"lnfid\")\n \tString getLnfId();", "public String getPhnLoclNbr()\n\t{\n\t\treturn mPhnLoclNbr;\n\t}", "private void as_ld(int reg_d, int reg_a, int offset)\n {\n print_binary((reg_d << 26) | (reg_a << 20) | ((offset & 0x1fff) << 7) | I_LD);\n }", "@Override\n\t\t\tpublic void onGetReverseGeoCodeResult(ReverseGeoCodeResult arg0) {\n\t\t\t}", "private String longitudeConversion() {\n int lon = record[5];\n if (lon >= 0) {\n lon = lon & 255;\n }\n lon = (lon << 8) + (record[4] & 255);\n float flon = Float.parseFloat(\"\" + lon + \".\" + (((record[7] & 255) << 8) + (record[6] & 255)));\n int degs = (int) flon / 100;\n float min = flon - degs * 100;\n String retVal = \"\" + (degs + min / 60);\n\n if (retVal.compareTo(\"200.0\") == 0) {\n return \"\";\n } else {\n return retVal;\n }\n }", "public static String matchLocationToPSID(Location l) {\n BlockVector3 v = BlockVector3.at(l.getX(), l.getY(), l.getZ());\n String currentPSID = \"\";\n RegionManager rgm = WGUtils.getRegionManagerWithWorld(l.getWorld());\n List<String> idList = rgm.getApplicableRegionsIDs(v);\n if (idList.size() == 1) { // if the location is only in one region\n if (ProtectionStones.isPSRegion(rgm.getRegion(idList.get(0)))) {\n currentPSID = idList.get(0);\n }\n } else {\n // Get nearest protection stone if in overlapping region\n double distanceToPS = -1, tempToPS;\n for (String currentID : idList) {\n if (ProtectionStones.isPSRegion(rgm.getRegion(currentID))) {\n PSLocation psl = WGUtils.parsePSRegionToLocation(currentID);\n Location psLocation = new Location(l.getWorld(), psl.x, psl.y, psl.z);\n tempToPS = l.distance(psLocation);\n if (distanceToPS == -1 || tempToPS < distanceToPS) {\n distanceToPS = tempToPS;\n currentPSID = currentID;\n }\n }\n }\n }\n return currentPSID;\n }", "String getLocation();", "String getLocation();", "String getLocation();", "public LocationDetail getLocationDetail(Long locationId) throws LocationException;", "int getAptitudeId();", "protected AssociationList reverseAssoc(LexBIGService lbsvc, LexBIGServiceConvenienceMethods lbscm, String scheme,\r\n CodingSchemeVersionOrTag csvt, Association assoc, AssociationList addTo,\r\n Map<String, EntityDescription> codeToEntityDescriptionMap) throws LBException {\r\n\r\n ConceptReference acRef = assoc.getAssociationReference();\r\n AssociatedConcept acFromRef = new AssociatedConcept();\r\n acFromRef.setCodingScheme(acRef.getCodingScheme());\r\n acFromRef.setConceptCode(acRef.getConceptCode());\r\n AssociationList acSources = new AssociationList();\r\n acFromRef.setIsNavigable(Boolean.TRUE);\r\n acFromRef.setSourceOf(acSources);\r\n\r\n // Use cached description if available (should be cached\r\n // for all but original root) ...\r\n if (codeToEntityDescriptionMap.containsKey(acRef.getConceptCode()))\r\n acFromRef.setEntityDescription(codeToEntityDescriptionMap.get(acRef.getConceptCode()));\r\n // Otherwise retrieve on demand ...\r\n else\r\n acFromRef.setEntityDescription(Constructors.createEntityDescription(getCodeDescription(lbsvc, scheme, csvt,\r\n acRef.getConceptCode())));\r\n\r\n AssociatedConceptList acl = assoc.getAssociatedConcepts();\r\n for (AssociatedConcept ac : acl.getAssociatedConcept()) {\r\n // Create reverse association (same non-directional name)\r\n Association rAssoc = new Association();\r\n rAssoc.setAssociationName(assoc.getAssociationName());\r\n\r\n // On reverse, old associated concept is new reference point.\r\n ConceptReference ref = new ConceptReference();\r\n ref.setCodingScheme(ac.getCodingScheme());\r\n ref.setConceptCode(ac.getConceptCode());\r\n rAssoc.setAssociationReference(ref);\r\n\r\n // And old reference is new associated concept.\r\n AssociatedConceptList rAcl = new AssociatedConceptList();\r\n rAcl.addAssociatedConcept(acFromRef);\r\n rAssoc.setAssociatedConcepts(rAcl);\r\n\r\n // Set reverse directional name, if available.\r\n String dirName = assoc.getDirectionalName();\r\n if (dirName != null)\r\n try {\r\n rAssoc.setDirectionalName(lbscm.isForwardName(scheme, csvt, dirName) ? lbscm\r\n .getAssociationReverseName(assoc.getAssociationName(), scheme, csvt) : lbscm\r\n .getAssociationReverseName(assoc.getAssociationName(), scheme, csvt));\r\n } catch (LBException e) {\r\n }\r\n\r\n // Save code desc for future reference when setting up\r\n // concept references in recursive calls ...\r\n codeToEntityDescriptionMap.put(ac.getConceptCode(), ac.getEntityDescription());\r\n\r\n AssociationList sourceOf = ac.getSourceOf();\r\n if (sourceOf != null)\r\n for (Association sourceAssoc : sourceOf.getAssociation()) {\r\n AssociationList pos = reverseAssoc(lbsvc, lbscm, scheme, csvt, sourceAssoc, addTo,\r\n codeToEntityDescriptionMap);\r\n pos.addAssociation(rAssoc);\r\n }\r\n else\r\n addTo.addAssociation(rAssoc);\r\n }\r\n return acSources;\r\n }", "private void doLookup(int key)\n {\n String value = getLocalValue(key);\n if (value != null)\n {\n display(key, value);\n }\n else\n {\n getValueFromDB(key);\n } \n }", "String mo30285c(long j);", "private String roundLongDown(String longitude){\r\n\t\tdouble temp = new BigDecimal(Double.valueOf(longitude))\r\n\t\t\t\t.setScale(3, BigDecimal.ROUND_HALF_UP)\r\n\t\t\t\t.doubleValue();\r\n\t\ttemp -= 0.4;\r\n\r\n\t\treturn Double.toString(temp);\r\n\t}", "Eid matchLocal(Eid eid);", "private static int getRelationalOffset(Node basicNode, int absoluteOffset) {\n \n \t\treturn absoluteOffset - ((IndexedRegion) basicNode).getStartOffset();\n \t}", "final public static int binarySearchGeo(DefaultMutableTreeNode parent, String geoLabel) { \t\t\t\t\n \t\tint left = 0;\n \t\tint right = parent.getChildCount()-1;\n \t\tif (right == -1) return -1;\n \t\n \t\t// binary search for geo's label\n \t\twhile (left <= right) {\t\t\t\t\t\t\t\n \t\t\tint middle = (left + right) / 2;\n \t\t\tDefaultMutableTreeNode node = (DefaultMutableTreeNode) parent.getChildAt(middle);\n \t\t\tString nodeLabel = ((GeoElement) node.getUserObject()).getLabel();\n \t\t\t\n \t\t\tint compare = GeoElement.compareLabels(geoLabel, nodeLabel);\n \t\t\tif (compare < 0)\n \t\t\t\tright = middle -1;\n \t\t else if (compare > 0)\n \t\t \tleft = middle + 1;\t\n \t\t else\n \t\t \treturn middle;\n \t\t}\t\t\t\t\t\t\t\t\t\t\t\t \n \t\t\n \t\treturn -1;\t\t\t\t\n \t}", "Integer getFntLID();", "public Location (java.lang.Long uniqueId) {\n \t\tsuper(uniqueId);\n \t}", "public void okFindObjid()\n\t{\n\t\tString comment,view_name;\n\t\tString commentArr[];\n\n\t\tString luNameArr[];\n\n\t\tASPManager mgr = getASPManager();\n\n\t\tbFromOkFindObjid = true;\n\n\t\t// So that this page can be added to My Links\n\t\tmgr.createSearchURL(headblk);\n\n\t\tview_name = mgr.readValue(\"view\");\n\t\tif (mgr.isEmpty(view_name))\n\t\t\tview_name=mgr.readValue(\"VIEW\");\n\t\tobjid = mgr.readValue(\"objid\");\n\t\tif (mgr.isEmpty(objid))\n\t\t\tobjid=mgr.readValue(\"OBJID\");\n\n\t\t// A list of incoming view names\n\t\t// where we actually want to work with\n\t\t// another view/LU.\n\t\t// For example, when inserting a reference to\n\t\t// a EquipmentFunctional object, insert EquipmentObject\n\t\t// as LU_NAME instead in DocReferenceObject\n\n\n\t\t// MDAHSE, 2001-01-16\n\t\t// Removed view conversions for the following views:\n\n\t\t// ACTIVE_ROUND\n\t\t// ACTIVE_SEPARATE\n\t\t// HISTORICAL_SEPARATE\n\t\t// HISTORICAL_ROUND\n\n\n\t\tif (\"EQUIPMENT_FUNCTIONAL\".equals(view_name))\n\t\t\tview_name=\"EQUIPMENT_OBJECT\";\n\t\telse if (\"EQUIPMENT_SERIAL\".equals(view_name))\n\t\t\tview_name=\"EQUIPMENT_OBJECT\";\n\t\telse if (\"SEPARATE_STANDARD_JOB\".equals(view_name))\n\t\t\tview_name=\"STANDARD_JOB\";\n\t\telse if (\"ROUND_STANDARD_JOB\".equals(view_name))\n\t\t\tview_name=\"STANDARD_JOB\";\n\t\telse if (\"EQUIPMENT_ALL_OBJECT\".equals(view_name))\n\t\t\tview_name=\"EQUIPMENT_OBJECT\";\n\t\t//IID FIPR308A Begin\n\t\telse if (\"POSTING_PROPOSAL_INVOICE_WEB\".equals(view_name))\n\t\t\tview_name=\"MAN_SUPP_INVOICE\";\n\t\t//IID FIPR308A End\n\t\telse\n\t\t\tview_name = view_name;\n\n\t\tboolean bSetClosed = checkWfState(view_name, objid);\n\t\t\n\t\t// Initialize the transaction\n\t\ttrans.clear();\n\n\t\t// We really should use a reference to this value in the next database call\n\t\t// so that we only make ONE submit to the database.\n\n\t\tcmd = trans.addCustomFunction(\"GETLUNAME\", \"Doc_Reference_API.Get_Lu_Name_\",\"DUMMY\");\n\t\tcmd.addParameter(\"TEMP1\", view_name);\n\n\t\ttrans = mgr.perform(trans);\n\n\t\troot_lu_name = trans.getValue(\"GETLUNAME/DATA/DUMMY\");\n\n\t\t// Initialize the second transaction\n\t\ttrans.clear();\n\n\t\tcmd = trans.addCustomCommand(\"GETKEYREF\",\"Client_SYS.Get_Key_Reference\");\n\n\t\tcmd.addParameter(\"KEY_REF\");\t\t\t\t\t\t // Our out-variable from the procedure call\n\t\tcmd.addParameter(\"LU_NAME\",root_lu_name);\t// pass root_lu_name as a parameter\n\t\tcmd.addParameter(\"OBJID\",objid);\n\n\t\t// Submit this query\n\t\ttrans = mgr.perform(trans);\n\n\t\t// Get the resulting values\n\t\troot_key_ref = trans.getValue(\"GETKEYREF/DATA/KEY_REF\");\n\n\t\t// MDAHSE, 2000-12-16\n\t\t// Removed reference to variable okFindObjidRun\n\n\t\tkeyRefLuNameTransferred();\n\t\t\n\t\tif (bSetClosed)\n setDrLock(view_name);\n\t}", "@DSSource({DSSourceKind.SENSITIVE_UNCATEGORIZED})\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:58:12.107 -0500\", hash_original_method = \"958E0B7EB30F5353747022B831D2FD74\", hash_generated_method = \"ADF84B7CD584A3086AA314B699B00CEF\")\n \npublic String getLocation() {\n return location;\n }", "private static int longestPalindromicSubsequence(String str1) {\n\t\tStringBuilder str2 = new StringBuilder(str1);\n\t\tstr2.reverse().toString();\n\t\tString strtemp = str2.toString(); \n\t\treturn LCSDP(str1,strtemp,str1.length(),str1.length());\n\t}", "MapType map(List<ReferenceOrderedDatum> rodData, char ref, LocusContext context);", "IMappingNode getMappingNode(Object groupID) throws Exception;", "com.google.ads.googleads.v6.resources.LocationView getLocationView();", "private LookupUtil(){}", "public Map<String, ForeignRoute> determineForeignRoutes(List<EULocation> locationList, String id) {\n // Sort the locations\n Collections.sort(locationList);\n\n Map<String, List<List<EULocation>>> countryTripList = new HashMap<>();\n countryTripList.put(\"DE\", new ArrayList<>());\n countryTripList.put(\"LU\", new ArrayList<>());\n countryTripList.put(\"NL\", new ArrayList<>());\n countryTripList.put(\"AT\", new ArrayList<>());\n countryTripList.put(\"BE\", new ArrayList<>());\n\n // Set initial last country code\n String currentCountryCode = getCountryCodeByLocation(locationList.get(0));\n\n List<EULocation> trip = new ArrayList<>();\n\n for (EULocation l : locationList) {\n String thisCountryCode = getCountryCodeByLocation(l);\n if (thisCountryCode.equals(currentCountryCode)) {\n // We're still in the country, add to this trip\n trip.add(l);\n } else {\n // This trip is done. Add the trip to the country's (other) trips\n List<List<EULocation>> newTrips = countryTripList.get(currentCountryCode);\n if (trip.size() > 0) {\n newTrips.add(trip);\n }\n countryTripList.put(currentCountryCode, newTrips);\n\n // Set new country\n currentCountryCode = thisCountryCode;\n\n // Clear current trip\n trip = new ArrayList<>();\n\n trip.add(l);\n }\n }\n\n ForeignRoute foreignRouteNL = new ForeignRoute(countryCode, countryTripList.get(\"NL\"), id);\n ForeignRoute foreignRouteDE = new ForeignRoute(countryCode, countryTripList.get(\"DE\"), id);\n ForeignRoute foreignRouteBE = new ForeignRoute(countryCode, countryTripList.get(\"BE\"), id);\n ForeignRoute foreignRouteAT = new ForeignRoute(countryCode, countryTripList.get(\"AT\"), id);\n ForeignRoute foreignRouteLU = new ForeignRoute(countryCode, countryTripList.get(\"LU\"), id);\n\n Map<String, ForeignRoute> result = new HashMap<>();\n\n if (foreignRouteAT.getTrips().size() != 0 && !countryCode.equals(\"AT\")) {\n result.put(\"AT\", foreignRouteAT);\n }\n if (foreignRouteBE.getTrips().size() != 0 && !countryCode.equals(\"BE\")) {\n result.put(\"BE\", foreignRouteBE);\n }\n if (foreignRouteNL.getTrips().size() != 0 && !countryCode.equals(\"NL\")) {\n result.put(\"NL\", foreignRouteNL);\n }\n if (foreignRouteLU.getTrips().size() != 0 && !countryCode.equals(\"LU\")) {\n result.put(\"LU\", foreignRouteLU);\n }\n if (foreignRouteDE.getTrips().size() != 0 && !countryCode.equals(\"DE\")) {\n result.put(\"DE\", foreignRouteDE);\n }\n\n return result;\n }", "public int getLocationID() {\n return locationID;\n }", "private String roundLongUp(String longitude){\r\n\t\tdouble temp = new BigDecimal(Double.valueOf(longitude))\r\n\t\t\t\t.setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue();\r\n\t\ttemp += 0.4;\r\n\r\n\t\treturn Double.toString(temp);\r\n\t}", "String getIdFromLocation(final String location) {\n return location.substring(location.lastIndexOf(\"/\") + 1);\n }", "public LA2 getAdministeredAtLocation() { \r\n\t\tLA2 retVal = this.getTypedField(11, 0);\r\n\t\treturn retVal;\r\n }", "public java.lang.String getLOCNO()\n {\n \n return __LOCNO;\n }", "public static void UpdateLocation(Location location){\n \n try (Connection connection = DbConnector.connectToDb();\n Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);\n ResultSet resultSet = statement.executeQuery(\"SELECT City, AirportCode from Location WHERE AirportCode = '\" + location.getAirportCode() + \"'\")){\n \n resultSet.absolute(1);\n resultSet.updateString(\"City\", location.getCity());\n resultSet.updateString(\"AirportCode\", location.getAirportCode());\n resultSet.updateRow();\n }\n catch(SQLException sqle){\n System.out.println(sqle.toString());\n } \n \n \n }" ]
[ "0.75463355", "0.54678386", "0.5299385", "0.5208418", "0.5150136", "0.50913113", "0.5019395", "0.4994658", "0.49842596", "0.49211788", "0.4747349", "0.4747349", "0.4747349", "0.4747349", "0.4747349", "0.4747349", "0.4747349", "0.4747349", "0.4747349", "0.4747349", "0.4747349", "0.4747349", "0.4747349", "0.4734454", "0.4734454", "0.46961305", "0.46950933", "0.46922296", "0.46421343", "0.46180078", "0.4612983", "0.46025366", "0.45992908", "0.45991948", "0.45971417", "0.459387", "0.45929912", "0.45909378", "0.45875257", "0.45875257", "0.4578067", "0.45676938", "0.45667362", "0.45632628", "0.45597833", "0.4558083", "0.45515397", "0.45453134", "0.4544961", "0.45404714", "0.4536462", "0.45349926", "0.45340887", "0.45334303", "0.4516743", "0.44811556", "0.44811556", "0.4471048", "0.44602975", "0.44498372", "0.44478792", "0.44398063", "0.443208", "0.44253886", "0.44171843", "0.44149444", "0.44062468", "0.44028226", "0.44009292", "0.43932226", "0.43800333", "0.4367129", "0.43638688", "0.43638688", "0.43638688", "0.4358254", "0.43252897", "0.43237817", "0.43234438", "0.43212712", "0.43107474", "0.42977726", "0.42964774", "0.42950386", "0.42932218", "0.4287156", "0.42823705", "0.4282335", "0.42736265", "0.42735994", "0.42731655", "0.4268912", "0.42673162", "0.42551735", "0.42542094", "0.4242235", "0.42419392", "0.42380637", "0.42360744", "0.4236034" ]
0.81041753
0
Load all procedures in one step
public static final void LoadProcedures(Connection conn) throws SQLException { /* * REGEXP procedure */ if (Messenger.debug_mode) Messenger.printMsg(Messenger.DEBUG, "loading procedure REGEXP"); Function.create(conn, "REGEXP", new Function() { @Override public void xFunc() throws SQLException { int nba = args(); if( nba != 2 ) { throw new SQLException("REGEXP requires 2 String parameters"); } for( int i=0 ; i<nba ; i++ ) { if( value_type(i) != SQLITE_TEXT ) {result(0); return;}} String exp = value_text(0); String str = value_text(1); result((str.matches(exp))? 1: 0); } }); /* * corner00_ra procedure */ if (Messenger.debug_mode) Messenger.printMsg(Messenger.DEBUG, "loading procedure corner00_ra"); Function.create(conn, "corner00_ra", new Function() { @Override public void xFunc() throws SQLException { int nba = args(); if( nba != 4 ) { throw new SQLException("corner00_ra requires 4 double parameters in degrees"); } for( int i=0 ; i<nba ; i++ ) { if( value_type(i) != SQLITE_FLOAT && value_type(i) != SQLITE_INT ) {result(SaadaConstant.DOUBLE); return;}} try { result(Procedures.corner00_ra(value_double(0), value_double(1), value_double(2), value_double(3))); } catch(Exception e){ Messenger.printMsg(Messenger.ERROR, "corner00_ra: " + e.getMessage()); result(0); } } }); /* * corner00_dec procedure */ if (Messenger.debug_mode) Messenger.printMsg(Messenger.DEBUG, "loading procedure corner00_dec"); Function.create(conn, "corner00_dec", new Function() { @Override public void xFunc() throws SQLException { int nba = args(); if( nba != 2 ) { throw new SQLException("corner00_dec requires 2 double parameters in degrees"); } for( int i=0 ; i<nba ; i++ ) { if( value_type(i) != SQLITE_FLOAT && value_type(i) != SQLITE_INT) {result(SaadaConstant.DOUBLE); return;}} try { result(Procedures.corner00_dec(value_double(0), value_double(1))); } catch(Exception e){ Messenger.printMsg(Messenger.ERROR, "corner00_dec: " + e.getMessage()); result(0); } } }); /* * corner01_ra procedure */ if (Messenger.debug_mode) Messenger.printMsg(Messenger.DEBUG, "loading procedure corner01_ra"); Function.create(conn, "corner01_ra", new Function() { @Override public void xFunc() throws SQLException { int nba = args(); if( nba != 4 ) { throw new SQLException("corner01_ra requires 4 double parameters in degrees"); } for( int i=0 ; i<nba ; i++ ) { if( value_type(i) != SQLITE_FLOAT && value_type(i) != SQLITE_INT ) {result(SaadaConstant.DOUBLE); return;}} try { result(Procedures.corner01_ra(value_double(0), value_double(1), value_double(2), value_double(3))); } catch(Exception e){ Messenger.printMsg(Messenger.ERROR, "corner01_ra: " + e.getMessage()); result(0); } } }); /* * corner01_dec procedure */ if (Messenger.debug_mode) Messenger.printMsg(Messenger.DEBUG, "loading procedure corner01_dec"); Function.create(conn, "corner01_dec", new Function() { @Override public void xFunc() throws SQLException { int nba = args(); if( nba != 2 ) { throw new SQLException("corner01_dec requires 2 double parameters in degrees"); } for( int i=0 ; i<nba ; i++ ) { if( value_type(i) != SQLITE_FLOAT && value_type(i) != SQLITE_INT ) {result(SaadaConstant.DOUBLE); return;}} try { result(Procedures.corner01_dec(value_double(0), value_double(1))); } catch(Exception e){ Messenger.printMsg(Messenger.ERROR, "corner01_dec: " + e.getMessage()); result(0); } } }); /* * corner10_ra procedure */ if (Messenger.debug_mode) Messenger.printMsg(Messenger.DEBUG, "loading procedure corner10_ra"); Function.create(conn, "corner10_ra", new Function() { @Override public void xFunc() throws SQLException { int nba = args(); if( nba != 4 ) { throw new SQLException("corner10_ra requires 4 double parameters in degrees"); } for( int i=0 ; i<nba ; i++ ) { if( value_type(i) != SQLITE_FLOAT && value_type(i) != SQLITE_INT ) {result(SaadaConstant.DOUBLE); return;}} try { result(Procedures.corner10_ra(value_double(0), value_double(1), value_double(2), value_double(3))); } catch(Exception e){ Messenger.printMsg(Messenger.ERROR, "corner10_ra: " + e.getMessage()); result(0); } } }); /* * corner10_dec procedure */ if (Messenger.debug_mode) Messenger.printMsg(Messenger.DEBUG, "loading procedure corner10_dec"); Function.create(conn, "corner10_dec", new Function() { @Override public void xFunc() throws SQLException { int nba = args(); if( nba != 2 ) { throw new SQLException("corner10_dec requires 2 double parameters in degrees"); } for( int i=0 ; i<nba ; i++ ) { if( value_type(i) != SQLITE_FLOAT && value_type(i) != SQLITE_INT ) {result(SaadaConstant.DOUBLE); return;}} try { result(Procedures.corner10_dec(value_double(0), value_double(1))); } catch(Exception e){ Messenger.printMsg(Messenger.ERROR, "corner10_dec: " + e.getMessage()); result(0); } } }); /* * corner11_ra procedure */ if (Messenger.debug_mode) Messenger.printMsg(Messenger.DEBUG, "loading procedure corner11_ra"); Function.create(conn, "corner11_ra", new Function() { @Override public void xFunc() throws SQLException { int nba = args(); if( nba != 4 ) { throw new SQLException("corner11_ra requires 4 double parameters in degrees"); } for( int i=0 ; i<nba ; i++ ) { if( value_type(i) != SQLITE_FLOAT && value_type(i) != SQLITE_INT ) {result(SaadaConstant.DOUBLE); return;}} try { result(Procedures.corner11_ra(value_double(0), value_double(1), value_double(2), value_double(3))); } catch(Exception e){ Messenger.printMsg(Messenger.ERROR, "corner11_ra: " + e.getMessage()); result(0); } } }); /* * corner11_dec procedure */ if (Messenger.debug_mode) Messenger.printMsg(Messenger.DEBUG, "loading procedure corner11_dec"); Function.create(conn, "corner11_dec", new Function() { @Override public void xFunc() throws SQLException { int nba = args(); if( nba != 2 ) { throw new SQLException("corner11_dec requires 2 double parameters in degrees"); } for( int i=0 ; i<nba ; i++ ) { if( value_type(i) != SQLITE_FLOAT && value_type(i) != SQLITE_INT ) {result(SaadaConstant.DOUBLE); return;}} try { result(Procedures.corner11_dec(value_double(0), value_double(1))); } catch(Exception e){ Messenger.printMsg(Messenger.ERROR, "corner11_dec: " + e.getMessage()); result(0); } } }); /* * distancedegree procedure */ if (Messenger.debug_mode) Messenger.printMsg(Messenger.DEBUG, "loading procedure distancedegree"); Function.create(conn, "distancedegree", new Function() { @Override public void xFunc() throws SQLException { int nba = args(); if( nba != 4 ) { throw new SQLException("distancedegree requires 4 double parameters in degrees"); } for( int i=0 ; i<nba ; i++ ) { if( value_type(i) != SQLITE_FLOAT && value_type(i) != SQLITE_INT ) {result(SaadaConstant.DOUBLE); return;}} try { result(Procedures.distancedegree(value_double(0), value_double(1), value_double(2), value_double(3))); } catch(Exception e){ Messenger.printMsg(Messenger.ERROR, "distancedegree: " + e.getMessage()); result(0); } } }); /* * tileleftborder procedure */ if (Messenger.debug_mode) Messenger.printMsg(Messenger.DEBUG, "loading procedure tileleftborder"); Function.create(conn, "tileleftborder", new Function() { @Override public void xFunc() throws SQLException { int nba = args(); if( nba != 4 ) { throw new SQLException("tileleftborder requires 4 double parameters in degrees"); } for( int i=0 ; i<nba ; i++ ) { if( value_type(i) != SQLITE_FLOAT && value_type(i) != SQLITE_INT ) {result(SaadaConstant.DOUBLE); return;}} try { result(Procedures.tileleftborder(value_double(0), value_double(1), value_double(2), value_double(3))); } catch(Exception e){ Messenger.printMsg(Messenger.ERROR, "tileleftborder: " + e.getMessage()); result(0); } } }); /* * tileleftborder procedure */ if (Messenger.debug_mode) Messenger.printMsg(Messenger.DEBUG, "loading procedure tilerightborder"); Function.create(conn, "tilerightborder", new Function() { @Override public void xFunc() throws SQLException { int nba = args(); if( nba != 4 ) { throw new SQLException("tilerightborder requires 4 double parameters in degrees"); } for( int i=0 ; i<nba ; i++ ) { if( value_type(i) != SQLITE_FLOAT && value_type(i) != SQLITE_INT ) {result(SaadaConstant.DOUBLE); return;}} try { result(Procedures.tilerightborder(value_double(0), value_double(1), value_double(2), value_double(3))); } catch(Exception e){ Messenger.printMsg(Messenger.ERROR, "tilerightborder: " + e.getMessage()); result(0); } } }); /* * isinbox procedure */ if (Messenger.debug_mode) Messenger.printMsg(Messenger.DEBUG, "loading procedure isinbox"); Function.create(conn, "isinbox", new Function() { @Override public void xFunc() throws SQLException { int nba = args(); if( nba != 6 ) { throw new SQLException("isinbox requires 6 double parameters in degrees"); } for( int i=0 ; i<nba ; i++ ) { if( value_type(i) != SQLITE_FLOAT && value_type(i) != SQLITE_INT ) {result(0); return;}} try { result(Procedures.isinbox(value_double(0), value_double(1), value_double(2), value_double(3), value_double(4), value_double(5))); } catch(Exception e){ Messenger.printMsg(Messenger.ERROR, "isinbox: " + e.getMessage()); result(0); } } }); /* * getmjd procedure */ if (Messenger.debug_mode) Messenger.printMsg(Messenger.DEBUG, "loading procedure getmjd"); Function.create(conn, "getmjd", new Function() { @Override public void xFunc() throws SQLException { int nba = args(); if( nba != 1 ) { throw new SQLException("getmjd requires 1 double parameters"); } for( int i=0 ; i<nba ; i++ ) { if( value_type(i) != SQLITE_FLOAT && value_type(i) != SQLITE_INT ) {result(SaadaConstant.STRING); return;}} result(Procedures.getmjd(value_double(0))); } }); /* * boxcenter procedure */ if (Messenger.debug_mode) Messenger.printMsg(Messenger.DEBUG, "loading procedure boxcenter"); Function.create(conn, "boxcenter", new Function() { @Override public void xFunc() throws SQLException { int nba = args(); if( nba != 7 ) { throw new SQLException("boxcenter requires 7 double parameters in degrees"); } for( int i=0 ; i<nba ; i++ ) { if( value_type(i) != SQLITE_FLOAT && value_type(i) != SQLITE_INT ) {result(0); return;}} try { result(Procedures.boxcenter(value_double(0), value_double(1), value_double(2), value_double(3), value_double(4), value_double(5), value_double(6))); } catch(Exception e){ Messenger.printMsg(Messenger.ERROR, "boxcenter: " + e.getMessage()); result(0); } } }); /* * boxcovers procedure */ if (Messenger.debug_mode) Messenger.printMsg(Messenger.DEBUG, "loading procedure boxcovers"); Function.create(conn, "boxcovers", new Function() { @Override public void xFunc() throws SQLException { int nba = args(); if( nba != 7 ) { throw new SQLException("boxcovers requires 7 double parameters in degrees"); } for( int i=0 ; i<nba ; i++ ) { if( value_type(i) != SQLITE_FLOAT && value_type(i) != SQLITE_INT ) {result(0); return;}} try { result(Procedures.boxcovers(value_double(0), value_double(1), value_double(2), value_double(3), value_double(4), value_double(5), value_double(6))); } catch(Exception e){ Messenger.printMsg(Messenger.ERROR, "boxcovers: " + e.getMessage()); result(0); } } }); /* * boxenclosed procedure */ if (Messenger.debug_mode) Messenger.printMsg(Messenger.DEBUG, "loading procedure boxenclosed"); Function.create(conn, "boxenclosed", new Function() { @Override public void xFunc() throws SQLException { int nba = args(); if( nba != 7 ) { throw new SQLException("boxenclosed requires 7 double parameters in degrees"); } for( int i=0 ; i<nba ; i++ ) { if( value_type(i) != SQLITE_FLOAT && value_type(i) != SQLITE_INT ) {result(0); return;}} try { result(Procedures.boxenclosed(value_double(0), value_double(1), value_double(2), value_double(3), value_double(4), value_double(5), value_double(6))); } catch(Exception e){ Messenger.printMsg(Messenger.ERROR, "boxenclosed: " + e.getMessage()); result(0); } } }); /* * boxoverlaps procedure */ if (Messenger.debug_mode) Messenger.printMsg(Messenger.DEBUG, "loading procedure boxoverlaps"); Function.create(conn, "boxoverlaps", new Function() { @Override public void xFunc() throws SQLException { int nba = args(); if( nba != 7 ) { throw new SQLException("boxoverlaps requires 7 double parameters in degrees"); } for( int i=0 ; i<nba ; i++ ) { if( value_type(i) != SQLITE_FLOAT && value_type(i) != SQLITE_INT ) {result(0); return;}} try { result(Procedures.boxoverlaps(value_double(0), value_double(1), value_double(2), value_double(3), value_double(4), value_double(5), value_double(6))); } catch(Exception e){ Messenger.printMsg(Messenger.ERROR, "boxoverlaps: " + e.getMessage()); result(0); } } }); /* * string format procedure */ if (Messenger.debug_mode) Messenger.printMsg(Messenger.DEBUG, "loading procedure sprintf"); Function.create(conn, "sprintf", new Function() { @Override public void xFunc() throws SQLException { int nba = args(); if( nba != 2 ) { throw new SQLException("sprintf requires 2 parameters (one string and one either text, int or double"); } if( value_type(0) != SQLITE_TEXT ) {result(0); return;} switch(value_type(1)){ case SQLITE_FLOAT: result(String.format(value_text(0), value_double(1))); break; case SQLITE_INT : result(String.format(value_text(0), value_int(1))); break; case SQLITE_TEXT : result(String.format(value_text(0), value_text(1))); break; default: throw new SQLException("2nd parameter must be either a text, an int ora double"); } } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void refreshAvailableProcedures()\n\t{\n\t\tm_models.obtainAvailableProcedures(true);\n\t}", "@Override\n\tprotected Map<String, List<ProcedureParamSrc>> loadProcedures(String databaseName) throws SQLException {\n\t\t Map<String, List<ProcedureParamSrc>> ret=new HashMap<>();\n\t\t Map<String, StringBuffer> textMap=new HashMap<>();\n\t\tString sql=\"SELECT NAME,TEXT FROM ALL_SOURCE WHERE TYPE='PROCEDURE' \"\n\t\t\t\t+ \"and OWNER='\"+databaseName.toUpperCase()+\"'\"\n\t\t\t\t;\n\t\tsql+=\" order by NAME,LINE asc\";\n try(PreparedStatement preparedStatement= connection.prepareStatement(sql);\n \t\tResultSet resultSet=preparedStatement.executeQuery();){\n\t\twhile(resultSet.next()) {\n\t\t String key=resultSet.getString(1)\n\t\t\t\t ,line=resultSet.getString(2)\n\t\t\t\t ;\n\t\t StringBuffer sbr=textMap.get(key);\n\t\t if(sbr==null) {\n\t\t\t sbr=new StringBuffer(\"\");\n\t\t\t textMap.put(key, sbr);\n\t\t\t \n\t\t }\n\t\t if(line.contains(\"--\")) {\n\t\t\t line=line.substring(0,line.indexOf(\"--\"));\n\t\t\t line.replace(\"\\n\", \"\");\n\t\t }\n\t\t sbr.append(line);\n\t\t}\n }\n \n for(Entry<String, StringBuffer> ent:textMap.entrySet()) {\n \t\n \tList<ProcedureParamSrc> paramSrcs=ret.get(ent.getKey());\n \t\n \tString procName=ent.getKey();\n \tif(paramSrcs==null) {\n \t\tparamSrcs=new ArrayList<>();\n \t\tret.put(procName, paramSrcs);\n \t}\n \t\n \tString text=ent.getValue().toString(),t=text.toLowerCase(),p=\"\";\n \tint s=0,e=0;\n \ts=t.indexOf(procName.toLowerCase())+procName.length();\n \tt=t.substring(s);\n \t\n \t\n \ts=t.indexOf(\"(\");\n \t\n \tif(s>=0&&s<5) {\n \t s++;\n \t \n \t \n \t e=t.indexOf(\")\");\n \t\n \t \n \t \n \t p=t.substring(s,e-1);\n \t}\n \t\n \t\n \t\n \tString[] params=p.split(\",\");\n \tfor(String param: params) {\n \t\t// (is_used OUT number, data_ratio OUT number, clob_rest OUT clob)\n if(param.trim().length()==0)continue;\n \t\tString[] subParams=param.trim().split(\" \");\n \t\t\n \t\tObject[] _params= Stream.of(subParams)\n \t\t\t\t.filter(str->!str.isEmpty()).toArray();\n \t\t\n \t\t//System.out.println(param);\n \t\tString name=_params[0].toString().trim()\n \t\t\t\t,io=\"in\"\n \t\t\t\t,type=\"varchar2\"\n \t\t\t\t;\n \t\tif(_params.length==3) {\n \t\t\tio=_params[1].toString().trim();\n \t\ttype=_params[2].toString().trim();\n \t\t}\n \t\tProcedureParamSrc src=new ProcedureParamSrc();\n \t\tsrc.isOutput=io.toUpperCase().equals(\"out\");\n \t\tsrc.paramName=name;\n \t\tif(\"number\".equals(type)) {\n \t\t\tsrc.sqlType=Types.DOUBLE;\n \t\tsrc.cls=Double.class;\n \t\t}\n \t\telse if(\"date\".equals(type)) {\n \t\t\tsrc.sqlType=Types.DATE;\n \t\tsrc.cls=Date.class;\n \t\t}else {\n \t\t\tsrc.sqlType=Types.VARCHAR;\n \t\tsrc.cls=String.class;\n \t\t}\n \t\t\n \t\tparamSrcs.add(src);\n \t}\n \t\n }\n\t\t\n\t\t\n\t\treturn ret;\n\t}", "private void loadRegistredCommands() {\n ServiceLoader<Command> loader = ServiceLoader.load(Command.class);\n for (Command command : loader) {\n addCommand(command);\n }\n }", "private void load() {\r\n\t\tswitch (this.stepPanel.getStep()) {\r\n\t\tcase StepPanel.STEP_HOST_GRAPH:\r\n\t\t\tloadGraph(StepPanel.STEP_HOST_GRAPH);\r\n\t\t\tbreak;\r\n\t\tcase StepPanel.STEP_STOP_GRAPH:\r\n\t\t\tloadGraph(StepPanel.STEP_STOP_GRAPH);\r\n\t\t\tbreak;\r\n\t\tcase StepPanel.STEP_CRITICAL_PAIRS:\r\n\t\t\tloadPairs();\r\n\t\t\tbreak;\r\n\t\tcase StepPanel.STEP_FINISH:\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}", "void loadAll() {\n\t\tsynchronized (this) {\n\t\t\tif (isFullyLoaded) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfor (Entry<Integer, Supplier<ChunkMeta<?>>> generator : ChunkMetaFactory.getInstance()\n\t\t\t\t\t.getEmptyChunkFunctions()) {\n\t\t\t\tChunkMeta<?> chunk = generator.getValue().get();\n\t\t\t\tchunk.setChunkCoord(this);\n\t\t\t\tchunk.setPluginID(generator.getKey());\n\t\t\t\ttry {\n\t\t\t\t\tchunk.populate();\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// need to catch everything here, otherwise we block the main thread forever\n\t\t\t\t\t// once it tries to read this\n\t\t\t\t\tCivModCorePlugin.getInstance().getLogger().log(Level.SEVERE, \n\t\t\t\t\t\t\t\"Failed to load chunk data\", e);\n\t\t\t\t}\n\t\t\t\taddChunkMeta(chunk);\n\t\t\t}\n\t\t\tisFullyLoaded = true;\n\t\t\tthis.notifyAll();\n\t\t}\n\t}", "protected void updateProcedures() {\n if (!STORED_PROCEDURE_ENABLED.contains(dbType)) {\n return;\n }\n\n // Build/update the tables as well as the stored procedures\n PhysicalDataModel pdm = new PhysicalDataModel();\n buildCommonModel(pdm, updateFhirSchema, updateOauthSchema,updateJavaBatchSchema);\n\n // Now only apply the procedures in the model. Much faster than\n // going through the whole schema\n try {\n try (Connection c = createConnection()) {\n try {\n JdbcTarget target = new JdbcTarget(c);\n IDatabaseAdapter adapter = getDbAdapter(dbType, target);\n pdm.applyProcedures(adapter);\n pdm.applyFunctions(adapter);\n } catch (Exception x) {\n c.rollback();\n throw x;\n }\n c.commit();\n }\n } catch (SQLException x) {\n throw translator.translate(x);\n }\n }", "public static void load() {\n for (DataSourceSwapper each : ServiceLoader.load(DataSourceSwapper.class)) {\n loadOneSwapper(each);\n }\n }", "private static void load(){\n }", "public void beginLoad(int libraryCount);", "public void loadPlugins() {\n\n ServiceLoader<Pump> serviceLoader = ServiceLoader.load(Pump.class);\n for (Pump pump : serviceLoader) {\n availablePumps.put(pump.getPumpName(), pump);\n }\n\n Pump dummy = new DummyControl();\n availablePumps.put(dummy.getName(), dummy);\n\n Pump lego = new LegoControl();\n availablePumps.put(lego.getName(), lego);\n }", "public void load() {\n\t}", "public static void load() {\n }", "public void insertLoadsAndStores() {\n for (com.debughelper.tools.r8.ir.code.BasicBlock block : code.blocks) {\n com.debughelper.tools.r8.ir.code.InstructionListIterator it = block.listIterator();\n while (it.hasNext()) {\n com.debughelper.tools.r8.ir.code.Instruction current = it.next();\n current.insertLoadAndStores(it, this);\n }\n }\n }", "protected void loadAll() {\n\t\ttry {\n\t\t\tloadGroups(this.folder, this.cls, this.cachedOnes);\n\t\t\t/*\n\t\t\t * we have to initialize the components\n\t\t\t */\n\t\t\tfor (Object obj : this.cachedOnes.values()) {\n\t\t\t\t((Component) obj).getReady();\n\t\t\t}\n\t\t\tTracer.trace(this.cachedOnes.size() + \" \" + this + \" loaded.\");\n\t\t} catch (Exception e) {\n\t\t\tthis.cachedOnes.clear();\n\t\t\tTracer.trace(\n\t\t\t\t\te,\n\t\t\t\t\tthis\n\t\t\t\t\t\t\t+ \" pre-loading failed. No component of this type is available till we successfully pre-load them again.\");\n\t\t}\n\t}", "private synchronized void loadProcessors() {\n if (loaded)\n return;\n\n // Get the processor service declarations\n Set<ServiceDeclaration> processorDeclarations; \n try {\n processorDeclarations = ServiceDiscovery.getInstance().getServiceDeclarations(URLArtifactProcessor.class);\n } catch (IOException e) {\n \tIllegalStateException ie = new IllegalStateException(e);\n \terror(\"IllegalStateException\", staxProcessor, ie);\n throw ie;\n }\n \n for (ServiceDeclaration processorDeclaration: processorDeclarations) {\n Map<String, String> attributes = processorDeclaration.getAttributes();\n // Load a URL artifact processor\n String artifactType = attributes.get(\"type\");\n String modelTypeName = attributes.get(\"model\");\n \n // Create a processor wrapper and register it\n URLArtifactProcessor processor = new LazyURLArtifactProcessor(artifactType, modelTypeName, \n \t\tprocessorDeclaration, extensionPoints, staxProcessor, monitor);\n addArtifactProcessor(processor);\n }\n \n loaded = true;\n }", "@SuppressWarnings(\"rawtypes\")\n\tprotected void scan() {\n\t\tLOGGER.info(\"Scanning database procedure mappers for packages: \"\n\t\t\t\t+ packageNames + \" ...\");\n\t\tfor (String scanPackageName : packageNames) {\n\t\t\tClass[] procedureConfigClasses = PackageUtils.getAnnotatedClasses(\n\t\t\t\t\tscanPackageName, Procedure.class);\n\t\t\tif (procedureConfigClasses != null) {\n\t\t\t\tfor (Class procedureConfigClass : procedureConfigClasses) {\n\t\t\t\t\thelper.initProcedureConfigCache(procedureConfigClass);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tLOGGER.info(\"Finished scanning database procedure mappers for packages.\");\n\t}", "public void load() {\n }", "@ConfigOperation\r\n @Order(10)\r\n protected void execLoadSession() throws ProcessingException {\r\n }", "void loadNext();", "public void loadAllUserData(){\n\n }", "private void loadLists() {\n loadSavedCourses();\n loadSavedSchedules();\n }", "public void load() {\n handleLoad(false, false);\n }", "@Override\n\tpublic Map<String, String> getAvailableProcedures(boolean refresh)\n\t{\n\t\treturn m_models.getAvailableProcedures(refresh);\n\t}", "public void load() ;", "public void loadAllPlugins(final String extPointId);", "public abstract void loaded();", "public void load();", "public void load();", "@Override\r\n\tpublic void load() {\n\t\ts.load();\r\n\r\n\t}", "public static void preLoad() {\n\t\tserviceClasses.clear();\n\t\tloadGroups(CLASS_FOLDER, null, serviceClasses);\n\t\tTracer.trace(serviceClasses.size()\n\t\t\t\t+ \" java class names loaded as services.\");\n\t\t/*\n\t\t * clean and pre-load if required\n\t\t */\n\t\tfor (ComponentType aType : ComponentType.values()) {\n\t\t\tif (aType.cachedOnes != null) {\n\t\t\t\taType.cachedOnes.clear();\n\t\t\t}\n\t\t\tif (aType.preLoaded) {\n\t\t\t\taType.loadAll();\n\t\t\t}\n\t\t}\n\t}", "public void load() {\n ClassLoader loader;\n Class c;\n Mapper result;\n Method m;\n Object[] tables;\n\n if (isLoaded()) {\n return;\n }\n loader = Mapper.class.getClassLoader();\n try {\n c = loader.loadClass(name);\n } catch (ClassNotFoundException e) {\n throw new IllegalStateException(e.toString());\n }\n try {\n m = c.getMethod(\"load\", new Class[]{});\n } catch (NoSuchMethodException e) {\n throw new IllegalStateException(e.toString());\n }\n try {\n tables = (Object[]) m.invoke(null, new Object[] {});\n } catch (InvocationTargetException e) {\n throw new IllegalStateException(e.getTargetException().toString());\n } catch (IllegalAccessException e) {\n throw new IllegalStateException(e.toString());\n }\n parser = (Parser) tables[0];\n oag = (Oag) tables[1];\n }", "public void loadPluginsStartup();", "public abstract void load();", "@Override\r\n\tpublic void load() {\n\t}", "public static List<IProcedure> getSystemProcedures() {\r\n\t\treturn systemProcedures;\r\n\t}", "public void loadData ( ) {\n\t\tinvokeSafe ( \"loadData\" );\n\t}", "void load();", "void load();", "public static void addSystemProcedures(IProcedure procedure) {\r\n\t\tsystemProcedures.add(procedure);\r\n\t}", "private void loadLists() {\n }", "@Override\n\tpublic Stream<Path> loadAll() {\n\t\treturn null;\n\t}", "@Override\r\n\tprotected void initLoad() {\n\r\n\t}", "private void loadGameFiles(){\n\t}", "@Override\r\n\tpublic void load() {\n\r\n\t}", "public static void load() {\n\t\t// manager.load(camp_fire);\r\n\t\t// manager.load(camp_fire_burntout);\r\n\t\t//\r\n\t\t// manager.load(fire_stick);\r\n\t\t// manager.load(fire_stick_burntout);\r\n\t\t//\r\n\t\t// manager.load(stockpile);\r\n\t\t// manager.load(worker);\r\n\t\t//\r\n\t\t// manager.load(icon_wood);\r\n\t\t//\r\n\t\tmanager.load(worker_ant);\r\n\t\tmanager.setLoader(FreeTypeFontGenerator.class,\r\n\t\t\t\tnew FreeTypeFontGeneratorLoader(new InternalFileHandleResolver()));\r\n\t\tmanager.load(dialog);\r\n\t}", "public void loadData() {\n\t\tbookingRequestList = bookingRequestDAO.getAllBookingRequests();\n\t\tcabDetailList = cabDAO.getAllCabs();\n\t}", "public void loadAllLists(){\n }", "public void load() throws SparqlException {\n \tload(getLoadFilePath());\n }", "RecordSet loadAllComponents(Record record, RecordLoadProcessor recordLoadProcessor);", "public void execute() {\n OBPropertiesProvider.setFriendlyWarnings(true);\n\n // Initialize DAL only in case it is needed: modules have refrence data to be loaded\n CPStandAlone pool = new CPStandAlone(propertiesFile);\n ApplyModuleData[] ds = null;\n try {\n if (!forceRefData) {\n ds = ApplyModuleData.selectClientReferenceModules(pool);\n } else {\n ds = ApplyModuleData.selectAllClientReferenceModules(pool);\n }\n } catch (Exception e) {\n log4j.error(\"Error checking modules with reference data\", e);\n }\n if (ds != null && ds.length > 0) {\n // Initialize DAL and execute\n super.execute();\n } else {\n try {\n if (!forceRefData) {\n ds = ApplyModuleData.selectTranslationModules(pool);\n } else {\n ds = ApplyModuleData.selectAllTranslationModules(pool);\n }\n } catch (Exception e) {\n log4j.error(\"Error checking modules with translation data\", e);\n }\n if (ds != null && ds.length > 0) {\n // Execute without DAL\n doExecute();\n }\n // do not execute if not reference data nor translations present\n }\n }", "public static void load() {\n load(false);\n }", "@Override\r\n\tprotected void load() {\n\t\t\r\n\t}", "public void reload(){\n\t\tplugin_configuration.load();\n\t\tflarf_configuration.load();\n\t\tmessages_configuration.load();\n\t\tstadiumlisting.load();\n\t}", "@Override\n public void load() {\n }", "public static void loadEndpoints(){\n\t\tStart.loadEndpoints();\n\t\t//add\t\t\n\t\t//e.g.: get(\"/my-endpoint\", (request, response) ->\t\tmyEndpointGet(request, response));\n\t\t//e.g.: post(\"/my-endpoint\", (request, response) ->\t\tmyEndpointPost(request, response));\n\t}", "void loadAll(int pageNum, LoadView mLoadView);", "public void load() {\n mapdb_ = DBMaker.newFileDB(new File(\"AllPoems.db\"))\n .closeOnJvmShutdown()\n .encryptionEnable(\"password\")\n .make();\n\n // open existing an collection (or create new)\n poemIndexToPoemMap_ = mapdb_.getTreeMap(\"Poems\");\n \n constructPoems();\n }", "protected abstract void loadData();", "void massiveModeLoading( File dataPath );", "@Override\n\tprotected void load() {\n\n\t}", "@Override\n\tprotected void load() {\n\n\t}", "@Override\n\tprotected void load() {\n\t\t\n\t}", "@Override\n\tprotected void load() {\n\t\t\n\t}", "@Override\n\tprotected void load() {\n\t\t\n\t}", "public void executeLoad(){\n\t\tBitString destBS = mIR.substring(4, 3);\n\t\tBitString pcOffset = mIR.substring(7, 9);\n\t\tBitString wantedVal = mMemory[mPC.getValue() + pcOffset.getValue2sComp()];\n\t\tmRegisters[destBS.getValue()] = wantedVal;\n\n\t\tsetConditionalCode(wantedVal);\n\t\t//now I just need to set the conditional codes.\n\t}", "public static void SelfCallForLoading() {\n\t}", "public void loadAndWait()\n {\n injector.addConfigurationInstances(this.configClassInstances);\n\n // load all @Services from @Configuration classes\n injector.activateFailOnNullInstance();\n injector.load();\n\n // detect duplicates and crash on matches\n injector.crashOnDuplicates();\n\n // branch out the dependencies, such that Service A, with dependency B, is\n // aware of all dependencies of B.\n injector.branchOutDependencyTree();\n\n // sort the services, based on dependency requirements\n injector.sortByDependencies();\n\n // instantiate services/clients and crash if any nil instances are detected\n injector.instantiateComponents();\n injector.crashOnNullInstances();\n\n // add the component instances to the ServiceContext\n injector.installServices(ctx);\n\n // instantiate clients\n //injector.instantiateClients();\n\n // invoke DepWire methods with required services & clients\n injector.findDepWireMethodsAndPopulate();\n }", "public void setAllLoaded(boolean value) {\n this.allLoaded = value;\n }", "public abstract void loadData();", "public abstract void loadData();", "public void load (){\n load(MAX_PREZ);\n }", "protected void loadData()\n {\n }", "public void load() {\r\n\t\t\r\n\t\t//-- Clean\r\n\t\tthis.repositories.clear();\r\n\t\t\r\n\t\tloadInternal();\r\n\t\tloadExternalRepositories();\r\n\t\t\r\n\t}", "public void loaded(){\n\t\tloaded=true;\n\t}", "@Override\r\n public void load() throws ParamContextException {\n\r\n }", "public void processFiles(){\n\t\tfor(String fileName : files) {\n\t\t\ttry {\n\t\t\t\tloadDataFromFile(fileName);\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\tSystem.out.println(\"Can't open file: \" + fileName);\n\t\t\t\tSystem.out.println();\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tprintInOrder();\n\t\t\tstudents.clear();\n\t\t}\n\t}", "public void loadAll() throws IOException {\r\n System.out.println(\"Previous setting were:\");\r\n System.out.print(\"Time: \" + SaveLoadPrev.getPrevTime(\"outputfile.txt\") + \" | \");\r\n System.out.print(\"Bus Number: \" + SaveLoadPrev.getPrevBusnum(\"outputfile.txt\") + \" | \");\r\n System.out.println(\"Bus Stop: \" + SaveLoadPrev.getPrevBusstop(\"outputfile.txt\"));\r\n String time = SaveLoadPrev.getPrevTime(\"outputfile.txt\");\r\n String busnum = SaveLoadPrev.getPrevBusnum(\"outputfile.txt\");\r\n String busstop = SaveLoadPrev.getPrevBusstop(\"outputfile.txt\");\r\n new ArriveTimeCalculator(busstop, busnum, time);\r\n }", "private void loadJobs(){\n\t\tsuperJobsList.clear();\n\t\tsuperJobs=jdbc.getProjectsAndJobs();\n\t\tfor(Job j: superJobs){\n\t\t\tsuperJobsList.addElement(j.jobname);\n\t\t}\n\t\t\n\t}", "public void loadNames() {\n\t\tloadNames(false);\n\t}", "private void loading(){\n mDbHelper = new DbHelper(getActivity());\n if(!(mDbHelper.getPlanCount() == 0)){\n plan_list.addAll(mDbHelper.getAllPlan());\n }\n refreshList();\n }", "public void load_cntl_code_1() {\n\n control_memory[0] = new Fetch0();\n control_memory[1] = new Fetch1();\n control_memory[2] = new Fetch2();\n control_memory[5] = new NOP();\n control_memory[10] = new LOADI0();\n\n control_memory[15] = new RSTART(\"ADD\", false);\n control_memory[16] = new ADD(\"ADD\", false);\n control_memory[17] = new RFINISH(\"ADD\");\n\n control_memory[20] = new RSTART(\"SUB\", false);\n control_memory[21] = new SUB(\"SUB\", false);\n control_memory[22] = new RFINISH(\"SUB\");\n\n control_memory[25] = new RSTART(\"ADDS\", false);\n control_memory[26] = new ADD(\"ADDS\", true);\n control_memory[27] = new RFINISH(\"ADDS\");\n\n control_memory[30] = new RSTART(\"SUBS\", false);\n control_memory[31] = new SUB(\"SUBS\", true);\n control_memory[32] = new RFINISH(\"SUBS\");\n\n control_memory[35] = new RSTART(\"AND\", false);\n control_memory[36] = new AND(\"AND\");\n control_memory[37] = new RFINISH(\"AND\");\n\n control_memory[40] = new RSTART(\"ORR\", false);\n control_memory[41] = new ORR(\"ORR\");\n control_memory[42] = new RFINISH(\"ORR\");\n\n control_memory[45] = new RSTART(\"EOR\", false);\n control_memory[46] = new EOR(\"EOR\");\n control_memory[47] = new RFINISH(\"EOR\");\n\n control_memory[50] = new LSL0();\n control_memory[51] = new LSL1();\n control_memory[52] = new RFINISH(\"LSR\");\n\n control_memory[55] = new LSR0();\n control_memory[56] = new LSR1();\n control_memory[57] = new RFINISH(\"LSR\");\n\n control_memory[60] = new BR0();\n control_memory[61] = new BR1();\n\n control_memory[65] = new RSTART(\"ADDI\", true);\n control_memory[66] = new ADD(\"ADDI\", false);\n control_memory[67] = new RFINISH(\"ADDI\");\n\n control_memory[70] = new RSTART(\"SUBI\", true);\n control_memory[71] = new SUB(\"SUBI\", false);\n control_memory[72] = new RFINISH(\"SUBI\");\n\n control_memory[75] = new RSTART(\"ADDIS\", true);\n control_memory[76] = new ADD(\"ADDIS\", true);\n control_memory[77] = new RFINISH(\"ADDIS\");\n\n control_memory[80] = new RSTART(\"SUBIS\", true);\n control_memory[81] = new SUB(\"SUBIS\", true);\n control_memory[82] = new RFINISH(\"SUBIS\");\n\n control_memory[85] = new RSTART(\"ANDI\", true);\n control_memory[86] = new AND(\"ANDI\");\n control_memory[87] = new RFINISH(\"ANDI\");\n\n control_memory[90] = new RSTART(\"ORRI\", true);\n control_memory[91] = new ORR(\"ORRI\");\n control_memory[92] = new RFINISH(\"ORRI\");\n\n control_memory[95] = new RSTART(\"EORI\", true);\n control_memory[96] = new EOR(\"EORI\");\n control_memory[97] = new RFINISH(\"EORI\");\n\n control_memory[100] = new LDUR0();\n control_memory[101] = new LDUR1();\n control_memory[102] = new LDUR2();\n control_memory[103] = new LDUR3();\n control_memory[104] = new LDUR4();\n\n control_memory[105] = new STUR0();\n control_memory[106] = new STUR1();\n control_memory[107] = new STUR2();\n control_memory[108] = new STUR3();\n control_memory[109] = new STUR4();\n\n control_memory[140] = new CBSTART(\"CBZ\");\n control_memory[141] = new CBZ();\n control_memory[142] = new CBFINISH(\"CBZ\");\n\n control_memory[145] = new CBSTART(\"CBNZ\");\n control_memory[146] = new CBNZ();\n control_memory[147] = new CBFINISH(\"CBNZ\");\n\n control_memory[155] = new BCONDSTART(\"BEQ\");\n control_memory[156] = new BEQ();\n control_memory[157] = new BCONDFINISH(\"BEQ\");\n\n control_memory[160] = new BCONDSTART(\"BNE\");\n control_memory[161] = new BNE();\n control_memory[162] = new BCONDFINISH(\"BNE\");\n\n control_memory[165] = new BCONDSTART(\"BLT\");\n control_memory[166] = new BLT();\n control_memory[167] = new BCONDFINISH(\"BLT\");\n\n control_memory[170] = new BCONDSTART(\"BLE\");\n control_memory[171] = new BLE();\n control_memory[172] = new BCONDFINISH(\"BLE\");\n\n control_memory[175] = new BCONDSTART(\"BGT\");\n control_memory[176] = new BGT();\n control_memory[177] = new BCONDFINISH(\"BGT\");\n\n control_memory[180] = new BCONDSTART(\"BGE\");\n control_memory[181] = new BGE();\n control_memory[182] = new BCONDFINISH(\"BGE\");\n\n control_memory[185] = new B0();\n control_memory[186] = new B1();\n control_memory[187] = new B2();\n\n\n }", "public void loadFromDatabase(){\r\n /**\r\n * Open the file streams to the three files\r\n * Recover the state of data structures\r\n * Close the file streams\r\n */\r\n\r\n try{\r\n //Recover the state of unfinished set from unfinished.dat\r\n unfinishedFileInputStream = new FileInputStream(UNFINISHED_FILE_PATH);\r\n unfinishedSetInputStream = new ObjectInputStream(unfinishedFileInputStream);\r\n unfinished = (Set<Task>)unfinishedSetInputStream.readObject();\r\n unfinishedSetInputStream.close();\r\n unfinishedFileInputStream.close();\r\n\r\n //Recover the state of finished list from finished.dat\r\n finishedFileInputStream = new FileInputStream(FINISHED_FILE_PATH);\r\n finishedListInputStream = new ObjectInputStream(finishedFileInputStream);\r\n finished = (ArrayList<Task>)finishedListInputStream.readObject();\r\n finishedListInputStream.close();\r\n finishedFileInputStream.close();\r\n\r\n //Recover the state of activities list from activities.dat\r\n activitiesFileInputStream = new FileInputStream(ACTIVITIES_FILE_PATH);\r\n activitiesListInputStream = new ObjectInputStream(activitiesFileInputStream);\r\n activities = (ArrayList<Activity>)activitiesListInputStream.readObject();\r\n activitiesListInputStream.close();\r\n activitiesFileInputStream.close();\r\n\r\n generateWeeklySchedule();\r\n }\r\n catch(Exception e){\r\n System.out.println(e.getMessage());\r\n }\r\n }", "@Override\n public void load() {\n }", "void loadData();", "void loadData();", "@BeforeAll\n\tstatic void initOperate()\n\t{\t\n\t\tSystem.out.println(\"only Before All the tests....\");\n\t\toperate = new Operations();\n\t}", "@PostConstruct\n private void loadFiles() {\n \n\n File dir = new File(Constants.DIR_PATH);\n File[] files = dir.listFiles(); //stores list of files in given paths\n String line=\"\";\n\n for(File file : files){\n try {\n br = new BufferedReader(new FileReader(file));\n br.readLine();\n while((line=br.readLine())!=null){\n\n String []token=line.split(Constants.DELIMETER);\n String fileName=file.getName().toUpperCase();\n\n FlightData newflight = new FlightData(fileName.substring(0,fileName.lastIndexOf(\".\")),token[0],token[1],token[2],token[3],token[4],token[5],Double.parseDouble(token[6]),token[7],token[8]);\n flightDataDao.insertFlightData(newflight);\n }\n\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n }", "public static void loadPOTables(){\n\t\ttry {\n\t\t\tfor(TableInfo tableInfo:tables.values()){\n\t\t\t\tClass c = Class.forName(DBManager.getConfiguration().getPoPackage()+\".\"+StringUtils.firstCharUpperCase(tableInfo.getTname()));\n\t\t\t\tpoClassTableMap.put(c, tableInfo);\n\t\t\t}\n\t\t} catch (ClassNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void loadOutputModules() {\n\t\tthis.outputModules = new ModuleLoader<IOutput>(\"/Output_Modules\", IOutput.class).loadClasses();\n\t}", "public void getAllFSMProcess() {\n IReadFile readFile = new ReadFile();\n List<String> list = readFile.readFsmFile(path);\n for(String s : list) {\n FSMContent content = readFile.saveFSMContent(readFile.splitFsmLine(s));\n if(currentState == null) {\n currentState = content.getCurrentState();\n }\n current_state.add(content.getCurrentState());\n next_state.add(content.getNextState());\n solution_set.add(content.getInputSymbol());\n contentsMap.put(content.getCurrentState() + content.getInputSymbol(), content);\n }\n }", "@Override\n\t\t\t\t\tpublic void beginLoad(int type) {\n\n\t\t\t\t\t}", "protected void _loadHandlers() throws SessionException\n {\n if (this._fileEventHandlerSet != null)\n {\n this._logger.trace(\"Releasing old set of file event handlers.\"); \n this._fileEventHandlerSet.destroy();\n }\n \n //--------------------------\n \n this._logger.trace(\"Creating file event handler manager.\");\n \n //create new manager, and get a (possible empty) handle set from it\n FileEventHandlerManager fehManager = new FileEventHandlerManager(\n this._argTable, \n this._actionId); \n this._fileEventHandlerSet = fehManager.getFileEventHandlers();\n \n //check for error\n if (this._fileEventHandlerSet.hasError())\n {\n throw new SessionException(\"Error occured while loading file handlers\",\n Constants.EXCEPTION);\n }\n \n //dump list of ids if debug enabled\n if (this._logger.isDebugEnabled())\n {\n String[] ids = _fileEventHandlerSet.getHandlerIds();\n StringBuffer buf = new StringBuffer(\"Handler set ids: { \");\n if (ids.length > 0)\n buf.append(ids[0]);\n if (ids.length > 1)\n for (int i = 1; i < ids.length; ++i)\n buf.append(\", \").append(ids[i]);\n buf.append(\"}\");\n this._logger.debug(buf.toString()); \n \n }\n }", "private void loadInstructions(int count, byte... codes) {\r\n\t\tint instructionLocation = instructionBase;\r\n\t\tfor (int i = 0; i < count; i++) {\r\n\t\t\tfor (byte code : codes) {\r\n\t\t\t\tcpuBuss.write(instructionLocation++, code);\r\n\t\t\t} // for codes\r\n\t\t} // for\r\n\t\twrs.setProgramCounter(instructionBase);\r\n\t}", "public void loadPlugins()\n throws Exception\n {\n SecurityClassLoader securityClassLoader = new SecurityClassLoader(Plugin.class.getClassLoader(),\n ImmutableList.of(\"ideal.sylph.\", \"com.github.harbby.gadtry.\")); //raed only sylph-api deps\n this.loader = ModuleLoader.<Plugin>newScanner()\n .setPlugin(Plugin.class)\n .setScanDir(pluginDir)\n .setLoader(OperatorManager::serviceLoad)\n .setClassLoaderFactory(urls -> new VolatileClassLoader(urls, securityClassLoader)\n {\n @Override\n protected void finalize()\n throws Throwable\n {\n super.finalize();\n logger.warn(\"Jvm gc free ClassLoader: {}\", Arrays.toString(urls));\n }\n })\n .setLoadHandler(module -> {\n logger.info(\"loading module {} find {} Operator\", module.getName(), module.getPlugins().size());\n ModuleInfo moduleInfo = new ModuleInfo(module, new ArrayList<>());\n analyzeModulePlugins(moduleInfo);\n ModuleInfo old = userExtPlugins.put(module.getName(), moduleInfo);\n if (old != null) {\n Try.of(old::close).onFailure(e -> logger.warn(\"free old module failed\", e)).doTry();\n }\n }).load();\n }", "public void schemaBeingLoaded(SchemaDefinition sd) throws ResultException {\n \tfor(SchemaExtensionIF currext : extensions.values()){\n \t\tcurrext.schemaBeingLoaded(sd);\n \t}\n }", "boolean supportsParallelLoad();", "public void loadRounds ()\n {\n for (Integer roundId : selectedRounds) {\n log.info(\"Loading Round \" + roundId);\n }\n log.info(\"End of list of rounds that are loaded\");\n\n Scheduler scheduler = Scheduler.getScheduler();\n scheduler.loadRounds(selectedRounds);\n }", "@Override\n public void execute(Map<String, FileInfo> fileInfos) throws Exception {\n FileInfo fileInfo = fileInfos.computeIfAbsent(COMMON_FILE, FileInfo::new);\n fileInfo.setImports(ImmutableSet.of());\n fileInfo.getStructInfos().put(EMPTY.getName(), EMPTY);\n EMPTY.setFileInfo(fileInfo);\n // create loaders\n enumLoader = new EnumLoader(name -> fileInfos.computeIfAbsent(name, FileInfo::new));\n structLoader = new StructLoader(enumLoader);\n rpcLoader = new ServiceLoader(structLoader);\n // load classes\n for (Class<?> clz : ScanUtils.scanClass(packageName, this::filterClass)) {\n if (clz.isInterface()) {\n rpcLoader.execute(clz);\n interfaceCount++;\n } else if (clz.getInterfaces().length > 1) {\n structLoader.execute(clz);\n classCount++;\n } else if (clz.getInterfaces().length > 0) {\n enumLoader.execute(clz);\n enumCount++;\n }\n }\n }", "private void loadInstructions(byte... codes) {\r\n\t\tint instructionLocation = instructionBase;\r\n\t\tfor (int i = -128; i < 128; i++) {\r\n\t\t\tfor (byte code : codes) {\r\n\t\t\t\tcpuBuss.write(instructionLocation++, code);\r\n\t\t\t} // for codes\r\n\t\t\tcpuBuss.write(instructionLocation++, (byte) i);\r\n\t\t} // for\r\n\t\twrs.setProgramCounter(instructionBase);\r\n\t}", "public void reloadFiles()\n {\n for (Reloadable rel : reloadables)\n {\n rel.reload();\n }\n }" ]
[ "0.6226616", "0.61815554", "0.61158514", "0.603613", "0.6006571", "0.59813607", "0.59502006", "0.5933483", "0.585835", "0.58097565", "0.5798204", "0.5797339", "0.5763333", "0.5754247", "0.5720541", "0.56955034", "0.5687943", "0.5673609", "0.5614747", "0.55605435", "0.55468", "0.5486538", "0.545587", "0.54551667", "0.54323673", "0.5380265", "0.5378564", "0.5378564", "0.5370368", "0.53590703", "0.53460073", "0.53422225", "0.53233165", "0.52983993", "0.5294751", "0.5287975", "0.5277338", "0.5277338", "0.52730477", "0.5257177", "0.5243401", "0.5235379", "0.5232194", "0.52158993", "0.5213765", "0.5184156", "0.5181762", "0.5176946", "0.51685864", "0.5165805", "0.5120666", "0.51204425", "0.5106646", "0.51062435", "0.50936264", "0.5089157", "0.50821185", "0.5076767", "0.5063691", "0.5047685", "0.5047685", "0.50412244", "0.50412244", "0.50412244", "0.50357467", "0.5033339", "0.5015564", "0.5007767", "0.50054365", "0.50054365", "0.50039333", "0.49992806", "0.4991313", "0.49676827", "0.49496776", "0.4938323", "0.49294898", "0.49234527", "0.49205282", "0.49109456", "0.49085924", "0.49079436", "0.49055246", "0.48974642", "0.48974642", "0.4894325", "0.48939773", "0.4889226", "0.48876697", "0.4883608", "0.4882058", "0.488023", "0.4874434", "0.4871442", "0.48710245", "0.4867155", "0.4862568", "0.48590693", "0.48511928", "0.48448437" ]
0.58381677
9
Created by RezaulAkram on 10/10/2016.
public interface NoSmokeFragmentInterface { public void setCountValue(int count); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "public final void mo51373a() {\n }", "private stendhal() {\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\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\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\tprotected void interr() {\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n protected void getExras() {\n }", "@Override\n public void init() {\n\n }", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\r\n\tpublic void rozmnozovat() {\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 }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n protected void initialize() {\n\n \n }", "@Override\n protected void initialize() \n {\n \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 public void init() {\n }", "@Override\n public void memoria() {\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n void init() {\n }", "private void poetries() {\n\n\t}", "public void mo4359a() {\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\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n protected void init() {\n }", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\n public void init() {}", "@Override\n public int describeContents() { return 0; }", "public void gored() {\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 einkaufen() {\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {}", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "private void init() {\n\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 Rekenhulp()\n\t{\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "private void m50366E() {\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\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tpublic void init()\n\t{\n\n\t}", "@Override\n public void initialize() {\n \n }", "@Override\n\tpublic void init() {\n\t}", "@Override\n public void initialize() { \n }", "protected MetadataUGWD() {/* intentionally empty block */}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\n\t\tpublic void init() {\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 }", "@Override\n\tprotected void initialize() {\n\t}", "@Override\n\tprotected void initialize() {\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public int retroceder() {\n return 0;\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "public void mo6081a() {\n }", "@Override\n public void initialize() {}", "@Override\n public void initialize() {}" ]
[ "0.6303395", "0.6077538", "0.60044605", "0.6002728", "0.5995385", "0.5964251", "0.5964251", "0.5925746", "0.5923478", "0.5897153", "0.58799076", "0.5788074", "0.57835495", "0.57740796", "0.57727003", "0.57580084", "0.5735522", "0.5722423", "0.5718254", "0.57174385", "0.5713163", "0.5698527", "0.5698527", "0.5698527", "0.5698527", "0.5698527", "0.5698527", "0.56912005", "0.5688338", "0.5684052", "0.56760764", "0.5674193", "0.5674193", "0.5674193", "0.5674193", "0.5674193", "0.56604093", "0.56485283", "0.5648226", "0.5640864", "0.5640864", "0.5638164", "0.5636654", "0.563156", "0.56262827", "0.56262827", "0.56226736", "0.5598339", "0.55894834", "0.5586471", "0.55847085", "0.5578113", "0.55696887", "0.556572", "0.556572", "0.556572", "0.5561959", "0.5560976", "0.55592346", "0.5555412", "0.5554466", "0.5554466", "0.5554157", "0.5550172", "0.5550172", "0.5550172", "0.5549415", "0.5549314", "0.5544865", "0.5533026", "0.55270636", "0.5521821", "0.5505108", "0.5505108", "0.5505108", "0.5503488", "0.5494417", "0.54888266", "0.5472888", "0.54701215", "0.5469897", "0.54657286", "0.545513", "0.5452429", "0.5449165", "0.5449165", "0.5449165", "0.5449165", "0.5449165", "0.5449165", "0.5449165", "0.5447931", "0.5447931", "0.5441843", "0.54410815", "0.5438463", "0.5434281", "0.54295796", "0.542681", "0.54151076", "0.54151076" ]
0.0
-1
Use this factory method to create a new instance of this fragment using the provided parameters.
public static FragmentRegistro newInstance(String param1, String param2) { FragmentRegistro fragment = new FragmentRegistro(); Bundle args = new Bundle(); args.putString(ARG_PARAM1, param1); args.putString(ARG_PARAM2, param2); fragment.setArguments(args); return fragment; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static FragmentTousWanted newInstance() {\n FragmentTousWanted fragment = new FragmentTousWanted();\n Bundle args = new Bundle();\n fragment.setArguments(args);\n return fragment;\n }", "protected abstract Fragment createFragment();", "public void createFragment() {\n\n }", "public CuartoFragment() {\n }", "@Override\n protected Fragment createFragment() {\n Intent intent = getIntent();\n\n long id = intent.getLongExtra(MovieDetailFragment.EXTRA_ID, -1);\n return MovieDetailFragment.newInstance(id);\n }", "public StintFragment() {\n }", "public ExploreFragment() {\n\n }", "public RickAndMortyFragment() {\n }", "public LogFragment() {\n }", "public FragmentMy() {\n }", "public FeedFragment() {\n }", "public HistoryFragment() {\n }", "public HistoryFragment() {\n }", "public static MyFeedFragment newInstance() {\n return new MyFeedFragment();\n }", "public WkfFragment() {\n }", "public static ScheduleFragment newInstance() {\n ScheduleFragment fragment = new ScheduleFragment();\n Bundle args = new Bundle();\n //args.putString(ARG_PARAM1, param1);\n //args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);\n return fragment;\n }", "public WelcomeFragment() {}", "public ProfileFragment(){}", "public static ForumFragment newInstance() {\n ForumFragment fragment = new ForumFragment();\n Bundle args = new Bundle();\n fragment.setArguments(args);\n\n return fragment;\n }", "public static NotificationFragment newInstance() {\n NotificationFragment fragment = new NotificationFragment();\n Bundle args = new Bundle();\n// args.putString(ARG_PARAM1, param1);\n// args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);\n return fragment;\n }", "public progFragment() {\n }", "public static RouteFragment newInstance() {\n RouteFragment fragment = new RouteFragment();\n Bundle args = new Bundle();\n //fragment.setArguments(args);\n return fragment;\n }", "public HeaderFragment() {}", "public EmployeeFragment() {\n }", "public Fragment_Tutorial() {}", "public NewShopFragment() {\n }", "public FavoriteFragment() {\n }", "public static MyCourseFragment newInstance() {\n MyCourseFragment fragment = new MyCourseFragment();\r\n// fragment.setArguments(args);\r\n return fragment;\r\n }", "public static MessageFragment newInstance() {\n MessageFragment fragment = new MessageFragment();\n Bundle args = new Bundle();\n\n fragment.setArguments(args);\n return fragment;\n }", "public static RecipeListFragment newInstance() {\n RecipeListFragment fragment = new RecipeListFragment();\n// Bundle args = new Bundle();\n// args.putString(ARG_PARAM1, param1);\n// args.putString(ARG_PARAM2, param2);\n// fragment.setArguments(args);\n return fragment;\n }", "public static ReservationFragment newInstance() {\n\n ReservationFragment _fragment = new ReservationFragment();\n// Bundle args = new Bundle();\n// args.putString(ARG_PARAM1, param1);\n// args.putString(ARG_PARAM2, param2);\n// fragment.setArguments(args);\n return _fragment;\n }", "public CreateEventFragment() {\n // Required empty public constructor\n }", "public static Fragment newInstance() {\n\t\treturn new ScreenSlidePageFragment();\n\t}", "public NoteActivityFragment() {\n }", "public static WeekViewFragment newInstance(int param1, int param2) {\n WeekViewFragment fragment = new WeekViewFragment();\n //WeekViewFragment 객체 생성\n Bundle args = new Bundle();\n //Bundle 객체 생성\n args.putInt(ARG_PARAM1, param1);\n //ARG_PARAM1에 param1의 정수값 넣어서 args에 저장\n args.putInt(ARG_PARAM2, param2);\n //ARG_PARAM2에 param2의 정수값 넣어서 args에 저장\n fragment.setArguments(args);\n //args를 매개변수로 한 setArguments() 메소드 수행하여 fragment에 저장\n return fragment; //fragment 반환\n }", "public static Fragment0 newInstance(String param1, String param2) {\n Fragment0 fragment = new Fragment0();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);\n return fragment;\n }", "public static QueenBEmbassyF newInstance() {\n QueenBEmbassyF fragment = new QueenBEmbassyF();\n //the way to pass arguments between fragments\n Bundle args = new Bundle();\n\n fragment.setArguments(args);\n return fragment;\n }", "public EventHistoryFragment() {\n\t}", "public static Fragment newInstance() {\n StatisticsFragment fragment = new StatisticsFragment();\n Bundle args = new Bundle();\n fragment.setArguments(args);\n return fragment;\n }", "public HomeFragment() {}", "public PeopleFragment() {\n // Required empty public constructor\n }", "public static FeedFragment newInstance() {\n FeedFragment fragment = new FeedFragment();\n return fragment;\n }", "public static MainFragment newInstance(String param1, String param2) {\n MainFragment fragment = new MainFragment();\n Bundle args = new Bundle();\n fragment.setArguments(args);\n return fragment;\n }", "public VantaggiFragment() {\n // Required empty public constructor\n }", "public AddressDetailFragment() {\n }", "public ArticleDetailFragment() { }", "public static DropboxMainFrag newInstance() {\n DropboxMainFrag fragment = new DropboxMainFrag();\n // set arguments in Bundle\n return fragment;\n }", "public RegisterFragment() {\n }", "public EmailFragment() {\n }", "public static CommentFragment newInstance() {\n CommentFragment fragment = new CommentFragment();\n\n return fragment;\n }", "public static FragmentComida newInstance(String param1) {\n FragmentComida fragment = new FragmentComida();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n fragment.setArguments(args);\n return fragment;\n\n\n }", "public static ParqueosFragment newInstance() {\n ParqueosFragment fragment = new ParqueosFragment();\n return fragment;\n }", "public ForecastFragment() {\n }", "public FExDetailFragment() {\n \t}", "public static AddressFragment newInstance(String param1) {\n AddressFragment fragment = new AddressFragment();\n\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n fragment.setArguments(args);\n\n return fragment;\n }", "public TripNoteFragment() {\n }", "public ItemFragment() {\n }", "public NoteListFragment() {\n }", "public CreatePatientFragment() {\n\n }", "public DisplayFragment() {\n\n }", "public static frag4_viewcompliment newInstance(String param1, String param2) {\r\n frag4_viewcompliment fragment = new frag4_viewcompliment();\r\n Bundle args = new Bundle();\r\n args.putString(ARG_PARAM1, param1);\r\n args.putString(ARG_PARAM2, param2);\r\n fragment.setArguments(args);\r\n return fragment;\r\n }", "public static fragment_profile newInstance(String param1, String param2) {\n fragment_profile fragment = new fragment_profile();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);\n return fragment;\n }", "@Override\n\tprotected Fragment createFragment() {\n\t\treturn new FormFragment();\n\t}", "public static MainFragment newInstance() {\n MainFragment fragment = new MainFragment();\n Bundle args = new Bundle();\n fragment.setArguments(args);\n return fragment;\n }", "public ProfileFragment() {\n\n }", "public CustomerFragment() {\n }", "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 BackEndFragment() {\n }", "public ArticleDetailFragment() {\n }", "public ArticleDetailFragment() {\n }", "public ArticleDetailFragment() {\n }", "public static Fragment newInstance() {\n return new SettingsFragment();\n }", "public PeersFragment() {\n }", "public SummaryFragment newInstance()\n {\n return new SummaryFragment();\n }", "public TagsFragment() {\n }", "public static ProfileFragment newInstance() {\n ProfileFragment fragment = new ProfileFragment();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, \"\");\n args.putString(ARG_PARAM2, \"\");\n fragment.setArguments(args);\n return fragment;\n }", "public HomeSectionFragment() {\n\t}", "public static FriendsFragment newInstance() {\n FriendsFragment fragment = new FriendsFragment();\n\n return fragment;\n }", "public static FirstFragment newInstance(String text) {\n\n FirstFragment f = new FirstFragment();\n Bundle b = new Bundle();\n b.putString(\"msg\", text);\n\n f.setArguments(b);\n\n return f;\n }", "public static LogFragment newInstance(Bundle params) {\n LogFragment fragment = new LogFragment();\n fragment.setArguments(params);\n return fragment;\n }", "public PersonDetailFragment() {\r\n }", "public RegisterFragment() {\n // Required empty public constructor\n }", "public VehicleFragment() {\r\n }", "public static Fine newInstance(String param1, String param2) {\n Fine fragment = new Fine();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);\n return fragment;\n }", "public static FriendsFragment newInstance(String param1, String param2) {\n FriendsFragment fragment = new FriendsFragment();\n Bundle args = new Bundle();\n fragment.setArguments(args);\n return fragment;\n }", "public static NoteFragment newInstance(String param1, String param2) {\n NoteFragment fragment = new NoteFragment();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n args.putString(ARG_PARAM2, param2);\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 MainFragment newInstance(Context context) {\n MainFragment fragment = new MainFragment();\n if(context != null)\n fragment.setVariables(context);\n return fragment;\n }", "@Override\n\tprotected Fragment createFragment() {\n\t\treturn new CrimeListFragment();\n\t}", "public static MoneyLogFragment newInstance() {\n MoneyLogFragment fragment = new MoneyLogFragment();\n return fragment;\n }", "public static ForecastFragment newInstance() {\n\n //Create new fragment\n ForecastFragment frag = new ForecastFragment();\n return(frag);\n }", "public static MainFragment newInstance(String param1, String param2) {\n MainFragment fragment = new MainFragment();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);\n return fragment;\n }", "public static MainFragment newInstance(String param1, String param2) {\n MainFragment fragment = new MainFragment();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);\n return fragment;\n }", "public static MainFragment newInstance(String param1, String param2) {\n MainFragment fragment = new MainFragment();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);\n return fragment;\n }", "public static MyTaskFragment newInstance(String param1) {\n MyTaskFragment fragment = new MyTaskFragment();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n fragment.setArguments(args);\n return fragment;\n }", "public static MainFragment newInstance(int param1, String param2) {\n MainFragment fragment = new MainFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_PARAM1, param1);\n\n args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);\n return fragment;\n }", "public static MyProfileFragment newInstance(String param1, String param2) {\n MyProfileFragment fragment = new MyProfileFragment();\n return fragment;\n }", "public PlaylistFragment() {\n }", "public static HistoryFragment newInstance() {\n HistoryFragment fragment = new HistoryFragment();\n return fragment;\n }", "public static SurvivorIncidentFormFragment newInstance(String param1, String param2) {\n// SurvivorIncidentFormFragment fragment = new SurvivorIncidentFormFragment();\n// Bundle args = new Bundle();\n// args.putString(ARG_PARAM1, param1);\n// args.putString(ARG_PARAM2, param2);\n// fragment.setArguments(args);\n// return fragment;\n\n SurvivorIncidentFormFragment fragment = new SurvivorIncidentFormFragment();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);\n return fragment;\n\n\n }", "public static PersonalFragment newInstance(String param1, String param2) {\n PersonalFragment fragment = new PersonalFragment();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);\n return fragment;\n }" ]
[ "0.7260997", "0.7233023", "0.71139246", "0.69902015", "0.6990197", "0.68339634", "0.68298686", "0.6814042", "0.6802172", "0.68006206", "0.6766425", "0.6740456", "0.6740456", "0.67286223", "0.6717106", "0.6707997", "0.6691045", "0.66906345", "0.66888523", "0.6664766", "0.6646295", "0.6641969", "0.6641151", "0.66351783", "0.6618878", "0.6614461", "0.66075444", "0.66060954", "0.65996534", "0.65938187", "0.65933573", "0.6592791", "0.65830207", "0.65802246", "0.6566385", "0.656248", "0.655828", "0.65524215", "0.6551029", "0.6544007", "0.6540301", "0.6535632", "0.653452", "0.652886", "0.652519", "0.6524337", "0.6524179", "0.65153986", "0.6506756", "0.6499224", "0.6498952", "0.64962023", "0.6495085", "0.6486315", "0.6485869", "0.6481742", "0.6479443", "0.64777875", "0.6471789", "0.6466489", "0.645878", "0.6457261", "0.64543056", "0.6453744", "0.6450888", "0.6448873", "0.64487475", "0.6448724", "0.6443938", "0.6443938", "0.6443938", "0.64425945", "0.64423394", "0.6441851", "0.6439066", "0.64352584", "0.6429579", "0.64295495", "0.642576", "0.6420743", "0.6420302", "0.6413205", "0.641305", "0.6404773", "0.64028054", "0.6398195", "0.63981533", "0.6393855", "0.6389547", "0.63851887", "0.63805455", "0.63770175", "0.63770175", "0.63770175", "0.6376279", "0.63665354", "0.63660157", "0.63620394", "0.63553715", "0.6354086", "0.6352893" ]
0.0
-1
Inflate the layout for this fragment
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View viewFragmentRegistro = inflater.inflate(R.layout.fragment_fragment_registro, container, false); //Creamos las referencias con la interfaz objViewAutosDis = viewFragmentRegistro.findViewById(R.id.view_autos_dis); objViewAutosActuales = viewFragmentRegistro.findViewById(R.id.view_autos_actuales); objViewMotosDis = viewFragmentRegistro.findViewById(R.id.view_motos_dis); objViewMotosActuales = viewFragmentRegistro.findViewById(R.id.view_motos_actuales); objSpinner = viewFragmentRegistro.findViewById(R.id.spinner_registro); objGroup = viewFragmentRegistro.findViewById(R.id.radio_group_ent_sal); objBtnRegistra = viewFragmentRegistro.findViewById(R.id.btn_registra_archivo); objActivity = getActivity(); objContext = objActivity.getApplicationContext(); //Crea una instancia de AdministraArchivo para mostrar y modificar la disponibilidad de motos y autos final AdministraArchivo objConfigura = new AdministraArchivo(objContext); //Asignamos el texto a los TextView int a = objConfigura.getAutosDisponibles(); String autosDisponibles = "Autos disponibles: " + a; objViewAutosDis.setText(autosDisponibles); int b = objConfigura.getAutosActuales(); String autosActuales = "Autos actuales: " + b; objViewAutosActuales.setText(autosActuales); int c = objConfigura.getMotosDisponibles(); String motosDisponibles = "Motos disponibles: " + c; objViewMotosDis.setText(motosDisponibles); int d = objConfigura.getMotosActuales(); String motosActuales = "Motos actuales: " + d; objViewMotosActuales.setText(motosActuales); //Llenamos el Spinner de la interfaz ArrayList<String> objListSpinner = new ArrayList<>(); objListSpinner.add("Seleccione la clase de vehiculo"); objListSpinner.add("carro"); objListSpinner.add("moto"); //Adaptamos el Spinner final ArrayAdapter<String> objAdapter = new ArrayAdapter<String>(objContext, android.R.layout.simple_spinner_dropdown_item, objListSpinner); objSpinner.setAdapter(objAdapter); //Ponemos en escucha el boton de registrar objBtnRegistra.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { //Almacenamos la seleccion del Spinner String selectSpinner = objSpinner.getSelectedItem().toString(); //Validamos la seleccion del spinner if (objSpinner.getSelectedItemPosition() != 0) { //Almacenamos la seleccion de RadioButton int selectRadio = objGroup.getCheckedRadioButtonId(); int result = objConfigura.creaEntradaSalida(selectSpinner, selectRadio); if (result == 1) { Toast.makeText(objContext, "Entrada guardada.", Toast.LENGTH_SHORT).show(); } else if (result == 2) { Toast.makeText(objContext, "Salida guardada.", Toast.LENGTH_SHORT).show(); } objSpinner.setSelection(0); }else { Toast.makeText(objContext, "Seleccione una clase de vehiculo.", Toast.LENGTH_SHORT).show(); } } }); return viewFragmentRegistro; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_main_allinfo, container, false);\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n\t\t\tBundle savedInstanceState) {\n\t\treturn inflater.inflate(R.layout.wallpager_layout, null);\r\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_invit_friends, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View inflate = inflater.inflate(R.layout.fragment_zhuye, container, false);\n initView(inflate);\n initData();\n return inflate;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.fragment_posts, parent, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n return inflater.inflate(R.layout.ilustration_fragment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_sow_drug_cost_per_week, container, false);\n\n db = new DataBaseAdapter(getActivity());\n hc = new HelperClass();\n pop = new FeedSowsFragment();\n\n infltr = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n parent = (LinearLayout) v.findViewById(R.id.layout_for_add);\n tvTotalCost = (TextView) v.findViewById(R.id.totalCost);\n\n getData();\n setData();\n\n return v;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_stream_list, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_event, container, false);\n\n\n\n\n\n\n\n\n return v;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_feed, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.screen_select_list_student, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_overall, container, false);\n mNamesLayout = (LinearLayout) rootView.findViewById(R.id.fragment_overall_names_layout);\n mOverallView = (OverallView) rootView.findViewById(R.id.fragment_overall_view);\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState)\n {\n\n\n view = inflater.inflate(R.layout.fragment_earning_fragmant, container, false);\n ini(view);\n return view;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n super.onCreateView(inflater, container, savedInstanceState);\n final View rootview = inflater.inflate(R.layout.activity_email_frag, container, false);\n ConfigInnerElements(rootview);\n return rootview;\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n\t\t\tBundle savedInstanceState) {\n\t\trootView = inflater.inflate(R.layout.fragment_attack_armor, container, false);\r\n\r\n\t\tfindInterfaceElements();\r\n\t\taddRangeSelector();\r\n\t\tupdateHeadings();\r\n\t\tsetListeners();\r\n\r\n\t\tsetFromData();\r\n\r\n\t\treturn rootView;\r\n\t}", "@SuppressLint(\"InflateParams\")\r\n\t@Override\r\n\tpublic View initLayout(LayoutInflater inflater) {\n\t\tView view = inflater.inflate(R.layout.frag_customer_all, null);\r\n\t\treturn view;\r\n\t}", "@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_fore_cast, container, false);\r\n initView();\r\n mainLayout.setVisibility(View.GONE);\r\n apiInterface = RestClinet.getClient().create(ApiInterface.class);\r\n loadData();\r\n return view;\r\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_friend, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n rootView = inflater.inflate(R.layout.fragment_detail, container, false);\n image = rootView.findViewById(R.id.fr_image);\n name = rootView.findViewById(R.id.fr_name);\n phoneNumber = rootView.findViewById(R.id.fr_phone_number);\n email = rootView.findViewById(R.id.fr_email);\n street = rootView.findViewById(R.id.fr_street);\n city = rootView.findViewById(R.id.fr_city);\n state = rootView.findViewById(R.id.fr_state);\n zipcode = rootView.findViewById(R.id.fr_zipcode);\n dBrith = rootView.findViewById(R.id.date_brith);\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_pm25, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_kkbox_playlist, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_feed_pager, container, false);\n\n// loadData();\n\n findViews(rootView);\n\n setViews();\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n layout = (FrameLayout) inflater.inflate(R.layout.fragment_actualites, container, false);\n\n relLayout = (RelativeLayout) layout.findViewById(R.id.relLayoutActus);\n\n initListView();\n getXMLData();\n\n return layout;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n rootView = inflater.inflate(R.layout.frag_post_prayer_video, container, false);\n setCustomDesign();\n setCustomClickListeners();\n return rootView;\n }", "@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\treturn inflater.inflate(R.layout.lf_em4305_fragment, container, false);\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_recordings, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view=inflater.inflate(R.layout.fragment_category, container, false);\n initView(view);\n bindRefreshListener();\n loadParams();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_cm_box_details, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view=inflater.inflate(R.layout.fragment_layout12, container, false);\n\n iniv();\n\n init();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_details, container, false);\n //return inflater.inflate(R.layout.fragment_details, container, false);\n getIntentValues();\n initViews();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_mem_body_blood, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_qiugouxiaoxi, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View inflate = inflater.inflate(R.layout.fragment_coll_blank, container, false);\n initView(inflate);\n initData();\n return inflate;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_attendance_divide, container, false);\n\n initView(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.show_program_fragment, parent, false);\n }", "@Override\n public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,\n @Nullable Bundle savedInstanceState) {\n return inflater.inflate(R.layout.visualization_fragment, container, false);\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n rootView = inflater.inflate(R.layout.fragment_category_details_page, container, false);\n initializeAll();\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n final View v = inflater.inflate(R.layout.fragemnt_reserve, container, false);\n\n\n\n\n return v;\n }", "protected int getLayoutResId() {\n return R.layout.activity_fragment;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_all_quizs, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n role = getArguments().getInt(\"role\");\n rootview = inflater.inflate(R.layout.fragment_application, container, false);\n layout = rootview.findViewById(R.id.patentDetails);\n progressBar = rootview.findViewById(R.id.progressBar);\n try {\n run();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return rootview;\n }", "@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\tview = inflater.inflate(R.layout.fragment_zhu, null);\n\t\tinitView();\n\t\tinitData();\n\t\treturn view;\n\t}", "@Override\n\t\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)\n\t\t{\n\t\t\tView rootView = inflater.inflate(R.layout.maimfragment, container, false);\n\t\t\treturn rootView;\n\t\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n // Inflate the layout for this fragment\n return inflater.inflate(R.layout.fragment__record__week, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_porishongkhan, container, false);\n\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_dashboard, container, false);\n resultsRv = view.findViewById(R.id.db_results_rv);\n resultText = view.findViewById(R.id.db_search_empty);\n progressBar = view.findViewById(R.id.db_progressbar);\n lastVisitText = view.findViewById(R.id.db_last_visit);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(getLayoutId(), container, false);\n init(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_feedback, container, false);\n self = getActivity();\n initUI(view);\n initControlUI();\n initData();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_service_summery, container, false);\n tvVoiceMS = v.findViewById(R.id.tvVoiceValue);\n tvDataMS = v.findViewById(R.id.tvdataValue);\n tvSMSMS = v.findViewById(R.id.tvSMSValue);\n tvVoiceFL = v.findViewById(R.id.tvVoiceFLValue);\n tvDataBS = v.findViewById(R.id.tvDataBRValue);\n tvTotal = v.findViewById(R.id.tvTotalAccountvalue);\n return v;\n }", "@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_clan_rank_details, container, false);\r\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_star_wars_list, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View inflate = inflater.inflate(R.layout.fragment_lei, container, false);\n\n initView(inflate);\n initData();\n return inflate;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_quotation, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_wode_ragment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n\n\n\n\n\n return inflater.inflate(R.layout.fragment_appoint_list, parent, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n if (rootView == null) {\n rootView = inflater.inflate(R.layout.fragment_ip_info, container, false);\n initView();\n }\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_offer, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_rooms, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n\n View view = inflater.inflate(R.layout.fragment_img_eva, container, false);\n\n getSendData();\n\n initView(view);\n\n initData();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_project_collection, container, false);\n ButterKnife.bind(this, view);\n fragment = this;\n initView();\n getCollectionType();\n // getCategoryList();\n initBroadcastReceiver();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_yzm, container, false);\n initView(view);\n return view;\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n\t\tmainLayout = inflater.inflate(R.layout.fragment_play, container, false);\r\n\t\treturn mainLayout;\r\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_invite_request, container, false);\n initialiseVariables();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n getLocationPermission();\n return inflater.inflate(R.layout.centrum_fragment, container, false);\n\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_habit_type_details, container, false);\n\n habitTitle = rootView.findViewById(R.id.textViewTitle);\n habitReason = rootView.findViewById(R.id.textViewReason);\n habitStartDate = rootView.findViewById(R.id.textViewStartDate);\n habitWeeklyPlan = rootView.findViewById(R.id.textViewWeeklyPlan);\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_information_friends4, container, false);\n\n if (getArguments() != null) {\n FriendsID = getArguments().getString(\"keyFriends\");\n }\n\n return v;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_post_details, container, false);\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_hotel, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view=inflater.inflate(R.layout.fragment_bus_inquiry, container, false);\n initView();\n initData();\n initDialog();\n getDataFromNet();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_weather, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_srgl, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_ground_detail_frgment, container, false);\n init();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_book_appointment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_wheretogo, container, false);\n ids();\n setup();\n click();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n binding = DataBindingUtil\n .inflate(inflater, R.layout.fragment_learning_leaders, container, false);\n init();\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_end_game_tab, container, false);\n\n setupWidgets();\n setupTextFields(view);\n setupSpinners(view);\n\n // Inflate the layout for this fragment\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.memoir_fragment, container, false);\n\n getUserIdFromSharedPref();\n configureUI(view);\n configureSortSpinner();\n configureFilterSpinner();\n\n networkConnection = new NetworkConnection();\n new GetAllMemoirTask().execute();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_jadwal, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_delivery_detail, container, false);\n initialise();\n\n\n\n return view;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_4, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_all_product, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_group_details, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment06_7, container, false);\n initView(view);\n setLegend();\n setXAxis();\n setYAxis();\n setData();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_downloadables, container, false);\n }", "@Override\n public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.movie_list_fragment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_like, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_hall, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_unit_main, container, false);\n TextView mTxvBusinessAassistant = (TextView) view.findViewById(R.id.txv_business_assistant);\n TextView mTxvCardINformation = (TextView) view.findViewById(R.id.txv_card_information);\n RelativeLayout mRelOfficialWebsite = (RelativeLayout) view.findViewById(R.id.rel_official_website);\n RelativeLayout mRelPictureAblum = (RelativeLayout) view.findViewById(R.id.rel_picture_album);\n TextView mTxvQrCodeCard = (TextView) view.findViewById(R.id.txv_qr_code_card);\n TextView mTxvShareCard = (TextView) view.findViewById(R.id.txv_share_card);\n mTxvBusinessAassistant.setOnClickListener(this.mOnClickListener);\n mTxvCardINformation.setOnClickListener(this.mOnClickListener);\n mRelOfficialWebsite.setOnClickListener(this.mOnClickListener);\n mRelPictureAblum.setOnClickListener(this.mOnClickListener);\n mTxvQrCodeCard.setOnClickListener(this.mOnClickListener);\n mTxvShareCard.setOnClickListener(this.mOnClickListener);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_moviespage, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_s, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_overview, container, false);\n\n initOverviewComponents(view);\n registerListeners();\n initTagListener();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_bahan_ajar, container, false);\n initView(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n root = (ViewGroup) inflater.inflate(R.layout.money_main, container, false);\n context = getActivity();\n initHeaderView(root);\n initView(root);\n\n getDate();\n initEvetn();\n return root;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.fragment_historical_event, parent, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_event_details, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_video, container, false);\n unbinder = ButterKnife.bind(this, view);\n initView();\n initData();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n\n v= inflater.inflate(R.layout.fragment_post_contacts, container, false);\n this.mapping(v);\n return v;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_measures, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_feed, container, false);\n findViews(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_surah_list, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_data_binded, container, false);\n }" ]
[ "0.6739604", "0.67235583", "0.6721706", "0.6698254", "0.6691869", "0.6687986", "0.66869223", "0.6684548", "0.66766286", "0.6674615", "0.66654444", "0.66654384", "0.6664403", "0.66596216", "0.6653321", "0.6647136", "0.66423255", "0.66388357", "0.6637491", "0.6634193", "0.6625158", "0.66195583", "0.66164845", "0.6608733", "0.6596594", "0.65928894", "0.6585293", "0.65842897", "0.65730995", "0.6571248", "0.6569152", "0.65689117", "0.656853", "0.6566686", "0.65652984", "0.6553419", "0.65525705", "0.65432084", "0.6542382", "0.65411425", "0.6538022", "0.65366334", "0.65355957", "0.6535043", "0.65329415", "0.65311074", "0.65310687", "0.6528645", "0.65277404", "0.6525902", "0.6524516", "0.6524048", "0.65232015", "0.65224624", "0.65185034", "0.65130377", "0.6512968", "0.65122765", "0.65116245", "0.65106046", "0.65103024", "0.6509013", "0.65088093", "0.6508651", "0.6508225", "0.6504662", "0.650149", "0.65011525", "0.6500686", "0.64974767", "0.64935696", "0.6492234", "0.6490034", "0.6487609", "0.6487216", "0.64872116", "0.6486594", "0.64861935", "0.6486018", "0.6484269", "0.648366", "0.6481476", "0.6481086", "0.6480985", "0.6480396", "0.64797544", "0.647696", "0.64758915", "0.6475649", "0.6474114", "0.6474004", "0.6470706", "0.6470275", "0.64702207", "0.6470039", "0.6467449", "0.646602", "0.6462256", "0.64617974", "0.6461681", "0.6461214" ]
0.0
-1
Almacenamos la seleccion del Spinner
@Override public void onClick(View v) { String selectSpinner = objSpinner.getSelectedItem().toString(); //Validamos la seleccion del spinner if (objSpinner.getSelectedItemPosition() != 0) { //Almacenamos la seleccion de RadioButton int selectRadio = objGroup.getCheckedRadioButtonId(); int result = objConfigura.creaEntradaSalida(selectSpinner, selectRadio); if (result == 1) { Toast.makeText(objContext, "Entrada guardada.", Toast.LENGTH_SHORT).show(); } else if (result == 2) { Toast.makeText(objContext, "Salida guardada.", Toast.LENGTH_SHORT).show(); } objSpinner.setSelection(0); }else { Toast.makeText(objContext, "Seleccione una clase de vehiculo.", Toast.LENGTH_SHORT).show(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onClick(View v)\n {\n mySpinner.performClick();\n int getPosition = (Integer) v.getTag();\n\n toggleSelection(getPosition);\n\n\n notifyDataSetChanged();\n\n /**\n * if clicked position is one\n * that means you want clear all select item in list\n */\n /* if (getPosition == 1)\n {\n clearList();\n }\n */\n /**\n * if clicked position is two\n * that means you want select all item in list\n */\n /* else if (getPosition == 2)\n {\n fillList();\n }*/\n }", "private void itemtypeSpinner() {\n ArrayAdapter<CharSequence> staticAdapter = ArrayAdapter\n .createFromResource(getContext(), R.array.select_array,\n android.R.layout.simple_spinner_item);\n\n // Specify the layout to use when the list of choices appears\n staticAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n\n // Apply the adapter to the spinner\n mItemTypeSpinnerA2.setAdapter(staticAdapter);\n\n mItemTypeSpinnerA2.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view,\n int position, long id) {\n String itemtypeText = (String) parent.getItemAtPosition(position);\n if (itemtypeText.equals(\"Mobile Phones\")) {\n\n mInputLayoutSerialNoA2.setVisibility(View.VISIBLE);\n mInputLayoutSerialNoA2.setClickable(true);\n mInputLayoutItemImeiA2.setVisibility(View.VISIBLE);\n mInputLayoutItemImeiA2.setClickable(true);\n\n\n } else if (itemtypeText.equals(\"Laptops\")) {\n\n mInputLayoutSerialNoA2.setVisibility(View.VISIBLE);\n mInputLayoutSerialNoA2.setClickable(true);\n mInputLayoutItemImeiA2.setVisibility(View.GONE);\n mInputLayoutItemImeiA2.setClickable(false);\n\n } else {\n mInputLayoutSerialNoA2.setVisibility(View.GONE);\n mInputLayoutSerialNoA2.setClickable(false);\n mInputLayoutItemImeiA2.setVisibility(View.GONE);\n mInputLayoutItemImeiA2.setClickable(false);\n }\n\n\n\n }\n\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n mItemTypeSpinnerA2.getItemAtPosition(0);\n mInputLayoutSerialNoA2.setVisibility(View.GONE);\n mInputLayoutSerialNoA2.setClickable(false);\n mInputLayoutItemImeiA2.setVisibility(View.GONE);\n mInputLayoutItemImeiA2.setClickable(false);\n\n\n }\n });\n\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n if (position != mClickTypeSelection) {\n setActionSpinner(true, position);\n }\n }", "private void spinnerAction() {\n Spinner spinnerphonetype = (Spinner) findViewById(R.id.activity_one_phonetype_spinner);//phonetype spinner declaration\n ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this,\n R.array.phone_spinner, android.R.layout.simple_spinner_item); //create the spinner array\n adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); //set the drop down function\n spinnerphonetype.setAdapter(adapter); //set the spinner array\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view,\n int pos, long id) {\n choice=pos;\n }", "public void setSelection(T t) {\n\t\tspinner.setSelection(adapter.getPosition(t));\n\t}", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {\n spinnerItemSelected = parent.getItemAtPosition(pos).toString();\n }", "private void spinner() {\n ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this,\n R.array.planets_array, R.layout.simple_spinner_item_new);\n// Specify the layout to use when the list of choices appears\n adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n// Apply the adapter to the spinner\n// dropDownViewTheme.\n planetsSpinner.setAdapter(adapter);\n planetsSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n Object itemAtPosition = parent.getItemAtPosition(position);\n Log.d(TAG, \"onItemSelected: \" + itemAtPosition);\n\n String[] stringArray = getResources().getStringArray(R.array.planets_array);\n Toast.makeText(DialogListActivity.this, \"选择 \" + stringArray[position], Toast.LENGTH_SHORT).show();\n }\n\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n Toast.makeText(DialogListActivity.this, \"未选择\", Toast.LENGTH_SHORT).show();\n }\n });\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n }", "private void updateSpinner() {\n ArrayAdapter<CharSequence> adaptador = new ArrayAdapter(getContext(), android.R.layout.simple_spinner_item,nombresEnComboBox);\n spinner.setAdapter(adaptador);\n //guardo el item seleccionado del combo\n spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener(){\n @Override\n public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {\n nombreDeLocSeleccionada[0] = (String) spinner.getAdapter().getItem(i);\n for (int j=0 ; j < listaLocalidades.size() ; j++){\n if (listaLocalidades.get(j).getNombreLocalidad().equals(nombreDeLocSeleccionada[0])) {\n idLoc = listaLocalidades.get(j).getIdLocalidad() ;\n break;\n }\n }\n //Toast.makeText(getActivity(), nombreDeLocSeleccionada[0], Toast.LENGTH_SHORT).show();\n }\n\n @Override\n public void onNothingSelected(AdapterView<?> adapterView) {\n\n }\n });\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position,\n long id) {\n\n }", "void onItemSelected();", "void onItemSelected();", "public void onItemSelected(AdapterView<?> parent, View view,\n int pos, long id) {\n\n }", "public void onNothingSelected(AdapterView<?> parent) {\n // Toast.makeText(getApplicationContext(), \"nada en el spinner\", Toast.LENGTH_LONG).show();\n }", "public void onItemSelected(int id);", "@Override\n public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {\n }", "@Override\n public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {\n }", "@Override\n public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n\n switch (parent.getId())\n {\n case R.id.spiEspecie:\n /**Vericamos si la posicion seleccionada es mayor que cero, ya que el numero 0 es un valor por default\n y no tiene ningun valor en la base de datos*/\n if(position>0)\n {\n\n //Desbloqueamos la base el sepinner de razas\n enableSpinnerAndButton(spiRaza,agregarRaza);\n /**Establecemos un observador para obtener las razas por especie seleccianada, en esta caso este se encarga de actualizar\n * cada vez que agreguemos una nueva raza\n * */\n instanciaDB.getRazaDAO().getAllBreedsFromSpecie(parent.getSelectedItem().toString()).observe(CreacionPerfiles.this,\n new Observer<List<RazaDAO.NombreRaza>>() {\n @Override\n public void onChanged(List<RazaDAO.NombreRaza> nombreRazas) {\n arrayNombreRazas.clear();\n /**Este metodo esta asociado a un Observer que decta cuando se han cambiado los datos para actualizar\n * de forma asincrona, por tal razan validdamos cuando es guardar y cuando es actualizar en caso de ser\n * \"guardar\" entonces solo actualiza el spinner raza cuando se selecciona una especie */\n if (accion == Constantes.GUARDAR) {\n for (RazaDAO.NombreRaza raza : nombreRazas) {\n arrayNombreRazas.add(raza.getNombreRaza());\n }\n }\n else if (accion == Constantes.ACTUALIZAR) {\n for(int i=0;i<nombreRazas.size();i++)\n {\n if(nombreRazas.get(i).getNombreRaza().equals(raza))\n {\n /**Se obtiene la posición y se le suma 1 porque el 0 es el valor por defecto*/\n postionItemRaza =i+1;\n }\n arrayNombreRazas.add(i,nombreRazas.get(i).getNombreRaza());\n }\n }\n\n /** Independientemente si es actualizacion o se esta guardando la opcion por default siempre va e\n * existir por eso se coloca al final de las evaluaciones*/\n arrayNombreRazas.add(0,\"Seleccione Raza\");\n spiRaza.setSelection(postionItemRaza);\n /** Se resetea esta posición con el objetivo que la proxima vez que seleccione una nueva especie y\n * no tenga razas relacionadas en la base de datos, el valor por defecto se seleccione*/\n postionItemRaza=0;\n }\n });\n /**\n * Cada vez que se selecciona una especie se recarga las razas pertenecientes a esa especie, por tanto el primer item seleccionado sea el cero\n * ya que es el valor por defecto \"Seleccione raza\", que le indica al usuario que hacer\n * */\n\n }\n else\n {\n /**Se selecciona el valor po defecto*/\n spiRaza.setSelection(postionItemRaza);\n disableSpinnerAndButton(spiRaza,agregarRaza);\n\n }\n\n\n\n break;\n }\n }", "private void povoarSpinners() {\n List<String> lista = new ArrayList<>();\n lista.add(UsuarioNivelConstantes.VETOR_DESCRICOES[0]);\n lista.add(UsuarioNivelConstantes.VETOR_DESCRICOES[1]);\n lista.add(UsuarioNivelConstantes.VETOR_DESCRICOES[2]);\n ArrayAdapter<String> arrayAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_dropdown_item, lista);\n arrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_item);\n spnNivel.setAdapter(arrayAdapter);\n lista = new ArrayList<>();\n lista.add(UsuarioEstadoConstantes.VETOR_DESCRICOES[0]);\n lista.add(UsuarioEstadoConstantes.VETOR_DESCRICOES[1]);\n arrayAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_dropdown_item, lista);\n arrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_item);\n spnEstado.setAdapter(arrayAdapter);\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View v, int position, long id)\n {\n }", "@Override\n public void onItemSelected(AdapterView<?> arg0, View arg1, int position,long id) {\n\n\n\n\n }", "@Override\n public void onItemSelected(AdapterView<?> adapterView, View view, int position, long id)\n {\n }", "@Override\r\n\t\t\tpublic void seleccionar() {\n\r\n\t\t\t}", "public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n userType = (int) arg3;\n /* 将mySpinner 显示*/\n arg0.setVisibility(View.VISIBLE);\n }", "@Override\n public void onItemSelected(AdapterView<?> arg0, View arg1,\n int arg2, long arg3) {\n\n\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view,\n int position, long id) {\n }", "public void onItemSelected(int position);", "public void onItemSelected(String id);", "public void onItemSelected(String id);", "public void onItemSelected(String id);", "public void onItemSelected(String id);", "public void onItemSelected(String id);", "public void onItemSelected(AdapterView<?> parent, View view,\n int pos, long id) {\n }", "@Override\n\tpublic void onItemSelected(AdapterView<?> parent, View view, int pos,\n\t\t\tlong id) {\n\t\t\n\t\t\n\t}", "@Override\n\t\tpublic void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n\n\t\t}", "private void setUpSpinner(){\n ArrayAdapter paymentSpinnerAdapter =ArrayAdapter.createFromResource(this,R.array.array_gender_option,android.R.layout.simple_spinner_item);\n\n // Specify dropdown layout style - simple list view with 1 item per line, then apply adapter to the spinner\n paymentSpinnerAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);\n mPaymentSpinner.setAdapter(paymentSpinnerAdapter);\n\n // To set the spinner to the selected payment method by the user when clicked from cursor adapter.\n if (payMode != null) {\n if (payMode.equalsIgnoreCase(\"COD\")) {\n mPaymentSpinner.setSelection(0);\n } else {\n mPaymentSpinner.setSelection(1);\n }\n mPaymentSpinner.setOnTouchListener(mTouchListener);\n }\n\n mPaymentSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n String selectedPayment = (String)parent.getItemAtPosition(position);\n if(!selectedPayment.isEmpty()){\n if(selectedPayment.equals(getString(R.string.payment_cod))){\n mPaymentMode = clientContract.ClientInfo.PAYMENT_COD; // COD = 1\n }else{\n\n mPaymentMode = clientContract.ClientInfo.PAYMENT_ONLINE; // ONLINE = 0\n }\n }\n }\n\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n\n }\n });\n\n }", "void loadSpinner(Spinner sp){\n List<String> spinnerArray = new ArrayList<>();\n spinnerArray.add(\"Oui\");\n spinnerArray.add(\"Non\");\n\n// (3) create an adapter from the list\n ArrayAdapter<String> adapter = new ArrayAdapter<String>(\n this,\n android.R.layout.simple_spinner_item,\n spinnerArray\n );\n\n//adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n\n// (4) set the adapter on the spinner\n sp.setAdapter(adapter);\n\n }", "@Override\n public void onItemSelected(MaterialSpinner view, int position, long id, Object item) {\n\n if(item.equals(\"Other\")){\n othereditText.setVisibility(View.VISIBLE);\n serviceSelected = othereditText.getText().toString().trim();\n }else{\n serviceSelected = item+\"\";\n }\n }", "@Override\n\t\t\t\t\tpublic void onItemSelected(AdapterView<?> arg0, View arg1,\n\t\t\t\t\t\t\tint arg2, long arg3) {\n\t\t\t\t\t\tint position = gameSpinner.getSelectedItemPosition();\n\t\t\t\t\t\tif (macGames[+position] != \"-- Choose sport --\") {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/*Toast.makeText(getApplicationContext(),\n\t\t\t\t\t\t\t\t\t\"You have selected \" + macGames[+position],\n\t\t\t\t\t\t\t\t\tToast.LENGTH_LONG).show();*/\n\t\t\t\t\t\t\tchosenGame = macGames[+position];\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n\n quanHuyens = sqLite_quanHuyen.getDSQH(arrTinhTP.get(position).getId());\n adapterRecyclerViewChonQuan = new AdapterRecyclerViewChonQuan(quanHuyens, getApplicationContext());\n recycleQH.setAdapter(adapterRecyclerViewChonQuan);\n\n //spinnerQuanHuyen_adapter = new SpinnerQuanHuyen_Adapter(getApplicationContext(), arrQuanHuyen);\n //spinnerQuanHuyen_adapter.notifyDataSetChanged();\n //spinnerQuanHuyen.setAdapter(spinnerQuanHuyen_adapter);\n\n }", "@Override\n public void onItemSelected(AdapterView<?> adapterView, View view,\n int position, long id) {\n //So this code is called when ever the spinner is clicked\n //Brug position til at populate editQty med indhold fra QtySpinner\n editQty.setText(\"\");\n editQty.clearFocus();\n }", "private void cargarSpinner() {\n\n admin = new AdminSQLiteOpenHelper(this, \"activo_fijo\", null, 1);\n BaseDeDatos = admin.getReadableDatabase();\n\n List<String> opciones = new ArrayList<String>();\n opciones.add(\"Selecciona una opción\");\n\n String selectQuery = \"SELECT * FROM sucursales\" ;\n Cursor cursor = BaseDeDatos.rawQuery(selectQuery, null);\n\n // looping through all rows and adding to list\n if (cursor.moveToFirst()) {\n do {\n // adding to tags list\n opciones.add(cursor.getString(cursor.getColumnIndex(\"local\")));\n } while (cursor.moveToNext());\n }\n\n BaseDeDatos.close();\n\n //spiner personalizado\n ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, opciones);\n spinner.setAdapter(adapter);\n\n }", "public void onItemSelected(Long id);", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n SpinnerValue = (String)spinner.getSelectedItem();\n }", "public void addListenerOnButton() {\n\n isempleado = (Spinner) findViewById(R.id.spinnerWifi);\n spinner2 = (Spinner) findViewById(R.id.spinner2);\n\n\n Toast.makeText(getApplicationContext(), \"Spinner 1 \"+String.valueOf(isempleado.getSelectedItem()) +\n \"Spinner 2 : \"+ String.valueOf(spinner2.getSelectedItem()), Toast.LENGTH_LONG).show();\n\n\n }", "@Override\n\t\t\tpublic void onItemSelected(AdapterView<?> parent, View view,\n\t\t\t\t\tint position, long id) {\n\t\t\t}", "@Override\n\t\t\t\tpublic void onItemSelected(AdapterView<?> arg0, View arg1,\n\t\t\t\t\t\tint arg2, long arg3) {\n\t\t\t\t\tprefs.edit().putInt(\"CHOOSE\",(int)choose.getSelectedItemId()).commit();\n\n\t\t\t\t\tif(choose.getSelectedItemId()==0)\n\t\t \t\t\tcontacts.setVisibility(View.GONE);\n\t\t\t\t\telse \n\t\t \t\t\tcontacts.setVisibility(View.VISIBLE);\n\t\t\t\t}", "@Override\n public void onClick(DialogInterface dialogInterface, int i) {\n district = input_add_new_district.getText().toString();\n\n db_table_result_rows_list.remove(0);\n db_table_result_rows_list.add(district);\n\n ArrayAdapter<String> spinnerArrayAdapterDistrict = new ArrayAdapter<String>(AddNewLocation.this.getApplicationContext(), android.R.layout.simple_spinner_item, db_table_result_rows_list);\n spinnerArrayAdapterDistrict.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); // The drop down view\n districtsSpinner.setAdapter(spinnerArrayAdapterDistrict);\n\n districtsSpinner.setSelection(((ArrayAdapter<String>)districtsSpinner.getAdapter()).getPosition(district));\n\n }", "public void onItemSelected(AdapterView<?> adapterView, \n\t\t View view, int i, long l) {\n\t\t \tString selected2 = colorGraySpin.getSelectedItem().toString();\n\t\t\t Toast.makeText(PainActivity.this,\"You Selected : \"\n\t\t\t + selected2,Toast.LENGTH_SHORT).show(); \n\t\t if (selected2.equals(\"Colorscale\")) {\n\t\t \t setColorBrush(false);\n\t\t } else{\n\t\t \t setColorBrush(true);\n\t\t }\n\t\t \t\n\t\t }", "@Override\r\n\t\t\tpublic void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {\n\t\t\t\thasilSpinJurusan = parent.getItemAtPosition(pos).toString();\r\n\t\t\t\tString[] parts = hasilSpinJurusan.split(\"--\");\r\n\t\t\t\tString kode = parts[0];\r\n\t\t\t\tkodeJurusan=kode;\r\n\t\t\t}", "@Override\r\n public void onItemChosen(View labelledSpinner, AdapterView<?> adapterView, View itemView, int position, long id) {\r\n String selectedText = adapterView.getItemAtPosition(position).toString();\r\n switch (labelledSpinner.getId()) {\r\n case R.id.spinner_planets:\r\n //Toast.makeText(getActivity(), \"Selected: \" + selectedText, Toast.LENGTH_SHORT).show();\r\n selectTextSpinner = selectedText;\r\n break;\r\n // If you have multiple LabelledSpinners, you can add more cases here\r\n }\r\n }", "@Override\n public void onItemSelected(AdapterView<?> arg0, View arg1,\n int arg2, long arg3) {\n String mselection = mSpinner.getSelectedItem().toString();\n Toast.makeText(getApplicationContext(), \"selected \" + mselection, 30).show();\n /**** do your code*****/\n\n if (mselection.equals(\"New Location\")){\n Intent i = new Intent(getApplicationContext(), NewLocation.class);\n startActivity(i);\n }\n }", "public void onItemSelected(AdapterView<?> parent, View view, \r\n int pos, long id) {\n\t\tString word = (String) parent.getItemAtPosition(pos);\r\n\t\tif (!word.equalsIgnoreCase(\"select a word from this list\")) {\r\n\t\t\tToast.makeText(this, \"You selected \\\"\" + parent.getItemAtPosition(pos) + \"\\\" from the Spinner\", Toast.LENGTH_LONG).show();\r\n\t\t}\r\n }", "@Override\n public void onItemSelected(View view, int position) {\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n if (position != mHoldTypeSelection) {\n setActionSpinner(false, position);\n }\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view,\n int position, long id) {\n if (syrupM1.getSelectedItemPosition() < 1 || syrupE3.getSelectedItemPosition() < 1 || syrupN4.getSelectedItemPosition() < 1) {\n syrupM1.setSelection(syrupA2.getSelectedItemPosition());\n syrupE3.setSelection(syrupA2.getSelectedItemPosition());\n syrupN4.setSelection(syrupA2.getSelectedItemPosition());\n }\n }", "public void addItemsOnSpinner2() {\n }", "private void preencheSpinner(){\n List<String> listaParentes = new ArrayList<String>();\n\n listaParentes.add(getString(R.string.selecioneParentesco));\n\n listaParentes.add(getString(R.string.pai));\n listaParentes.add(getString(R.string.mae));\n listaParentes.add(getString(R.string.esposoa));\n listaParentes.add(getString(R.string.filhoa));\n\n listaParentes.add(getString(R.string.neto));\n listaParentes.add(getString(R.string.genro));\n listaParentes.add(getString(R.string.nora));\n listaParentes.add(getString(R.string.tioa));\n listaParentes.add(getString(R.string.sobrinhoa));\n listaParentes.add(getString(R.string.amigo));\n\n ArrayAdapter<String> adapteSpinner = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, listaParentes);\n adapteSpinner.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n spinnerParentesco.setAdapter(adapteSpinner);\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n item = parent.getItemAtPosition(position).toString();\n isSelected = true;\n\n // Showing selected spinner item\n //Toast.makeText(parent.getContext(), \"Selected: \" + item, Toast.LENGTH_LONG).show();\n }", "private void spinner() {\n spn_semester.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n id_database = position;\n if(spn_semester.getSelectedItemPosition() == 0){\n listadaptor1();\n }\n else if(spn_semester.getSelectedItemPosition() == 1){\n listadaptor2();\n }\n else{\n listadaptor3();\n }\n }\n\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n //Nothing\n }\n });\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view,\n int position, long id) {\n\n if (syrupA2.getSelectedItemPosition() < 1 || syrupE3.getSelectedItemPosition() < 1 || syrupN4.getSelectedItemPosition() < 1) {\n syrupA2.setSelection(syrupM1.getSelectedItemPosition());\n syrupE3.setSelection(syrupM1.getSelectedItemPosition());\n syrupN4.setSelection(syrupM1.getSelectedItemPosition());\n }\n\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view,\n int position, long id) {\n if (syrupM1.getSelectedItemPosition() < 1 || syrupA2.getSelectedItemPosition() < 1 || syrupN4.getSelectedItemPosition() < 1) {\n syrupM1.setSelection(syrupE3.getSelectedItemPosition());\n syrupA2.setSelection(syrupE3.getSelectedItemPosition());\n syrupN4.setSelection(syrupE3.getSelectedItemPosition());\n }\n }", "@Override\n\t\t\tpublic void onItemSelected(AdapterView<?> arg0, View arg1,\n\t\t\t\t\tint position, long arg3) {\n\t\t\t\tif (position == 1) {\n\t\t\t\t\t// show it\n\t\t\t\t\tsubjectSpinner.setVisibility(View.VISIBLE);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// hide it\n\t\t\t\t\tsubjectSpinner.setVisibility(View.GONE);\n\t\t\t\t}\n\t\t\t}", "@Override\n public void onClick(DialogInterface dialogInterface, int i) {\n district = input_add_new_district.getText().toString();\n\n db_table_result_rows_list.remove(0);\n db_table_result_rows_list.add(district);\n\n ArrayAdapter<String> spinnerArrayAdapterDistrict = new ArrayAdapter<String>(AddNewLocation.this.getApplicationContext(), android.R.layout.simple_spinner_item, db_table_result_rows_list);\n spinnerArrayAdapterDistrict.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); // The drop down view\n districtsSpinner.setAdapter(spinnerArrayAdapterDistrict);\n\n districtsSpinner.setSelection(((ArrayAdapter<String>)districtsSpinner.getAdapter()).getPosition(district));\n\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view,\n int position, long id) {\n if (syrupM1.getSelectedItemPosition() < 1 && syrupA2.getSelectedItemPosition() < 1 && syrupE3.getSelectedItemPosition() < 1) {\n syrupM1.setSelection(syrupN4.getSelectedItemPosition());\n syrupA2.setSelection(syrupN4.getSelectedItemPosition());\n syrupE3.setSelection(syrupN4.getSelectedItemPosition());\n }\n }", "private void setActionSpinner(boolean isClickAction, int pos) {\n Spinner actionSpinner, typeSpinner;\n\n if (isClickAction) {\n actionSpinner = mClickActionSpinner;\n typeSpinner = mClickActionTypeSpinner;\n mClickTypeSelection = pos;\n } else {\n actionSpinner = mHoldActionSpinner;\n typeSpinner = mHoldActionTypeSpinner;\n mHoldTypeSelection = pos;\n }\n\n ArrayAdapter<String> actionAdapter;\n LinearLayout.LayoutParams actionParams = new LinearLayout.LayoutParams(0,\n LinearLayout.LayoutParams.WRAP_CONTENT);\n LinearLayout.LayoutParams actionTypeParams = new LinearLayout.LayoutParams(0,\n LinearLayout.LayoutParams.WRAP_CONTENT);\n actionParams.weight = 1;\n actionTypeParams.weight = 1;\n\n\n switch (pos) {\n case 0: // Action Type: None\n actionSpinner.setVisibility(View.GONE);\n actionAdapter = new ArrayAdapter<>(mContext, android.R.layout.simple_spinner_item,\n mContext.getResources().getStringArray(R.array.dialog_spinner_empty));\n actionAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);\n actionSpinner.setAdapter(actionAdapter);\n\n actionParams.weight = 0;\n actionTypeParams.weight = 2;\n actionSpinner.setLayoutParams(actionParams);\n typeSpinner.setLayoutParams(actionTypeParams);\n break;\n case 1: // Action Type: Volume\n actionSpinner.setVisibility(View.VISIBLE);\n actionAdapter = new ArrayAdapter<>(mContext, android.R.layout.simple_spinner_item,\n mContext.getResources().getStringArray(R.array.dialog_action_volume));\n actionAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);\n actionSpinner.setAdapter(actionAdapter);\n\n actionSpinner.setLayoutParams(actionParams);\n typeSpinner.setLayoutParams(actionTypeParams);\n break;\n case 2: // Action Type: Media\n actionSpinner.setVisibility(View.VISIBLE);\n actionAdapter = new ArrayAdapter<>(mContext, android.R.layout.simple_spinner_item,\n mContext.getResources().getStringArray(R.array.dialog_action_media));\n actionAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);\n actionSpinner.setAdapter(actionAdapter);\n\n actionSpinner.setLayoutParams(actionParams);\n typeSpinner.setLayoutParams(actionTypeParams);\n break;\n case 3: // Action Type: Integrated\n actionSpinner.setVisibility(View.VISIBLE);\n actionAdapter = new ArrayAdapter<>(mContext, android.R.layout.simple_spinner_item,\n mContext.getResources().getStringArray(R.array.dialog_action_integrated));\n actionAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);\n actionSpinner.setAdapter(actionAdapter);\n\n actionSpinner.setLayoutParams(actionParams);\n typeSpinner.setLayoutParams(actionTypeParams);\n break;\n case 4: // Action Type: Application\n actionSpinner.setVisibility(View.VISIBLE);\n AppListAdapter appAdapter = new AppListAdapter(mContext);\n actionSpinner.setAdapter(appAdapter);\n\n actionSpinner.setLayoutParams(actionParams);\n typeSpinner.setLayoutParams(actionTypeParams);\n break;\n case 5: // Action Type: Tasker\n actionSpinner.setVisibility(View.VISIBLE);\n if (mTaskerTasks != null) {\n actionAdapter = new ArrayAdapter<>(mContext, android.R.layout.simple_spinner_item,\n mTaskerTasks);\n } else {\n actionAdapter = new ArrayAdapter<>(mContext, android.R.layout.simple_spinner_item,\n mContext.getResources().getStringArray(R.array.dialog_spinner_empty));\n }\n actionSpinner.setAdapter(actionAdapter);\n\n actionSpinner.setLayoutParams(actionParams);\n typeSpinner.setLayoutParams(actionTypeParams);\n break;\n default:\n actionSpinner.setVisibility(View.GONE);\n actionParams.weight = 0;\n actionTypeParams.weight = 2;\n actionSpinner.setLayoutParams(actionParams);\n typeSpinner.setLayoutParams(actionTypeParams);\n break;\n }\n\n\n }", "@Override\n public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2,\n long arg3) {\n\n }", "public void onItemSelected(AdapterView<?> parent, View v, \n\t int pos, long id) {\n\t }", "@Override\n public void onItemSelected(AdapterView<?> parentView, View selectedItemView, int position, long id) {\n spnDistrict.setAdapter(C.getArrayAdapter(\"select ZIlLAID||'-'||ZILLANAMEENG DistName from Zilla where DIVID='\" + Global.Left(spnDiv.getSelectedItem().toString(), 2) + \"'\"));// Global.Left(spnDiv.getSelectedItem().toString(),2)\n spnDistrict.setSelection(DivzillaSelect(\"zilla\"));\n\n\n }", "@Override\n\t\t\t\t\t\tpublic void onItemSelected(AdapterView<?> parent,\n\t\t\t\t\t\t\t\tView view, int position, long id) {\n\t\t\t\t\t\t\tif(position!=0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tMyspinner sp = (Myspinner)mandilist.getSelectedItem();\n\t\t\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\t\t\tencryptedgeoid = new Webservicerequest().Encrypt(sp.getValue());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcatch(Exception e){\n\t\t\t\t\t\t\t\t\te.getMessage();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcategory3.addAll(get.getretailersList(encryptedgeoid));\t\n\t\t\t\t\t\t\t\tMyspinner[] redemo3 = new Myspinner[category3.size()];\n\t\t\t\t \t\t\t\tfor(int i=0; i<category3.size(); i++){\n\t\t\t\t \t\t\t\t\tredemo3[i] = new Myspinner(category3.get(i).get(\"2\"), category3.get(i).get(\"1\"), \"\");\n\t\t\t\t \t\t\t\t}\n\t\t\t\t \t\t\t\tArrayAdapter<Myspinner> adapter3 = new ArrayAdapter<Myspinner>(context, android.R.layout.simple_spinner_dropdown_item, redemo3);\n\t\t\t\t \t\t\t\tretailerslist.setAdapter(adapter3);\n\t\t\t\t\t\t\t\tArrayAdapter<String> adaptervillages = new ArrayAdapter<String>(context, android.R.layout.simple_spinner_dropdown_item, get.getVillageNames(encryptedgeoid));\n\t\t\t\t\t\t\t\tvillages.setAdapter(adaptervillages);\n\t\t\t\t\t\t\t\tvillages.setThreshold(3);\n\t\t\t\t\t\t\t\tvillages.setOnItemClickListener(new OnItemClickListener() {\n\n\t\t\t\t\t\t\t\t\t @Override\n\t\t\t\t\t\t\t\t\t public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\t\t\t\t\t\t\t\t\t InputMethodManager in = (InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE);\n\t\t\t\t\t\t\t\t\t in.hideSoftInputFromWindow(villages.getWindowToken(), 0);\n\n\t\t\t\t\t\t\t\t\t }\n\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\telse{\n\t\t\t\t\t\t\t\tvillages.setAdapter(null);\n\t\t\t\t\t\t\t\tArrayList<HashMap<String, String>> category3=new ArrayList<HashMap<String,String>>();\n\t\t\t\t\t\t\t\tHashMap<String, String> map3=new HashMap<String, String>();\n\t\t\t\t \t\t\t\tmap3.put(\"1\",\"\");\n\t\t\t\t \t\t\t\tmap3.put(\"2\",\"Select Retailer\");\n\t\t\t\t \t\t\t\tcategory3.add(map3);\n\t\t\t\t \t\t\t\tMyspinner[] redemo3 = new Myspinner[category3.size()];\n\t\t\t\t \t\t\t\tfor(int i=0; i<category3.size(); i++){\n\t\t\t\t \t\t\t\t\tredemo3[i] = new Myspinner(category3.get(i).get(\"2\"), category3.get(i).get(\"1\"), \"\");\n\t\t\t\t \t\t\t\t}\n\t\t\t\t \t\t\t\tArrayAdapter<Myspinner> adapter3 = new ArrayAdapter<Myspinner>(context, android.R.layout.simple_spinner_dropdown_item, redemo3);\n\t\t\t\t \t\t\t\tretailerslist.setAdapter(adapter3); \t\t\t\t \t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}", "@Override\n\t\tpublic void onItemSelected(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\tlong arg3) {\n\t\t\t\n\t\t}", "private void select(JSpinner spinner) {\n/* 194 */ JComponent editor = spinner.getEditor();\n/* */ \n/* 196 */ if (editor instanceof JSpinner.DateEditor) {\n/* */ \n/* 198 */ JSpinner.DateEditor dateEditor = (JSpinner.DateEditor)editor;\n/* 199 */ JFormattedTextField ftf = dateEditor.getTextField();\n/* 200 */ Format format = dateEditor.getFormat();\n/* */ \n/* */ Object value;\n/* 203 */ if (format != null && (value = spinner.getValue()) != null) {\n/* */ \n/* 205 */ SpinnerDateModel model = dateEditor.getModel();\n/* 206 */ DateFormat.Field field = DateFormat.Field.ofCalendarField(model.getCalendarField());\n/* */ \n/* 208 */ if (field != null) {\n/* */ \n/* */ try {\n/* */ \n/* 212 */ AttributedCharacterIterator iterator = format.formatToCharacterIterator(value);\n/* 213 */ if (!select(ftf, iterator, field) && field == DateFormat.Field.HOUR0)\n/* */ {\n/* 215 */ select(ftf, iterator, DateFormat.Field.HOUR1);\n/* */ }\n/* 217 */ } catch (IllegalArgumentException iae) {}\n/* */ }\n/* */ } \n/* */ } \n/* */ }", "@Override\n\t\t\tpublic void onItemSelected(AdapterView<?> parent, View view,\n\t\t\t\t\t\t\t\t\t int position, long id) {\n\t\t\t\tif (mSpinner.getSelectedItemPosition() >= str1.length) {\n\t\t\t\t\tmDesTextView.setVisibility(View.VISIBLE);\n//\t\t\t\t\tToast toast = Toast.makeText(MainActivity.this, \"长按此项可删除\",\n//\t\t\t\t\t\t\t2000);\n//\t\t\t\t\ttoast.setGravity(Gravity.TOP, 0, 150);\n//\t\t\t\t\ttoast.show();\n\t\t\t\t}else {\n\t\t\t\t\tmDesTextView.setVisibility(View.GONE);\n\t\t\t\t}\n\t\t\t\tif (!mIsBack) {\n\t\t\t\t\turl = map.get(mSpinner.getSelectedItem());\n\t\t\t\t\tif (url != null)\n\t\t\t\t\t\tmWebView.loadUrl(url);\n\t\t\t\t\telse {\n\n\t\t\t\t\t}\n\t\t\t\t\tif (mIsDelete) {\n\t\t\t\t\t\tlistSpinnerPosition.remove(listSpinnerPosition.size() - 1);\n\t\t\t\t\t\tlistSpinnerText.remove(listSpinnerText.size() - 1);\n\n\t\t\t\t\t}\n\t\t\t\t\tlistSpinnerText.add(mSpinner.getSelectedItem().toString());\n\t\t\t\t\tlistSpinnerPosition.add(mSpinner.getSelectedItemPosition());\n\t\t\t\t\tautoScrollTextView.setText(mSpinner.getSelectedItem()\n\t\t\t\t\t\t\t.toString());\n\t\t\t\t\tautoScrollTextView.init(getWindowManager());\n\t\t\t\t\tautoScrollTextView.startScroll();\n\t\t\t\t}\n\t\t\t\tmIsBack = false;\n\t\t\t\tmIsDelete = false;\n\t\t\t}", "public void onItemSelected(AdapterView<?> parent, View view, int position,\n long id) {\n nama_pasien2 = parent.getItemAtPosition(position).toString();\n\n // Showing selected spinner item\n Toast.makeText(parent.getContext(), \"You selected: \" + nama_pasien2,\n Toast.LENGTH_LONG).show();\n\n }", "public void spinner() {\n /**\n * calls if the tasks was weekly, if not, it will be automatically set to \"once\"\n */\n if(weekly) {\n String[] items = new String[]{activity.getResources().getString(R.string.sunday), activity.getResources().getString(R.string.monday), activity.getResources().getString(R.string.tuesday), activity.getResources().getString(R.string.wednesday), activity.getResources().getString(R.string.thursday), activity.getResources().getString(R.string.friday), activity.getResources().getString(R.string.saturday)};\n ArrayAdapter<String> frequencyAdapter = new ArrayAdapter<String>(activity.getBaseContext(), android.R.layout.simple_spinner_dropdown_item, items);\n weekday.setAdapter(frequencyAdapter);\n weekday.getBackground().setColorFilter(activity.getResources().getColor(R.color.colorAccent), PorterDuff.Mode.SRC_ATOP);\n weekday.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n\n day = String.valueOf(position + 1); //chosen day is stored\n\n }\n\n\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n\n }\n });\n } else {\n day = \"8\";\n weekday.setVisibility(View.GONE);\n }\n }", "@Then(\"^I choose the park on combobox$\")\n public void i_choose_the_park_on_combobox() {\n onViewWithId(R.id.spinnerParks).click();\n onViewWithText(\"Parque D\").isDisplayed();\n onViewWithText(\"Parque D\").click();\n }", "public void Iniciar(View view){\n String auditoria = txt_NomAuditoria.getText().toString().trim();\n String sucursal = spinner.getSelectedItem().toString(); //obteniendo los valores del Spinner\n\n if (auditoria.isEmpty()){\n Toast.makeText(this, \"El Nombre de la Auditoria es Requerido\", Toast.LENGTH_SHORT).show();\n }\n else{\n if (sucursal.equals(\"Selecciona una opción\")){\n Toast.makeText(this, \"Selecciona una opción\", Toast.LENGTH_SHORT).show();\n }\n else {\n Intent colectar = new Intent(this, Colectar.class);\n colectar.putExtra(\"auditoria\", auditoria);\n colectar.putExtra(\"sucursal\", sucursal);\n startActivity(colectar);\n finish();\n }\n }\n }", "@Override\r\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n switch (position) {\r\n case 0:\r\n mode = 1;\r\n //mode = spinner.getSelectedItem().toString();\r\n break;\r\n case 1:\r\n mode = 2;\r\n //mode = spinner.getSelectedItem().toString();\r\n break;\r\n case 2:\r\n mode = 3;\r\n //mode = spinner.getSelectedItem().toString();\r\n break;\r\n }\r\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n String item = (String) parent.getItemAtPosition(position);\n selectedSports = item;\n Log.d(\"testing Spinner\", \"Spinner item selected is: \" + selectedSports + \" \" + item.toString());\n }", "@Override\n public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {\n id = i;\n }", "@RequiresApi(api = Build.VERSION_CODES.M)\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n TextView selectedItemTV = (TextView) parent.getSelectedView();\n if(selectedItemTV != null)\n selectedItemTV.setTextAppearance(R.style.SpinnerSelectedItem);\n }", "@Override\n public void onIndicatorSelected(int index) {\n setSelect(index);\n }", "public void onClickSifIVSpinner(View view){\n sifIncidentTypeSpinner.performClick();\n }", "@Override\n public void onNothingSelected(AdapterView<?> parent) {\n choice=0;\n }", "@Override\n public void onItemSelected(AdapterView<?> adapterView,\n View view, int i, long l) {\n mSpinnerLabel = adapterView.getItemAtPosition(i).toString();\n showText(view);\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position,\n long id) {\n nama_dokter2 = parent.getItemAtPosition(position).toString();\n\n // Showing selected spinner item\n Toast.makeText(parent.getContext(), \"You selected: \" + nama_dokter2,\n Toast.LENGTH_LONG).show();\n\n }", "@Override\n public void onItemSelected(AdapterView<?> parent2, View view2, int position2, long id2) {\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view,\n int position, long id) {\n\n\n try{\n String s = \"\";\n Log.e(\"mytag\",\"(String) parent.getItemAtPosition(position):\"+(String) parent.getItemAtPosition(position).toString().trim());\n if (parent.getItemAtPosition(position).toString().trim().equals(\"בחר\")){\n s = \"-1\";\n }else{\n s = String.valueOf(ctype_map.get(parent.getItemAtPosition(position).toString().trim()).getCtypeID());\n }\n setCcustomerSpinner(s);\n }catch(Exception e){\n helper.LogPrintExStackTrace(e);\n }\n Log.e(\"mytag\", (String) parent.getItemAtPosition(position));\n //statusID = db.getCallStatusByCallStatusName((String) parent.getItemAtPosition(position)).getCallStatusID();\n //statusName = db.getCallStatusByCallStatusName((String) parent.getItemAtPosition(position)).getCallStatusName();\n //Toast.makeText(getApplication(), \"status: \" + s, Toast.LENGTH_LONG).show();\n //Log.v(\"item\", (String) parent.getItemAtPosition(position));\n }", "private void setupSpinner() {\n // Create adapter for spinner. The list options are from the String array it will use\n // the spinner will use the default layout\n ArrayAdapter fruitSpinnerAdapter = ArrayAdapter.createFromResource(this,\n R.array.array_fruit_options, android.R.layout.simple_spinner_item);\n\n // Specify dropdown layout style - simple list view with 1 item per line\n fruitSpinnerAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);\n\n // Apply the adapter to the spinner\n mTypeSpinner.setAdapter(fruitSpinnerAdapter);\n\n // Set the integer mSelected to the constant values\n mTypeSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n String selection = (String) parent.getItemAtPosition(position);\n if (!TextUtils.isEmpty(selection)) {\n if (selection.equals(getString(R.string.apple))) {\n mFruit = FruitEntry.TYPE_APPLE;\n } else if (selection.equals(getString(R.string.banana))) {\n mFruit = FruitEntry.TYPE_BANANA;\n } else if (selection.equals(getString(R.string.peach))) {\n mFruit = FruitEntry.TYPE_PEACH;\n } else if (selection.equals(getString(R.string.pineapple))) {\n mFruit = FruitEntry.TYPE_PINEAPPLE;\n } else if (selection.equals(getString(R.string.strawberry))) {\n mFruit = FruitEntry.TYPE_STRAWBERRY;\n } else if (selection.equals(getString(R.string.watermelon))) {\n mFruit = FruitEntry.TYPE_WATERMELON;\n } else {\n mFruit = FruitEntry.TYPE_NOTSELECTED;\n }\n }\n }\n\n // Because AdapterView is an abstract class, onNothingSelected must be defined\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n mFruit = FruitEntry.TYPE_NOTSELECTED;\n }\n });\n }", "public void onItemSelected(AdapterView<?> parent, android.view.View v, int position, long id) {\n // Log.d(TAGLOG, \"----------------------- pasando7---------------\" + datosCorreos.size());\n correo = parent.getItemAtPosition(position).toString();\n txtEmail3.setText(miTab + \" de \" + correo);\n // Log.d(TAGLOG, \"----------------------- pasando8---------------\" + datosCorreos.size());\n switch (spCorreo.getSelectedItemPosition()) {\n case 0:\n //si se selecciona todos, oculta el boton enviar\n enviar3.setVisibility(View.GONE);\n // Toast.makeText(getApplicationContext(), \"todos seleccionados \"+spCorreo.getSelectedItemPosition(), Toast.LENGTH_LONG).show();\n break;\n default:\n //por defecto muestra el boton enviar\n enviar3.setVisibility(View.VISIBLE);\n // Toast.makeText(getApplicationContext(), \"otros seleccionados \"+spCorreo.getSelectedItemPosition(), Toast.LENGTH_LONG).show();\n break;\n }\n Log.d(TAGLOG, \"----------------------- pasando9---------------\" + datosCorreos.size());\n //llama a muestra mensaje con el correo seleccionado a mostrar o con \"todos\" si no se ha seleccionado ninguno\n //muestraMensajes(correo, miTab);\n DBmensajes conn = new DBmensajes(miTab);\n conn.listaMensajes(correo, miTab);\n\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n item = parent.getItemAtPosition(position).toString();\n //beaconselected.setText(item);\n\n // Showing selected spinner item\n if(!item.equals(\"select a beacon\")){\n //Toast.makeText(parent.getContext(), \"Selected: \" + item, Toast.LENGTH_LONG).show();\n x++;\n beaconManager.stopRanging(beaconRegion);\n t=0;\n //Toast.makeText(this, \"Search stopped\", Toast.LENGTH_SHORT).show();\n }\n\n\n\n }", "@Override\n public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {\n brand_id = String.valueOf(brand_list.get(i).getBrandId());\n brandName = brand_list.get(i).getBrand_name();\n\n Log.d(\"fsdklj\", brand_id + brandName);\n\n hitSpinnerSeries(brand_id);\n\n }", "public void initSpinner() {\n }" ]
[ "0.7216106", "0.7055917", "0.6980246", "0.6952659", "0.69339573", "0.69018525", "0.68943775", "0.68901354", "0.6859379", "0.6859379", "0.6835287", "0.67905706", "0.6774842", "0.6774842", "0.6765767", "0.67525166", "0.67330164", "0.67330164", "0.6728821", "0.67252064", "0.67158794", "0.6713561", "0.6713561", "0.6713561", "0.67088354", "0.6702391", "0.6690788", "0.6681861", "0.6681646", "0.66664124", "0.6657066", "0.6652012", "0.66426086", "0.6622306", "0.661277", "0.661277", "0.661277", "0.661277", "0.661277", "0.6610306", "0.660495", "0.6601058", "0.65741843", "0.6561526", "0.65531284", "0.65475607", "0.6542195", "0.6538788", "0.6536359", "0.65200967", "0.65189224", "0.65090007", "0.65005326", "0.64971715", "0.649611", "0.64890987", "0.6485076", "0.64813375", "0.6480373", "0.64782476", "0.6474587", "0.64706147", "0.6469179", "0.64664584", "0.6462499", "0.64482445", "0.6445285", "0.64439774", "0.6431765", "0.64281636", "0.6425422", "0.6415234", "0.64119077", "0.64095306", "0.6400369", "0.63587034", "0.6355894", "0.63449186", "0.6329016", "0.63247925", "0.6324022", "0.6322482", "0.6320648", "0.63194454", "0.6317882", "0.6317173", "0.630962", "0.6302444", "0.62883884", "0.62793595", "0.62647504", "0.62609035", "0.6252195", "0.6243432", "0.62275314", "0.62245834", "0.6215861", "0.6208561", "0.6199864", "0.61939" ]
0.6677492
29
TODO: Rename method, update argument and hook method into UI event
public void onButtonPressed(Uri uri) { if (mListener != null) { mListener.onFragmentInteraction(uri); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t\t}", "@Override\n\t\t\t\tpublic void handle(ActionEvent event) {\n\n\t\t\t\t}", "@Override\n\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t}", "public abstract void update(UIReader event);", "@Override\r\n\t\t\tpublic void handle(ActionEvent arg0) {\n\t\t\t}", "@Override\n\tpublic void handle(ActionEvent event) {\n\t\t\n\t}", "@Override\n\tpublic void handle(ActionEvent event) {\n\n\t}", "@Override\n\tpublic void handleUpdateUI(String text, int code) {\n\t\t\n\t}", "@Override\n\tpublic void update(Event e) {\n\t}", "public abstract void onInvoked(CommandSender sender, String[] args);", "@Override\r\n public void updateUI() {\r\n }", "@Override\r\n\tpublic void handle(ActionEvent arg0) {\n\t\t\r\n\t}", "@Override\n\tprotected void UpdateUI() {\n\t\t\n\t}", "@Override\n\tprotected void UpdateUI() {\n\t\t\n\t}", "@Override\n\tpublic void processEvent(Event e) {\n\n\t}", "@Override\n\t\t\tpublic void handleEvent(Event event) {\n\t\t\t\t \n\t\t\t}", "@Override\n\t\t\tpublic void handleEvent(Event event) {\n\t\t\t\t \n\t\t\t}", "@Override\n\tpublic void processCommand(JMVCommandEvent arg0) {\n\t}", "@Override\n\tpublic void inputChanged( Viewer arg0, Object arg1, Object arg2 ) {\n\t}", "@Override\n\tpublic void handleEvent(Event arg0) {\n\t\t\n\t}", "@Override\r\n\tpublic void onCustomUpdate() {\n\t\t\r\n\t}", "public void updateUI(){}", "private synchronized void updateScreen(String arg){\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n setChanged();\n notifyObservers(arg);\n }\n });\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\n\t\t\t}", "@Override\r\n public void actionPerformed( ActionEvent e )\r\n {\n }", "@Override\n\t\t\tpublic void handleEvent(Event event) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void handleEvent(Event event) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void handleEvent(Event event) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void handleEvent(Event event) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void handleEvent(Event event) {\n\n\t\t\t}", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\tpublic void updateObjectListener(ActionEvent e) {\n\t\t\r\n\t}", "Event () {\n // Nothing to do here.\n }", "void onArgumentsChanged();", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void handleEvent(Event event) {\n\t\t\t}", "@Override\n\t\t\tpublic void handleEvent(Event event) {\n\t\t\t}", "@Override\n\t\t\tpublic void handleEvent(Event event) {\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t}", "void eventChanged();", "@Override\r\n\t\t\tpublic void execute(LiftEvent e) {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void execute(LiftEvent e) {\n\t\t\t\t\r\n\t\t\t}", "@Override public void handle(ActionEvent e)\n\t {\n\t }", "@Override\r\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\r\n\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}", "@Override //se repita\r\n public void actionPerformed(ActionEvent ae) {\r\n \r\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\n\t\t\t}", "public abstract CommandResponse onCommand(CommandSender sender, String label, String[] args);", "@Override\n public void actionPerformed(ActionEvent actionEvent) {\n }", "@Override\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t}", "@Override\r\n public void actionPerformed(ActionEvent e) {\n \r\n }", "public abstract void onCommand(MessageEvent context) throws Exception;", "@Override\r\n\tpublic void onEvent(Event arg0) {\n\r\n\t}", "private void addParameterEventHandler(){\n\t\t\n\t\tgetParameterNameListBox().addDoubleClickHandler(new DoubleClickHandler() {\n\t\t\t@Override\n\t\t\tpublic void onDoubleClick(DoubleClickEvent event) {\n\t\t\t\tparameterAceEditor.clearAnnotations();\n\t\t\t\tparameterAceEditor.removeAllMarkers();\n\t\t\t\tparameterAceEditor.redisplay();\n\t\t\t\tSystem.out.println(\"In addParameterEventHandler on DoubleClick isPageDirty = \" + getIsPageDirty() + \" selectedIndex = \" + getParameterNameListBox().getSelectedIndex());\n\t\t\t\tsetIsDoubleClick(true);\n\t\t\t\tsetIsNavBarClick(false);\n\t\t\t\tif (getIsPageDirty()) {\n\t\t\t\t\tshowUnsavedChangesWarning();\n\t\t\t\t} else {\n\t\t\t\t\tint selectedIndex = getParameterNameListBox().getSelectedIndex();\n\t\t\t\t\tif (selectedIndex != -1) {\n\t\t\t\t\t\tfinal String selectedParamID = getParameterNameListBox().getValue(selectedIndex);\n\t\t\t\t\t\tcurrentSelectedParamerterObjId = selectedParamID;\n\t\t\t\t\t\tif(getParameterMap().get(selectedParamID) != null){\n\t\t\t\t\t\t\tgetParameterNameTxtArea().setText(getParameterMap().get(selectedParamID).getParameterName());\n\t\t\t\t\t\t\tgetParameterAceEditor().setText(getParameterMap().get(selectedParamID).getParameterLogic());\n\t\t\t\t\t\t\tSystem.out.println(\"In Parameter DoubleClickHandler, doing setText()\");\n\t\t\t\t\t\t\t//disable parameterName and Logic fields for Default Parameter\n\t\t\t\t\t\t\tboolean isReadOnly = getParameterMap().get(selectedParamID).isReadOnly();\n\t\t\t\t\t\t\tgetParameterButtonBar().getDeleteButton().setTitle(\"Delete\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(MatContext.get().getMeasureLockService()\n\t\t\t\t\t\t\t\t\t.checkForEditPermission()){\n\t\t\t\t\t\t\t\tsetParameterWidgetReadOnly(!isReadOnly);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// load most recent used cql artifacts\n\t\t\t\t\t\t\tMatContext.get().getMeasureService().getUsedCQLArtifacts(MatContext.get().getCurrentMeasureId(), new AsyncCallback<GetUsedCQLArtifactsResult>() {\n\n\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\t\t\t\t\t\tWindow.alert(MatContext.get().getMessageDelegate().getGenericErrorMessage());\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\t@Override\n\t\t\t\t\t\t\t\tpublic void onSuccess(GetUsedCQLArtifactsResult result) {\n\t\t\t\t\t\t\t\t\tif(result.getUsedCQLParameters().contains(getParameterMap().get(selectedParamID).getParameterName())) {\n\t\t\t\t\t\t\t\t\t\tgetParameterButtonBar().getDeleteButton().setEnabled(false);\n\t\t\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\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\tsuccessMessageAlert.clearAlert();\n\t\t\t\t\terrorMessageAlert.clearAlert();\n\t\t\t\t\twarningMessageAlert.clearAlert();\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t}", "@Override\n public void handle(Event event) {\n }", "@Override\n\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\n\t\t}", "@Override\n public void actionPerformed(AnActionEvent e) {\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n \n }", "@Override\n public void actionPerformed(ActionEvent e) {\n \n }", "@Override\n public void actionPerformed(ActionEvent e) {\n \n }", "@Override\n public void actionPerformed(ActionEvent e) {\n \n }", "@Override\r\n\tpublic void handleEvent(Event event) {\n\r\n\t}", "public void ImageView(ActionEvent event) {\n\t}", "@Override\n public void updateUi() {\n\n }", "@Override\n public void updateUi() {\n\n }", "@Override\n public void updateUi() {\n\n }", "@Override\n\t\t\t\t\t\tpublic void mouseDown(MouseEvent arg0) {\n\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void mouseDown(MouseEvent arg0) {\n\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void mouseDown(MouseEvent arg0) {\n\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void mouseDown(MouseEvent arg0) {\n\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void mouseDown(MouseEvent arg0) {\n\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void mouseDown(MouseEvent arg0) {\n\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void mouseDown(MouseEvent arg0) {\n\n\t\t\t\t\t\t}", "public void runInUi(ElexisEvent ev){}", "@Override\n public void delta() {\n \n }", "@Override\n\tpublic void onClick(ClickEvent arg0) {\n\t\t\n\t}", "@Override\n public void actionPerformed(ActionEvent e) {\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n }", "@Override\n\tprotected void OnClick() {\n\t\t\n\t}", "@Override\n public void actionPerformed(ActionEvent ev) {\n }", "@Override\n public void actionPerformed(ActionEvent e)\n {\n \n }", "@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\r\n\t}", "@Override\n public void update(Observable o, Object arg)\n {\n \n }", "@Override\n public void actionPerformed(ActionEvent e) {\n\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tupdate();\n\t\t\t}", "@Override\r\n public void processEvent(IAEvent e) {\n\r\n }" ]
[ "0.6619185", "0.65246344", "0.6473144", "0.6473144", "0.64351684", "0.6325494", "0.62368196", "0.6189416", "0.6158721", "0.61455715", "0.6123594", "0.6107332", "0.6101038", "0.6092755", "0.6049496", "0.6049496", "0.60442764", "0.604003", "0.604003", "0.6007846", "0.59999037", "0.59848183", "0.59776366", "0.59587413", "0.5940049", "0.5925668", "0.5925668", "0.59208333", "0.5915737", "0.5915737", "0.5915737", "0.5915737", "0.5915737", "0.5915554", "0.5909643", "0.5895144", "0.58947057", "0.589277", "0.58885247", "0.58885247", "0.58885247", "0.58671176", "0.58671176", "0.58671176", "0.58636886", "0.5862447", "0.5862447", "0.58613557", "0.5855828", "0.5846504", "0.5846504", "0.5846504", "0.5846504", "0.5837475", "0.58366984", "0.5820788", "0.58068436", "0.58022934", "0.5772422", "0.57714665", "0.5770862", "0.5765655", "0.5763872", "0.57544947", "0.57542855", "0.57542855", "0.57450074", "0.57441026", "0.57441026", "0.57441026", "0.5741053", "0.574037", "0.5739314", "0.57367086", "0.57367086", "0.57367086", "0.57322264", "0.57322264", "0.57322264", "0.57322264", "0.57322264", "0.57322264", "0.57322264", "0.57235956", "0.57232994", "0.5721006", "0.571978", "0.571978", "0.57187414", "0.57177836", "0.57133436", "0.57110935", "0.57110935", "0.57110935", "0.57110935", "0.57110935", "0.57110935", "0.5707859", "0.5707546", "0.5704973", "0.57016516" ]
0.0
-1
This interface must be implemented by activities that contain this fragment to allow an interaction in this fragment to be communicated to the activity and potentially other fragments contained in that activity. See the Android Training lesson Communicating with Other Fragments for more information.
public interface OnFragmentInteractionListener { // TODO: Update argument type and name void onFragmentInteraction(Uri uri); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface OnFragmentInteractionListener {\n void onFragmentMessage(String TAG, Object data);\n}", "public interface FragmentInteraction {\n void switchToBoardView();\n void switchToPinsView();\n void switchToPins(PDKBoard pdkBoard);\n void switchToDescription(PDKPin pin);\n}", "public interface IFragmentView {\n public Activity getActivity();\n public void onItemClick(int position);\n}", "public interface OnFragmentInteractionListener {\n void onMainFragmentInteraction(String string);\n }", "@Override\n public void onAttach(Context context) {\n super.onAttach(context);\n if (context instanceof RequestFragmentInterface) {\n mInterface = (RequestFragmentInterface) context;\n } else {\n throw new RuntimeException(context.toString()\n + \" must implement OnFragmentInteractionListener\");\n }\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n public void onCallBellPressed(MessageReason reason);\n }", "void onFragmentInteraction();", "void onFragmentInteraction();", "void onFragmentInteraction();", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n\n\n void onFragmentInteraction(String mId, String mProductName, String mItemRate, int minteger, int update);\n }", "public interface OnFragmentInteractionListener {\n public void onFragmentInteraction(String id);\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n void onFragmentInteraction();\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n public void onComidaSelected(int comidaId);\n }", "public interface OnFragmentInteractionListener {\n public void onFragmentInteraction(Qualification q);\n }", "public interface OnFragmentInteractionListener {\n void onReceiverAcceptRequest(int nextState, String requestId);\n }", "public interface FragMainLife\n{\n\tpublic void onResumeFragMainLife();\n}", "public interface OnFragmentListener {\n\n void onAction(Intent intent);\n}", "public interface IBaseFragmentActivity {\n void onFragmentExit(BaseFragment fragment);\n\n void onFragmentStartLoading(BaseFragment fragment);\n\n void onFragmentFinishLoad(BaseFragment fragment);\n}", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n void onFragmentInteraction(String string);\n }", "void onFragmentInteraction(Object ref);", "public interface OnParametersFragmentInteractionListener {\n public void startTask();\n }", "public interface OnFragmentInteractionListener {\n // Update argument type and name\n public void onFragmentInteraction(String id);\n }", "public interface OnFragmentInteractionListener {\n void onFragmentInteraction(Parcelable selectedItem);\n }", "public interface FragmentInterface {\r\n void fragmentBecameVisible();\r\n}", "public interface OnFragmentInteractionListener {\n public void onFragmentInteraction(String key);\n }", "public interface OnFragmentInteractionListener {\n void newList();\n\n void searchList();\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n void pasarALista();\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n\n /**\n * This interface's single method. The hosting Activity must implement this interface and\n * provide an implementation of this method so that this Fragment can communicate with the\n * Activity.\n *\n * @param spotId\n */\n// void onFragmentInteraction(Uri uri);\n void onFragmentInteraction(int spotId);\n// void onFragmentInteraction(LatLng spotPosition);\n\n }", "public interface MainGameActivityCallBacks {\n public void onMsgFromFragmentToMainGame(String sender, String strValue);\n}", "public interface IFragment {\n void onFragmentRefresh();\n\n void onMenuClick();\n}", "public interface FragmentInterface {\n\n void onCreate();\n\n void initLayout();\n\n void updateLayout();\n\n void sendInitialRequest();\n}", "public interface OnFragmentInteractionListener {\n void onFragmentInteraction(String accessToken, String network);\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n void onFragmentInteraction(View v);\n }", "public interface OnFragmentInteractionListener {\n void swapFragments(SetupActivity.SetupActivityFragmentType type);\n\n void addServer(String name, String ipAddress, String port);\n }", "public interface OnFragmentInteractionListener {\n\t\tvoid restUp(IGameState gameState);\n\t\tvoid restartGame();\n\t}", "public interface OnFragmentInteractionListener\n {\n // TODO: Update argument type and name\n public void onFragmentInteraction(String id);\n }", "public interface PersonalFragmentView extends BaseMvpView {\n\n}", "public interface OnFragmentInteractionListener {\n void onFinishCreatingRequest();\n }", "void onFragmentInteraction(View v);", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n public void onFragmentInteraction(String id);\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n public void onFragmentInteraction(String id);\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n public void onFragmentInteraction(String id);\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n public void onFragmentInteraction(String id);\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n public void onFragmentInteraction(String id);\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n public void onFragmentInteraction(String id);\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n public void onFragmentInteraction(String id);\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n public void onFragmentInteraction(String id);\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n public void onFragmentInteraction(String id);\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n void onFragmentInteraction(ArrayList<Recepie> recepieList);\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n void onFragmentInteraction(String id);\n }", "void onFragmentInteractionMain();", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n public void showRestaurantDetail(Map<String, Object> objectMap);\n\n public void showAddRestaurantFragment(String location);\n }", "public interface FragmentNavigator {\n\n void SwitchFragment(Fragment fragment);\n}", "public interface FragmentModellnt {\n void FragmentM(OnFinishListener onFinishListener,String dataId);\n}", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n //void onFragmentInteraction(Uri uri);\n }", "void onFragmentInteraction(String id);", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n void onFragmentInteraction(ArrayList naleznosci, String KLUCZ);\n }", "public interface OnFragmentInteractionListener {\r\n // TODO: Update argument type and name\r\n void onEditFragmentInteraction(Student student);\r\n }", "public interface OnFragmentInteractionListener {\n void onStartFragmentStarted();\n\n void onStartFragmentStartTracking();\n\n void onStartFragmentStopTracking();\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n Long onFragmentInteraction();\n }", "public interface OnFragmentInteractionListener {\n void onFragmentInteraction(Uri uri);\n void onFragmentInteraction(String id);\n}", "public interface IBaseFragment extends IBaseView {\n /**\n * 出栈到目标fragment\n * @param targetFragmentClass 目标fragment\n * @param includeTargetFragment 是否包涵目标fragment\n * true 目标fragment也出栈\n * false 出栈到目标fragment,目标fragment不出栈\n */\n void popToFragment(Class<?> targetFragmentClass, boolean includeTargetFragment);\n\n /**\n * 跳转到新的fragment\n * @param supportFragment 新的fragment继承SupportFragment\n */\n void startNewFragment(@NonNull SupportFragment supportFragment);\n\n /**\n * 跳转到新的fragment并出栈当前fragment\n * @param supportFragment\n */\n void startNewFragmentWithPop(@NonNull SupportFragment supportFragment);\n\n /**\n * 跳转到新的fragment并返回结果\n * @param supportFragment\n * @param requestCode\n */\n void startNewFragmentForResult(@NonNull SupportFragment supportFragment,int requestCode);\n\n /**\n * 设置fragment返回的result\n * @param requestCode\n * @param bundle\n */\n void setOnFragmentResult(int requestCode, Bundle bundle);\n\n /**\n * 跳转到新的Activity\n * @param clz\n */\n void startNewActivity(@NonNull Class<?> clz);\n\n /**\n * 携带数据跳转到新的Activity\n * @param clz\n * @param bundle\n */\n void startNewActivity(@NonNull Class<?> clz,Bundle bundle);\n\n /**\n * 携带数据跳转到新的Activity并返回结果\n * @param clz\n * @param bundle\n * @param requestCode\n */\n void startNewActivityForResult(@NonNull Class<?> clz,Bundle bundle,int requestCode);\n\n /**\n * 当前Fragment是否可见\n * @return true 可见,false 不可见\n */\n boolean isVisiable();\n\n /**\n * 获取当前fragment绑定的activity\n * @return\n */\n Activity getBindActivity();\n\n}", "public void onFragmentInteraction(String id);", "public void onFragmentInteraction(String id);", "public void onFragmentInteraction(String id);", "public void onFragmentInteraction(String id);", "public void onFragmentInteraction(String id);", "public void onFragmentInteraction(String id);", "public void onFragmentInteraction(String id);", "public void onFragmentInteraction(String id);", "public void onFragmentInteraction(String id);", "public void onFragmentInteraction(String id);", "public void onFragmentInteraction(String id);", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n void onSocialLoginInteraction();\n }", "public interface OnFragmentInteractionListener {\n /**\n * On fragment interaction.\n *\n * @param uri the uri\n */\n// TODO: Update argument type and name\n public void onFragmentInteraction(Uri uri);\n }", "public interface OnFragmentListener {\n void onClick(Fragment fragment);\n}", "public interface OnFragmentInteractionListener {\n void playGame(Uri location);\n }", "public interface LoginFragmentListener {\n public void OnRegisterClicked();\n public void OnLoginClicked(String User, String Pass);\n}", "public interface MoveFragment {\n\n\n public void moveFragment(Fragment selectedFragment);\n\n}", "public interface ChangeFragmentListener {\n void changeFragment();\n}", "public interface OnProductItemFragmentInteraction{\r\n public void itemSelected(Producto product);\r\n }", "public interface FragmentInterface {\n public void fragmentResult(Fragment fragment, String title);\n}", "@Override\n public void onAttach(Context context) {\n super.onAttach(context);\n //this registers this fragment to recieve any EventBus\n EventBus.getDefault().register(this);\n }", "void onFragmentInteraction(int position);", "public interface AddFarmFragmentView extends BaseView {\n\n\n}", "void OpenFragmentInteraction();", "public interface OnFragmentInteractionListener {\n\t\t// TODO: Update argument type and name\n\t\tpublic void onFragmentInteraction(Uri uri);\n\t}", "public interface FragmentDataObserver {\n void getDataFromActivity(String data);\n\n}", "public interface PesonageFragmentView extends MvpView {\n\n}", "public interface OnFragInteractionListener {\n\n // replace top fragment with this fragment\n interface OnMainFragInteractionListener {\n void onWifiFragReplace();\n void onHistoryFragReplace();\n void onHistoryWithOsmMapFragReplace();\n void onMainFragReplace();\n }\n\n // interface for WifiPresenterFragment\n interface OnWifiScanFragInteractionListener {\n void onGetDataAfterScanWifi(ArrayList<WifiLocationModel> list);\n void onAllowToSaveWifiHotspotToDb(String ssid, String pass, String encryption, String bssid);\n }\n\n // interface for HistoryPresenterFragment\n interface OnHistoryFragInteractionListener {\n // get wifi info\n void onGetWifiHistoryCursor(Cursor cursor);\n // get mobile network generation\n void onGetMobileHistoryCursor(Cursor cursor);\n // get wifi state and date\n void onGetWifiStateAndDateCursor(Cursor cursor);\n }\n\n interface OnMapFragInteractionListerer {\n void onGetWifiLocationCursor(Cursor cursor);\n }\n}", "public interface OnUsersFragmentInteractionListener {\n void onListFragmentInteraction(User item);\n }", "public interface MainScreeInteractionListener {\n // TODO: Update argument type and name\n void onFragmentInteractionMain();\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n void onClickNextTurn();\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n void onFragmentInteraction();\n\n void changeBottomNavSelection(int menuItem);\n }", "public interface OnFragmentInteractionListener {\n void onFragmentInteraction(Uri uri);\n}", "public interface OnFragmentInteractionListener {\n public void onFragmentInteraction(Uri uri);\n }", "public interface OnFragmentInteractionListener {\n public void onFragmentInteraction(Uri uri);\n }", "public interface OnFragmentInteractionListener {\n public void onFragmentInteraction(Uri uri);\n }", "public interface OnFragmentInteractionListener {\n void onSignoutClicked();\n\n void onExtraScopeRequested();\n }", "interface OnMainFragInteractionListener {\n void onWifiFragReplace();\n void onHistoryFragReplace();\n void onHistoryWithOsmMapFragReplace();\n void onMainFragReplace();\n }", "public interface OnListFragmentInteractionListener {\n void onListFragmentInteraction(Note note);\n}" ]
[ "0.7323792", "0.72082794", "0.7134954", "0.7123491", "0.7122167", "0.701424", "0.6976951", "0.6976951", "0.6976951", "0.6973974", "0.69670236", "0.69652706", "0.6960549", "0.69533235", "0.69430083", "0.69339865", "0.69292945", "0.692731", "0.69223285", "0.6910736", "0.6902757", "0.6896468", "0.6893908", "0.6882123", "0.6880699", "0.6874388", "0.686401", "0.6860271", "0.68593484", "0.6858118", "0.68550384", "0.68431246", "0.6839113", "0.6829111", "0.6816891", "0.6816165", "0.68101656", "0.67853284", "0.6769532", "0.67688614", "0.67688614", "0.67688614", "0.67688614", "0.67688614", "0.67688614", "0.67688614", "0.67688614", "0.67688614", "0.67659384", "0.67609555", "0.6755687", "0.6752616", "0.6698285", "0.66808885", "0.6673179", "0.6671044", "0.66690505", "0.66612566", "0.6660422", "0.6654709", "0.6651342", "0.664483", "0.6644206", "0.6644206", "0.6644206", "0.6644206", "0.6644206", "0.6644206", "0.6644206", "0.6644206", "0.6644206", "0.6644206", "0.6644206", "0.6637433", "0.6635452", "0.66309", "0.6624982", "0.66238683", "0.66180724", "0.6609358", "0.66092205", "0.66088176", "0.66055775", "0.659777", "0.65967387", "0.6588278", "0.65717125", "0.6568448", "0.65599674", "0.6559159", "0.65536565", "0.6548942", "0.6548183", "0.654234", "0.653836", "0.65334255", "0.65334255", "0.65334255", "0.65180117", "0.6516102", "0.65157163" ]
0.0
-1
TODO: Update argument type and name
void onFragmentInteraction(Uri uri);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n public String getFirstArg() {\n return name;\r\n }", "@Override\n public int getNumberArguments() {\n return 1;\n }", "java.lang.String getArg();", "@Override\n public int getArgLength() {\n return 4;\n }", "Argument createArgument();", "@Override\r\n\tpublic String getFirstArg() {\n\t\treturn null;\r\n\t}", "@Override\n protected PacketArgs.ArgumentType[] getArgumentTypes() {\n return new PacketArgs.ArgumentType[] { PacketArgs.ArgumentType.String };\n }", "@Override\n\tpublic void traverseArg(UniArg node) {\n\t}", "@Override\n\t\t\t\t\tpublic Parameter handleParameter(Method parent,\n\t\t\t\t\t\t\tEParamType direction, FArgument src) {\n\t\t\t\t\t\treturn super.handleParameter(parent, direction, src);\n\t\t\t\t\t}", "Object[] getArguments();", "Object[] getArguments();", "String getArguments();", "@Override\n\tpublic void handleArgument(ArrayList<String> argument) {\n\t\t\n\t}", "@Override\n public final int parseArguments(Parameters params) {\n return 1;\n }", "ArgList createArgList();", "public Object[] getArguments() { return args;}", "@Override\n public String getInputArg(String argName) {\n Log.w(TAG, \"Test input args is not supported.\");\n return null;\n }", "@Override\n protected String getName() {return _parms.name;}", "private static AbstractType<?>[] argumentsType(@Nullable StringType algorithmArgumentType)\n {\n return algorithmArgumentType == null\n ? DEFAULT_ARGUMENTS\n : new AbstractType<?>[]{ algorithmArgumentType };\n }", "uicargs createuicargs();", "java.util.List<com.mwr.jdiesel.api.Protobuf.Message.Argument> \n getArgumentList();", "java.util.List<com.mwr.jdiesel.api.Protobuf.Message.Argument> \n getArgumentList();", "public static void main(String[] args) {\n\t\t\tmeth(args);\r\n\t\t\targument_test:meth(args);\r\n\t}", "@Override\r\n\tpublic int getSecondArg() {\n\t\treturn 0;\r\n\t}", "public getType_args(getType_args other) {\n }", "Object[] args();", "protected void validateArguments( Object[] args ) throws ActionExecutionException {\n\n Annotation[][] annotations = method.getParameterAnnotations();\n for (int i = 0; i < annotations.length; i++) {\n\n Annotation[] paramAnnotations = annotations[i];\n\n for (Annotation paramAnnotation : paramAnnotations) {\n if (paramAnnotation instanceof Parameter) {\n Parameter paramDescriptionAnnotation = (Parameter) paramAnnotation;\n ValidationType validationType = paramDescriptionAnnotation.validation();\n\n String[] validationArgs;\n\n // if we are checking for valid constants, then the\n // args array should contain\n // the name of the array holding the valid constants\n if (validationType == ValidationType.STRING_CONSTANT\n || validationType == ValidationType.NUMBER_CONSTANT) {\n try {\n String arrayName = paramDescriptionAnnotation.args()[0];\n\n // get the field and set access level if\n // necessary\n Field arrayField = method.getDeclaringClass().getDeclaredField(arrayName);\n if (!arrayField.isAccessible()) {\n arrayField.setAccessible(true);\n }\n Object arrayValidConstants = arrayField.get(null);\n\n // convert the object array to string array\n String[] arrayValidConstatnsStr = new String[Array.getLength(arrayValidConstants)];\n for (int j = 0; j < Array.getLength(arrayValidConstants); j++) {\n arrayValidConstatnsStr[j] = Array.get(arrayValidConstants, j).toString();\n }\n\n validationArgs = arrayValidConstatnsStr;\n\n } catch (IndexOutOfBoundsException iobe) {\n // this is a fatal error\n throw new ActionExecutionException(\"You need to specify the name of the array with valid constants in the 'args' field of the Parameter annotation\");\n } catch (Exception e) {\n // this is a fatal error\n throw new ActionExecutionException(\"Could not get array with valid constants - action annotations are incorrect\");\n }\n } else {\n validationArgs = paramDescriptionAnnotation.args();\n }\n\n List<BaseType> typeValidators = createBaseTypes(paramDescriptionAnnotation.validation(),\n paramDescriptionAnnotation.name(),\n args[i], validationArgs);\n //perform validation\n for (BaseType baseType : typeValidators) {\n if (baseType != null) {\n try {\n baseType.validate();\n } catch (TypeException e) {\n throw new InvalidInputArgumentsException(\"Validation failed while validating argument \"\n + paramDescriptionAnnotation.name()\n + e.getMessage());\n }\n } else {\n log.warn(\"Could not perform validation on argument \"\n + paramDescriptionAnnotation.name());\n }\n }\n }\n }\n }\n }", "@Test\n void getArgString() {\n }", "@Override\n\t\t\t\t\tpublic Parameter handleParameter(Method parent,\n\t\t\t\t\t\t\tEParamType direction, FEnumerator src) {\n\t\t\t\t\t\treturn super.handleParameter(parent, direction, src);\n\t\t\t\t\t}", "@Override\n public void prepareArguments(ActionInvocation invocation)\n throws InvalidValueException {\n }", "@Override\n public void prepareArguments(ActionInvocation invocation)\n throws InvalidValueException {\n }", "@Override\n public void prepareArguments(ActionInvocation invocation)\n throws InvalidValueException {\n }", "@Override\n public void prepareArguments(ActionInvocation invocation)\n throws InvalidValueException {\n }", "@Override\n public void prepareArguments(ActionInvocation invocation)\n throws InvalidValueException {\n }", "@Override\n public void prepareArguments(ActionInvocation invocation)\n throws InvalidValueException {\n }", "@Override\n public void prepareArguments(ActionInvocation invocation)\n throws InvalidValueException {\n }", "@Override\n public void prepareArguments(ActionInvocation invocation)\n throws InvalidValueException {\n }", "@Override\n public void prepareArguments(ActionInvocation invocation)\n throws InvalidValueException {\n }", "@Override\n public void prepareArguments(ActionInvocation invocation)\n throws InvalidValueException {\n }", "@Override\n public void prepareArguments(ActionInvocation invocation)\n throws InvalidValueException {\n }", "@Override\n public void prepareArguments(ActionInvocation invocation)\n throws InvalidValueException {\n }", "@Override\n public void prepareArguments(ActionInvocation invocation)\n throws InvalidValueException {\n }", "@Override\n public void prepareArguments(ActionInvocation invocation)\n throws InvalidValueException {\n }", "@Override\n public void prepareArguments(ActionInvocation invocation)\n throws InvalidValueException {\n }", "@Override\n public void prepareArguments(ActionInvocation invocation)\n throws InvalidValueException {\n }", "@Override\n public void prepareArguments(ActionInvocation invocation)\n throws InvalidValueException {\n }", "int getArgIndex();", "@Override\n\tpublic void addArg(FormulaElement arg){\n\t}", "public Type[] getArgumentTypes() {\n/* 236 */ return Type.getArgumentTypes(this.desc);\n/* */ }", "@Override\n public Object[] getArguments() {\n return null;\n }", "public login_1_argument() {\n }", "Optional<String[]> arguments();", "private Main(String... arguments) {\n this.operations = new ArrayDeque<>(List.of(arguments));\n }", "@Override\n\tprotected GATKArgumentCollection getArgumentCollection() {\n\t\treturn argCollection;\n\t}", "protected void sequence_Argument(ISerializationContext context, Argument semanticObject) {\n\t\tif (errorAcceptor != null) {\n\t\t\tif (transientValues.isValueTransient(semanticObject, TdlPackage.Literals.ARGUMENT__NAME) == ValueTransient.YES)\n\t\t\t\terrorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, TdlPackage.Literals.ARGUMENT__NAME));\n\t\t}\n\t\tSequenceFeeder feeder = createSequencerFeeder(context, semanticObject);\n\t\tfeeder.accept(grammarAccess.getArgumentAccess().getNameSTRINGTerminalRuleCall_0_0(), semanticObject.getName());\n\t\tfeeder.finish();\n\t}", "void setArguments(String arguments);", "@Override\n\tpublic List<String> getArgumentDesc() {\n\t\treturn desc;\n\t}", "OpFunctionArgAgregate createOpFunctionArgAgregate();", "protected abstract Feature<T,?> convertArgument(Class<?> parameterType, Feature<T,?> originalArgument);", "void visitArgument(Argument argument);", "public Thaw_args(Thaw_args other) {\r\n }", "@Override\r\n\tpublic List<String> getArguments()\r\n\t{\n\t\treturn null;\r\n\t}", "private static String getArgumentString(Object arg) {\n if (arg instanceof String) {\n return \"\\\\\\\"\"+arg+\"\\\\\\\"\";\n }\n else return arg.toString();\n }", "public interface Param {\n\n int[] args();\n String exec(ExecutePack pack);\n String label();\n}", "@Override\n public void verifyArgs(ArrayList<String> args) throws ArgumentFormatException {\n super.checkNumArgs(args);\n _args = true;\n }", "public abstract ValidationResults validArguments(String[] arguments);", "public ArgumentException() {\n super(\"Wrong arguments passed to function\");\n }", "public String getArgumentString() {\n\t\treturn null;\n\t}", "@Override\n public String kind() {\n return \"@param\";\n }", "@Override\n\t\t\t\t\tpublic Parameter handleParameter(Method parent,\n\t\t\t\t\t\t\tEParamType direction, FEnumerationType src) {\n\t\t\t\t\t\treturn super.handleParameter(parent, direction, src);\n\t\t\t\t\t}", "public void addArgumentTypeSerialization(String functionName, String argumentName, TensorType type) {\n wrappedSerializationContext.addArgumentTypeSerialization(functionName, argumentName, type);\n }", "void setArgument(int idx,int v) \t\t{ setArgument(idx,Integer.valueOf(v)); }", "@Override\n\tprotected byte[] getArgByte() {\n\t\treturn paramsJson.getBytes();\n\t}", "void onArgumentsChanged();", "com.google.protobuf.ByteString\n\t\tgetArgBytes();", "@Override public int getNumArguments()\t\t\t{ return arg_list.size(); }", "MyArg(int value){\n this.value = value;\n }", "public ArgList(Object arg1) {\n super(1);\n addElement(arg1);\n }", "public Clear_args(Clear_args other) {\r\n }", "private ParameterInformation processArgumentReference(Argument argument,\n List<NameDescriptionType> argTypeSet,\n SequenceEntryType seqEntry,\n int seqIndex)\n {\n ParameterInformation argumentInfo = null;\n\n // Initialize the argument's attributes\n String argName = argument.getName();\n String dataType = null;\n String arraySize = null;\n String bitLength = null;\n BigInteger argBitSize = null;\n String enumeration = null;\n String description = null;\n UnitSet unitSet = null;\n String units = null;\n String minimum = null;\n String maximum = null;\n\n // Step through each command argument type\n for (NameDescriptionType argType : argTypeSet)\n {\n // Check if this is the same command argument referenced in the argument list (by\n // matching the command and argument names between the two)\n if (argument.getArgumentTypeRef().equals(argType.getName()))\n {\n boolean isInteger = false;\n boolean isUnsigned = false;\n boolean isFloat = false;\n boolean isString = false;\n\n // Check if this is an array parameter\n if (seqEntry instanceof ArrayParameterRefEntryType)\n {\n arraySize = \"\";\n\n // Store the reference to the array parameter type\n ArrayDataTypeType arrayType = (ArrayDataTypeType) argType;\n argType = null;\n\n // Step through each dimension for the array variable\n for (Dimension dim : ((ArrayParameterRefEntryType) seqEntry).getDimensionList().getDimension())\n {\n // Check if the fixed value exists\n if (dim.getEndingIndex().getFixedValue() != null)\n {\n // Build the array size string\n arraySize += String.valueOf(Integer.valueOf(dim.getEndingIndex().getFixedValue()) + 1)\n + \",\";\n }\n }\n\n arraySize = CcddUtilities.removeTrailer(arraySize, \",\");\n\n // The array parameter type references a non-array parameter type that\n // describes the individual array members. Step through each data type in the\n // parameter type set in order to locate this data type entry\n for (NameDescriptionType type : argTypeSet)\n {\n // Check if the array parameter's array type reference matches the data\n // type name\n if (arrayType.getArrayTypeRef().equals(type.getName()))\n {\n // Store the reference to the array parameter's data type and stop\n // searching\n argType = type;\n break;\n }\n }\n }\n\n // Check if a data type entry for the parameter exists in the parameter type set\n // (note that if the parameter is an array the steps above locate the data type\n // entry for the individual array members)\n if (argType != null)\n {\n long dataTypeBitSize = 0;\n\n // Check if the argument is an integer data type\n if (argType instanceof IntegerArgumentType)\n {\n IntegerArgumentType icmd = (IntegerArgumentType) argType;\n\n // Get the number of bits occupied by the argument\n argBitSize = icmd.getSizeInBits();\n\n // Get the argument units reference\n unitSet = icmd.getUnitSet();\n\n // Check if integer encoding is set to 'unsigned'\n if (icmd.getIntegerDataEncoding().getEncoding().equalsIgnoreCase(\"unsigned\"))\n {\n isUnsigned = true;\n }\n\n // Determine the smallest integer size that contains the number of bits\n // occupied by the argument\n dataTypeBitSize = 8;\n\n while (argBitSize.longValue() > dataTypeBitSize)\n {\n dataTypeBitSize *= 2;\n }\n\n // Get the argument alarm\n IntegerArgumentType.ValidRangeSet alarmType = icmd.getValidRangeSet();\n\n // Check if the argument has an alarm\n if (alarmType != null)\n {\n // Get the alarm range\n List<IntegerRangeType> alarmRange = alarmType.getValidRange();\n\n // Check if the alarm range exists\n if (alarmRange != null)\n {\n // Store the minimum alarm value\n minimum = alarmRange.get(0).getMinInclusive();\n\n // Store the maximum alarm value\n maximum = alarmRange.get(0).getMaxInclusive();\n }\n }\n\n isInteger = true;\n }\n // Check if the argument is a floating point data type\n else if (argType instanceof FloatArgumentType)\n {\n // Get the float argument attributes\n FloatArgumentType fcmd = (FloatArgumentType) argType;\n dataTypeBitSize = fcmd.getSizeInBits().longValue();\n unitSet = fcmd.getUnitSet();\n\n // Get the argument alarm\n FloatArgumentType.ValidRangeSet alarmType = fcmd.getValidRangeSet();\n\n // Check if the argument has an alarm\n if (alarmType != null)\n {\n // Get the alarm range\n List<FloatRangeType> alarmRange = alarmType.getValidRange();\n\n // Check if the alarm range exists\n if (alarmRange != null)\n {\n // Get the minimum value\n Double min = alarmRange.get(0).getMinInclusive();\n\n // Check if a minimum value exists\n if (min != null)\n {\n // Get the minimum alarm value\n minimum = String.valueOf(min);\n }\n\n // Get the maximum value\n Double max = alarmRange.get(0).getMaxInclusive();\n\n // Check if a maximum value exists\n if (max != null)\n {\n // Get the maximum alarm value\n maximum = String.valueOf(max);\n }\n }\n }\n\n isFloat = true;\n }\n // Check if the argument is a string data type\n else if (argType instanceof StringDataType)\n {\n // Get the string argument attributes\n StringDataType scmd = (StringDataType) argType;\n dataTypeBitSize = Integer.valueOf(scmd.getStringDataEncoding()\n .getSizeInBits()\n .getFixed()\n .getFixedValue());\n unitSet = scmd.getUnitSet();\n isString = true;\n }\n // Check if the argument is an enumerated data type\n else if (argType instanceof EnumeratedDataType)\n {\n EnumeratedDataType ecmd = (EnumeratedDataType) argType;\n EnumerationList enumList = ecmd.getEnumerationList();\n\n // Check if any enumeration parameters are defined\n if (enumList != null)\n {\n // Step through each enumeration parameter\n for (ValueEnumerationType enumType : enumList.getEnumeration())\n {\n // Check if this is the first parameter\n if (enumeration == null)\n {\n // Initialize the enumeration string\n enumeration = \"\";\n }\n // Not the first parameter\n else\n {\n // Add the separator for the enumerations\n enumeration += \", \";\n }\n\n // Begin building this enumeration\n enumeration += enumType.getValue() + \" | \" + enumType.getLabel();\n }\n\n argBitSize = ecmd.getIntegerDataEncoding().getSizeInBits();\n unitSet = ecmd.getUnitSet();\n\n // Check if integer encoding is set to 'unsigned'\n if (ecmd.getIntegerDataEncoding().getEncoding().equalsIgnoreCase(\"unsigned\"))\n {\n isUnsigned = true;\n }\n\n // Determine the smallest integer size that contains the number of bits\n // occupied by the argument\n dataTypeBitSize = 8;\n\n while (argBitSize.longValue() > dataTypeBitSize)\n {\n dataTypeBitSize *= 2;\n }\n\n isInteger = true;\n }\n }\n\n // Get the name of the data type from the data type table that matches the base\n // type and size of the parameter\n dataType = getMatchingDataType(dataTypeBitSize / 8,\n isInteger,\n isUnsigned,\n isFloat,\n isString,\n dataTypeHandler);\n\n // Check if the description exists\n if (argType.getLongDescription() != null)\n {\n // Store the description\n description = argType.getLongDescription();\n }\n\n // Check if the argument bit size exists\n if (argBitSize != null && argBitSize.longValue() != dataTypeBitSize)\n {\n // Store the bit length\n bitLength = argBitSize.toString();\n }\n\n // Check if the units exists\n if (unitSet != null)\n {\n List<UnitType> unitType = unitSet.getUnit();\n\n // Check if the units is set\n if (!unitType.isEmpty())\n {\n // Store the units\n units = unitType.get(0).getContent();\n }\n }\n\n argumentInfo = new ParameterInformation(argName,\n dataType,\n arraySize,\n bitLength,\n enumeration,\n units,\n minimum,\n maximum,\n description,\n 0,\n seqIndex);\n }\n\n break;\n }\n }\n\n return argumentInfo;\n }", "public abstract interface QueryArgs {\n\n /** Return the catalog associated with this object */\n public Catalog getCatalog();\n\n /** Set the value for the ith parameter */\n public void setParamValue(int i, Object value);\n\n /** Set the value for the parameter with the given label */\n public void setParamValue(String label, Object value);\n\n /** Set the min and max values for the parameter with the given label */\n public void setParamValueRange(String label, Object minValue, Object maxValue);\n\n /** Set the int value for the parameter with the given label */\n public void setParamValue(String label, int value);\n\n /** Set the double value for the parameter with the given label */\n public void setParamValue(String label, double value);\n\n /** Set the double value for the parameter with the given label */\n public void setParamValueRange(String label, double minValue, double maxValue);\n\n /** Set the array of parameter values directly. */\n public void setParamValues(Object[] values);\n\n /** Get the value of the ith parameter */\n public Object getParamValue(int i);\n\n /** Get the value of the named parameter\n *\n * @param label the parameter name or id\n * @return the value of the parameter, or null if not specified\n */\n public Object getParamValue(String label);\n\n /**\n * Get the value of the named parameter as an integer.\n *\n * @param label the parameter label\n * @param defaultValue the default value, if the parameter was not specified\n * @return the value of the parameter\n */\n public int getParamValueAsInt(String label, int defaultValue);\n\n /**\n * Get the value of the named parameter as a double.\n *\n * @param label the parameter label\n * @param defaultValue the default value, if the parameter was not specified\n * @return the value of the parameter\n */\n public double getParamValueAsDouble(String label, double defaultValue);\n\n /**\n * Get the value of the named parameter as a String.\n *\n * @param label the parameter label\n * @param defaultValue the default value, if the parameter was not specified\n * @return the value of the parameter\n */\n public String getParamValueAsString(String label, String defaultValue);\n\n\n /**\n * Return the object id being searched for, or null if none was defined.\n */\n public String getId();\n\n /**\n * Set the object id to search for.\n */\n public void setId(String id);\n\n\n /**\n * Return an object describing the query region (center position and\n * radius range), or null if none was defined.\n */\n public CoordinateRadius getRegion();\n\n /**\n * Set the query region (center position and radius range) for\n * the search.\n */\n public void setRegion(CoordinateRadius region);\n\n\n /**\n * Return an array of SearchCondition objects indicating the\n * values or range of values to search for.\n */\n public SearchCondition[] getConditions();\n\n /** Returns the max number of rows to be returned from a table query */\n public int getMaxRows();\n\n /** Set the max number of rows to be returned from a table query */\n public void setMaxRows(int maxRows);\n\n\n /** Returns the query type (an optional string, which may be interpreted by some catalogs) */\n public String getQueryType();\n\n /** Set the query type (an optional string, which may be interpreted by some catalogs) */\n public void setQueryType(String queryType);\n\n /**\n * Returns a copy of this object\n */\n public QueryArgs copy();\n\n /**\n * Optional: If not null, use this object for displaying the progress of the background query\n */\n public StatusLogger getStatusLogger();\n}", "@Override\n public void doExeception(Map<String, Object> args)\n {\n \n }", "@Override\n public void doExeception(Map<String, Object> args)\n {\n \n }", "@Override\n\tprotected Collection<ArgumentTypeDescriptor> getArgumentTypeDescriptors() {\n\t\treturn Arrays.asList(new VCFWriterArgumentTypeDescriptor(engine, System.out, bisulfiteArgumentSources), new SAMReaderArgumentTypeDescriptor(engine),\n\t\t\t\tnew SAMFileWriterArgumentTypeDescriptor(engine, System.out), new OutputStreamArgumentTypeDescriptor(engine, System.out));\n\t}", "@Override\n public int getArgent() {\n return _argent;\n }", "private static @NonNull String resolveInputName(@NonNull Argument<?> argument) {\n String inputName = argument.getAnnotationMetadata().stringValue(Bindable.NAME).orElse(null);\n if (StringUtils.isEmpty(inputName)) {\n inputName = argument.getName();\n }\n return inputName;\n }", "private Object[] getArguments (String className, Object field)\n\t{\n\t\treturn ((field == null) ? new Object[]{className} : \n\t\t\tnew Object[]{className, field});\n\t}", "PermissionSerializer (GetArg arg) throws IOException, ClassNotFoundException {\n\tthis( \n\t create(\n\t\targ.get(\"targetType\", null, Class.class),\n\t\targ.get(\"type\", null, String.class),\n\t\targ.get(\"targetName\", null, String.class),\n\t\targ.get(\"targetActions\", null, String.class) \n\t )\n\t);\n }", "public Type getArgumentDirection() {\n return direction;\n }", "public String argTypes() {\n return \"I\";//NOI18N\n }", "public static void main(String arg[]) {\n\n }", "godot.wire.Wire.Value getArgs(int index);", "@Override\n protected String[] getArguments() {\n String[] args = new String[1];\n args[0] = _game_file_name;\n return args;\n }", "public void setArgs(java.lang.String value) {\n this.args = value;\n }", "private Argument(Builder builder) {\n super(builder);\n }", "@Override\n public void execute(String[] args) {\n\n }", "@Override\n\tprotected final void setFromArgument(CommandContext<ServerCommandSource> context, String name) {\n\t}", "UUID createArgument(ArgumentCreateRequest request);", "@Override\n public void initialise(String[] arguments) {\n\n }", "public static ParameterExpression parameter(Class type, String name) { throw Extensions.todo(); }", "protected abstract void parseArgs() throws IOException;" ]
[ "0.7164074", "0.6946075", "0.6714363", "0.65115863", "0.63969076", "0.6375468", "0.63481104", "0.63162106", "0.6260299", "0.6208487", "0.6208487", "0.62070644", "0.6197276", "0.61806154", "0.6177103", "0.61530507", "0.61472267", "0.61243707", "0.60771817", "0.6054482", "0.59906125", "0.59906125", "0.5984017", "0.59791875", "0.5977681", "0.59532714", "0.5946838", "0.59457266", "0.59452903", "0.59352577", "0.59352577", "0.59352577", "0.59352577", "0.59352577", "0.59352577", "0.59352577", "0.59352577", "0.59352577", "0.59352577", "0.59352577", "0.59352577", "0.59352577", "0.59352577", "0.59352577", "0.59352577", "0.59352577", "0.5909717", "0.5889277", "0.588111", "0.5871162", "0.5866624", "0.58613646", "0.58519953", "0.58381283", "0.58083445", "0.58059824", "0.5795826", "0.57816726", "0.57670826", "0.57556796", "0.57471323", "0.57418406", "0.5729463", "0.57291526", "0.5716928", "0.5713024", "0.56974274", "0.56782854", "0.56723106", "0.5664594", "0.5664104", "0.5660337", "0.5652865", "0.5647883", "0.5642134", "0.5635645", "0.5634968", "0.562251", "0.56210977", "0.56167537", "0.56138444", "0.56044126", "0.56044126", "0.5602371", "0.56012225", "0.55986875", "0.55893147", "0.5588273", "0.5583255", "0.5582767", "0.55681497", "0.55626017", "0.55577534", "0.55524325", "0.5549442", "0.55378276", "0.5536797", "0.5527675", "0.5511817", "0.55099154", "0.550257" ]
0.0
-1
Call the registerUser() method in the UserRepository class to persist the user record in the database
public void registerUser(User newUser) { userRepo.save(newUser); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void registerUser(User user) {\n userDAO.createUser(user);\n }", "void registerUser(User newUser);", "@Override\n\tpublic void register(User user) {\n\t\tuserDao.register(user);\n\t}", "@Override\r\n\tpublic void save() {\n\t\tSystem.out.println(\"UserServiceImplÍ┤đđ┴╦\");\r\n\t\tuserDao.save();\r\n\t}", "@Override\n public void addUser(User u) {\n Session session = this.sessionFactory.getCurrentSession();\n session.persist(u);\n logger.info(\"User saved successfully, User Details=\"+u);\n }", "@Override\r\n\tpublic int register(User user) {\n\t\treturn dao.addUser(user);\r\n\t}", "Boolean registerNewUser(User user);", "@Override\n\tpublic void regist(User user) {\n\t\tdao.addUser(user);\n\t}", "@Override\n public boolean register(UserDTO user) throws WrongUserDatabase, UserDatabaseNotFoundException, UserExistsException {\n userRepository.addUser(user);\n return true;\n }", "public void register(UserRegistration userRegistration){\n User userToSave = UserMapper.map(userRegistration);\n// metoda do szyfrowania będzie wykorzystana w aktualnej metodzie register(),\n hashPasswordWithSha256(userToSave);\n userDao.save(userToSave);\n }", "private void pushToHibernate(){\n DATA_API.saveUser(USER);\n }", "private void register_user() {\n\n\t\tHttpRegister post = new HttpRegister();\n\t\tpost.execute(Config.URL + \"/api/newuser\");\n\n\t}", "@Override\n\tpublic void createUser(User user) {\n\t\tSystem.out.println(\"INSIDE create user function\");\n\t\tem.persist(user);\n\t\t\t\n\t}", "@Override\n public void createUser(User user) {\n run(()->{this.userDAO.save(user);});\n\n }", "boolean saveUser(User entity) throws UserDaoException;", "public User InsertUser(User user){\n\t\t\t//step to call the jpa class and insert user into the db\n\t\t\treturn user;\n\t\t}", "public User saveUser(User user){\n return userRepository.save(user);\n }", "public void registerUser(User user) throws UserManagementException;", "public Register() {\n user = new User();\n em = EMF.createEntityManager();\n valid = false;\n }", "public void saveUser(User user);", "public void insertUser() {}", "public void insertUser(User user) {\n mUserDAO.insertUser(user);\n }", "public long registerUserProfile(User user);", "@Override\n\t@Transactional(propagation = Propagation.REQUIRED,\n\t\t isolation = Isolation.DEFAULT)\n\tpublic void regUser(Employee usr, Address address) throws HibernateException {\n\t\tdao.regUser(usr, address);\n\t}", "public void registerUser(Register reg)\r\n {\n\t Session session = HibernateUtils.getSession();\r\n\t Transaction tx = session.beginTransaction();\r\n\t session.save(reg);\r\n\t tx.commit();\r\n\t session.close();\r\n }", "@Override\n public boolean userRegister(User user) \n { \n Connection conn = null;\n Statement stmt = null;\n try \n {\n db_controller.setClass();\n conn = db_controller.getConnection();\n stmt = conn.createStatement();\n String sql;\n \n sql = \"INSERT INTO users (firstname,lastname,username,password,city,number) \"\n + \"values ('\"+ user.getFirstname()+\"',\" \n + \"'\" + user.getLastname() + \"',\" \n + \"'\" + user.getUsername() + \"',\" \n + \"'\" + user.getPassword() + \"',\" \n + \"'\" + user.getCity() + \"',\"\n + \"'\" + user.getNumber() + \"')\";\n int result = stmt.executeUpdate(sql);\n \n stmt.close();\n conn.close();\n if(result == 1) return true;\n else return false;\n } \n catch (SQLException ex) { ex.printStackTrace(); return false;} \n catch (ClassNotFoundException ex) { ex.printStackTrace(); return false;} \n }", "public void saveUser(User user) {\n\t\tpersist(user);\r\n\t\t\r\n\t}", "void saveRegisterInformation(UserDTO userDTO);", "@Override\n public User register(UserRegisterModel model) {\n User newUser = User.builder()\n .password(model.getPassword())\n .username(model.getUsername())\n .dateOfBirth(model.getDateOfBirth())\n .build();\n return userRepository.save(newUser);\n }", "@Override\n\tpublic void register(User user) throws ValidationException {\n\t\tif (user.getEmail() == null) {\n\t\t\tthrow new ValidationException(\"Give your email\");\n\t\t}\n\t\tUser foundUser = userDao.findUserByEmail(user.getEmail());\n\t\tif (foundUser != null) {\n\t\t\tthrow new ValidationException(\"User with this email already exists\");\n\t\t}\n\t\tif (user.getPassword() == null) {\n\t\t\tthrow new ValidationException(\"Your password must contain at least 1 character\");\n\t\t}\n\t\tuserDao.create(user);\n\t}", "@Override\n\tpublic void save(User user) \n\t{\n\t\tuserDAO.save(user);\n\t}", "public abstract User register(User data);", "@Override\r\n\tpublic int saveUser(User user) {\n\t\tString sql = \"insert into user values(?,?,?,?)\";\r\n\t\treturn this.update(sql,user.getId(), user.getUsername(),user.getPassword(),user.getEmail());\r\n\t}", "@PostMapping(\"/v1/register\")\n\t@Transactional\n\tpublic ResponseEntity<RegisteredUserResult> register(@RequestBody RegisterUserRequest registerUserRequest) {\n\n\t\tLOG.info(\"Register user!\");\n\n\t\tcheckHeader(registerUserRequest);\n\n\t\t// Create user in user service db\n\t\tUserEntity userEntity = new UserEntity();\n\t\tmapper.map(registerUserRequest, userEntity);\n\t\tuserEntity.setRoles(Arrays.asList(roleRepository.findByName(ROLE_USER)));\n\t\tuserEntity = userRepository.save(userEntity);\n\n\t\t// Create user in auth service db\n\t\tUserDto userDto = new UserDto();\n\t\tmapper.map(registerUserRequest, userDto);\n\t\tthis.authServiceClient.createUser(userDto);\n\n\t\tRegisteredUserResult result = new RegisteredUserResult(userEntity.getId());\n\t\tResponseEntity<RegisteredUserResult> response = new ResponseEntity<>(result, HttpStatus.OK);\n\n\t\treturn response;\n\t}", "User registration(User user);", "public void createUser(User user);", "User register(String firstName, String lastName, String username, String email) throws UserNotFoundException, EmailExistException, UsernameExistsException, MessagingException;", "public void createUser(User user) {\n\n\t}", "String registerUser(User user);", "public User register(User user) {\n\t\tString sql =\"insert into HealthUsers (firstName,lastName,email,gender,password) values(?,?,?,?,?)\";\n\t\tObject args[] = {user.getFirstName(), user.getLastName(),user.getEmail(),user.getGender(),user.getPassword()};\n\t\tjdbcTemplate.update(sql, args);\n\t\treturn login( user.getEmail(), user.getPassword());\n\t}", "public void saveUser(User user) {\n\t\tuserRepo.save(user);\n\t}", "@RequestMapping(\"/register-user\")\n public ResponseEntity<UserProfileEntity> register(@RequestBody UserProfileEntity payload, HttpServletRequest request) throws ServletException{\n UserProfileEntity user = userProfileService.findByUser(payload.getUsername());\n\n //if null add new user and login\n if (user == null) {\n RoleEntity role = new RoleEntity();\n role.setRole(\"ROLE_USER\");\n\n Set<RoleEntity> roleSet = new HashSet<>();\n roleSet.add(role);\n\n UserProfileEntity userToAdd = new UserProfileEntity();\n userToAdd.setEnabled(true);\n userToAdd.setUsername(payload.getUsername());\n userToAdd.setPassword(payload.getPassword());\n userToAdd.setRoles(roleSet);\n\n userProfileService.save(userToAdd);\n\n request.login(userToAdd.getUsername(), userToAdd.getPassword());\n\n return new ResponseEntity<UserProfileEntity>(userToAdd, HttpStatus.CREATED);\n\n } else {\n return new ResponseEntity<UserProfileEntity>(HttpStatus.CONFLICT);\n }\n\n }", "public UserRegister(String userFirstName, String userLastName, String userEmail, String userPhoneNo, String userName, String userPassword) throws Exception { \r\n\t\t//super(userName, userPassword);\r\n\t\t// add new user to database\r\n\t\ttry {\r\n\t\tString str = \"INSERT INTO tblusers (userName,userPassword, userFirstName, userLastName, userEmail, userPhoneNo, userDateJoined)\" + \r\n\t\t\t\t\"VALUES ('\" + userName + \"', '\" + userPassword + \"', '\" + userFirstName + \"', '\" + userLastName + \"',\" + \r\n\t\t\t\t\" '\" + userEmail + \"', '\" + userPhoneNo + \"', NOW() );\";\r\n\t\tDBConnect.runUpdateQuery(str);\r\n\t\t}catch(Exception e) {\r\n\t\t\tthrow e;\r\n\t\t\t//System.out.println(e.toString());\r\n\t\t}\r\n\r\n\t}", "@Override\n\tpublic int insertUser(String username, String password) {\n\t\treturn userMapper.insertUser(username, password);\n\t}", "public void saveUser(IUser user);", "@Override\n public void saveUser(User user) {\n }", "@Override\n\tpublic void insertUser(User user) {\n\t\t\n\t}", "public void registerUser(User1 u1) {\n\t\tSession session = sf.openSession();\n\t\tTransaction tx = session.beginTransaction();\t\t\n\t\t\n \tsession.save(u1);\t\t\n \t \n \ttx.commit();\n \tsession.close();\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public int persistUser(User user) {\n\n\t\tEntityManager entityManager = factory.createEntityManager();\n\t\t// User user = new User(\"someuser2\",\"password2123\");\n\t\tentityManager.getTransaction().begin();\n\t\tentityManager.persist(user);\n\t\tentityManager.getTransaction().commit();\n\t\tSystem.out.println(\"added user\");\n\n\t\treturn 0;\n\t}", "@Override\n\tpublic boolean userRegister(User user) {\n\t\tif(userDao.insertUser(user)<=0)\n\t\t return false;\n\t\telse\n\t\t\treturn true;\n\t}", "@Override\n\tpublic User createUser(User user) {\n\t\tem.persist(user);\n\t\tem.flush();\n\t\treturn user;\n\t}", "public User saveUser(User user);", "User saveUser(User user);", "private void registerUser() {\n\n // Get register name\n EditText mRegisterNameField = (EditText) findViewById(R.id.register_name_field);\n String nickname = mRegisterNameField.getText().toString();\n\n // Get register email\n EditText mRegisterEmailField = (EditText) findViewById(R.id.register_email_field);\n String email = mRegisterEmailField.getText().toString();\n\n // Get register password\n EditText mRegisterPasswordField = (EditText) findViewById(R.id.register_password_field);\n String password = mRegisterPasswordField.getText().toString();\n\n AccountCredentials credentials = new AccountCredentials(email, password);\n credentials.setNickname(nickname);\n\n if (DataHolder.getInstance().isAnonymous()) {\n credentials.setOldUsername(DataHolder.getInstance().getUser().getUsername());\n }\n\n sendRegistrationRequest(credentials);\n }", "UserDTO registerUser(final UserDTO userDTO);", "@Transactional\n\tpublic int doRegister(String email, String password) throws NoSuchFieldException, SecurityException {\n\t\tUser user = userDao.findUser(email);\n\n\t\tif (user != null) {\n\t\t\t//邮箱已被注册\n\t\t\treturn -1;\n\t\t}\n\t\telse {\n\t\t\t//注册新用户\n\t\t\tuser = new User(1L, email, password, \"\", \"M\", 0, \"\");\n\t\t\tSystem.out.println(user);\n\t\t\tuserDao.save(user);\n\t\t\treturn 0;\n\t\t}\n\t}", "public User saveUser(User user) {\n return userRepository.save(user);\n }", "@Override\n\tpublic void insertUser(UserPojo user) {\n\t\tuserDao.insertUser(user);\n\t}", "@RequestMapping(value=\"/user\", method = RequestMethod.POST) \n\tpublic void saveUser(@RequestBody Users user) {\n\t\tlogger.debug(\"Add a new user: {}\", user.getUsername());\n\t\tauthService.saveUser(user);\n\t}", "@Override\n\tpublic void registerUser(SpaceUserVO spaceUserVO) throws Exception {\n\t\t\n\t}", "@RequestMapping(method = RequestMethod.POST,\n consumes = MediaType.APPLICATION_JSON_VALUE)\n public void registerNewUser(@RequestBody @Valid UserDetails user){\n userRepository.save(user);\n }", "public int saveUser(User user);", "@Override\n\tpublic boolean saveUser(User user) {\n\t\treturn userRepository.saveUser(user);\n\t}", "private void registerUser()\n {\n /*AuthService.createAccount takes a Consumer<Boolean> where the result will be true if the user successfully logged in, or false otherwise*/\n authService.createAccount(entryService.extractText(namedFields), result -> {\n if (result.isEmpty()) {\n startActivity(new Intent(this, DashboardActivity.class));\n } else {\n makeToast(result);\n formContainer.setAlpha(1f);\n progressContainer.setVisibility(View.GONE);\n progressContainer.setOnClickListener(null);\n }\n });\n }", "@Override\n @Transactional\n public ResponseEntity<?> saveUser(User user) {\n user.setPassword(new BCryptPasswordEncoder().encode(user.getPassword()));\n return new ResponseEntity<>(this.user.save(user), HttpStatus.CREATED);\n }", "@Transactional\r\n\tpublic void addUser(){\r\n\t}", "public void addUser(User user){\n loginDAO.saveUser(user.getId(),user.getName(),user.getPassword());\n }", "@PostMapping(\"/signup\")\n public ResponseEntity<?> registerUser(@Valid @RequestBody SignupRequest signupRequest) {\n System.out.println(\"Creating User \" + signupRequest);\n\n if (userAccountDetailsService.isUserExistByUsername(signupRequest.getUsername())) {\n System.out.println(\"A User with username: \" + signupRequest.getUsername() + \" already exist\");\n return new ResponseEntity<Void>(HttpStatus.CONFLICT);\n }\n\n UserAccount userAccount = new UserAccount();\n userAccount.setName(signupRequest.getName());\n userAccount.setUsername(signupRequest.getUsername());\n userAccount.setAge(signupRequest.getAge());\n userAccount.setPassword(passwordEncoder.encode(signupRequest.getPassword()));\n\n Set<String> roles = signupRequest.getRole();\n Set<Authorities> authorities = new HashSet<>();\n for(String role: roles) {\n Authorities authority = new Authorities();\n authority.setAuthority(role);\n authority.setUserAccount(userAccount);\n authorities.add(authority);\n }\n userAccount.setAuthorities(authorities);\n\n userAccountDetailsService.saveUser(userAccount);\n\n return new ResponseEntity<Void>(HttpStatus.CREATED);\n }", "@RolesAllowed({ RoleEnum.ROLE_ADMIN, RoleEnum.ROLE_GUEST })\n\tpublic Integer saveUser(User user);", "public RegisterResult register(RegisterRequest r) throws DBException, IOException\n {\n try\n {\n idGenerator = UUID.randomUUID();\n String personID = idGenerator.toString();\n User newUser = new User(\n r.getUserName(),\n r.getPassword(),\n r.getEmail(),\n r.getFirstName(),\n r.getLastName(),\n r.getGender(),\n personID\n );\n userDao.postUser(newUser);\n commit(true);\n login = new LoginService();\n\n LoginRequest loginRequest = new LoginRequest(r.getUserName(), r.getPassword());\n LoginResult loginResult = login.loginService(loginRequest);\n login.commit(true);\n\n fill = new FillService();\n FillRequest fillRequest = new FillRequest(r.getUserName(), 4);\n FillResult fillResult = fill.fill(fillRequest);\n fill.commit(true);\n\n\n result.setAuthToken(loginResult.getAuthToken());\n result.setUserName(loginResult.getUserName());\n result.setPersonID(loginResult.getPersonID());\n result.setSuccess(loginResult.isSuccess());\n\n\n if( !loginResult.isSuccess() || !fillResult.isSuccess() )\n {\n throw new DBException(\"Login failed\");\n }\n\n }\n catch(DBException ex)\n {\n result.setSuccess(false);\n result.setMessage(\"Error: \" + ex.getMessage());\n commit(false);\n }\n return result;\n }", "public void registerUser(View view) {\n this.closeKeyboard();\n this.validator.validate();\n if (this.validator.hasNoErrors()) {\n User user = createUser();\n RealmUser registeredUser = registerUserDetails(user);\n //TODO register on server.\n if (registeredUser != null) {\n new MockUserRegistrationService().registerUser(user.getFirstName(), user.getLastName(), user.getEmail(), user.getInsuranceProvider(), user.getInsurancePlan());\n doOnRegistrationSuccess();\n }\n }\n }", "@Test\r\n\t\tpublic void insertUserTestCase() {\r\n\t\t\t\r\n\t\t\tUser user = new User();\r\n\t\t\t\t\t\r\n\t\t//\tuser.setBirthDate(LocalDate.parse(\"1994-04-09\"));\r\n\t\t\tuser.setUsername(\"renu\");\r\n\t\t//\tuser.setUserId(1003);\r\n\t\t\t\r\n\t\t\tuser.setEmail(\"renu@gmail.com\");\r\n\t\t\t\t\t\r\n\t\t\tuser.setFirstname(\"Renu\");\r\n\t\t\tuser.setSurname(\"Rawat\");\r\n\t\t//\tuser.setGender('F');\r\n\t\t\tuser.setPassword(\"renu\");\r\n\t\t\tuser.setPhone(\"9876543210\");\r\n\t\t//\tuser.setStatus(\"A\");\r\n\t\t\tuser.setIsOnline(false);\r\n\t\t\t\r\n\t\t\tuser.setRole(\"ADMIN\");\r\n\t\t//\tuser.setConfmemail(\"renu@gmail.com\");\r\n\t\t//\tuser.setConfpassword(\"renu\");\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"user printed\");\r\n\t\t\tassertEquals(\"successfully!\", Boolean.valueOf(true), userDao.registerUser(user));\r\n\t\t\tSystem.out.println(\"After User Table\");\r\n\t\t\t\r\n\t}", "public int insertUser(final User user);", "@Override\n\tpublic void saveUser(User user) {\n\t\tuser.setPassword(MD5.getInstance().getMd5(user.getPassword(),\"UTF-8\"));\n\t\tuserDao.insertUser(user);\n\t}", "@Override\n\tpublic int RegisterUser(String username, String password) {\n\t\tSession session=sessionFactory.openSession();\n\t\tTransaction tr = session.beginTransaction();\n\t\tboolean findUserByUserName = FindUserByUserName(username);\n\t\tif (!findUserByUserName) {\n\t\t\treturn 0;//注册失败\n\t\t}\n\t\tint executeUpdate = 0;\n\t\tString sqlString=\"insert into user values ('\"+UUID.randomUUID().toString()+\"','\"+username+\"','\"+password+\"','\"+0+\"','\"+100+\"')\";\n\t\ttry {\n\t\t\tQuery query=session.createSQLQuery(sqlString);\n\t\t\texecuteUpdate = query.executeUpdate();\n\t\t\tSystem.out.println(\"executeUpdate:\"+executeUpdate);\n\t\t} catch (HibernateException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}finally{\n\t\t\ttr.commit();\n\t\t session.close();\n\t\t}\n\t\treturn executeUpdate;\n\t}", "void createUser() throws SQLException {\n String name = regName.getText();\n String birthdate = regAge.getText();\n String username = regUserName.getText();\n String password = regPassword.getText();\n String query = \" insert into users (name, birthdate, username, password)\"\n + \" values (?, ?, ?, ?)\";\n\n DB.registerUser(name, birthdate, username, password, query);\n }", "@Override\n\tpublic UserImpl saveUser(UserImpl userImpl) {\n\t \treturn userRepository.save(userImpl);\n\t}", "@Override\n\tpublic boolean registerUtente(Utente user) {\n\t\tif(!userExists(user)) {\n\t\t\tDB db = getDB();\n\t\t\tMap<Long, UtenteBase> users = db.getTreeMap(\"users\");\n\t\t\tlong hash = (long) user.getUsername().hashCode();\n\t\t\tusers.put(hash, user);\n\t\t\tdb.commit();\n\t\t\treturn true;\n\t\t} else\n\t\t\treturn false;\t\n\t}", "public void signup(User u) {\n\t\tUserDao ua=new UserDao();\n\t\t ua.register(u);\n\t}", "@Transactional(readOnly=false)\r\n\tpublic void saveUser(User user) {\n\t\tthis.userDao.saveEntry(user);\r\n\t}", "@PostMapping(\"/registerUser\")\n\tpublic void addUser(@RequestBody User user){\n\t\t\n\t\tregistrationSeirvice.registerUser(user);\n\t}", "private void register() {\r\n if (mName.getText().length() == 0) {\r\n mName.setError(\"please fill this field\");\r\n return;\r\n }\r\n if (mEmail.getText().length() == 0) {\r\n mEmail.setError(\"please fill this field\");\r\n return;\r\n }\r\n if (mPassword.getText().length() == 0) {\r\n mPassword.setError(\"please fill this field\");\r\n return;\r\n }\r\n if (mPassword.getText().length() < 6) {\r\n mPassword.setError(\"password must have at least 6 characters\");\r\n return;\r\n }\r\n\r\n\r\n final String email = mEmail.getText().toString();\r\n final String password = mPassword.getText().toString();\r\n final String name = mName.getText().toString();\r\n\r\n FirebaseAuth.getInstance().createUserWithEmailAndPassword(email, password).addOnCompleteListener(getActivity(), new OnCompleteListener<AuthResult>() {\r\n @Override\r\n public void onComplete(@NonNull Task<AuthResult> task) {\r\n if (!task.isSuccessful()) {\r\n Snackbar.make(view.findViewById(R.id.layout), \"sign up error\", Snackbar.LENGTH_SHORT).show();\r\n } else {\r\n String uid = FirebaseAuth.getInstance().getCurrentUser().getUid();\r\n\r\n //Saves the user's info in the database\r\n Map<String, Object> mNewUserMap = new HashMap<>();\r\n mNewUserMap.put(\"email\", email);\r\n mNewUserMap.put(\"name\", name);\r\n\r\n FirebaseDatabase.getInstance().getReference().child(\"users\").child(uid).updateChildren(mNewUserMap);\r\n }\r\n }\r\n });\r\n\r\n }", "public void registerUser(RegisterForm form) throws DAOException;", "@Override\r\n\tpublic void save(User user) {\n\t\t\r\n\t}", "public void insert(User user);", "@Override\n\tpublic G_User registerUser(G_User d) {\n\t\tif (ValidationUtils.isValid(d)) {\n\t\t\tif (!ValidationUtils.isValid(d.getAvatar())) {\n\t\t\t\td.setAvatar(\"unknown.png\");\n\t\t\t}\n\n\t\t\td.setActive(true);\n\n\t\t\td.setLastlogin(0l);\n\t\t\td.setNumberlogins(0);\n\t\t\treturn uDao.save(d);\n\t\t}\n\t\treturn null;\n\t}", "@Override\n\tpublic boolean save(User user) {\n\t\tString userHash = UUID.randomUUID().toString();\n\t\tuser.setUserHash(userHash);\n\t\tboolean status = userRepository.save(user);\n\t\tif (status) {\n\t\t\tSystem.out.println(\"USER ID : \" + user.getId());\n\t\t\tSystem.out.println(\"User has been inserted!\");\n\t\t} else {\n\t\t\tSystem.out.println(\"User has not been inserted!.\");\n\t\t}\n\t\treturn status;\n\t}", "@PostMapping(\"/process_register\")\n public String processRegistration(User user,Model model)\n throws SignatureException, NoSuchAlgorithmException, InvalidKeyException{\n\n //checking if user exists\n if(userService.existByLogin(user.getLogin())) {\n model.addAttribute(\"error\", true);\n return \"registerForm\";\n }\n\n model.addAttribute(\"user\", user);\n //saving user\n /* userRepository.save(user);*/\n userService.saveUser(user, Sha512.generateSalt().toString());\n return \"registerSuccessful\";\n }", "@Transactional\n\tpublic User save(User user) {\n\t\treturn userRepository.save(user);\n\t}", "@Transactional\n\t@Override\n\tpublic void createUser(User user) {\n\t\tString token = UUID.randomUUID().toString();\n\t\tCalendar cal = Calendar.getInstance();\n\t\tcal.add(Calendar.DAY_OF_YEAR, 1);\n\n\t\tuser.setExpiryDate(cal.getTime());\n\t\tuser.setToken(token);\n\t\tAccount account = user.getAccount();\n\t\tRole role = new Role(\"ROLE_CUSTOMER\");\n\t\taccount.setRole(role);\n\t\taccount.setEnabled(false);\n\t\taccountService.createAccount(account);\n\t\tuserRepository.insertUser(user);\n\t\tthis.sendRegistrationToken(user);\n\t}", "@Override\npublic String createUser(String userAccount, String userPassword,\n\t\tString userSex, String userEmail, String userName) {\n\t\n\tUser user = new User(userAccount, userPassword, userSex , userEmail, userName);\n\tem.persist(user) ;\n\t return \n\t\t\t \"Account: \" + user.getUserAccount() + \"\\n\" +\n\t\t\t\"Password: \" + user.getUserPassword() + \"\\n\" + \n\t\t\t\"Sex: \" + user.getUserSex() + \"\\n\" +\n\t\t\t\"Email: \" + user.getUserEmail() + \"\\n\" +\n\t\t\t\"Name: \" + user.getUserName();\n\n\t\n}", "@Override\n public void performRegister(final String name, final String email, final String gender, final String password){\n\n mAuth.createUserWithEmailAndPassword(email.toLowerCase(),password)\n .addOnCompleteListener(new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n User user = new User();\n user.setName(name);\n user.setEmail(email.toLowerCase());\n user.setGender(gender);\n user.setPassword(password);\n FirebaseDatabase.getInstance().getReference(\"Users\")\n .child(FirebaseAuth.getInstance().getCurrentUser().getUid())\n .setValue(user).addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n if (task.isSuccessful()) {\n Toast.makeText(context, \"Authentication Success.\",\n Toast.LENGTH_LONG).show();\n view.redirectToLogin();\n } else {\n Toast.makeText(context, \"Authentication Failed.\",\n Toast.LENGTH_LONG).show();\n }\n }\n });\n } else {\n Log.w(TAG, \"createUserWithEmail:failure\", task.getException());\n Toast.makeText(context, \"Authentication failed.\",\n Toast.LENGTH_SHORT).show();\n }\n }\n });\n\n }", "public void register(String firstname, String lastname, String username, String email, String password) {\n BasicDBObject query = new BasicDBObject();\n query.put(\"firstname\", firstname);\n query.put(\"lastname\", lastname);\n query.put(\"username\", username);\n query.put(\"email\", email);\n query.put(\"password\", password);\n query.put(\"rights\", 0);\n users.save(query);\n System.out.println(\"### DATABASE: user \" + username + \" registered ... password hash: \" + password);\n }", "@Transactional\r\n\tpublic void saveRegisteredUser(Tswacct tswacct, Users users) {\n\t\tsaveUsers(tswacct, users, users.getCustomer().getCustomerId());\r\n\t\t\r\n\t}", "public void register(RegistrationDTO p) throws UserExistException {\n userLogic.register((Person) p);\n }", "public void registerUser(String username, String email, String password, String firstName, String surname, String userType, String staffID)\n throws UsernameTakenException, IncorrectStaffIDException, StaffIDTakenException, EmptyUserInputException, NotValidEmailException {\n register.registerUser(username, email, password, firstName, surname, userType, staffID);\n }", "public void createUser() {\n try {\n conn = dao.getConnection();\n\n ps = conn.prepareStatement(\"INSERT INTO Users(username, password) VALUES(?, ?)\");\n ps.setString(1, this.username);\n ps.setString(2, this.password);\n\n ps.execute();\n\n ps.close();\n conn.close();\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "@Override\n\tpublic void saveUser(User user) {\n\t\tmongoTemplate.save(user);\n\t}", "public UserEntity save(UserEntity userEntity);", "public void saveUser(User_registerDto user_registerDto) {\n\t\tUser_login user_login = new User_login();\r\n\t\tString password=user_registerDto.getPassword();\r\n\t\tuser_login.setEmail(user_registerDto.getEmail());\r\n\t\tuser_login.setPassword(bcryptEncoder.encode(password));\r\n\t\tuser_login.getRole().setId(user_registerDto.getRole_id());\r\n\t\t\r\n\t\tUser_info user_info = new User_info();\r\n\r\n\t\tuser_info.setId(user_registerDto.getId());\r\n\t\tuser_info.setName(user_registerDto.getName());\r\n\t\tuser_info.setAddress(user_registerDto.getAddress());\r\n\t\tuser_info.setPhno(user_registerDto.getPhno());\r\n\t\tuser_info.setNrc(user_registerDto.getNrc());\r\n\t\tFileUpload uploaded_file=new FileUpload();\r\n\t\tuploaded_file.setFile(user_registerDto.getPhoto());\r\n\t\tuser_info.setPhoto(file_detailsDao.upload_File(uploaded_file));\r\n\t\tuser_info.getDepartment().setId(user_registerDto.getDepartment_id());\r\n\t\t\r\n\t\tuser_loginDao.saveOrUpdateUser_login(user_login);\r\n\t\tlong login_id=user_loginDao.findUserByEmail(user_login.getEmail()).getId();\r\n\t\tuser_info.getUser_login().setId(login_id);\r\n\t\tuser_infoDao.saveOrUpdateUser_info(user_info);\r\n\t\t\r\n\t}" ]
[ "0.8183175", "0.7612976", "0.7598531", "0.7562941", "0.74167234", "0.7375949", "0.73724", "0.73712444", "0.73531973", "0.7328712", "0.7302794", "0.72419053", "0.7238588", "0.72211987", "0.7208761", "0.71356565", "0.71254677", "0.7124306", "0.7111939", "0.7107494", "0.70847785", "0.70830786", "0.70813733", "0.70811445", "0.7078116", "0.7075258", "0.706077", "0.70606226", "0.70572925", "0.7044283", "0.7025707", "0.70208025", "0.701859", "0.69983536", "0.6998139", "0.69935095", "0.6985479", "0.69773084", "0.6964482", "0.6952941", "0.6950971", "0.69436556", "0.6940987", "0.693684", "0.6925951", "0.69183", "0.68994313", "0.6880223", "0.68710697", "0.686627", "0.68426734", "0.68341076", "0.6833594", "0.6824325", "0.6817155", "0.6815388", "0.67840207", "0.6777332", "0.6775426", "0.6774068", "0.6774003", "0.67702967", "0.67702746", "0.6766093", "0.6742324", "0.6730193", "0.6720762", "0.6720343", "0.67186624", "0.67137426", "0.66976523", "0.6691898", "0.66881526", "0.66872275", "0.6679157", "0.66748065", "0.66714686", "0.66667545", "0.6666472", "0.6663148", "0.6655541", "0.6647965", "0.6646064", "0.663815", "0.66369236", "0.66289306", "0.66268134", "0.66098255", "0.66087943", "0.66079134", "0.6606631", "0.66059417", "0.6604871", "0.6601289", "0.6600338", "0.6598537", "0.65912867", "0.6590617", "0.6589044", "0.6587553" ]
0.7873012
1
Interface etendue par les interfaces locale et remote du manager
public interface ConditionPaiementManager extends GenericManager<ConditionPaiement, Long> { public final static String SERVICE_NAME = "ConditionPaiementManager"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface LocalizationService {\n\n /**\n *\n * @param locale - the languge that we like to present\n * @return\n */\n Map<String, String> getAllLocalizationStrings(Locale locale);\n\n /**\n * @param prefix - show all strings which start with thr prefix\n * @param locale - the languge that we like to present\n * @return\n */\n// Map<String, String> getAllLocalizationStringsByPrefix(String prefix, Locale locale);\n\n\n /**\n * @param key - the specific key\n * @param locale - the language that we like to present\n * @return\n */\n String getLocalizationStringByKey(String key, Locale locale);\n\n /**\n * Get the default system locale\n * @return\n */\n Locale getDefaultLocale();\n\n /**\n * Get evidence name\n * @param evidence\n * @return\n */\n String getIndicatorName(Evidence evidence);\n\n\n String getAlertName(Alert alert);\n\n Map<String,Map<String, String>> getMessagesToAllLanguages();\n}", "public interface Locale {\n public String getStringById(int stringId);\n}", "@Local\r\npublic interface MatiereDltManagerLocal\r\n extends MatiereDltManager\r\n{\r\n\r\n\r\n}", "@Remote\r\npublic interface AdministrarGestionarLocalesCentroComercialBORemote {\r\n\r\n /**\r\n * Metodo encargado de obtener los registros de LocalCentroComercial de la\r\n * base de datos\r\n *\r\n * @return Lista de LocalCentroComercial\r\n */\r\n public List<LocalCentroComercial> consultarLocalesCentroComercialRegistrados();\r\n\r\n /**\r\n * Metodo encargado de obtener los registros de LocalCentroComercial por\r\n * medio de parametros de busqueda\r\n *\r\n * @param filtros Parametros de busqueda\r\n * @return Lista de LocalCentroComercial\r\n */\r\n public List<LocalCentroComercial> consultarLocalesCentroComercialPorParametro(Map<String, String> filtros);\r\n\r\n /**\r\n * Metodo encargado de obtener un LocalCentroComercial por medio de su id\r\n *\r\n * @param idLocalCentroComercial Id del local\r\n * @return LocalCentroComercial identificado por el id dado\r\n */\r\n public LocalCentroComercial obtenerLocalCentroComercialPorID(BigInteger idLocalCentroComercial);\r\n\r\n /**\r\n * Metodo encargado de actualizar la informacion de un LocalCentroComercial\r\n *\r\n * @param localCentroComercial LocalCentroComercial a editar\r\n */\r\n public void actualizarInformacionLocalCentroComercial(LocalCentroComercial localCentroComercial);\r\n\r\n /**\r\n * Metodo encargado de registrar un LocalCentroComercial en la base de datos\r\n *\r\n * @param localCentroComercialNuevo LocalCentroComercial a registrar\r\n */\r\n public void almacenarNuevoLocalCentroComercialEnSistema(LocalCentroComercial localCentroComercialNuevo);\r\n\r\n /**\r\n * Metodo encargado de validar si el numero de local ya esta registradp\r\n *\r\n * @param numeroLocal Numero local\r\n * @return true -> no existe / false -> ya existe\r\n */\r\n public Boolean obtenerLocalPorNumeroLocal(String numeroLocal);\r\n}", "public interface I18NService {\n Pagination<I18N> find(I18NQuery query, int pageNo, int pageSize);\n\n I18N get(String id);\n\n String save(I18NSave request);\n}", "public interface Translator\n{\n Locale SWEDISH = Locale.forLanguageTag(\"sv\");\n\n List<Locale> supportedLanguages();\n Map<Locale, List<Locale>> supportedDirections();\n Translation translate(Translation message);\n String pageTranslationURL(String sourceURL, Translation message);\n}", "public DefaultLocalesManager() {\r\n\t}", "@Local\r\npublic interface PrepaSalaireManagerLocal\r\n extends PrepaSalaireManager\r\n{\r\n\r\n\r\n}", "public interface ILocalizationListener {\r\n\t/**\r\n\t * Does something when localization changes\r\n\t */\r\n\tvoid localizationChanged();\r\n}", "public interface ResourceManager extends RemoteService{\n\n /**\n * This method returns a list of the resources.\n *\n * @return This list of resources.\n * @throws ResourcesException\n */\n public List<ResourceBase> listTypes() throws ResourceException;\n}", "public interface LanguageInterface {\n public void setLanguage();\n}", "public interface Message {\n public OptionsImpl getConfirm();\n\n public List<SystemImpl> getAddressees();\n\n}", "@Remote\npublic interface PasseUneCommande {\n\n public Commande passeUneCommande(Double prixHT,String rendezvous,String cookies);\n\n public List<String> choisirCookies();\n\n public List<Commande> getCommandes();\n\n\n}", "private void init() {\n\t\t\n\t\tPropertiesManager propertiesManager = PropertiesManager.getInstance();\n\t\tFile localeDirectory = new File(propertiesManager.getProperty(\"locale.directory\", LOCALE_DIRECTORY));\n\n\t\tlocales = new ArrayList<Locale>();\n\n\t\ttry {\n\t\t\t\n\t\t\tClassUtils.addClassPathFile(localeDirectory);\n\t\t\t\n\t\t\t// Находим все доступные локали\n\t\t\tlocales = findAvailableLocales(localeDirectory);\n\n\t\t} catch(Exception ignore) {}\n\n\t\tfallbackLocale = Locale.ENGLISH;\n\t\tcontrol = new Control();\n\n\t\tif(!locales.contains(Locale.ENGLISH)) {\n\t\t\tlocales.add(0, fallbackLocale);\n\t\t}\n\n\t\tdefaultLocale = locales.get(locales.indexOf(Locale.ENGLISH));\n\t\t\n\t\tString language = propertiesManager.getProperty(\"locale.language\", \"\");\n\t\tString country = propertiesManager.getProperty(\"locale.country\", \"\");\n\t\tString variant = propertiesManager.getProperty(\"locale.variant\", \"\");\n\t\t\n\t\tLocale locale = new Locale(language, country, variant);\n\t\t\n\t\tif(locales.contains(locale)) {\n\t\t\tlocale = locales.get(locales.indexOf(locale));\n\t\t} else {\n\t\t\tlocale = defaultLocale;\n\t\t}\n\n\t\tsetLocale(locale);\n\t\t\n\t\tif(FontEditor.DEBUG) {\n\t\t\t\n\t\t\tfor(Locale l : locales) {\n\t\t\t\tSystem.out.println(\"locale found -> \" + l.getDisplayLanguage(Locale.ENGLISH));\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"Total locale(s) found: \" + locales.size());\n\t\t\tSystem.out.println();\n\t\t}\n//System.out.println(\">>> \" + getValue(\"shitd\"));\n\t}", "public List<LocalCentroComercial> consultarLocalesCentroComercialRegistrados();", "public interface LocaleContext {\n Locale getLocale();\n}", "@Local\npublic interface CobranzaServiceLocal {\n\n ResumenInicialVO getCarteraPorTramos(List<Object[]> resultList);\n\n Response obtenerDocumentosSAP(Request request);\n\n Response getCargosSAP(Request request);\n}", "public interface InterfaceServeurClient extends Remote {\n\n\tpublic void setServeur(InterfaceServeurClient serveur) throws RemoteException;\n\tpublic void setListeClient(ArrayList<InterfaceServeurClient> client) throws RemoteException;\n\tpublic Partie getPartie() throws RemoteException;\n\tpublic void ajouterClient(InterfaceServeurClient client) throws RemoteException;\n\tpublic boolean retirerClient(InterfaceServeurClient client) throws RemoteException;\n\tpublic InterfaceServeurClient getServeur() throws RemoteException;\n\tpublic String getNamespace() throws RemoteException;\n\tpublic String getNomJoueur() throws RemoteException;\n\tpublic int getIdObjetPartie() throws RemoteException;\n\tpublic void setIdObjetPartie(int idObjetPartie) throws RemoteException;\n\tpublic ArrayList<Dynastie> getListeDynastie() throws RemoteException;\n\tpublic void setListeDynastie(ArrayList<Dynastie> liste) throws RemoteException;\n\tpublic ArrayList<Dynastie> getListeDynastieDispo() throws RemoteException;\n\tpublic void setJoueur(Joueur j) throws RemoteException;\n\n\tpublic boolean deconnecter() throws RemoteException;\n\n\tpublic void notifierChangement(ArrayList<Object> args) throws RemoteException;\n\tpublic void addListener(ChangeListener listener) throws RemoteException;\n\tpublic void removeListener(ChangeListener listener) throws RemoteException;\n\tpublic void clearListeners() throws RemoteException;\n\tpublic Joueur getJoueur() throws RemoteException;\n\tpublic void setPartieCourante(Partie partie) throws RemoteException;\n\tpublic ArrayList<InterfaceServeurClient> getClients() throws RemoteException;\n\tpublic boolean send(Action action, int idClient) throws RemoteException;\n\tpublic void passerTour() throws RemoteException;\n\n\tpublic void switchJoueurEstPret(InterfaceServeurClient client) throws RemoteException;\n\tpublic void switchJoueurPret() throws RemoteException;\n\tpublic boolean setDynastieOfClient(InterfaceServeurClient client, Dynastie dynastie) throws RemoteException;\n\tpublic void setDynastie(Dynastie d) throws RemoteException;\n\tpublic void libererDynastie(Dynastie d) throws RemoteException;\n\tpublic int getUniqueId() throws RemoteException;\n\n\tpublic void envoyerNouveauConflit(Conflits conflit, int idClient) throws RemoteException;\n\tpublic void envoyerRenforts(ArrayList<TuileCivilisation> renforts, Joueur joueur) throws RemoteException;\n\tpublic boolean piocherCartesManquantes(Joueur j) throws RemoteException;\n\tpublic void finirPartie() throws RemoteException;\n\tpublic void envoyerPointsAttribues(Joueur joueur) throws RemoteException;\n\tpublic ArrayList<Joueur> recupererListeJoueurPartie() throws RemoteException;\n\tpublic void chargerPartie() throws RemoteException;\n}", "@Remote\r\npublic interface ViewAnniversaireManagerRemote\r\n extends ViewAnniversaireManager\r\n{\r\n\r\n\r\n}", "private LocaleManager() {\n\t\t\n\t\tinit();\n\t}", "public interface ILamportServer extends Remote {\n public String SERVICE_NAME = \"LAMPORT_RMI\"; // Nom du service\n \n /**\n * Envoie un Message REQUEST aux autres serveurs pour annoncer le fait de \n * vouloir rentrer dans la section critique\n * @param message Le message envoyé avec une requête\n * @throws RemoteException \n */\n public void request(Message message) throws RemoteException;\n \n /**\n * Envoi du Message RESPONSE après avoir Reçu le Message REQUEST\n * @param message Le message envoyé avec une réponse\n * @throws RemoteException \n */\n public void response(Message message) throws RemoteException;\n \n /**\n * Envoie du message FREE pour indiquer aux autres serveur que l'on sort de\n * la section critique\n * @param message Le message envoyé pour libérer la section critique\n * @throws RemoteException \n */\n public void freeSC(Message message) throws RemoteException;\n \n /**\n * Métode pour modifier la variable globalle dans tous les serveurs\n * @param newValue La nouvelle valeur de la variable\n * @throws RemoteException \n */\n public void setVariableGlobally(int newValue) throws RemoteException;\n}", "public interface LocaleProvider {\n\tLocale getLocale();\n}", "public interface IBemListaInteractor {\n\n void buscarBensPorDepartamento(IBemListaPresenter listener);\n void atualizarListaBens(IBemListaPresenter listener);\n void buscarBemTipo(Context context, IBemListaPresenter listener);\n void buscarDadosQrCode(IBemListaPresenter listener);\n\n}", "public interface SupportedLocales {\n\n Locale getDefaultLocale();\n\n Collection<Locale> getSupportedLocales();\n\n SupportedLocales withLocale(Locale locale);\n\n SupportedLocales withLocaleParsingPolicy(LocalePolicy localeParsingPolicy);\n\n SupportedLocales withLocaleLookupPolicy(LocalePolicy localeLookupPolicy);\n\n Locale filterForParsing(Locale locale);\n\n Locale filterForLookup(Locale locale);\n\n LocalePolicy getLocaleParsingPolicy();\n\n LocalePolicy getLocaleLookupPolicy();\n}", "@Local\r\npublic interface ResourceRegistryDAOLocal\r\n extends ResourceRegistryDAO\r\n{\r\n\r\n\r\n}", "public void setLang() {\n new LanguageManager() {\n @Override\n public void engLanguage() {\n mFirstCurrencyTitle = getString(R.string.converter_main_currency_eng);\n mSaleTitle = getString(R.string.converter_sale_eng);\n mPurchaseTitle = getString(R.string.converter_purchase_eng);\n mCountTitle = getString(R.string.converter_count_of_currencies_eng);\n eTTitle.setText(getResources().getString(R.string.drawer_item_converter_eng));\n tVChosenCurrency.setText(mMainListForActions.get(mPositionOfCurInList)\n .getCurrency().getTitleEng().toUpperCase());\n tVChosenOrganizationTitle.setText(mMainListForActions.get(mPositionOfCurInList)\n .getOrganizations().get(mPositionOfOrgInList).getTitleEng());\n tVSecondCurrency.setText(mMainListForActions.get(mPositionOfCurInList)\n .getCurrency().getTitleEng().toUpperCase().concat(\" (\").concat(mCurrencyShortForm).concat(\")\"));\n mCurrencyDialogTitle = getString(R.string.drawer_item_currencies_eng);\n mOrganizationDialogTitle = getString(R.string.drawer_item_organizations_eng);\n mActionDialogTitle = getString(R.string.converter_dialog_action_title_eng);\n mToastFailure = getString(R.string.converter_toast_failure_eng);\n mTitle = getResources().getString(R.string.drawer_item_converter_eng);\n mMessage = getString(R.string.dialog_template_text_eng);\n mTitleButtonOne = getString(R.string.dialog_template_edit_eng);\n mTitleButtonTwo = getString(R.string.dialog_template_create_eng);\n mToastEdited = getString(R.string.converter_toast_template_edit_eng);\n mToastCreated = getString(R.string.converter_toast_template_create_eng);\n mMessageFinal = getString(R.string.converter_final_dialog_text_eng);\n mTitleButtonOneFinal = getString(R.string.converter_final_dialog_yes_eng);\n mTitleButtonTwoFinal = getString(R.string.converter_final_dialog_no_eng);\n }\n\n @Override\n public void ukrLanguage() {\n mFirstCurrencyTitle = getString(R.string.converter_main_currency_ukr);\n mSaleTitle = getString(R.string.converter_sale_ukr);\n mPurchaseTitle = getString(R.string.converter_purchase_ukr);\n mCountTitle = getString(R.string.converter_count_of_currencies_ukr);\n eTTitle.setText(getResources().getString(R.string.drawer_item_converter_ukr));\n tVChosenCurrency.setText(mMainListForActions.get(mPositionOfCurInList)\n .getCurrency().getTitleUkr().toUpperCase());\n tVChosenOrganizationTitle.setText(mMainListForActions.get(mPositionOfCurInList)\n .getOrganizations().get(mPositionOfOrgInList).getTitleUkr());\n tVSecondCurrency.setText(mMainListForActions.get(mPositionOfCurInList)\n .getCurrency().getTitleUkr().toUpperCase().concat(\" (\").concat(mCurrencyShortForm).concat(\")\"));\n mCurrencyDialogTitle = getString(R.string.drawer_item_currencies_ukr);\n mOrganizationDialogTitle = getString(R.string.drawer_item_organizations_ukr);\n mActionDialogTitle = getString(R.string.converter_dialog_action_title_ukr);\n mToastFailure = getString(R.string.converter_toast_failure_ukr);\n mTitle = getResources().getString(R.string.drawer_item_converter_ukr);\n mMessage = getString(R.string.dialog_template_text_ukr);\n mTitleButtonOne = getString(R.string.dialog_template_edit_ukr);\n mTitleButtonTwo = getString(R.string.dialog_template_create_ukr);\n mToastEdited = getString(R.string.converter_toast_template_edit_ukr);\n mToastCreated = getString(R.string.converter_toast_template_create_ukr);\n mMessageFinal = getString(R.string.converter_final_dialog_text_ukr);\n mTitleButtonOneFinal = getString(R.string.converter_final_dialog_yes_ukr);\n mTitleButtonTwoFinal = getString(R.string.converter_final_dialog_no_ukr);\n }\n\n @Override\n public void rusLanguage() {\n mFirstCurrencyTitle = getString(R.string.converter_main_currency_rus);\n mSaleTitle = getString(R.string.converter_sale_rus);\n mPurchaseTitle = getString(R.string.converter_purchase_rus);\n mCountTitle = getString(R.string.converter_count_of_currencies_rus);\n eTTitle.setText(getResources().getString(R.string.drawer_item_converter_rus));\n tVChosenCurrency.setText(mMainListForActions.get(mPositionOfCurInList)\n .getCurrency().getTitleRus().toUpperCase());\n tVChosenOrganizationTitle.setText(mMainListForActions.get(mPositionOfCurInList)\n .getOrganizations().get(mPositionOfOrgInList).getTitleRus());\n tVSecondCurrency.setText(mMainListForActions.get(mPositionOfCurInList)\n .getCurrency().getTitleRus().toUpperCase().concat(\" (\").concat(mCurrencyShortForm).concat(\")\"));\n mCurrencyDialogTitle = getString(R.string.drawer_item_currencies_rus);\n mOrganizationDialogTitle = getString(R.string.drawer_item_organizations_rus);\n mActionDialogTitle = getString(R.string.converter_dialog_action_title_rus);\n mToastFailure = getString(R.string.converter_toast_failure_rus);\n mTitle = getResources().getString(R.string.drawer_item_converter_rus);\n mMessage = getString(R.string.dialog_template_text_rus);\n mTitleButtonOne = getString(R.string.dialog_template_edit_rus);\n mTitleButtonTwo = getString(R.string.dialog_template_create_rus);\n mToastEdited = getString(R.string.converter_toast_template_edit_rus);\n mToastCreated = getString(R.string.converter_toast_template_create_rus);\n mMessageFinal = getString(R.string.converter_final_dialog_text_rus);\n mTitleButtonOneFinal = getString(R.string.converter_final_dialog_yes_rus);\n mTitleButtonTwoFinal = getString(R.string.converter_final_dialog_no_rus);\n }\n };\n getDataForActionDialog();\n setData();\n }", "public interface ResourceManager {\r\n\r\n\t/**\r\n\t * Adds a resource bundle to be managed by the resource manager.\r\n\t * \r\n\t * @param bundleBaseName - the base name of the bundle to add.\r\n\t * @param locales - an array with the locales to consider for the bundle to add \r\n\t */\r\n\tvoid addBundle(String bundleBaseName, Locale... locales);\r\n\t\r\n\t/**\r\n\t * Gets the localized text for the specified bundle key, and for the resource manager default locale\r\n\t * \r\n\t * @param bundleKey\t- the key of the requested text in the resource bundle\r\n\t * @return the requested localized text\r\n\t */\r\n\tString getString(String bundleKey);\r\n\r\n\t/**\r\n\t * Gets the localized text for the specified bundle key and for the specified locale.\r\n\t * \r\n\t * @param bundleKey\t- the key of the requested text in the resource bundle\r\n\t * @param locale\t- the locale of the resource bundle\r\n\t * @return the requested localized text\r\n\t */\r\n\tString getString(String bundleKey, Locale locale);\r\n\r\n\t/**\r\n\t * Gets the localized text for the specified bundle key,\r\n\t * in the resource bundle with the given base name, and for the resource manager default locale\r\n\t * \r\n\t * @param bundleKey\t\t - the key of the requested text in the resource bundle\r\n\t * @param bundleBaseName - the name of the bundle where the localized text should be found\r\n\t * @return the requested localized text\r\n\t */\r\n\tString getString(String bundleKey, String bundleBaseName);\r\n\r\n\t/**\r\n\t * Gets the localized text for the specified bundle key,\r\n\t * from the resource bundle with the given base name, and for the specified locale.\r\n\t * \r\n\t * @param bundleKey\t\t - the key of the requested text in the resource bundle\r\n\t * @param bundleBaseName - the name of the bundle where the localized text should be found\r\n\t * @param locale \t\t - the locale of the resource bundle\r\n\t * @return the requested localized text\r\n\t */\r\n\tString getString(String bundleKey, String bundleBaseName, Locale locale);\r\n\r\n\t/**\r\n\t * Gets the localized text message for the specified bundle key, and for the resource manager default locale.<br/>\r\n\t * If the requested message contains place holders, they will be substituted by the given arguments\r\n\t * \r\n\t * @param bundleKey - the key of the requested message in the resource bundle\r\n\t * @param args \t\t- an object array with substitution parameters for the message\r\n\t * @return the requested localized text message\r\n\t */\r\n\tString getMessage(String bundleKey, Object... args);\r\n\r\n\t/**\r\n\t * Gets the localized text message for the specified bundle key, and for the specified locale.<br/>\r\n\t * If the requested message contains place holders, they will be substituted by the given arguments\r\n\t * \r\n\t * @param bundleKey - the key of the requested message in the resource bundle\r\n\t * @param args \t\t- an object array with substitution parameters for the message\r\n\t * @return the requested localized text message\r\n\t */\r\n\tString getMessage(String bundleKey, Locale locale, Object... args);\r\n\r\n\t/**\r\n\t * Gets the localized text message for the specified bundle key, and for the resource manager default locale.<br/>\r\n\t * If the requested message contains place holders, they will be substituted by the given arguments\r\n\t * \r\n\t * @param bundleKey \t - the key of the requested message in the resource bundle\r\n\t * @param bundleBaseName - the name of the bundle where the value should be found\r\n\t * @param locale\t\t - the locale of the resource bundle\r\n\t * @param args \t\t\t - an object array with substitution parameters for the message\r\n\t * @return the requested localized text message\r\n\t */\r\n\tString getMessage(String bundleKey, String bundleBaseName, Object... args);\r\n\r\n\t/**\r\n\t * Gets the localized text message for the specified bundle key,\r\n\t * from the resource bundle with the given base name, and for the specified locale.<br/>\r\n\t * If the requested message contains place holders, they will be substituted by the given arguments\r\n\t * \r\n\t * @param bundleKey \t - the key of the requested message in the resource bundle\r\n\t * @param bundleBaseName - the name of the bundle where the localized text message should be found\r\n\t * @param locale\t\t - the locale of the resource bundle\r\n\t * @param args \t\t\t - the array with substitution parameters for the message\r\n\t * @return the requested localized text message\r\n\t */\r\n\tString getMessage(String bundleKey, String bundleName, Locale locale, Object... args);\r\n\t\r\n\t/**\r\n\t * Gets the localized object for the specified bundle key, and for the resource manager default locale<br/>\r\n\t * This method should be used only if resources are stored in a subclass of {@link ResourceBundle}\r\n\t * \r\n\t * @param bundleKey - the key of the requested localized object in the resource bundle\r\n\t * @return the requested localized object\r\n\t */\r\n\tObject getObject(String bundleKey);\r\n\t\r\n\t/**\r\n\t * Gets the localized object for the specified bundle key, and for specified locale<br/>\r\n\t * This method should be used only if resources are stored in a subclass of {@link ResourceBundle}\r\n\t * \r\n\t * @param bundleKey - the key of the requested localized object in the resource bundle\r\n\t * @param locale\t- the locale of the resource bundle\r\n\t * @return the requested localized object\r\n\t */\r\n\tObject getObject(String bundleKey, Locale locale);\r\n\t\r\n\t/**\r\n\t * Gets the localized object for the specified bundle key,\r\n\t * from the resource bundle with the given name, and for the resource manager default locale<br/>\r\n\t * This method should be used only if resources are stored in a subclass of {@link ResourceBundle}\r\n\t * \r\n\t * @param bundleKey \t - the key of the requested localized object in the resource bundle\r\n\t * @param bundleBaseName - the name of the bundle where the localized object should be found\r\n\t * @return the requested localized object\r\n\t */\r\n\tObject getObject(String bundleKey, String bundleBaseName);\r\n\t\r\n\t/**\r\n\t * Gets the localized object for the specified bundle key,\r\n\t * from the resource bundle with the given name, and for specified locale<br/>\r\n\t * This method should be used only if resources are stored in a subclass of {@link ResourceBundle}\r\n\t * \r\n\t * @param bundleKey \t - the key of the requested localized object in the resource bundle\r\n\t * @param bundleBaseName - the name of the bundle where the localized object should be found\r\n\t * @param locale\t \t - the locale of the resource bundle\r\n\t * @return the requested localized object\r\n\t */\r\n\tObject getObject(String bundleKey, String bundleBaseName, Locale locale);\r\n\t\r\n\t/**\r\n\t * Indicates if the resource manager has to return <code>null</code> if a resource is missing\r\n\t * @return <code>true</code> if the resource manager has to return <code>null</code> for missing\r\n\t * resources, <code>false</code> otherwise\r\n\t */\r\n\tboolean isNullable();\r\n\t\r\n\t/**\r\n\t * Indicates if the resource manager has to return <code>null</code> if a resource is missing\r\n\t * @param nullable - <code>true</code> if the resource manager has to return <code>null</code>\r\n\t * \t\t\t\t\t for missing resource, <code>false</code> otherwise\r\n\t */\r\n\tvoid setNullable(boolean nullable);\r\n\r\n\t/**\r\n\t * Gets a set with the locales managed by the resource manager\r\n\t * @return a set of the locales managed by the resource manager\r\n\t */\r\n\tSet<Locale> getManagedLocales();\r\n\r\n\t/**\r\n\t * Gets the locale currently used as default by the resource manager\r\n\t * @return the locale currently used as default by the resource manager\r\n\t */\r\n\tLocale getDefaultLocale();\r\n}", "@Remote\r\npublic interface MenuActionManagerRemote\r\n extends MenuActionManager\r\n{\r\n\r\n\r\n}", "@Local\r\npublic interface CiviliteManagerLocal\r\n extends CiviliteManager\r\n{\r\n\r\n\r\n}", "public interface GestionAsintomaticosInt extends Remote\n{\n \n public boolean registrarAsintomatico(PacienteCllbckInt objPaciente, int idPaciente) throws RemoteException;\n public boolean enviarIndicador(int id, float ToC) throws RemoteException;\n}", "@Local\r\npublic interface CalendarRecordManagerLocal\r\n extends CalendarRecordManager\r\n{\r\n\r\n\r\n}", "public interface MainUiMessages extends Messages {\n String login();\n String password();\n String submit();\n String exit();\n}", "public void setLocalisation(final Room pLocalisation){this.aLocalisation = pLocalisation;}", "public Room getLocalisation(){return this.aLocalisation;}", "public interface LocalHandle {\n\n /**\n * 获取城市名称\n *\n * @param city\n */\n public void getCity(String city);\n}", "public interface Mensaje_SMS_ACSLocal extends javax.ejb.EJBLocalObject {\n\t/**\n\t * Get accessor for persistent attribute: id\n\t */\n\tpublic java.lang.Long getId();\n\t/**\n\t * Set accessor for persistent attribute: id\n\t */\n\tpublic void setId(java.lang.Long newId);\n\t/**\n\t * Get accessor for persistent attribute: xml\n\t */\n\tpublic java.lang.String getXml();\n\t/**\n\t * Set accessor for persistent attribute: xml\n\t */\n\tpublic void setXml(java.lang.String newXml);\n\t/**\n\t * Get accessor for persistent attribute: peti_numero\n\t */\n\tpublic java.lang.Long getPeti_numero();\n\t/**\n\t * Set accessor for persistent attribute: peti_numero\n\t */\n\tpublic void setPeti_numero(java.lang.Long newPeti_numero);\n\t/**\n\t * Get accessor for persistent attribute: fecha_envio\n\t */\n\tpublic java.sql.Timestamp getFecha_envio();\n\t/**\n\t * Set accessor for persistent attribute: fecha_envio\n\t */\n\tpublic void setFecha_envio(java.sql.Timestamp newFecha_envio);\n\t/**\n\t * Get accessor for persistent attribute: usuario\n\t */\n\tpublic java.lang.String getUsuario();\n\t/**\n\t * Set accessor for persistent attribute: usuario\n\t */\n\tpublic void setUsuario(java.lang.String newUsuario);\n}", "public interface IRemoteEnvProxyManager extends IRemoteProxyManager {\n \t/**\n \t * Method to get system's environment variables.\n \t *\n\t * @param Project\n\t * IProject\n \t * @return Mapping of environment variables\n \t * @since 2.1\n\t*/\t\n \tpublic Map<String, String> getEnv(IProject project) throws CoreException;\n /**\n * Method to get system's environment variables.\n * \n * @param Resource URI\n * URI\n * @return Mapping of environment variables\n * @since 2.1\n */\n \tpublic Map<String, String> getEnv(URI uri) throws CoreException;\n }", "public interface DialogKonstanten {\n\n String HANDBOOK_TITLE = \"Bedienungsanleitung\";\n String HANDBOOK_HEADER = \"Tastenbelegung und Menüpunkte\";\n String HANDBOOK_TEXT = \"Ein Objekt kann über den Menüpunkt \\\"File -> Load File\\\" geladen werden.\\nZu Bewegung des Objektes wird die Maus verwendet.\\nRMB + Maus: Bewegen\\nLMB + Maus: Rotieren\\nEine Verbindung zu einem anderen Programm wir über den Menüpunkt Network aufgebaut. Der Server wird gestartet indem keine IP eingegeben wird und eine Verbindung zu einem Server wird erreicht indem die jeweilige IP-Adresse in das erste Textfeld eigegeben wird.\";\n\n}", "Set<Locale> getManagedLocales();", "@Remote\r\npublic interface NoteMailManagerRemote\r\n extends NoteMailManager\r\n{\r\n\r\n\r\n}", "@Local\r\npublic interface AdministrativeEJBLocal extends AbstractSolaTransactionEJBLocal {\r\n\r\n List<ChangeStatusType> getChangeStatusTypes(String languageCode);\r\n\r\n List<BaUnitType> getBaUnitTypes(String languageCode);\r\n\r\n List<MortgageType> getMortgageTypes(String languageCode);\r\n\r\n List<RrrGroupType> getRRRGroupTypes(String languageCode);\r\n\r\n List<RrrType> getRRRTypes(String languageCode);\r\n\r\n BaUnit getBaUnitById(String id);\r\n\r\n Rrr getRrr(String id);\r\n\r\n BaUnit getBaUnitByCode(String nameFirstPart, String nameLastPart);\r\n\r\n BaUnit saveBaUnit(String serviceId, BaUnit baUnit);\r\n\r\n List<BaUnit> getBaUnitsByTransactionId(String transactionId);\r\n\r\n List<BaUnitRelType> getBaUnitRelTypes(String languageCode);\r\n\r\n BaUnit terminateBaUnit(String baUnitId, String serviceId);\r\n\r\n BaUnit cancelBaUnitTermination(String baUnitId);\r\n\r\n List<RrrLoc> getRrrLocsById(String locId);\r\n\r\n Moth saveMoth(Moth moth);\r\n\r\n Moth getMoth(String id);\r\n\r\n List<Moth> getMoths(String vdcCode, String mothLuj);\r\n\r\n Moth getMoth(String vdcCode, String mothLuj, String mothLujNumber);\r\n\r\n Loc saveLoc(Loc loc);\r\n\r\n Loc getLoc(String id);\r\n\r\n LocWithMoth getLocWithMoth(String id);\r\n\r\n BaUnit saveBaUnit(BaUnit baUnit);\r\n\r\n LocWithMoth getLocByPageNoAndMoth(LocSearchByMothParams searchParams);\r\n\r\n List<LocWithMoth> getLocListByPageNoAndMoth(LocSearchByMothParams searchParams);\r\n\r\n List<Loc> getLocList(String mothId);\r\n\r\n List<RestrictionReason> getRestrictionReasons(String languageCode);\r\n\r\n List<RestrictionReleaseReason> getRestrictionReleaseReasons(String languageCode);\r\n\r\n List<RestrictionOffice> getRestrictionOffices(String languageCode);\r\n\r\n List<OwnerType> getOwnerTypes(String languageCode);\r\n\r\n List<OwnershipType> getOwnershipTypes(String languageCode);\r\n\r\n List<TenancyType> getTenancyTypes(String languageCode);\r\n\r\n void deletePendingBaUnit(String baUnitId);\r\n\r\n List<Moth> searchMoths(MothSearchParams params);\r\n\r\n List<Moth> searchMothsByParts(String searchString);\r\n}", "void localizationChaneged();", "public SrvI18n() {\n try { //to fix Android Java\n messages = ResourceBundle.getBundle(\"MessagesBundle\");\n } catch (Exception e) {\n Locale locale = new Locale(\"en\", \"US\");\n messages = ResourceBundle.getBundle(\"MessagesBundle\", locale);\n }\n }", "@ImplementedBy(DefaultLanguageInSession.class)\npublic interface LanguageInSession extends ResourceStoringOperations<Locale> {\n\n Optional<Locale> findCountry();\n\n @Override\n void store(@Nullable final Locale locale);\n\n @Override\n void remove();\n}", "public interface ChatMsgManager extends IManager {\r\n\r\n}", "@Local\r\npublic interface EltSalaireDAOLocal\r\n extends EltSalaireDAO\r\n{\r\n\r\n\r\n}", "public interface ServConstrainsManagement {\n /**\n * Obtien la lista de componentes visuales a los cuales no tendra accesso\n * el rol (perfil) que esta operando el sistema\n * @return Lista de componentes visuales que no tiene acceso\n */\n public List<ViewConstrainsEnum> getViewConstrainsUIComponent();\n \n}", "@Remote\r\npublic interface EcheanceReglementManagerRemote\r\n extends EcheanceReglementManager\r\n{\r\n\r\n\r\n}", "public interface I18nConstants {\n // Common\n String userName();\n\n String email();\n\n String confirmEmail();\n\n String password();\n\n String confirmPassword();\n\n String skip();\n\n String close();\n\n String tooltipCloseDialog();\n\n String tooltipMinimize();\n\n String tooltipMaximize();\n\n String highScore();\n\n String limitation();\n\n String houseSpace();\n\n String noMoney();\n\n String notEnoughMoney();\n\n String tooManyItems();\n\n String spaceLimitExceeded();\n\n String unregisteredUser();\n\n String unnamedUser();\n\n String yes();\n\n String no();\n\n String newBase();\n\n String startOver();\n\n String stop();\n\n String mission();\n\n String refresh();\n\n String player();\n\n String planet();\n\n String filter();\n\n String activate();\n\n String cancel();\n\n String start();\n\n String description();\n\n String abort();\n\n String date();\n\n String time();\n\n String event();\n\n String save();\n\n String dismiss();\n\n String nameToShort();\n\n String nameAlreadyUsed();\n\n String unknownErrorReceived();\n\n String name();\n\n String send();\n\n String noSuchUser(String userName);\n\n String change();\n\n String message();\n\n String featureNextRelease();\n\n String featureComingSoon();\n\n String loading();\n\n String serverError();\n\n String connectWithFacebook();\n\n String availableCrystals(String text);\n\n // Login logout\n String login();\n\n String loginFailed();\n\n String loginFailedText();\n\n String loginFailedNotVerifiedText();\n\n String logout();\n\n String logoutQuestion();\n\n String logoutTextFacebook(String name);\n\n String tooltipNotRegistered();\n\n String tooltipNotVerified(String userName);\n\n String tooltipLoggedIn(String userName);\n\n String forgotPassword();\n\n // Radar\n String tooltipRadar();\n\n String tooltipZoomIn();\n\n String tooltipZoomOut();\n\n String tooltipZoomHome();\n\n String tooltipZoomAttack();\n\n String tooltipRadarPageLeft();\n\n String tooltipRadarPageRight();\n\n String tooltipRadarPageUp();\n\n String tooltipRadarPageDown();\n\n String radarNoPower();\n\n String radarNoRadarBuilding();\n\n // Dialogs\n String messageDialog();\n\n String inventory();\n\n String inventoryNotAvailableMission();\n\n String inventoryNotAvailableBase();\n\n String startTutorialFinished();\n\n String questPassed();\n\n String boxPicked();\n\n // Connection\n String connectionFailed();\n\n String connectionLost();\n\n String connectionAnotherExits();\n\n String connectionNone();\n\n String connectionNoneLoggedOut();\n\n String wrongBase();\n\n String notYourBase();\n\n // Sell\n String sellConfirmationTitle();\n\n String sellConfirmation();\n\n String tooltipSell();\n\n // Register dialog\n String unregistered();\n\n String unnamed();\n\n String chatUnregistered();\n\n String chatUnnamed();\n\n String registerFacebookNickname();\n\n String registerThanks();\n\n String registerThanksLong();\n\n String registerConfirmationEmailSent(String email);\n\n String register();\n\n String registerDirect();\n\n String registerFacebook();\n\n String registrationFailed();\n\n String registrationFilled();\n\n String registrationMatch();\n\n String registrationEmailNotValid();\n\n String registrationEmailMatch();\n\n String registrationEmail();\n\n String registrationUser();\n\n String setName();\n\n String registrationPasswordNotValid();\n\n String setNameFailedNotVerifiedText();\n\n // Side Cockpit\n String tooltipEnergy();\n\n String tooltipMute();\n\n String tooltipHighScore();\n\n String tooltipFacebookCommunity();\n\n String tooltipFacebookInvite();\n\n String singlePlayer();\n\n String tooltipAbortMission();\n\n String multiplayer();\n\n // Quests\n String questBotBasesText(String botBases);\n\n String nextPlanet();\n\n String tooltipNextPlanet();\n\n String questDialog();\n\n String tooltipQuestDialog();\n\n String questVisualisation();\n\n String tooltipQuestVisualisation();\n\n String pressButtonWhenReady();\n\n String tooltipStartMission();\n\n String reward();\n\n String xpReward(int xp);\n\n String razarionReward(int razarion);\n\n String crystalReward(int crystals);\n\n String activeQuest();\n\n String activeQuestAbort();\n\n String questOverview(int questsDone, int totalQuests);\n\n String missionOverview(int missionsDone, int totalMissions);\n\n String youPassedQuest(String questTitle);\n\n String noMoreQuests();\n\n String noActiveQuest();\n\n String questBasesKilled();\n\n String questBoxesPicked();\n\n String questCrystalsIncreased();\n\n String questArtifactItemAdded();\n\n String questResourcesCollected();\n\n String questTimeRemaining();\n\n String questTimeNotFulfilled();\n\n String questBuilt();\n\n String questUnitStructuresBuilt();\n\n String questArtifactItemAddedActionWord();\n\n String questDestroyed();\n\n String questUnitStructuresDestroyed();\n\n String questMinutesPast();\n\n String startMission();\n\n String competeMission();\n\n String go();\n\n String questEnumPvp();\n\n String questEnumPve();\n\n String questEnumBossPve();\n\n String questEnumMission();\n\n String questEnumGather();\n\n String questEnumMoney();\n\n String questEnumBuildup();\n\n String questEnumHoldTheBase();\n\n String questType();\n\n String abortMission();\n\n String reallyAbortMission();\n\n String placeStartItemTitle();\n\n String placeStartItemDescription();\n\n // Dead-end and new base\n String reachedDeadEnd();\n\n String reachedDeadEndItem();\n\n String reachedDeadEndMoney();\n\n String startNewBase();\n\n String baseLostTitle();\n\n String baseLost();\n\n // Item cockpit\n String guildMembershipRequestItemCockpit();\n\n String tooltipLaunchMissile();\n\n String tooltipUpgrade();\n\n String tooltipBuild(String itemName);\n\n String tooltipNoBuildLevel(String itemName);\n\n String tooltipNoBuildLimit(String itemName);\n\n String tooltipNoBuildHouseSpace(String itemName);\n\n String tooltipNoBuildMoney(String itemName);\n\n String botEnemy();\n\n String botNpc();\n\n String playerEnemy();\n\n String playerFriend();\n\n String itemCockpitGuildMember();\n\n String tooltipSelect(String itemName);\n\n String notPlaceHere();\n\n String notPlaceOver();\n\n String containingNoUnits();\n\n String containing1Unit();\n\n String containingXUnits(int count);\n\n String unloadButton();\n\n String unloadButtonTooltip();\n\n // Highscore\n String findMe();\n\n String rank();\n\n String killed();\n\n String killedPve();\n\n String killedPvp();\n\n String basesKilled();\n\n String basesLost();\n\n String created();\n\n String create();\n\n // Inventory\n String useItem();\n\n String workshop();\n\n String dealer();\n\n String funds();\n\n String artifacts();\n\n String buy();\n\n String tooltipAssemble();\n\n String assemble();\n\n String tooltipArtifact(String artifactName);\n\n String youOwn(int ownCount);\n\n String useItemLimit(String itemName);\n\n String useItemHouseSpace();\n\n String useItemMoney();\n\n String enemyTooNear();\n\n String crystalAmount(int crystals);\n\n String cost(int crystalCost);\n\n String leaveBaseNextPlanet();\n\n String goNextPlanet();\n\n String getInventoryItemTitle();\n\n String getInventoryItemNotEnough(String inventoryItemName);\n\n String getArtifactItemTitle();\n\n String getInventoryArtifactNotEnough(String inventoryArtifactName);\n\n // Startup\n String startupClearGame();\n\n String startupLoadRealGameInfo();\n\n String startupDeltaStartRealGame();\n\n String startupLoadUnits();\n\n String startupInitUnits();\n\n String startupRunRealGame();\n\n String startupCheckCompatibility();\n\n String startupLoadJavaScript();\n\n String startupInitGui();\n\n String startupInitRealGame();\n\n String startupPreloadImageSpriteMaps();\n\n String startupLoadSimulationGameInfo();\n\n String startupInitSimulatedGame();\n\n String startupRunSimulatedGame();\n\n String startupDeltaStartSimulatedGame();\n\n // Unlock dialogs\n String unlockDialogTitle();\n\n String unlockDialogText();\n\n String nothingToUnlockDialogText();\n\n String unlockCrystalCost(int crystals);\n\n String unlockFailed();\n\n String unlockNotEnoughCrystals();\n\n // ???\n String createBase();\n\n String createBaseInBotFailed();\n\n String chooseYourStartPoint();\n\n // Menu\n String tooltipMenuNewBaseSimulated();\n\n String tooltipMenuNewBaseRealGame();\n\n String menuNews();\n\n String menuHistory();\n\n String menuTooltipRegisterLogin();\n\n String menuTooltipNews();\n\n String menuTooltipHistory();\n\n String menuTooltipHistoryOnlyRegistered();\n\n String menuTooltipHistoryOnlyRealGame();\n\n String menuTooltipHistoryOnlyRegisteredVerified();\n\n String menuTooltipGuildsMission();\n\n String guildsOnlyRegisteredVerified();\n\n String guildsOnlyRegistered();\n\n String menuTooltipMyGuild();\n\n String menuTooltipGuilds();\n\n String menuMyGuild();\n\n String menuGuilds();\n\n String menuSearchGuilds();\n\n String menuCreateGuild();\n\n String menuGuildInvitations();\n\n String menuInviteFriends();\n\n String menuInviteFriendsTooltip();\n\n String menuGetCrystals();\n\n String menuTooltipGetCrystals();\n\n String menuBuyPaypal();\n\n String menuBuyFacebook();\n\n String menuOverviewGetCrystals();\n\n String menuStarMap();\n\n String menuStarMapTooltip();\n\n String menuStarMapTooltipMission();\n\n // News Dialog\n String newsDialogTitle();\n\n // History Dialog\n String historyDialogTitle();\n\n // Guild dialogs\n String createGuildDialogTitle();\n\n String createGuildDialog();\n\n String myGuildDialogTitle();\n\n String searchGuildDialogTitle();\n\n String member();\n\n String guildRank();\n\n String kick();\n\n String guildKickMember();\n\n String guildKickMemberMessage(String name);\n\n String guildPresident();\n\n String guildManagement();\n\n String guildMember();\n\n String changeRank();\n\n String gildMemberInvited();\n\n String gildMemberInvitedMessage(String userName);\n\n String inviteMember();\n\n String createGuildInsufficientCrystals();\n\n String createGuildCrystalCost(int cost);\n\n String guildText();\n\n String guildMembers();\n\n String guildMembershipRequestTitle();\n\n String guildMembershipRequest();\n\n String guildMembershipRequestSent(String name);\n\n String joinGuild();\n\n String joinGuildMessage(String name);\n\n String dismissGuildMessage(String name);\n\n String guildTab();\n\n String guildMemberTab();\n\n String guildRecruitingTab();\n\n String guildInviteMessage();\n\n String guildMembershipRequestText();\n\n String leaveGuild();\n\n String closeGuild();\n\n String leaveGuildMessage();\n\n String closeGuildMessage();\n\n String guildNameFilter();\n\n String guildInvitations();\n\n String guildInvitationsMessage();\n\n String changeRankText(String name);\n\n String noGuildRequests();\n\n String noGuildInvitations();\n\n String noGuilds();\n\n String guildToSendRequest();\n\n String guildTextShort();\n\n String guildInvitationNotification();\n\n String openGuildInvitation();\n\n String guildMembershipRequestNotification();\n\n String openGuildMembershipRequest();\n\n String guildInvitationNotRegistered(String playerName);\n\n String guildInvitationBaseAbandoned(String playerName);\n\n String userIsAlreadyAGuildMember(String userName);\n\n String guildLostTitle();\n\n String guildLostMessage();\n\n // Chat\n String tooltipChatMenu();\n\n String globalChat();\n\n String guildChat();\n\n String chatMessageFilter();\n\n String chatMessageFilterNoGuild();\n\n // Invite friends\n String inviteFriends();\n\n String inviteFriendsOnlyRegisteredVerified();\n\n String inviteFriendsOnlyRegistered();\n\n String inviteFriendsDescription();\n\n String inviteFriendsViaFacebook();\n\n String inviteFriendsViaMail();\n\n String inviteFriendsViaUrl();\n\n String inviteUrlDescription();\n\n String tabInvite();\n\n String tabComplete();\n\n String sendButton();\n\n String generateButton();\n\n String invitationCrystalBonus();\n\n String crystalBonus();\n\n String fbInviteTitle();\n\n String fbInviteMessage();\n\n String inviteFriendsEmailNotValid();\n\n String invitationEmailSent(String address);\n\n String invitationFacebookSent();\n\n String noFriendInvited();\n\n // Crystal helper\n String buyDialogCost(int crystalCost);\n\n String buyDialogbalance(int crystalBalance);\n\n String invite();\n\n String howToGetCrystals();\n\n String buyCrystalsViaPayPal();\n\n String buyCrystalsViaFacebook();\n\n String invitationFriendsAndGetCrystals();\n\n String collectBoxesAndGetCrystals();\n\n // Buy crystals dialog\n String buyCrystalsPaypal();\n\n String buyCrystalsPaypal1();\n\n String buyCrystalsPaypal2();\n\n String buyCrystalsPaypa3();\n\n String buyCrystalsPaypal4();\n\n String buyCrystalsPaypal5();\n\n String buyCrystalsPaypalOnlyRegistered();\n\n String buyCrystalsPaypalOnlyRegisteredVerified();\n\n String buyCrystalsPaypalDialogTitle();\n\n String buyCrystalsFacebookDialogTitle();\n\n String buyCrystalsFacebook();\n\n String buyCrystalsFacebook1();\n\n String buyCrystalsFacebook2();\n\n String buyCrystalsFacebook3();\n\n String buyCrystalsFacebook4();\n\n String buyCrystalsFacebook5();\n\n String buyCrystalsFacebookButton(int crystals);\n\n String buyCrystalsFacebookOnlyRegisteredVerified();\n\n String buyCrystalsFacebookOnlyRegistered();\n\n String tanksCrystalBoughtDialogTitle();\n\n String tanksCrystalBoughtDialog(int delta, int value);\n\n // Star map\n String starMapDialogTitle();\n\n String minLevel();\n\n String planetSize();\n\n String allowedUnits();\n\n String bases();\n\n String bots();\n\n String units();\n\n String land();\n\n String wrongLevelForLand();\n\n String tooltipShowUnitsOnPlanet();\n\n String tooltipLandOnPlanet();\n\n String youAreAlreadyOnThisPlanet();\n\n String moveToPlanetTitle();\n\n String moveToPlanet(String name);\n\n String leaveBaseMoveToPlanet(String name);\n\n // Training\n String trainingTipScroll();\n\n String trainingTipSelectItem(String itemTypeName);\n\n String trainingTipClickItem();\n\n String trainingTipSendBuildCommand(String itemTypeName);\n\n String trainingTipSendBuildFinalizeCommand(String itemTypeName);\n\n String trainingTipFactorizeCommand(String itemTypeName);\n\n String trainingTipSendCollectCommand(String itemTypeName);\n\n String trainingTipToBeBuiltPlacer(String itemTypeName);\n\n String trainingTipWatchQuestDialog();\n\n String trainingTipClickContainerItem(String itemTypeName);\n\n String trainingTipClickMove();\n\n String trainingTipClickUnload();\n\n String trainingTipClickUnloadMode();\n\n String apply();\n\n String ok();\n\n // Level up dialog\n String levelUpDialogTitle();\n\n String youReachedLevel(int level);\n\n // User account dialog\n String userAccountDialogTitle();\n\n // System\n String serverRebootTitle();\n\n String serverRebootMissionNotSaved();\n\n String serverRebootNotRegistered();\n\n String planetRestartTitle();\n\n String planetRestartMessage();\n\n String serverRestartTitle();\n\n String serverShuttingDown();\n\n String serverStarting();\n\n String serverRunning();\n\n String unknown();\n}", "public interface Localizable extends Serializable {\r\n /**\r\n * Gets the source (non-localized) string.\r\n *\r\n * @return the source string.\r\n */\r\n String getSourceString();\r\n\r\n /**\r\n * Gets the localized string.\r\n *\r\n * @param locale locale into which to get the string.\r\n * @return the localized string or the source string if no\r\n * localized version is available.\r\n */\r\n String getLocalizedString(Locale locale);\r\n}", "@Local\r\npublic interface RetardPaiementModalDAOLocal\r\n extends RetardPaiementModalDAO\r\n{\r\n\r\n\r\n}", "UmType getUserManager();", "public interface InterfaceClient extends Remote {\n\n double seConnecter(Client client) throws RemoteException;\n\n \n\n boolean peutReserver(Reservation rv) throws RemoteException;\n\n void visualiser(Vehicule voiture) throws RemoteException;\n\n \n \n \n void deconnexion() throws RemoteException;\n\n boolean sinscrire(Client client) throws RemoteException;\n\n void inscriptionReussite(Client client) throws RemoteException;\n}", "public void setLocales(List<Locale> locales);", "@Local\npublic interface AdvertBundleDaoInterface extends DaoInterface<AdvertBundleEntity> {\n\n\tList<AdvertBundleEntity> findAllForPartner(PartnerEntity partner);\n\n\t/**\n\t * Hleda vsechny AdvertBundle, ke kterym je treba vystavit novou proforma-fakturu\n\t * @return\n\t */\n\tList<AdvertBundleEntity> findAllRequiredNewProforma();\n\n}", "public interface CalendrierIntervenantManager\r\n extends GenericManager<CalendrierIntervenant, Long>\r\n{\r\n\r\n public final static String SERVICE_NAME = \"CalendrierIntervenantManager\";\r\n\r\n}", "public ApplicationLocales(ActionServlet servlet) {\n\n super();\n Locale list[] = Locale.getAvailableLocales();\n MessageResources resources = (MessageResources)\n servlet.getServletContext().getAttribute(Globals.MESSAGES_KEY);\n if (resources == null)\n return;\n String config = resources.getConfig();\n if (config == null)\n return;\n\n for (int i = 0; i < list.length; i++) {\n try {\n ResourceBundle bundle =\n ResourceBundle.getBundle(config, list[i]);\n if (bundle == null)\n continue;\n if (list[i].equals(bundle.getLocale())) {\n localeLabels.add(list[i].getDisplayName());\n localeValues.add(list[i].toString());\n supportedLocales.add(list[i]);\n }\n } catch( Exception ex ) {\n servlet.log(\"Missing locale \" + list[i] );\n continue;\n }\n }\n\n }", "@ImplementedBy(DefaultStringManager.class)\npublic interface StringManager extends ResourceManager<StringManager, StringResource> {\n\n @Override\n default String getType() {\n return \"string\";\n }\n}", "public interface DealsWithPlatformInfo {\n public void setPlatformInfoManager (PlatformInfoManager platformInfoManager);\n}", "public MostrarBienesWizard(String locale)\r\n {\r\n \t this.locale=locale;\r\n \t try{\r\n initComponents();\r\n renombrarComponentes();\r\n inventarioClient= new InventarioClient(aplicacion.getString(UserPreferenceConstants.LOCALGIS_SERVER_ADMCAR_SERVLET_URL) +\r\n \t\tConstantes.INVENTARIO_SERVLET_NAME);\r\n \r\n } catch (Exception e){\r\n logger.error(\"Error al importar actividades economicas\",e);\r\n }\r\n }", "void localizationChanged();", "void localizationChanged();", "void localizationChanged();", "public TranslatorManager getManager();", "static private synchronized void initServices() {\n if (_eiService == null) {\n try {\n _eiService = (ExtensionInstallerService)ServiceManager.lookup(\"javax.jnlp.ExtensionInstallerService\");\n _basicService = (BasicService)ServiceManager.lookup(\"javax.jnlp.BasicService\");\n _downloadService = (DownloadService)ServiceManager.lookup(\"javax.jnlp.DownloadService\");\n } catch(UnavailableServiceException use) {\n Config.trace(\"Unable to locate service: \" + use);\n }\n }\n\n // We cannot really use this, since it breaks lazy loading. When resources for all locales\n // are in place it should be ok. Or we need another solution.\n //_resources = ResourceBundle.getBundle(\"jnlp/JreInstaller/resources/strings\");\n try {\n URL bundle = (new Config()).getClass().getClassLoader().getResource(\"jnlp/sample/JreInstaller/resources/strings.properties\");\n _resources = new PropertyResourceBundle(bundle.openStream());\n } catch(Throwable t) {\n Config.trace(\"Unable to load resources: \" + t);\n }\n }", "public interface IArticuloLeyMercadoGestor {\n\n\t/**\n\t * M\\u00E9todo que permite registrar un art\\u00EDculo con estado CODIFICADO seg\\u00FAn la Ley Org\\u00E1nica de Regulaci\\u00F3n y Control del Poder de Mercado\n\t * @author mgranda\n\t * @param codigoCompania\n\t * @param codigoArticulo\n\t * @param userId\n\t * @throws SICException\n\t */\n\tvoid codificarArticuloLeyMercado(Integer codigoCompania, String codigoArticulo, String userId) throws SICException;\n\t\n\t/**\n\t * M\\u00E9todo que permite registrar un art\\u00EDculo con estado DESCODIFICADO seg\\u00FAn la Ley Org\\u00E1nica de Regulaci\\u00F3n y Control del Poder de Mercado\n\t * @author mgranda\n\t * @param codigoCompania\n\t * @param codigoArticulo\n\t * @param userId\n\t * @param codigoCausal\n\t * @param valorCausal\n\t * @throws SICException\n\t */\n\tvoid descodificarArticuloLeyMercado(Integer codigoCompania, String codigoArticulo, String userId, Integer codigoCausal, String valorCausal) throws SICException;\n\n\t/**\n\t * M\\u00E9todo que permite registrar un art\\u00EDculo con estado REACTIVADO seg\\u00FAn la Ley Org\\u00E1nica de Regulaci\\u00F3n y Control del Poder de Mercado\n\t * @author mgranda\n\t * @param codigoCompania\n\t * @param codigoArticulo\n\t * @param userId\n\t * @throws SICException\n\t */\n\tvoid reactivarArticuloLeyMercado(Integer codigoCompania, String codigoArticulo, String userId) throws SICException;\n\t\n\t/**\n\t * M\\u00E9todo que permite registrar un art\\u00EDculo con estado CODIFICADO seg\\u00FAn la Ley Org\\u00E1nica de Regulaci\\u00F3n y Control del Poder de Mercado\n\t * @author mgranda\n\t * @param articuloLeyMercadoDTO entidad que representa la informacion de Ley Org\\u00E1nica de Regulaci\\u00F3n y Control del Poder de Mercado del articulo\n\t * @throws SICException\n\t */\n\tvoid codificarArticuloLeyMercado(ArticuloLeyMercadoDTO articuloLeyMercadoDTO) throws SICException;\t\n\n\t/**\n\t * M\\u00E9todo que permite registrar un art\\u00EDculo con estado DESCODIFICADO seg\\u00FAn la Ley Org\\u00E1nica de Regulaci\\u00F3n y Control del Poder de Mercado\n\t * @author mgranda\n\t * @param articuloLeyMercadoDTO entidad que representa la informacion de Ley Org\\u00E1nica de Regulaci\\u00F3n y Control del Poder de Mercado del articulo\n\t * @throws SICException\n\t */\n\tvoid descodificarArticuloLeyMercado(ArticuloLeyMercadoDTO articuloLeyMercadoDTO) throws SICException;\n\t\n\t/**\n\t * Metodo que permite obtener la informacion actual de Ley Org\\u00E1nica de Regulaci\\u00F3n y Control del Poder de Mercado del articulo\n\t * @author mgranda\n\t * @param codigoCompania\n\t * @param codigoArticulo\n\t * @return\n\t * @throws SICException\n\t */\n\tArticuloLeyMercadoDTO obtenerArticuloLeyMercado(Integer codigoCompania, String codigoArticulo) throws SICException;\n\n\t/**\n\t * Metodo que permite obtener la informacion historica de estados del articulo segun la Ley Org\\u00E1nica de Regulaci\\u00F3n y Control del Poder de Mercado\n\t * @author mgranda\n\t * @param first\n\t * @param pageSize\n\t * @param sortField\n\t * @param filters\n\t * @return\n\t * @throws SICException\n\t */\n\tList<ArticuloBitacoraLeyMercadoDTO> obtenerHistoricoLeyMercado(int first, int pageSize, String sortField, Map<String, String> filters) throws SICException;\n\t\n\t/**\n\t * Metodo que permite obtener el total de la informacion historica de estados del articulo segun la Ley Org\\u00E1nica de Regulaci\\u00F3n y Control del Poder de Mercado\n\t * @param codigoCompania\n\t * @param codigoArticulo\n\t * @return\n\t * @throws SICException\n\t */\n\tLong obtenerTotalHistoricoLeyMercado(Integer codigoCompania, String codigoArticulo) throws SICException;\n}", "@PostConstruct\n public void init()\n throws RedbackServiceException\n {\n getI18nProperties( \"en\" );\n getI18nProperties( \"fr\" );\n }", "public interface ListService {\n\n public String showListCmd();\n\n}", "public void mudarIdioma() {\n\t\tString localeStr = facesUtil.getParam(\"locale\");\n\n\t\tif (localeStr.length() == 2) {\n\t\t\tlocale = new Locale(localeStr);\n\n\t\t} else {\n\t\t\tlocale = new Locale(localeStr.substring(0, 2), localeStr.substring(3));\n\t\t}\n\n\t\tfacesUtil.setLocale(locale);\n\t\tLog.setLogger(ConfigBean.class, facesUtil.getMessage(\"MGL064\", new String[] { localeStr }), Level.INFO);\n\t}", "public interface NCBENU {\n}", "public interface SistemaArqOperations \r\n{\r\n int list_Arq (String nome, String[] aq, String p);\r\n String[] att_clientes ();\r\n String[] get_Arq (int a);\r\n void set_Arq (String[] aq, int idd);\r\n String get_path (int a);\r\n int qtd_clientes ();\r\n}", "public abstract EnvioMensajesCallBackInterface getInterfaceCallback();", "@Local\npublic interface IGestionnaireReponseService {\n\n /**\n * Envoie une reponse avec le code de statut HTTP fourni, contenant, dans son body,\n * la collection d'entites qui a fait l'objet d'une requete de recuperation (GET /collection).\n * @param listeEntites Liste d'entites recuperees\n * @param reponse Reponse retournee (celle prise en parametre de la methode appelee de la servlet)\n * @param <TEntite> Classe de l'entite (generique, pour prendre n'importe quel objet)\n * @throws IOException en cas d'erreur de creation de l'objet de sortie du contenu du body renvoye\n */\n <TEntite> void envoiReponseAvecDonnees(ArrayList<TEntite> listeEntites, HttpServletResponse reponse, int codeDeStatutHttp, String message) throws IOException;\n\n /**\n * Envoie une reponse avec le code de statut HTTP fourni, contenant, dans son body,\n * l'entite qui a fait l'objet d'une requete de recuperation, de creation ou de modification.\n * @param entite Entite recuperee\n * @param reponse Reponse retournee (celle prise en parametre de la methode appelee de la servlet)\n * @param <TEntite> Classe de l'entite (generique, pour prendre n'importe quel objet)\n * @throws IOException en cas d'erreur de creation de l'objet de sortie du contenu du body renvoye\n */\n <TEntite> void envoiReponseAvecDonnees(TEntite entite, HttpServletResponse reponse, int codeDeStatutHttp, String message) throws IOException;\n\n /**\n * Envoie une reponse 200 OK sans body. Appel uniquement par une route DELETE (suppression d'entite).\n *\n * @param reponse Reponse renvoyee (celle prise en parametre de la methode appelee de la servlet)\n */\n void envoiReponseSansDonnees(HttpServletResponse reponse);\n\n}", "private LocalizationProvider() {\r\n\t\tthis.language = DEFAULT_LANGUAGE;\r\n\t\tthis.bundle = ResourceBundle.getBundle(\"hr.fer.zemris.java.hw11.jnotepadapp.local.languages\",\r\n\t\t\t\tLocale.forLanguageTag(language));\r\n\t}", "List<Locale> getSupportedLocales() {\n return Collections.unmodifiableList(mSupportedLocales);\n }", "@Local\r\npublic interface BonLivraisonManagerLocal\r\n extends BonLivraisonManager\r\n{\r\n\r\n\r\n}", "@Local\r\npublic interface ViewBulletinPaieHelperManagerLocal\r\n extends ViewBulletinPaieHelperManager\r\n{\r\n\r\n\r\n}", "public void updateI18N() {\n\t\t/* Update I18N in the menuStructure */\n\t\tappMenu.updateI18N();\n\t\t/* Pack all */\n\t\tLayoutShop.packAll(shell);\n\t}", "@Override\n\tpublic String listarClientes() throws MalformedURLException, RemoteException, NotBoundException {\n\t\tdatos = (ServicioDatosInterface) Naming.lookup(\"rmi://\"+ direccion + \":\" + puerto + \"/almacen\");\n \tString lista = datos.listaClientes();\n \treturn lista;\n \t\n\t}", "@Remote\r\npublic interface RappelManagerRemote\r\n extends RappelManager\r\n{\r\n\r\n\r\n}", "@Local\npublic interface IndirizzoFacadeLocal {\n\n void create(Indirizzo indirizzo);\n\n void edit(Indirizzo indirizzo);\n\n void remove(Indirizzo indirizzo);\n\n Indirizzo find(Object id);\n\n List<Indirizzo> findAll();\n\n /** Restituisce tutte le stringe \"citta\" che iniziano con il parametro\n * @param subCitta la stringa da cercare\n * @return una lista di stringhe che rappresentano i nomi delle citta presenti su db\n */\n public List<String> getCitta(String subCitta);\n\n /** carica tutti i nomi della città presenti nel database\n * @return la lista dei nomi delle città sotto forma di String\n */\n public java.util.List<java.lang.String> getCitta();\n\n}", "public interface RemoteDataSource {\n\n interface ZhiHuDataSource {\n /**\n * 启动界面图片文字\n */\n void getSplashInfo(String res, RemoteApiCallback<SplashBean> callback);\n\n /**\n * 最新日报\n */\n void getNewsDailyList(RemoteApiCallback<NewsDailyBean> callback);\n\n /**\n * 往期日报\n */\n void getNewsDailyBefore(String date, RemoteApiCallback<NewsDailyBean> callback);\n\n /**\n * 主题日报\n */\n void getThemes(RemoteApiCallback<ThemesBean> callback);\n\n /**\n * 主题日报详情\n */\n void getThemesDetail(int id, RemoteApiCallback<ThemesListBean> callback);\n\n /**\n * 热门日报\n */\n void getHotNews(RemoteApiCallback<HotNewsBean> callback);\n\n /**\n * 日报详情\n */\n void getNewsDetailInfo(int id, RemoteApiCallback<NewsDetailBean> callback);\n\n /**\n * 日报的额外信息\n */\n void getNewsExtraInfo(int id, RemoteApiCallback<NewsExtraBean> callback);\n\n /**\n * 日报的长评论\n */\n void getLongCommentInfo(int id, RemoteApiCallback<CommentsBean> callback);\n\n /**\n * 日报的短评论\n */\n void getShortCommentInfo(int id, RemoteApiCallback<CommentsBean> callback);\n\n /**\n * 专题特刊\n */\n void getSpecials(RemoteApiCallback<SpecialsBean> callback);\n\n /**\n * 专题特刊列表\n */\n void getSpecialList(int id, RemoteApiCallback<SpecialListBean> callback);\n\n /**\n * 获取专栏的之前消息\n */\n void getBeforeSpecialListDetail(int id, long timestamp, RemoteApiCallback<SpecialListBean> callback);\n\n /**\n * 获取推荐的作者专题\n */\n void getRecommendedAuthorColumns(int limit, int offset, int seed, RemoteApiCallback<List<RecommendAuthorBean>> callback);\n\n /**\n * 获取专栏作者的详细信息\n */\n void getColumnAuthorDetail(String name, RemoteApiCallback<ColumnAuthorDetailBean> callback);\n\n /**\n * 获取推荐的文章\n */\n void getRecommendedAuthorArticles(int limit, int offset, int seed, RemoteApiCallback<List<RecommendArticleBean>> callback);\n\n /**\n * 获取某人的专题\n */\n void getColumnsOfAuthor(String name, int limit, int offset, RemoteApiCallback<List<ColumnsBean>> callback);\n\n /**\n * 获取某篇专题文章详情\n */\n void getColumnArticleDetail(int id, RemoteApiCallback<ColumnArticleDetailBean> callback);\n\n /**\n * 获取文章的评论\n */\n void getColumnComments(int id, int limit, int offset, RemoteApiCallback<List<ColumnCommentsBean>> callback);\n }\n\n interface GankDataSource {\n /**\n * 获取某个类别的信息\n */\n void getGankNewsByCategory(String category, int num, int page, RemoteApiCallback<List<GankNewsBean>> callback);\n\n /**\n * 获取某天的所有类别信息\n */\n void getGankNewsOfSomeday(int year, int month, int day, RemoteApiCallback<GankDateNewsBean> callback);\n\n /**\n * 获取随机推荐的信息\n */\n void getRecommendGankNews(String category, int num, RemoteApiCallback<List<GankNewsBean>> callback);\n }\n\n interface TianXinDataSource {\n /**\n * 获取天行数据精选\n */\n void getTianXinNews(String type, String key, int num, int page, RemoteApiCallback<List<TianXinNewsBean>> callback);\n\n /**\n * 通过关键字获取天行数据精选\n */\n void getTianXinNewsByWord(String type, String key, int num, int page, String word, RemoteApiCallback<List<TianXinNewsBean>> callback);\n }\n}", "public interface ResourceConfig {\n\n public ResourceBundle config = ResourceBundle.getBundle(\"resource-config\");\n\n public String DEFAULT_LOCALE = config.getString(\"defaultLocale\");\n\n public String EXCEPTION_MESSAGE_PREFIX = config.getString(\"exception_message_prefix\");\n\n public boolean VALUE_NEED_ENCODE = new Boolean(config.getString(\"stringEncode\")).booleanValue();\n\n public String SOURCE_ENCODE = config.getString(\"sourceEncode\");\n\n public String TARGET_ENCODE = config.getString(\"targetEncode\");\n\n public String LOCALE_LIST = config.getString(\"localeList\");\n\n public String RESOURCEBOX_FILES = config.getString(\"resourcebox_files\");\n\n public String CONSTANTS_FILES = config.getString(\"constants_files\");\n\n}", "public interface LanguageDAO extends CommonEntityDAO {\r\n}", "public interface TelIpManageService {\n\n public List<CallCenter> queryCallCenters();\n\n public void updateCallCenter(CallCenter callCenter);\n\n\tpublic void deleteCallCenters(List<Integer> callCenterIDs);\n\n\tpublic void addCallCenter(CallCenter callCenter);\n\n\tpublic CallCenter queryCallCenter(Integer callCenterID);\n}", "public interface IMensagemGrupo {\n\n\t/** Retorna o Tipo de Envio. */\n\tTipoEnvio getTipoEnvio();\n\t\n\t/** Define o Tipo de Envio. */\n\tvoid setTipoEnvio(TipoEnvio tipoEnvio);\n\t\n\t/** Retorna o Grupo. */\n\tGrupo getGrupo();\n\t\n\t/** Define o Grupo. */\n\tvoid setGrupo(Grupo grupoUsuario);\n\t\n}", "public interface InterfaceSistemaDeControle {\r\n\t\r\n\t/** Este método adiciona um pedido.\r\n\t * \r\n\t * @param p Recebe um objeto do tipo Pedido.\r\n\t */\r\n\t\r\n\tpublic void adicionaPedido (Pedido p);\r\n\t\r\n\t/** Este método pesquisa pedidos utilizando o código do produto.\r\n\t * \r\n\t * @param codProduto Recebe um objeto do tipo String que representa o código do produto.\r\n\t * @return Este método retorna uma Lista do tipo Pedido contendo todos os produtos que têm o código \r\n\t * igual ao passado no parametro.\r\n\t */\r\n\t\r\n\tpublic List<Pedido> pesquisaIncluindoProduto (String codProduto);\r\n\t\r\n\t/** Este método remove um pedido.\r\n\t * \r\n\t * @param numPedido Este método do tipo long recebe o número do pedido que será removido.\r\n\t */\r\n\tpublic void removePedido (long numPedido);\r\n\t\r\n}", "public interface MineContract {\n String CUSTOMER_WORK_ORDER_LIST = \"/serviceWork/serviceWorkList\";//客服工单列表\n\n interface IMineView extends BaseViewInterface {\n }\n\n interface IMinePresent {\n /**\n * 获取客服工单列表\n * @param offset\n * @param limit\n * @param villageId\n * @param ghsUserId\n * @param state 1:跟进中 2:完成 3:待跟进\n * @param tag\n */\n void getCustomerWorkOrders(int offset, int limit, int villageId, int ghsUserId, int state, String tag);\n }\n}", "public interface ITransModel {\n\n void getTransList(String catid, String device, String moni, ITransListListener listener);\n\n}", "public interface TCNetworkManageInterface {\n\n public String serviceIdentifier();\n\n public String apiClassPath();\n\n public String apiMethodName();\n}", "@Remote\r\npublic interface ActionItemManagerRemote\r\n extends ActionItemManager\r\n{\r\n\r\n\r\n}", "public interface PlatformManagerClient {\n\n /**\n * 查询所有平台\n * @return 平台列表\n */\n ResultDTO<List<Platform>> getAllPlatform();\n\n /**\n * 按id查询平台\n * @param platformId 平台Id\n * @return\n */\n ResultDTO<Platform> getPlatformById(@NotBlank String platformId);\n\n /**\n * 按id查询平台\n * @param appId 微信公众平台id\n * @return\n */\n ResultDTO<Platform> getPlatformByAppId(@NotBlank String appId);\n\n /**\n * 按企业码查询平台\n * @param platformCode 平台企业码\n * @return\n */\n ResultDTO<Platform> getPlatformByCode(@NotBlank(message=\"平台代码不可以为空\") String platformCode);\n\n /**\n * 创建平台\n * @param platform 平台信息\n * @return\n */\n ResultDTO<Boolean> createPlatform(@NotNull(message=\"平台类不可为空\") @Valid Platform platform);\n\n /**\n * 更新平台\n * @param platform 平台信息\n * @return\n */\n ResultDTO<Boolean> updatePlatform(@NotNull @Valid Platform platform);\n\n /**\n * 禁用平台\n * @param platformId\n * @return\n */\n ResultDTO<Boolean> disablePlatform(@NotBlank String platformId);\n\n /**\n * 解禁平台\n * @param platformId\n * @return\n */\n ResultDTO<Boolean> enablePlatform(@NotBlank String platformId);\n\n /**\n * 分页查询平台\n * @param keyWord 企业码关键字\n * @param pageNo 页码\n * @param pageSize 分页大小\n * @return\n */\n ResultDTO<PageInfo<Platform>> listPlatform(String keyWord, @NotNull Integer pageNo, @NotNull Integer pageSize);\n\n\n /**\n * 获取所有平台的企业码\n * @return\n */\n ResultDTO<List<String>> listAllPlatformCodes();\n}", "@Override\n protected void attachBaseContext(Context base) {\n super.attachBaseContext(Application.Companion.getLocaleManager().setLocale(base));\n }", "public AbstractLocalizationProvider() {\r\n\t\tsuper();\r\n\t\tthis.listeners = new ArrayList<>();\r\n\t}", "public interface SimpleLogRemote extends javax.ejb.EJBObject, com.arexis.mugen.simplelog.SimpleLogRemoteBusiness {\n \n \n}", "public interface CompteManager\r\n extends GenericManager<Compte, Long>\r\n{\r\n\r\n public final static String SERVICE_NAME = \"CompteManager\";\r\n\r\n}", "public interface Compromiso_peticionLocal extends javax.ejb.EJBLocalObject {\n\t/**\n\t * Get accessor for persistent attribute: tiag_id\n\t */\n\tpublic java.lang.Long getTiag_id();\n\t/**\n\t * Set accessor for persistent attribute: tiag_id\n\t */\n\tpublic void setTiag_id(java.lang.Long newTiag_id);\n\t/**\n\t * Get accessor for persistent attribute: id_rango\n\t */\n\tpublic java.lang.Integer getId_rango();\n\t/**\n\t * Set accessor for persistent attribute: id_rango\n\t */\n\tpublic void setId_rango(java.lang.Integer newId_rango);\n\t/**\n\t * Get accessor for persistent attribute: peti_numero\n\t */\n\tpublic java.lang.Long getPeti_numero();\n\t/**\n\t * Set accessor for persistent attribute: peti_numero\n\t */\n\tpublic void setPeti_numero(java.lang.Long newPeti_numero);\n\t/**\n\t * Get accessor for persistent attribute: codigo_pcom\n\t */\n\tpublic java.lang.String getCodigo_pcom();\n\t/**\n\t * Set accessor for persistent attribute: codigo_pcom\n\t */\n\tpublic void setCodigo_pcom(java.lang.String newCodigo_pcom);\n\t/**\n\t * Get accessor for persistent attribute: dia_especifico\n\t */\n\tpublic java.sql.Timestamp getDia_especifico();\n\t/**\n\t * Set accessor for persistent attribute: dia_especifico\n\t */\n\tpublic void setDia_especifico(java.sql.Timestamp newDia_especifico);\n\t/**\n\t * Get accessor for persistent attribute: id_tecnico\n\t */\n\tpublic java.lang.Long getId_tecnico();\n\t/**\n\t * Set accessor for persistent attribute: id_tecnico\n\t */\n\tpublic void setId_tecnico(java.lang.Long newId_tecnico);\n\t/**\n\t * Get accessor for persistent attribute: user_mac\n\t */\n\tpublic java.lang.String getUser_mac();\n\t/**\n\t * Set accessor for persistent attribute: user_mac\n\t */\n\tpublic void setUser_mac(java.lang.String newUser_mac);\n\t/**\n\t * Get accessor for persistent attribute: hora_desde\n\t */\n\tpublic java.lang.String getHora_desde();\n\t/**\n\t * Set accessor for persistent attribute: hora_desde\n\t */\n\tpublic void setHora_desde(java.lang.String newHora_desde);\n\t/**\n\t * Get accessor for persistent attribute: hora_hasta\n\t */\n\tpublic java.lang.String getHora_hasta();\n\t/**\n\t * Set accessor for persistent attribute: hora_hasta\n\t */\n\tpublic void setHora_hasta(java.lang.String newHora_hasta);\n\t/**\n\t * Get accessor for persistent attribute: codigo_agencia\n\t */\n\tpublic java.lang.String getCodigo_agencia();\n\t/**\n\t * Set accessor for persistent attribute: codigo_agencia\n\t */\n\tpublic void setCodigo_agencia(java.lang.String newCodigo_agencia);\n\t/**\n\t * Get accessor for persistent attribute: estado\n\t */\n\tpublic java.lang.Short getEstado();\n\t/**\n\t * Set accessor for persistent attribute: estado\n\t */\n\tpublic void setEstado(java.lang.Short newEstado);\n\t/**\n\t * Get accessor for persistent attribute: grse_id\n\t */\n\tpublic java.lang.Integer getGrse_id();\n\t/**\n\t * Set accessor for persistent attribute: grse_id\n\t */\n\tpublic void setGrse_id(java.lang.Integer newGrse_id);\n\t/**\n\t * Get accessor for persistent attribute: fecha\n\t */\n\tpublic java.sql.Timestamp getFecha();\n\t/**\n\t * Set accessor for persistent attribute: fecha\n\t */\n\tpublic void setFecha(java.sql.Timestamp newFecha);\n\t/**\n\t * Get accessor for persistent attribute: care_id\n\t */\n\tpublic java.lang.Integer getCare_id();\n\t/**\n\t * Set accessor for persistent attribute: care_id\n\t */\n\tpublic void setCare_id(java.lang.Integer newCare_id);\n\t/**\n\t * Get accessor for persistent attribute: usua_id\n\t */\n\tpublic java.lang.Long getUsua_id();\n\t/**\n\t * Set accessor for persistent attribute: usua_id\n\t */\n\tpublic void setUsua_id(java.lang.Long newUsua_id);\n\t/**\n\t * Get accessor for persistent attribute: id_cita_previa\n\t */\n\tpublic java.lang.Long getId_cita_previa();\n\t/**\n\t * Set accessor for persistent attribute: id_cita_previa\n\t */\n\tpublic void setId_cita_previa(java.lang.Long newId_cita_previa);\n}", "protected void localeChanged() {\n\t}", "public interface RemoteDataSource {\n\n /**\n * 请求短信验证码\n * @param context\n * @param phoneNumber\n * @param type 类型:re注册;lg登录\n * @param callback\n * @return\n */\n boolean requestPhoneCheckCode(Context context, String phoneNumber, String type,\n BaseNetworkRequest.RequestCallback callback);\n /**\n * 注册\n * @param context\n * @param phoneNumber 手机号\n * @param checkCode 验证码\n * @param callback\n * @return\n */\n String register(Context context, String phoneNumber, String checkCode,\n BaseNetworkRequest.RequestCallback callback);\n\n /**\n * 登录\n * @param context\n * @param phoneNumber\n * @param checkCode\n * @param callback\n * @return\n */\n String login(Context context, String phoneNumber, String checkCode,\n BaseNetworkRequest.RequestCallback callback);\n\n /**\n * 获取词汇列表\n * @param context\n * @param page\n *@param sort\n * @param sortType\n * @param callback @return\n */\n String getCategoryList(Context context, int page, String sort, String sortType,\n BaseNetworkRequest.RequestCallback callback);\n\n /**\n * 获取图片\n * @param context\n * @param url\n * @param imageView\n * @param maxWidth\n * @param maxHeight\n * @param defaultImage\n * @param errorImage\n */\n public void getImageForView(@NonNull Context context, String url, ImageView imageView, int maxWidth,\n int maxHeight, int defaultImage, int errorImage);\n\n /**\n * 获取词汇列表\n * @param context\n * @param categoryId\n * @param page\n * @param secondLan\n * @param callback @return\n * */\n public String getVocabularyList(@NonNull Context context, String categoryId, int page,\n String secondLan, BaseNetworkRequest.RequestCallback callback);\n\n /**\n * 新增词汇分类\n * @param context\n * @param category\n * @param callback\n */\n public void postCategory(@NonNull Context context, List<PostParam> category,\n BaseNetworkRequest.RequestCallback callback);\n\n /**\n * 新增词汇\n * @param context\n * @param vocabulary\n * @param callback\n */\n public void postVocabulary(@NonNull Context context, List<PostParam> vocabulary,\n BaseNetworkRequest.RequestCallback callback);\n}", "public interface IConversationView {\n\n //初始化我们的聊天视图\n void initConversationView(List<EMConversation> emConversationList);\n\n}" ]
[ "0.6879806", "0.6270815", "0.6227726", "0.61852247", "0.6100339", "0.5967303", "0.59518534", "0.59347266", "0.5914048", "0.5908129", "0.583974", "0.5830078", "0.5822163", "0.5820339", "0.5814302", "0.5796019", "0.57848644", "0.5772592", "0.5765515", "0.57473564", "0.57352495", "0.57188916", "0.5691783", "0.56630236", "0.566197", "0.5621284", "0.5620428", "0.5600989", "0.56007606", "0.556859", "0.55600107", "0.5559057", "0.5551394", "0.55507207", "0.5549263", "0.5540207", "0.551799", "0.55127054", "0.5512362", "0.55077845", "0.5506027", "0.5503976", "0.5503909", "0.54922473", "0.5481397", "0.54681087", "0.54634535", "0.545978", "0.54397607", "0.54380023", "0.5419463", "0.54033214", "0.5402857", "0.5402295", "0.54010195", "0.5397485", "0.53935117", "0.5389795", "0.5383669", "0.53818154", "0.53804576", "0.53804576", "0.53804576", "0.5380152", "0.5362139", "0.53574675", "0.5356266", "0.5348167", "0.5347617", "0.5347144", "0.5342704", "0.5339038", "0.5337964", "0.53251994", "0.53191465", "0.5315577", "0.5313218", "0.53098416", "0.53031176", "0.530084", "0.52829444", "0.5276532", "0.5272056", "0.52627677", "0.52534425", "0.52531457", "0.52509224", "0.52470076", "0.52402264", "0.52384126", "0.5237396", "0.5232216", "0.5228", "0.52278006", "0.52265555", "0.5221173", "0.5221142", "0.52201325", "0.5212723", "0.52107716" ]
0.5237379
91
Sets destinations for output and error output. This method may allow to redirect output and error.
void setOutputChannels(Appendable outP, Appendable errP);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void redirectOutput() {\n Process process = _vm.process();\n _errThread = new StreamRedirectThread(\"error reader\", process.getErrorStream(), System.err);\n _outThread = new StreamRedirectThread(\"output reader\", process.getInputStream(), System.out);\n _errThread.start();\n _outThread.start();\n }", "protected void stopAllRedirectors() {\n _stdOutRedirector.setStopFlag();\n _stdErrRedirector.setStopFlag();\n }", "private void redirectSystemStreams() {\r\n\t\tOutputStream out = new OutputStream() {\r\n\t\t\t@Override\r\n\t\t\tpublic void write(int b) throws IOException {\r\n\t\t\t\tupdateTextArea(String.valueOf((char) b));\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void write(byte[] b, int off, int len) throws IOException {\r\n\t\t\t\tupdateTextArea(new String(b, off, len));\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void write(byte[] b) throws IOException {\r\n\t\t\t\twrite(b, 0, b.length);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tSystem.setOut(new PrintStream(out, true));\r\n\t\tSystem.setErr(new PrintStream(out, true));\r\n\t}", "private void _debugSystemOutAndErr() {\n try {\n File outF = new File(System.getProperty(\"user.home\") +\n System.getProperty(\"file.separator\") + \"out.txt\");\n FileWriter wo = new FileWriter(outF);\n final PrintWriter outWriter = new PrintWriter(wo);\n File errF = new File(System.getProperty(\"user.home\") +\n System.getProperty(\"file.separator\") + \"err.txt\");\n FileWriter we = new FileWriter(errF);\n final PrintWriter errWriter = new PrintWriter(we);\n System.setOut(new PrintStream(new edu.rice.cs.util.OutputStreamRedirector() {\n public void print(String s) {\n outWriter.print(s);\n outWriter.flush();\n }\n }));\n System.setErr(new PrintStream(new edu.rice.cs.util.OutputStreamRedirector() {\n public void print(String s) {\n errWriter.print(s);\n errWriter.flush();\n }\n }));\n }\n catch (IOException ioe) {}\n }", "public static void setOutputReceiver(Consumer<String> regular, Consumer<String> error) {\n DEBUG.out = regular;\n INFO.out = regular;\n WARN.out = error;\n ERROR.out = error;\n }", "@Test(expected = TooManyOutputRedirectionsException.class)\n public void shouldFailWithTwoOutputRedirections() {\n Template template = createTemplate(\"stdout\", \"stdout\");\n new OutputRedirectionTemplateValidator(\"stdout\").validate(template, new NullHeterogeneousRegistry());\n }", "public static void RedirectOutput() {\t\n\t\ttry {\n\t\t\tPrintStream out = new PrintStream(new FileOutputStream(\"ybus.txt\"));\n\t\t\tSystem.setOut(out); //Re-assign the standard output stream to a file.\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Test\n public void shouldSuccedWithOneOuptutRedirection() {\n Template template = createTemplate(\"stdout\", \"file\");\n new OutputRedirectionTemplateValidator(\"stdout\").validate(template, new NullHeterogeneousRegistry());\n }", "public void setErr(PrintStream err);", "public abstract void setOutputUrl(String outputUrl);", "@Before\n\tpublic void setUpStreams() {\n\t\tSystem.setOut(new PrintStream(outContent));\n\t}", "public static\n void hookSystemOutputStreams() {\n out();\n err();\n }", "public PrintStreamCommandOutput( PrintStream output )\n {\n this( output, System.err );\n }", "public void setLogFilesUrls() {\n String s = \"\";\n s = s + makeLink(\"NODE-\" + getNodeName() + \"-out.log\");\n s = s + \"<br>\" + makeLink(\"NODE-\" + getNodeName() + \"-err.log\");\n s = s + \"<br>\" + makeLink(\"log-\" + getNodeName() + \".html\");\n logFilesUrls = s;\n }", "public void logStreams() {\n logger.debug(\"error stream:\");\n logStream(this.bufferedErrorStream, false);\n logger.debug(\"input stream:\");\n logStream(this.bufferedInputStream, true);\n }", "public void setOutput(File out) {\r\n this.output = out;\r\n incompatibleWithSpawn = true;\r\n }", "public void setErrorWriter(final Writer errorWriter) {\n this.octaveExec.setErrorWriter(errorWriter);\n }", "public void setOut(PrintStream out);", "public void setOutputLink(String[] s) {\n outputLink = new Vector<String>();\n if (s != null) {\n for (String value : s) {\n outputLink.add(value.trim());\n }\n }\n }", "public void setOutputproperty(String outputProp) {\r\n redirector.setOutputProperty(outputProp);\r\n incompatibleWithSpawn = true;\r\n }", "public ErrorHandlerLogger(Appendable out, Callback redirects, boolean summary) {\r\n\t\t_logger = out;\r\n\t\t\r\n\t\t_summary = summary;\r\n\r\n\t\t_redirects = redirects;\r\n\t\t\r\n\t\t_errors = Collections.synchronizedList(new ArrayList<ObjectThrowable>());\r\n\t\t\r\n\t\t_status = Collections.synchronizedMap(new TreeMap<Integer, Integer>());\r\n\t\t_rostatus = Collections.synchronizedMap(new TreeMap<Integer, Integer>());\r\n\r\n\t\t_cache = Collections.synchronizedMap(new TreeMap<String, Integer>());\r\n\t\t_rocache = Collections.synchronizedMap(new TreeMap<String, Integer>());\r\n\t\t\r\n\t\t_type = Collections.synchronizedMap(new TreeMap<String, Integer>());\r\n\t\t_rotype = Collections.synchronizedMap(new TreeMap<String, Integer>());\r\n\t\t\r\n\t\t_time = Collections.synchronizedMap(new TreeMap<Integer, Integer>());\r\n\t\t_rotime = Collections.synchronizedMap(new TreeMap<Integer, Integer>());\r\n\t\t\r\n\t\t_lookups = 0;\r\n\r\n\t\t_df = new SimpleDateFormat(\"dd/MMM/yyyy:HH:mm:ss Z\", Locale.US);\r\n\t}", "public ConsoleRedirect(TextArea textArea) {\n this.textArea = textArea;\n this.saveErr = System.err;\n this.saveOut = System.out;\n\n // Set the flushThread to be a Daemon thread. A Daemon thread will continue to run after the the program finishes\n flushThread.setDaemon(true);\n }", "public final void setOutput(String sinkName, Object output) throws ConnectException,\n UnsupportedOperationException {\n if (output instanceof ContentHandler) {\n this.result = new SAXResult((ContentHandler) output);\n } else if (output instanceof WritableByteChannel) {\n this.result = new StreamResult(Channels.newOutputStream((WritableByteChannel) output));\n } else if (output instanceof OutputStream) {\n this.result = new StreamResult((OutputStream) output);\n } else if (output instanceof Writer) {\n this.result = new StreamResult((Writer) output);\n } else if (output instanceof File) {\n this.result = new StreamResult((File) output);\n } else if (output instanceof Node) {\n this.result = new DOMResult((Node) output);\n } else {\n throw new ConnectException(i18n.getString(\"unsupportedOutputType\", output.getClass(),\n XMLReaderFilter.class.getName()));\n }\n }", "void setDestination(Locations destination);", "public void setLogDestination(String logDestination) {\n this.logDestination = logDestination;\n }", "public void setOutputReceiver(Consumer<String> receiver) {\n out = receiver;\n }", "@Test\n public void localAction_stderrIsReported() throws Exception {\n if (OS.getCurrent() == OS.WINDOWS) {\n return;\n }\n write(\n \"BUILD\",\n \"genrule(\",\n \" name = 'foo',\",\n \" srcs = [],\",\n \" outs = ['out/foo.txt'],\",\n \" cmd = 'echo my-error-message > $@',\",\n \")\",\n \"genrule(\",\n \" name = 'foobar',\",\n \" srcs = [':foo'],\",\n \" outs = ['out/foobar.txt'],\",\n \" cmd = 'cat $(location :foo) >&2 && exit 1',\",\n \" tags = ['no-remote'],\",\n \")\");\n RecordingOutErr outErr = new RecordingOutErr();\n this.outErr = outErr;\n\n assertThrows(BuildFailedException.class, () -> buildTarget(\"//:foobar\"));\n\n assertOutputContains(outErr.errAsLatin1(), \"my-error-message\");\n }", "public void setOutput(File output) {\r\n this.output = output;\r\n }", "@Override\n public void setOutputDir(String outputDir) {\n this.outputDir = outputDir;\n }", "private void setupWriter() {\n output = new StringWriter();\n writer = new PrintWriter(output);\n }", "@After\n public void tearDown(){\n final String standardOutput = myOut.toString();\n final String standardError = myErr.toString();\n assertEquals(\"You used 'System.out' in your assignment, This is not allowed.\",true, standardOutput.length() == 0);\n assertEquals(\"You used 'System.err' in your assignment, This is not allowed.\",true, standardError.length() == 0);\n System.err.flush();\n System.out.flush();\n System.setOut(new PrintStream(new FileOutputStream(FileDescriptor.out)));\n System.setErr(new PrintStream(new FileOutputStream(FileDescriptor.err)));\n }", "private static void execWithOutput(String[] cmd)\n throws IOException\n {\n Process p = Runtime.getRuntime().exec(cmd);\n StreamRedirector errRedirector = new StreamRedirector(p.getErrorStream(), System.err);\n errRedirector.start();\n StreamRedirector outRedirector = new StreamRedirector(p.getInputStream(), System.out);\n outRedirector.start();\n }", "public void setOutput(File file){\n outputDir = file;\n }", "public void setOutput(Output output) {\n\t\tthis.output = output;\n\t}", "public void set_log_stream(Writer strm) {\r\n stream = strm;\r\n }", "void setOutputPath(String outputPath);", "public void setOutput(TestOut output) {\n\tthis.output = output;\n\tsuper.setOutput(output);\n }", "public void turnOnSystemOutput(){\n if(originalSystemOut == null){\n originalSystemOut = System.out;\n System.setOut(new PrintStream(generalStream));\n //will cause CSS hang up\n// System.setIn(console.getInputStream());\n }\n }", "@Test\n public void shouldSucceedWithNoOutputRedirections() {\n Template template = createTemplate(\"file\", \"file\");\n new OutputRedirectionTemplateValidator(\"stdout\").validate(template, new NullHeterogeneousRegistry());\n }", "static public void setPrintStream( PrintStream out ) {\n \t Debug.out = out;\n }", "void addSinks(McastRoute route, Set<ConnectPoint> sinks);", "static PrintStream outputStream() {\n return System.err;\n }", "final public static void setLogDestination(LogDestination logDestination) {\n\t\tlogger.setLogDestinationImpl(logDestination);\n\t}", "protected final void setOutputStream(LoggedDataOutputStream outputStream) {\n if (this.outputStream == outputStream) return ;\n if (this.outputStream != null) {\n try {\n this.outputStream.close();\n } catch (IOException ioex) {/*Ignore*/}\n }\n this.outputStream = outputStream;\n }", "public void setOutputStream(OutputStream out) {\n this.output = out;\n }", "private void logConfigLocations() {\n\t\tlogger.info(\"XD config location: \" + environment.resolvePlaceholders(XD_CONFIG_LOCATION));\n\t\tlogger.info(\"XD config names: \" + environment.resolvePlaceholders(XD_CONFIG_NAME));\n\t\tlogger.info(\"XD module config location: \" + environment.resolvePlaceholders(XD_MODULE_CONFIG_LOCATION));\n\t\tlogger.info(\"XD module config name: \" + environment.resolvePlaceholders(XD_MODULE_CONFIG_NAME));\n\t}", "public void write(URL dest) throws IOException, RenderException {\r\n\t\twrite(dest, true);\r\n\t}", "public final void toLogFile() {\n\t\tRetroTectorEngine.toLogFile(\"Error message from \" + THESTRINGS[0] + \":\");\n\t\tfor (int i=1; i<THESTRINGS.length; i++) {\n\t\t\tRetroTectorEngine.toLogFile(THESTRINGS[i]);\n\t\t}\n\t}", "private void copyTempOutErrToActionOutErrMaybe(\n FileOutErr tempOutErr,\n FileOutErr outErr,\n ShowIncludesFilter showIncludesFilterForStdout,\n ShowIncludesFilter showIncludesFilterForStderr)\n throws ActionExecutionException {\n if (!shouldParseShowIncludes()) {\n return;\n }\n\n try {\n tempOutErr.close();\n if (tempOutErr.hasRecordedStdout()) {\n try (InputStream in = tempOutErr.getOutputPath().getInputStream()) {\n ByteStreams.copy(\n in, showIncludesFilterForStdout.getFilteredOutputStream(outErr.getOutputStream()));\n }\n }\n if (tempOutErr.hasRecordedStderr()) {\n try (InputStream in = tempOutErr.getErrorPath().getInputStream()) {\n ByteStreams.copy(\n in, showIncludesFilterForStderr.getFilteredOutputStream(outErr.getErrorStream()));\n }\n }\n } catch (IOException e) {\n throw ActionExecutionException.fromExecException(\n new EnvironmentalExecException(\n e, createFailureDetail(\"OutErr copy failure\", Code.COPY_OUT_ERR_FAILURE)),\n CppCompileAction.this);\n }\n }", "public void setOutput(String outputFile) {\n this.output = outputFile;\n }", "public void setDefaultOutputFiles() {\n setOutputFileValue(\"t\",false);\n setOutputFileValue(\"s\",false);\n setOutputFileValue(\"opsit\",false);\n setOutputFileValue(\"airt\",false);\n setOutputFileValue(\"q\",false);\n setOutputFileValue(\"cost\",false);\n setOutputFileValue(\"psi\",false);\n setOutputFileValue(\"opsi\",false);\n setOutputFileValue(\"opsip\",false);\n setOutputFileValue(\"opsia\",false);\n setOutputFileValue(\"zpsi\",false);\n setOutputFileValue(\"fofy\",false);\n setOutputFileValue(\"rho\",false);\n setOutputFileValue(\"err\",false);\n setOutputFileValue(\"sst\",false);\n setOutputFileValue(\"sss\",false);\n setOutputFileValue(\"tair\",false);\n setOutputFileValue(\"qair\",false);\n setOutputFileValue(\"hice\",false);\n setOutputFileValue(\"aice\",false);\n setOutputFileValue(\"tice\",false);\n setOutputFileValue(\"pptn\",false);\n setOutputFileValue(\"evap\",false);\n setOutputFileValue(\"runoff\",false);\n setOutputFileValue(\"arcice\",false);\n setOutputFileValue(\"fwfxneto\",false);\n setOutputFileValue(\"fx0neto\",false);\n setOutputFileValue(\"fxfa\",false);\n setOutputFileValue(\"temp\",false);\n setOutputFileValue(\"saln\",false);\n setOutputFileValue(\"albedo\",false);\n }", "@Before\n public void changeOutStream() {\n PrintStream printStream = new PrintStream(outContent);\n System.setOut(printStream);\n }", "public void setLogWriter(PrintWriter out) throws ResourceException {\n log.finest(\"setLogWriter()\");\n logwriter = out;\n }", "public static void setLogStream(PrintStream log) {\n out = log;\n }", "private void setupStreams() throws IOException {\n\t\toutput = new ObjectOutputStream(Connection.getOutputStream());\n\t\toutput.flush();\n\t\tinput = new ObjectInputStream(Connection.getInputStream()); \n\t\tshowMessage(\"\\n Streams have successfully connected.\");\n\t}", "public void turnOffSystemOutput() {\n if (originalSystemOut != null) {\n System.setOut(originalSystemOut);\n originalSystemOut = null;\n\n // WARNING: It is not possible to reconfigure the logger here! This\n // method is called in the UI thread, so reconfiguring the logger\n // here would mean that the UI thread waits for the logger, which\n // could cause a deadlock.\n }\n }", "@After\n\tpublic void restoreStreams() {\n\t\tSystem.setOut(originalOut);\n\t}", "public void write(PrintStream output) {\r\n writeHelper(output, overallRoot);\r\n }", "public void setOutputFilePath(String outputFilePath) {\n if (outputFilePath != null && !outputFilePath.trim().isEmpty()) {\n if (CONSOLE.equals(outputFilePath.toLowerCase())) {\n writer = new PrintWriter(System.out);\n } else {\n File outputFile = new File(outputFilePath);\n try {\n writer = new FileWriter(outputFile, false);\n } catch (IOException e) {\n if (LOG.isDebugEnabled()) {\n LOG.debug(e.getMessage(), e);\n } else {\n LOG.error(e.getMessage());\n }\n }\n }\n }\n }", "void setStderrFile(File file);", "public void setOutputDirectory(File outputDirectory) {\n\t\tthis.outputDirectory = outputDirectory;\n\t}", "public void setOutput(String output) { this.output = output; }", "public final void printErrors() {\n for (ShadowException exception : errorList) LOGGER.error(exception.getMessage());\n }", "public static void pipeOutputToFile(String location) {\n\t\tPrintStream fileOut;\n\t\ttry {\n\t\t\tfileOut = new PrintStream(new File(location));\n\t\t\tSystem.setOut(fileOut);\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public interface Redirectator {\n\n void prepareRedirection(RedirectCommand cmd);\n\n void cleanup();\n}", "protected void connectProcess(Process p) {\n // redirect all stdout from all the processes into a combined output stream\n // that pipes all the data into a combined input stream that serves as this\n // process sequence's input stream\n if (_stdOutRedirector==null) {\n _stdOutRedirector = new StreamRedirectThread(\"stdout Redirector \"+_index,\n p.getInputStream(),\n _combinedStdOutStream,\n false/*close*/,\n new ProcessSequenceThreadGroup(_combinedStdErrStream),\n true/*keepRunning*/);\n _stdOutRedirector.start();\n }\n else {\n _stdOutRedirector.setInputStream(p.getInputStream());\n }\n if (_stdErrRedirector==null) {\n _stdErrRedirector = new StreamRedirectThread(\"stderr Redirector \"+_index,\n p.getErrorStream(),\n _combinedStdErrStream,\n false/*close*/,\n new ProcessSequenceThreadGroup(_combinedStdErrStream),\n true/*keepRunning*/);\n _stdErrRedirector.start();\n }\n else {\n _stdErrRedirector.setInputStream(p.getErrorStream());\n }\n _combinedOutputStream = p.getOutputStream();\n }", "public void setupStreams() throws IOException{\n\t\t\n\t\toutput = new ObjectOutputStream(connection.getOutputStream());\n\t\toutput.flush();\n\t\tinput = new ObjectInputStream(connection.getInputStream());\n\t\tshowMessage(\"All streams are set up and ready to go!\");\n\t\t\n\t\t\t\t\n\t}", "public void wrap() {\n if (fSavedOut != null) {\n return;\n }\n fSavedOut = System.out;\n fSavedErr = System.err;\n final IOConsoleOutputStream out = fCurrent.newOutputStream();\n out.setColor(ConsoleUtils.getDefault().getBlack()); \n \n System.setOut(new PrintStream(out));\n final IOConsoleOutputStream err = fCurrent.newOutputStream();\n err.setColor(ConsoleUtils.getDefault().getRed()); \n \n System.setErr(new PrintStream(err));\n }", "public void setLogWriter(PrintWriter out) throws ResourceException {\n this.logWriter = out;\n }", "public void setErrorProperty(String errorProperty) {\r\n redirector.setErrorProperty(errorProperty);\r\n incompatibleWithSpawn = true;\r\n }", "public void setOutputDirectory(String dir) {\n\t\tnew LabeledText(\"Output directory:\").setText(dir);\n\t}", "public void setOutputStream(OutputStream outputStream) {\n this.outputStream = outputStream;\n }", "private static void setupLogging(IATOptions iatOptions) {\n\t\tPrintStream logS = null;\n\t\t\n\t\ttry {\n\t\t\tFile path = new File(iatOptions.logFilePath_);\n\t\t\tpath.getParentFile().mkdirs();\n\t\t\tlogS = new PrintStream(new FileOutputStream(path));\n\t\t\tSystem.setErr(logS);\n\t\t} catch (Exception e) {\n\t\t\tLogging.Init_LOG.error(\"Cannot open log file\", e);\n\t\t}\n\t}", "@Before\n\tpublic void setUp() throws Exception {\n\t\tSystem.setOut(new PrintStream(out));\n\t\tSystem.setErr(new PrintStream(err));\n\n\t}", "public void setOutputs(java.util.List<java.lang.String> value) {\n this.outputs = value;\n }", "private void createDestinationPdf(String dest) throws Exception {\n PdfDocument pdfDoc = new PdfDocument(new PdfWriter(dest));\n Document doc = new Document(pdfDoc);\n\n Paragraph anchor = new Paragraph(\"This is a destination\");\n\n // Set string destination, to which the created in the another pdf file link will lead.\n anchor.setProperty(Property.DESTINATION, \"dest\");\n doc.add(anchor);\n\n doc.close();\n }", "private void dumpRecordedOutErr(\n EventHandler eventHandler, Action action, FileOutErr outErrBuffer) {\n Event event = Event.info(\"From \" + action.describe() + \":\");\n dumpRecordedOutErr(eventHandler, event, outErrBuffer);\n }", "public static void setup() {\n\t\toutputs.add(new Console.stdout());\n\t}", "private static void setOutputProcessor(File outputDir, Launcher spoon, Environment environment) {\n JavaOutputProcessor outProcessor = spoon.createOutputWriter(); // Spoon 8\r\n environment.setDefaultFileGenerator(outProcessor); // Define output folder (needed for the output type: classes)\r\n\r\n // spoon.setOutputDirectory(IoUtils.getCanonicalPath(outputDir)); // Define output folder AGAIN (needed for the\r\n spoon.setSourceOutputDirectory(SpecsIo.getCanonicalPath(outputDir));// Define output folder AGAIN\r\n spoon.setBinaryOutputDirectory(SpecsIo.getCanonicalPath(outputDir)); // Define output folder AGAIN (needed for\r\n }", "protected void setSpecificInputOutput() {\n\t\tsetInputOutput(new GeoElement[] { (GeoElement) point, inputOrtho },\n\t\t\t\tnew GeoElement[] { line });\n\t}", "public void setTomopitchOutput() {\n if (dialog == null) {\n return;\n }\n TomopitchLog log = new TomopitchLog(manager, axisID);\n if (!setParameters(log)) {\n openTomopitchLog();\n }\n }", "public void setOutputDirectory(final String outputDirectory) {\n this.outputDirectory = outputDirectory;\n }", "public void setOutputs(final IOutputManager iOutputManager) {\n\t\tif ( !scheduled && !getExperiment().getSpecies().isBatch() ) {\n\t\t\tIDescription des = ((ISymbol) iOutputManager).getDescription();\n\t\t\toutputs = (IOutputManager) des.compile();\n\t\t\tMap<String, IOutput> mm = new TOrderedHashMap<String, IOutput>();\n\t\t\tfor ( IOutput output : outputs.getOutputs().values() ) {\n\t\t\t\tString oName =\n\t\t\t\t\toutput.getName() + \"#\" + this.getSpecies().getDescription().getModelDescription().getAlias() + \"#\" +\n\t\t\t\t\t\tthis.getExperiment().getSpecies().getName() + \"#\" + this.getExperiment().getIndex();\n\t\t\t\tmm.put(oName, output);\n\t\t\t}\n\t\t\toutputs.removeAllOutput();\n\t\t\tfor ( Entry<String, IOutput> output : mm.entrySet() ) {\n\t\t\t\toutput.getValue().setName(output.getKey());\n\t\t\t\toutputs.addOutput(output.getKey(), output.getValue());\n\t\t\t}\n\t\t} else {\n\t\t\toutputs = iOutputManager;\n\t\t}\n\t\t// end-hqnghi\n\t}", "public void setOutputFiles(Table outputFiles) {\n\t_outputFiles = outputFiles;\n }", "private void setupStreams() {\n\t\ttry {\n\t\t\tthis.out = new ObjectOutputStream(this.sock.getOutputStream());\n\t\t\tthis.out.flush();\n\t\t\tthis.in = new ObjectInputStream(this.sock.getInputStream());\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public interface OutputStrategy {\n\n\tpublic OutputStream getOutputStream(Config config);\n\tpublic void close();\n}", "private void writeToConsole(IOConsoleOutputStream stream, String output){\n try {\n stream.write(output);\n } catch (IOException e) {\n OPIBuilderPlugin.getLogger().log(Level.WARNING, \"Write Console error\",e); //$NON-NLS-1$\n }\n }", "public void write(PrintStream output) {\r\n writeInternal(finalRoot, output);\r\n }", "public void setOutputDirectory(String outputDirectory) {\n this.outputDirectory = outputDirectory;\n }", "private void openOutputStream() {\n\t\tPrintStreamManagement.openOutputStream();\n\t}", "public void setDestination(String destination1) {\r\n this.destination = destination1;\r\n }", "public void setOutput(String O)\t\n\t{\t//start of setOuput method\n\t\toutputMsg = O;\n\t}", "public void setOutput(String output) {\r\n\t\tthis.output = output;\r\n\t}", "public Route() {\n responseType = ResponseType.FORWARD;\n responsePath = FORWARD_TO_ERROR_PAGE;\n }", "public void setDestination(String destination) {\r\n this.destination = destination;\r\n }", "protected ConsoleHandler() {\n super();\n setConsole(System.err);\n setFormatter(LOG_FORMATTER);\n setLevel(DEFAULT_LEVEL);\n }", "public void setOutputFile(File params) {\n outputFile = params;\n }", "public Builder addAllDelegatedOutputs(\n java.lang.Iterable<? extends org.hyperledger.fabric.protos.token.Transaction.PlainDelegatedOutput> values) {\n if (delegatedOutputsBuilder_ == null) {\n ensureDelegatedOutputsIsMutable();\n com.google.protobuf.AbstractMessageLite.Builder.addAll(\n values, delegatedOutputs_);\n onChanged();\n } else {\n delegatedOutputsBuilder_.addAllMessages(values);\n }\n return this;\n }", "@AfterClass\n public static void finalise()\n {\n System.setOut(SYSTEM_OUT_ORIGINAL);\n }", "public void write(OutputStream dest) throws IOException, RenderException {\r\n\t\twrite(dest, true);\r\n\t}" ]
[ "0.6238899", "0.5867874", "0.56859165", "0.56494725", "0.56249976", "0.5519948", "0.5408588", "0.53798866", "0.5282086", "0.5216251", "0.52110535", "0.51976943", "0.51720536", "0.51604205", "0.5010674", "0.5003647", "0.49165612", "0.49066135", "0.48492196", "0.4827404", "0.47968593", "0.47962284", "0.4775266", "0.4759414", "0.47543296", "0.47336113", "0.47241363", "0.47218922", "0.47176257", "0.4712563", "0.47082964", "0.47061604", "0.46864933", "0.46859095", "0.4669947", "0.46644896", "0.4645028", "0.46176228", "0.4615217", "0.46109372", "0.4593883", "0.45928702", "0.4590055", "0.4589278", "0.45872438", "0.45558566", "0.4548316", "0.45343643", "0.45335254", "0.45241222", "0.45215687", "0.4516189", "0.4510754", "0.45090345", "0.4489479", "0.4481148", "0.44785747", "0.4476107", "0.44625002", "0.44550037", "0.4453384", "0.44515544", "0.44491515", "0.4447347", "0.44377992", "0.44284892", "0.44187117", "0.4415958", "0.44158316", "0.44151998", "0.44136167", "0.440995", "0.44097602", "0.44027385", "0.44026405", "0.44006026", "0.43907717", "0.4389498", "0.43730146", "0.43601978", "0.43596542", "0.4358485", "0.4357395", "0.43496302", "0.43284792", "0.43143168", "0.43139523", "0.43117282", "0.43047136", "0.4294297", "0.42932844", "0.42882973", "0.42777342", "0.42761344", "0.42736083", "0.42711368", "0.42673147", "0.42625964", "0.4260817", "0.42576012" ]
0.56436163
4
/ This approach did not work! The google doc plugin for viewing the pdf does not redirect the cookie header to the cognet website, thus the request is not authenticated and it is rejected. Download the pdf and open it locally via intents instead!
private void configWebViewToViewDirectly(){ WebView webView = new WebView(this); webView.getSettings().setJavaScriptEnabled(true); webView.getSettings().setPluginState(WebSettings.PluginState.ON); webView.getSettings().setAllowFileAccess(true); Map<String, String> headers = new HashMap<>(); headers.put("Cookie", cookie); System.out.println("pdf url: " + pdfUrl + ", cookie: " + cookie); //webView.loadUrl("https://docs.google.com/gview?embedded=true&url=http://www.cs.brandeis.edu/~olga/publications/clouddb14-admission.pdf"); //setContentView(R.layout.activity_pdfviewer); WebViewClient wvc = new WebViewClient() { @Override public boolean shouldOverrideUrlLoading(WebView view, String url){ Map<String, String> headers = new HashMap<>(); headers.put("Cookie", cookie); view.loadUrl(url, headers); return false; } @Override public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceRequest request) { try { //System.out.println("Got Cookie?: "+request.getRequestHeaders().get("Cookie")); DefaultHttpClient client = new DefaultHttpClient(); Uri url = request.getUrl(); //Uri url = Uri.parse("https://docs.google.com/gview?embedded=true&url=http://www.cs.brandeis.edu/~olga/publications/clouddb14-admission.pdf"); HttpGet httpGet = new HttpGet(url.toString()); httpGet.setHeader("Cookie", PDFViewer.this.cookie); httpGet.setHeader(HttpHeaders.USER_AGENT, "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36"); HttpResponse httpReponse = client.execute(httpGet); Header contentType = httpReponse.getEntity().getContentType(); Header encoding = httpReponse.getEntity().getContentEncoding(); InputStream responseInputStream ; //responseInputStream = httpReponse.getEntity().getContent(); if (request.getUrl().toString().equals("https://docs.google.com/favicon.ico")){ responseInputStream = httpReponse.getEntity().getContent(); } else { responseInputStream = HttpRequests.getPDF(PDFViewer.this.pdfUrl, PDFViewer.this.cookie); } String contentTypeValue = null; String encodingValue = null; if (contentType != null) { contentTypeValue = contentType.getValue(); } contentTypeValue = "application/pdf"; System.out.println("ContentType: "+contentTypeValue); System.out.println("encoding: "+encodingValue); if (encoding != null) { encodingValue = encoding.getValue(); } return new WebResourceResponse(contentTypeValue, encodingValue, responseInputStream); } catch (ClientProtocolException e) { //return null to tell WebView we failed to fetch it WebView should try again. return null; } catch (IOException e) { //return null to tell WebView we failed to fetch it WebView should try again. return null; } } }; webView.setWebViewClient(wvc); webView.loadUrl("https://docs.google.com/gview?embedded=true&url=" + pdfUrl, headers); setContentView(webView); System.out.println("Done~!"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void getPDF() {\n //for greater than lolipop versions we need the permissions asked on runtime\n //so if the permission is not available user will go to the screen to allow storage permission\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && ContextCompat.checkSelfPermission(this,\n Manifest.permission.READ_EXTERNAL_STORAGE)\n != PackageManager.PERMISSION_GRANTED) {\n Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS,\n Uri.parse(\"package:\" + getPackageName()));\n startActivity(intent);\n return;\n }\n\n //creating an intent for file chooser\n Intent intent = new Intent();\n intent.setType(\"application/pdf\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent, \"Select PDF File\"), PICK_PDF_CODE);\n }", "private PDF getPDF() {\n final Intent intent = getIntent();\n\t\tUri uri = intent.getData(); \t\n\t\tfilePath = uri.getPath();\n\t\tif (uri.getScheme().equals(\"file\")) {\n\t\t\tif (history) {\n\t\t\t\tRecent recent = new Recent(this);\n\t\t\t\trecent.add(0, filePath);\n\t\t\t\trecent.commit();\n\t\t\t}\n\t\t\treturn new PDF(new File(filePath), this.box);\n \t} else if (uri.getScheme().equals(\"content\")) {\n \t\tContentResolver cr = this.getContentResolver();\n \t\tFileDescriptor fileDescriptor;\n\t\t\ttry {\n\t\t\t\tfileDescriptor = cr.openFileDescriptor(uri, \"r\").getFileDescriptor();\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\tthrow new RuntimeException(e); // TODO: handle errors\n\t\t\t}\n \t\treturn new PDF(fileDescriptor, this.box);\n \t} else {\n \t\tthrow new RuntimeException(\"don't know how to get filename from \" + uri);\n \t}\n }", "private void selectPdf() {\n\n Intent intent = new Intent();\n intent.setType(\"application/pdf\");\n intent.setAction(Intent.ACTION_GET_CONTENT);//to fetch files\n startActivityForResult(intent,86);\n\n\n\n }", "void selectPDF()\n {\n Intent intent=new Intent();\n intent.setType(\"application/pdf\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(intent,9);\n }", "public void showPdfChooser() {\n Intent intent2 = new Intent();\n intent2.setType(\"application/pdf\");\n intent2.setAction(\"android.intent.action.GET_CONTENT\");\n startActivityForResult(Intent.createChooser(intent2, \"Select Document\"), PICK_IMAGE_REQUEST);\n }", "public String getConsentPDF();", "private void launchPdfFile(File pdfFile){\n String dstPath = (Environment.getExternalStoragePublicDirectory(\n Environment.DIRECTORY_DOWNLOADS) + \"/\" + pdfFile.getName());\n File dstFile = new File(dstPath);\n if (dstFile.exists()){ //if file exists\n Uri path = Uri.fromFile(dstFile); //path of file\n Intent objIntent = new Intent(Intent.ACTION_VIEW); //intent to launch pdf file\n objIntent.setDataAndType(path, \"application/pdf\");\n objIntent.setFlags(Intent. FLAG_ACTIVITY_CLEAR_TOP);\n startActivity(objIntent);//Starting the pdf viewer\n } else {\n Toast.makeText(this, \"Error: This file does not exists.\",\n Toast.LENGTH_SHORT).show();\n }\n }", "public static void openDocument(Context context, String strFilePath, String strFileType) {\n try {\n File file = new File(strFilePath);\n Intent intent = new Intent(Intent.ACTION_VIEW);\n /* if (strFileType.equals(\"pdf\")) {\n intent.setDataAndType(Uri.fromFile(file), \"application/pdf\");\n } else if (strFileType.equals(\"doc\") || strFileType.equals(\"docx\")) {\n MimeTypeMap myMime = MimeTypeMap.getSingleton();\n String mimeType = myMime.getMimeTypeFromExtension(strFilePath);\n intent.setDataAndType(Uri.fromFile(file), mimeType);\n } else {\n intent.setDataAndType(Uri.fromFile(file), \"application/*\");\n }*/\n intent.setDataAndType(Uri.fromFile(file), \"application/*\");\n intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);\n context.startActivity(intent);\n } catch (ActivityNotFoundException activityNotFoundException) {\n activityNotFoundException.printStackTrace();\n throw activityNotFoundException;\n } catch (Exception otherException) {\n otherException.printStackTrace();\n throw otherException;\n }\n }", "@Override\r\n\t\tprotected void onPostExecute(File result) {\n\t\t\tsuper.onPostExecute(result);\r\n\t\t\tpDialog.dismiss();\r\n\t\t\t Uri path = Uri.fromFile(file);\r\n\t\t\ttry {\r\n\t Intent intent = new Intent(Intent.ACTION_VIEW);\r\n\t intent.setDataAndType(path, \"application/pdf\");\r\n\t intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\r\n\t startActivity(intent);\r\n\t \r\n\t } catch (ActivityNotFoundException e) {\r\n\t \r\n\t }\r\n\t\t\t\r\n\t\t}", "public void onCreate(Bundle bundle) {\n super.onCreate(bundle);\n setContentView((int) R.layout.activity_webview);\n this.mWebView = (WebView) findViewById(R.id.web_view);\n this.mProgressBar = (ProgressBar) findViewById(R.id.progress_bar);\n this.mNoNetworkView = findViewById(R.id.no_network_view);\n this.mPdfUrl = getIntent().getStringExtra(\"pdf_url\");\n this.mWebView.getSettings().setJavaScriptEnabled(true);\n this.mWebView.loadUrl(String.format(GOOGLE_DOCS_PDF_VIEWER_BASE_URL, new Object[]{this.mPdfUrl}));\n }", "private void viewDocument() throws Exception{ \r\n CoeusVector cvDataObject = new CoeusVector();\r\n HashMap hmDocumentDetails = new HashMap();\r\n hmDocumentDetails.put(\"awardNumber\", awardBaseBean.getMitAwardNumber());\r\n hmDocumentDetails.put(\"sequenceNumber\", EMPTY_STRING+awardBaseBean.getSequenceNumber());\r\n hmDocumentDetails.put(\"fileName\", awardAddDocumentForm.txtFileName.getText());\r\n hmDocumentDetails.put(\"document\", getBlobData()); \r\n cvDataObject.add(hmDocumentDetails);\r\n RequesterBean requesterBean = new RequesterBean();\r\n DocumentBean documentBean = new DocumentBean();\r\n Map map = new HashMap();\r\n map.put(\"DATA\", cvDataObject);\r\n map.put(DocumentConstants.READER_CLASS, \"edu.mit.coeus.award.AwardDocumentReader\");\r\n map.put(\"USER\", CoeusGuiConstants.getMDIForm().getUserId());\r\n map.put(\"MODULE_NAME\", \"VIEW_DOCUMENT\");\r\n documentBean.setParameterMap(map);\r\n requesterBean.setDataObject(documentBean);\r\n requesterBean.setFunctionType(DocumentConstants.GENERATE_STREAM_URL); \r\n AppletServletCommunicator appletServletCommunicator = new\r\n AppletServletCommunicator(STREAMING_SERVLET, requesterBean);\r\n appletServletCommunicator.send();\r\n ResponderBean responder = appletServletCommunicator.getResponse(); \r\n if(!responder.isSuccessfulResponse()){\r\n throw new CoeusException(responder.getMessage(),0);\r\n }\r\n map = (Map)responder.getDataObject();\r\n String url = (String)map.get(DocumentConstants.DOCUMENT_URL);\r\n if(url == null || url.trim().length() == 0 ) {\r\n CoeusOptionPane.showErrorDialog(\r\n coeusMessageResources.parseMessageKey(\"protocolUpload_exceptionCode.1009\"));\r\n return;\r\n }\r\n url = url.replace('\\\\', '/') ;\r\n try{\r\n URL urlObj = new URL(url);\r\n URLOpener.openUrl(urlObj);\r\n }catch (MalformedURLException malformedURLException) {\r\n malformedURLException.printStackTrace();\r\n }catch( Exception ue) {\r\n ue.printStackTrace() ;\r\n }\r\n }", "@SuppressLint(\"InlinedApi\")\n @Override\n public void onDataLoaded(Uri pdfUri) {\n if (mAlreadyOpenedPdf) {\n return;\n }\n\n // Open in external application\n mAlreadyOpenedPdf = true;\n if (pdfUri == null) {\n Toast.makeText(getActivity(), R.string.cannot_download_pdf, Toast.LENGTH_SHORT).show();\n } else {\n try {\n startActivity(\n new Intent(Intent.ACTION_VIEW, pdfUri)\n .addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION)\n );\n } catch (ActivityNotFoundException e) {\n Toast.makeText(getActivity(), R.string.cannot_open_pdf, Toast.LENGTH_SHORT).show();\n }\n }\n\n // Dismiss this dialog (we already dismiss ourselves if there's any saved state so loss here is ok)\n dismissAllowingStateLoss();\n }", "private void showFileChooser() {\n // Intent intent = new Intent();\n\n /* intent.setType(\"application/pdf\");\n intent.setType(\"docx*//*\");*/\n\n Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);\n intent.addCategory(Intent.CATEGORY_OPENABLE);\n String [] mimeTypes = {\"application/pdf/docx\"};\n intent.setType(\"*/*\");\n intent.putExtra(Intent.EXTRA_MIME_TYPES, mimeTypes);\n\n\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent, \"Select Picture\"), PICK_IMAGE_REQUEST);\n }", "@Override\n public void handle(ActionEvent t) {\n \n try {\n Runtime.getRuntime().exec(\"rundll32 url.dll,FileProtocolHandler \" + \"src\\\\multimedia\\\\Manual de usuario.pdf\");\n} catch (IOException e) {\n e.printStackTrace();\n}\n\n}", "private void openFile(String name){\n File path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);\n File file = new File(path, \"\"+name);\n\n Intent install = new Intent(Intent.ACTION_VIEW);\n install.setDataAndType(Uri.fromFile(file), \"application/pdf\");\n install.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(install);\n\n }", "public static void printDocument(MVGObject bo, String property)\n {\n SessionManager smgr = SessionManager.getInstance();\n if (smgr.getActive() != null)\n {\n if (!smgr.getActive().isExpired())\n {\n try\n {\n //Prepare headers\n ArrayList<AbstractMap.SimpleEntry<String, String>> headers = new ArrayList<>();\n headers.add(new AbstractMap.SimpleEntry<>(\"Cookie\", smgr.getActive().getSessionId()));\n\n String filename = String.valueOf(bo.get(property));\n long start = System.currentTimeMillis();\n byte[] file = RemoteComms.sendFileRequest(filename, headers);\n if (file != null)\n {\n long ellapsed = System.currentTimeMillis() - start;\n IO.log(TAG, IO.TAG_INFO, \"File [\" + filename + \"] download complete, size: \" + file.length + \" bytes in \" + ellapsed + \"msec.\");\n\n PDF.printPDF(file);\n IO.log(TAG, IO.TAG_INFO, \"Printing: \" + filename + \" [\"+bo.get_id()+\"]\");\n }else{\n IO.logAndAlert(\"Print Trip\", \"Could not download file '\"+filename+\"'\", IO.TAG_ERROR);\n }\n }catch (PrintException e)\n {\n IO.logAndAlert(TAG, e.getMessage(), IO.TAG_ERROR);\n }catch (IOException e)\n {\n IO.logAndAlert(TAG, e.getMessage(), IO.TAG_ERROR);\n }\n } else IO.logAndAlert(\"Session Expired\", \"Active session has expired.\", IO.TAG_ERROR);\n } else IO.logAndAlert(\"Session Expired\", \"No active sessions.\", IO.TAG_ERROR);\n }", "private void downloadPDF(WebDriver driver, String link, File targetDir) {\n\t\ttry {\n\t\t\ttargetDir.mkdirs();\n\n\t\t\t// create connection\n\t\t\tURL url = new URL(link);\n\t\t\tHttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();\n\t\t\thttpURLConnection.setRequestMethod(\"GET\");\n\n\t\t\t// add cookies\n\t\t\tSet<Cookie> cookies = driver.manage().getCookies();\n\t\t\tStringBuilder cookieString = new StringBuilder();\n\t\t\tfor (Cookie cookie : cookies) {\n\t\t\t\tcookieString.append(cookie.getName()).append(\"=\").append(cookie.getValue()).append(\";\");\n\t\t\t}\n\t\t\thttpURLConnection.addRequestProperty(\"Cookie\", cookieString.toString());\n\n\t\t\t// download\n\t\t\tString baseName = FilenameUtils.getName(link);\n\t\t\ttry (InputStream in = httpURLConnection.getInputStream()) {\n\t\t\t\tFiles.copy(in, new File(targetDir, baseName).toPath(), StandardCopyOption.REPLACE_EXISTING);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\r\n\t\tpublic boolean shouldOverrideUrlLoading(WebView view, String url) {\n\r\n\r\n\t\t\tview.loadUrl(\"https://docs.google.com/viewer?url=\"+url);\r\n\r\n\t\t\treturn true;\r\n\r\n\t\t}", "@Test\n public void testPreSignDocumentIn() throws IOException, GeneralSecurityException\n {\n try ( InputStream resource = getClass().getResourceAsStream(\"document_in.pdf\");\n FileOutputStream os = new FileOutputStream(new File(RESULT_FOLDER, \"document_in-presigned.pdf\")) )\n {\n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n\n Certificate maincertificate = cf.generateCertificate(getClass().getResourceAsStream(\"Samson_aut.cer\"));\n Certificate[] chain = new Certificate[] { maincertificate };\n String hashAlgorithm = \"SHA-256\";\n\n PdfReader reader = new PdfReader(resource);\n PdfSigner signer = new PdfSigner(reader, os, new StampingProperties());\n signer.setFieldName(\"certification\"); // this field already exists\n signer.setCertificationLevel(PdfSigner.CERTIFIED_FORM_FILLING);\n PdfSignatureAppearance sap = signer.getSignatureAppearance();\n sap.setReason(\"Certification of the document\");\n sap.setLocation(\"On server\");\n sap.setCertificate(maincertificate);\n BouncyCastleDigest digest = new BouncyCastleDigest();\n PdfPKCS7 sgn = new PdfPKCS7(null, chain, hashAlgorithm, null, digest,false);\n PreSignatureContainer external = new PreSignatureContainer(PdfName.Adobe_PPKLite,PdfName.Adbe_pkcs7_detached);\n signer.signExternalContainer(external, 8192);\n byte[] hash=external.getHash();\n sgn.getAuthenticatedAttributeBytes(hash, PdfSigner.CryptoStandard.CMS, null, null);\n }\n }", "public static boolean canDisplayPdf(Context context) {\n\t\tPackageManager packageManager = context.getPackageManager();\n\t\tIntent testIntent = new Intent(Intent.ACTION_VIEW);\n\t\ttestIntent.setType(MIME_TYPE_PDF);\n\t\tif (packageManager.queryIntentActivities(testIntent,\n\t\t\t\tPackageManager.MATCH_DEFAULT_ONLY).size() > 0) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public static void extractText(String pdfUrl) throws Exception {\n URL url = new URL(ENDPOINT + pdfUrl);\n HttpURLConnection conn = (HttpURLConnection) url.openConnection();\n conn.setDoOutput(true);\n conn.setRequestMethod(\"GET\");\n conn.setRequestProperty(\"X-WM-CLIENT-ID\", CLIENT_ID);\n conn.setRequestProperty(\"X-WM-CLIENT-SECRET\", CLIENT_SECRET);\n\n int statusCode = conn.getResponseCode();\n System.out.println(\"Status Code: \" + statusCode);\n InputStream is = null;\n if (statusCode == 200) {\n is = conn.getInputStream();\n System.out.println(\"PDF text is shown below\");\n System.out.println(\"=======================\");\n } else {\n is = conn.getErrorStream();\n System.err.println(\"Something is wrong:\");\n }\n\n BufferedReader br = new BufferedReader(new InputStreamReader(is)); \n String output;\n while ((output = br.readLine()) != null) {\n System.out.println(output);\n }\n conn.disconnect();\n }", "DocumentData getPreviewSign(String documentId,\n String filename) throws IOException;", "@Override\r\n public void actionPerformed(ActionEvent e) {\n \r\n if (Desktop.isDesktopSupported()) {\r\n try {\r\n File myFile = new File(\"E:\");\r\n Desktop.getDesktop().open(myFile);\r\n \r\n } catch (IOException ex) {\r\n // no application registered for PDFs\r\n }\r\n}\r\n \r\n \r\n }", "private void openDocument(DocumentInfo doc, Model model) {\n Intent intent = new QuickViewIntentBuilder(\n getPackageManager(), getResources(), doc, model).build();\n\n if (intent != null) {\n // TODO: un-work around issue b/24963914. Should be fixed soon.\n try {\n startActivity(intent);\n return;\n } catch (SecurityException e) {\n // Carry on to regular view mode.\n Log.e(TAG, \"Caught security error: \" + e.getLocalizedMessage());\n }\n }\n\n // Fall back to traditional VIEW action...\n intent = new Intent(Intent.ACTION_VIEW);\n intent.setDataAndType(doc.derivedUri, doc.mimeType);\n\n // Downloads has traditionally added the WRITE permission\n // in the TrampolineActivity. Since this behavior is long\n // established, we set the same permission for non-managed files\n // This ensures consistent behavior between the Downloads root\n // and other roots.\n int flags = Intent.FLAG_GRANT_READ_URI_PERMISSION;\n if (doc.isWriteSupported()) {\n flags |= Intent.FLAG_GRANT_WRITE_URI_PERMISSION;\n }\n intent.setFlags(flags);\n\n if (DEBUG && intent.getClipData() != null) {\n Log.d(TAG, \"Starting intent w/ clip data: \" + intent.getClipData());\n }\n\n try {\n startActivity(intent);\n } catch (ActivityNotFoundException e) {\n Snackbars.makeSnackbar(\n this, R.string.toast_no_application, Snackbar.LENGTH_SHORT).show();\n }\n }", "@Override\n protected void onActivityResult(final int requestCode,\n final int resultCode, final Intent data) {\n switch (requestCode) {\n\n case REQUEST_CODE_OPENER:\n if (resultCode == RESULT_OK) {\n mFileId = data.getParcelableExtra(\n OpenFileActivityBuilder.EXTRA_RESPONSE_DRIVE_ID);\n\n Log.e(\"file id\", mFileId.getResourceId() + \"\");\n\n String url = \"https://drive.google.com/open?id=\"+ mFileId.getResourceId();\n Intent i = new Intent(Intent.ACTION_VIEW);\n i.setData(Uri.parse(url));\n startActivity(i);\n }\n break;\n\n default:\n super.onActivityResult(requestCode, resultCode, data);\n break;\n }\n }", "public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {\n String filePath = \"/home/harun/Downloads/Q3.pdf\";\n File downloadFile = new File(filePath);\n FileInputStream inputStream = new FileInputStream(downloadFile);\n\n // Get the mimeType of the file\n ServletContext context = getServletContext();\n String mimeType = context.getMimeType(filePath);\n\n // Fetch file in binary there's no MimeType mapping\n if(mimeType==null) mimeType = \"application/octet-stream\";\n // Log the mimeType in the console\n System.out.println(mimeType);\n\n\n //Set the response mimeType/contentType and file length\n response.setContentType(\"Mime Tyoe: \" + mimeType);\n int fileLength = (int) downloadFile.length();\n response.setContentLength(fileLength);\n\n // Set the response header value// Force download\n String headerKey = \"Content-Disposition\";\n String headerValue = String.format(\"attachment; filename=\\\"%s\\\"\", downloadFile.getName());\n response.setHeader(headerKey,headerValue);\n\n // read the input stream in buffered chunks to the output stream\n OutputStream outputStream = response.getOutputStream();\n byte[] buffer = new byte[4096]; // Buffers of 4MB's\n int c = -1;\n\n while((c = inputStream.read(buffer)) != -1){\n outputStream.write(buffer, 0, c);\n }\n\n // Close the input and output streams\n inputStream.close();\n outputStream.close();\n\n }", "DocumentData getPreviewDocument(String documentId,\n String filename,\n String mimetype) throws IOException;", "private void getPDF(){\r\n\t\t\r\n\t\tif(request.getParameter(\"exportType\").equals(PDFGenerator.EXPORT_ADMIN)){\r\n\t\t\tgetAdministration(); // pdf uses same data\r\n\t\t} else if(request.getParameter(\"exportType\").equals(PDFGenerator.EXPORT_TEACHER)){\r\n\t\t\tgetEventRegistration(); // pdf uses same data\r\n\t\t}\r\n\t\t\r\n\t\tPDFGenerator pdfGen = new PDFGenerator();\r\n\t\tpdfGen.createDocument(request, response);\r\n\t\t\r\n\t\tString eventTitle = \"all\";\r\n\t\t\r\n\t}", "public void openDocumentUrl(CampaignTrainingOutput selectedCampaignTrainingOutput) {\n\n //Opening Url\n customTabsIntent.launchUrl(this, Uri.parse(selectedCampaignTrainingOutput.getUrl()));\n }", "ByteArrayOutputStream createPDF(String pdfTextUrl);", "public void loadPdfFile() {\n PDFView.Configurator configurator;\n RelativeLayout relativeLayout = (RelativeLayout)this.pdfView.getParent();\n this.errorTextView = (TextView)relativeLayout.findViewById(2131296408);\n this.progressBar = (ProgressBar)relativeLayout.findViewById(2131296534);\n this.sharedPreferences = Factory.getInstance().getMainNavigationActivity().getSharedPreferences(\"AppsgeyserPrefs\", 0);\n StringBuilder stringBuilder = new StringBuilder();\n stringBuilder.append(\"pdf_saved_page_\");\n stringBuilder.append(this.initialTabId);\n savedPageKey = stringBuilder.toString();\n if (this.pathFile.startsWith(\"file:///\")) {\n String string2 = this.pathFile.replace((CharSequence)\"file:///android_asset/\", (CharSequence)\"\");\n configurator = this.pdfView.fromAsset(string2);\n } else {\n boolean bl = this.pathFile.startsWith(\"http\");\n configurator = null;\n if (bl) {\n String string3 = this.pathFile;\n new LoaderPdf().execute((Object[])new String[]{string3});\n }\n }\n this.pdfView.useBestQuality(true);\n if (configurator == null) return;\n try {\n this.loadConfigurator(configurator);\n return;\n }\n catch (Exception exception) {\n exception.printStackTrace();\n this.progressBar.setVisibility(8);\n }\n }", "public void onClick(DialogInterface dialog, int which) {\n Intent browserIntent = new Intent(\n Intent.ACTION_VIEW,\n Uri.parse(\"https://docs.google.com/spreadsheet/viewform?formkey=dGpiRDhreGpmTFBmQ2FUTVVjVlhESHc6MQ\"));\n startActivity(browserIntent);\n\n return;\n }", "ResponseEntity<byte[]> getProjectPDF(Long projectId, String lang) throws IOException, DocumentException;", "@Override\n public void onDownloadStart(String url, String userAgent,\n String contentDisposition, String mimetype,\n long contentLength) {\n\n startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));\n }", "public void loadPDF(URL url) throws IOException {\n loadPDF(new BufferedInputStream(url.openConnection().getInputStream()));\n }", "@RequestMapping(value=\"/receiveFile\", method = RequestMethod.POST)\n public ResponseEntity<JsonResponse> receiveFile(@RequestBody JsonRequest request) {\n \n try{\n byte[] decodedContent = Base64.getDecoder().decode(request.getContent());\n\n PDFSecure pdfDoc = new PDFSecure(new ByteArrayInputStream(decodedContent), null);\n\n // Load the keystore that contains the digital id to use in signing\n FileInputStream pkcs12Stream = new FileInputStream (System.getenv(\"KEYSTORE_PATH\"));\n KeyStore store = KeyStore.getInstance(\"PKCS12\");\n \n store.load(pkcs12Stream, \"mypassword\".toCharArray());\n pkcs12Stream.close();\n\n // Create signing information\n SigningInformation signInfo = new SigningInformation (store, \"myalias\", \"mypassword\");\n\n // Customize the signature appearance\n SignatureAppearance signAppear = signInfo.getSignatureAppearance();\n\n // Create signature field on the first page\n Rectangle2D signBounds = new Rectangle2D.Double (36, 36, 144, 48);\n SignatureField signField = pdfDoc.addSignatureField(0, \"signature\", signBounds);\n\n // Apply digital signature\n pdfDoc.signDocument(signField, signInfo);\n \n ByteArrayOutputStream signedContent = new ByteArrayOutputStream();\n\n pdfDoc.saveDocument (signedContent);\n\n String encodedSignedContent = Base64.getEncoder().encodeToString(signedContent.toByteArray());\n\n log.info(request.getFileName());\n\n return new ResponseEntity<>(new JsonResponse(request.getFileName(), encodedSignedContent, \"sucess\"), HttpStatus.CREATED);\n } catch (Exception e) {\n \n e.printStackTrace();\n return new ResponseEntity<>(new JsonResponse(request.getFileName(), \"null\", \"exception\"), HttpStatus.INTERNAL_SERVER_ERROR);\n }\n\n }", "@Override\n public void onSuccess(FileDownloadTask.TaskSnapshot taskSnapshot) {\n\n Log.d(TAG, \"onSuccess: Downloaded File\");\n pdfView.fromFile(localFile).load();\n\n }", "private void detectionPDF() {\n\t\tif (sourcePDF.getText().equals(\"\")){\n\t\t\tlockButton();\n\t\t\tmessage.setText(\"<html><span color='red'>Pas de PDF</span></html>\");\n\t\t}\n\t\telse{\n\t\t\tif(new File(sourcePDF.getText()).exists()){\n\t\t\t\tmessage.setText(\"<html><head><meta charset=\\\"UTF-8\\\"><span color='green'>Fichier PDF détecté</span></html>\");\n\t\t\t\tunlockButton();\n\t\t\t}\n\t\t\telse\n\t\t\t\tmessage.setText(\"<html><span color='red'>le fichier \"+ sourcePDF.getText() +\" n'existe pas</span></html>\");\n\t\t}\n\t}", "private void pickFile() {\n\n String[] mimeTypes = {\"application/pdf\"};\n\n Intent intent = new Intent(Intent.ACTION_GET_CONTENT);\n intent.addCategory(Intent.CATEGORY_OPENABLE);\n intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE,false);\n intent.setType(\"*/*\");\n intent.putExtra(Intent.EXTRA_MIME_TYPES, mimeTypes);\n startActivityForResult(intent, 2);\n\n\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tIntent intent = new Intent(getApplicationContext(),Routine.class);\n\t\t\t\tintent.putExtra(\"pdf\", \"http://www.aust.edu/bba/class_routine_mba.pdf\");\n\t\t\t\tstartActivity(intent);\n\t\t\t}", "private void fetchingData() {\n loadingDialog.startLoadingDialog();\n\n FirebaseStorage.getInstance().getReference().child(\"course-details\").child(\"course-details.pdf\")\n .getBytes(1024 * 1024).addOnSuccessListener(bytes -> {\n loadingDialog.dismissDialog();\n Toast.makeText(getApplicationContext(), \"Zoom out !!\", Toast.LENGTH_LONG).show();\n pdfView.fromBytes(bytes).load();\n }).addOnFailureListener(e ->\n Toast.makeText(getApplicationContext(), \"download unsuccessful\", Toast.LENGTH_LONG).show());\n }", "public void downloadDocumentUrl(CampaignTrainingOutput selectedCampaignTrainingOutput) {\n\n //Checking permission Marshmallow\n if (Build.VERSION.SDK_INT >= 23) {\n\n if (checkPermissionStorage())\n {\n\n downloadFile(selectedCampaignTrainingOutput);\n\n } else {\n\n //Request permission\n requestPermissionStorage();\n }\n } else {\n\n\n downloadFile(selectedCampaignTrainingOutput);\n }\n }", "@RequestMapping(value = CaerusAnnotationURLConstants.CANDIDATE_DOWNLOAD_CV)\n\tpublic void downloadCV(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException,CaerusCommonException\n\t{\n\t\t//Spring security authentication containing the logged in user details\n\t\tAuthentication auth = SecurityContextHolder.getContext().getAuthentication();\n\t\tString emailId = auth.getName();\n\t\t\n\t\t\tStudentDom file = studentManager.getDetailsByEmailId(emailId);\n\t\t\t\n\t\t\t String fileName = file.getResumeName();\n\t\t\t if(fileName != null && !fileName.equals(null))\n\t\t\t {\n\t\t \t response.setHeader(\"Content-Disposition\",\"inline; filename=\\\"\" + file.getResumeName() +\"\\\"\");\n\t\t \t FileCopyUtils.copy(file.getFileData(), response.getOutputStream());\n\t\t } \n\t\t\t else\n\t\t\t {\n\t\t \t throw new CaerusCommonException(\"Resume is not available in database, Please upload your resume\");\n\t\t\t }\n\t}", "private void sendPDF(byte[] content, HttpServletResponse response) throws IOException {\n response.setContentType(\"application/pdf\");\n response.setContentLength(content.length);\n response.getOutputStream().write(content);\n response.getOutputStream().flush();\n }", "public Blob toPdf(String inCommandLine, String inUrl, String inFileName) throws IOException, CommandNotAvailable,\n NuxeoException {\n\n return run(inCommandLine, inUrl, inFileName, null);\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_webview, container, false);\n ((MainActivity) getActivity()).setDrawerState(false);\n ((MainActivity) getActivity()).setTitle(\"\");\n webView = (WebView) rootView.findViewById(R.id.webview);\n img_download = (ImageView) rootView.findViewById(R.id.img_download);\n progressDialog = new ProgressDialog(getActivity());\n\n\n webView.getSettings().setJavaScriptEnabled(true);\n webView.getSettings().setAllowContentAccess(true);\n webView.getSettings().setUseWideViewPort(true);\n webView.getSettings().setLoadWithOverviewMode(true);\n // webView.getSettings().setSupportZoom(true);\n webView.getSettings().setBuiltInZoomControls(true);\n webView.getSettings().setDisplayZoomControls(false);\n webView.getSettings().setDomStorageEnabled(true);\n\n if (Build.VERSION.SDK_INT >= 21) {\n webView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);\n }\n bundle = getArguments();\n if (bundle.containsKey(\"Social_url\")) {\n img_download.setVisibility(View.GONE);\n// progressDialog.setMessage(\"Please Wait..\");\n// progressDialog.show();\n try {\n String[] file_split = bundle.getString(\"Social_url\").split(\"\\\\.(?=[^\\\\.]+$)\");\n String str_exten = file_split[1];\n if (str_exten.equalsIgnoreCase(\"pdf\")) {\n webView.setWebViewClient(new WebViewController());\n webView.loadUrl(\"http://docs.google.com/gview?embedded=true&url=\" + bundle.getString(\"Social_url\"));\n\n } else {\n webView.setWebViewClient(new WebViewClient());\n webView.loadUrl(bundle.getString(\"Social_url\"));\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n } else if (bundle.containsKey(\"document_file\")) {\n img_download.setVisibility(View.VISIBLE);\n Log.d(\"AITL\", \"BundleWebview\" + \"http://docs.google.com/gview?embedded=true&url=\" + bundle.getString(\"document_file\"));\n progressDialog.setMessage(\"Please Wait..\");\n progressDialog.show();\n webView.setWebViewClient(new WebViewController());\n webView.loadUrl(\"http://docs.google.com/gview?embedded=true&url=\" + bundle.getString(\"document_file\"));\n\n img_download.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n if (Build.VERSION.SDK_INT >= 23) {\n if (isCameraPermissionGranted()) {\n downloadFile();\n } else {\n requestPermission();\n }\n } else {\n downloadFile();\n }\n }\n });\n }\n return rootView;\n }", "public void downloadPDF(String fileName, String fileExtension, String destinationDirectory, String url) {\n DownloadManager downloadManager = (DownloadManager) getContext().getSystemService(Context.DOWNLOAD_SERVICE);\n Uri uri = Uri.parse(url);\n DownloadManager.Request request = new DownloadManager.Request(uri);\n\n request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);\n request.setDestinationInExternalFilesDir(getContext(), destinationDirectory, fileName + fileExtension);\n downloadManager.enqueue(request);\n }", "@RequestMapping(value = \"/download\", method = RequestMethod.GET)\n public PdfView download(final Model model) {\n final PdfView view = new PdfView();\n return view;\n }", "DocumentData getPreviewReport(String documentId,\n String filename, String mimetype) throws IOException;", "public void onDownloadStart(String url, String userAgent,\n String contentDisposition, String mimetype,\n long contentLength) {\n\n startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));\n }", "public void OpenFileFromGoogleDrive(){\n\n IntentSender intentSender = Drive.DriveApi\n .newOpenFileActivityBuilder()\n .setMimeType(new String[] { \"text/plain\", \"text/html\" })\n .build(mGoogleApiClient);\n try {\n startIntentSenderForResult(\n\n intentSender, REQUEST_CODE_OPENER, null, 0, 0, 0);\n\n } catch (IntentSender.SendIntentException e) {\n\n Log.w(TAG, \"Unable to send intent\", e);\n }\n\n }", "@Override\r\n\tpublic void createPDF(HttpServletRequest request, OutputStream os) {\n\t\t\r\n\t}", "@Override\r\n public void encryptPdf(String src, String dest) throws IOException, DocumentException {\n\r\n }", "@Override \r\n public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimetype, \r\n\t long contentLength) {\n \tString filename = SDHelper.getAppDataPath() + File.separator \r\n\t\t\t\t\t+ getFilename(url);\r\n \tFile file =new File(filename);\r\n \tif (file.exists()) {\r\n\t\t\t\tIntent intent = new Intent(Intent.ACTION_VIEW);\r\n\t\t\t\tintent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\r\n\t\t\t\tString ext = getExt(file);\r\n\t\t\t\tString mark = null;\r\n\t\t\t if (ext.equalsIgnoreCase(\"doc\")||ext.equalsIgnoreCase(\"docx\"))\r\n\t\t\t\t\tmark = \"application/msword\";\r\n\t\t\t\telse if (ext.equalsIgnoreCase(\"xls\")||ext.equalsIgnoreCase(\"xlsx\"))\r\n\t\t\t\t\tmark = \"application/vnd.ms-excel\";\r\n\t\t\t\telse if (ext.equalsIgnoreCase(\"ppt\")||ext.equalsIgnoreCase(\"pptx\"))\r\n\t\t\t\t\tmark = \"application/vnd.ms-powerpoint\";\r\n\t\t\t\telse if (ext.equalsIgnoreCase(\"pdf\"))\r\n\t\t\t\t\tmark = \"application/pdf\";\r\n\t\t\t\t\r\n\t\t\t\telse if (ext.equalsIgnoreCase(\"apk\"))\r\n\t\t\t\t\tmark = \t\"application/vnd.android.package-archive\"; \r\n\t\t\t\tintent.setDataAndType(Uri.fromFile(file), mark);\r\n\t\t\t\tmContext.startActivity(intent);\r\n\r\n \t}\r\n \telse \r\n \t new getFileAsync().execute(url);\r\n \t\r\n \t}", "@Override\n\tpublic File getDocument(String name) {\n\t\t\n\t\tFile returnValue = new File(RestService.documentDirectory + name + \".pdf\");\n\t\t\n\t\tif(returnValue.exists() && !returnValue.isDirectory()) { \n\t\t return returnValue;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t}", "public Document fetchDocument(String url) { \n Document doc = new Document(\"\");\n //http://www.oracle.com/technetwork/java/javase/8u111-relnotes-3124969.html\n //Disable basic authentication for HTTPS tunneling \n System.setProperty(\"jdk.http.auth.tunneling.disabledSchemes\", \"''\");\n System.out.println(\"Acessing url \" + url + \" ...\");\n\n try {\n URL robotsTxT = new URL(url);\n\n Proxy proxy = proxies.get(this.rand.nextInt(proxies.size()));\n \n Authenticator authenticator = new Authenticator() {\n @Override\n protected PasswordAuthentication getPasswordAuthentication() {\n return (new PasswordAuthentication(USER, PASS.toCharArray()));\n }\n };\n Authenticator.setDefault(authenticator);\n \n HttpURLConnection httpConn = (HttpURLConnection) robotsTxT.openConnection(proxy);\n httpConn.setRequestProperty(\"User-Agent\", agentValue.get(rand.nextInt(agentValue.size())));\n\n Scanner httpResponse = new Scanner(httpConn.getInputStream());\n\n ByteArrayOutputStream response = new ByteArrayOutputStream();\n while(httpResponse.hasNextLine()) {\n response.write(httpResponse.nextLine().getBytes());\n } \n\n response.close();\n httpResponse.close(); \n\n String robotsData = response.toString();\n\n if(robotsData != null) {\n doc = Jsoup.parse(robotsData);\n }\n\n } catch (Exception ex) {\n System.err.println(\"ERROR: \" + ex.getMessage());\n }\n\n return doc;\n }", "public void cargarPdf() {\n\t\tif (pdf != null) {\n\t\t\tFacesMessage message = new FacesMessage(\"Se cargo \", pdf.getFileName() + \" correctamente.\");\n\t\t\tFacesContext.getCurrentInstance().addMessage(null, message);\n\t\t}\n\t}", "public void createPdf(String dest) throws IOException, DocumentException, XMPException {\n Document document = new Document(PageSize.A4.rotate());\n //PDF/A-3b\n //Create PdfAWriter with the required conformance level\n PdfAWriter writer = PdfAWriter.getInstance(document, new FileOutputStream(dest), PdfAConformanceLevel.ZUGFeRD);\n writer.setPdfVersion(PdfWriter.VERSION_1_7);\n //Create XMP metadata\n writer.createXmpMetadata();\n writer.getXmpWriter().setProperty(PdfAXmpWriter.zugferdSchemaNS, PdfAXmpWriter.zugferdDocumentFileName, \"invoice.xml\");\n //====================\n document.open();\n //PDF/A-3b\n //Set output intents\n ICC_Profile icc = ICC_Profile.getInstance(new FileInputStream(ICC));\n writer.setOutputIntents(\"Custom\", \"\", \"http://www.color.org\", \"sRGB IEC61966-2.1\", icc);\n //===================\n\n Paragraph p = new Paragraph();\n //PDF/A-3b\n //Embed font\n p.setFont(FontFactory.getFont(FONT, BaseFont.WINANSI, BaseFont.EMBEDDED, 20));\n //=============\n Chunk c = new Chunk(\"The quick brown \");\n p.add(c);\n Image i = Image.getInstance(FOX);\n c = new Chunk(i, 0, -24);\n p.add(c);\n c = new Chunk(\" jumps over the lazy \");\n p.add(c);\n i = Image.getInstance(DOG);\n c = new Chunk(i, 0, -24);\n p.add(c);\n document.add(p);\n\n PdfDictionary parameters = new PdfDictionary();\n parameters.put(PdfName.MODDATE, new PdfDate());\n PdfFileSpecification fileSpec = writer.addFileAttachment(\n \"ZUGFeRD invoice\", null, XML,\n \"invoice.xml\", \"application/xml\",\n AFRelationshipValue.Alternative, parameters);\n PdfArray array = new PdfArray();\n array.add(fileSpec.getReference());\n writer.getExtraCatalog().put(PdfName.AF, array);\n\n document.close();\n }", "public void sendPdfByEmail(String fileName, String emailTo, String emailCC, Context context){\n\n Intent emailIntent = new Intent(Intent.ACTION_SEND);\n emailIntent.putExtra(Intent.EXTRA_SUBJECT, \"Movalink PDF Tutorial email\");\n emailIntent.putExtra(Intent.EXTRA_TEXT, \"Working with PDF files in Android\");\n emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[]{emailTo});\n emailIntent.putExtra(Intent.EXTRA_BCC, new String[]{emailCC});\n\n String sdCardRoot = Environment.getExternalStorageDirectory().getPath();\n String fullFileName = sdCardRoot + File.separator + APP_FOLDER_NAME + File.separator + fileName;\n\n Uri uri = Uri.fromFile(new File(fullFileName));\n emailIntent.putExtra(Intent.EXTRA_STREAM, uri);\n emailIntent.setType(\"application/pdf\");\n\n context.startActivity(Intent.createChooser(emailIntent, \"Send email using:\"));\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n if (requestCode == 86 && resultCode == RESULT_OK && data != null)\n {\n pdfUri = data.getData(); // return the uri of selected file....\n notification.setText(\"A File is Selected\");\n }\n else\n {\n Toast.makeText(getApplicationContext(),\"Please Select CV\",Toast.LENGTH_LONG).show();\n\n }\n\n }", "public CashDrawer openCashDrawer(CashDrawer cd, String documentId);", "@Override\n public void onClick(View view) {\n Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);\n intent.addCategory(Intent.CATEGORY_OPENABLE);\n //intent.setType(\"*/*\");\n intent.setType(\"text/plain\");\n startActivityForResult(intent, READ_REQUEST_CODE);\n }", "private void popAbout() {\n try {\n //File file=new File(filepath);\n Desktop.getDesktop().open(new java.io.File(\"about.pdf\"));\n } catch (IOException ex) {\n JOptionPane.showMessageDialog(rootPane,\"File not found or supported\");\n }\n }", "public static void main(String[] args) {\n\t\t\n\t\t\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"C:\\\\Users\\\\sameera\\\\Downloads\\\\chromedriver_win32\\\\chromedriver.exe\");\n\t\tWebDriver driver = new ChromeDriver();\n\t\tdriver.get(\"https://www.smallpdf.com/pdf-to-word\");\n\t\tdriver.manage().window().fullscreen();\n\t\t\n\t\t//WebElement chooseFile = \n\t\t\t\tdriver.findElement(By.xpath(\"//*[@id=\\\"__picker-input\\\"]\")).sendKeys(\"C:\\\\Users\\\\sameera\\\\Downloads\\\\Fido-Jan27_2020.pdf\");\n\t//\tdriver.findElement(By.name(\"Scanned pages will appear as images.\")).click();\n\t\t//driver.findElement(By.id(\"__rk0\")).click();\t\t(//div[@class='__-zhab'])\n\t\t\t\n\t//\t\tWebElement radio = \tdriver.findElement(By.cssSelector(\"#__-zhab\"));\n\t\t\t\t\t\t\n\t\t\tWebElement radio = \tdriver.findElement(By.cssSelector(\"#sc-18us72i-0 cnzToN\"));\t\n\t\t\tradio.click();\n\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tString url = \"file:///C:/Users/J1637009/Desktop/aaaaa.pdf\";\n\t\t\t\tString url2 = \"file:///N:/AE/2017/‹l•[/ƒJƒPƒnƒVAEƒG[ƒWƒFƒ“ƒg‹l•[/doubLeiƒNƒŠƒGƒCƒeƒBƒuEj_18.pdf\";\n\t\t\t\t\n\t\t\t\t\n\t\t try {\n\t\t\t\t\tjava.awt.Desktop.getDesktop().browse(java.net.URI.create(url2));\n\t\t\t\t} catch (IOException 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\n\t\t\t}", "private void verPDFFrame(String filePath) {\n SwingController c = new SwingController();\n c.setIsEmbeddedComponent(true);\n\n PropertiesManager prop = new PropertiesManager(\n System.getProperties(),\n ResourceBundle.getBundle(PropertiesManager.DEFAULT_MESSAGE_BUNDLE));\n\n prop.set(PropertiesManager.PROPERTY_DEFAULT_ZOOM_LEVEL, \"1.25\");\n prop.setBoolean(PropertiesManager.PROPERTY_VIEWPREF_FITWINDOW, Boolean.TRUE);\n prop.setBoolean(PropertiesManager.PROPERTY_SHOW_TOOLBAR_ANNOTATION, Boolean.FALSE);\n prop.setBoolean(PropertiesManager.PROPERTY_SHOW_TOOLBAR_FIT, Boolean.FALSE);\n prop.setBoolean(PropertiesManager.PROPERTY_SHOW_TOOLBAR_ROTATE, Boolean.FALSE);\n prop.setBoolean(PropertiesManager.PROPERTY_SHOW_TOOLBAR_TOOL, Boolean.FALSE);\n prop.setBoolean(PropertiesManager.PROPERTY_SHOW_UTILITY_UPANE, Boolean.FALSE);\n prop.setBoolean(PropertiesManager.PROPERTY_SHOW_UTILITY_SEARCH, Boolean.FALSE);\n\n SwingViewBuilder fac = new SwingViewBuilder(c, prop);\n\n // add interactive mouse link annotation support via callback\n c.getDocumentViewController().setAnnotationCallback(\n new org.icepdf.ri.common.MyAnnotationCallback(c.getDocumentViewController()));\n javax.swing.JPanel viewerComponentPanel = fac.buildViewerPanel();\n JFrame applicationFrame = new JFrame();\n\n applicationFrame.setDefaultCloseOperation(DISPOSE_ON_CLOSE);\n applicationFrame.getContentPane().add(viewerComponentPanel);\n // Now that the GUI is all in place, we can try openning a PDF\n c.setPageFitMode(DocumentViewController.PAGE_FIT_WINDOW_WIDTH, false);\n c.openDocument(filePath);\n // show the component\n applicationFrame.pack();\n Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();\n applicationFrame.setExtendedState(JFrame.MAXIMIZED_BOTH);\n applicationFrame.setSize(screenSize);\n applicationFrame.setLocationRelativeTo(null);\n applicationFrame.setResizable(false);\n applicationFrame.setVisible(true);\n\n }", "public void FileDownloadView(PojoPropuestaConvenio pojo) throws IOException {\n BufferedOutputStream out = null;\n try {\n String extension = null;\n String nombre = null;\n String contentType = null;\n InputStream stream = null;\n listadoDocumento = documentoService.getDocumentFindCovenio(pojo.getID_PROPUESTA());\n\n for (Documento doc : listadoDocumento) {\n if (doc.getIdTipoDocumento().getNombreDocumento().equalsIgnoreCase(TIPO_DOCUMENTO)) {\n if (getFileExtension(doc.getNombreDocumento()).equalsIgnoreCase(\"pdf\")) {\n stream = new ByteArrayInputStream(doc.getDocumento());\n nombre = doc.getNombreDocumento();\n extension = \"pdf\";\n }\n }\n }\n\n if (extension != null) {\n if (extension.equalsIgnoreCase(\"pdf\")) {\n contentType = \"Application/pdf\";\n }\n content = new DefaultStreamedContent(stream, contentType, nombre);\n } else {\n FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_WARN, \"Documento\", \"No se cuenta con documento firmado para descargar\"));\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n if (out != null) {\n out.close();\n }\n }\n\n }", "@Override\n public void onRequestHandlePathOz(@NotNull PathOz pathOz, @Nullable Throwable throwable) {\n readPdfFile(pathOz.getPath());\n mButtonReadText.setVisibility(View.VISIBLE);\n mHighlightedTextView.setVisibility(View.VISIBLE);\n mFragmentWallpaperTextView.setVisibility(View.INVISIBLE);\n mHighlightedTextView.setText(fileTextContent);\n Toast.makeText(getActivity(), \"File Uploaded Successfully !\", Toast.LENGTH_SHORT).show();\n Log.e(\"URI\", \"The URI path: \"+pathOz.getPath());\n }", "public static void launchDocumentPickerInActivity(Activity context, int REQUEST_CODE) {\n Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);\n intent.setType(\"application/*\");\n intent.addCategory(Intent.CATEGORY_OPENABLE);\n context.startActivityForResult(intent, REQUEST_CODE);\n }", "public void onCreatePdf(View view) {\n\n\t\t// Images used in the PDF should be JPG images, stored as Assets\n\t\tbyte[] stickerBmp = Pdf.getAssetJpgBytes(this, JPG_SRC);\n\n\t\t// Create a new PDF\n\t\tPdf pdf = new Pdf();\n\t\tStream stream = pdf.addPage();\n\n\t\t// Add some text at a specific position\n\t\t// The coordinate system is setup where the origin (0,0) is at the\n\t\t// bottom left corner\n\t\tstream.addText(\"This is a test pdf.\", PDF_HEADER_FONT_SIZE, 100, 50, RED);\n\n\t\t// Add some text with a different color\n\t\tstream.addText(userText.getText().toString(), BLUE, PDF_HEADER_FONT_SIZE);\n\n\t\t// Add a line with a color and a width\n\t\tstream.addHorizontalLine(GREEN, LINE_WIDTH);\n\n\t\t// Add an image at a specific coordinate (top right corner of the page)\n\t\tstream.addBmpImage(Pages.PAGE_WIDTH - (int) Stream.MARGIN_HORIZONTAL - JPG_WIDTH, Pages.PAGE_HEIGHT - (int) Stream.MARGIN_VERTICAL - JPG_HEIGHT,\n\t\t\t\tJPG_WIDTH, JPG_HEIGHT, stickerBmp);\n\n\t\t// Get the raw PDF bytes like this:\n\t\tbyte[] pdfBytes = pdf.getPDF();\n\n\t\t// Optionally, write the bytes out to a file:\n\t\tFile file = Pdf.writePdf(this, pdfBytes, PDF_PDFNAME);\n\n\t\t// Show the PDF in an external viewer\n\t\tIntent intent = new Intent(Intent.ACTION_VIEW);\n\t\tUri uri = Uri.fromFile(file);\n\t\tintent.setDataAndType(uri, MIME_TYPE_PDF);\n\t\tstartActivity(intent);\n\n\t}", "@RequestMapping( value = \"/pdfExtract\", method = RequestMethod.GET )\n\t@Transactional\n\tpublic @ResponseBody Map<String, Object> doPdfExtraction( \n\t\t\t@RequestParam( value = \"id\", required = false ) final String id,\n\t\t\t@RequestParam( value = \"url\", required = false ) final String url, \n\t\t\tfinal HttpServletResponse response) throws InterruptedException, IOException, ExecutionException\n\t{\n\t\tif( id != null )\n\t\t\treturn publicationFeature.getPublicationManage().extractPublicationFromPdf( id );\n\t\telse\n\t\t\treturn publicationFeature.getPublicationApi().extractPfdFile( url );\n\t}", "@Override\n public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {\n if (requestCode == 7 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {\n selectPdf();\n } else\n Toast.makeText(FileUpload.this, \"You need to provide permission in order to upload content\", Toast.LENGTH_LONG).show();\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 public void onClick(DialogInterface dialog, int which)\n {\n DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url));\n //cookie\n String cookie= CookieManager.getInstance().getCookie(url);\n //Add cookie and User-Agent to request\n request.addRequestHeader(\"Cookie\",cookie);\n request.addRequestHeader(\"User-Agent\",userAgent);\n\n //file scanned by MediaScannar\n request.allowScanningByMediaScanner();\n //Download is visible and its progress, after completion too.\n request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);\n //DownloadManager created\n DownloadManager downloadManager= (DownloadManager) getContext().getSystemService(Context.DOWNLOAD_SERVICE);\n //Saving file in Download folder\n request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, filename);\n //download enqued\n downloadManager.enqueue(request);\n }", "@RequestMapping(value = \"/patientDocFileDownload\", method = RequestMethod.GET)\n\t\tpublic void downloadDocFiles(HttpServletRequest request, HttpServletResponse response, HttpSession session,\n\t\t\t\t @RequestParam(\"f\") String fileId, @RequestParam(\"p\") String patientId){\n\t\t\ttry {\n\t\t\t\t//System.out.println(\"downloadDocFiles ---> \" + fileId);\n\t\t\t\tString fileName = patientAccountService.getPatientDocFileName( Integer.parseInt(fileId) );\n\t\t\t\tString downloadName = patientAccountService.getPatientDownloadDocFileName( Integer.parseInt(fileId) );\n\t\t\t\tPharmacyUtil.downloadFile(fileName, downloadName, response);\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}", "private void downloadAlfrescoDocument(){\n\t\t//el boton solo esta activo si un fichero esta seleccionado en la tabla de ficheros\n\t\t//Se abre un filechooser y se elije un directorio\n\t\t//Se enviara la direccion y el nodo con el content alfresco y se generara un File a partir de ellos (si no hay una opcion mejor con alfresco api)\n\t\t//se descarga el documento en el directorio elegido\n\n\t\tif(getFileChooser(JFileChooser.DIRECTORIES_ONLY).showOpenDialog(this)==JFileChooser.APPROVE_OPTION){\n\t\t\tAlfrescoNode node = (AlfrescoNode) getDynamicTreePanel().getDragTable().getValueAt(getDynamicTreePanel().getDragTable().getSelectedRow(),0);\n\t\t\t//if(alfrescoManager.downloadFile(new AlfrescoKey(node.getUuid(), AlfrescoKey.KEY_UUID), getFileChooser().getSelectedFile().getAbsolutePath()))\n\t\t\ttry {\n\t\t\t\talfrescoDocumentClient.downloadFile(new AlfrescoKey(node.getUuid(), AlfrescoKey.KEY_UUID), getFileChooser().getSelectedFile().getAbsolutePath(), node.getName());\n\t\t\t\tJOptionPane.showMessageDialog(this, \"El documento se ha descargado correctamente.\");\t\t\t\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(e);\n\t\t\t\tJOptionPane.showMessageDialog(this, \"Error al descargar el documento.\");\n\t\t\t}\n\t\t}\n\t}", "@Test\n void testIllegalFieldsDefinition() throws IOException, URISyntaxException\n {\n String sourceUrl = \"https://issues.apache.org/jira/secure/attachment/12866226/D1790B.PDF\";\n\n try (PDDocument testPdf = Loader.loadPDF(\n RandomAccessReadBuffer.createBufferFromStream(new URI(sourceUrl).toURL().openStream())))\n {\n PDDocumentCatalog catalog = testPdf.getDocumentCatalog();\n\n assertDoesNotThrow(() -> catalog.getAcroForm(), \"Getting the AcroForm shall not throw an exception\");\n }\n }", "public void onDownloadStart(String url, String userAgent,\n String contentDisposition, String mimeType,\n long contentLength) {\n\n DownloadManager.Request request = new DownloadManager.Request(\n Uri.parse(url));\n request.setMimeType(mimeType);\n String cookies = CookieManager.getInstance().getCookie(url);\n request.addRequestHeader(\"cookie\", cookies);\n request.addRequestHeader(\"User-Agent\", userAgent);\n request.setDescription(\"Downloading File...\");\n request.setTitle(URLUtil.guessFileName(url, contentDisposition, mimeType));\n request.allowScanningByMediaScanner();\n request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);\n request.setDestinationInExternalPublicDir(\n \"/MyUniversity\", URLUtil.guessFileName(\n url, contentDisposition, mimeType));\n DownloadManager dm = (DownloadManager) getSystemService(DOWNLOAD_SERVICE);\n dm.enqueue(request);\n Toast.makeText(getApplicationContext(), \"Downloading File\", Toast.LENGTH_LONG).show();\n\n\n }", "public void scanDocument() {\n Intent intent = new Intent(getContext(), ScanActivity.class);\n intent.putExtra(ScanConstants.OPEN_INTENT_PREFERENCE, ScanConstants.OPEN_CAMERA);\n startActivityForResult(intent, REQUEST_CAMERA);\n }", "@Override\n protected void onStart() {\n super.onStart();\n\n\n /*\n\n FirebaseRecyclerAdapter <Model , viewHolder_cse> firebaseRecyclerAdapter =\n new FirebaseRecyclerAdapter<Model, viewHolder_cse>(\n\n Model.class ,\n R.layout.row_for_cse_pdf,\n viewHolder_cse.class,\n mRef\n\n\n\n ) {\n\n\n @Override\n protected void populateViewHolder(viewHolder_cse viewHolder, Model model, int position) {\n\n viewHolder.SetDeatils(getApplicationContext() , model.getTitle() , model.getWriter() , model.getLink());\n Handler handler = new Handler() ;\n handler.postDelayed(new Runnable() {\n @Override\n public void run() {\n\n cse_bar.setVisibility(View.GONE);\n\n }\n },3000);\n\n }\n\n\n\n @Override\n public viewHolder_cse onCreateViewHolder(ViewGroup parent, int viewType) {\n\n viewHolder_cse viewHolder_cse = super.onCreateViewHolder(parent,viewType) ;\n\n\n viewHolder_cse.setOnClickListener(new viewHolder_cse.ClickListener() {\n @Override\n public void onItemClick(View view, int position) {\n\n\n // data from views\n String mlink = getItem(position).getLink() ;\n\n\n\n // sending those data to new Activity\n\n Intent intent = new Intent(view.getContext() , pdfViewer.class);\n\n intent.putExtra(\"LINK\", mlink); // put title\n startActivity(intent);\n }\n\n @Override\n public void onItemLongClick(View view, int position) {\n\n\n\n }\n });\n\n\n return viewHolder_cse ;\n }\n };\n\n//set adapter to recyclerview\n mrecyclerView.setAdapter(firebaseRecyclerAdapter);\n*/\n }", "public void actionPerformed(ActionEvent arg0) {\n\t\t \t \ttry {\n\t\t\t\t\t\tDesktop.getDesktop().open(new File(new File(\"\").getAbsolutePath() + \n\t\t\t\t\t\t\t\t\"\\\\src\\\\pdf\\\\DocumentationUtilisateur.pdf\"));\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t }", "@Override\n\tpublic void openDocument(String path, String name) {\n\t\t\n\t}", "private void showOpenFileDialog() {\n Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);\n intent.addCategory(Intent.CATEGORY_OPENABLE);\n intent.setType(\"*/*\");\n // We accept PDF files and images (for image documents).\n intent.putExtra(Intent.EXTRA_MIME_TYPES, new String[] {\"application/pdf\", \"image/*\"});\n\n // Set of the intent for result, so we can retrieve the Uri of the selected document.\n startActivityForResult(intent, REQUEST_OPEN_DOCUMENT);\n }", "public static void view(Document doc) throws URISyntaxException, IOException {\n Desktop desktop = Desktop.getDesktop();\n URI uri = new URI(doc.getLocation());\n if (Desktop.isDesktopSupported()) {\n desktop = Desktop.getDesktop();\n }\n if (desktop != null) {\n desktop.browse(uri);\n }\n }", "@GetMapping(\"/GeneratePDF\")\n public String getPDFView(Model model) throws Exception {\n util.createPdf(\"homepage\");\n model.addAttribute(\"message\", \"PDF Downloaded successfully..\");\n return \"success\";\n }", "@Override\n protected void onPostExecute(String file_url) {\n // dismiss the dialog after the file was downloaded\n //dismissDialog(progress_bar_type);\n dismissProgress();\n showToast(String.valueOf(\"Download File Success to \") + filename);\n if (filePath != null) {\n File file = new File( filePath );\n Intent intent = new Intent(Intent.ACTION_VIEW);\n Uri fileUri = FileProvider.getUriForFile(getContext(),\n \"com.insurance.easycover\",\n file);\n intent.setData(fileUri);\n intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);\n startActivity(intent);\n }\n }", "public void openURLByFile(String url)\n {\n getAppleMenu().activate();\n getAppleMenu().select(Menu.FILE);\n getAppleMenu().open(Menu.OPEN_URL);\n logger.debug(\"Open Office document from URL: \" + url);\n getLdtp().enterString(url);\n getLdtp().generateKeyEvent(\"<enter>\");\n }", "Object getDocument(String uri) throws FunctionCallException;", "private void readPdfFile(String path) {\n\n try {\n PdfReader pdfReader = new PdfReader(path);\n fileTextContent = PdfTextExtractor.getTextFromPage(pdfReader, 1).trim();\n Log.i(\"PDF_CONTENTS\", \"The pdf content: \"+ fileTextContent);\n pdfReader.close();\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private void getPdfFromAwsLink(PdfWriter writer, Locale locale) throws Exception {\n final String disclosureFileClasspath = getMessage(locale, \"pdf.receipt.disclosure.classpath\");\n InputStream file = PdfServlet.class.getClassLoader().getResourceAsStream(disclosureFileClasspath);\n\n PdfReader reader = new PdfReader(file);\n PdfContentByte cb = writer.getDirectContent();\n int pageOfCurrentReaderPDF = 0;\n while (pageOfCurrentReaderPDF < reader.getNumberOfPages()) {\n pageOfCurrentReaderPDF++;\n PdfImportedPage page = writer.getImportedPage(reader, pageOfCurrentReaderPDF);\n cb.addTemplate(page, 0, 0);\n }\n }", "private WebView createWebView() {\n WebView webView = new WebView();\n webView.setContextMenuEnabled(false);\n\n WebEngine engine = webView.getEngine();\n // The files below must exist! Or pdf viewer no more!\n String url = new File(\"src/Resources/pdfjs_2.7.570/web/viewer.html\").toURI().toString();\n\n engine.setJavaScriptEnabled(true);\n engine.load(url);\n\n\n engine.getLoadWorker()\n .stateProperty()\n .addListener(\n new ChangeListener<>() {\n @Override\n public void changed(ObservableValue<? extends Worker.State> observable, Worker.State oldValue, Worker.State newValue) {\n JSObject window = (JSObject) engine.executeScript(\"window\");\n window.setMember(\"java\", null);\n engine.executeScript(\"console.log = function(message){ try {java.log(message);} catch(e) {} };\");\n\n if (newValue == Worker.State.SUCCEEDED) {\n try {\n PDFDisplayer.this.pdfJsLoaded = true;\n\n if (PDFDisplayer.this.loadScript != null) {\n engine.executeScript(PDFDisplayer.this.loadScript);\n }\n\n engine.executeScript(PDFDisplayer.this.toExecuteWhenPDFJSLoaded);\n PDFDisplayer.this.toExecuteWhenPDFJSLoaded = null;\n observable.removeListener(this);\n } catch (RuntimeException e) {\n e.printStackTrace();\n throw new RuntimeException(e);\n }\n }\n }\n });\n return webView;\n }", "@Override\n protected void onHandleIntent(Intent intent) {\n String urlPath = intent.getStringExtra(URL);\n String fileName = intent.getStringExtra(FILENAME);\n String timetable = intent.getStringExtra(TIMETABLE);\n mTimetable = intent.getParcelableExtra(TIMETABLE_OBJECT);\n\n try{\n\n File SDCardRoot = Environment.getExternalStorageDirectory();\n File wallpaperDirectory = new File(SDCardRoot.getPath()+\"/FGC/\");\n wallpaperDirectory.mkdirs();\n\n File file = new File(SDCardRoot+\"/FGC/\",fileName+\".pdf\");\n\n Intent tempIntent = new Intent(Intent.ACTION_VIEW);\n tempIntent.setDataAndType(Uri.fromFile(file), \"application/pdf\");\n tempIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n PendingIntent pIntent = PendingIntent.getActivity(this, 0, tempIntent, 0);\n\n // build notification\n // the addAction re-use the same intent to keep the example short\n NotificationCompat.Builder n = new NotificationCompat.Builder(this)\n .setContentTitle(getString(R.string.downloading))\n .setContentText(getString(R.string.downloading_timetable)+\" \"+timetable)\n .setSmallIcon(R.drawable.fgclogo)\n .setContentIntent(pIntent)\n .setAutoCancel(true)\n .setOngoing(true);\n\n\n NotificationManager notificationManager =\n (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n\n notificationManager.notify(id, n.build());\n\n URL url = new URL(urlPath);\n\n HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();\n\n urlConnection.setRequestMethod(\"GET\");\n urlConnection.connect();\n\n\n FileOutputStream fileOutput = new FileOutputStream(file);\n\n InputStream inputStream = urlConnection.getInputStream();\n\n int totalSize = urlConnection.getContentLength();\n\n int downloadedSize = 0;\n\n byte[] buffer = new byte[1024];\n int bufferLength = 0;\n\n int tempValue=0;\n int increment = totalSize/20;\n while ( (bufferLength = inputStream.read(buffer)) > 0 ) {\n fileOutput.write(buffer, 0, bufferLength);\n downloadedSize += bufferLength;\n\n if(tempValue < downloadedSize){\n tempValue+=increment;\n n.setProgress(totalSize, downloadedSize, false);\n notificationManager.notify(id, n.build());\n }\n }\n\n fileOutput.close();\n\n n.setContentText(getString(R.string.download_finished))\n .setProgress(0, 0, false)\n .setOngoing(false)\n .setContentIntent(pIntent);\n notificationManager.notify(id, n.build());\n\n publishResults(fileName, file);\n } catch (IOException f){\n f.printStackTrace();\n\n Toast.makeText(this, getString(R.string.download_error), Toast.LENGTH_SHORT).show();\n }\n\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n HttpSession session=request.getSession();\n response.setHeader(\"Cache-Control\",\"no-store\"); //HTTP 1.1\n response.setHeader(\"Pragma\",\"no-cache\"); //HTTP 1.0\n response.setDateHeader(\"Expires\", 0);\n response.setDateHeader(\"Last-Modified\", 0); \n try {\n boolean isMultipart = ServletFileUpload.isMultipartContent( request );\n if ( !isMultipart )\n {\n String modo=request.getParameter(\"modo\"); \n if(modo.equals(\"abrirPdf\")) {\n //if(objetoSesion.isSuperAdministrador() || objetoSesion.getPerfilSelected().getCoreDerechoSistemaList().toString().indexOf(\"D_VER_DEPOSITO\")>-1){ \n CoreDocumento documento=documentoEJBLocal.find(Integer.parseInt(request.getParameter(\"coreDocumentoId\")));\n response.setContentType(\"application/pdf\"); \n response.setHeader(\"Content-Disposition\",\"attachment; filename=\\\"\" + documento.getNombreArchivo() + \"\\\"\"); \n response.getOutputStream().write(documento.getDocumento());\n //}else\n // response.getWriter().println(\"{\\\"success\\\":false,\\\"msg\\\":\\\"Usted no cuenta con los permisos necesarios.\\\"}\");\n }\n }else{ \n ServletFileUpload upload = new ServletFileUpload(); \n try\n {\n byte[] bytes=null;\n String name=null;\n Integer documentoId=null;\n FileItemIterator iter = upload.getItemIterator( request );\n while ( iter.hasNext() )\n {\n FileItemStream item = iter.next();\n String fieldName = item.getFieldName();\n if ( fieldName.equals( \"PDFFile\" ) )\n {\n name=item.getName();\n String[] aname=name.split(\"Id=\");\n bytes = IOUtils.toByteArray( item.openStream() ); \n documentoId=Integer.parseInt(aname[1]);\n }else if(fieldName.equals( \"coreDocumentoId\" ))\n documentoId=Integer.parseInt(Streams.asString(item.openStream()));\n }\n if(documentoId!=null){\n CoreDocumento documento=documentoEJBLocal.find(documentoId);\n documento.setDocumento(bytes);\n response.getWriter().print(documentoEJBLocal.persistir(documento,\"editar\"));\n }\n }\n catch ( IOException ex )\n {\n throw ex;\n }\n catch ( Exception ex )\n {\n throw new ServletException( ex );\n }\n\n }\n }catch (Exception e) {\n if(request.getParameter(\"modo\")==null || request.getParameter(\"modo\").equals(\"listaDocumentos\"))\n response.getWriter().print(\"{\\\"data\\\":[],\\\"total\\\":0}\"); \n else\n response.getWriter().print(\"{\\\"success\\\":false,\\\"msg\\\":\\\"Error al realizar la operacion.\\\"}\");\n }\n }", "byte[] renderFormAsPDF(Document srcDoc) throws GreensheetBaseException {\r\n\r\n\t\tbyte[] result = null;\r\n\r\n\t\tByteArrayInputStream inputStream = null;\r\n\t\tByteArrayOutputStream outputStream = null;\r\n\r\n\t\ttry {\r\n\r\n\t\t\tDocument foDoc = this.generateFo(srcDoc);\r\n\t\t\tString docXml = foDoc.asXML();\r\n\t\t\t// Replace the default UTF-8 encoding with ISO-8859-1 to take care\r\n\t\t\t// of the special/extended character set.\r\n\t\t\t// unfortunately, dom4j 1.4 has a bug whereby .asXML() method\r\n\t\t\t// returns the encoding as UTF-8 only. Hence this approach.\r\n\t\t\t// using dom4j 1.6.1 has its own set of problems.\r\n\r\n\t\t\tdocXml = this.Replace(docXml, \"UTF-8\", \"ISO-8859-1\");\r\n\t\t\tinputStream = new ByteArrayInputStream(docXml.getBytes());\r\n\t\t\toutputStream = new ByteArrayOutputStream();\r\n\r\n\t\t\t// Setup FOP\r\n\t\t\tLog4JLogger l4Jlogger = new Log4JLogger(logger);\r\n\t\t\tInputSource inputSource = new InputSource(inputStream);\r\n\t\t\tDriver driver = new Driver(inputSource, outputStream);\r\n\t\t\tdriver.setLogger(l4Jlogger);\r\n\t\t\tdriver.setRenderer(Driver.RENDER_PDF);\r\n\r\n\t\t\tdriver.run();\r\n\r\n\t\t\tresult = outputStream.toByteArray();\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\tthrow new GreensheetBaseException(\"error rendering PDF\", e);\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tinputStream.close();\r\n\t\t\t\toutputStream.close();\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tthrow new GreensheetBaseException(\"error rendering PDF\", e);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public void testDownloadFile(){\n final String url = \"http://www.zebrai.cn/login/picture/getCaptcha\";\n new Thread(new Runnable() {\n @Override\n public void run() {\n downloadFile(url);\n }\n }).start();\n\n }", "@Override\n\tprotected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\n String description = request.getParameter(\"description\"); // Retrieves <input type=\"text\" name=\"description\">\n Part filePart = request.getPart(\"file\"); // Retrieves <input type=\"file\" name=\"file\">\n // String fileName = Paths.get(filePart.getSubmittedFileName()).getFileName().toString(); // MSIE fix.\n InputStream fileContent = filePart.getInputStream();\n \n int rand =(int)( Math.random()*1000000000);\n String sourcePath = \"C:\\\\tmp\\\\tmp_\"+rand+\".pdf\";\n\n final Path destination = Paths.get(sourcePath);\n\n File file = destination.toFile();\n if(file.exists()){\n file.delete();\n }\n Files.copy(fileContent, destination);\n\n \n String path= PDFMinerController.pdf2text(sourcePath);\n \n \n File source = new File(path);\n System.out.println(\"XML file is readable \"+source.exists());\n List<Reference> refList= ReferenceExctractor.getReferences(source);\n Parser p = new Parser();\n StyleParser hp = new StyleParser();\n ArrayList<OneChar> text = p.parse(source);\n String headline= hp.parseHeadline(text);\n //response.setContentType(\"text/xml\");\n StringBuilder sb =new StringBuilder();\n sb.append(headline).append(\"\\n\");\n System.out.println(\"Reference list size \"+refList.size());\n for(Reference ref:refList ){\n System.out.println(\"Reference \"+ref.toString());\n sb.append(ref.toString()).append(\"\\n\");\n \n \n }\n response.getWriter().println(sb.toString());\n\t\n \n if(file.exists()){\n file.delete();\n System.out.println(\"PDF file deleted\");\n }\n System.out.println(\"Source exist \"+source.exists());\n if(source.exists()){\n source.delete();\n System.out.println(\"Source File deleted\");\n }\n \n }", "@RequestMapping(value = \"/manualDocFileDownload\", method = RequestMethod.GET)\n\tpublic void downloadInstructionDocFiles(HttpServletRequest request, HttpServletResponse response, \n\t\t\tHttpSession session, @RequestParam(\"f\") String fileId, @RequestParam(\"i\") String isImageStr){\n\t\ttry {\n\t\t\t//System.out.println(\"downloadDocFiles ---> \" + fileId);\n\t\t\tString fileName = \"\";\n\t\t\tString downloadName=\"\";\n\t\t\tif (isImageStr.equalsIgnoreCase(\"n\")) {\n\t\t\t\tfileName = manualService.getDocFileName( Integer.parseInt(fileId), false );\n\t\t\t\tdownloadName = manualService.getDownloadDocFileName( Integer.parseInt(fileId), false );\n\t\t\t} else {\n\t\t\t\tfileName = manualService.getDocFileName( Integer.parseInt(fileId), true );\n\t\t\t\tdownloadName = manualService.getDownloadDocFileName( Integer.parseInt(fileId), true );\n\t\t\t}\n\t\t\tPharmacyUtil.downloadFile(fileName, downloadName, response);\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\r\n\tpublic File createPDF() {\n\t\treturn null;\r\n\t}", "public static void main(String[] args) {\n ConnectionFactory connectionFactory = new ConnectionFactory();\n connectionFactory.setHost(\"localhost\");\n\n try {\n Connection connection = connectionFactory.newConnection();\n Channel channel = connection.createChannel();\n channel.basicQos(3);\n\n channel.exchangeDeclare(EXCHANGE_NAME, EXCHANGE_TYPE);\n // создаем временную очередь со случайным названием\n String queue = channel.queueDeclare().getQueue();\n\n // привязали очередь к EXCHANGE_NAME\n channel.queueBind(queue, EXCHANGE_NAME, \"\");\n\n DeliverCallback deliverCallback = (consumerTag, message) -> {\n System.out.println(\"Creating deduction file for \" + new String(message.getBody()));\n String[] info = new String(message.getBody()).split(\" \");\n try {\n String fileName = DEST_FOLDER + info[0] + \" \" + info[1] + \".pdf\";\n File file = new File(fileName);\n file.getParentFile().getParentFile().mkdirs();\n\n PdfReader pdfReader = new PdfReader(SRC);\n PdfWriter pdfWriter = new PdfWriter(fileName);\n PdfDocument doc = new PdfDocument(pdfReader, pdfWriter);\n PdfAcroForm form = PdfAcroForm.getAcroForm(doc, true);\n Map<String, PdfFormField> fields = form.getFormFields();\n fields.get(\"name\").setValue(info[0]);\n fields.get(\"surname\").setValue(info[1]);\n fields.get(\"age\").setValue(info[4]);\n fields.get(\"passport\").setValue(info[2] + \" \" + info[3]);\n fields.get(\"given\").setValue(info[5]);\n\n doc.close();\n channel.basicAck(message.getEnvelope().getDeliveryTag(), false);\n } catch (IOException e) {\n System.err.println(\"FAILED\");\n channel.basicReject(message.getEnvelope().getDeliveryTag(), false);\n }\n };\n\n channel.basicConsume(queue, false, deliverCallback, consumerTag -> {\n });\n } catch (IOException | TimeoutException e) {\n throw new IllegalArgumentException(e);\n }\n }", "@DSComment(\"Private Method\")\n @DSBan(DSCat.PRIVATE_METHOD)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:32:41.970 -0500\", hash_original_method = \"E3D7D6931554145E868760CB2C4A26A3\", hash_generated_method = \"EE86FFF77F12F6E87C0C4F0204A00383\")\n \nprivate String cookies(String url) {\n return CookieManager.getInstance().getCookie(url);\n }" ]
[ "0.64722186", "0.6214941", "0.62096447", "0.6108684", "0.61052865", "0.60438335", "0.57415456", "0.57219034", "0.5562598", "0.54975957", "0.54874", "0.5481916", "0.54772496", "0.5455021", "0.54546654", "0.54102725", "0.5410128", "0.53775233", "0.5316339", "0.5271884", "0.52623624", "0.52534306", "0.5248415", "0.5244029", "0.51717544", "0.5148969", "0.5128104", "0.51154435", "0.5114962", "0.5113102", "0.506986", "0.5054886", "0.50491935", "0.503104", "0.5011179", "0.50098777", "0.49958163", "0.4966783", "0.49566674", "0.49554732", "0.49449643", "0.49323484", "0.49256456", "0.492156", "0.49119034", "0.49107635", "0.48869723", "0.4886873", "0.48664188", "0.48589367", "0.48502588", "0.48304936", "0.48086277", "0.4796208", "0.47951403", "0.47930992", "0.479143", "0.47887248", "0.47806814", "0.47784027", "0.47661632", "0.47638813", "0.4762295", "0.47590718", "0.47503594", "0.47403094", "0.47396126", "0.47360337", "0.47321093", "0.4725694", "0.4718513", "0.47183603", "0.47065896", "0.4684663", "0.46708703", "0.46634412", "0.4647171", "0.46426854", "0.46341416", "0.46218354", "0.4603562", "0.45969573", "0.45801178", "0.4555093", "0.45543578", "0.45534992", "0.4552581", "0.45514983", "0.4551488", "0.45441604", "0.45437455", "0.45394787", "0.45350543", "0.4534613", "0.4533752", "0.45272532", "0.45169944", "0.45169717", "0.45169014", "0.45137826" ]
0.71003526
0
AutoPilot, like the ones in aviation, are not fully auto, but rather semiauto. Its responsibility is to abstract away the lowerlevel steering of the car, and provide a highlevel interface for controlling the vehicle.
public interface AutoPilot { /** * This is called on each update cycle. The AutoPilot looks at the environment * (via the Car object), and then make a decision about what car controls to use * at that cycle. * that encapsulates the information needed for decision-making. * * @see ActuatorAction * @param delta Seconds passed since last update * @param carStatus * @return */ ActuatorAction handle(float delta, SensorInfo carStatus); /** * Lets the caller know whether this AutoPilot can take over the control. Some * types of AutoPilot (such as TurningAutoPilot) only takes over control at * certain tiles. * * @return true if it is ready to take over control. */ public boolean canTakeCharge(); /** * Lets the caller know whether this AutoPilot can be swapped out. * * Sometimes, AutoPilots are in certain crtical states (like in the process of making a turn), * and should not be interrupted. Otherwise, the car will end up in an unrecoverable state (like * halfway in the turning trajectory). * * @return true if it can be swapped out. */ public boolean canBeSwappedOut(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void autonomousPeriodic() {\n \n //Switch is used to switch the autonomous code to whatever was chosen\n // on your dashboard.\n //Make sure to add the options under m_chooser in robotInit.\n switch (m_autoSelected) {\n case kCustomAuto:\n // Put custom auto code here\n break;\n case kDefaultAuto:\n default:\n if (m_timer.get() < 2.0){\n m_driveTrain.arcadeDrive(0.5, 0); //drive forward at half-speed\n } else {\n m_driveTrain.stopMotor(); //stops motors once 2 seconds have elapsed\n }\n break;\n }\n }", "@Override\r\n\tpublic void autonomous() {\n\r\n\t\tint autoMode = -1;\r\n\t\t\r\n\t\tif (!switch1.get() && !switch2.get() && !switch3.get()) {\r\n\t\t\t//if all the switches are off\r\n\t\t\tautoMode = 0;\r\n\t\t} else if (switch1.get() && !switch2.get() && !switch3.get()) {\r\n\t\t\tautoMode = 1;\r\n\t\t} else if (!switch1.get() && switch2.get() && !switch3.get()) {\r\n\t\t\tautoMode = 2;\r\n\t\t} else if (switch1.get() && switch2.get() && !switch3.get()) {\r\n\t\t\tautoMode = 3;\r\n\t\t}\r\n\r\n\t\tautotime.start();\r\n\r\n\t\t// double[] wheelSpeeds = new double[2];\r\n\t\t// double[] startCoords = {0, 0, Math.PI / 2};\r\n\t\t// double[] endCoords = {0, 1, Math.PI / 2};\r\n\t\t// AutoPath pathAuto = new AutoPath(startCoords, endCoords,\r\n\t\t// ahrs.getAngle());\r\n\t\t//\r\n\t\t// int i = 0;\r\n\t\t// boolean successfullyGrabbedRectangles = false;\r\n\t\t\r\n\t\tboolean shotGear = false;\r\n\t\t//boolean hasBackedUp = false;\r\n\t\twhile (isAutonomous() && isEnabled()) {\r\n\t\t\t// auto.drive(autoMode);\r\n\r\n\t\t\t// while(autotime.get() < 3) {\r\n\t\t\t// drive.drive(-0.9, -0.9);\r\n\t\t\t// }\r\n\r\n\t\t\t// grab the current switch status\r\n\r\n\t\t\tswitch (autoMode) {\r\n\t\t\tcase 0:\r\n\t\t\t\t//Mark: Drive forward\r\n\r\n\t\t\t\tif (autotime.get() < 3) {\r\n\t\t\t\t\tdrive.drive(-0.9, -0.9);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase 1:\r\n\t\t\t\t// Mark: Drive Forward, NO turning, and shoot gear onto peg\r\n\r\n\t\t\t\tif (autotime.get() < 3) {\r\n\t\t\t\t\tdrive.drive(-0.75, -0.75);\r\n\t\t\t\t} else if(!shotGear) {\r\n\t\t\t\t\t// shoot the gear onto the peg\r\n\t\t\t\t\tgearOutput.autoOutput();\r\n\t\t\t\t\tshotGear = true;\r\n\t\t\t\t}else if(autotime.get() < 3.67) {\r\n\t\t\t\t\tdrive.drive(0.50, 0.50);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tdrive.drive(0,0);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2:\r\n\t\t\t\t//Mark: start LEFT of center, drive forward, turn -60 degrees, drive forward, shoot gear on peg\r\n\t\t\t\tif (autotime.get() < 2) {\r\n\t\t\t\t\tdrive.drive(-0.75, -0.75);\r\n\t\t\t\t} else if (autotime.get() < 2.5) {\r\n\t\t\t\t\tdrive.drive(1, 0);\r\n\t\t\t\t}else if(autotime.get() < 3.5) { \r\n\t\t\t\t\tdrive.drive(-.75,-.75);\r\n\t\t\t\t} else if (!shotGear) {\r\n\t\t\t\t\tgearOutput.autoOutput();\r\n\t\t\t\t\tshotGear = true;\r\n\t\t\t\t}else if(autotime.get() < 4.5) {\r\n\t\t\t\t\tdrive.drive(0.75, 0.75);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tdrive.drive(0,0);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase 3:\r\n\t\t\t\t//Mark: start RIGHT of center, drive forward, turn 60 degrees, drive forward, shoot gear on peg\r\n\t\t\t\tif (autotime.get() < 2) {\r\n\t\t\t\t\tdrive.drive(-0.75, -0.75);\r\n\t\t\t\t} else if (autotime.get() < 2.25) {\r\n\t\t\t\t\tdrive.drive(0, 1);\r\n\t\t\t\t}else if(autotime.get() < 4) { \r\n\t\t\t\t\tdrive.drive(-.75,-.75);\r\n\t\t\t\t} else if (!shotGear) {\r\n\t\t\t\t\tgearOutput.autoOutput();\r\n\t\t\t\t\tshotGear = true;\r\n\t\t\t\t}else if(autotime.get() < 4.5) {\r\n\t\t\t\t\tdrive.drive(0.75, 0.75);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tdrive.drive(0,0);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\t// if(!successfullyGrabbedRectangles) {\r\n\t\t\t// Rectangle[] targets = grabRectangles();\r\n\t\t\t//\r\n\t\t\t//// System.out.println(\"-----\");\r\n\t\t\t//// for(Rectangle r : testing) {\r\n\t\t\t//// System.out.println(r.getArea());\r\n\t\t\t//// }\r\n\t\t\t//// System.out.println(\"-----\");\r\n\t\t\t//\r\n\t\t\t// if(targets[0].getArea() == 0) {\r\n\t\t\t// //since grabRectangles returns 1 rectangle with area of 0, so if\r\n\t\t\t// one of the area's\r\n\t\t\t// //equals 0, then it was a failed response\r\n\t\t\t// successfullyGrabbedRectangles = false;\r\n\t\t\t// }else{\r\n\t\t\t//\r\n\t\t\t// successfullyGrabbedRectangles = true;\r\n\t\t\t//\r\n\t\t\t// //call auto path to get the wheel speeds from the rectangle\r\n\t\t\t// pathAuto.makeNewPath(targets[0].getWidth(),\r\n\t\t\t// targets[1].getWidth(), targets[0].getXPos() - 240,\r\n\t\t\t// targets[1].getXPos() - 240, ahrs.getAngle());\r\n\t\t\t// //drive.drive(wheelSpeeds[0], wheelSpeeds[1]);\r\n\t\t\t//\r\n\t\t\t// }\r\n\t\t\t// }else{\r\n\t\t\t// //drive.drive(0,0);\r\n\t\t\t//\r\n\t\t\t// double[] wheelSpeedsFromPath = pathAuto.getWheelSpeeds(.4); //the\r\n\t\t\t// .4 doesn't mean anything at all; Beitel is just weird :^)\r\n\t\t\t// drive.drive(wheelSpeedsFromPath[0], wheelSpeedsFromPath[1]);\r\n\t\t\t// //System.out.println(\"Left:\" + wheelSpeedsFromPath[0]);\r\n\t\t\t// //System.out.println(\"Right: \" + wheelSpeedsFromPath[1]);\r\n\t\t\t// }\r\n\r\n\t\t}\r\n\t\t\r\n\t}", "public void autonomous() {\n robot.drive(0.5); //Drives in a square\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n robot.drive(0.5);\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n robot.drive(0.5);\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n robot.drive(0.5);\n Timer.delay(0.5);\n robot.tankDrive(0.5, -0.5);\n Timer.delay(0.25);\n }", "@Override\n\tpublic void robotInit() {\n\t\tdrive = new Drive();\n\t\tintake = new Intake();\n\t\tshooter = new Shooter();\n\t\taimShooter = new AimShooter();\n\t\tvision = new Vision();\n\t\tintakeRoller = new IntakeRoller();\n\t\taManipulators = new AManipulators();\n\t\tshooterLock = new ShooterLock();\n\n\t\t// autochooser\n\t\t// autoChooser = new SendableChooser();\n\n\t\toi = new OI();\n\t\t// instantiate the command used for the autonomous period\n\t\tlowGearCommand = new LowGear();\n\n\t\t// auto chooser commands\n\t\t// autoChooser.addDefault(\"FarLeftAuto\", new FarLeftAuto());\n\t\t// autoChooser.addObject(\"MidLeftAuto\", new MidLeftAuto());\n\t\t// autoChooser.addObject(\"MidAuto\", new MidAuto());\n\t\t// autoChooser.addObject(\"MidRightAuto\", new MidRightAuto());\n\t\t// autoChooser.addObject(\"FarRightAuto\", new FarRightAuto());\n\t\t// autoChooser.addObject(\"Uber Auto\", new UberAuto());\n\t\t// autoChooser.addObject(\"Paper Weight\", new PaperWeightAuto());\n\t\t//\n\t\t// SmartDashboard.putData(\"Autonomous\", autoChooser);\n\n\t\t// autonomousCommand = (Command) autoChooser.getSelected();\n\t\tautonomousCommand = new FarLeftAuto();\n\t\t// autonomousCommand = new MidAuto();\n\t\t// CameraServer.getInstance().startAutomaticCapture(\"cam3\");\n\t\t// autonomousCommand = new FarLeftAuto\n\n\t\tpovUpTrigger.whenActive(new MoveActuatorsUp());\n\t\tpovDownTrigger.whenActive(new MoveActuatorsDown());\n\t}", "public void autonomousPeriodic() {\n\t\tScheduler.getInstance().run();\n\t\t\n shooterArm.updateSmartDashboard();\n\t\tdriveTrain.getDegrees();\n\n\t\tvision.findGoal();\n\t\tvision.getGoalXAngleError();\n\t\tvision.getGoalArmAngle();\n\n\t\t// Stop auto mode if the robot is tilted too much\n\t\tif (Math.abs(driveTrain.getRobotPitch())<=60 && Math.abs(driveTrain.getRobotRoll())<=60)\n\t\t\ttimerTilt.reset();\n\t\t\n\t\t// For some reason, robot did not move in last match in auto, so this code is suspect\n\t\t// Do the Pitch/Roll values need to be zeroed?\n//\t\tif ( autonomousCommand != null && timerTilt.get()>0.5)\n//\t\t\tautonomousCommand.cancel();\n\n\t}", "public void autonomous() {\n /*myRobot.setSafetyEnabled(false);\n myRobot.drive(-0.5, 0.0);\t// drive forwards half speed\n Timer.delay(2.0);\t\t// for 2 seconds\n myRobot.drive(0.0, 0.0);\t// stop robot\n */\n \t/*gyro.reset();\n \twhile(isAutonomous()){\n \t\tdouble angle = gyro.getAngle();\n \tmyRobot.drive(0, -angle * Kp);\t\n \tTimer.delay(.004);\n \t}\n \tmyRobot.drive(0.0, 0.0);\n \t*/\n }", "@Override\n\tpublic void autonomousInit() {\n\t\tvision_.startGearLiftTracker(15);\n\t\tgyro_.reset();\n\t\tautoCommand = (Command) autoChooser.getSelected();\n\t\tif(autoCommand != null)\n\t\t{\n\t\t\tautoCommand.start();\n\t\t}\n\t}", "public void autonomousInit() {\n int sequenceNumber = (int)SmartDashboard.getNumber(\"Autonomous Sequence\");\n \n switch(sequenceNumber) {\n // Move into the Auto Zone\n case 0:\n autonomousCommand = new DirectionalDrive(0.0, -0.5, 1.25);\n break;\n \n // Grab a container and move into the Auto Zone\n case 1:\n autonomousCommand = new ContainerAutonomous();\n break;\n \n // If something else was supplied, do nothing for saftey reasons\n default:\n autonomousCommand = null;\n }\n // Start the autonomous command\n if (autonomousCommand != null) autonomousCommand.start();\n }", "public interface Vehicle {\n\n void applyBrakes();\n void speedUp(int delta);\n void slowDown(int delta);\n}", "@Override\n\tpublic void robotInit() {\n\t\toi = new OI();\n\t\t\n\t\t// chooser.addObject(\"My Auto\", new MyAutoCommand());\n\t\tSmartDashboard.putData(\"Auto mode\", chooser);\n\t\tSystem.out.println(\"I am here\");\n\t\ttopRight = new CANTalon(1);\n\t\tmiddleRight = new CANTalon(3);\n\t\tbottomRight = new CANTalon(2);\n\t\ttopLeft = new CANTalon(5);\n\t\tmiddleLeft = new CANTalon(6);\n\t\tbottomLeft = new CANTalon(7);\n\t\tclimber = new CANTalon(4);\n\t\tshifter = new DoubleSolenoid(2,3);\n\t\tshifter.set(Value.kForward);\n\t\tbucket= new DoubleSolenoid(0, 1);\n\t\tclimber.reverseOutput(true);\n\t\t//Setting Followers\n\t\t//topRight is Right Side Master (TalonSRX #1)0.062, 0.00062, 0.62)\n\t\t//middleRight.reset();\n//\t\tmiddleRight.setProfile(0);\n//\t\tmiddleRight.setPID( 0.0, 0.0, 0.0);//TODO: make multiple profiles\n\t\t\n//\t\tmiddleRight.setFeedbackDevice(FeedbackDevice.CtreMagEncoder_Absolute);\n//\t\tmiddleRight.setEncPosition(0);\n//\t\tmiddleRight.setAllowableClosedLoopErr(10);\n\t\tmiddleRight.reverseSensor(true);\n//\t\tmiddleRight.configNominalOutputVoltage(+0f, -0f);\n//\t\tmiddleRight.configPeakOutputVoltage(+12f, -12f);\n\t\ttopRight.changeControlMode(TalonControlMode.Follower);\n\t\ttopRight.set(middleRight.getDeviceID());\n\t\ttopRight.reverseOutput(true);\n\t\tbottomRight.changeControlMode(TalonControlMode.Follower); //TalonSRX #3\n\t\tbottomRight.set(middleRight.getDeviceID());\n//\t\tmiddleRight.setProfile(1);\n//\t\tmiddleRight.setPID( 0.0, 0.0, 0.0);\n\t\t//climber is the climber Motor (TalonSRX #4)\n\t\t//TopLeft is Right Side Master (TalonSRX #5)\n\t\t//middleLeft.reset();\n\t\t//middleLeft.setProfile(0);\n//\t\tmiddleLeft.setPID(0.0, 0.00, 0.0);\n//\t\tmiddleLeft.setEncPosition(0);\n//\t\tmiddleLeft.setFeedbackDevice(FeedbackDevice.CtreMagEncoder_Absolute);\n//\t\tmiddleLeft.configNominalOutputVoltage(+0f, -0f);\n//\t\tmiddleLeft.configPeakOutputVoltage(+12f, -12f);\n\t\tmiddleLeft.reverseSensor(false);\n//\t\tmiddleLeft.setAllowableClosedLoopErr(10);\n\t\ttopLeft.changeControlMode(TalonControlMode.Follower); //TalonSRX #6\n\t\ttopLeft.set(middleLeft.getDeviceID());\n\t\ttopLeft.reverseOutput(true);\n\t\tbottomLeft.changeControlMode(TalonControlMode.Follower); //TalonSRX #7\n\t\tbottomLeft.set(middleLeft.getDeviceID());\n//\t\tmiddleLeft.setProfile(1);\n//\t\tmiddleLeft.setPID(0, 0, 0);\n\t\t//Sensors\n\t\timu = new ADIS16448IMU();\n\t\tclimberSubsystem = new ClimberSubsystem();\n\t\tbucketSubsystem = new BucketSubsystem();\n\t\tdriveSubsystem = new DriveSubsystem();\n\t}", "@Override\n\tpublic void autonomousInit() {\n\t\t//SmartDashboard.getData(\"Driver File\");\n\t\t//SmartDashboard.getData(\"Operator File\");\n\t\tautonomousCommand = chooser.getSelected();\n\t\tisAutonomous = true;\n\t\tisTeleoperated = false;\n\t\tisEnabled = true;\n\t\tRobot.numToSend = 3;\n\t\tdrivebase.resetGyro();\n\n\t\t/*\n\t\t * String autoSelected = SmartDashboard.getString(\"Auto Selector\",\n\t\t * \"Default\"); switch(autoSelected) { case \"My Auto\": autonomousCommand\n\t\t * = new MyAutoCommand(); break; case \"Default Auto\": default:\n\t\t * autonomousCommand = new ExampleCommand(); break; }\n\t\t */\n\n\t\t// schedule the autonomous command (example)\n\t\tRobot.gearManipulator.gearManipulatorPivot.setPosition(0);\n\t\tRobot.gearManipulator.gearManipulatorPivot.setSetpoint(0);\n\t\tif (autonomousCommand != null)\n\t\t\tautonomousCommand.start();\n\t}", "@Override\n public void robotInit() {\n m_oi = new OI();\n m_chooser.setDefaultOption(\"Default Auto\", new ExampleCommand());\n // chooser.addOption(\"My Auto\", new MyAutoCommand());\n SmartDashboard.putData(\"Auto mode\", m_chooser);\n\n Comp = new Compressor();\n\n //ClimbBack = new DoubleSolenoid(PCM_COMP_24V, 0, 1);\n //ClimbFront = new DoubleSolenoid(PCM_COMP_24V, 2, 3);\n LegFrontL = new VictorSPX(30);\n LegFrontR = new Spark(9);\n LegBackL = new VictorSPX(31);\n LegBackR = new VictorSPX(32);\n\n BackFootMover = new VictorSP(1);\n FrontFootMover = new Spark(2);\n //FeetMovers = new SpeedControllerGroup(BackFootMoverFootMover);\n\n MainRight = new CANSparkMax(9, MotorType.kBrushless);\n AltRight = new CANSparkMax(10, MotorType.kBrushless);\n MainLeft = new CANSparkMax(11, MotorType.kBrushless);\n AltLeft = new CANSparkMax(12, MotorType.kBrushless);\n\n MainRight.setIdleMode(IdleMode.kCoast);\n AltRight.setIdleMode(IdleMode.kCoast);\n MainLeft.setIdleMode(IdleMode.kCoast);\n AltLeft.setIdleMode(IdleMode.kCoast);\n\n AltLeft.follow(MainLeft);\n AltRight.follow(MainRight);\n\n Drive = new DifferentialDrive(MainLeft, MainRight);\n\n Lifter = new TalonSRX(6);\n Lifter.setNeutralMode(NeutralMode.Brake);\n Lifter.enableCurrentLimit(false);\n /*Lifter.configContinuousCurrentLimit(40);\n Lifter.configPeakCurrentLimit(50);\n Lifter.configPeakCurrentDuration(1500);*/\n //Lifter.configReverseSoftLimitEnable(true);\n //Lifter.configReverseSoftLimitThreshold(-27000);\n //Lifter.configForwardLimitSwitchSource(LimitSwitchSource.FeedbackConnector, LimitSwitchNormal.NormallyOpen);\n //Lifter.configClearPositionOnLimitF(true, 0);\n Lifter.selectProfileSlot(0, 0);\n LiftSetpoint = 0;\n\n LiftFollower = new TalonSRX(5);\n LiftFollower.follow(Lifter);\n LiftFollower.setNeutralMode(NeutralMode.Brake);\n\n ArmExtender = new Solenoid(0);\n ArmOpener = new Solenoid(1);\n ArmGrippers = new Spark(0);\n\n HatchSwitch0 = new DigitalInput(0);\n HatchSwitch1 = new DigitalInput(1);\n\n Accel = new BuiltInAccelerometer(Range.k2G);\n\n //Diagnostics = new DiagnosticsLogger();\n // Uncomment this line to enable diagnostics. Warning: this may\n // cause the robot to be slower than it is supposed to be because of lag.\n //Diagnostics.start();\n\n xbox = new XboxController(0);\n joystick = new Joystick(1);\n \n LiftRamp = new SRamp();\n SpeedRamp = new SRamp();\n\n NetworkTableInstance nt = NetworkTableInstance.getDefault();\n\n VisionTable = nt.getTable(\"ChickenVision\");\n TapeDetectedEntry = VisionTable.getEntry(\"tapeDetected\");\n TapePitchEntry = VisionTable.getEntry(\"tapePitch\");\n TapeYawEntry = VisionTable.getEntry(\"tapeYaw\");\n\n LedTable = nt.getTable(\"LedInfo\");\n LedScript = LedTable.getEntry(\"CurrentScript\");\n LedScriptArgument = LedTable.getEntry(\"ScriptArgument\");\n LedArmsClosed = LedTable.getEntry(\"ArmsClosed\");\n\n UsbCamera cam = CameraServer.getInstance().startAutomaticCapture();\n cam.setPixelFormat(PixelFormat.kMJPEG);\n cam.setResolution(320, 240);\n cam.setFPS(15);\n \n\n LedScript.setString(\"ColorWaves\");\n LedScriptArgument.setString(\"\");\n\n limits = new DigitalInput[8];\n\n for (int i = 0; i < limits.length; i++) {\n limits[i] = new DigitalInput(i + 2);\n }\n }", "@Override\n public void autonomousInit() {\n\n Robot.m_driveTrain.driveTrainLeftFrontMotor.setSelectedSensorPosition(0);\n Robot.m_driveTrain.driveTrainRightFrontMotor.setSelectedSensorPosition(0);\n Robot.m_driveTrain.driveTrainRightRearMotor.setSelectedSensorPosition(0);\n Robot.m_driveTrain.driveTrainLeftRearMotor.setSelectedSensorPosition(0);\n\n /*\n * String autoSelected = SmartDashboard.getString(\"Auto Selector\",\n * \"Default\"); switch(autoSelected) { case \"My Auto\": autonomousCommand\n * = new MyAutoCommand(); break; case \"Default Auto\": default:\n * autonomousCommand = new ExampleCommand(); break; }\n */\n\n // schedule the autonomous command (example)\n }", "@Override\n public void autonomousInit() {\n //ds.set(Value.kForward);\n /*m_autonomousCommand = m_chooser.getSelected();\n\n /*\n * String autoSelected = SmartDashboard.getString(\"Auto Selector\",\n * \"Default\"); switch(autoSelected) { case \"My Auto\": autonomousCommand\n * = new MyAutoCommand(); break; case \"Default Auto\": default:\n * autonomousCommand = new ExampleCommand(); break; }\n * \n */\n\n // schedule the autonomous command (example)\n /*if (m_autonomousCommand != null) {\n m_autonomousCommand.start();\n }*/\n //new VisionProcess().start();\n //SmartDashboard.putNumber(\"heerer\", value)\n new TeleOpCommands().start();\n }", "@Override\n\tpublic void autonomousInit() {\n\t\tRobot.driveSubsystem.shiftDown();\n\n\t\tRobot.driveSubsystem.setBrakeMode();\n\n\t\tm_autoCmd = m_chooser.getSelected();\n\t\tif (m_autoCmd != null) {\n\t\t\tm_autoCmd.start();\n\t\t}\n\t}", "public void operatorDrive() {\n\n changeMode();\n checkForGearShift();\n\n if (Robot.rightJoystick.getRawButton(1)) {\n currentMode = DriveMode.AUTO;\n\n } else if (Robot.rightJoystick.getRawButton(2)) {\n currentMode = DriveMode.CLIMB;\n } else {\n currentMode = DEFAULT_MODE;\n }\n\n isDeploying = false;\n\n if (currentMode == DriveMode.AUTO) {\n currentMode_s = \"Auto\";\n } else if (currentMode == DriveMode.ARCADE) {\n currentMode_s = \"Arcade\";\n } else {\n currentMode_s = \"Tank\";\n }\n\n double leftY = 0;\n double rightY = 0;\n\n switch (currentMode) {\n\n case AUTO:\n rotateCam(4, Robot.visionTargetInfo.visionPixelX);\n\n // driveFwd(4, .25);\n\n break;\n\n case CLIMB:\n\n climb();\n\n break;\n\n case ARCADE:\n resetAuto();\n double linear = 0;\n double turn = 0;\n\n if (Math.abs(Robot.rightJoystick.getY()) > deadband) {\n linear = -Robot.rightJoystick.getY();\n }\n if (Math.abs(Robot.leftJoystick.getX()) > deadband) {\n turn = Math.pow(Robot.leftJoystick.getX(), 3);\n }\n\n leftY = -linear - turn;\n rightY = linear - turn;\n if (!isShifting) {\n assignMotorPower(rightY, leftY);\n } else {\n\n assignMotorPower(0, 0);\n }\n\n break;\n\n case TANK:\n\n resetAuto();\n if (Math.abs(Robot.rightJoystick.getY()) > deadband) {\n rightY = -Math.pow(Robot.rightJoystick.getY(), 3 / 2);\n }\n if (Math.abs(Robot.leftJoystick.getY()) > deadband) {\n leftY = Math.pow(Robot.leftJoystick.getY(), 3 / 2);\n }\n if (!isShifting) {\n assignMotorPower(rightY, leftY);\n } else {\n\n assignMotorPower(0, 0);\n }\n break;\n\n default:\n break;\n }\n\n updateTelemetry();\n }", "@Override\n\tpublic void autonomousInit() {\n\t\t\n\t\t// runs the autonomous smartdashboard display for auton\n\t\tActuators.getLeftDriveMotor().setEncPosition(0);\n\t\tActuators.getRightDriveMotor().setEncPosition(0);\n\t\tautonomousCommand = (Command) autoChooser.getSelected();\n\t\t\n//\t\tbackupCommand = (Command) backupChooser.getSelected();\n//\t\tActuators.getLeftDriveMotor().changeControlMode(TalonControlMode.MotionProfile);\n//\t\tActuators.getRightDriveMotor().changeControlMode(TalonControlMode.MotionProfile);\n//\t\tif (NetworkTables.getControlsTable().getBoolean(\"camera0\", false)) {//Auto for working camera\n\t\t\n\t\tif(autonomousCommand != null){\t\n\t\t\tSystem.out.println(autonomousCommand);\n\t\t\tautonomousCommand.start();\n\t\t}\n\t\t\n//\t\t\tSystem.out.println(\"I got here auto Command start\");\n//\t\t\t}\n//\t\telse{\n//\t\t\tbackupCommand.start();\t\t\t\n//\t\t}\n//\t\t\tDrive.driveWithPID(distance, distance);\n\n\t\tstate = \"auton\";\n\t\t// autoSelected = chooser.getSelected();\n\t\t// // autoSelected = SmartDashboard.getString(\"Auto Selector\",\n\t\t// // defaultAuto);\n\t\t// System.out.println(\"Auto selected: \" + autoSelected);\n\t\tNetworkTables.getControlsTable().putBoolean(\"auton\", true);\n\n\t}", "@Override\n public void robotInit() {\n m_chooser.setDefaultOption(\"Default Auto\", kDefaultAuto);\n m_chooser.addOption(\"My Auto\", kCustomAuto);\n SmartDashboard.putData(\"Auto choices\", m_chooser);\n SmartDashboard.putData(leftMotor1);\n SmartDashboard.putData(leftMotor2);\n SmartDashboard.putData(rightMotor1);\n SmartDashboard.putData(rightMotor2);\n SmartDashboard.putData(firstMotor);\n SmartDashboard.putData(secondMotor);\n \n\n\n\n }", "public void autonomousPeriodic() {\n \tswitch(autoSelected) {\n \tcase customAuto:\n //Put custom auto code here \n break;\n \tcase defaultAuto:\n \tdefault:\n \t//Put default auto code here\n break;\n \t}\n }", "@Override\n public void runOpMode() throws InterruptedException {\n\n AutoMode = new AutoUC3_Park();\n autoIntake = new Intake(hardwareMap);\n autoArm = new Arm(hardwareMap);\n autoChassis = new Chassis(hardwareMap);\n\n waitForStart();\n\n //Initialize on press of play\n autoChassis.initChassis();\n autoArm.initArm();\n autoIntake.initIntake();\n\n while (opModeIsActive()&& !isStopRequested() && !parked) {\n parked = AutoMode.AutoUC3_Park_Method(\n this,\n playingAlliance,\n parkingPlaceNearSkyBridge,\n startInBuildingZone,\n autoChassis,\n autoArm,\n autoIntake);\n }\n }", "public void robotInit() {\n\t\toi = new OI();\n chooser = new SendableChooser();\n chooser.addDefault(\"Default Auto\", new ExampleCommand());\n// chooser.addObject(\"My Auto\", new MyfAutoCommand());\n SmartDashboard.putData(\"Auto mode\", chooser);\n \n //Drive\n //this.DriveTrain = new DriveTrain();\n \t//RobotMap.robotDrive1.arcadeDrive(oi.stickLeft);\n \n //Buttons\n // oi.button1.whenPressed(new SetMaxMotorOutput());\n \n //Ultrasonic\n sonic1 = new Ultrasonic(0,1);\n sonic1.setAutomaticMode(true);\n \n }", "public void autonomousInit() {\n\t\tswitch (autoMode) {\r\n\t\tcase 0:\r\n\t\t\tauto = new G_NoAuto();\r\n\t\t\tbreak;\r\n\t\tcase 1:\r\n\t\t\tauto = new G_Step();\r\n\t\t\tbreak;\r\n\t\tcase 2:\r\n\t\t\tauto = new G_BlockThenFour();\r\n\t\t\tbreak;\r\n\t\tcase 3:\r\n\t\t\tauto = new G_BinTwoLeft();\r\n\t\t\tbreak;\r\n\t\tcase 4:\r\n\t\t\tauto = new G_StepBinCentre();\r\n\t\t\tbreak;\r\n\t\tcase 5:\r\n\t\t\tauto = new G_StepBinLeft();\t\r\n\t\t\tbreak;\r\n\t\tcase 6:\r\n\t\t\tauto = new G_Block();\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\t//Start the chosen Autonomous command. \r\n\t\tauto.start();\r\n\t\t//Cancel the tele-op command, in case it was running before autonomous began. \r\n\t\tteleop.cancel();\r\n\t\t// Start pushing sensor readings to the SD.\r\n\t\treadings.start();\r\n\r\n\t}", "public AutoUnidealSwitch() {\n \tdouble strafeTime = 8;\n \tint strafeDirection = 1;\n \tdouble strafeSpeed = 0.8;\n \t\n \tdouble forwardTime = 3;\n \tdouble forwardSpeed = 0.8;\n \t//Also assumes that positive 1 for direction means robot moving -->\n \t//Assume default position is always going to be left\n \t//addSequential(new StrafeForTime(strafeTime, direction, speed));\n \t//addSequential(new DriveForwardTime(forwardTime, forwardSpeed));\n // Add Commands here:\n // e.g. addSequential(new Command1());\n // addSequential(new Command2());\n // these will run in order.\n\n // To run multiple commands at the same time,\n // use addParallel()\n // e.g. addParallel(new Command1());\n // addSequential(new Command2());\n // Command1 and Command2 will run in parallel.\n\n // A command group will require all of the subsystems that each member\n // would require.\n // e.g. if Command1 requires chassis, and Command2 requires arm,\n // a CommandGroup containing them would require both the chassis and the\n // arm.\n }", "public void init(HardwareMap ahwMap, boolean auto) {\n hwMap = ahwMap;\n\n // Define and Initialize Motors\n extensionArm = hwMap.get(DcMotor.class, \"extensionArm\");\n leftDrive = hwMap.get(DcMotor.class, \"leftDrive\");\n rightDrive = hwMap.get(DcMotor.class, \"rightDrive\");\n leftrotationArm = hwMap.get(DcMotor.class, \"leftrotationArm\");\n rightrotationArm = hwMap.get(DcMotor.class, \"rightrotationArm\");\n intake_motor = hwMap.get(DcMotor.class, \"intakeMotor\");\n if (auto) {\n leftDrive.setDirection(DcMotorSimple.Direction.REVERSE); // Set to REVERSE if using AndyMark motors\n leftDrive.setMode(DcMotor.RunMode.RUN_USING_ENCODER); // Set to REVERSE if using AndyMark motors\n rightDrive.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n rightDrive.setDirection(DcMotorSimple.Direction.FORWARD);\n }else{\n rightDrive.setDirection(DcMotorSimple.Direction.REVERSE); // Set to REVERSE if using AndyMark motors\n leftDrive.setDirection(DcMotorSimple.Direction.FORWARD);\n }\n\n leftrotationArm.setDirection(DcMotorSimple.Direction.REVERSE);\n rightrotationArm.setDirection(DcMotorSimple.Direction.REVERSE);\n\n intake_motor.setDirection(DcMotorSimple.Direction.FORWARD);\n extensionArm.setDirection(DcMotorSimple.Direction.REVERSE);\n\n // Set all motors to zero power\n leftDrive.setPower(0);\n rightDrive.setPower(0);\n\n\n leftrotationArm.setPower(0);\n\n extensionArm.setPower(0);\n intake_motor.setPower(0);\n\n // Set all motors to run without encoders.\n // May want to use RUN_USING_ENCODERS if encoders are installed.\n leftDrive.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n rightDrive.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n\n // Define and initialize ALL installed servos.\n latching_linear = hwMap.get(DcMotor.class, \"latching_linear\");\n\n latchServo = hwMap.get(Servo.class, \"latchServo\");\n verticalServo = hwMap.get(Servo.class, \"yServo\");\n //horizontalServo = hwMap.get(Servo.class, \"zServo\");\n teamMarker = hwMap.get(Servo.class, \"teamMarker\");\n }", "public void execute()\n {\n // obtain object references\n ttlAG = (TTL_Autoguider)TTL_Autoguider.getInstance();\n AUTOGUIDE a = (AUTOGUIDE)command;\n AGS_State desired = null;\n pmc = new AltAzPointingModelCoefficients();\n telescope.getMount().getPointingModel().addCoefficients( pmc );\n\n // start of command execution\n Timestamp start = telescope.getTimer().getTime();\n\n try\n {\n AutoguideMode mode = a.getAutoguideMode();\n\n // Guide on the Brightest guide star\n if( mode == AutoguideMode.BRIGHTEST )\n {\n\tttlAG.guideOnBrightest();\n\tdesired = AGS_State.E_AGS_ON_BRIGHTEST;\n }\n\n // Gide on a guide star between magnitudes i1 and i2\n else if( mode == AutoguideMode.RANGE )\n {\n\tint i1 = (int)\n\t ( Math.rint\n\t ( a.getFaintestMagnitude() ) * 1000.0 );\n\n\tint i2 = (int)\n\t ( Math.rint\n\t ( a.getBrightestMagnitude() ) * 1000.0 );\n\n\tttlAG.guideOnRange( i1, i2 );\n\tdesired = AGS_State.E_AGS_ON_RANGE;\n }\n\n // Guide on teh Nth brightest star\n else if( mode == AutoguideMode.RANK )\n {\n\tttlAG.guideOnRank( a.getBrightnessRank() );\n\tdesired = AGS_State.E_AGS_ON_RANK;\n }\n\n // Guide on the star at pixel coords X,Y\n else if( mode == AutoguideMode.PIXEL )\n {\n\tint i1 = (int)\n\t ( Math.rint( a.getXPixel() * 1000.0 ) );\n\n\tint i2 = (int)\n\t ( Math.rint( a.getYPixel() * 1000.0 ) );\n\n\tttlAG.guideOnPixel( i1, i2 );\n\tdesired = AGS_State.E_AGS_ON_PIXEL;\n }\n\n\n // wait for AGS state change and see if it's the desired one\n // after 200 seconds\n int sleep = 5000;\n while( ( ttlAG.get_AGS_State() == AGS_State.E_AGS_WORKING )&&\n\t ( slept < TIMEOUT ) )\n {\n\n\ttry\n\t{\n\t Thread.sleep( sleep );\n\t slept += sleep;\n\t}\n\tcatch( InterruptedException ie )\n\t{\n\t logger.log( 1, logName, ie.toString() );\n\t}\n }\n\n AGS_State actual = ttlAG.get_AGS_State();\n if( actual != desired )\n {\n\tString s = ( \"after \"+slept+\"ms AGS has acheived \"+actual.getName()+\n\t\t \" state, desired state is \"+desired.getName() );\n\tcommandDone.setErrorMessage( s );\n\tlogger.log( 1, logName, s );\n\treturn;\n }\n\n\n // get x,y of guide star depending on mode and check for age of\n // returned centroids - centroids MUST have been placed SINCE this\n // cmd impl was started.\n TTL_AutoguiderCentroid centroid;\n\n // sleep for 0.5 sec to check values have been updated\n int updateSleep = 500;\n do\n {\n\ttry\n\t{\n\t Thread.sleep( 500 );\n\t slept += 500;\n\t}\n\tcatch( InterruptedException ie )\n\t{\n\t logger.log( 1, logName, ie.toString() );\n\t}\n\n\tcentroid = ttlAG.getCentroidData();\n }\n while( centroid.getTimestamp().getSeconds() < start.getSeconds() );\n\n guideStar = ttlAG.getGuideTarget( centroid );\n\n }\n catch( TTL_SystemException se )\n {\n\n }\n\n stopGuiding = false;\n new Thread( this ).start();\n\n commandDone.setSuccessful( true );\n }", "public void autonomousInit() {\n Jagbot.isAutonomous = true;\n int mode = (int)SmartDashboard.getNumber(RobotMap.Autonomous.MODE_KEY);\n switch (mode) {\n case 0:\n System.out.println(\"Standing still\");\n new StandStill().start();\n break;\n case 1:\n System.out.println(\"Driving forward\");\n new DriveStraight(1).start();\n break;\n \n case 2:\n System.out.println(\"Turning left and shooting to score\");\n new TurnAndScore(-1).start();\n break;\n case 3:\n System.out.println(\"Turning right and shooting to score\");\n new TurnAndScore(1).start();\n break;\n }\n }", "public void autonomousInit() {\n\t\tSystem.out.println(\"Auto Init\");\n//\t\tint autonStep = 0;\t//step that autonomous is executing\n\t\tclaw = new Claw();\n\t\televator = new Elevator();\n//\t\televator.elevator();\n\t\tdecode = new Decode();\n//\t\tdecode.decode();\n\t}", "public void drive( Vehicle vehicle ) {\n\t\t\tvehicle.run();\n\t}", "@Override\n public void robotInit()\n {\n wireUpOperatorInterface();\n chooser.setDefaultOption(\"Default Auto\", driveCommand);\n // chooser.addOption(\"My Auto\", new MyAutoCommand());\n SmartDashboard.putData(\"Auto mode\", chooser);\n }", "@Override \n public void runOpMode() \n {\n leftMotors = hardwareMap.get(DcMotor.class, \"left_Motors\");\n rightMotors = hardwareMap.get(DcMotor.class, \"right_Motors\");\n vLiftMotor = hardwareMap.get(DcMotor.class, \"vLift_Motor\"); \n \n leftMotors.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n rightMotors.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n leftMotors.setDirection(DcMotor.Direction.REVERSE);\n rightMotors.setDirection(DcMotor.Direction.FORWARD);\n vLiftMotor.setDirection(DcMotor.Direction.REVERSE);\n vLiftMotor.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n \n waitForStart(); //press play button, actives opMode\n intakePivotServo.setPosition(intakePivotServoPos);\n while (opModeIsActive()) \n { \n drive();\n pivotIntake();\n pivotLift();\n \n }//opModeIsActive \n \n }", "public AutoScript(Robot robot) {\r\n\t\tthis.robot = robot;\r\n\r\n\t\t//leftEncoder = new DirectionalEncoder(1, 2, RobotTemplate.WHEEL_DIAMETER);\r\n\t\tleftEncoderPIDOut = new PIDOut();\r\n\t\tleftEncoderPIDSauce = new PIDSauce(0);\r\n\t\tleftEncoderPID = new PIDWrapper(RobotTemplate.ENCODER_PID_P, RobotTemplate.ENCODER_PID_I, RobotTemplate.ENCODER_PID_D, RobotTemplate.ENCODER_PID_F, leftEncoderPIDSauce, leftEncoderPIDOut, 0.05);\r\n\r\n\t\t//rightEncoder = new DirectionalEncoder(3, 4, RobotTemplate.WHEEL_DIAMETER);\r\n\t\trightEncoderPIDOut = new PIDOut();\r\n\t\trightEncoderPIDSauce = new PIDSauce(0);\r\n\t\trightEncoderPID = new PIDWrapper(RobotTemplate.ENCODER_PID_P, RobotTemplate.ENCODER_PID_I, RobotTemplate.ENCODER_PID_D, RobotTemplate.ENCODER_PID_F, rightEncoderPIDSauce, rightEncoderPIDOut, 0.05);\r\n\r\n\t\tgyro = robot.chassis.gyro;\r\n\t\tgyroPIDOut = new PIDOut();\r\n\t\tgyroPIDSauce = new PIDSauce(0);\r\n\t\tgyroPID = new PIDWrapper(RobotTemplate.GYRO_PID_P, RobotTemplate.GYRO_PID_I, RobotTemplate.GYRO_PID_D, RobotTemplate.GYRO_PID_F, gyroPIDSauce, gyroPIDOut, 0.05);\r\n\t\tgyroPID.enable();\r\n\t}", "@Override\n\tpublic void teleopPeriodic() {\n\t\tSmartDashboard.putString(\"DT Current Command\", \" \");\n\t\tSmartDashboard.putString(\"SHOOTER Current Command\", \" \");\n\t\tSmartDashboard.putString(\"SHOOTERPIVOT Current Command\", \" \");\n\t\tSmartDashboard.putString(\"INTAKE Current Command\", \" \");\n\t\t\n\t\tScheduler.getInstance().run();\n//\t\t\n//\t\tRobot.drivetrain.leftLED.set(true);\n//\t\tRobot.drivetrain.rightLED.set(false);\n\n\t\tif(!autoAiming) {\n\t\t\tnew DriveForwardRotate(correctForDeadZone(oi.driver.getForward()), correctForDeadZone(oi.driver.getRotation())).start();\n\t\t}\n\t\t//new DriveForwardRotate(oi.driver.getForward(), oi.driver.getRotation()).start();\n\t\t\n\t\tif(oi.autoAim() && !prevStateAutoAim){\n\t\t\t//new SetPivotPosition(PivotPID.AUTO_CAMERA_AIM_POSITION).start(\n//\t\t\tnew AutoAim().start();\n\t\t\tnew AutoAim(TurnConstants.AIM_VELOCITY).start(); //this is a press and hold button 3 on joystick\n\t\t\t\n\t\t}\n\t\t\n\t\tif (readyToShoot && oi.operator.shootBallFlywheels() && oi.operator.shoot()){\n//\t\t\tSystem.out.println(\"SHOOT THE SHOOTER -- ready to shoot\");\n\t\t\tnew ShootTheShooter().start();\n\t\t}\n\t\t\n\t\t\n\t\t//INTAKE ------2 button\n\t\tif (oi.operator.intakeUp() && !prevStateIntakeUp){\n\t\t\tnew SetIntakePosition(IntakeSubsystem.UP).start();\n\t\t}\n\t\tif (oi.operator.intakeDeploy() && !prevStateIntakeDeployed){\n\t\t\tnew SetIntakePosition(!IntakeSubsystem.UP).start();\n\t\t}\n\t\t\n\t\t//CAMERA PISTON\n\t\t\n\t\t//move up\n\t\tif (oi.driver.isCameraUpPressed()){\n\t\t\tnew SetCameraPiston(CameraSubsystem.CAM_UP).start();\n\t\t}\n\t\telse{\n\t\t\tnew SetCameraPiston(!CameraSubsystem.CAM_UP).start();\n\t\t}\n\t\t\n//\t\tif (oi.driver.isCameraUpPressed() && !prevStateCameraUp){\n//\t\t\tnew SetCameraPiston(cameraUp ? !CameraSubsystem.CAM_UP : CameraSubsystem.CAM_UP).start();\n//\t\t\tcameraUp = !cameraUp;\n//\t\t}\n//\t\telse{\n//\t\t\tnew SetCameraPiston(cameraUp ? CameraSubsystem.CAM_UP : !CameraSubsystem.CAM_UP).start();\n//\t\t}\n\t\t\n\t\t\n\t\tif (oi.operator.isSemiAutonomousIntakePressed() && !prevStateSemiAutoIntake){\n\t\t\tnew SemiAutoLoadBall().start();\n\t\t}\n//\t\t\n\t\t\n\t\t//pivot state\n//\t\tif (oi.operator.pivotShootState() && !prevStatePivotUp){\n//\t\t\tnew SetPivotState(ShooterPivotSubsystem.PivotPID.FAR_SHOOT_STATE).start();\n//\t\t}\n//\t\telse if(oi.operator.resetPivot() && !prevStateResetButton) {\n//\t\t\t new ResetPivot().start();\n//\t\t}\n//\t\telse if (oi.operator.pivotStoreState() && !prevStatePivotMiddle){\n//\t\t\tnew SetPivotState(ShooterPivotSubsystem.PivotPID.STORING_STATE).start();\n//\t\t}\n\t\t\n\t\t//PIVOT\n\t\t\n\t\t//if going up\n\t\tif (oi.operator.pivotCloseShot() && !prevStatePivotCloseShot){\n\t\t\tnew SetPivotState(ShooterPivotSubsystem.PivotPID.CLOSE_SHOOT_STATE).start();\t\t\n\t\t}\n\t\t//if going down\n\t\telse if(oi.operator.pivotFarShot() && !prevStatePivotFarShot) {\n\t\t\tnew SetPivotState(ShooterPivotSubsystem.PivotPID.FAR_SHOOT_STATE).start();\n\t\t}\n\t\telse if (oi.operator.pivotStoreState()&& !prevStateStore){\n\t\t\tnew SetPivotState(ShooterPivotSubsystem.PivotPID.STORING_STATE).start();\n\t\t}\n\t\telse if (oi.operator.pivotReset() && !prevStateResetSafety){\n\t\t\tnew ResetPivot().start();\n\t\t}\n\t\telse if (oi.driver.isDefenseShot() && prevStateDefenseShot){\n\t\t\tnew SetPivotPosition(ShooterPivotSubsystem.PivotPID.ANTI_DEFENSE_POSITION).start();\n\t\t}\n\t\n\t\t\n\t\tif (!semiAutoIsRunning){\n//\t\t\n\t\t\t//intake purging/running\n\t\t\tif(oi.operator.purgeIntake()) {\n\t\t\t\t//new SetIntakeSpeed(IntakeSubsystem.FORWARD_ROLLER_PURGE_SPEED, IntakeSubsystem.CENTERING_MODULE_PURGE_SPEED).start(); \n\t\t\t\tnew RunAllRollers(ShooterSubsystem.OUT, !ShooterSubsystem.UNTIL_IR).start();\n\t\t\t\tallIntakeRunning = true;\n\t\t\t} else if (oi.operator.runIntake()) {\n\t\t\t\t//new SetIntakeSpeed(IntakeSubsystem.FORWARD_ROLLER_INTAKE_SPEED, IntakeSubsystem.CENTERING_MODULE_INTAKE_SPEED).start();\n\t\t\t\tnew RunAllRollers(ShooterSubsystem.IN, ShooterSubsystem.UNTIL_IR).start();\n//\t\t\t\tnew SemiAutoLoadBall().start();\n\t\t\t\tallIntakeRunning = true;\n\t\t\t} else {\n\t\t\t\t//just the intakes off here to avoid conflicts\n\t\t\t\tnew SetIntakeSpeed(IntakeSubsystem.INTAKE_OFF_SPEED, IntakeSubsystem.INTAKE_OFF_SPEED).start();\n\t\t\t\t//new EndSemiAuto(true).start();\n\t\t\t\t//new RunAllRollers(ShooterSubsystem.OFF, !ShooterSubsystem.UNTIL_IR).start();\n\t\t\t\tallIntakeRunning = false;\n\t\t\t}\n\t\t\t\n\t\t\t//flywheel control\n\t\t\tif (!allIntakeRunning){\n//\t\t\t\tif(oi.operator.loadBallFlywheels()){\n//\t\t\t\t\tnew SetFlywheels(ShooterSubsystem.FLYWHEEL_INTAKE_POWER, -ShooterSubsystem.FLYWHEEL_INTAKE_POWER).start();;\n//\t\t\t\t\tflywheelShootRunning = true;\n//\t\t\t\t} else \n\t\t\t\tif(oi.operator.shootBallFlywheels()) {\n\t\t\t\t\t//new SetFlywheels(0.7, -0.7).start();\n\t\t\t\t\tnew BangBangFlywheels(true).start();\n\t\t\t\t\tflywheelShootRunning = true;\n\t\t\t\t} else {\n\t\t\t\t\t//new SetFlywheels(0, 0).start();//BangBangFlywheels(false).start();\n\t\t\t\t\tflywheelShootRunning = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n//\t\t\tif(oi.operator.shoot()){\n//\t\t\t\tnew ShooterSet(DoubleSolenoid.Value.kForward).start();\n//\t\t\t} else {\n//\t\t\t\tnew ShooterSet(DoubleSolenoid.Value.kReverse).start();\n//\t\t\t}\n//\t\t\t\n\t\t\tif (!allIntakeRunning && !flywheelShootRunning){\n\t\t\t\tnew SetFlywheels(0, 0).start();\n\t\t\t}\n\t\t\t\n\t\t\t//DEFENSE STATE\n\t\t\tif (oi.operator.isDefenseState() && !prevStateDefenseMode){\n\t\t\t\tnew SetDefenseMode().start();\n\t\t\t}\n\t\t}\n\t\t//tells us if bang bang works\n\t\treadyToShoot = ((Math.abs(shooter.getRightFlywheelRPM() - ShooterSubsystem.flywheelTargetRPM) < ShooterSubsystem.flywheelTolerance)\n\t\t\t\t&& (Math.abs(shooter.getLeftFlywheelRPM() - ShooterSubsystem.flywheelTargetRPM) < ShooterSubsystem.flywheelTolerance));\n\t\t\n\t\t\n\t\tif (oi.operator.isManualFirePiston() && !prevStateManualFirePiston){\n//\t\t\tSystem.out.println(\"SHOOT THE SHOOTER -- manual\");\n\t\t\tnew ShootTheShooter().start();\n\t\t}\n\t\t\n\t\t\n\t\tif(oi.driver.isDrivetrainHighGearButtonPressed()){\n\t\t\tdrivetrain.shift(DrivetrainSubsystem.HIGH_GEAR);\n\t\t\tcurrentGear = DrivetrainSubsystem.HIGH_GEAR;\n\t\t} else {\n\t\t\tdrivetrain.shift(!DrivetrainSubsystem.HIGH_GEAR);\n\t\t\tcurrentGear = !DrivetrainSubsystem.HIGH_GEAR;\n\t\t}\n\t\t\n\t\tisManualPressed = oi.operator.isManualOverrideOperator();\n\t\t\n\t\tif (!shooterPIDIsRunning){\n\t\t\tif(isManualPressed) {\n\t\t\t\tdouble pivotPower = oi.operator.getManualPower()/2.0;\n\t\t\t\t//shooterPivot.engageBrake(false);\n\t\t\t\tif (pivotPower > 0 && shooterPivot.pastMax() || pivotPower < 0 && shooterPivot.lowerLimitsTriggered()){\n\t\t\t\t\tpivotPower = 0;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tnew SetPivotPower(pivotPower).start();\n\t\t\t}\n\t\t\telse{\n\t\t\t\tnew SetPivotPower(0).start();\n\t\t\t}\n\t\t}\n\t\t\n//\t\tSystem.out.println(\"Left: \" + Robot.drivetrain.motors[2].get() + \", Right: \" + (-Robot.drivetrain.motors[0].get()));\n//\t\tSystem.out.println(\"Left V: \" + Robot.drivetrain.leftEncoder.getRate() + \", Right V: \" + Robot.drivetrain.rightEncoder.getRate());\n//\t\tSystem.out.println(\"Accel z: \" + Robot.drivetrain.accel.getZ());\n\t\t\n\t\t\n\t\t//PREV STATES\n\t\tprevStateIntakeUp = oi.operator.intakeUp();\n\t\tprevStateIntakeDeployed = oi.operator.intakeDeploy();\n\t\tprevStateDriveShifter = oi.driver.isDrivetrainHighGearButtonPressed();\n\t\tprevStateShootButton = oi.operator.shoot();\n\t\t\n\t\tprevStatePivotCloseShot = oi.operator.pivotCloseShot();\n\t\tprevStatePivotFarShot = oi.operator.pivotFarShot();\n\t\tprevStateStore = oi.operator.pivotStoreState();\n\t\tprevStateResetSafety = oi.operator.pivotReset();\n\t\t\n\t\tprevStateSemiAutoIntake = oi.operator.isSemiAutonomousIntakePressed();\n\t\tprevStateDefenseMode = oi.operator.isDefenseState();\n\t\t\n\t\tprevStateManualFirePiston = oi.operator.isManualFirePiston();\n\t\tprevStateCameraUp = oi.driver.isCameraUpPressed();\n\t\tprevStateAutoAim = oi.autoAim();\n\t\tprevStateDefenseShot = oi.driver.isDefenseShot();\n\n\t\t\n\t\t//********updating subsystem*******//\n\t\t\n\t\t//shooter hal effect counter\n\t\t//shooterPivot.updateHalEffect();\n\t\t\n\t\t//update the flywheel speed constants\n\t\tshooter.updateShooterConstants();\n\t\t\n\t\t\n\t\t//brake\n\t\tif (!isManualPressed){ //if manual override isn't running\n\t\t\tif (!shooterPIDIsRunning && shooterPivot.motorLeft.get() < DEAD_ZONE_TOLERANCE && shooterPivot.motorRight.get() < DEAD_ZONE_TOLERANCE){\n\t\t\t\t\n\t\t\t\tif (pivotTimer.get() > MIN_STOPPED_TIME){\n\t\t\t\t\tnew EngageBrakes().start();\n\t\t\t\t}\n\t\t\t\t//if motor is 0 for the first time, start the timer\n\t\t\t\tif (!prevStateMotorPowerIs0){\n\t\t\t\t\tpivotTimer.reset();\n\t\t\t\t\tpivotTimer.start();\n\t\t\t\t}\n\t\t\t\t//keep this at the end\n\t\t\t\tprevStateMotorPowerIs0 = true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tshooterPivot.engageBrake(false);\n\t\t\t\t//keep this at the end\n\t\t\t\tpivotTimer.reset();\n\t\t\t\tprevStateMotorPowerIs0 = false;\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tshooterPivot.engageBrake(false);\n\t\t\tpivotTimer.reset();\n\t\t}\n\t\t//System.out.println(shooterPivot.motorLeft.get());\n\t\t\n\t\t//LOGGING AND DASHBOARD\n\t\tlogAndDashboard();\n\t}", "@Override\n public void autonomousPeriodic() {\n switch (m_autoSelected) {\n case kCustomAuto:\n // Put custom auto code here\n break;\n case kDefaultAuto:\n default:\n // Put default auto code here\n break;\n }\n }", "@Override\n public void autonomousPeriodic() {\n switch (m_autoSelected) {\n case kCustomAuto:\n // Put custom auto code here\n break;\n case kDefaultAuto:\n default:\n // Put default auto code here\n break;\n }\n }", "@Override\n public void autonomousPeriodic() {\n switch (m_autoSelected) {\n case kCustomAuto:\n // Put custom auto code here\n break;\n case kDefaultAuto:\n default:\n // Put default auto code here\n break;\n }\n }", "@Override\n public void autonomousPeriodic() {\n switch (m_autoSelected) {\n case kCustomAuto:\n // Put custom auto code here\n break;\n case kDefaultAuto:\n default:\n // Put default auto code here\n break;\n }\n }", "protected void execute() {\n \tRobot.gearIntake.setGearRollerSpeed(-.7);\n }", "@Override\n public void runOpMode() {\n leftDrive = hardwareMap.get(DcMotor.class, \"left_drive\");\n rightDrive = hardwareMap.get(DcMotor.class, \"right_drive\");\n intake = hardwareMap.get (DcMotor.class, \"intake\");\n dropServo = hardwareMap.get(Servo.class, \"drop_Servo\");\n leftDrive.setDirection(DcMotor.Direction.REVERSE);\n rightDrive.setDirection(DcMotor.Direction.FORWARD);\n\n dropServo.setPosition(1.0);\n waitForStart();\n dropServo.setPosition(0.6);\n sleep(500);\n VuforiaOrientator();\n encoderSequence(\"dumbDrive\");\n\n\n }", "@Override\n public void execute() {\n intake.intakeMotor.set(-.8);\n }", "public void teleopArcadeDrive(){\r\n\t\tmyRobot.arcadeDrive(-m_controls.driver_Y_Axis(), -m_controls.driver_X_Axis());\r\n\t}", "@Override\n public void robotInit() {\n m_chooser.setDefaultOption(\"Default Auto\", kDefaultAuto);\n m_chooser.addOption(\"My Auto\", kCustomAuto);\n SmartDashboard.putData(\"Auto choices\", m_chooser);\n //starts the dual cameras\n CameraServer.getInstance().startAutomaticCapture(0);\n CameraServer.getInstance().startAutomaticCapture(1);\n //auto start (disabled atm)\n //pressBoy.setClosedLoopControl(true);\n pressBoy.setClosedLoopControl(false);\n \n \n }", "@Override\n public void autonomousPeriodic() {\n switch (m_autoSelected) {\n case kCustomAuto:\n // Put custom auto code here\n break;\n case kDefaultAuto:\n default:\n // Put default auto code here\n break;\n\n }\n\n controllerMap.controllerMapPeriodic();\n }", "public void robotInit() {\n chooser = new SendableChooser();\n chooser.addDefault(\"Default Auto\", defaultAuto);\n chooser.addObject(\"My Auto\", customAuto);\n SmartDashboard.putData(\"Auto choices\", chooser);\n \n // camera stuff\n robotCamera = CameraServer.getInstance();\n robotCamera.setQuality(50);\n robotCamera.startAutomaticCapture(\"cam0\");\n\n //our robot stuff\n // myChassis\t= new RobotDrive(0,1);\n leftSide\t= new VictorSP(1);\n rightSide\t= new VictorSP(0);\n spinWheels\t= new TalonSRX(2);\n armLifty\t= new TalonSRX(3);\n drivePad\t= new Joystick(0);\n statesPad\t= new Joystick(1);\n LiveWindow.addActuator(\"stud\", \"talonsrx\", armLifty);\n \n //arm position stuff\n armPosition\t\t= new AnalogInput(0);\n armPortSwitch\t= new DigitalInput(0);\n \n //solenoid stuff\n //solenoidThing = new Solenoid(1);\n \n //init button states\n lBPX\t\t\t= false;\n bIPX\t\t\t= false;\n \n //driver buttons\n ballSpitButton\t= 4;\n ballSuckButton\t= 2;\n \n //state machine variables\n defaultState\t\t= 0;\n portState\t\t\t= 1;\n chevellState\t\t= 2;\n ballGrabState\t\t= 10;\n driveState\t\t\t= 11;\n lowBarState\t\t\t= 8;\n rockState\t\t\t= driveState;\n roughState\t\t\t= driveState;\n moatState\t\t\t= driveState;\n rampartState\t\t= driveState;\n drawState\t\t\t= driveState;\n sallyState\t\t\t= driveState;\n liftOverride\t\t= 0.09;\n terrainStates\t\t= 0;\n autoLiftSpeed\t\t= 1.0;\n armLiftBuffer\t\t= 0.01;\n //port state variables\n portPosition1\t\t= 1.7;\n portPosition2\t\t= 0.9;\n portSwitch\t\t\t= 0;\n //chevell state variables\n chevellPosition1\t= 1.135;\n chevellPosition2\t= 2.0;\n chevellSwitch \t\t= 0;\n chevellWheelSpeed\t= 0.3;\n //ball grab state variables\n ballGrabPosition1\t= 1.35;\n ballGrabSwitch\t\t= 0;\n ballGrabWheelSpeed\t= -0.635;\n ballSpitWheelSpeed\t= 1.0;\n //lowbar state variables\n lowBarPosition\t\t= 1.6;\n lowBarSwitch\t\t= 0;\n //drive state variables\n driveSwitch\t\t\t= 1;\n \n }", "@Override\n protected void execute() {\n Robot.tapeAlignSys.enable();\n Robot.lidarAlignSys.enable();\n if (Robot.useDrive) {\n double joy_vals[] = Robot.oi.getJoyXYZ(joy);\n\n double x = joy_vals[0];\n double y = joy_vals[1] * m_forward_speed_limit;\n double z = joy_vals[2] * .5;\n\n if (!joy.getRawButton(5)) { // Button 5 is pid override\n // Get sensor feedback for strafe\n x = .5 * x + Robot.tapeAlignSys.get_pid_output();\n if (x > 1) { x = 1; }\n if (x < -1) { x= -1; }\n\n double distance = Robot.stormNetSubsystem.getLidarDistance();\n SmartDashboard.putNumber(\"Lidar distance (cm)\",distance);\n\n // Get Lidar alignment for Z axis\n// if (z < 100) { // only align if close\n// z = z + Robot.lidarAlignSys.get_pid_output();\n// if (z > 1) { z = 1; }\n// if (z < -1) { z= -1; }\n// }\n\n if (distance < m_distance_scale_factor) {\n // Modulate driver forward input\n if (y > 0 && distance < (m_target_distance + m_distance_scale_factor)) {\n y = y * ((distance - m_target_distance)/(m_distance_scale_factor)) ;\n if (y<0) y = 0;\n } \n }\t\n }\n Robot.drive.driveArcade(x,y,z);\n }\n }", "void accelerate() {\n isAccelerating = true;\n Bukkit.getScheduler().scheduleSyncRepeatingTask(Cars.getInstance(), new BukkitRunnable() {\n @Override\n public void run() {\n if (!isAccelerating) {\n cancel();\n return;\n } else if (CAR.getAcceleration(DIRECTION.getOpposite()).isAccelerating) {\n // Just stop the car if both cars are accelerating because it means the driver is holding down 's'\n // and 'w' at the same time.\n CAR.stopCompletely();\n return;\n }\n\n Minecart minecart = CAR.getMinecart();\n Vector velocity = minecart.getVelocity();\n velocity.add(/* TODO ACCELERATION direction*/new Vector());\n if (velocity.length() >= minecart.getMaxSpeed()) isAccelerating = false;\n minecart.setDerailedVelocityMod(velocity);\n }\n }, 1, 1);\n }", "protected void execute() {\n \tswitch (auto) {\n \tcase RightRightRight:\n \t\tRightRightRight();\n \t\tbreak;\n \tcase RightRightLeft:\n \t\tRightRightLeft();\n \t\tbreak;\n \tcase RightLeftRight:\n \t\tRightLeftRight();\n \t\tbreak;\n \tcase RightLeftLeft:\n \t\tRightLeftLeft();\n \t\tbreak;\n \tcase LeftRightRight:\n \t\tLeftRightRight();\n \t\tbreak;\n \tcase LeftRightLeft:\n \t\tLeftRightLeft();\n \t\tbreak;\n \tcase LeftLeftRight:\n \t\tLeftLeftRight();\n \t\tbreak;\n\t\tcase LeftLeftLeft:\n\t\t\tLeftLeftLeft();\n\t\t\tbreak;\n\t\t}\n \t\n\t\t//Robot.drivebase.DriveTank(1, 1);\n\t\t//new drivecar(1, 1, 5);\n \t\n }", "public void intakeCargo(){\n intake.set(INTAKE_SPEED);\n }", "@Override\n\tpublic void robotInit() {\n\t\tm_chooser.setDefaultOption(\"Default Auto\", kDefaultAuto);\n\t\tm_chooser.addOption(\"My Auto\", kCustomAuto);\n\t\tSmartDashboard.putData(\"Auto choices\", m_chooser);\n\n\t\tm_frontRight = new PWMVictorSPX(0);\n\t\tm_frontLeft = new PWMVictorSPX(2);\n\t\tm_backRight = new PWMVictorSPX(1);\n\t\tm_backLeft = new PWMVictorSPX(3);\n\n\t\tx_aligning = false;\n\n\t\tJoy = new Joystick(0);\n\t\tmyTimer = new Timer();\n\n\t\tfinal SpeedControllerGroup m_left = new SpeedControllerGroup(m_frontLeft, m_backLeft);\n\t\tfinal SpeedControllerGroup m_right = new SpeedControllerGroup(m_frontRight, m_backRight);\n\n\t\tm_drive = new DifferentialDrive(m_left, m_right);\n\n\t\tdistanceToTarget = 0;\n\n\t\tcounter = new Counter(9);\n\t\tcounter.setMaxPeriod(10.0);\n\t\tcounter.setSemiPeriodMode(true);\n\t\tcounter.reset();\n\t}", "@Override\n\tpublic void robotInit() {\n\t\tm_chooser.setDefaultOption(\"Default Auto\", kDefaultAuto);\n\t\tm_chooser.addOption(\"My Auto\", kCustomAuto);\n\t\tSmartDashboard.putData(\"Auto choices\", m_chooser);\n\n\t\tJoy = new Joystick(0);\n\t\ts1 = new DoubleSolenoid(1, 0);\n\t\ts2 = new DoubleSolenoid(2, 3);\n\t\tairCompressor = new Compressor();\n\t\ttriggerValue = false;\n\t\ts1Value = false;\n\t}", "public void autonomousInit() {\n\t\ttimer.start();\n\t\tautonomousCommand = autoChooser.getSelected();\n\t\t//This outputs what we've chosen in the SmartDashboard as a string.\n\t\tSystem.out.println(autonomousCommand);\n\t\tif (DriverStation.getInstance().isFMSAttached()) {\n\t\t\tgameData = DriverStation.getInstance().getGameSpecificMessage();\n\t\t}\n\t\telse {\n\t\t\tgameData=\"RLR\";\n\t\t}\n\t\t//armSwing.setAngle(90); //hopefully this will swing the arms down. not sure what angle it wants though\n\t}", "public void autoUpdate()\n {\n if(distanceSensor.checkDistance() < 300 && myRobot.getAutoDrive())\n {\n activateDumpSolenoid(forward);\n myRobot.setAutoDoneTrue();\n }\n\n //closes the ball tray after doing autonomous\n if(distanceSensor.checkDistance() > 900 && myRobot.getAutoDrive())\n {\n activateDumpSolenoid(reverse);\n }\n }", "@Override\n\tpublic void robotInit() {\n\t\tm_chooser.addDefault(\"Default Auto\", kDefaultAuto);\n\t\tm_chooser.addObject(\"My Auto\", kCustomAuto);\n\t\tSmartDashboard.putData(\"Auto choices\", m_chooser);\n\t\t\n\t\ttalonMotor10.setNeutralMode(NeutralMode.Brake);\n\t\ttalonMotor11.setNeutralMode(NeutralMode.Brake);\n\t\ttalonMotor12.setNeutralMode(NeutralMode.Brake);\n\t\ttalonMotor13.setNeutralMode(NeutralMode.Brake);\n\t\ttalonMotor14.setNeutralMode(NeutralMode.Brake);\n\t\ttalonMotor15.setNeutralMode(NeutralMode.Brake);\n\t}", "@Override\n\tpublic void autonomousPeriodic() //runs the autonomous mode, repeating every 20ms\n\t{\n\t\tScheduler.getInstance().run();\n\t\tSmartDashboard.putNumber(\"Encoder Left: \", RobotMap.encoderLeft.getRaw()); //putting the value of the left encoder to the smartDashboard\n\t\tSmartDashboard.putNumber(\"Encoder Right: \", RobotMap.encoderRight.getRaw()); //putting the value of the right encoder to the smartDashboard\n\t\tSmartDashboard.putNumber(\"Ultrasonic sensor\", ultrasonic.getDistanceIn()); //putting the value of the ultrasonic sensor to the smartDashboard\n\t\tdriveExecutor.execute(); //running the execute() method in driveExecutor\n\t\tgrab.execute(); //running the execute() method in GearGrab_Command (should run without this but this is ensuring us that it is on)\n\t}", "@Override\n public void autonomousInit() {\n\tgameData.readGameData();\n\tautonomousCommand = (Command) chooserMode.getSelected();\n\tdriveSubsystem.resetEncoders();\n\televatorSubsystem.resetEncoder();\n\t// schedule the autonomous command\n\tif (autonomousCommand != null) {\n\t // SmartDashboard.putString(\"i\", \"nit\");\n\t autonomousCommand.start();\n\t}\n }", "public void preform_action() {\n\t\tCarPanelState car_panel_state;\n\t\tSensorData sensor_data;\n\n\t\tint actuator_comp_time = 300;\n\t\tint actuator_deadline = 1000;\n\t\tNature actuator_nature = Task.Nature.APERIODIC;\n\t\tint actuator_movement_amount = 80;\n\n\t\tint closest = 100000;\n\n\t\tswitch (this.action) {\n\t\tcase SET_CAR_SPEED:\n\t\t\tSystem.out.println(\"set speed:\\t\" + this.set_point);\n\t\t\tthis.car_panel_controller.set_target_speed(this.set_point);\n\t\t\tbreak;\n\t\tcase MOVE_UP_CAR:\n\t\t\tSystem.out.println(\"Move_UP:\\t\" + this.set_point);\n\t\t\tthis.car_panel_controller.move_up(this.set_point);\n\t\t\tbreak;\n\t\tcase MOVE_DOWN_CAR:\n\t\t\tSystem.out.println(\"Move_DOWN:\\t\" + this.set_point);\n\t\t\tthis.car_panel_controller.move_down(this.set_point);\n\t\t\tbreak;\n\t\tcase READ_CONE_SENSOR:\n\t\t\tcar_panel_state = this.car_panel_controller.car_panel.getState();\n\t\t\tsensor_data = this.car_panel_controller.get_sensor_data();\n\n\t\t\tint move_up = 0;\n\t\t\tint move_down = 0;\n\n\t\t\tSystem.out.println(\"cone sensor:\\t\" + sensor_data.cone_sensor.cones);\n\n\t\t\t// what to do to avoid hitting the cone\n\t\t\t// if the bottom of the car will hit the cone, move up\n\t\t\tfor (Cone cone : sensor_data.cone_sensor.cones) {\n\t\t\t\tif (will_collide(car_panel_state.main_car, cone)) {\n\t\t\t\t\t// check if the top of the cone will hit the car\n\t\t\t\t\tif ((cone.y_pos < car_panel_state.main_car.y_pos + car_panel_state.main_car.height)\n\t\t\t\t\t\t\t&& (cone.y_pos > car_panel_state.main_car.y_pos)) {\n\t\t\t\t\t\t// the bottom of the car will hit, so move up\n\t\t\t\t\t\tmove_down++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// the top of the car will hit, so move down\n\t\t\t\t\t\t// this.processing_controller.add_task(task);\n\t\t\t\t\t\tmove_up++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// set the actuator deadline based on the closest cone\n\t\t\t\tif (cone.origional_x_pos < closest) {\n\t\t\t\t\tclosest = cone.origional_x_pos;\n\n\t\t\t\t\tint distance_from_cone = cone.origional_x_pos - car_panel_state.main_car.total_moved;\n\t\t\t\t\tint speed_by_tick = 1; // car_panel_state.main_car.speed /\n\t\t\t\t\t\t\t\t\t\t\t// CarPanelController.speed_increment;\n\n\t\t\t\t\tactuator_deadline = distance_from_cone / speed_by_tick;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// if we need to move decide what task we need to insert\n\t\t\tif (move_up + move_down > 0) {\n\t\t\t\t// see if more obstacles would be avoided by moving up or down\n\t\t\t\tif (move_down > move_up) {\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.MOVE_DOWN_CAR, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\t\tactuator_movement_amount);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t} else {\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.MOVE_UP_CAR, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\t\tactuator_movement_amount);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase READ_OTHER_CAR_SENSOR:\n\t\t\tcar_panel_state = this.car_panel_controller.car_panel.getState();\n\t\t\tsensor_data = this.car_panel_controller.get_sensor_data();\n\n\t\t\tmove_up = 0;\n\t\t\tmove_down = 0;\n\n\t\t\tSystem.out.println(\"car sensor:\\t\" + sensor_data.other_car_sensor.other_cars);\n\n\t\t\t// what to do to avoid hitting the cone\n\t\t\t// if the bottom of the car will hit the cone, move up\n\t\t\tfor (Car car : sensor_data.other_car_sensor.other_cars) {\n\t\t\t\tif (will_collide(car_panel_state.main_car, car)) {\n\t\t\t\t\t// check if the top of the cone will hit the car\n\t\t\t\t\tif ((car.y_pos < car_panel_state.main_car.y_pos + car_panel_state.main_car.height)\n\t\t\t\t\t\t\t&& (car.y_pos > car_panel_state.main_car.y_pos)) {\n\t\t\t\t\t\t// the bottom of the car will hit, so move up\n\t\t\t\t\t\tmove_down++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// the top of the car will hit, so move down\n\t\t\t\t\t\t// this.processing_controller.add_task(task);\n\t\t\t\t\t\tmove_up++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// set the actuator deadline based on the closest cone\n\t\t\t\tif (car.origional_x_pos < closest) {\n\t\t\t\t\tclosest = car.origional_x_pos;\n\n\t\t\t\t\tint distance_from_cone = car.origional_x_pos - car_panel_state.main_car.total_moved;\n\t\t\t\t\tint speed_by_tick = 1; // car_panel_state.main_car.speed /\n\t\t\t\t\t\t\t\t\t\t\t// CarPanelController.speed_increment;\n\n\t\t\t\t\tactuator_deadline = distance_from_cone / speed_by_tick;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// if we need to move decide what task we need to insert\n\t\t\tif (move_up + move_down > 0) {\n\t\t\t\t// see if more obstacles would be avoided by moving up or down\n\t\t\t\tif (move_down > move_up) {\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.MOVE_DOWN_CAR, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\t\tactuator_movement_amount);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t} else {\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.MOVE_UP_CAR, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\t\tactuator_movement_amount);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase READ_SPEED_SIGN_SENSOR:\n\t\t\tcar_panel_state = this.car_panel_controller.car_panel.getState();\n\t\t\tsensor_data = this.car_panel_controller.get_sensor_data();\n\n\t\t\tSystem.out.println(\"speed sensor:\\t\" + sensor_data.speed_sign_sensor.signs);\n\n\t\t\t// what to do to avoid hitting the cone\n\t\t\t// if the bottom of the car will hit the cone, move up\n\t\t\tfor (Sign sign : sensor_data.speed_sign_sensor.signs) {\n\t\t\t\t// check the distance to the sign. If the sign is within 300,\n\t\t\t\t// slow down\n\t\t\t\tint main_car_x = car_panel_state.main_car.origional_x_pos + car_panel_state.main_car.total_moved;\n\t\t\t\tif (sign.origional_x_pos - main_car_x < 1000) {\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.SET_CAR_SPEED, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\t\tsign.speed_limit);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t}\n\n\t\t\t\t// set the actuator deadline based on the closest cone\n\t\t\t\tif (sign.origional_x_pos < closest) {\n\t\t\t\t\tclosest = sign.origional_x_pos;\n\n\t\t\t\t\tint distance_from_cone = sign.origional_x_pos - car_panel_state.main_car.total_moved;\n\t\t\t\t\tint speed_by_tick = 1; // car_panel_state.main_car.speed /\n\t\t\t\t\t\t\t\t\t\t\t// CarPanelController.speed_increment;\n\n\t\t\t\t\tactuator_deadline = distance_from_cone / speed_by_tick;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase READ_STOP_SIGN_SENSOR:\n\t\t\tcar_panel_state = this.car_panel_controller.car_panel.getState();\n\t\t\tsensor_data = this.car_panel_controller.get_sensor_data();\n\n\t\t\tSystem.out.println(\"stop sensor:\\t\" + sensor_data.stop_sign_sensor.signs);\n\n\t\t\t// what to do to avoid hitting the cone\n\t\t\t// if the bottom of the car will hit the cone, move up\n\t\t\tfor (Sign sign : sensor_data.stop_sign_sensor.signs) {\n\t\t\t\t// check the distance to the sign. If the sign is within 300,\n\t\t\t\t// slow down\n\t\t\t\tint main_car_x = car_panel_state.main_car.origional_x_pos + car_panel_state.main_car.total_moved;\n\t\t\t\tif (sign.origional_x_pos - main_car_x < 500) {\n\t\t\t\t\t// submit a task to stop at the stop sign\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.SET_CAR_SPEED, this.processing_controller, this.car_panel_controller, 0);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\n\t\t\t\t\t// submit a task to start moving again\n\t\t\t\t\ttask = new Task(actuator_comp_time * 100, 0, actuator_deadline * 100, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.SET_CAR_SPEED, this.processing_controller, this.car_panel_controller, 50);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t}\n\n\t\t\t\t// set the actuator deadline based on the closest cone\n\t\t\t\tif (sign.origional_x_pos < closest) {\n\t\t\t\t\tclosest = sign.origional_x_pos;\n\n\t\t\t\t\tint distance_from_cone = sign.origional_x_pos - car_panel_state.main_car.total_moved;\n\t\t\t\t\tint speed_by_tick = 1; // car_panel_state.main_car.speed /\n\t\t\t\t\t\t\t\t\t\t\t// CarPanelController.speed_increment;\n\n\t\t\t\t\tactuator_deadline = distance_from_cone / speed_by_tick;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase READ_LANE_SENSOR:\n\t\t\tcar_panel_state = this.car_panel_controller.car_panel.getState();\n\t\t\tsensor_data = this.car_panel_controller.get_sensor_data();\n\n\t\t\tSystem.out.println(\"lane sensor:\\t\" + sensor_data.lane_sensor.within_lane);\n\n\t\t\t// if we aren't within our lane\n\t\t\tif (sensor_data.lane_sensor.within_lane == false) {\n\t\t\t\t// move back to origional y position\n\t\t\t\tint main_car_y_offset = car_panel_state.main_car.origional_y_pos - car_panel_state.main_car.y_pos;\n\t\t\t\t// if car below where it should be\n\n\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\tTask.Action.MOVE_DOWN_CAR, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\tmain_car_y_offset);\n\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\t}", "@Override\n\tpublic void autonomousPeriodic() {\n\t\tswitch (m_autoSelected) {\n\t\t\tcase kCustomAuto:\n\t\t\t\t// Put custom auto code here\n\t\t\t\tbreak;\n\t\t\tcase kDefaultAuto:\n\t\t\tdefault:\n\t\t\t\t// Put default auto code here\n\t\t\t\tbreak;\n\t\t}\n\t}", "@Override\n\tpublic void autonomousPeriodic() {\n\t\tswitch (m_autoSelected) {\n\t\t\tcase kCustomAuto:\n\t\t\t\t// Put custom auto code here\n\t\t\t\tbreak;\n\t\t\tcase kDefaultAuto:\n\t\t\tdefault:\n\t\t\t\t// Put default auto code here\n\t\t\t\tbreak;\n\t\t}\n\t}", "@Override\n\tpublic void autonomousPeriodic() {\n\t\tswitch (m_autoSelected) {\n\t\t\tcase kCustomAuto:\n\t\t\t\t// Put custom auto code here\n\t\t\t\tbreak;\n\t\t\tcase kDefaultAuto:\n\t\t\tdefault:\n\t\t\t\t// Put default auto code here\n\t\t\t\tbreak;\n\t\t}\n\t}", "void drive() {\n \t\tSystem.out.println(\"Car can drive\");\n \t}", "public AutoDriveForward()\r\n {\r\n addSequential(new DriveForward(6.5));\r\n }", "public void commonPeriodic()\n {\n double d1LeftJoystick = driver1.getAxis(driver1.LAxisUD);\n double d1RightJoystick = driver1.getAxis(driver1.RAxisUD);\n\n double d2LeftJoystick = driver2.getAxis(driver2.LAxisUD);\n double d2RightJoystick = driver2.getAxis(driver2.RAxisUD);\n\n // -------------------- DRIVER 1\n\n driveTrain.drive(d1LeftJoystick * speedModifier, d1RightJoystick * speedModifier);\n\n // driver1 controls ramp\n // press start and select together to deploy\n if(driver1.down(driver1.Start) && driver1.down(driver1.Select))\n {\n ramp.deploy();\n hatchArm.fingerGrab();\n }\n else\n {\n ramp.undeploy();\n }\n\n // driver 1 can double speed by holding L2\n //driveTrain.fastSpeed = driver1.down(driver1.L2);\n if(driver1.pressed(driver1.A))\n {\n driveTrain.slowSpeed = !driveTrain.slowSpeed;\n System.out.println(\"Fast speed toggled to: \" + driveTrain.slowSpeed);\n }\n\n //drive straight\n if(driver1.down(driver1.L1))\n {\n driveTrain.set_right_motors(speedModifier);\n }\n if(driver1.down(driver1.R1))\n {\n driveTrain.set_left_motors(speedModifier);\n }\n\n // flip drive orientation\n if(driver1.pressed(driver1.Select))\n {\n driveTrain.flip_orientation();\n \n if(driveTrain.isFacingForward())\n {\n camServForward.setSource(camFront);\n //camServReverse.setSource(camBack);\n // camBack.free();\n // camFront.close();\n // camFront = CameraServer.getInstance().startAutomaticCapture(0);\n // camBack = CameraServer.getInstance().startAutomaticCapture(1);\n }\n else\n {\n camServForward.setSource(camBack);\n //camServReverse.setSource(camFront);\n // camBack.close();\n // camFront.close();\n // camFront = CameraServer.getInstance().startAutomaticCapture(1);\n // camBack = CameraServer.getInstance().startAutomaticCapture(0);\n }\n }\n\n\n // -------------------- DRIVER 2\n\n\n // up is out\n // down is in\n // (when it's negated)\n cargoArm.spinBallMotor(-1 * d2LeftJoystick * 0.9);\n\n // control hatch placement pistons\n if(driver2.pressed(driver2.A))\n {\n hatchArm.pushPistons();\n }\n else if (driver2.released(driver2.A))\n {\n hatchArm.retractPistons();\n }\n\n // open/close hatch grabber arms\n if(driver2.pressed(driver2.B))\n {\n hatchArm.toggleGrabber();\n }\n\n if(driver2.pressed(driver2.Select))\n {\n //cargoArm.toggleArmLock();\n hatchArm.toggleFinger();\n }\n\n // extend/de-extend cargo hand\n if(driver2.pressed(driver2.Start))\n {\n cargoArm.toggleHand();\n }\n\n // button 7: L2\n // button 8: R2\n // L2 will reverse the finger\n // R2 will rotate it forward\n if(driver2.down(driver2.L1))\n {\n hatchArm.rotateFinger(1);\n }\n else\n {\n if(driver2.down(driver2.L2))\n {\n hatchArm.rotateFinger(-1);\n }\n else\n {\n hatchArm.rotateFinger(0);\n }\n }\n\n \n // button 5: L1\n // button 6: R1\n // L1 will move the hatch arm one way\n // R1 will move it the other way\n if(driver2.down(driver2.R1))\n {\n hatchArm.rotateArm(-1 * speedModifier);// * 0.75);\n }\n else\n {\n if(driver2.down(driver2.R2))\n {\n hatchArm.rotateArm(1 * speedModifier);// * 0.75);\n }\n else\n {\n hatchArm.rotateArm(0);\n }\n }\n\n \n // button 1: x\n // button 4: y\n // button 1 will move the ball arm one way\n // button 4 will move it the other way\n if(driver2.down(driver2.X))\n {\n //cargoArm.requestMove(-1 * speedModifier);\n cargoArm.rotateArm(-1);\n //cargoArm.solArmBrake.set(false);\n }\n else\n {\n if(driver2.down(driver2.Y))\n {\n //cargoArm.requestMove(2 * speedModifier);\n cargoArm.rotateArm(1);\n //cargoArm.solArmBrake.set(false);\n }\n else\n {\n //cargoArm.rotateArm(cargoArm.getArmCalculation());\n //cargoArm.solArmBrake.set(true);\n cargoArm.rotateArm(0);\n }\n }\n if(driver2.released(driver2.X) || driver2.released(driver2.Y))\n {\n //cargoArm.setArmTarget(cargoArm.currentPosition());\n //cargoArm.solArmBrake.set(true);\n cargoArm.rotateArm(0);\n }\n\n if(driver2.dpad(driver2.Up))\n {\n cargoArm.setArmUp();\n }\n if(driver2.dpad(driver2.Down))\n {\n cargoArm.setArmDown();\n }\n if(driver2.dpad(driver2.Left))\n {\n cargoArm.setArmMid();\n }\n if(driver2.dpad(driver2.Right))\n {\n cargoArm.setArmLow();\n }\n\n if(driver2.pressed(driver2.LThumb))\n {\n cargoArm.armLockEnabled = !cargoArm.armLockEnabled;\n \n }\n if(driver2.pressed(driver2.RThumb))\n {\n cargoArm.toggleBrake();\n }\n\n\n // allow move-to calculations to occur\n hatchArm.periodic();\n cargoArm.periodic();\n }", "@Override\n\tpublic void drive() {\n\t\tSystem.out.println(\"you drive the QCar\");\n\t}", "public static void startAuto(){\n cancelAuto();\n //Turn our ID into a Command\n \tswitch(autonomousChooser.getSelected()){\n case 0:\n command = new BaseLine();\n break;\n default:\n\t\t\t\tSystem.out.println(\"No auto picked\");\n command = null;\n }\n //Run the Command\n\t\tif (command != null){\n\t\t\tcommand.start();\n\t\t}\n }", "protected void execute() { \t\n \tif (isLowered != Robot.oi.getOperator().getRawButton(2)) {\n \t\tisLowered = Robot.oi.getOperator().getRawButton(2);\n \t\tif (isLowered)\n \t\t\tRobot.gearSubsystem.getRaiser().set(DoubleSolenoid.Value.kForward);\n \t\telse\n \t\t\tRobot.gearSubsystem.getRaiser().set(DoubleSolenoid.Value.kReverse);\n \t}\n \t\n \tif (Robot.oi.getOperator().getRawButton(11))\n \t\tRobot.gearSubsystem.getIntakeMotor().set(0.75);\n \telse if (Robot.oi.getOperator().getRawButton(12))\n \t\tRobot.gearSubsystem.getIntakeMotor().set(0);\n \telse if (Robot.oi.getOperator().getRawButton(10))\n \t\tRobot.gearSubsystem.getIntakeMotor().set(-0.75);\n }", "public AutoAim(TurretSubsystem turret, ShooterSubsystem shooter, LED led) {\n // Add your commands in the super() call, e.g.\n // super(new FooCommand(), new BarCommand());\n super(\n // aim towards thing\n new RunCommand(\n () -> {\n turret.turretAuto();\n //System.out.println(\"aiming with turret\");\n },\n turret\n ),\n\n new ShooterSetSpeedPIDF(shooter, true),\n\n new RunCommand(() -> {\n led.turnOnLED();\n }) {\n @Override\n public void end(boolean interrupted) {\n led.turnOffLED();\n }\n }\n \n // start shooter motor\n );\n this.turret = turret;\n this.shooter = shooter;\n this.led = led;\n }", "@Override\n\tpublic void autonomousPeriodic() {\n\t\tif (state == \"auton\") {\n\t\t\tlastState = \"auton\";\n\t\t}\n\t\tScheduler.getInstance().run();\n\t\tSmartDashboard.putNumber(\"Left encoder\", Actuators.getLeftDriveMotor().getEncPosition());\n\t\tSmartDashboard.putNumber(\"Right encoder\", Actuators.getRightDriveMotor().getEncPosition());\n\t\tSmartDashboard.putNumber(\"Left speed\", Actuators.getLeftDriveMotor().get());\n\t\tSmartDashboard.putNumber(\"Right speed\", Actuators.getRightDriveMotor().get());\n\t\t\n\t\t\n\t}", "@Override\n public void robotInit() {\n m_chooser.setDefaultOption(\"Default Auto\", kDefaultAuto);\n m_chooser.addOption(\"My Auto\", kCustomAuto);\n SmartDashboard.putData(\"Auto choices\", m_chooser);\n leftFrontMotor = new CANSparkMax(10, MotorType.kBrushless);\n leftBackMotor = new CANSparkMax(11, MotorType.kBrushless);\n rightFrontMotor = new CANSparkMax(12, MotorType.kBrushless);\n rightBackMotor = new CANSparkMax(13, MotorType.kBrushless);\n leftFrontMotor.setIdleMode(IdleMode.kCoast);\n leftBackMotor.setIdleMode(IdleMode.kCoast);\n rightFrontMotor.setIdleMode(IdleMode.kCoast);\n rightBackMotor.setIdleMode(IdleMode.kCoast);\n gyro = new ADXRS450_Gyro();\n gyro.calibrate();\n stick = new Joystick(1);\n controller = new XboxController(0);\n origGyro = 0;\n }", "public void autonomousPeriodic() {\n //Scheduler.getInstance().run();\n /** if(autoLoopCounter < 100) { //Checks to see if the counter has reached 100 yet\n myRobot.drive(-0.5, 0.0); //If the robot hasn't reached 100 packets yet, the robot is set to drive forward at half speed, the next line increments the counter by 1\n autoLoopCounter++;\n } else {\n myRobot.drive(0.0, 0.0); //If the robot has reached 100 packets, this line tells the robot to stop\n }*/\n }", "@Override\r\n\tpublic void apagar() {\n\t\tSystem.out.println(\"Apagar motor electrico adaptador\");\r\n\t\tthis.motorElectrico.detener();\r\n\t\tthis.motorElectrico.desconectar();\r\n\t}", "@Override\n\tpublic void autonomousInit() //initialization of the autonomous code\n\t{\n\t\t//m_autonomousCommand = m_chooser.getSelected();\n\n\t\t/*\n\t\t * String autoSelected = SmartDashboard.getString(\"Auto Selector\",\n\t\t * \"Default\"); switch(autoSelected) { case \"My Auto\": autonomousCommand\n\t\t * = new MyAutoCommand(); break; case \"Default Auto\": default:\n\t\t * autonomousCommand = new ExampleCommand(); break; }\n\t\t */\n\n\t\t// schedule the autonomous command (example)\n\t\tif (m_autonomousCommand != null) //if we have any autonomous code, start it\n\t\t{\n\t\t\tm_autonomousCommand.start();\n\t\t}\n\t\tRobotMap.encoderLeft.reset(); //reset the values of the encoder\n\t\tRobotMap.encoderRight.reset(); //reset the values of the encoder\n\t\tultrasonic.getInitialDist(); //if nullPointerException, use \"first\" boolean inside the method and run in periodic()\n\t}", "interface VehicleOne\n{\n\tint speed=90;\n\tpublic void distance();\n}", "public void run(int autoId)\r\n\t{\r\n\t\tswitch(autoId)\r\n\t\t{\r\n\t\t\tcase Config.Auto.idDoNothing:\r\n\t\t\t{\r\n\t\t\t\tdoNothing();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcase Config.Auto.idDriveForwardEnc:\r\n\t\t\t{\r\n\t\t\t\t//drive.setTalonMode(true);\r\n\t\t\t\tdriveForwardEnc();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcase Config.Auto.idDriveForwardTimer:\r\n\t\t\t{\r\n\t\t\t\tdriveForwardTimer();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tcase Config.Auto.idGetAllTotesLeftEnc:\r\n\t\t\t{\r\n\t\t\t\t//drive.setTalonMode(true);\r\n\t\t\t\tgetAllTotesLeftEnc();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcase Config.Auto.idGetAllTotesCenterEnc:\r\n\t\t\t{\r\n\t\t\t\t//drive.setTalonMode(true);\r\n\t\t\t\tgetAllTotesCenterEnc();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcase Config.Auto.idGetAllTotesRightEnc:\r\n\t\t\t{\r\n\t\t\t\t//drive.setTalonMode(true);\r\n\t\t\t\tgetAllTotesRightEnc();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcase Config.Auto.idGetAllTotesLeftTimer:\r\n\t\t\t{\r\n\t\t\t\tgetAllTotesLeftTimer();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcase Config.Auto.idGetAllTotesCenterTimer:\r\n\t\t\t{\r\n\t\t\t\tgetAllTotesCenterTimer();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcase Config.Auto.idGetAllTotesRightTimer:\r\n\t\t\t{\r\n\t\t\t\tgetAllTotesRightTimer();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcase Config.Auto.idGetOneToteTimer:\r\n\t\t\t{\r\n\t\t\t\tgetOneToteTimer();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n\tpublic void autonomousPeriodic() {\n\t\t//For some reason, right is inverted in auto instead of left\n\t\tString start = autonomousCommand; //from smartDashboard\n\t\t//String start = \"R\";//R for right, FR for far right, L for far left\n\t\t//Starting Far Right\n\t\tif (start == \"FR\") {\n\t\t\tif(autoStep==0) {\n\t\t\t\tif (timer.get() < 3) {\n\t\t\t\t\tmotorRB.set(-0.5);\n\t\t\t\t\tmotorRF.set(-0.5);\n\t\t\t\t\tmotorLB.set(0.5);\n\t\t\t\t\tmotorLF.set(0.5);\n\t\t\t\t\t//Go forward for 5 seconds\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tmotorRB.set(0);\n\t\t\t\t\tmotorRF.set(0);\n\t\t\t\t\tmotorLB.set(0);\n\t\t\t\t\tmotorLF.set(0);\n\t\t\t\t\t//stop going\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if (start == \"R\") {\n\t\t\t//Starting on the right, aligned with the switch\n\t\t\tif(autoStep==0) {\n\t\t\t\tif (timer.get() < 2) {\n\t\t\t\t\tmotorRB.set(-0.5);\n\t\t\t\t\tmotorRF.set(-0.5);\n\t\t\t\t\tmotorLB.set(0.5);\n\t\t\t\t\tmotorLF.set(0.5);\n\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tmotorRB.set(0);\n\t\t\t\t\tmotorRF.set(0);\n\t\t\t\t\tmotorLB.set(0);\n\t\t\t\t\tmotorLF.set(0);\n\t\t\t\t}\n\t\t\t\tif(gameData.charAt(0) == 'R') {\n\t\t\t\t\tif(timer.get()< 4) {\n\t\t\t\t\t\tmotorLift.set(.25);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tmotorLift.set(0);\n\t\t\t\t\t}\n\t\t\t\t\tif (timer.get() < 15 && timer.get() > 7) {\n\t\t\t\t\t\t\tmotorGL.set(1);\n\t\t\t\t\t\t\tmotorGR.set(-1);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tmotorGL.set(0);\n\t\t\t\t\t\tmotorGR.set(0);\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tautoStep++;\n\t\t\t}\n\t\t}\n\t\telse if (start == \"L\") {\n\t\t//This is for starting on the far left\n\t\t\tif(autoStep == 0) {\n\t\t\t\tif (timer.get() < 2.5) {\n\t\t\t\t\tmotorRB.set(-0.5);\n\t\t\t\t\tmotorRF.set(-0.5);\n\t\t\t\t\tmotorLB.set(0.5);\n\t\t\t\t\tmotorLF.set(0.5);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tmotorRB.set(0);\n\t\t\t\t\tmotorRF.set(0);\n\t\t\t\t\tmotorLB.set(0);\n\t\t\t\t\tmotorLF.set(0);\n\t\t\t\t}\n\t\t\t\tif(gameData.charAt(0) == 'L') {/**Change this to R if we start on the right side, comment out if we're on the far right or left side**/\n\t\t\t\t\trotateTo(270);\n\t\t\t\t\tif (timer.get()>3 && timer.get()<4) {\n\t\t\t\t\t\tmotorRB.set(-0.5);\n\t\t\t\t\t\tmotorRF.set(-0.5);\n\t\t\t\t\t\tmotorLB.set(0.5);\n\t\t\t\t\t\tmotorLF.set(0.5);\n\t\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tmotorRB.set(0);\n\t\t\t\t\t\tmotorRF.set(0);\n\t\t\t\t\t\tmotorLB.set(0);\n\t\t\t\t\t\tmotorLF.set(0);\n\t\t\t\t\t}\n\t\t\t\t\tif(timer.get()< 4) {\n\t\t\t\t\t\tmotorLift.set(.25);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tmotorLift.set(0);\n\t\t\t\t\t}\n\t\t\t\t\tif (timer.get() < 7 && timer.get() > 4) {\n\t\t\t\t\t\tmotorGL.set(1);\n\t\t\t\t\t\tmotorGR.set(-1);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tmotorGL.set(0);\n\t\t\t\t\t\tmotorGR.set(0);\n\t\t\t\t\t}\n\t\t\t\t\tautoStep++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t//Default Code\n\t\t\tif (true) {\n\t\t\t\tif(autoStep==0) {\n\t\t\t\t\tif (timer.get() < 3) {\n\t\t\t\t\t\tmotorRB.set(-0.5);\n\t\t\t\t\t\tmotorRF.set(-0.5);\n\t\t\t\t\t\tmotorLB.set(0.5);\n\t\t\t\t\t\tmotorLF.set(0.5);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tmotorRB.set(0);\n\t\t\t\t\t\tmotorRF.set(0);\n\t\t\t\t\t\tmotorLB.set(0);\n\t\t\t\t\t\tmotorLF.set(0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void autonomousInit() {\n\t\tautonomousCommand = new Auto();\n\n\t\t/*\n\t\t * String autoSelected = SmartDashboard.getString(\"Auto Selector\",\n\t\t * \"Default\"); switch(autoSelected) { case \"My Auto\": autonomousCommand\n\t\t * = new MyAutoCommand(); break; case \"Default Auto\": default:\n\t\t * autonomousCommand = new ExampleCommand(); break; }\n\t\t */\n\n\t\t// schedule the autonomous command (example)\n\t\tif (autonomousCommand != null)\n\t\t\tautonomousCommand.start();\n\t}", "public void arcadeDrive() {\n\t\tif (fastBool) {\n\t\t\tmotorRB.set((joystickLYAxis + joystickLXAxis/2));\n\t\t\tmotorRF.set((joystickLYAxis + joystickLXAxis/2));\n\t\t\tmotorLB.set(-(joystickLYAxis - joystickLXAxis/2));\n\t\t\tmotorLF.set(-(joystickLYAxis - joystickLXAxis/2));\n\t\t} else {\n\t\t\tmotorRB.set((joystickLYAxis + joystickLXAxis/2)/2);\n\t\t\tmotorRF.set((joystickLYAxis + joystickLXAxis/2)/2);\n\t\t\tmotorLB.set(-(joystickLYAxis - joystickLXAxis/2)/2);\n\t\t\tmotorLF.set(-(joystickLYAxis - joystickLXAxis/2)/2);\n\t\t}\n\t}", "public void autoMode4Red(int delay){\n \taddParallel(new LightCommand(0.25));\n// \taddSequential(new OpenGearSocketCommand());\n//\t\taddSequential(new OpenBoilerSocketCommand());\n \taddSequential(new AutoDriveCommand(6));\n \taddSequential(new TurnWithPIDCommand(-45)); \n \taddSequential(new WaitWithoutCheckCommand(.5));\n \taddSequential(new VisionGearTargetCommand(\"targets\"));\n \taddSequential(new TargetGearSortCommand());\n \taddSequential(new AutoTurnCommand());\n \taddParallel(new EnvelopeCommand(true));\n \taddSequential(new AutoDriveUltraSonicForwardCommand(.6, 7));\n \taddSequential(new WaitCommand(2));\n// \tif(Robot.envelopeSubsystem.gearCheck()){\n// \t\taddParallel(new EnvelopeCommand(false));\n// \t\taddSequential(new AutoDriveUltraSonicBackwardCommand(-.7, 35));\n// \t\taddSequential(new VisionGearTargetCommand(\"targets\"),0.5);\n// \t\taddSequential(new TargetGearSortCommand(),0.5);\n// \t\taddSequential(new AutoTurnCommand());\n// \t\taddParallel(new EnvelopeCommand(true));\n// \taddSequential(new AutoDriveUltraSonicForwardCommand(.6, 7));\n// \t\taddSequential(new WaitCommand(2));\n// \t}else{\n// \t\n// \t}\n }", "@Override\n public void handle(Car car) {\n\t SimpleMaxXCar inter = (SimpleMaxXCar) Main.intersection;\n try {\n sleep(car.getWaitingTime());\n } catch (InterruptedException e) {\n e.printStackTrace();\n } // NU MODIFICATI\n\n\t try {\n\t\t System.out.println(\"Car \"+ car.getId() + \" has reached the roundabout from lane \"\n\t\t\t\t + car.getStartDirection());\n\t\t // semafor de x pt fiecare directie\n\t\t inter.s.get(car.getStartDirection()).acquire();\n\t\t System.out.println(\"Car \"+ car.getId() + \" has entered the roundabout from lane \"\n\t\t\t\t + car.getStartDirection());\n\n\t\t // sleep t secunde cand masina e in giratoriu\n\t\t sleep(inter.t);\n\n\t\t System.out.println(\"Car \"+ car.getId() +\" has exited the roundabout after \"\n\t\t\t\t + inter.t + \" seconds\");\n\n\t\t inter.s.get(car.getStartDirection()).release();\n\n\t } catch (InterruptedException e) {\n\t\t e.printStackTrace();\n\t }\n }", "@Override\n public void autonomousInit() {\n //Diagnostics.writeString(\"State\", \"AUTO\");\n //m_autonomousCommand = m_chooser.getSelected();\n\n /*\n * String autoSelected = SmartDashboard.getString(\"Auto Selector\", \"Default\");\n * switch(autoSelected) { case \"My Auto\": autonomousCommand = new\n * MyAutoCommand(); break; case \"Default Auto\": default: autonomousCommand = new\n * ExampleCommand(); break; }\n */\n\n // schedule the autonomous command (example)\n /*if (m_autonomousCommand != null) {\n m_autonomousCommand.start();\n }*/\n\n teleopInit();\n }", "@Override\n public void runOpMode() {\n try {\n leftfrontDrive = hardwareMap.get(DcMotor.class, \"frontLeft\");\n leftfrontDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n rightfrontDrive = hardwareMap.get(DcMotor.class, \"frontRight\");\n rightfrontDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n leftbackDrive = hardwareMap.get(DcMotor.class, \"backLeft\");\n leftbackDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n leftbackDrive.setDirection(DcMotor.Direction.REVERSE);\n\n rightbackDrive = hardwareMap.get(DcMotor.class, \"backRight\");\n rightbackDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n lift = hardwareMap.get(DcMotor.class, \"Lift\");\n lift.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n lift.setDirection(DcMotor.Direction.REVERSE);\n\n markerArm = hardwareMap.get(Servo.class, \"markerArm\");\n\n armActivator = hardwareMap.get(DcMotor.class, \"armActivator\");\n armActivator.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n } catch (IllegalArgumentException iax) {\n bDebug = true;\n }\n\n BNO055IMU.Parameters parameters = new BNO055IMU.Parameters();\n parameters.angleUnit = BNO055IMU.AngleUnit.DEGREES;\n parameters.accelUnit = BNO055IMU.AccelUnit.METERS_PERSEC_PERSEC;\n parameters.calibrationDataFile = \"BNO055IMUCalibration.json\";\n parameters.loggingEnabled = true;\n parameters.loggingTag = \"IMU\";\n parameters.accelerationIntegrationAlgorithm = new JustLoggingAccelerationIntegrator();\n\n imu = hardwareMap.get(BNO055IMU.class, \"imu\");\n imu.initialize(parameters);\n\n waitForStart(); //the rest of the code begins after the play button is pressed\n\n sleep(3000);\n\n drive(0.35, 0.5);\n\n turn(90.0f);\n\n drive(1.8, 0.5);\n\n turn(45.0f);\n\n drive(2.5, -0.5);\n\n sleep(1000);\n\n markerArm.setPosition(1);\n\n sleep(1000);\n\n markerArm.setPosition(0);\n\n sleep(1000);\n\n drive(2.5,.75);\n\n turn(179.0f);\n\n drive(1.5, 1.0);\n\n requestOpModeStop(); //end of autonomous\n }", "@Override\n public void teleopPeriodic() {\n double triggerVal = \n (m_driverController.getTriggerAxis(Hand.kRight)\n - m_driverController.getTriggerAxis(Hand.kLeft))\n * RobotMap.DRIVING_SPEED;\n\n double stick = \n (m_driverController.getX(Hand.kLeft))\n * RobotMap.TURNING_RATE;\n \n m_driveTrain.tankDrive(triggerVal + stick, triggerVal - stick);\n\n if(m_driverController.getAButton()){\n m_shooter.arcadeDrive(RobotMap.SHOOTER_SPEED, 0.0);\n }\n \n else{\n m_shooter.arcadeDrive(0.0, 0.0);\n }\n \n }", "@Override\n public void robotPeriodic() {\n // m_driveTrain.run(gulce);\n\n\n\n // workingSerialCom.StringConverter(ros_string, 2);\n // RoboticArm.run( workingSerialCom.StringConverter(ros_string, 2));\n }", "void setAuto(boolean auto);", "void setAuto(boolean auto);", "public interface Vehicle {\n void start(int a);\n void stop(int b);\n}", "@Override\n public void teleopInit() {\n if (autonomousCommand != null) \n {\n autonomousCommand.cancel();\n }\n\n new ArcadeDrive().start();\n\n new BackElevatorControl().start();\n\n new IntakeControl().start();\n\n new FrontElevatorManual().start();\n\n new ElevatorAutomatic().start();\n }", "public interface IMotor\n{\n /**\n * Function that should be called periodically, typically from\n * the using swerve module's `periodic` function.\n */\n default void periodic()\n {\n // no-op\n }\n\n /**\n * Set the RPM goal, in revolutions per minute. The implementing class is\n * expected to cause the motor to maintain this RPM, through the use of PIDs\n * or similar mechanism.\n *\n * @param goalRPM\n * The requested RPM to be maintained\n */\n void setGoalRPM(double goalRPM);\n\n /**\n * Get the current encoder-ascertained velocity of the motor, in RPM\n */\n public double getVelocityRPM();\n}", "public abstract void interagir (Robot robot);", "public static void runIntake(double lTrigger, double rTrigger, boolean auto, double lSpeed, double rSpeed, boolean poopyShoot)\n\t{\n\t\tif(!auto)\n\t\t{\n\t\t\tif(poopyShoot)//poopyShoot\n\t\t\t{\n\t\t\t\trightIntakeMotor.set(ControlMode.PercentOutput, -Constants.poopyShoot);\n\t\t\t\tleftIntakeMotor.set(ControlMode.PercentOutput, -Constants.poopyShoot);\n\t\t\t}\n\t\t\telse if(lTrigger > 0)//shoot\n\t\t\t{\t\n\t\t\t\trightIntakeMotor.set(ControlMode.PercentOutput, -lTrigger *1);\n\t\t\t\tleftIntakeMotor.set(ControlMode.PercentOutput, -lTrigger *1);\n\t\t\t}\n\t\t\telse if(rTrigger > 0)//intake\n\t\t\t{\n\t\t\t\trightIntakeMotor.set(ControlMode.PercentOutput, rTrigger*0.8);\n\t\t\t\tleftIntakeMotor.set(ControlMode.PercentOutput, rTrigger*.7);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\trightIntakeMotor.set(ControlMode.PercentOutput, 0);\n\t\t\t\tleftIntakeMotor.set(ControlMode.PercentOutput, 0);\n\t\t\t}\n\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\trightIntakeMotor.set(ControlMode.PercentOutput, rSpeed);\n\t\t\tleftIntakeMotor.set(ControlMode.PercentOutput, lSpeed);\n\t\t}\n\t}", "public void autonomous() {\n for (int i = 0; i < teleopControllers.size(); i++) {\n ((EventController) teleopControllers.elementAt(i)).disable();\n }\n for (int i = 0; i < autoControllers.size(); i++) {\n ((EventController) autoControllers.elementAt(i)).enable();\n }\n\n }", "@Override\n public void autonomousInit()\n {\n autonomousCommand = chooser.getSelected();\n \n /*\n * String autoSelected = SmartDashboard.getString(\"Auto Selector\",\n * \"Default\"); switch(autoSelected) { case \"My Auto\": autonomousCommand\n * = new MyAutoCommand(); break; case \"Default Auto\": default:\n * autonomousCommand = new ExampleCommand(); break; }\n */\n \n // schedule the autonomous command (example)\n if (autonomousCommand != null) \n {\n autonomousCommand.start();\n }\n }", "protected void setup() {\n DFAgentDescription dfd = new DFAgentDescription();\n dfd.setName(getAID());\n ServiceDescription sd = new ServiceDescription();\n sd.setName(\"Storage Agent\");\n sd.setType(\"Storage\");\n dfd.addServices(sd);\n try {\n DFService.register(this, dfd);\n } catch (FIPAException fe) {\n fe.printStackTrace();\n }\n waitForAgents = new waitAgents();\n receiveAgents = new receiveFromAgents();\n operate = new opMicrogrid();\n decision = new takeDecision();\n\n addBehaviour(waitForAgents);\n\n //add a ticker behavior to monitor PV production, disable PLay button in the meanwhile\n addBehaviour(new TickerBehaviour(this, 5000) {\n protected void onTick() {\n if (AgentsUp == 0) {\n appletVal.playButton.setEnabled(false);\n ACLMessage msg = new ACLMessage(ACLMessage.INFORM);\n msg.addReceiver(new AID(AgentAIDs[2].getLocalName(), AID.ISLOCALNAME));\n msg.setContent(\"Inform!!!\");\n send(msg);\n String stripedValue = \"\";\n msg = receive();\n if (msg != null) {\n // Message received. Process it\n String val = msg.getContent().toString();\n stripedValue = (val.replaceAll(\"[\\\\s+a-zA-Z :]\", \"\"));\n //PV\n if (val.contains(\"PV\")) {\n System.out.println(val);\n PV = Double.parseDouble(stripedValue);\n appletVal.playButton.setEnabled(true);\n appletVal.SetAgentData(PV, 0, 2);\n }\n\n } else {\n block();\n }\n\n }\n }\n });\n\n }", "@Override\n\tprotected void execute() {\n\t\tdrive.arcadeDrive(Robot.oi.getDriveJoystickForward(), Robot.oi.getDriveJoystickLateral());\n\t}", "public abstract void interagir(Robot robot);", "public AutoVisionTurretCommand() {\n \taddParallel(new VisionCommand(), 5);\n \taddSequential(new DelayedAimCommand());\n }", "public void drive(double power_cap, double target_distance, double target_acceleration,\n double target_velocity) {\n TL.resetMotor();\n TR.resetMotor();\n BL.resetMotor();\n BR.resetMotor();\n\n // Required Stop Condition\n int success_count = TL.getSuccess_count();\n\n // \"PID\" Loop\n while((opModeIsActive() && !isStopRequested()) && (success_count < 90)){\n success_count = TL.getSuccess_count();\n // IMU PID STUFF\n imu.imu_iter(0.00000001);\n double imu_correction = imu.getCorrection();\n telemetry.addData(\"IMU Correction -> \", imu_correction);\n telemetry.addData(\"Global Angle ->\", imu.getGlobalAngle());\n if (!MotorPlus.isWithin(0.0195, imu_correction, 0.0)){\n // If correction is needed, we correct the angle\n TL.addExternalResponse(-imu_correction);\n TR.addExternalResponse(imu_correction);\n BL.addExternalResponse(-imu_correction);\n BR.addExternalResponse(imu_correction);\n } else {\n TL.addExternalResponse(0.0);\n TR.addExternalResponse(0.0);\n BL.addExternalResponse(0.0);\n BR.addExternalResponse(0.0);\n }\n\n // Supplying the \"targets\" to the Motors\n TL.actuate(power_cap, target_distance, target_acceleration, target_velocity);\n TR.actuate(power_cap, target_distance, target_acceleration, target_velocity);\n BL.actuate(power_cap, target_distance, target_acceleration, target_velocity);\n BR.actuate(power_cap, target_distance, target_acceleration, target_velocity);\n\n // Telemetry Stuff\n telemetry.addData(\"TL, TR, BL, and BR Vels -> \", TL.getCurrent_velocity());\n telemetry.addData(\"Success Count TL -> \", TL.getSuccess_count());\n telemetry.update();\n }\n }", "public void teleopPeriodic() {\r\n //Driving\r\n if (driveChooser.getSelected().equals(\"tank\")){\r\n if (joystickChooser.getSelected().equals(\"two\")){\r\n drive.tankDrive(leftJoystick.getY(), rightJoystick.getY());\r\n } \r\n else {\r\n drive.tankDrive(manipulator.getY(), manipulator.getThrottle());\r\n }\r\n }\r\n if (driveChooser.getSelected().equals(\"arcade1\")){\r\n if (joystickChooser.getSelected().equals(\"two\")){\r\n drive.arcadeDrive(leftJoystick.getY(), leftJoystick.getX());\r\n } \r\n else {\r\n drive.arcadeDrive(manipulator.getY(), manipulator.getX());\r\n }\r\n }\r\n if (driveChooser.getSelected().equals(\"arcade2\")){\r\n if (joystickChooser.getSelected().equals(\"two\")){\r\n drive.arcadeDrive(leftJoystick.getY(), rightJoystick.getX());\r\n }\r\n else{\r\n drive.arcadeDrive(manipulator.getY(), manipulator.getTwist());\r\n }\r\n }\r\n \r\n //Shooting\r\n if (shootButton1.get()||shootButton2.get()){\r\n frontShooter.set(-1);\r\n backShooter.set(1);\r\n }\r\n else{\r\n frontShooter.set(0);\r\n backShooter.set(0); \r\n }\r\n if (transportButton1.get()||transportButton2.get()){\r\n transport.set(-1);\r\n }\r\n else{\r\n transport.set(0); \r\n }\r\n \r\n //Intake\r\n if (intakeButton1.get()||intakeButton2.get()){\r\n //intakeA.set(-1);BROKEN\r\n intakeB.set(-1);\r\n }\r\n else{\r\n intakeA.set(0);\r\n intakeB.set(0); \r\n }\r\n \r\n //Turret\r\n if (toggleTurretButton.get()){\r\n turret.set(leftJoystick.getX());\r\n }\r\n else{\r\n turret.set(manipulator.getX());\r\n }\r\n }", "@Override\n protected void execute() {\n\n //directly map the speed from the joystick to the robot motor controllers. \n double leftSpeed = Robot.m_oi.leftJoystickY(Robot.m_oi.driverController);\n double rightSpeed = Robot.m_oi.rightJoystickY(Robot.m_oi.driverController);\n\n //provide a tolernce from the joystick input. \n //Some times if your not touching it it may read a very small value. We dont want the robot to think we are trying to drive it.\n double tolerance = 0.05;\n if(leftSpeed < tolerance && leftSpeed > -tolerance ){\n leftSpeed = 0.0;\n }\n if(rightSpeed < tolerance && rightSpeed > -tolerance){\n rightSpeed = 0.0;\n }\n\n //speed reduction\n if (Robot.m_oi.RB.get()) {\n releaseR = false;\n } else{\n if(releaseR == false) {\n toggleR = !toggleR;\n if (gear < MAXGEAR) {\n gear++;\n }\n releaseR = true;\n }\n }\n if (Robot.m_oi.LB.get()) {\n releaseL = false;\n } else{\n if(releaseL == false) {\n toggleL = !toggleL;\n if (gear > MINGEAR) {\n gear--;\n }\n releaseL = true;\n }\n }\n if (gear == 1){\n leftSpeed*=0.75;\n rightSpeed*=0.75;\n }\n if(gear == 2){\n leftSpeed*=0.5;\n rightSpeed*=0.5;\n }\n if(gear == 3){\n leftSpeed*=0.25;\n rightSpeed*=0.25;\n }\n Robot.WriteOut(\"Gear #: \" + gear);\n SmartDashboard.putNumber(\"gear\", gear );\n\n\n //pass the desired speed to the drive substem and make robot go!\n Robot.drive_subsystem.drive(-leftSpeed, -rightSpeed);\n }", "@Override\n public void teleopPeriodic() {\n double x = xcontroller2.getX(Hand.kLeft);\n //double y = xcontroller1.getTriggerAxis(Hand.kRight) - xcontroller1.getTriggerAxis(Hand.kLeft);\n // For testing just use left joystick. Use trigger axis code for GTA Drive/\n double y = -xcontroller2.getY(Hand.kLeft);\n double z = xcontroller2.getX(Hand.kRight);\n double yaw = imu.getAngleZ();\n RobotDT.driveCartesian(x, y, 0, 0);\n \n\n // After you spin joystick R3 press A button to reset gyro angle\n if (xcontroller1.getAButtonPressed()) {\n imu.reset();\n }\n \n if (xcontroller2.getBButtonPressed()){\n mGPM.goSpongeHatch();\n }\n\n if (xcontroller2.getXButtonPressed()){\n mGPM.goPineHome();\n \n }\n\n\n /** \n * If Bumpers are pressed then Cargo Intake Motor = -1 for Intake \n *if Triggers are pressed set value to 1 for Outtake\n *If triggers are released set value to 0*/\n if(xcontroller2.getBumperPressed(Hand.kLeft) && xcontroller2.getBumperPressed(Hand.kRight)) {\n mGPM.setCargoMotor(-1);\n } else if((xcontroller2.getTriggerAxis(Hand.kLeft) >0.75) && (xcontroller2.getTriggerAxis(Hand.kRight) >0.75)) {\n mGPM.setCargoMotor(1);\n } else{\n mGPM.setCargoMotor(0);\n }\n }", "public interface Vehicle {\n\n double getSpeedLimit();\n}", "@Override\n\tpublic void carEngine() {\n\n\t}" ]
[ "0.68145764", "0.67096686", "0.6660873", "0.6638046", "0.6629854", "0.6539709", "0.64604366", "0.6451977", "0.64092755", "0.63967437", "0.6372303", "0.63193715", "0.63117844", "0.62855566", "0.622557", "0.6170952", "0.6166014", "0.61500704", "0.61381984", "0.6135858", "0.61053425", "0.6101066", "0.6078083", "0.6042154", "0.60412574", "0.60397035", "0.60151607", "0.6000795", "0.599696", "0.5991104", "0.5990704", "0.5985537", "0.59736043", "0.59736043", "0.59736043", "0.59736043", "0.597336", "0.59580857", "0.59401464", "0.59376174", "0.59229636", "0.5915889", "0.5915426", "0.5910987", "0.59039867", "0.5903705", "0.5902341", "0.58975005", "0.58930284", "0.58920217", "0.58827424", "0.58818245", "0.5881312", "0.5878978", "0.5875577", "0.5874338", "0.5874338", "0.5874338", "0.58737475", "0.5873241", "0.5861659", "0.58613944", "0.5858718", "0.58574533", "0.5851437", "0.58418524", "0.5837682", "0.58140576", "0.5812193", "0.58111143", "0.5807186", "0.58022904", "0.58000124", "0.579137", "0.5786439", "0.5779548", "0.57751644", "0.5765536", "0.5764269", "0.576047", "0.5750419", "0.57449037", "0.57449037", "0.57366824", "0.57342935", "0.5732235", "0.57302624", "0.57236004", "0.572241", "0.5720731", "0.5717858", "0.5712454", "0.570844", "0.5708009", "0.57075876", "0.5704917", "0.57025784", "0.5700875", "0.5699055", "0.56988794" ]
0.81597555
0
This is called on each update cycle. The AutoPilot looks at the environment (via the Car object), and then make a decision about what car controls to use at that cycle. that encapsulates the information needed for decisionmaking.
ActuatorAction handle(float delta, SensorInfo carStatus);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface AutoPilot {\n /**\n * This is called on each update cycle. The AutoPilot looks at the environment\n * (via the Car object), and then make a decision about what car controls to use\n * at that cycle.\n * that encapsulates the information needed for decision-making.\n *\n * @see ActuatorAction\n * @param delta Seconds passed since last update\n * @param carStatus\n * @return\n */\n ActuatorAction handle(float delta, SensorInfo carStatus);\n\n /**\n * Lets the caller know whether this AutoPilot can take over the control. Some\n * types of AutoPilot (such as TurningAutoPilot) only takes over control at\n * certain tiles.\n *\n * @return true if it is ready to take over control.\n */\n public boolean canTakeCharge();\n\n /**\n * Lets the caller know whether this AutoPilot can be swapped out.\n * \n * Sometimes, AutoPilots are in certain crtical states (like in the process of making a turn),\n * and should not be interrupted. Otherwise, the car will end up in an unrecoverable state (like\n * halfway in the turning trajectory).\n * \n * @return true if it can be swapped out.\n */\n public boolean canBeSwappedOut();\n\n}", "@Override\n\tpublic void robotInit() {\n\t\tm_chooser.setDefaultOption(\"Default Auto\", kDefaultAuto);\n\t\tm_chooser.addOption(\"My Auto\", kCustomAuto);\n\t\tSmartDashboard.putData(\"Auto choices\", m_chooser);\n\n\t\tm_frontRight = new PWMVictorSPX(0);\n\t\tm_frontLeft = new PWMVictorSPX(2);\n\t\tm_backRight = new PWMVictorSPX(1);\n\t\tm_backLeft = new PWMVictorSPX(3);\n\n\t\tx_aligning = false;\n\n\t\tJoy = new Joystick(0);\n\t\tmyTimer = new Timer();\n\n\t\tfinal SpeedControllerGroup m_left = new SpeedControllerGroup(m_frontLeft, m_backLeft);\n\t\tfinal SpeedControllerGroup m_right = new SpeedControllerGroup(m_frontRight, m_backRight);\n\n\t\tm_drive = new DifferentialDrive(m_left, m_right);\n\n\t\tdistanceToTarget = 0;\n\n\t\tcounter = new Counter(9);\n\t\tcounter.setMaxPeriod(10.0);\n\t\tcounter.setSemiPeriodMode(true);\n\t\tcounter.reset();\n\t}", "public static void driverControls() {\n\t\tif (driverJoy.getYButton()) {\n\t\t\tif (!yPrevious) {\n\t\t\t\tyEnable = !yEnable;\n\t\t\t\tif (yEnable) {\n\t\t\t\t\tClimber.frontExtend();\n\t\t\t\t} else {\n\t\t\t\t\tClimber.frontRetract();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tyPrevious = driverJoy.getYButton();\n\n\t\t// Toggle switch for the front climbing pneumatics\n\t\tif (driverJoy.getBButton()) {\n\t\t\tif (!bPrevious) {\n\t\t\t\tbEnable = !bEnable;\n\t\t\t\tif (bEnable) {\n\t\t\t\t\tClimber.backExtend();\n\t\t\t\t} else {\n\t\t\t\t\tClimber.backRetract();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tbPrevious = driverJoy.getBButton();\n\n\t\t// Toggles for extending and retracting the hatch\n\t\tif (driverJoy.getAButton()) {\n\t\t\tSystem.out.println((Arm.getSetPosition() == Constants.HATCH_ONE) + \"\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\");\n\t\t\tif (!aPrevious) {\n\t\t\t\taEnable = !aEnable;\n\t\t\t\tif (aEnable) {\n\t\t\t\t\tif (Arm.getSetPosition() == Constants.HATCH_ONE && Arm.isWithinDeadband())// && Arm.isWithinDeadband()) //TODO add this in\n\t\t\t\t\t\tHatchIntake.extend();\n\t\t\t\t} else\n\t\t\t\t\tHatchIntake.retract();\n\t\t\t}\n\t\t}\n\t\taPrevious = driverJoy.getAButton();\n\n\t\t// Start to open servo, back to close\n\t\tif (driverJoy.getStartButton()) {\n\t\t\tHatchIntake.openServo();\n\t\t}\n\t\tif (driverJoy.getBackButton()) {\n\t\t\tHatchIntake.closeServo();\n\t\t}\n\n\t\t// Toggles for extending and retracting the crab\n\t\tif (driverJoy.getXButton()) {\n\t\t\tif (!xPrevious) {\n\t\t\t\txEnable = !xEnable;\n\t\t\t\tif (xEnable) {\n\t\t\t\t\tCrab.extend();\n\t\t\t\t} else {\n\t\t\t\t\tCrab.retract();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\txPrevious = driverJoy.getXButton();\n\n\t\t// Make crab move left or right\n\t\tif (driverJoy.getBumper(Hand.kLeft)) {\n\t\t\tCrab.driveLeft();\n\t\t} else if (driverJoy.getBumper(Hand.kRight)) {\n\t\t\tCrab.driveRight();\n\t\t} else {\n\t\t\tCrab.driveStop();\n\t\t}\n\n\t\t// Intake controls\n\t\tif (driverJoy.getTriggerAxis(Hand.kRight) > .1) {\n\t\t\tIntake.runIntake();\n\t\t} else if (driverJoy.getTriggerAxis(Hand.kLeft) > .1) {\n\t\t\tIntake.runOuttake();\n\t\t} else {\n\t\t\tIntake.stopIntake();\n\t\t}\n\n\t\t// Drive controls front back\n\t\tif (Math.abs(driverJoy.getY(Hand.kLeft)) > .12) {\n\t\t\tspeedStraight = driverJoy.getY(Hand.kLeft);\n\t\t} else {\n\t\t\tspeedStraight = 0;\n\t\t}\n\t\t// Drive controls left right\n\t\tif (Math.abs(driverJoy.getX(Hand.kRight)) > .12) {\n\t\t\tturn = driverJoy.getX(Hand.kRight);\n\t\t} else {\n\t\t\tturn = 0;\n\t\t}\n\t\tDriveTrain.drive(speedStraight, turn);\n\t}", "@Override\n\tpublic void robotInit() {\n\t\tdrive = new Drive();\n\t\tintake = new Intake();\n\t\tshooter = new Shooter();\n\t\taimShooter = new AimShooter();\n\t\tvision = new Vision();\n\t\tintakeRoller = new IntakeRoller();\n\t\taManipulators = new AManipulators();\n\t\tshooterLock = new ShooterLock();\n\n\t\t// autochooser\n\t\t// autoChooser = new SendableChooser();\n\n\t\toi = new OI();\n\t\t// instantiate the command used for the autonomous period\n\t\tlowGearCommand = new LowGear();\n\n\t\t// auto chooser commands\n\t\t// autoChooser.addDefault(\"FarLeftAuto\", new FarLeftAuto());\n\t\t// autoChooser.addObject(\"MidLeftAuto\", new MidLeftAuto());\n\t\t// autoChooser.addObject(\"MidAuto\", new MidAuto());\n\t\t// autoChooser.addObject(\"MidRightAuto\", new MidRightAuto());\n\t\t// autoChooser.addObject(\"FarRightAuto\", new FarRightAuto());\n\t\t// autoChooser.addObject(\"Uber Auto\", new UberAuto());\n\t\t// autoChooser.addObject(\"Paper Weight\", new PaperWeightAuto());\n\t\t//\n\t\t// SmartDashboard.putData(\"Autonomous\", autoChooser);\n\n\t\t// autonomousCommand = (Command) autoChooser.getSelected();\n\t\tautonomousCommand = new FarLeftAuto();\n\t\t// autonomousCommand = new MidAuto();\n\t\t// CameraServer.getInstance().startAutomaticCapture(\"cam3\");\n\t\t// autonomousCommand = new FarLeftAuto\n\n\t\tpovUpTrigger.whenActive(new MoveActuatorsUp());\n\t\tpovDownTrigger.whenActive(new MoveActuatorsDown());\n\t}", "@Override\n public void robotInit() {\n m_chooser.setDefaultOption(\"Default Auto\", kDefaultAuto);\n m_chooser.addOption(\"My Auto\", kCustomAuto);\n SmartDashboard.putData(\"Auto choices\", m_chooser);\n leftFrontMotor = new CANSparkMax(10, MotorType.kBrushless);\n leftBackMotor = new CANSparkMax(11, MotorType.kBrushless);\n rightFrontMotor = new CANSparkMax(12, MotorType.kBrushless);\n rightBackMotor = new CANSparkMax(13, MotorType.kBrushless);\n leftFrontMotor.setIdleMode(IdleMode.kCoast);\n leftBackMotor.setIdleMode(IdleMode.kCoast);\n rightFrontMotor.setIdleMode(IdleMode.kCoast);\n rightBackMotor.setIdleMode(IdleMode.kCoast);\n gyro = new ADXRS450_Gyro();\n gyro.calibrate();\n stick = new Joystick(1);\n controller = new XboxController(0);\n origGyro = 0;\n }", "@Override\r\n\tpublic void autonomous() {\n\r\n\t\tint autoMode = -1;\r\n\t\t\r\n\t\tif (!switch1.get() && !switch2.get() && !switch3.get()) {\r\n\t\t\t//if all the switches are off\r\n\t\t\tautoMode = 0;\r\n\t\t} else if (switch1.get() && !switch2.get() && !switch3.get()) {\r\n\t\t\tautoMode = 1;\r\n\t\t} else if (!switch1.get() && switch2.get() && !switch3.get()) {\r\n\t\t\tautoMode = 2;\r\n\t\t} else if (switch1.get() && switch2.get() && !switch3.get()) {\r\n\t\t\tautoMode = 3;\r\n\t\t}\r\n\r\n\t\tautotime.start();\r\n\r\n\t\t// double[] wheelSpeeds = new double[2];\r\n\t\t// double[] startCoords = {0, 0, Math.PI / 2};\r\n\t\t// double[] endCoords = {0, 1, Math.PI / 2};\r\n\t\t// AutoPath pathAuto = new AutoPath(startCoords, endCoords,\r\n\t\t// ahrs.getAngle());\r\n\t\t//\r\n\t\t// int i = 0;\r\n\t\t// boolean successfullyGrabbedRectangles = false;\r\n\t\t\r\n\t\tboolean shotGear = false;\r\n\t\t//boolean hasBackedUp = false;\r\n\t\twhile (isAutonomous() && isEnabled()) {\r\n\t\t\t// auto.drive(autoMode);\r\n\r\n\t\t\t// while(autotime.get() < 3) {\r\n\t\t\t// drive.drive(-0.9, -0.9);\r\n\t\t\t// }\r\n\r\n\t\t\t// grab the current switch status\r\n\r\n\t\t\tswitch (autoMode) {\r\n\t\t\tcase 0:\r\n\t\t\t\t//Mark: Drive forward\r\n\r\n\t\t\t\tif (autotime.get() < 3) {\r\n\t\t\t\t\tdrive.drive(-0.9, -0.9);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase 1:\r\n\t\t\t\t// Mark: Drive Forward, NO turning, and shoot gear onto peg\r\n\r\n\t\t\t\tif (autotime.get() < 3) {\r\n\t\t\t\t\tdrive.drive(-0.75, -0.75);\r\n\t\t\t\t} else if(!shotGear) {\r\n\t\t\t\t\t// shoot the gear onto the peg\r\n\t\t\t\t\tgearOutput.autoOutput();\r\n\t\t\t\t\tshotGear = true;\r\n\t\t\t\t}else if(autotime.get() < 3.67) {\r\n\t\t\t\t\tdrive.drive(0.50, 0.50);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tdrive.drive(0,0);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2:\r\n\t\t\t\t//Mark: start LEFT of center, drive forward, turn -60 degrees, drive forward, shoot gear on peg\r\n\t\t\t\tif (autotime.get() < 2) {\r\n\t\t\t\t\tdrive.drive(-0.75, -0.75);\r\n\t\t\t\t} else if (autotime.get() < 2.5) {\r\n\t\t\t\t\tdrive.drive(1, 0);\r\n\t\t\t\t}else if(autotime.get() < 3.5) { \r\n\t\t\t\t\tdrive.drive(-.75,-.75);\r\n\t\t\t\t} else if (!shotGear) {\r\n\t\t\t\t\tgearOutput.autoOutput();\r\n\t\t\t\t\tshotGear = true;\r\n\t\t\t\t}else if(autotime.get() < 4.5) {\r\n\t\t\t\t\tdrive.drive(0.75, 0.75);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tdrive.drive(0,0);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase 3:\r\n\t\t\t\t//Mark: start RIGHT of center, drive forward, turn 60 degrees, drive forward, shoot gear on peg\r\n\t\t\t\tif (autotime.get() < 2) {\r\n\t\t\t\t\tdrive.drive(-0.75, -0.75);\r\n\t\t\t\t} else if (autotime.get() < 2.25) {\r\n\t\t\t\t\tdrive.drive(0, 1);\r\n\t\t\t\t}else if(autotime.get() < 4) { \r\n\t\t\t\t\tdrive.drive(-.75,-.75);\r\n\t\t\t\t} else if (!shotGear) {\r\n\t\t\t\t\tgearOutput.autoOutput();\r\n\t\t\t\t\tshotGear = true;\r\n\t\t\t\t}else if(autotime.get() < 4.5) {\r\n\t\t\t\t\tdrive.drive(0.75, 0.75);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tdrive.drive(0,0);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\t// if(!successfullyGrabbedRectangles) {\r\n\t\t\t// Rectangle[] targets = grabRectangles();\r\n\t\t\t//\r\n\t\t\t//// System.out.println(\"-----\");\r\n\t\t\t//// for(Rectangle r : testing) {\r\n\t\t\t//// System.out.println(r.getArea());\r\n\t\t\t//// }\r\n\t\t\t//// System.out.println(\"-----\");\r\n\t\t\t//\r\n\t\t\t// if(targets[0].getArea() == 0) {\r\n\t\t\t// //since grabRectangles returns 1 rectangle with area of 0, so if\r\n\t\t\t// one of the area's\r\n\t\t\t// //equals 0, then it was a failed response\r\n\t\t\t// successfullyGrabbedRectangles = false;\r\n\t\t\t// }else{\r\n\t\t\t//\r\n\t\t\t// successfullyGrabbedRectangles = true;\r\n\t\t\t//\r\n\t\t\t// //call auto path to get the wheel speeds from the rectangle\r\n\t\t\t// pathAuto.makeNewPath(targets[0].getWidth(),\r\n\t\t\t// targets[1].getWidth(), targets[0].getXPos() - 240,\r\n\t\t\t// targets[1].getXPos() - 240, ahrs.getAngle());\r\n\t\t\t// //drive.drive(wheelSpeeds[0], wheelSpeeds[1]);\r\n\t\t\t//\r\n\t\t\t// }\r\n\t\t\t// }else{\r\n\t\t\t// //drive.drive(0,0);\r\n\t\t\t//\r\n\t\t\t// double[] wheelSpeedsFromPath = pathAuto.getWheelSpeeds(.4); //the\r\n\t\t\t// .4 doesn't mean anything at all; Beitel is just weird :^)\r\n\t\t\t// drive.drive(wheelSpeedsFromPath[0], wheelSpeedsFromPath[1]);\r\n\t\t\t// //System.out.println(\"Left:\" + wheelSpeedsFromPath[0]);\r\n\t\t\t// //System.out.println(\"Right: \" + wheelSpeedsFromPath[1]);\r\n\t\t\t// }\r\n\r\n\t\t}\r\n\t\t\r\n\t}", "@Override\n\tpublic void robotInit() {\n\t\tm_chooser.addDefault(\"Default Auto\", kDefaultAuto);\n\t\tm_chooser.addObject(\"My Auto\", kCustomAuto);\n\t\tSmartDashboard.putData(\"Auto choices\", m_chooser);\n\t\t\n\t\ttalonMotor10.setNeutralMode(NeutralMode.Brake);\n\t\ttalonMotor11.setNeutralMode(NeutralMode.Brake);\n\t\ttalonMotor12.setNeutralMode(NeutralMode.Brake);\n\t\ttalonMotor13.setNeutralMode(NeutralMode.Brake);\n\t\ttalonMotor14.setNeutralMode(NeutralMode.Brake);\n\t\ttalonMotor15.setNeutralMode(NeutralMode.Brake);\n\t}", "@Override\n public void robotInit() {\n m_chooser.setDefaultOption(\"Default Auto\", kDefaultAuto);\n m_chooser.addOption(\"My Auto\", kCustomAuto);\n SmartDashboard.putData(\"Auto choices\", m_chooser);\n SmartDashboard.putData(leftMotor1);\n SmartDashboard.putData(leftMotor2);\n SmartDashboard.putData(rightMotor1);\n SmartDashboard.putData(rightMotor2);\n SmartDashboard.putData(firstMotor);\n SmartDashboard.putData(secondMotor);\n \n\n\n\n }", "@Override\n\tpublic void robotInit() {\n\t\tm_chooser.setDefaultOption(\"Default Auto\", kDefaultAuto);\n\t\tm_chooser.addOption(\"My Auto\", kCustomAuto);\n\t\tSmartDashboard.putData(\"Auto choices\", m_chooser);\n\n\t\tJoy = new Joystick(0);\n\t\ts1 = new DoubleSolenoid(1, 0);\n\t\ts2 = new DoubleSolenoid(2, 3);\n\t\tairCompressor = new Compressor();\n\t\ttriggerValue = false;\n\t\ts1Value = false;\n\t}", "protected void ratCrewInit() {\n\n // Init motor state machine.\n motorTurnType = \"none\";\n motorTurnDestination = 0.0f;\n motorTurnAngleToGo = 0.0f;\n motorTurnAngleAdjustedToGo = 0.0f;\n isDriving = false;\n driveLeftStart = 0;\n driveRightStart = 0;\n driveLeftTarget = 0;\n driveRightTarget = 0;\n driveRightSpeed = 0.0f;\n driveLeftSpeed = 0.0f;\n driveAngleOffset = 0.0f;\n driveAngleCorrection = 0.0f;\n\n // TODO: push into initMotor function\n if (doMotors) {\n // Initialize Motors, finding them through the hardware map.\n leftDrive = hardwareMap.get(DcMotor.class, \"motorLeft\");\n rightDrive = hardwareMap.get(DcMotor.class, \"motorRight\");\n leftDrive.setDirection(DcMotor.Direction.REVERSE);\n rightDrive.setDirection(DcMotor.Direction.FORWARD);\n\n // initialize the encoder\n leftDrive.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n rightDrive.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n leftDrive.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n rightDrive.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n leftDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n rightDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n // Set all motors to zero power.\n leftDrive.setPower(0);\n rightDrive.setPower(0);\n\n gate = hardwareMap.get(Servo.class, \"Gate\");\n gate.setPosition(1.0);\n }\n initGyroscope();\n\n if (doVuforia){\n initVuforia();\n initTfod();\n\n if (tfod != null) {\n tfod.activate();\n\n // The TensorFlow software will scale the input images from the camera to a lower resolution.\n // This can result in lower detection accuracy at longer distances (> 55cm or 22\").\n // If your target is at distance greater than 50 cm (20\") you can adjust the magnification value\n // to artificially zoom in to the center of image. For best results, the \"aspectRatio\" argument\n // should be set to the value of the images used to create the TensorFlow Object Detection model\n // (typically 1.78 or 16/9).\n\n // Uncomment the following line if you want to adjust the magnification and/or the aspect ratio of the input images.\n tfod.setZoom(2.5, 1.78);\n }\n }\n\n // Init run state.\n madeTheRun = false;\n startTime = 0;\n telemetry.addData(\"Init\", \"motors=%b, gyro=%b, vuforia=%b\", doMotors, doGyro, doVuforia);\n telemetry.update();\n }", "public final void modifyMotorcycle(){\r\n \tgetOffer();\r\n \tgetExhaustSystem();\r\n \tgetTires();\r\n getWindshield();\r\n getLED();\r\n getEngineGuards();\r\n /* Note that any of this methods \r\n \t * could provide a default implementation \r\n \t * by being concretely defined\r\n \t */\r\n }", "@Override\n public void robotInit() {\n m_chooser.setDefaultOption(\"Default Auto\", kDefaultAuto);\n m_chooser.addOption(\"My Auto\", kCustomAuto);\n SmartDashboard.putData(\"Auto choices\", m_chooser);\n //starts the dual cameras\n CameraServer.getInstance().startAutomaticCapture(0);\n CameraServer.getInstance().startAutomaticCapture(1);\n //auto start (disabled atm)\n //pressBoy.setClosedLoopControl(true);\n pressBoy.setClosedLoopControl(false);\n \n \n }", "public void updateInformation() {\r\n onFirstCycle = false;\r\n lastLocation = player.getLocation();\r\n preparedAppearance = false;\r\n }", "public void setCar() {\n\n\t\tint tries = 0;\n\t\tif(type ==RANDOM)\n\t\t{\n\t\t\tfor (int i = 0; i < noOfCarsGenerated; i++) {\n\t\t\t\tCar c = generateRandomCar(Timer.getClock());\n\t\t\t\twhile (c == null){\n\t\t\t\t\ttries++;\n\t\t\t\t\tSystem.out.println(\"i'm null somehow : \" + tries);\n\t\t\t\t\tc = generateRandomCar(Timer.getClock());\n\t\t\t\t}\n\t\t\t\tSimulator.getStations().get(c.getDestination()).addMovingQueue(c);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse if (type == FIXED) {\n\t\t\t\n\t\t\tPoint source=Simulator.geoToCor(latitude, longitude);\n\t\t\tString destination=strategy.chooseDestination(source);\n\n\t\t\tfor (int i = 0; i < noOfCarsGenerated; i++) {\n\t\t\t\tCar c = new Car(latitude, longitude, destination, Timer.getClock(), strategy.setChargingTime(source));\n\t\t\t\tc.saveRoute(c.getCarRoute());\n\t\t\t\tSimulator.getStations().get(c.getDestination()).addMovingQueue(c);\n\t\t\t}\n\t\t}\n\n\t\tcurrentNo += noOfCarsGenerated;\n\n\t\tSimulator.updateCarNolbl(noOfCarsGenerated);\n\n\n\t}", "@Override\n public void robotInit() {\n m_chooser.setDefaultOption(\"Default Auto\", kDefaultAuto);\n m_chooser.addOption(\"My Auto\", kCustomAuto);\n SmartDashboard.putData(\"Auto choices\", m_chooser);\n \n //Initialize Drive Train Motors/\n LeftFront = new WPI_TalonSRX(11);\n RightFront = new WPI_TalonSRX(13);\n LeftBack = new WPI_TalonSRX(10);\n RightBack = new WPI_TalonSRX(12);\n RobotDT = new MecanumDrive(LeftFront, LeftBack, RightFront, RightBack);\n \n //Initialize Xbox Controller or Joystick/\n xcontroller1 = new XboxController(0);\n xcontroller2 = new XboxController(1);\n \n //Initialize Cameras/\n RoboCam = CameraServer.getInstance();\n FrontCamera = RoboCam.startAutomaticCapture(0);\n BackCamera = RoboCam.startAutomaticCapture(1);\n\n //GPM Init/\n mGPM = new GPM();\n \n }", "@Override\n public void robotInit() {\n // Hardware.getInstance().init();\n hardware.init();\n\n controllerMap = ControllerMap.getInstance();\n controllerMap.controllerMapInit();\n\n controllerMap.intake.IntakeInit();\n\n m_chooser.setDefaultOption(\"Default Auto\", kDefaultAuto);\n m_chooser.addOption(\"My Auto\", kCustomAuto);\n SmartDashboard.putData(\"Auto choices\", m_chooser);\n\n intakeCam = CameraServer.getInstance().startAutomaticCapture(\"Driver Camera :)\", 0);\n intakeCam.setPixelFormat(PixelFormat.kMJPEG);\n intakeCam.setResolution(160, 120);\n intakeCam.setFPS(15);\n // climberCam = CameraServer.getInstance().startAutomaticCapture(1);\n\n }", "@Override\n\tpublic void robotInit() {\n\t\toi = new OI();\n\t\t\n\t\t// chooser.addObject(\"My Auto\", new MyAutoCommand());\n\t\tSmartDashboard.putData(\"Auto mode\", chooser);\n\t\tSystem.out.println(\"I am here\");\n\t\ttopRight = new CANTalon(1);\n\t\tmiddleRight = new CANTalon(3);\n\t\tbottomRight = new CANTalon(2);\n\t\ttopLeft = new CANTalon(5);\n\t\tmiddleLeft = new CANTalon(6);\n\t\tbottomLeft = new CANTalon(7);\n\t\tclimber = new CANTalon(4);\n\t\tshifter = new DoubleSolenoid(2,3);\n\t\tshifter.set(Value.kForward);\n\t\tbucket= new DoubleSolenoid(0, 1);\n\t\tclimber.reverseOutput(true);\n\t\t//Setting Followers\n\t\t//topRight is Right Side Master (TalonSRX #1)0.062, 0.00062, 0.62)\n\t\t//middleRight.reset();\n//\t\tmiddleRight.setProfile(0);\n//\t\tmiddleRight.setPID( 0.0, 0.0, 0.0);//TODO: make multiple profiles\n\t\t\n//\t\tmiddleRight.setFeedbackDevice(FeedbackDevice.CtreMagEncoder_Absolute);\n//\t\tmiddleRight.setEncPosition(0);\n//\t\tmiddleRight.setAllowableClosedLoopErr(10);\n\t\tmiddleRight.reverseSensor(true);\n//\t\tmiddleRight.configNominalOutputVoltage(+0f, -0f);\n//\t\tmiddleRight.configPeakOutputVoltage(+12f, -12f);\n\t\ttopRight.changeControlMode(TalonControlMode.Follower);\n\t\ttopRight.set(middleRight.getDeviceID());\n\t\ttopRight.reverseOutput(true);\n\t\tbottomRight.changeControlMode(TalonControlMode.Follower); //TalonSRX #3\n\t\tbottomRight.set(middleRight.getDeviceID());\n//\t\tmiddleRight.setProfile(1);\n//\t\tmiddleRight.setPID( 0.0, 0.0, 0.0);\n\t\t//climber is the climber Motor (TalonSRX #4)\n\t\t//TopLeft is Right Side Master (TalonSRX #5)\n\t\t//middleLeft.reset();\n\t\t//middleLeft.setProfile(0);\n//\t\tmiddleLeft.setPID(0.0, 0.00, 0.0);\n//\t\tmiddleLeft.setEncPosition(0);\n//\t\tmiddleLeft.setFeedbackDevice(FeedbackDevice.CtreMagEncoder_Absolute);\n//\t\tmiddleLeft.configNominalOutputVoltage(+0f, -0f);\n//\t\tmiddleLeft.configPeakOutputVoltage(+12f, -12f);\n\t\tmiddleLeft.reverseSensor(false);\n//\t\tmiddleLeft.setAllowableClosedLoopErr(10);\n\t\ttopLeft.changeControlMode(TalonControlMode.Follower); //TalonSRX #6\n\t\ttopLeft.set(middleLeft.getDeviceID());\n\t\ttopLeft.reverseOutput(true);\n\t\tbottomLeft.changeControlMode(TalonControlMode.Follower); //TalonSRX #7\n\t\tbottomLeft.set(middleLeft.getDeviceID());\n//\t\tmiddleLeft.setProfile(1);\n//\t\tmiddleLeft.setPID(0, 0, 0);\n\t\t//Sensors\n\t\timu = new ADIS16448IMU();\n\t\tclimberSubsystem = new ClimberSubsystem();\n\t\tbucketSubsystem = new BucketSubsystem();\n\t\tdriveSubsystem = new DriveSubsystem();\n\t}", "@Override\n\tpublic void robotInit() {\n\t\toi = new OI();\n\t\tdrivebase.calibrateGyro();\n\t\tSmartDashboard.putData(\"Zero Gyro\", new ZeroGyro());\n\t\tSmartDashboard.putData(\"Calibrate Gyro - WHILE ROBOT NOT MOVING\", new CalibrateGyro());\n\t\tchooser.addDefault(\"Default Prepare Gear Auto\", new PrepareGearManipulator());\n\t\t//shooterModeChooser.addDefault(\"Shooter at Nominal Preset when Pressed\", object);\n\t\t/*chooser.addObject(\"Left Gear Auto\", new LeftGearGroup());\n\t\tchooser.addObject(\"Center Gear Auto\", new CenterGearGroup());*/\n\t//\tchooser.addObject(\"Test Vision Auto\", new TurnTillPerpVision(true));\n\t//\tchooser.addObject(\"Testing turn gyro\", new RotateToGyroAngle(90,4));\n\t\t//chooser.addObject(\"DriveStraightTest\", new GoAndReturn());\n\t\t //UNNECESSARY AUTOS FOR TESTING ^\n\t\tchooser.addObject(\"Center Gear Encoder Auto (place)\", new DriveStraightCenter());\n\t\tchooser.addObject(\"Vision center TESTING!!!\", new TurnTillPerpVision());\n\t\tchooser.addObject(\"Boiler Auto RED\", new BoilerAuto(true));\n\t\tchooser.addObject(\"Boiler Auto BLUE\", new BoilerAuto(false));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t//\tchooser.addObject(\"Center Gear Encoder Auto (do not place )\", new DriveToFace(false, false, false));\n\t\tchooser.addObject(\"Baseline\", new DriveToLeftRightFace(false,false,false,false));\n\t\tchooser.addObject(\"TEST DRIVETANK AUTO\", new DriveTimedTank(0.7,0.7,5));\n\t\tchooser.addObject(\"Side Gear Auto RIGHT (manual straight lineup)(place)(TURN AFTER AND START CYCLE)\", new DriveStraightSide(true,false));\n\n\t\tchooser.addObject(\"Side Gear Auto LEFT (manual straight lineup)(place)(TURN AFTER AND START CYCLE)\", new DriveStraightSide(true,true));\n\t\t//chooser.addObject(\"Side Gear Auto (place)\", new DriveToLeftRightFace(true,false,false,false));\n\t\t//chooser.addObject(\"Test DriveStraight Auto\", new DriveStraightPosition(10,5));\n\t\t//chooser.addObject(\"Center Gear Encoder Auto (place)\", new DriveStraightCenter());\n\t\t/*InterpreterGroup interp = new InterpreterGroup();\n\t\t(interp.init()){\n\t\t\tchooser.addObject(\"Interpreter\",interp);\n\t\t}*/\n\t\t// chooser.addObject(\"My Auto\", new MyAutoCommand());\n\t\tSmartDashboard.putData(\"Auto Chooser\", chooser);\n\n\t\tRobot.drivebase.leftDrive1.setPosition(0);\n \tRobot.drivebase.rightDrive1.setPosition(0);\n \t\n\t\t\n \tRobot.leds.initializei2cBus();\n \tbyte mode = 0;\n \tRobot.leds.setMode(mode);\n \tgearcamera = CameraServer.getInstance();\n\t\t\n \tUsbCamera gearUsb = gearcamera.startAutomaticCapture();\n \tgearUsb.setFPS(25);\n \tgearUsb.setResolution(256, 144);\n\n\t\t//NetworkTable.setClientMode();\n \t//NetworkTable.setIPAddress(\"raspberrypi.local\");\n\t\t\n\t\t\n\t\t/*\n\t\t * new Thread(() -> { UsbCamera goalcamera =\n\t\t * CameraServer.getInstance().startAutomaticCapture();\n\t\t * goalcamera.setResolution(320, 240); goalcamera.setFPS(30);\n\t\t * goalcamera.setBrightness(1); goalcamera.setExposureManual(1);\n\t\t * \n\t\t * CvSink goalCvSink = CameraServer.getInstance().getVideo();\n\t\t * \n\t\t * Mat source = new Mat();\n\t\t * \n\t\t * while(!Thread.interrupted()) { goalCvSink.grabFrame(source);\n\t\t * goaloutputmat = source; } }).start();\n\t\t * goalPipeline.process(goaloutputmat);\n\t\t * \n\t\t * new Thread(() -> { UsbCamera gearcamera =\n\t\t * CameraServer.getInstance().startAutomaticCapture();\n\t\t * gearcamera.setResolution(320, 240); gearcamera.setFPS(30);\n\t\t * gearcamera.setBrightness(1); gearcamera.setExposureManual(1);\n\t\t * \n\t\t * CvSink gearCvSink = CameraServer.getInstance().getVideo();\n\t\t * \n\t\t * Mat source = new Mat();\n\t\t * \n\t\t * while(!Thread.interrupted()) { gearCvSink.grabFrame(source);\n\t\t * gearoutputmat = source; } }).start();\n\t\t * gearPipeline.process(gearoutputmat);\n\t\t */\n\t}", "protected void onTick() {\n\t\tif(car.drivingInfo.pathToGet.size() == 0 && car.carData.to == null) {\n\t\t\tcar.state = Car.WAIT_PASSENGER_TO_GO_INSIDE;\n\t\t\tSystem.out.println(\"engaged with from drive\" + car.engagedWithAID.toString());\n\t\t\tcar.addBehaviour(new TakePassenger());\n\t\t\tthis.stop();\n\t\t\treturn;\n\t\t}\n\t\t\t\t\n\t\tif(car.carData.to == null) {\n\t\t\tHouseData nextHouseToGo = car.drivingInfo.pathToGet.remove(0);\n\t\t\tcar.carData.to = nextHouseToGo;\n\t\t}\n\t\t\n\t\tint distanceDone = car.carData.distance;\n\t\tint distanceToDo = (int) SmaUtils.computeDistance(car.carData.from.position, car.carData.to.position);\n\t\t\n\t\t// if the distance left is higher than the distance the car can do in one tick, we increment the distance\n\t\tif(distanceDone+Car.CAR_SPEED < distanceToDo) {\n\t\t\tcar.carData.distance += Car.CAR_SPEED;\n\t\t\treturn;\n\t\t} \n\t\t// else, we put the car on the next house\n\t\telse if(distanceDone <= distanceToDo) {\n\t\t\tcar.carData.from = car.carData.to;\n\t\t\tcar.carData.to = null;\n\t\t\tcar.carData.distance = 0;\n\t\t\treturn;\n\t\t}\n\t}", "@Override\r\n public void update(Vehicle vehicle) {\n }", "private void updateVehicles() {\n OffloaderSyncAdapter.syncImmediately(getContext());\n Log.w(LOG_TAG, \"updateVehicles: \");\n }", "public void preform_action() {\n\t\tCarPanelState car_panel_state;\n\t\tSensorData sensor_data;\n\n\t\tint actuator_comp_time = 300;\n\t\tint actuator_deadline = 1000;\n\t\tNature actuator_nature = Task.Nature.APERIODIC;\n\t\tint actuator_movement_amount = 80;\n\n\t\tint closest = 100000;\n\n\t\tswitch (this.action) {\n\t\tcase SET_CAR_SPEED:\n\t\t\tSystem.out.println(\"set speed:\\t\" + this.set_point);\n\t\t\tthis.car_panel_controller.set_target_speed(this.set_point);\n\t\t\tbreak;\n\t\tcase MOVE_UP_CAR:\n\t\t\tSystem.out.println(\"Move_UP:\\t\" + this.set_point);\n\t\t\tthis.car_panel_controller.move_up(this.set_point);\n\t\t\tbreak;\n\t\tcase MOVE_DOWN_CAR:\n\t\t\tSystem.out.println(\"Move_DOWN:\\t\" + this.set_point);\n\t\t\tthis.car_panel_controller.move_down(this.set_point);\n\t\t\tbreak;\n\t\tcase READ_CONE_SENSOR:\n\t\t\tcar_panel_state = this.car_panel_controller.car_panel.getState();\n\t\t\tsensor_data = this.car_panel_controller.get_sensor_data();\n\n\t\t\tint move_up = 0;\n\t\t\tint move_down = 0;\n\n\t\t\tSystem.out.println(\"cone sensor:\\t\" + sensor_data.cone_sensor.cones);\n\n\t\t\t// what to do to avoid hitting the cone\n\t\t\t// if the bottom of the car will hit the cone, move up\n\t\t\tfor (Cone cone : sensor_data.cone_sensor.cones) {\n\t\t\t\tif (will_collide(car_panel_state.main_car, cone)) {\n\t\t\t\t\t// check if the top of the cone will hit the car\n\t\t\t\t\tif ((cone.y_pos < car_panel_state.main_car.y_pos + car_panel_state.main_car.height)\n\t\t\t\t\t\t\t&& (cone.y_pos > car_panel_state.main_car.y_pos)) {\n\t\t\t\t\t\t// the bottom of the car will hit, so move up\n\t\t\t\t\t\tmove_down++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// the top of the car will hit, so move down\n\t\t\t\t\t\t// this.processing_controller.add_task(task);\n\t\t\t\t\t\tmove_up++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// set the actuator deadline based on the closest cone\n\t\t\t\tif (cone.origional_x_pos < closest) {\n\t\t\t\t\tclosest = cone.origional_x_pos;\n\n\t\t\t\t\tint distance_from_cone = cone.origional_x_pos - car_panel_state.main_car.total_moved;\n\t\t\t\t\tint speed_by_tick = 1; // car_panel_state.main_car.speed /\n\t\t\t\t\t\t\t\t\t\t\t// CarPanelController.speed_increment;\n\n\t\t\t\t\tactuator_deadline = distance_from_cone / speed_by_tick;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// if we need to move decide what task we need to insert\n\t\t\tif (move_up + move_down > 0) {\n\t\t\t\t// see if more obstacles would be avoided by moving up or down\n\t\t\t\tif (move_down > move_up) {\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.MOVE_DOWN_CAR, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\t\tactuator_movement_amount);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t} else {\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.MOVE_UP_CAR, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\t\tactuator_movement_amount);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase READ_OTHER_CAR_SENSOR:\n\t\t\tcar_panel_state = this.car_panel_controller.car_panel.getState();\n\t\t\tsensor_data = this.car_panel_controller.get_sensor_data();\n\n\t\t\tmove_up = 0;\n\t\t\tmove_down = 0;\n\n\t\t\tSystem.out.println(\"car sensor:\\t\" + sensor_data.other_car_sensor.other_cars);\n\n\t\t\t// what to do to avoid hitting the cone\n\t\t\t// if the bottom of the car will hit the cone, move up\n\t\t\tfor (Car car : sensor_data.other_car_sensor.other_cars) {\n\t\t\t\tif (will_collide(car_panel_state.main_car, car)) {\n\t\t\t\t\t// check if the top of the cone will hit the car\n\t\t\t\t\tif ((car.y_pos < car_panel_state.main_car.y_pos + car_panel_state.main_car.height)\n\t\t\t\t\t\t\t&& (car.y_pos > car_panel_state.main_car.y_pos)) {\n\t\t\t\t\t\t// the bottom of the car will hit, so move up\n\t\t\t\t\t\tmove_down++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// the top of the car will hit, so move down\n\t\t\t\t\t\t// this.processing_controller.add_task(task);\n\t\t\t\t\t\tmove_up++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// set the actuator deadline based on the closest cone\n\t\t\t\tif (car.origional_x_pos < closest) {\n\t\t\t\t\tclosest = car.origional_x_pos;\n\n\t\t\t\t\tint distance_from_cone = car.origional_x_pos - car_panel_state.main_car.total_moved;\n\t\t\t\t\tint speed_by_tick = 1; // car_panel_state.main_car.speed /\n\t\t\t\t\t\t\t\t\t\t\t// CarPanelController.speed_increment;\n\n\t\t\t\t\tactuator_deadline = distance_from_cone / speed_by_tick;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// if we need to move decide what task we need to insert\n\t\t\tif (move_up + move_down > 0) {\n\t\t\t\t// see if more obstacles would be avoided by moving up or down\n\t\t\t\tif (move_down > move_up) {\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.MOVE_DOWN_CAR, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\t\tactuator_movement_amount);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t} else {\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.MOVE_UP_CAR, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\t\tactuator_movement_amount);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase READ_SPEED_SIGN_SENSOR:\n\t\t\tcar_panel_state = this.car_panel_controller.car_panel.getState();\n\t\t\tsensor_data = this.car_panel_controller.get_sensor_data();\n\n\t\t\tSystem.out.println(\"speed sensor:\\t\" + sensor_data.speed_sign_sensor.signs);\n\n\t\t\t// what to do to avoid hitting the cone\n\t\t\t// if the bottom of the car will hit the cone, move up\n\t\t\tfor (Sign sign : sensor_data.speed_sign_sensor.signs) {\n\t\t\t\t// check the distance to the sign. If the sign is within 300,\n\t\t\t\t// slow down\n\t\t\t\tint main_car_x = car_panel_state.main_car.origional_x_pos + car_panel_state.main_car.total_moved;\n\t\t\t\tif (sign.origional_x_pos - main_car_x < 1000) {\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.SET_CAR_SPEED, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\t\tsign.speed_limit);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t}\n\n\t\t\t\t// set the actuator deadline based on the closest cone\n\t\t\t\tif (sign.origional_x_pos < closest) {\n\t\t\t\t\tclosest = sign.origional_x_pos;\n\n\t\t\t\t\tint distance_from_cone = sign.origional_x_pos - car_panel_state.main_car.total_moved;\n\t\t\t\t\tint speed_by_tick = 1; // car_panel_state.main_car.speed /\n\t\t\t\t\t\t\t\t\t\t\t// CarPanelController.speed_increment;\n\n\t\t\t\t\tactuator_deadline = distance_from_cone / speed_by_tick;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase READ_STOP_SIGN_SENSOR:\n\t\t\tcar_panel_state = this.car_panel_controller.car_panel.getState();\n\t\t\tsensor_data = this.car_panel_controller.get_sensor_data();\n\n\t\t\tSystem.out.println(\"stop sensor:\\t\" + sensor_data.stop_sign_sensor.signs);\n\n\t\t\t// what to do to avoid hitting the cone\n\t\t\t// if the bottom of the car will hit the cone, move up\n\t\t\tfor (Sign sign : sensor_data.stop_sign_sensor.signs) {\n\t\t\t\t// check the distance to the sign. If the sign is within 300,\n\t\t\t\t// slow down\n\t\t\t\tint main_car_x = car_panel_state.main_car.origional_x_pos + car_panel_state.main_car.total_moved;\n\t\t\t\tif (sign.origional_x_pos - main_car_x < 500) {\n\t\t\t\t\t// submit a task to stop at the stop sign\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.SET_CAR_SPEED, this.processing_controller, this.car_panel_controller, 0);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\n\t\t\t\t\t// submit a task to start moving again\n\t\t\t\t\ttask = new Task(actuator_comp_time * 100, 0, actuator_deadline * 100, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.SET_CAR_SPEED, this.processing_controller, this.car_panel_controller, 50);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t}\n\n\t\t\t\t// set the actuator deadline based on the closest cone\n\t\t\t\tif (sign.origional_x_pos < closest) {\n\t\t\t\t\tclosest = sign.origional_x_pos;\n\n\t\t\t\t\tint distance_from_cone = sign.origional_x_pos - car_panel_state.main_car.total_moved;\n\t\t\t\t\tint speed_by_tick = 1; // car_panel_state.main_car.speed /\n\t\t\t\t\t\t\t\t\t\t\t// CarPanelController.speed_increment;\n\n\t\t\t\t\tactuator_deadline = distance_from_cone / speed_by_tick;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase READ_LANE_SENSOR:\n\t\t\tcar_panel_state = this.car_panel_controller.car_panel.getState();\n\t\t\tsensor_data = this.car_panel_controller.get_sensor_data();\n\n\t\t\tSystem.out.println(\"lane sensor:\\t\" + sensor_data.lane_sensor.within_lane);\n\n\t\t\t// if we aren't within our lane\n\t\t\tif (sensor_data.lane_sensor.within_lane == false) {\n\t\t\t\t// move back to origional y position\n\t\t\t\tint main_car_y_offset = car_panel_state.main_car.origional_y_pos - car_panel_state.main_car.y_pos;\n\t\t\t\t// if car below where it should be\n\n\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\tTask.Action.MOVE_DOWN_CAR, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\tmain_car_y_offset);\n\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\t}", "@Override\r\n\tpublic void carDriveModeChange() {\n\t\t\r\n\t}", "@Override\n\tpublic void carEngine() {\n\n\t}", "public void autoUpdate()\n {\n if(distanceSensor.checkDistance() < 300 && myRobot.getAutoDrive())\n {\n activateDumpSolenoid(forward);\n myRobot.setAutoDoneTrue();\n }\n\n //closes the ball tray after doing autonomous\n if(distanceSensor.checkDistance() > 900 && myRobot.getAutoDrive())\n {\n activateDumpSolenoid(reverse);\n }\n }", "@Override\n public void robotInit() {\n m_oi = new OI();\n m_chooser.setDefaultOption(\"Default Auto\", new ExampleCommand());\n // chooser.addOption(\"My Auto\", new MyAutoCommand());\n SmartDashboard.putData(\"Auto mode\", m_chooser);\n\n Comp = new Compressor();\n\n //ClimbBack = new DoubleSolenoid(PCM_COMP_24V, 0, 1);\n //ClimbFront = new DoubleSolenoid(PCM_COMP_24V, 2, 3);\n LegFrontL = new VictorSPX(30);\n LegFrontR = new Spark(9);\n LegBackL = new VictorSPX(31);\n LegBackR = new VictorSPX(32);\n\n BackFootMover = new VictorSP(1);\n FrontFootMover = new Spark(2);\n //FeetMovers = new SpeedControllerGroup(BackFootMoverFootMover);\n\n MainRight = new CANSparkMax(9, MotorType.kBrushless);\n AltRight = new CANSparkMax(10, MotorType.kBrushless);\n MainLeft = new CANSparkMax(11, MotorType.kBrushless);\n AltLeft = new CANSparkMax(12, MotorType.kBrushless);\n\n MainRight.setIdleMode(IdleMode.kCoast);\n AltRight.setIdleMode(IdleMode.kCoast);\n MainLeft.setIdleMode(IdleMode.kCoast);\n AltLeft.setIdleMode(IdleMode.kCoast);\n\n AltLeft.follow(MainLeft);\n AltRight.follow(MainRight);\n\n Drive = new DifferentialDrive(MainLeft, MainRight);\n\n Lifter = new TalonSRX(6);\n Lifter.setNeutralMode(NeutralMode.Brake);\n Lifter.enableCurrentLimit(false);\n /*Lifter.configContinuousCurrentLimit(40);\n Lifter.configPeakCurrentLimit(50);\n Lifter.configPeakCurrentDuration(1500);*/\n //Lifter.configReverseSoftLimitEnable(true);\n //Lifter.configReverseSoftLimitThreshold(-27000);\n //Lifter.configForwardLimitSwitchSource(LimitSwitchSource.FeedbackConnector, LimitSwitchNormal.NormallyOpen);\n //Lifter.configClearPositionOnLimitF(true, 0);\n Lifter.selectProfileSlot(0, 0);\n LiftSetpoint = 0;\n\n LiftFollower = new TalonSRX(5);\n LiftFollower.follow(Lifter);\n LiftFollower.setNeutralMode(NeutralMode.Brake);\n\n ArmExtender = new Solenoid(0);\n ArmOpener = new Solenoid(1);\n ArmGrippers = new Spark(0);\n\n HatchSwitch0 = new DigitalInput(0);\n HatchSwitch1 = new DigitalInput(1);\n\n Accel = new BuiltInAccelerometer(Range.k2G);\n\n //Diagnostics = new DiagnosticsLogger();\n // Uncomment this line to enable diagnostics. Warning: this may\n // cause the robot to be slower than it is supposed to be because of lag.\n //Diagnostics.start();\n\n xbox = new XboxController(0);\n joystick = new Joystick(1);\n \n LiftRamp = new SRamp();\n SpeedRamp = new SRamp();\n\n NetworkTableInstance nt = NetworkTableInstance.getDefault();\n\n VisionTable = nt.getTable(\"ChickenVision\");\n TapeDetectedEntry = VisionTable.getEntry(\"tapeDetected\");\n TapePitchEntry = VisionTable.getEntry(\"tapePitch\");\n TapeYawEntry = VisionTable.getEntry(\"tapeYaw\");\n\n LedTable = nt.getTable(\"LedInfo\");\n LedScript = LedTable.getEntry(\"CurrentScript\");\n LedScriptArgument = LedTable.getEntry(\"ScriptArgument\");\n LedArmsClosed = LedTable.getEntry(\"ArmsClosed\");\n\n UsbCamera cam = CameraServer.getInstance().startAutomaticCapture();\n cam.setPixelFormat(PixelFormat.kMJPEG);\n cam.setResolution(320, 240);\n cam.setFPS(15);\n \n\n LedScript.setString(\"ColorWaves\");\n LedScriptArgument.setString(\"\");\n\n limits = new DigitalInput[8];\n\n for (int i = 0; i < limits.length; i++) {\n limits[i] = new DigitalInput(i + 2);\n }\n }", "@Override\r\n\tpublic ObjectList<CarControl> drive(State<CarRpmState, CarControl> state) {\n\t\tdouble steer = state.state.getAngleToTrackAxis()/SimpleDriver.steerLock;\r\n//\t\tdouble speed = state.state.getSpeed();\t\t\r\n\t\tObjectList<CarControl> ol = new ObjectArrayList<CarControl>();\t\t\r\n\r\n\t\t/*if (state.state.getSpeed()>=296.8 || state.state.gear==6){\r\n\t\t\tfor (int i =0;i<1;++i){\r\n\t\t\t\tCarControl cc = new CarControl(1.0d,0,6,steer,0);\r\n\t\t\t\tol.add(cc);\r\n\t\t\t}\r\n\t\t} else if (state.state.getSpeed()>=225 || state.state.gear==5){\r\n\t\t\tfor (int i =0;i<1;++i){\r\n\t\t\t\tCarControl cc = new CarControl(1.0d,0,5,steer,0);\r\n\t\t\t\tol.add(cc);\r\n\t\t\t}\r\n\t\t} else if (state.state.getSpeed()>=176 || state.state.gear==4){\r\n\t\t\tfor (int i =0;i<1;++i){\r\n\t\t\t\tCarControl cc = new CarControl(1.0d,0,4,steer,0);\r\n\t\t\t\tol.add(cc);\r\n\t\t\t}\r\n\t\t} else if (state.state.getSpeed()>=126 || state.state.gear==3){\r\n\t\t\tfor (int i =0;i<1;++i){\r\n\t\t\t\tCarControl cc = new CarControl(1.0d,0,3,steer,0);\r\n\t\t\t\tol.add(cc);\r\n\t\t\t}\r\n\t\t} else if (state.state.getSpeed()>=83){\r\n\t\t\tfor (int i =0;i<1;++i){\r\n\t\t\t\tCarControl cc = new CarControl(1.0d,0,2,steer,0);\r\n\t\t\t\tol.add(cc);\r\n\t\t\t}\r\n\t\t} else \t{\r\n\t\t\tCarControl cc = new CarControl(1.0d,0,1,steer,0);\r\n\t\t\tol.add(cc);\r\n\t\t}//*/\r\n//\t\tif (speed>225){\r\n//\t\t\tCarControl cc = new CarControl(0,1,4,steer,0);\r\n//\t\t\tol.add(cc);\r\n//\t\t} else if (speed>126){\r\n//\t\t\tCarControl cc = new CarControl(0,0.569,3,steer,0);\r\n//\t\t\tol.add(cc);\r\n//\t\t} else if (speed>83){\r\n//\t\t\tCarControl cc = new CarControl(0,0.363,2,steer,0);\r\n//\t\t\tol.add(cc);\r\n//\t\t} else {\r\n//\t\t\tCarControl cc = new CarControl(0,0.36,1,steer,0);\r\n//\t\t\tol.add(cc);\r\n//\t\t}\r\n//\t\tif (speed<226.541 && speed>200){\r\n//\t\t\tol.clear();\r\n//\t\t\tCarControl cc = new CarControl(0,0.6,4,steer,0);\r\n//\t\t\tol.add(cc);\r\n//\t\t}\r\n\t\t//}//*/ \r\n\t\t/*if (speed<3*3.6){\r\n\t\t\tCarControl cc = new CarControl(0,1.0d,0,steer,0);\r\n\t\t\tol.add(cc);\r\n\t\t\tbrake = 1;\r\n\t\t\treturn ol;\r\n\t\t}\r\n\t\tdouble[] wheelVel = state.state.getWheelSpinVel();\r\n\t\t// convert speed to m/s\r\n\t\t\t\t\r\n\t\t// when spedd lower than min speed for abs do nothing\t\t\r\n\r\n\t\t// compute the speed of wheels in m/s\r\n\t\tdouble slip = 0.0d;\t \r\n\t\tfor (int i = 0; i < 4; i++)\t{\r\n\t\t\tslip += wheelVel[i] * SimpleDriver.wheelRadius[i]/speed;\t\t\t\r\n\t\t}\r\n\t\tslip/=4;\t\t\t\r\n\t\tif (slip==0){\r\n\t\t\tbrake = 0.25;\r\n\t\t} if (slip < 0.1) \r\n\t\t\tbrake = 0.4+slip;\r\n\t\telse brake=1;\r\n\t\tif (brake<=0.09) brake=1;\r\n\t\tbrake = Math.min(1.0, brake);\r\n\t\tSystem.out.println(slip+\" \"+brake);\r\n\t\tCarControl cc = new CarControl(0,brake,0,steer,0);\r\n\t\tol.add(cc);//*/\r\n\t\tCarControl cc = new CarControl(0,1.0d,0,steer,0);\r\n\t\tol.add(cc);\r\n\t\treturn ol;\r\n\t}", "public void robotInit() {\n chooser = new SendableChooser();\n chooser.addDefault(\"Default Auto\", defaultAuto);\n chooser.addObject(\"My Auto\", customAuto);\n SmartDashboard.putData(\"Auto choices\", chooser);\n \n // camera stuff\n robotCamera = CameraServer.getInstance();\n robotCamera.setQuality(50);\n robotCamera.startAutomaticCapture(\"cam0\");\n\n //our robot stuff\n // myChassis\t= new RobotDrive(0,1);\n leftSide\t= new VictorSP(1);\n rightSide\t= new VictorSP(0);\n spinWheels\t= new TalonSRX(2);\n armLifty\t= new TalonSRX(3);\n drivePad\t= new Joystick(0);\n statesPad\t= new Joystick(1);\n LiveWindow.addActuator(\"stud\", \"talonsrx\", armLifty);\n \n //arm position stuff\n armPosition\t\t= new AnalogInput(0);\n armPortSwitch\t= new DigitalInput(0);\n \n //solenoid stuff\n //solenoidThing = new Solenoid(1);\n \n //init button states\n lBPX\t\t\t= false;\n bIPX\t\t\t= false;\n \n //driver buttons\n ballSpitButton\t= 4;\n ballSuckButton\t= 2;\n \n //state machine variables\n defaultState\t\t= 0;\n portState\t\t\t= 1;\n chevellState\t\t= 2;\n ballGrabState\t\t= 10;\n driveState\t\t\t= 11;\n lowBarState\t\t\t= 8;\n rockState\t\t\t= driveState;\n roughState\t\t\t= driveState;\n moatState\t\t\t= driveState;\n rampartState\t\t= driveState;\n drawState\t\t\t= driveState;\n sallyState\t\t\t= driveState;\n liftOverride\t\t= 0.09;\n terrainStates\t\t= 0;\n autoLiftSpeed\t\t= 1.0;\n armLiftBuffer\t\t= 0.01;\n //port state variables\n portPosition1\t\t= 1.7;\n portPosition2\t\t= 0.9;\n portSwitch\t\t\t= 0;\n //chevell state variables\n chevellPosition1\t= 1.135;\n chevellPosition2\t= 2.0;\n chevellSwitch \t\t= 0;\n chevellWheelSpeed\t= 0.3;\n //ball grab state variables\n ballGrabPosition1\t= 1.35;\n ballGrabSwitch\t\t= 0;\n ballGrabWheelSpeed\t= -0.635;\n ballSpitWheelSpeed\t= 1.0;\n //lowbar state variables\n lowBarPosition\t\t= 1.6;\n lowBarSwitch\t\t= 0;\n //drive state variables\n driveSwitch\t\t\t= 1;\n \n }", "public void initialize() {\n leftfrontmotor.setIdleMode(CANSparkMax.IdleMode.kBrake);\n leftrearmotor.setIdleMode(CANSparkMax.IdleMode.kBrake);\n rightfrontmotor.setIdleMode(CANSparkMax.IdleMode.kBrake);\n rightrearmotor.setIdleMode(CANSparkMax.IdleMode.kBrake);\n\n leftfrontmotor.setOpenLoopRampRate(Constants.DriveBase.MotorControllers.openramprate);\n leftrearmotor.setOpenLoopRampRate(Constants.DriveBase.MotorControllers.openramprate);\n rightfrontmotor.setOpenLoopRampRate(Constants.DriveBase.MotorControllers.openramprate);\n rightrearmotor.setOpenLoopRampRate(Constants.DriveBase.MotorControllers.openramprate);\n \n\n // More Motor Tunes (to occur during each initialization period):\n leftfrontmotor.getEncoder().setPositionConversionFactor(Constants.DriveBase.Encoders.encoderconversion);\n leftrearmotor.getEncoder().setPositionConversionFactor(Constants.DriveBase.Encoders.encoderconversion);\n rightfrontmotor.getEncoder().setPositionConversionFactor(Constants.DriveBase.Encoders.encoderconversion);\n rightrearmotor.getEncoder().setPositionConversionFactor(Constants.DriveBase.Encoders.encoderconversion);\n\n turnController.setSetpoint(Constants.DriveBase.Controllers.zero);\n turnController.setTolerance(Constants.DriveBase.Controllers.turntollerance);\n\n driveController.setSetpoint(Constants.DriveBase.Controllers.zero);\n driveController.setTolerance(Constants.DriveBase.Controllers.drivetollerance);\n\n ballTurnController.setSetpoint(Constants.DriveBase.Controllers.zero);\n ballTurnController.setTolerance(Constants.DriveBase.Controllers.balltollerance);\n\n ballDriveController.setSetpoint(Constants.DriveBase.Controllers.balldrive);\n ballDriveController.setTolerance(Constants.DriveBase.Controllers.balldrivetollerance);\n \n reset();\n }", "@Override\n\tpublic void autonomousInit() {\n\t\tvision_.startGearLiftTracker(15);\n\t\tgyro_.reset();\n\t\tautoCommand = (Command) autoChooser.getSelected();\n\t\tif(autoCommand != null)\n\t\t{\n\t\t\tautoCommand.start();\n\t\t}\n\t}", "public void update() {\n\t\tif (!uiDone)\n\t\t\tinitializeUI();\n\t\t\n Vehicle vehicle = (Vehicle) unit;\n\n // Update driver button if necessary.\n boolean driverChange = false;\n if (driverCache == null) {\n if (vehicle.getOperator() != null) driverChange = true;\n }\n else if (!driverCache.equals(vehicle.getOperator())) driverChange = true;\n if (driverChange) {\n driverCache = vehicle.getOperator();\n if (driverCache == null) {\n driverButton.setVisible(false);\n }\n else {\n driverButton.setVisible(true);\n driverButton.setText(driverCache.getOperatorName());\n }\n }\n\n // Update status label\n if (!vehicle.sameStatusTypes(statusCache, vehicle.getStatusTypes())) {\n statusCache = vehicle.getStatusTypes();\n statusLabel.setText(vehicle.printStatusTypes());\n }\n\n // Update beacon label\n if (beaconCache != vehicle.isBeaconOn()) {\n \tbeaconCache = vehicle.isBeaconOn();\n \tif (beaconCache) beaconLabel.setText(\"On\");\n \telse beaconLabel.setText(\"Off\");\n }\n\n // Update speed label\n if (speedCache != vehicle.getSpeed()) {\n speedCache = vehicle.getSpeed();\n speedLabel.setText(\"\" + formatter.format(speedCache) + \" km/h\");\n }\n\n // Update elevation label if ground vehicle.\n if (vehicle instanceof GroundVehicle) {\n GroundVehicle gVehicle = (GroundVehicle) vehicle;\n double currentElevation = gVehicle.getElevation();\n if (elevationCache != currentElevation) {\n elevationCache = currentElevation;\n elevationLabel.setText(formatter.format(elevationCache) + \" km\");\n }\n }\n\n Mission mission = missionManager.getMissionForVehicle(vehicle);\n \n boolean hasDestination = false;\n \t\t\n if ((mission != null) && (mission instanceof VehicleMission)\n && ((VehicleMission) mission).getTravelStatus().equals(TravelMission.TRAVEL_TO_NAVPOINT)) {\n \tNavPoint destinationPoint = ((VehicleMission) mission).getNextNavpoint();\n \t\n \thasDestination = true;\n \t\n \tif (destinationPoint.isSettlementAtNavpoint()) {\n \t\t// If destination is settlement, update destination button.\n \t\tif (destinationSettlementCache != destinationPoint.getSettlement()) {\n \t\t\tdestinationSettlementCache = destinationPoint.getSettlement();\n \t\t\tdestinationButton.setText(destinationSettlementCache.getName());\n \t\t\taddDestinationButton();\n \t\t\tdestinationTextCache = \"\";\n \t\t}\n \t}\n \telse {\n// \t\tif (destinationTextCache != \"\") {\n \t\t\t// If destination is coordinates, update destination text label.\n \t\t\tdestinationTextCache = Conversion.capitalize(destinationPoint.getDescription());//\"A Navpoint\";\n \t\t\tdestinationTextLabel.setText(destinationTextCache);\n \t\t\taddDestinationTextLabel();\n destinationSettlementCache = null;\n// \t\t}\n \t}\n }\n \n if (!hasDestination) {\n \t// If destination is none, update destination text label.\n \tif (destinationTextCache != \"\") {\n \t\tdestinationTextCache = \"\";\n \t\tdestinationTextLabel.setText(destinationTextCache);\n \t\taddDestinationTextLabel();\n \t\tdestinationSettlementCache = null;\n \t}\n }\n \n\n // Update latitude and longitude panels if necessary.\n if ((mission != null) && (mission instanceof VehicleMission)\n && ((VehicleMission) mission).getTravelStatus().equals(TravelMission.TRAVEL_TO_NAVPOINT)) {\n VehicleMission vehicleMission = (VehicleMission) mission;\n \tif (destinationLocationCache == null)\n \t\tdestinationLocationCache = new Coordinates(vehicleMission.getNextNavpoint().getLocation());\n \telse \n \t\tdestinationLocationCache.setCoords(vehicleMission.getNextNavpoint().getLocation());\n destinationLatitudeLabel.setText(\"\" +\n destinationLocationCache.getFormattedLatitudeString());\n destinationLongitudeLabel.setText(\"\" +\n destinationLocationCache.getFormattedLongitudeString());\n }\n else {\n \tif (destinationLocationCache != null) {\n \t\tdestinationLocationCache = null;\n destinationLatitudeLabel.setText(\"\");\n destinationLongitudeLabel.setText(\"\");\n \t}\n }\n\n // Update distance to destination if necessary.\n if ((mission != null) && (mission instanceof VehicleMission)) {\n VehicleMission vehicleMission = (VehicleMission) mission;\n \ttry {\n \t\tif (distanceCache != vehicleMission.getCurrentLegRemainingDistance()) {\n \t\t\tdistanceCache = vehicleMission.getCurrentLegRemainingDistance();\n \t\t\tdistanceLabel.setText(\"\" + formatter.format(distanceCache) + \" km\");\n \t\t}\n \t}\n \tcatch (Exception e) {\n \t\tlogger.log(Level.SEVERE,\"Error getting current leg remaining distance.\");\n \t\t\te.printStackTrace(System.err);\n \t}\n }\n else {\n \tdistanceCache = 0D;\n \tdistanceLabel.setText(\"\");\n }\n\n // Update ETA if necessary\n if ((mission != null) && (mission instanceof VehicleMission)) {\n VehicleMission vehicleMission = (VehicleMission) mission;\n if (vehicleMission.getLegETA() != null) {\n if (!etaCache.equals(vehicleMission.getLegETA().toString())) {\n etaCache = vehicleMission.getLegETA().toString();\n etaLabel.setText(\"\" + etaCache);\n }\n }\n }\n else {\n \tetaCache = \"\";\n \tetaLabel.setText(\"\");\n }\n\n // Update direction display\n directionDisplay.update();\n\n // Update terrain display\n terrainDisplay.update();\n }", "public static void driveMode(){\n\n\t\tSmartDashboard.putBoolean(\"Is Climbing:\", TalonDio.climbEncodDio(Actuators.getClimbMotor()));\n\t\tSmartDashboard.putBoolean(\"Is Driving:\", TalonDio.driveEncodDio(Actuators.getLeftDriveMotor(), Actuators.getRightDriveMotor()));\n\t\tSmartDashboard.putBoolean(\"Is Intake Disabled:\", Intake.intakeDisabled);\n\t\tSmartDashboard.putNumber(\"motorSpeed\", Intake.intakeMotorSpeed);\n\t\tSmartDashboard.putNumber(\"conveyorMotorSpeed\", Score.conveyorMotorSpeed);\n\t\tSmartDashboard.putBoolean(\"Intake Motor Inverted?:\", Actuators.getFuelIntakeMotor().getInverted());\n\t\tSmartDashboard.putBoolean(\"Is Climbing Motor Stalling:\", TalonDio.CIMStall(Actuators.getClimbMotor()));\n\n\t\t\n\n\t\tSmartDashboard.putBoolean(\"Is Climbing:\", TalonDio.climbEncodDio(Actuators.getClimbMotor()));\n\t\tSmartDashboard.putBoolean(\"Is Driving:\", TalonDio.driveEncodDio(Actuators.getLeftDriveMotor(), Actuators.getRightDriveMotor()));\n\t\tSmartDashboard.putBoolean(\"Is Climbing Motor Stalling:\", TalonDio.CIMStall(Actuators.getClimbMotor()));\n\t\tSmartDashboard.putNumber(\"Total Current Draw:\", SensorsDio.PDPCurrent(Sensors.getPowerDistro()));\n\n\t\n\t//TODO: Add Gear Vibrations for both controllers\n\t//Vibration Feedback\n\t\t//Sets the Secondary to vibrate if climbing motor is going to stall\n\t\tVibrations.climbStallVibrate(Constants.MAX_RUMBLE);\t\n\t\t//If within the second of TIME_RUMBLE then both controllers are set to HALF_RUMBLE\n\t\tVibrations.timeLeftVibrate(Constants.HALF_RUMBLE, Constants.TIME_RUMBLE);\t\n\t\t\n\t}", "@Override \n public void runOpMode() \n {\n leftMotors = hardwareMap.get(DcMotor.class, \"left_Motors\");\n rightMotors = hardwareMap.get(DcMotor.class, \"right_Motors\");\n vLiftMotor = hardwareMap.get(DcMotor.class, \"vLift_Motor\"); \n \n leftMotors.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n rightMotors.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n leftMotors.setDirection(DcMotor.Direction.REVERSE);\n rightMotors.setDirection(DcMotor.Direction.FORWARD);\n vLiftMotor.setDirection(DcMotor.Direction.REVERSE);\n vLiftMotor.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n \n waitForStart(); //press play button, actives opMode\n intakePivotServo.setPosition(intakePivotServoPos);\n while (opModeIsActive()) \n { \n drive();\n pivotIntake();\n pivotLift();\n \n }//opModeIsActive \n \n }", "@Override\n public void init() {\n telemetry.addData(\"Status\", \"Initializing\"); //display on the drivers phone that its working\n\n FLM = hardwareMap.get(DcMotor.class, \"FLM\"); //Go into the config and get the device named \"FLM\" and assign it to FLM\n FRM = hardwareMap.get(DcMotor.class, \"FRM\"); //device name doesn't have to be the same as the variable name\n BLM = hardwareMap.get(DcMotor.class, \"BLM\"); //DcMotor.class because that is what the object is\n BRM = hardwareMap.get(DcMotor.class, \"BRM\");\n\n BigSuck = hardwareMap.get(DcMotor.class, \"BigSUCK\");\n SmallSuck = hardwareMap.get(DcMotor.class, \"SmallSUCK\");\n SmallSuck.setDirection(DcMotor.Direction.REVERSE);\n \n UpLift = hardwareMap.get(DcMotor.class, \"LIFT\");\n UpLift.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n UpLift.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n //Make it so we don't have to add flip the sign of the power we are setting to half the motors\n //FRM.setDirection(DcMotor.Direction.REVERSE); //Run the right side of the robot backwards\n FLM.setDirection(DcMotor.Direction.REVERSE);\n BRM.setDirection(DcMotor.Direction.REVERSE); //the right motors are facing differently than the left handed ones\n\n FLM.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n FRM.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n BLM.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n BRM.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n DragArm = hardwareMap.servo.get(\"drag_arm\");\n DragArm.setDirection(Servo.Direction.REVERSE);\n DragArm.setPosition(DragArmRestPosition);\n\n LiftGrab = hardwareMap.servo.get(\"GRAB\");\n LiftGrab.setPosition(LiftGrabRestPosition);\n\n LiftSwivel = hardwareMap.servo.get(\"SWIVEL\");\n LiftSwivel.setPosition(LiftSwivelRestPosition);\n\n Push = hardwareMap.get(Servo.class, \"PUSH\");\n Push.setDirection(Servo.Direction.FORWARD);\n Push.setPosition(PushRestPosition);\n\n telemetry.addData(\"Status\", \"Initialized\");\n telemetry.update();\n }", "void do_physics(CAR car, double delta_t) {\n// sn = Math.sin(car.angle);\n// cs = Math.cos(car.angle);\n//\n// velocity.x = cs * car.velocity_wc.y + sn * car.velocity_wc.x;\n// velocity.y = cs * car.velocity_wc.x - sn * car.velocity_wc.y;\n//\n// double yawSpeed = 0.5 * car.cartype.wheelbase * car.angularvelocity;\n//\n// double rotationAngle = 0;\n// double sideSlip = 0;\n// if (velocity.x != 0) {\n// //car is moving forwards\n// rotationAngle = Math.atan(yawSpeed / velocity.x);\n// }\n//\n// if (velocity.x != 0) {\n// sideSlip = Math.atan(velocity.y / velocity.x);\n// }\n//\n// if (velocity.x == 0) {\n// car.angularvelocity = 0;\n// }\n//\n//\n// double slipAngleFront = sideSlip + rotationAngle - car.steerangle;\n// double slipAngleRear = sideSlip - rotationAngle;\n//\n// // weight per axle = half car mass times 1G (=9.8m/s^2)\n// double weight = car.cartype.mass * 9.8 * 0.5;\n//\n// Vector2D frontWheelLateralForce = new Vector2D();\n// frontWheelLateralForce.setX(0);\n// frontWheelLateralForce.setY(normalise(-MAX_GRIP, MAX_GRIP, CA_F * slipAngleFront));\n// frontWheelLateralForce.setY(frontWheelLateralForce.getY() * weight);\n//\n// if (front_slip == 1) {\n// frontWheelLateralForce.setY(frontWheelLateralForce.getY() * 0.5d);\n// }\n//\n// Vector2D rearWheelLateralForce = new Vector2D();\n// rearWheelLateralForce.setX(0);\n// rearWheelLateralForce.setY(normalise(-MAX_GRIP, MAX_GRIP, CA_R * slipAngleRear));\n// rearWheelLateralForce.setY(rearWheelLateralForce.getY() * weight);\n//\n// if (rear_slip == 1) {\n// rearWheelLateralForce.setY(rearWheelLateralForce.getY() * 0.5d);\n// }\n//\n//\n// Vector2D tractionForce = new Vector2D();\n// tractionForce.setX(100 * (car.throttle - car.brake * SGN(velocity.x)));\n// tractionForce.setY(0);\n//\n// if (rear_slip == 1) {\n// tractionForce.setX(tractionForce.getX() * 0.5d);\n// }\n//\n// Vector2D resistance = new Vector2D();\n// double rollingResistanceX = -RESISTANCE * velocity.x;\n// double rollingResistanceY = -RESISTANCE * velocity.y;\n// double dragResistanceX = -DRAG * velocity.x * ABS(velocity.x);\n// double dragResistanceY = -DRAG * velocity.y * ABS(velocity.y);\n// resistance.setX(rollingResistanceX + dragResistanceX);\n// resistance.setY(rollingResistanceY + dragResistanceY);\n//\n// // sum forces\n// Vector2D totalForce = new Vector2D();\n// double frontWheelLateralX = Math.sin(car.steerangle) * frontWheelLateralForce.getX();\n// double rearWheelLateralX = rearWheelLateralForce.getX();\n// double frontWheelLateralY = Math.cos(car.steerangle) * frontWheelLateralForce.getY();\n// double rearWheelLateralY = rearWheelLateralForce.getY();\n//\n// totalForce.setX(tractionForce.getX() + frontWheelLateralX + rearWheelLateralX + resistance.getX());\n// totalForce.setY(tractionForce.getY() + frontWheelLateralY + rearWheelLateralY + resistance.getY());\n//\n//\n// double frontTorque = frontWheelLateralForce.getY() * car.cartype.b;\n// double rearTorque = rearWheelLateralForce.getY() * car.cartype.c;\n// double torque = frontTorque - rearTorque;\n//\n// Vector2D acceleration = new Vector2D();\n// acceleration.setX(totalForce.getX() / car.cartype.mass);\n// acceleration.setY(totalForce.getY() / car.cartype.mass);\n// // Newton F = m.a, therefore a = F/m\n// //TODO: add inertia to the vehicle\n// double angularAcceleration = torque / car.cartype.inertia;\n//\n// acceleration.setX(normalise(acceleration.getX(), 0.1d));\n// acceleration.setY(normalise(acceleration.getY(), 0.1d));\n//\n//\n// Vector2D worldReferenceAcceleration = new Vector2D();\n// worldReferenceAcceleration.setX(cs * acceleration.getY() + sn * acceleration.getX());\n// worldReferenceAcceleration.setY(-sn * acceleration.getY() + cs * acceleration.getX());\n//\n// // velocity is integrated acceleration\n// Vector2D worldReferenceVelocity = new Vector2D();\n// worldReferenceVelocity.setX(car.velocity_wc.x + (delta_t * worldReferenceAcceleration.getX()));\n// worldReferenceVelocity.setY(car.velocity_wc.y + (delta_t * worldReferenceAcceleration.getY()));\n//\n// // position is integrated velocity\n// Vector2D newPosition = new Vector2D();\n// newPosition.setX(delta_t * worldReferenceVelocity.getX() + car.position_wc.x);\n// newPosition.setY(delta_t * worldReferenceVelocity.getY() + car.position_wc.y);\n//\n//\n// car.velocity_wc.x = normalise(worldReferenceVelocity.getX(), 0.1d);\n// car.velocity_wc.y = normalise(worldReferenceVelocity.getY(), 0.1d);\n//\n// if (car.velocity_wc.x == 0 && car.velocity_wc.y == 0) {\n// car.angularvelocity = 0;\n// } else {\n// car.angularvelocity += delta_t * angularAcceleration;\n// }\n//\n// car.angle += delta_t * car.angularvelocity;\n// car.position_wc.x = newPosition.getX();\n// car.position_wc.y = newPosition.getY();\n//\n// /**\n\n sn = Math.sin(car.angle);\n cs = Math.cos(car.angle);\n\n // SAE convention: x is to the front of the car, y is to the right, z is down\n // transform velocity in world reference frame to velocity in car reference frame\n velocity.x = cs * car.velocity_wc.y + sn * car.velocity_wc.x;\n velocity.y = -sn * car.velocity_wc.y + cs * car.velocity_wc.x;\n\n // Lateral force on wheels\n //\n // Resulting velocity of the wheels as result of the yaw rate of the car body\n // v = yawrate * r where r is distance of wheel to CG (approx. half wheel base)\n // yawrate (ang.velocity) must be in rad/s\n //\n yawspeed = car.cartype.wheelbase * 0.5 * car.angularvelocity;\n\n if (velocity.x == 0) // TODO: fix Math.singularity\n rot_angle = 0;\n else\n rot_angle = Math.atan(yawspeed / velocity.x);\n // Calculate the side slip angle of the car (a.k.a. beta)\n if (velocity.x == 0) // TODO: fix Math.singularity\n sideslip = 0;\n else\n sideslip = Math.atan(velocity.y / velocity.x);\n\n // Calculate slip angles for front and rear wheels (a.k.a. alpha)\n slipanglefront = sideslip + rot_angle - car.steerangle;\n slipanglerear = sideslip - rot_angle;\n\n // weight per axle = half car mass times 1G (=9.8m/s^2)\n weight = car.cartype.mass * 9.8 * 0.5;\n\n // lateral force on front wheels = (Ca * slip angle) capped to friction circle * load\n flatf.x = 0;\n flatf.y = CA_F * slipanglefront;\n flatf.y = Math.min(MAX_GRIP, flatf.y);\n flatf.y = Math.max(-MAX_GRIP, flatf.y);\n flatf.y *= weight;\n if (front_slip == 1)\n flatf.y *= 0.5;\n\n // lateral force on rear wheels\n flatr.x = 0;\n flatr.y = CA_R * slipanglerear;\n flatr.y = Math.min(MAX_GRIP, flatr.y);\n flatr.y = Math.max(-MAX_GRIP, flatr.y);\n flatr.y *= weight;\n if (rear_slip == 1)\n flatr.y *= 0.5;\n\n // longtitudinal force on rear wheels - very simple traction model\n ftraction.x = 100 * (car.throttle - car.brake * SGN(velocity.x));\n ftraction.y = 0;\n if (rear_slip == 1)\n ftraction.x *= 0.5;\n\n // Forces and torque on body\n\n // drag and rolling resistance\n resistance.x = -(RESISTANCE * velocity.x + DRAG * velocity.x * ABS(velocity.x));\n resistance.y = -(RESISTANCE * velocity.y + DRAG * velocity.y * ABS(velocity.y));\n\n // sum forces\n force.x = ftraction.x + Math.sin(car.steerangle) * flatf.x + flatr.x + resistance.x;\n force.y = ftraction.y + Math.cos(car.steerangle) * flatf.y + flatr.y + resistance.y;\n\n // torque on body from lateral forces\n torque = car.cartype.b * flatf.y - car.cartype.c * flatr.y;\n\n // Acceleration\n\n // Newton F = m.a, therefore a = F/m\n acceleration.x = force.x / car.cartype.mass;\n acceleration.y = force.y / car.cartype.mass;\n angular_acceleration = torque / car.cartype.inertia;\n\n // Velocity and position\n\n // transform acceleration from car reference frame to world reference frame\n acceleration_wc.x = cs * acceleration.y + sn * acceleration.x;\n acceleration_wc.y = -sn * acceleration.y + cs * acceleration.x;\n\n // velocity is integrated acceleration\n //\n car.velocity_wc.x += delta_t * acceleration_wc.x;\n car.velocity_wc.y += delta_t * acceleration_wc.y;\n\n // position is integrated velocity\n //\n car.position_wc.x += delta_t * car.velocity_wc.x;\n car.position_wc.y += delta_t * car.velocity_wc.y;\n\n\n // Angular velocity and heading\n\n // integrate angular acceleration to get angular velocity\n //\n car.angularvelocity += delta_t * angular_acceleration;\n\n // integrate angular velocity to get angular orientation\n //\n car.angle += delta_t * car.angularvelocity;\n\n }", "@Override\n public void robotInit() {\n SmartDashboard.putBoolean(\"CLIMB\", false);\n SmartDashboard.putNumber(\"servo\", 0);\n // Instantiate our RobotContainer. This will perform all our button bindings, and put our\n // autonomous chooser on the dashboard.\n m_robotContainer = new RobotContainer();\n //coast.\n if (RobotMap.DRIVE_TRAIN_DRAGON_FLY_IS_AVAILABLE)\n getRobotContainer().getDriveTrain().setCANSparkMaxMotorsState(false, RobotMap.DRIVE_TRAIN_MIDDLE_WHEEL_PORT);\n\n getRobotContainer().configureButtonBindings();\n getRobotContainer().getTecbotSensors().initializeAllSensors();\n getRobotContainer().getTecbotSensors().getTecbotGyro().reset();\n\n Robot.getRobotContainer().getDriveTrain().setCANSparkMaxMotorsState(true, RobotMap.DRIVE_TRAIN_MIDDLE_WHEEL_PORT);\n Robot.getRobotContainer().getDriveTrain().setCANSparkMaxMotorsState(true, RobotMap.DRIVE_TRAIN_LEFT_CHASSIS_PORTS);\n Robot.getRobotContainer().getDriveTrain().setCANSparkMaxMotorsState(true, RobotMap.DRIVE_TRAIN_RIGHT_CHASSIS_PORTS);\n\n UsbCamera camera = CameraServer.getInstance().startAutomaticCapture();\n camera.setResolution(640, 480);\n\n m_chooser.addOption(\"Move 3 m\", new SpeedReductionStraight(3, .75, 0));\n m_chooser.addOption(\"Rotate 90 degrees\", new SpeedReductionTurn(90, .5));\n m_chooser.setDefaultOption(\"El chido\", new DR01D3K4());\n m_chooser.addOption(\"Collect, go back and shoot\", new CollectPowerCellsGoBackShoot());\n m_chooser.addOption(\"Transport\", new SequentialCommandGroup(new FrontIntakeSetRaw(.75),\n new TransportationSystemSetRaw(.5)));\n m_chooser.addOption(\"Shoot 3PCs n' Move\", new SHOOT_3_PCs_N_MOVE());\n SmartDashboard.putData(\"Auto Mode\", m_chooser);\n\n //camera.setExposureManual(79);\n\n\n }", "private void automaticModeChecks(){\n // turn on lights if underground\n if (this.isUnderground()){ this.selectedTrain.setLights(1);}\n // set heat\n if (this.selectedTrain.getTemp() <= 40.0){this.selectedTrain.setThermostat(60.0);}\n else if (this.selectedTrain.getTemp() >= 80){ this.selectedTrain.setThermostat(50.0);}\n }", "public void autonomousPeriodic() {\n\t\tScheduler.getInstance().run();\n\t\t\n shooterArm.updateSmartDashboard();\n\t\tdriveTrain.getDegrees();\n\n\t\tvision.findGoal();\n\t\tvision.getGoalXAngleError();\n\t\tvision.getGoalArmAngle();\n\n\t\t// Stop auto mode if the robot is tilted too much\n\t\tif (Math.abs(driveTrain.getRobotPitch())<=60 && Math.abs(driveTrain.getRobotRoll())<=60)\n\t\t\ttimerTilt.reset();\n\t\t\n\t\t// For some reason, robot did not move in last match in auto, so this code is suspect\n\t\t// Do the Pitch/Roll values need to be zeroed?\n//\t\tif ( autonomousCommand != null && timerTilt.get()>0.5)\n//\t\t\tautonomousCommand.cancel();\n\n\t}", "@Override\n\tpublic void robotInit() {\n\t\tprefs = Preferences.getInstance();\n\t\tDEBUG = prefs.getBoolean(\"DEBUG\", false);\n\t\t\n\t\tinitCamera(\"Primary Camera\", 0);\n\t\tinitCamera(\"Secondary Camera\", 1);\n\t\t\n\t\tRobotMap.robotDriveMain = new DifferentialDrive(RobotMap.leftDrive, RobotMap.rightDrive);\n\t\t\n\t\tautoChooser.setDefaultOption(\"Left\", \"left\");\n\t\tautoChooser.addOption(\"Middle\", \"middle\");\n\t\tautoChooser.addOption(\"Right\", \"right\");\n\t\t\n\t\tSmartDashboard.putData(\"Auto Mode:\", autoChooser);\n\t}", "@Override\n\tpublic void setStates(){\n\t\tfor(Entry<String, GUIComponentSelector> lightEntry : lightSelectors.entrySet()){\n\t\t\tlightEntry.getValue().selectorState = vehicle.variablesOn.contains(lightEntry.getKey()) ? 1 : 0;\n\t\t}\n\t\t\n\t\t//Set the states of the magneto selectors.\n\t\tif(vehicle.definition.motorized.hasSingleEngineControl){\n\t\t\tmagnetoSelectors.get((byte)-1).visible = !vehicle.engines.isEmpty();\n\t\t\tfor(PartEngine engine : vehicle.engines.values()){\n\t\t\t\tmagnetoSelectors.get((byte)-1).selectorState = engine.state.magnetoOn ? 1 : 0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}else{\n\t\t\tfor(Entry<Byte, GUIComponentSelector> magnetoEntry : magnetoSelectors.entrySet()){\n\t\t\t\tif(vehicle.engines.containsKey(magnetoEntry.getKey())){\n\t\t\t\t\tmagnetoEntry.getValue().selectorState = vehicle.engines.get(magnetoEntry.getKey()).state.magnetoOn ? 1 : 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Set the states of the starter selectors.\n\t\tif(vehicle.definition.motorized.hasSingleEngineControl){\n\t\t\tfor(PartEngine engine : vehicle.engines.values()){\n\t\t\t\tstarterSelectors.get(ENGINE_SINGLE_SELECTOR_INDEX).selectorState = engine.state.magnetoOn ? (engine.state.esOn ? 2 : 1) : 0;\n\t\t\t\tstarterSelectors.get(ENGINE_SINGLE_SELECTOR_INDEX).visible = !engine.definition.engine.disableAutomaticStarter;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}else{\n\t\t\tfor(Entry<Byte, GUIComponentSelector> starterEntry : starterSelectors.entrySet()){\n\t\t\t\tif(vehicle.engines.containsKey(starterEntry.getKey())){\n\t\t\t\t\tPartEngine engine = vehicle.engines.get(starterEntry.getKey());\n\t\t\t\t\tstarterEntry.getValue().selectorState = engine.state.magnetoOn ? (engine.state.esOn ? 2 : 1) : 0;\n\t\t\t\t\tstarterEntry.getValue().visible = !engine.definition.engine.disableAutomaticStarter;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\t//For every tick we have one of the trim selectors pressed, do the corresponding trim action.\n\t\tif(selectedTrimSelector != null){\n\t\t\tif(inClockPeriod(3, 1)){\n\t\t\t\tif(!appliedTrimThisRender){\n\t\t\t\t\tselectedTrimSelector.selectorState = selectedTrimSelector.selectorState == 0 ? 1 : 0; \n\t\t\t\t\tInterfacePacket.sendToServer(new PacketVehicleControlDigital(vehicle, selectedTrimType, selectedTrimDirection));\n\t\t\t\t\tappliedTrimThisRender = true;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tappliedTrimThisRender = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//If we have reverse thrust, set the selector state.\n\t\tif(reverseSelector != null){\n\t\t\tif(vehicle.definition.motorized.isBlimp){\n\t\t\t\treverseSelector.selectorState = 0;\n\t\t\t\tfor(PartEngine engine : vehicle.engines.values()){\n\t\t\t\t\tif(engine.currentGear < 0){\n\t\t\t\t\t\treverseSelector.selectorState = 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\treverseSelector.selectorState = vehicle.reverseThrust ? 1 : 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//If we have autopilot, set the selector state.\n\t\tif(autopilotSelector != null){\n\t\t\tautopilotSelector.selectorState = vehicle.autopilot ? 1 : 0;\n\t\t}\n\t\t\n\t\t//If we have gear, set the selector state.\n\t\tif(gearSelector != null){\n\t\t\tif(vehicle.variablesOn.contains(EntityVehicleF_Physics.GEAR_VARIABLE)){\n\t\t\t\tgearSelector.selectorState = vehicle.gearMovementTime == vehicle.definition.motorized.gearSequenceDuration ? 2 : 3;\n\t\t\t}else{\n\t\t\t\tgearSelector.selectorState = vehicle.gearMovementTime == 0 ? 0 : 1;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//If we have a hitch, set the selector state.\n\t\tif(trailerSelector != null){\n\t\t\tSwitchEntry switchDef = trailerSwitchDefs.get(0);\n\t\t\tif(switchDef.connectionGroup.hookup){\n\t\t\t\ttrailerSelector.selectorState = switchDef.entityOn.towedByConnection != null ? 0 : 1;\n\t\t\t}else{\n\t\t\t\ttrailerSelector.selectorState = 1;\n\t\t\t\tfor(TrailerConnection connection : switchDef.entityOn.getTowingConnections()){\n\t\t\t\t\tif(connection.hitchGroupIndex == switchDef.connectionGroupIndex){\n\t\t\t\t\t\ttrailerSelector.selectorState = 0;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Set the beaconBox text color depending on if we have an active beacon.\n\t\tif(beaconBox != null){\n\t\t\tbeaconBox.fontColor = vehicle.selectedBeacon != null ? ColorRGB.GREEN : ColorRGB.RED;\n\t\t}\n\t\t\n\t\t//Iterate through custom selectors and set their states.\n\t\tfor(GUIComponentSelector customSelector : customSelectors){\n\t\t\tcustomSelector.selectorState = vehicle.variablesOn.contains(customSelector.text) ? 1 : 0;\n\t\t}\n\t}", "@Override\n\tpublic void autonomousInit() {\n\t\t\n\t\t// runs the autonomous smartdashboard display for auton\n\t\tActuators.getLeftDriveMotor().setEncPosition(0);\n\t\tActuators.getRightDriveMotor().setEncPosition(0);\n\t\tautonomousCommand = (Command) autoChooser.getSelected();\n\t\t\n//\t\tbackupCommand = (Command) backupChooser.getSelected();\n//\t\tActuators.getLeftDriveMotor().changeControlMode(TalonControlMode.MotionProfile);\n//\t\tActuators.getRightDriveMotor().changeControlMode(TalonControlMode.MotionProfile);\n//\t\tif (NetworkTables.getControlsTable().getBoolean(\"camera0\", false)) {//Auto for working camera\n\t\t\n\t\tif(autonomousCommand != null){\t\n\t\t\tSystem.out.println(autonomousCommand);\n\t\t\tautonomousCommand.start();\n\t\t}\n\t\t\n//\t\t\tSystem.out.println(\"I got here auto Command start\");\n//\t\t\t}\n//\t\telse{\n//\t\t\tbackupCommand.start();\t\t\t\n//\t\t}\n//\t\t\tDrive.driveWithPID(distance, distance);\n\n\t\tstate = \"auton\";\n\t\t// autoSelected = chooser.getSelected();\n\t\t// // autoSelected = SmartDashboard.getString(\"Auto Selector\",\n\t\t// // defaultAuto);\n\t\t// System.out.println(\"Auto selected: \" + autoSelected);\n\t\tNetworkTables.getControlsTable().putBoolean(\"auton\", true);\n\n\t}", "@Override\n public void robotPeriodic() {\n\n enabledCompr = pressBoy.enabled();\n //pressureSwitch = pressBoy.getPressureSwitchValue();\n currentCompr = pressBoy.getCompressorCurrent();\n //SmartDashboard.putBoolean(\"Pneumatics Loop Enable\", closedLoopCont);\n SmartDashboard.putBoolean(\"Compressor Status\", enabledCompr);\n //SmartDashboard.putBoolean(\"Pressure Switch\", pressureSwitch);\n SmartDashboard.putNumber(\"Compressor Current\", currentCompr);\n }", "public void updateSwitches(){\r\n if(this.ar){\r\n this.augmentedReality.setChecked(true);\r\n }else{\r\n this.augmentedReality.setChecked(false);\r\n }\r\n\r\n if(this.easy){\r\n this.easyMode.setChecked(true);\r\n }else{\r\n this.easyMode.setChecked(false);\r\n }\r\n }", "@Override\n public void robotInit() {\n myRobot = new DifferentialDrive(leftfrontmotor, rightfrontmotor);\n leftrearmotor.follow(leftfrontmotor);\n rightrearmotor.follow(rightfrontmotor);\n leftfrontmotor.setInverted(true); // <<<<<< Adjust this until robot drives forward when stick is forward\n\t\trightfrontmotor.setInverted(true); // <<<<<< Adjust this until robot drives forward when stick is forward\n\t\tleftrearmotor.setInverted(InvertType.FollowMaster);\n rightrearmotor.setInverted(InvertType.FollowMaster);\n \n CameraServer.getInstance().startAutomaticCapture();\n\n \n\n comp.setClosedLoopControl(true);\n \n\n /* Set up Dashboard widgets */\n SmartDashboard.putNumber(\"L Stick\", gamepad.getRawAxis(1));\n\t\tSmartDashboard.putNumber(\"R Stick\", gamepad.getRawAxis(5));\n\t\tSmartDashboard.putBoolean(\"Back Button\", gamepad.getRawButton(5));\n\t\tSmartDashboard.putBoolean(\"Fwd Button\", gamepad.getRawButton(6));\n\t\t\n SmartDashboard.putNumber(\"LF\", pdp.getCurrent(leftfrontmotorid));\n\t\tSmartDashboard.putNumber(\"LR\", pdp.getCurrent(leftrearmotorid));\n\t\tSmartDashboard.putNumber(\"RF\", pdp.getCurrent(rightfrontmotorid));\n\t\tSmartDashboard.putNumber(\"RR\", pdp.getCurrent(rightrearmotorid));\n SmartDashboard.putNumber(\"Total\", pdp.getCurrent(0) + pdp.getCurrent(1) + pdp.getCurrent(2) + pdp.getCurrent(3) + pdp.getCurrent(4) + pdp.getCurrent(5) + pdp.getCurrent(6) + pdp.getCurrent(7) + pdp.getCurrent(8) + pdp.getCurrent(9) + pdp.getCurrent(10) + pdp.getCurrent(11) + pdp.getCurrent(12) + pdp.getCurrent(13) + pdp.getCurrent(14) + pdp.getCurrent(15));\n }", "private void configVelocityControl() {\n //config remote sensors\n //sets the sensor to be a quad encoder, sets our feedback device to be that sensor\n m_masterMotor.configSelectedFeedbackSensor(TalonSRXFeedbackDevice.CTRE_MagEncoder_Relative, RobotMap.PID_PRIMARY_SLOT, RobotMap.LAUNCHER_CONFIG_TIMEOUT_MS);\n\n //zero the encoders on every init\n zeroEncoder();\n\n //sets whether our motor is inverted\n //this is currently false but can be switched based on testing\n m_masterMotor.setInverted(RobotMap.LAUNCHER_MASTER_INVERTED);\n m_masterMotor.setSensorPhase(RobotMap.LAUNCHER_MASTER_INVERTED);\n\n //this sets how often we pull data from our sensor\n m_masterMotor.setStatusFramePeriod(StatusFrame.Status_2_Feedback0, RobotMap.LAUNCHER_FEEDBACK_PERIOD_MS, RobotMap.LAUNCHER_CONFIG_TIMEOUT_MS);\n\n //this configs the deadband for the PID output. Any output with an absolute value less than this will be treated as zero\n m_masterMotor.configNeutralDeadband(0, RobotMap.LAUNCHER_CONFIG_TIMEOUT_MS);\n\n //this sets the peak output for our motor controller.\n m_masterMotor.configPeakOutputForward(RobotMap.LAUNCHER_PID_PEAK_OUTPUT, RobotMap.LAUNCHER_CONFIG_TIMEOUT_MS);\n //this does the same thing but for the reverse direction\n m_masterMotor.configPeakOutputReverse(0, RobotMap.LAUNCHER_CONFIG_TIMEOUT_MS);\n \n //sets the period of the velocity sample\n //effectively this defines the amount of time used to calculate the velocity\n m_masterMotor.configVelocityMeasurementPeriod(RobotMap.VELOCITY_MEASUREMENT_PERIOD, RobotMap.LAUNCHER_CONFIG_TIMEOUT_MS);\n\n //Sets the number of samples used in the rolling average for calculating velocity\n m_masterMotor.configVelocityMeasurementWindow(RobotMap.LAUNCHER_VELOCITY_MEASUREMENT_WINDOW, RobotMap.LAUNCHER_CONFIG_TIMEOUT_MS);\n \n //set p, i, d, f values\n //the zero is the PID slot, in this case it is zero for the primary PID\n //the launcher has no auxillary or turning PID control\n m_masterMotor.config_kP(RobotMap.PID_PRIMARY_SLOT, RobotMap.LAUNCHER_P);\n m_masterMotor.config_kI(RobotMap.PID_PRIMARY_SLOT, RobotMap.LAUNCHER_I);\n m_masterMotor.config_kD(RobotMap.PID_PRIMARY_SLOT, RobotMap.LAUNCHER_D);\n m_masterMotor.config_kF(RobotMap.PID_PRIMARY_SLOT, RobotMap.LAUNCHER_F);\n\n //this sets the acceptable amount of Integral error, where if the absolute accumulated error exceeds this ammount, it resets to zero\n //this is designed to prevent the PID from going crazy if we move too far from our target\n m_masterMotor.config_IntegralZone(RobotMap.PID_PRIMARY_SLOT, RobotMap.LAUNCHER_I_ZONE, RobotMap.LAUNCHER_CONFIG_TIMEOUT_MS);\n\n //sets the max output of the motor specifically within closed loop control\n m_masterMotor.configClosedLoopPeakOutput(RobotMap.PID_PRIMARY_SLOT, RobotMap.LAUNCHER_PID_PEAK_OUTPUT, RobotMap.LAUNCHER_CONFIG_TIMEOUT_MS);\n\n //this configures an allowable error in closed loop control\n //any error less than this is treated as zero.\n m_masterMotor.configAllowableClosedloopError(RobotMap.PID_PRIMARY_SLOT, RobotMap.LAUNCHER_ACCEPTABLE_ERROR, RobotMap.LAUNCHER_CONFIG_TIMEOUT_MS);\n\n //configures the period for closed loop calculations in MS \n //should be increased if the can bus is haveing issues\n m_masterMotor.configClosedLoopPeriod(RobotMap.PID_PRIMARY_SLOT, RobotMap.LAUNCHER_CLOSED_LOOP_PERIOD_MS, RobotMap.LAUNCHER_CONFIG_TIMEOUT_MS);\n\n //configures ramp speed\n m_masterMotor.configOpenloopRamp(RobotMap.LAUNCHER_OPEN_LOOP_RAMP_TIME_S);\n m_masterMotor.configClosedloopRamp(0);\n\n //sets our closed loop control to use our primary PID slot\n m_masterMotor.selectProfileSlot(RobotMap.PID_PRIMARY_SLOT, 0);\n }", "public void autonomousInit() { //Problems here when power is not cycled between matches.\n \tauto.autonomousInit();\n }", "public void autonomousInit() {\n\t\ttimer.start();\n\t\tautonomousCommand = autoChooser.getSelected();\n\t\t//This outputs what we've chosen in the SmartDashboard as a string.\n\t\tSystem.out.println(autonomousCommand);\n\t\tif (DriverStation.getInstance().isFMSAttached()) {\n\t\t\tgameData = DriverStation.getInstance().getGameSpecificMessage();\n\t\t}\n\t\telse {\n\t\t\tgameData=\"RLR\";\n\t\t}\n\t\t//armSwing.setAngle(90); //hopefully this will swing the arms down. not sure what angle it wants though\n\t}", "@Override\n public void init() {\n\n try {\n\n // Get wheel motors\n wheelMotor1 = hardwareMap.dcMotor.get(\"Wheel 1\");\n wheelMotor2 = hardwareMap.dcMotor.get(\"Wheel 2\");\n\n // Initialize wheel motors\n wheelMotor1.setMode(DcMotorController.RunMode.RUN_WITHOUT_ENCODERS);\n wheelMotor2.setMode(DcMotorController.RunMode.RUN_WITHOUT_ENCODERS);\n wheelMotor1.setDirection(DcMotor.Direction.FORWARD);\n wheelMotor2.setDirection(DcMotor.Direction.REVERSE);\n robotDirection = DriveMoveDirection.Forward;\n motion = new Motion(wheelMotor1, wheelMotor2);\n\n // Get hook motor\n motorHook = hardwareMap.dcMotor.get(\"Hook\");\n motorHook.setDirection(DcMotor.Direction.REVERSE);\n\n // Get servos\n servoTapeMeasureUpDown = hardwareMap.servo.get(\"Hook Control\");\n servoClimberDumperArm = hardwareMap.servo.get(\"Climber Dumper Arm\");\n servoDebrisPusher = hardwareMap.servo.get(\"Debris Pusher\");\n servoZipLineLeft = hardwareMap.servo.get(\"Zip Line Left\");\n servoZipLineRight = hardwareMap.servo.get(\"Zip Line Right\");\n servoAllClearRight = hardwareMap.servo.get (\"All Clear Right\");\n servoAllClearLeft = hardwareMap.servo.get (\"All Clear Left\");\n\n setServoPositions();\n }\n catch (Exception ex)\n {\n telemetry.addData(\"error\", ex.getMessage());\n }\n }", "public void autonomousInit() {\n\t\tSystem.out.println(\"Auto Init\");\n//\t\tint autonStep = 0;\t//step that autonomous is executing\n\t\tclaw = new Claw();\n\t\televator = new Elevator();\n//\t\televator.elevator();\n\t\tdecode = new Decode();\n//\t\tdecode.decode();\n\t}", "protected void setup() {\n DFAgentDescription dfd = new DFAgentDescription();\n dfd.setName(getAID());\n ServiceDescription sd = new ServiceDescription();\n sd.setName(\"Storage Agent\");\n sd.setType(\"Storage\");\n dfd.addServices(sd);\n try {\n DFService.register(this, dfd);\n } catch (FIPAException fe) {\n fe.printStackTrace();\n }\n waitForAgents = new waitAgents();\n receiveAgents = new receiveFromAgents();\n operate = new opMicrogrid();\n decision = new takeDecision();\n\n addBehaviour(waitForAgents);\n\n //add a ticker behavior to monitor PV production, disable PLay button in the meanwhile\n addBehaviour(new TickerBehaviour(this, 5000) {\n protected void onTick() {\n if (AgentsUp == 0) {\n appletVal.playButton.setEnabled(false);\n ACLMessage msg = new ACLMessage(ACLMessage.INFORM);\n msg.addReceiver(new AID(AgentAIDs[2].getLocalName(), AID.ISLOCALNAME));\n msg.setContent(\"Inform!!!\");\n send(msg);\n String stripedValue = \"\";\n msg = receive();\n if (msg != null) {\n // Message received. Process it\n String val = msg.getContent().toString();\n stripedValue = (val.replaceAll(\"[\\\\s+a-zA-Z :]\", \"\"));\n //PV\n if (val.contains(\"PV\")) {\n System.out.println(val);\n PV = Double.parseDouble(stripedValue);\n appletVal.playButton.setEnabled(true);\n appletVal.SetAgentData(PV, 0, 2);\n }\n\n } else {\n block();\n }\n\n }\n }\n });\n\n }", "public void robotInit() \n {\n RobotMap.init();\n\n driveTrain = new DriveTrain();\n gripper = new Gripper();\n verticalLift = new VerticalLift();\n\n // OI must be constructed after subsystems. If the OI creates Commands \n //(which it very likely will), subsystems are not guaranteed to be \n // constructed yet. Thus, their requires() statements may grab null \n // pointers. Bad news. Don't move it.\n\n oi = new OI();\n\n autonomousChooser = new SendableChooser();\n autonomousChooser.addDefault( \"Auto: Do Nothing\" , new DoNothing () );\n autonomousChooser.addObject ( \"Auto: Drive To Auto Zone\" , new DriveToAutoZone () );\n autonomousChooser.addObject ( \"Auto: Drive To Auto Zone (Bump)\" , new DriveToAutoZoneBump () );\n //autonomousChooser.addObject ( \"Auto: Get One (Long)\" , new GetOneLong () );\n //autonomousChooser.addObject ( \"Auto: Get One (Short)\" , new GetOneShort () );\n //autonomousChooser.addObject ( \"Auto: Get One Recycle Bin (Bump)\" , new GetOneRecycleBin () );\n autonomousChooser.addObject ( \"Auto: Get One Recycle Bin (Side)\" , new GetRecycleBinSide () );\n //autonomousChooser.addObject ( \"Auto: Get One Recycle Bin (Backwards)\" , new GetOneRecycleBinBackwards () );\n //autonomousChooser.addObject ( \"Auto: Get One Recycle Bin (Backwards, Bump)\", new GetOneRecycleBinBackwardsBump() );\n //autonomousChooser.addObject ( \"Auto: Get Two (Short)\" , new GetTwoShort () );\n //autonomousChooser.addObject ( \"Auto: Get Two Short (Special)\" , new GetTwoShortSpecial () );\n //autonomousChooser.addObject ( \"Auto: Get Two (Long, From left)\" , new TwoLongFromLeft () );\n //autonomousChooser.addObject ( \"Auto: Get Two (Long, From right)\" , new TwoLongFromRight () );\n autonomousChooser.addObject ( \"Auto: Get One Tote and Recycle Bin\" , new OneRecycleBinAndTote () );\n autonomousChooser.addObject ( \"Auto: Get One Tote and Recycle Bin (Bump)\" , new OneRecycleBinAndToteBump () );\n SmartDashboard.putData( \"Autonomous\", autonomousChooser );\n\n // instantiate the command used for the autonomous period\n //autonomousCommand = new RunAutonomousCommand();\n\n m_USBVCommand = new UpdateSBValuesCommand();\n m_USBVCommand.start();\n \n frame = NIVision.imaqCreateImage(NIVision.ImageType.IMAGE_RGB, 0);\n /*\n // the camera name (ex \"cam0\") can be found through the roborio web interface\n session = NIVision.IMAQdxOpenCamera(\"cam1\",\n NIVision.IMAQdxCameraControlMode.CameraControlModeController);\n NIVision.IMAQdxConfigureGrab(session);\n \n NIVision.IMAQdxStartAcquisition(session);\n */\n /*\n camServer = CameraServer.getInstance();//.startAutomaticCapture(\"cam1\");\n camServer.setQuality(30);\n \n cam = new USBCamera(\"cam1\");\n cam.openCamera();\n cam.setFPS(60);\n \n cam.setSize(320, 240);\n cam.updateSettings();\n */\n }", "private void MotorInit()\n {\n intake_up.configFactoryDefault();\n intake_down.configFactoryDefault();\n intake_up.configOpenloopRamp(Constants.kMotorRampRate);\n intake_down.configOpenloopRamp(Constants.kMotorRampRate);\n intake_up.setInverted(PortReversed.intake_up_reversed.value);\n intake_down.setInverted(PortReversed.intake_down_reversed.value);\n intake_up.setNeutralMode(NeutralMode.Brake);\n intake_down.setNeutralMode(NeutralMode.Brake);\n }", "@Override\r\n\tpublic void travelMode() {\n\t\tthis.travelMode = \"Car\";\r\n\t\tSystem.out.println(\"Mode of travel selected is \"+ this.travelMode);\r\n\r\n\t}", "public static void autoInit() {\n\t\tint col = allianceChooser.getSelected();\n\t\tRobot.navX.reset();\n\t\tif (col == 1) {\n\t\t\tRobot.redLight.set(false);\n\t\t\tRobot.blueLight.set(false);\n\t\t\tRobot.backLight.set(false);\n\t\t}\n\t\tif (col == 2) {\n\t\t\tRobot.redLight.set(true);\n\t\t\tRobot.backLight.set(true);\n\t\t\tRobot.blueLight.set(false);\n\t\t}\n\t\tif (col == 3) {\n\t\t\tRobot.redLight.set(false);\n\t\t\tRobot.backLight.set(false);\n\t\t\tRobot.blueLight.set(true);\n\t\t}\n\t\tint numchoose = chooser.getSelected();\n\t\t//numchoose = 2;\n\t\tif (numchoose == 1)\n\t\t\tmid();//moveDistance(1.4, 0, Robot.navX.getFusedHeading(), 130);\n\t\tif (numchoose == 2)\n\t\t\tleft();\n\t\tif (numchoose == 3)\n\t\t\tmid();\n\t\tif (numchoose == 4)\n\t\t\tright();\n\t\tif (numchoose == 5)\n\t\t\tLeftVis();\n\t\tif (numchoose == 6)\n\t\t\tMidVis();\n\t\tif (numchoose == 7)\n\t\t\tRightVis();\n\t\tif (numchoose == 8)\n\t\t\tshootRedDirect();\n\t\tif (numchoose == 9)\n\t\t\tshooterRedHopper();\n\t\tif (numchoose == 10)\n\t\t\tshooterBlueHopper();\n\n\t}", "@Override\n public void autonomousInit() {\n m_autoSelected = m_chooser.getSelected();\n // m_autoSelected = SmartDashboard.getString(\"Auto Selector\", kDefaultAuto);\n System.out.println(\"Auto selected: \" + m_autoSelected);\n\n Intake.getInstance().releaseHatch();\n }", "public void update()\n {\n if(RobotMap.manipController.getRawButton(XboxMap.X)==true)\n {\n activateDumpSolenoid(forward);\n }\n\n //when b is pressed, put gate back up\n if(RobotMap.manipController.getRawButton(XboxMap.B)==true)\n {\n activateDumpSolenoid(reverse);\n }\n\n //If A is pressed (auto)\n if(RobotMap.driveController.getRawButton(XboxMap.A)==true)\n {\n if(distanceSensor.checkDistance() < 270 && distanceSensor.checkDistance() != 0)\n {\n activateDumpSolenoid(forward);\n myRobot.setAutoDoneTrue();\n }\n }\n }", "@Override\n public void robotPeriodic() {\n\n boolean c = mGPM.haveCargo();\n \n // Need signal due to distance for assurance that cargo is obtained/\n if (c) {\n CargoLight.set(Value.kOn);\n } else{\n CargoLight.set(Value.kOff);\n }\n }", "public void Loop() {\n //if the drive mode is encoders then mirror the rear motors so that we just use the encoders of the front motors\n if(driveMode == DriveMode.Run_With_Encoders){\n rearLeftDrive.setVelocity(frontLeftDrive.getVelocity());\n rearRightDrive.setVelocity(frontRightDrive.getVelocity());\n }\n }", "@Override\n public void runOpMode() {\n try {\n leftfrontDrive = hardwareMap.get(DcMotor.class, \"frontLeft\");\n leftfrontDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n rightfrontDrive = hardwareMap.get(DcMotor.class, \"frontRight\");\n rightfrontDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n leftbackDrive = hardwareMap.get(DcMotor.class, \"backLeft\");\n leftbackDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n leftbackDrive.setDirection(DcMotor.Direction.REVERSE);\n\n rightbackDrive = hardwareMap.get(DcMotor.class, \"backRight\");\n rightbackDrive.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n lift = hardwareMap.get(DcMotor.class, \"Lift\");\n lift.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n lift.setDirection(DcMotor.Direction.REVERSE);\n\n markerArm = hardwareMap.get(Servo.class, \"markerArm\");\n\n armActivator = hardwareMap.get(DcMotor.class, \"armActivator\");\n armActivator.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n } catch (IllegalArgumentException iax) {\n bDebug = true;\n }\n\n BNO055IMU.Parameters parameters = new BNO055IMU.Parameters();\n parameters.angleUnit = BNO055IMU.AngleUnit.DEGREES;\n parameters.accelUnit = BNO055IMU.AccelUnit.METERS_PERSEC_PERSEC;\n parameters.calibrationDataFile = \"BNO055IMUCalibration.json\";\n parameters.loggingEnabled = true;\n parameters.loggingTag = \"IMU\";\n parameters.accelerationIntegrationAlgorithm = new JustLoggingAccelerationIntegrator();\n\n imu = hardwareMap.get(BNO055IMU.class, \"imu\");\n imu.initialize(parameters);\n\n waitForStart(); //the rest of the code begins after the play button is pressed\n\n sleep(3000);\n\n drive(0.35, 0.5);\n\n turn(90.0f);\n\n drive(1.8, 0.5);\n\n turn(45.0f);\n\n drive(2.5, -0.5);\n\n sleep(1000);\n\n markerArm.setPosition(1);\n\n sleep(1000);\n\n markerArm.setPosition(0);\n\n sleep(1000);\n\n drive(2.5,.75);\n\n turn(179.0f);\n\n drive(1.5, 1.0);\n\n requestOpModeStop(); //end of autonomous\n }", "@Override\n public void runOpMode() {\n servo0 = hardwareMap.servo.get(\"servo0\");\n servo1 = hardwareMap.servo.get(\"servo1\");\n digital0 = hardwareMap.digitalChannel.get(\"digital0\");\n motor0 = hardwareMap.dcMotor.get(\"motor0\");\n motor1 = hardwareMap.dcMotor.get(\"motor1\");\n motor0B = hardwareMap.dcMotor.get(\"motor0B\");\n motor2 = hardwareMap.dcMotor.get(\"motor2\");\n blinkin = hardwareMap.get(RevBlinkinLedDriver.class, \"blinkin\");\n motor3 = hardwareMap.dcMotor.get(\"motor3\");\n park_assist = hardwareMap.dcMotor.get(\"motor3B\");\n\n if (digital0.getState()) {\n int_done = true;\n } else {\n int_done = false;\n }\n motor_stuff();\n waitForStart();\n if (opModeIsActive()) {\n while (opModeIsActive()) {\n lancher_position();\n slow_mode();\n drive_robot();\n foundation_grabber(1);\n launcher_drive();\n data_out();\n Pickingupblockled();\n lettingoutblockled();\n Forwardled();\n backwardled();\n Turnleftled();\n Turnrightled();\n Stationaryled();\n }\n }\n }", "public void robotInit() {\n RobotMap.init();\n driveTrain = new DriveTrain();\n oi = new OI();\n flippy = new Flipper();\n flappy = new Flapper();\n autonomousCommand = new AutoFlip();\n \n OI.init();\n CommandBase.init();\n autoChooser = new SendableChooser();\n autoChooser.addDefault(\"Flap Left\", new AutoFlip());\n SmartDashboard.putData(\"Autonomous_Mode\", autoChooser); \n }", "private void updateControlView() {\n // initialize varables with default value\n int thermDrawable = R.drawable.off_thermostat_drawable;\n int mercuryDrawable = R.drawable.clip_mercury_off;\n int upColor = Color.WHITE;\n int downColor = Color.WHITE;\n int thermometerColor = Color.BLACK;\n double targetC = display_temp;\n double ambientC = mThermostat.getAmbientTemperatureC();\n double tempDiffC = targetC - ambientC;\n String state = mStructure.getAway();\n String mode = mThermostat.getHvacMode();\n boolean isAway = state.equals(KEY_AWAY) || state.equals(KEY_AUTO_AWAY);\n boolean isHeating = KEY_HEAT.equals(mode) && tempDiffC > 0;\n boolean isCooling = KEY_COOL.equals(mode) && tempDiffC < 0;\n GradientDrawable shapeBottom1 = (GradientDrawable) mThermometerBottom1.getDrawable();\n GradientDrawable shapeBottom2 = (GradientDrawable) mThermometerBottom2.getDrawable();\n\n Log.v(TAG, \"updateControlView\");\n\n // change varables based on HVAC status\n if (isHeating) { // if the HVAC is heating\n thermDrawable = R.drawable.heat_thermostat_drawable;\n mercuryDrawable = R.drawable.clip_mercury_heat;\n upColor = Color.RED;\n downColor = Color.GREEN;\n thermometerColor = ContextCompat.getColor(context, R.color.heat);\n } else if (isCooling) { // if the HVAC is cooling\n thermDrawable = R.drawable.cool_thermostat_drawable;\n mercuryDrawable = R.drawable.clip_mercury_cool;\n upColor = Color.GREEN;\n downColor = Color.RED;\n thermometerColor =ContextCompat.getColor(context,R.color.cool);\n }\n\n // Update the view.\n if (isAway) {\n mTargetTempText.setText(R.string.thermostat_away);\n }else {\n mTargetTempText.setText(String.format(Locale.CANADA, DEG_C, targetC));\n }\n mThermostatView.setBackgroundResource(thermDrawable);\n mTempUp.setTextColor(upColor);\n mTempDown.setTextColor(downColor);\n\n shapeBottom1.setColor(thermometerColor);\n shapeBottom2.setColor(thermometerColor);\n mMercuryImg.setImageResource(mercuryDrawable);\n\n updateSaving(!isCooling && !isHeating);\n }", "protected void initialize() {\r\n \t((Launcher) Robot.fuelLauncher).controlSpeed(i);\r\n }", "protected void initialize() {\n \t starttime = Timer.getFPGATimestamp();\n \tthis.startAngle = RobotMap.navx.getAngle();\n \tangleorientation.setSetPoint(RobotMap.navx.getAngle());\n \t\n \tRobotMap.motorLeftTwo.enableControl();\n \tRobotMap.motorRightTwo.enableControl();\n \tRobotMap.motorLeftTwo.enableControl();\n \tRobotMap.motorRightTwo.enableControl();\n \n //settting talon control mode\n \tRobotMap.motorLeftTwo.changeControlMode(TalonControlMode.MotionMagic);\t\t\n\t\tRobotMap.motorLeftOne.changeControlMode(TalonControlMode.Follower);\t\n\t\tRobotMap.motorRightTwo.changeControlMode(TalonControlMode.MotionMagic);\t\n\t\tRobotMap.motorRightOne.changeControlMode(TalonControlMode.Follower);\n\t\t//setting peak and nominal output voltage for the motors\n\t\tRobotMap.motorLeftTwo.configPeakOutputVoltage(+12.0f, -12.0f);\n\t\tRobotMap.motorLeftTwo.configNominalOutputVoltage(0.00f, 0.0f);\n\t\tRobotMap.motorRightTwo.configPeakOutputVoltage(+12.0f, -12.0f);\n\t\tRobotMap.motorRightTwo.configNominalOutputVoltage(0.0f, 0.0f);\n\t\t//setting who is following whom\n\t\tRobotMap.motorLeftOne.set(4);\n\t\tRobotMap.motorRightOne.set(3);\n\t\t//setting pid value for both sides\n\t//\tRobotMap.motorLeftTwo.setCloseLoopRampRate(1);\n\t\tRobotMap.motorLeftTwo.setProfile(0);\n\t RobotMap.motorLeftTwo.setP(0.000014f);\n \tRobotMap.motorLeftTwo.setI(0.00000001);\n\t\tRobotMap.motorLeftTwo.setIZone(0);//325);\n\t\tRobotMap.motorLeftTwo.setD(1.0f);\n\t\tRobotMap.motorLeftTwo.setF(this.fGainLeft+0.014);//0.3625884);\n\t\tRobotMap.motorLeftTwo.setAllowableClosedLoopErr(0);//300);\n\t\t\n\t RobotMap.motorRightTwo.setCloseLoopRampRate(1);\n\t RobotMap.motorRightTwo.setProfile(0);\n\t\tRobotMap.motorRightTwo.setP(0.000014f);\n\t\tRobotMap.motorRightTwo.setI(0.00000001);\n\t\tRobotMap.motorRightTwo.setIZone(0);//325);\n\t\tRobotMap.motorRightTwo.setD(1.0f);\n\t\tRobotMap.motorRightTwo.setF(this.fGainRight);// 0.3373206);\n\t\tRobotMap.motorRightTwo.setAllowableClosedLoopErr(0);//300);\n\t\t\n\t\t//setting Acceleration and velocity for the left\n\t\tRobotMap.motorLeftTwo.setMotionMagicAcceleration(125);\n\t\tRobotMap.motorLeftTwo.setMotionMagicCruiseVelocity(250);\n\t\t//setting Acceleration and velocity for the right\n\t\tRobotMap.motorRightTwo.setMotionMagicAcceleration(125);\n\t\tRobotMap.motorRightTwo.setMotionMagicCruiseVelocity(250);\n\t\t//resets encoder position to 0\t\t\n\t\tRobotMap.motorLeftTwo.setEncPosition(0);\n\t\tRobotMap.motorRightTwo.setEncPosition(0);\n\t //Set Allowable error for the loop\n\t\tRobotMap.motorLeftTwo.setAllowableClosedLoopErr(300);\n\t\tRobotMap.motorRightTwo.setAllowableClosedLoopErr(300);\n\t\t\n\t\t//sets desired endpoint for the motors\n RobotMap.motorLeftTwo.set(motionMagicEndPoint);\n RobotMap.motorRightTwo.set(-motionMagicEndPoint );\n \t\n }", "public void updateController() {\n\t\tjoystickLXAxis = controller.getRawAxis(portJoystickLXAxis);\t\t//returns a value [-1,1]\n\t\tjoystickLYAxis = controller.getRawAxis(portJoystickLYAxis);\t\t//returns a value [-1,1]\n\t\tjoystickLPress = controller.getRawButton(portJoystickLPress);\t//returns a value {0,1}\n\t\t\n\t\t//right joystick update\n\t\tjoystickRXAxis = controller.getRawAxis(portJoystickRXAxis);\t\t//returns a value [-1,1]\n\t\tjoystickRYAxis = controller.getRawAxis(portJoystickRYAxis);\t\t//returns a value [-1,1]\n\t\tjoystickRPress = controller.getRawButton(portJoystickRPress);\t//returns a value {0,1}\n\t\t\n\t\t//trigger updates\n\t\ttriggerL = controller.getRawAxis(portTriggerL);\t\t//returns a value [0,1]\n\t\ttriggerR = controller.getRawAxis(portTriggerR);\t\t//returns a value [0,1]\n\t\t\n\t\t//bumper updates\n\t\tbumperL = controller.getRawButton(portBumperL);\t\t//returns a value {0,1}\n\t\tbumperR = controller.getRawButton(portBumperR);\t\t//returns a value {0,1}\n\t\t\n\t\t//button updates\n\t\tbuttonX = controller.getRawButton(portButtonX);\t\t//returns a value {0,1}\n\t\tbuttonY = controller.getRawButton(portButtonY);\t\t//returns a value {0,1}\n\t\tbuttonA = controller.getRawButton(portButtonA);\t\t//returns a value {0,1}\n\t\tbuttonB = controller.getRawButton(portButtonB);\t\t//returns a value {0,1}\n\t\t\n\t\tbuttonBack = controller.getRawButton(portButtonBack);\t//returns a value {0,1}\n\t\tbuttonStart = controller.getRawButton(portButtonStart);\t//returns a value {0,1}\n\t\t\n\t\t//toggle checks\n\t\ttankDriveBool = checkButton(buttonX, tankDriveBool, portButtonX);\t\t//toggles boolean if button is pressed\n\t\tfastBool = checkButton(buttonB, fastBool, portButtonB);\t\t\t\t\t//toggles boolean if button is pressed\n\t\t\n\t\t\n\t\t//d-pad/POV updates\n\t\tdPad = controller.getPOV(portDPad);\t\t//returns a value {-1,0,45,90,135,180,225,270,315}\n\n\t\t//d-pad/POV turns\n\t\tif (dPad != -1) {\n\t\t\tdPad = 360 - dPad; //Converts the clockwise dPad rotation into a Gyro-readable counterclockwise rotation.\n\t\t\trotateTo(dPad);\n\t\t}\n\t\t\n\t\tjoystickDeadZone();\n\t}", "public void runOpMode() {\n leftBackDrive = hardwareMap.get(DcMotor.class, \"left_back_drive\"); //port 0, hub1\n rightBackDrive = hardwareMap.get(DcMotor.class, \"right_back_drive\"); //port 1, hub1\n leftFrontDrive = hardwareMap.get(DcMotor.class, \"left_front_drive\"); //port 2, hub1\n rightFrontDrive = hardwareMap.get(DcMotor.class, \"right_front_drive\"); //port 3, hub1\n craneExtend = hardwareMap.get(DcMotor.class, \"craneExtend\"); //port 0, hub2\n cranePitch = hardwareMap.get(DcMotor.class, \"cranePitch\"); //port 1, hub2\n craneElevate = hardwareMap.get(DcMotor.class, \"craneElevate\"); //port 2, hub2\n fakeMotor = hardwareMap.get(DcMotor.class, \"fakeMotor\"); //port 2, hub3\n craneGrab = hardwareMap.get(Servo.class, \"craneGrab\"); //port 0, servo\n craneGrabAttitude = hardwareMap.get(Servo.class, \"craneGrabAttitude\"); //port 2, servo\n trayGrab = hardwareMap.get(Servo.class, \"trayGrab\"); //port 1, servo\n flipperLeft = hardwareMap.get(Servo.class, \"flipperLeft\"); //port 3. servo\n flipperRight = hardwareMap.get(Servo.class, \"flipperRight\"); //port 4, servo\n \n //Setting the motor directions\n leftBackDrive.setDirection(DcMotor.Direction.FORWARD);\n rightBackDrive.setDirection(DcMotor.Direction.REVERSE);\n leftFrontDrive.setDirection(DcMotor.Direction.FORWARD);\n rightFrontDrive.setDirection(DcMotor.Direction.REVERSE);\n\n //Initializing variables\n \n telemetry.addData(\"Status\", \"Initialized\");\n telemetry.update(); //Done initalizing\n\n //Wait for the game to start (driver presses PLAY)\n waitForStart();\n runtime.reset();\n\n //run until the end of the match (driver presses STOP)\n while (opModeIsActive()) {\n \n//******************************************************************************\n\n //Drive controls\n if (gamepad1.left_trigger>0 || gamepad1.right_trigger>0) { //Crab\n leftBackDrive.setPower(gamepad1.left_stick_x*0.8);\n rightBackDrive.setPower(-gamepad1.left_stick_x*0.8);\n leftFrontDrive.setPower(-gamepad1.left_stick_x*0.8);\n rightFrontDrive.setPower(gamepad1.left_stick_x*0.8);\n }\n\n else { //Tank\n leftBackDrive.setPower(-gamepad1.left_stick_x);\n rightBackDrive.setPower(-gamepad1.right_stick_x);\n leftFrontDrive.setPower(-gamepad1.left_stick_x);\n rightFrontDrive.setPower(-gamepad1.right_stick_x);\n }\n }\n \n//******************************************************************************\n\n //Crane control\n \n \n//******************************************************************************\n\n //Telemetry display\n telemetry.addData(\"Run Time:\", \"\" + runtime.toString());\n telemetry.addData(\"Motor Power\", \"L (%.2f), R (%.2f)\", gamepad1.left_stick_y, gamepad1.right_stick_y);\n telemetry.update();\n }", "void find_steady_conditions () {\n // System.out.println(\"-- find_steady_conditions: \" + can_do_gui_updates);\n // double min_lift = parse_force_constraint(tf_tkoff_min_lift);\n double max_drag = parse_force_constraint(tf_tkoff_max_drag);\n boolean saved_flag = can_do_gui_updates;\n can_do_gui_updates = false;\n vpp.steady_flight_at_given_speed(5, 0);\n can_do_gui_updates = saved_flag;\n recomp_all_parts();\n\n\n // this animation idea alas does not work now... \n // //add a bit of animation in case the rider crosses the takeoff speed.\n // if (alt_val == 0 && foil_lift() >= load) { // need to raise up\n // while (alt_val < 70 && foil_lift() >= load) {\n // alt_val += 0.1;\n // loadPanel();\n // viewer.repaint();\n // // try { Thread.sleep(100); } catch (InterruptedException e) {}\n // saved_flag = can_do_gui_updates;\n // can_do_gui_updates = false;\n // vpp.steady_flight_at_given_speed(5, 0);\n // can_do_gui_updates = saved_flag;\n // }\n // }\n\n if (alt_val == 0 && foil_lift() >= load) { // need to raise up\n // viewer.start_raise = true; // this is experimentsl, has quirks....\n alt_val = 70;\n } else if (alt_val > 0 && foil_lift() < load) { // must splash\n // viewer.start_descend = true; // this is experimentsl, has quirks....\n alt_val = 0;\n }\n\n \n loadPanel();\n if (total_drag() > max_drag) \n dash.outTotalDrag.setForeground(Color.red);\n if (foil_lift() < load) \n dash.outTotalLift.setForeground(Color.red);\n }", "@Override\n public void runOpMode() throws InterruptedException {\n\n AutoMode = new AutoUC3_Park();\n autoIntake = new Intake(hardwareMap);\n autoArm = new Arm(hardwareMap);\n autoChassis = new Chassis(hardwareMap);\n\n waitForStart();\n\n //Initialize on press of play\n autoChassis.initChassis();\n autoArm.initArm();\n autoIntake.initIntake();\n\n while (opModeIsActive()&& !isStopRequested() && !parked) {\n parked = AutoMode.AutoUC3_Park_Method(\n this,\n playingAlliance,\n parkingPlaceNearSkyBridge,\n startInBuildingZone,\n autoChassis,\n autoArm,\n autoIntake);\n }\n }", "public void update() {\n if (!hasStarted) {\n //drive.setAutonStraightDrive();\n hasStarted = true;\n } else {\n if (Math.abs((Math.abs(rotations) - (Math.abs(drive.getRightSensorValue() / 4096)))) <= TOLERANCE) {\n drive.setBrakeMode(true);\n setFinished(true);\n }\n }\n\n }", "private void onCarLifecycleChanged(Car car, boolean ready) {\n if (!ready) {\n mBugreportManager = null;\n mCar = null;\n\n // NOTE: dumpstate still might be running, but we can't kill it or reconnect to it\n // so we ignore it.\n handleBugReportManagerError(CAR_BUGREPORT_SERVICE_NOT_AVAILABLE);\n return;\n }\n try {\n mBugreportManager = (CarBugreportManager) car.getCarManager(Car.CAR_BUGREPORT_SERVICE);\n } catch (CarNotConnectedException | NoClassDefFoundError e) {\n throw new IllegalStateException(\"Failed to get CarBugreportManager.\", e);\n }\n }", "@Override\n public void periodic() {\n\t\t// myDrive.\n\n\t\t// System.out.println(Robot.m_oi.getSpeed());\n\t\t// SmartDashboard.putNumber(\"Dial Output: \", Robot.m_oi.getSpeed());\n\n\t\t// //Wheel Speed Limits\n\n\t\t// SmartDashboard.putNumber(\"Front Left Percent\", myDrive.getFLSpeed());\n\t\t// SmartDashboard.putNumber(\"Front Right Percent\", myDrive.getFRSpeed());\n\t\t// SmartDashboard.putNumber(\"Rear Left Percent\", myDrive.getRLSpeed());\n\t\t// SmartDashboard.putNumber(\"Rear Right Percent\", myDrive.getRRSpeed());\n\n\t\t//Test Code for Selecting Calibration Motor \n\t\t//***COMMENT OUT BEFORE REAL GAME USE***\n\t\t// if (Robot.m_oi.getArmDown()) {\n\t\t// \t// System.out.println(\"Front Left Wheel Selected\");\n\t\t// \tWheel = 1;\n\t\t// \tSmartDashboard.putNumber(\"Wheel Selected: \", Wheel);\n\t\t\t\n\t\t// } else if (Robot.m_oi.getArmUp()) {\n\t\t// \t// System.out.println(\"Back Left Wheel Selected\");\n\t\t// \tWheel = 2;\n\t\t// \tSmartDashboard.putNumber(\"Wheel Selected: \", Wheel);\n\t\t\t\n\t\t// } else if (Robot.m_oi.getBallIn()) {\n\t\t// \t// System.out.println(\"Front Right Wheel Selected\");\n\t\t// \tWheel = 3;\n\t\t// \tSmartDashboard.putNumber(\"Wheel Selected: \", Wheel);\n\t\t\t\n\t\t// } else if (Robot.m_oi.getBallOut()) {\n\t\t// \t// System.out.println(\"Back Right Wheel Selected\");\n\t\t// \tWheel = 4;\n\t\t// \tSmartDashboard.putNumber(\"Wheel Selected: \", Wheel);\n\t\t\t\n\t\t// } else if (Robot.m_oi.getBlueButton()) {\n\t\t// \t// System.out.println(\"Back Right Wheel Selected\");\n\t\t// \tWheel = 0;\n\t\t// \tSmartDashboard.putNumber(\"Wheel Selected: \", Wheel);\n\t\t// } \n\n\t\t// if (Wheel == 1) {\n\n\t\t// \tmyDrive.setFLSpeed(Robot.m_oi.getSpeed());\n\n\t\t// } else if (Wheel == 2) {\n\n\t\t// \tmyDrive.setRLSpeed(Robot.m_oi.getSpeed());\n\n\t\t// } else if (Wheel == 3) {\n\n\t\t// \tmyDrive.setFRSpeed(Robot.m_oi.getSpeed());\n\n\t\t// } else if (Wheel == 4) {\n\n\t\t// \tmyDrive.setRRSpeed(Robot.m_oi.getSpeed());\n\n\t\t// }\n\n\t\t// if (Robot.m_oi.getSafety()) {\n\n\t\t// \tspeedLimit = 1.0;\n\t\t// \tstrafeLimit = 1.0;\n\n\t\t// } else {\n\n\t\t// \tspeedLimit = 0.5; \n\t\t// \tstrafeLimit = 0.8;\n\t\t\t\t\n\t\t// }\n\n\n\n\t\t//System.out.print (\"strafeLimit: \" + strafeLimit);\n\t\t//System.out.println(Robot.m_oi.getX() * strafeLimit);\n\n\t\t// myDrive.driveCartesian(\n\t\t// \t(Robot.m_oi.getY() * speedLimit), // set Y speed\n\t\t// \t(Robot.m_oi.getX() * strafeLimit), // set X speed\n\t\t// \t(Robot.m_oi.getRotate() * rotateLimit), // set rotation rate\n\t\t// \t0); // gyro angle \n\t\t\n\t\t//TODO: Rotate robot with vision tracking, set up curve to slow down as target approaches center.\n\t\t// if (Robot.m_oi.getStartButton()) {\n\t\t// \tmyDrive.driveCartesian(\n\t\t// \t\t (0.4), // set Rotation\n\t\t// \t\t (0.0), // set Strafe\n\t\t// \t\t (0.0), // set Forward/Back\n\t\t// \t\t 0);\n\t\t// } else {\n\t\tmyDrive.driveCartesian(\n\t\t\t(Robot.m_oi.getY() * rotateLimit), // set Y speed\n\t\t\t(Robot.m_oi.getX() * strafeLimit), // set X speed\n\t\t\t(Robot.m_oi.getRotate() * speedLimit), // set rotation rate\n\t\t\t0);\n\t\t// }\n\t\t// myDrive.driveCartesian(\n\t\t// \t(Robot.m_oi.getY()), // set Y speed\n\t\t// \t(Robot.m_oi.getX()), // set X speed\n\t\t// \t(Robot.m_oi.getRotate()), // set rotation rate\n\t\t// \t0); \n\n }", "@Override\n public void robotInit()\n {\n wireUpOperatorInterface();\n chooser.setDefaultOption(\"Default Auto\", driveCommand);\n // chooser.addOption(\"My Auto\", new MyAutoCommand());\n SmartDashboard.putData(\"Auto mode\", chooser);\n }", "public void robotInit() {\n\t\t\n\t\tupdateDashboard();\n\t\t\n \tautoChooser = new SendableChooser();\n \tautoChooser.addDefault(\"Default Autonomous does nothing!\", new Default());\n \t// Default Autonomous does nothing\n \tautoChooser.addObject(\"Cross the Low Bar Don't Run This it doesn't work\", new LowBar());\n \tautoChooser.addObject(\"Cross Rough Patch/Stone Wall\", new Main());\n \tautoChooser.addObject(\"Cross the Low Bar, Experimental!\", new LowBarEx());\n \t//autoChooser.addObject(\"If Jonathan lied to us and we can cross twice\", new RoughPatch());\n \tCameraServer server = CameraServer.getInstance();\n\n \tserver.setQuality(50);\n \t\n \tSmartDashboard.putData(\"Autonomous\", autoChooser);\n\n \tserver.startAutomaticCapture(\"cam0\");\n \tLowBar.gyro.reset();\n \t\n \tDriverStation.reportWarning(\"The Robot is locked and loaded. Time to kick some ass guys!\", !(server.isAutoCaptureStarted()));\n\n\t}", "public void checkInputs() {\n\n gearShift = driveStick.getXButtonReleased();\n slow = driveStick.getAButtonReleased();\n\n manualClimb = driveStick.getBumper(Hand.kLeft) && driveStick.getBumper(Hand.kRight);\n\n //climbToggle = driveStick.getBumperReleased(Hand.kLeft);\n climbToggle = false;\n climbRelease = driveStick.getStartButton();\n\n resetBalls = gunnerStick.getStartButtonReleased();\n visionShoot = gunnerStick.getBButtonReleased();\n manualShoot = gunnerStick.getYButton();\n distShoot = gunnerStick.getAButton();\n intakeToggle = gunnerStick.getBumperReleased(Hand.kRight);\n hoodToggle = gunnerStick.getBumperReleased(Hand.kLeft);\n intakeReverse = gunnerStick.getXButtonReleased();\n magazineReverse = gunnerStick.getBackButton();\n\n\n //Switch statement to determine controls for the driver\n switch (driverScheme) {\n case \"Reverse Turning\":\n XSpeed = -driveStick.getY(Hand.kLeft);\n ZRotation = driveStick.getX(Hand.kRight);\n break;\n default:\n XSpeed = driveStick.getY(Hand.kLeft);\n ZRotation = -driveStick.getX(Hand.kRight);\n break;\n }\n\n //Switch statement to determine controls for the gunner\n switch (gunnerScheme) {\n case \"Fun Mode\":\n\n discoToggle = gunnerStick.getBackButtonReleased();\n break;\n\n default:\n\n // if ((gunnerStick.getTriggerAxis(Hand.kRight) >= 0.75) && (gunnerStick.getTriggerAxis(Hand.kLeft) >= 0.75) && !overriding) {\n // overrideSafeties = !overrideSafeties;\n // overriding = true;\n // } else if ((gunnerStick.getTriggerAxis(Hand.kRight) <= 0.75) && (gunnerStick.getTriggerAxis(Hand.kLeft) <= 0.75)) {\n // overriding = false;\n // }\n\n break;\n }\n }", "public void carComeIn() {\n synchronized (carsController) {\n numberOfCars ++;\n }\n }", "@Override\n\tpublic void robotInit() {\n\t\tdt = new DriveTrain();\n\t\t//Initialize drive Talons\n\t\tRobotMap.vspLeft = new WPI_TalonSRX(RobotMap.dtLeft);\n\t\tRobotMap.vspRight = new WPI_TalonSRX(RobotMap.dtRight);\n\t\t//Initialize drive slave Victors\n\t\t//RobotMap.slaveLeft = new WPI_VictorSPX(RobotMap.slaveDriveLeft);\n\t\t//RobotMap.slaveRight = new WPI_VictorSPX(RobotMap.slaveDriveRight);\n\t\t//Set drive slaves to follower mode\n\t\t//RobotMap.slaveLeft.follow(RobotMap.vspLeft);\n\t\t//RobotMap.slaveRight.follow(RobotMap.vspRight);\n\t\t//Initialize drive train\n\t\tRobotMap.rd = new DifferentialDrive(RobotMap.vspLeft, RobotMap.vspRight);\n\t\t//Initialize drive joystick\n\t\tRobotMap.stick = new Joystick(RobotMap.joystickPort);\n\t\t//Disabled drive safety\n\t\tRobotMap.vspLeft.setSafetyEnabled(false);\n\t\tRobotMap.vspRight.setSafetyEnabled(false);\n\t\tRobotMap.rd.setSafetyEnabled(false);\n\t\t//Initialize lift Talon\n\t\tRobotMap.liftTalon = new WPI_TalonSRX(5);\n\t\t//Initialize operator controller\n\t\tRobotMap.controller = new Joystick(RobotMap.controllerPort);\n\t\t//Initialize intake Victors\n\t\tRobotMap.intakeVictorLeft = new WPI_VictorSPX(RobotMap.intakeMaster);\n\t\tRobotMap.intakeVictorRight = new WPI_VictorSPX(RobotMap.intakeSlave);\n\t\t//Set right intake Victor to follow left intake Victor\n\t\tRobotMap.intakeVictorRight.follow(RobotMap.intakeVictorLeft);\n\t\t\n\t\tRobotMap.climberVictorLeft = new WPI_VictorSPX(RobotMap.climberLeftAddress);\n\t\tRobotMap.climberVictorRight = new WPI_VictorSPX(RobotMap.climberRightAddress);\n\t\t\n\t\tRobotMap.climberVictorRight.follow(RobotMap.climberVictorLeft);\n\t\t\n\t\tRobotMap.piston = new DoubleSolenoid(RobotMap.inChannel, RobotMap.outChannel);\n\t\t\n\t\tRobotMap.intakeLifter = new WPI_VictorSPX(2);\n\t\t\n\t\tRobotMap.liftTalon = new WPI_TalonSRX(RobotMap.liftTalonAddress);\n\t\t\n\t\tautoChooser = new SendableChooser();\n\t\tautoChooser.addDefault(\"Drive to baseline\" , new DriveToBaseline());\n\t\tautoChooser.addObject(\"Null auto\", new NullAuto());\n\t\tautoChooser.addObject(\"Switch from right\", new SwitchFromRight());\n\t\tautoChooser.addObject(\"Switch from left\", new SwitchFromLeft());\n\t\tautoChooser.addObject(\"PID from left\", new PIDfromLeft());\n\t\tautoChooser.addObject(\"PID from right\", new PIDfromRight());\n\t\tautoChooser.addObject(\"Scale from right\", new ScaleAutoRight());\n\t\tautoChooser.addObject(\"Scale from left\", new ScaleAutoLeft());\n\t\tautoChooser.addObject(\"PID tester\", new PIDTESTER());\n\t\tautoChooser.addObject(\"Joe use this one\", new leftOnly());\n\t\tSmartDashboard.putData(\"Autonomous mode chooser\", autoChooser);\n\t\t\n\t\t//RobotMap.liftVictor.follow(RobotMap.climberTalon);\n\t\t\n\t\tRobotMap.vspLeft.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Relative, 0, 0);\n\t\tRobotMap.vspRight.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Relative, 0, 0);\n\t\t\n\t\tRobotMap.intakeLifted = new DigitalInput(1);\n\t\tRobotMap.isAtTop = new DigitalInput(2);\n\t\tRobotMap.isAtBottom = new DigitalInput(0);\n\t\t\n\t\tRobotMap.vspLeft.configVelocityMeasurementPeriod(VelocityMeasPeriod.Period_100Ms, 1);\n\t\tRobotMap.vspRight.configVelocityMeasurementWindow(64, 1); \n\t\t\n\t\toi = new OI();\n\t}", "protected void initialize() {\n done = false;\n\n\n prevAutoShiftState = driveTrain.getAutoShift();\n driveTrain.setAutoShift(false);\n driveTrain.setCurrentGear(DriveTrain.DriveGear.High);\n// double p = SmartDashboard.getNumber(\"drive p\", TTA_P);\n// double i = SmartDashboard.getNumber(\"drive i\", TTA_I);\n// double d = SmartDashboard.getNumber(\"drive d\", TTA_D);\n// double rate = SmartDashboard.getNumber(\"rate\", TTA_RATE);\n// double tolerance = TTA_TOLERANCE; // SmartDashboard.getNumber(\"tolerance\", 2);\n// double min = SmartDashboard.getNumber(\"min\", TTA_MIN);\n// double max = SmartDashboard.getNumber(\"max\", TTA_MAX);\n// double iCap = SmartDashboard.getNumber(\"iCap\", TTA_I_CAP);\n// pid = new PID(p, i, d, min, max, rate, tolerance, iCap);\n pid = new PID(TTA_P, TTA_I, TTA_D, TTA_MIN, TTA_MAX, TTA_RATE, TTA_TOLERANCE, TTA_I_CAP);\n\n driveTrain.setSpeedsPercent(0, 0);\n driveTrain.setCurrentControlMode(ControlMode.Velocity);\n }", "private void updatePreferences() {\n\n /* Update preferences of the agent */\n patientAgent.updatePreferredAllocations();\n List<AllocationState> newPreferredAllocations = patientAgent.getAllocationStates();\n preferredAllocationsIterator = patientAgent.getAllocationStates().iterator();\n currentSize = patientAgent.getAllocationStates().size();\n\n if (newPreferredAllocations.isEmpty() || iterationsWithNoImprovementCount >= maxIterationsNum) {\n /* We shut down the behaviour if there are no better appointments\n or we exceeded the possible number of non-improving algorithm iterations\n */\n isHappyWithAppointment = true;\n\n } else if (newPreferredAllocations.size() >= currentSize) {\n\n /* No improvement has been made in our algorithm */\n iterationsWithNoImprovementCount++;\n } else {\n\n /* Improved the appointment, resetting the counter */\n iterationsWithNoImprovementCount = 0;\n }\n\n\n }", "public void init(HardwareMap ahwMap, boolean auto) {\n hwMap = ahwMap;\n\n // Define and Initialize Motors\n extensionArm = hwMap.get(DcMotor.class, \"extensionArm\");\n leftDrive = hwMap.get(DcMotor.class, \"leftDrive\");\n rightDrive = hwMap.get(DcMotor.class, \"rightDrive\");\n leftrotationArm = hwMap.get(DcMotor.class, \"leftrotationArm\");\n rightrotationArm = hwMap.get(DcMotor.class, \"rightrotationArm\");\n intake_motor = hwMap.get(DcMotor.class, \"intakeMotor\");\n if (auto) {\n leftDrive.setDirection(DcMotorSimple.Direction.REVERSE); // Set to REVERSE if using AndyMark motors\n leftDrive.setMode(DcMotor.RunMode.RUN_USING_ENCODER); // Set to REVERSE if using AndyMark motors\n rightDrive.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n rightDrive.setDirection(DcMotorSimple.Direction.FORWARD);\n }else{\n rightDrive.setDirection(DcMotorSimple.Direction.REVERSE); // Set to REVERSE if using AndyMark motors\n leftDrive.setDirection(DcMotorSimple.Direction.FORWARD);\n }\n\n leftrotationArm.setDirection(DcMotorSimple.Direction.REVERSE);\n rightrotationArm.setDirection(DcMotorSimple.Direction.REVERSE);\n\n intake_motor.setDirection(DcMotorSimple.Direction.FORWARD);\n extensionArm.setDirection(DcMotorSimple.Direction.REVERSE);\n\n // Set all motors to zero power\n leftDrive.setPower(0);\n rightDrive.setPower(0);\n\n\n leftrotationArm.setPower(0);\n\n extensionArm.setPower(0);\n intake_motor.setPower(0);\n\n // Set all motors to run without encoders.\n // May want to use RUN_USING_ENCODERS if encoders are installed.\n leftDrive.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n rightDrive.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n\n // Define and initialize ALL installed servos.\n latching_linear = hwMap.get(DcMotor.class, \"latching_linear\");\n\n latchServo = hwMap.get(Servo.class, \"latchServo\");\n verticalServo = hwMap.get(Servo.class, \"yServo\");\n //horizontalServo = hwMap.get(Servo.class, \"zServo\");\n teamMarker = hwMap.get(Servo.class, \"teamMarker\");\n }", "@Override\n\tpublic void update(MyAIController controller) {\n\t\t// Update Map\n\t\tmap.update(controller.getView());\n\t\tWorldSpatial.Direction orientation = controller.getOrientation();\n\t\tCoordinate pos = new Coordinate(controller.getPosition());\n\n\t\tSystem.out.println(state);\n\n\t\tswitch (state) {\n\t\tcase NORMAL:\n\t\t\tupdateNormal(controller, pos, orientation);\n\t\t\tbreak;\n\t\tcase WALL_FOLLOWING:\n\t\t\tupdateWallFollowing(controller, pos, orientation);\n\t\t\tbreak;\n\t\t// Checks car has moved tiles before going back to WALL_FOLLOWING state\n\t\tcase JUST_TURNED_LEFT:\n\t\t\tupdateJustTurnedLeft(controller, pos, orientation);\n\t\t\tbreak;\n\t\tcase PASSING_TRAP:\n\t\t\tupdatePassingTrap(controller, pos, orientation);\n\t\t\tbreak;\n\t\t}\n\t}", "public void applyStrategy(){\n\t\tfloat dx, dy;\n\t\t\n\t\tdx = targetCar.getX() - myCar.getX();\n\t\tdy = targetCar.getY() - myCar.getY();\n\t\t\n\t\t// awesome, atan2 handles all the hard parts of arctan calculations\n\t\tint angle = (int)Math.toDegrees( Math.atan2(dx, dy) );\n\t\tmyCar.setHeading( angle );\n\t}", "@Override\n public void autonomousInit() {\n\tgameData.readGameData();\n\tautonomousCommand = (Command) chooserMode.getSelected();\n\tdriveSubsystem.resetEncoders();\n\televatorSubsystem.resetEncoder();\n\t// schedule the autonomous command\n\tif (autonomousCommand != null) {\n\t // SmartDashboard.putString(\"i\", \"nit\");\n\t autonomousCommand.start();\n\t}\n }", "@Override\n\tpublic void update(float delta) {\n\t\tHashMap<Coordinate, MapTile> currentView = getView();\n\t\tcheckStateChange();\n\t\tfor(Coordinate i : currentView.keySet()) {\n\t\t\t\n\t\t\t//Building up wholeMap with data from currentView\n\t\t\tif(i.x >= 0 && i.y >= 0 && i.x < World.MAP_WIDTH && i.y < World.MAP_HEIGHT ) {\n\t\t\t\twholeMap.put(i, currentView.get(i));\n\t\t\t}\n\t\n\t\t}\n//\t\tif(getSpeed() > CAR_SPEED/2f){\n//\t\t\tapplyBrake();\n//\t\t}\n\n//\t\tif(checkWallAhead(getOrientation(), currentView)){\n//\t\t\tisReversing = true;\n//\t\t}\n//\t\tif(checkRightWall(getOrientation(), currentView)){\n//\t\t\tisTurningLeft = true;\n//\t\t}\n//\t\tif(checkLeftWall(getOrientation(), currentView)){\n//\t\t\tisTurningRight = true;\n//\t\t}\n\n\n\n\t\tdebugPrint(\"STATES: A: \" + isAccelerating +\" Rv: \"+ isReversing +\n\t\t\" L: \"+ isTurningLeft + \" R: \"+isTurningRight);\n\n\n\t\t//Handles Steering\n\t\tif(isTurningLeft){\n\t\t\tdebugPrint(\"TRYING TO TURN LEFT\");\n\t\t\tapplySafeLeftTurn(delta);\n\t\t} else if(isTurningRight){\n\t\t\tdebugPrint(\"TRYING TO TURN RIGHT\");\n\t\t\tapplySafeRightTurn(delta);\n\t\t}\n\t\tif(isAccelerating){\n\t\t\tdebugPrint(\"No\");\n\t\t\tapplySafeForwardAcceleration();\n\t\t}\n\n\t\tif(isReversing){\n\t\t\tapplySafeReverseAcceleration();\n//\t\t\tisReversing = false;\n\n\t\t}\n\n\n\n\n\n\t\t//\n\t\tif(hasReachedNextDest) {\n\t\t\tdebugPrint(\"Recalculating Route.\");\n\t\t\tList<Node> result =exploreDijkstras(new Coordinate(carrrr.getPosition()));\n\t\t\tresult.add(new Node(\"1,2\"));\n\t\t\tpathList.add(result);\n\t\t\thasReachedNextDest = false;\n\t\t}\n\n\n\n\n\t\t//Car movement code-----------------------------------------------------------------------------------\n\t\t//If there's a path in the path array to follow\n\t\tif(pathList.size() > 0 || processing) {\n\t\t\tif(processing) {\n\t\t\t\tcheckStateChange();\n\n\t\t\t\t//Identify if target tile is N,S,E or W.\n\t\t\t\ttry {\n\t\t\t\t\tpath.get(counter+1);\n\t\t\t\t}\n\t\t\t\tcatch(Exception e) {\n\t\t\t\t\tdebugPrint(\"Starting new path\");\n\t\t\t\t\tcounter = 0;\n\t\t\t\t\tprocessing = false;\n\t\t\t\t\thasReachedNextDest = true;\n\t\t\t\t}\n\n\n\n\t\t\t\tCoordinate currPos = new Coordinate (getPosition());\n\t\t\t\tCoordinate targetPos = new Coordinate(path.get(counter).getName());\n\n\t\t\t\tif(!coordList.contains(currPos)){\n\t\t\t\t\tdebugPrint(\"Recalculating Route (Not on route).\");\n\t\t\t\t\tList<Node> result =exploreDijkstras(new Coordinate(getPosition()));\n\t\t\t\t\tresult.add(new Node(\"99,99\")); //This is just to make sure something is there.\n\t\t\t\t\tpathList.add(result);\n\t\t\t\t\tprocessing = false;\n\t\t\t\t\tdebugPrint(result);\n\t\t\t\t\tcounter = 0;\n\t\t\t\t}\n\n\n\t\t\t\tWorldSpatial.Direction dir = getDirection(currPos, targetPos);\n\n\t\t\t\tboolean isFacingTarget = false;\n\n\t\t\t\tSystem.out.println(\"-----------------\");\n\t\t\t\tdebugPrint(\"currPos: \"+ currPos);\n\t\t\t\tdebugPrint(\"targetPos: \"+ targetPos);\n\t\t\t\tSystem.out.println(\"-----------------\");\n\n\t\t\t\t// If we are on the target, move on to next.\n\t\t\t\tif(currPos.equals(targetPos)) {\n\t\t\t\t\tcounter++;\n\t\t\t\t\tcurrPos = targetPos;\n\t\t\t\t\ttargetPos = new Coordinate(path.get(counter).getName());\n\n\n\n\t\t\t\t\tif(!isFacingTarget){\n//\t\t\t\t\t\tisTurningSoon = true;\n\t\t\t\t\t\trotateAntiClockwise(delta);\n\n\t\t\t\t\t}\n\t\t\t\t\tdir = getDirection(currPos, targetPos);\n\t\t\t\t\tSystem.out.println(\"dir: \"+ dir);\n\t\t\t\t}\n\t\t\t\telse {\n\n\t\t\t\t\tSystem.out.println(\"dir: \"+ dir + \"|| carFront: \" + getOrientation());\n\t\t\t\t\tisFacingTarget = dir.equals(getOrientation());\n\n\t\t\t\t\tif(dir.equals(oppositeOfOrientation(getOrientation()))){\n\t\t\t\t\t\tisReversing = true;\n\t\t\t\t\t\tisAccelerating = false;\n\t\t\t\t\t}\n\n\t\t\t\t\t//Not on target yet.\n\t\t\t\t\tif(!isFacingTarget && isReversing) {\n\t\t\t\t\t\t//If not moving in Direction of target Coord:\n\t\t\t\t\t\tif(leftOrRight(dir) == null){\n\t\t\t\t\t\t\t//this is bad.\n\t\t\t\t\t\t\tdebugPrint(\"Not left or right?\");\n\t\t\t\t\t\t\tdebugPrint(\"UTURN REQUIRED\");\n\t\t\t\t\t\t\trotateAntiClockwise(delta);\n\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tisReversing = false;\n\t\t\t\t\t\t\tdebugPrint(\"leftOrRight: \" + leftOrRight(dir));\n\t\t\t\t\t\t\tlastTurnDirection = leftOrRight(dir);\n\t\t\t\t\t\t\tint targetDegree = directionToDegree(dir);\n\n\t\t\t\t\t\t\tdebugPrint(\"PEEK: \"+peek(getVelocity(), targetDegree, WorldSpatial.RelativeDirection.RIGHT, delta).getCoordinate().toString());\n\n\t\t\t\t\t\t\tif(peek(getVelocity(), targetDegree, WorldSpatial.RelativeDirection.RIGHT, delta).getCoordinate().equals(currPos)){\n\t\t\t\t\t\t\t\t//isAccelerating = true;\n//\t\t\t\t\t\t\t\tapplyForwardAcceleration();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(lastTurnDirection.equals(WorldSpatial.RelativeDirection.RIGHT)){\n\t\t\t\t\t\t\t\tif(peek(getVelocity(),targetDegree, WorldSpatial.RelativeDirection.RIGHT, delta).getCoordinate().equals(targetPos)){\n\t\t\t\t\t\t\t\t\tdebugPrint(\"RIGHT TURN SAFE\");\n\t\t\t\t\t\t\t\t\tisTurningRight = true;\n\t\t\t\t\t\t\t\t\tisAccelerating = false;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tisTurningRight = false;\n\t\t\t\t\t\t\t\t\tisAccelerating = true;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else{\n\t\t\t\t\t\t\t\tif(peek(getVelocity(),targetDegree, WorldSpatial.RelativeDirection.LEFT, delta).getCoordinate().equals(targetPos)) {\n\t\t\t\t\t\t\t\t\tdebugPrint(\"LEFT TURN SAFE\");\n\n\t\t\t\t\t\t\t\t\tisTurningLeft = true;\n\t\t\t\t\t\t\t\t\tisAccelerating = false;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tisTurningLeft = false;\n\t\t\t\t\t\t\t\t\tisAccelerating = 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\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\treadjust(lastTurnDirection, delta);\n\t\t\t\t\t\t//If moving in right direction,\n\t\t\t\t\t\t//Accelerate if not traveling at max speed\n\t\t\t\t\t\tfloat x = CAR_SPEED;\n\t\t\t\t\t\tif(isTurningSoon) {\n\t\t\t\t\t\t\tx = CAR_SPEED/4f;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(getSpeed() < x){\n\t\t\t\t\t\t\tisTurningSoon = false;\n\t\t\t\t\t\t\t//isAccelerating = true;\n//\t\t\t\t\t\t\tapplyForwardAcceleration();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tif(useTestPath){\n\t\t\t\t\tmakeTestPath();\n\t\t\t\t\tpath = testpath;\n\t\t\t\t} else {\n\t\t\t\t\tpath = pathList.poll();\n\t\t\t\t\t//Populate coordList\n\t\t\t\t\tfor(Node n: path){\n\t\t\t\t\t\tcoordList.add(new Coordinate(n.getName()));\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tdebugPrint(path);\n\t\t\t\tprocessing = true; \n\t\t\t\t\n\t\t\t}\n\t\n\t\t\t\n\t\t} else {\n\t\t\tdebugPrint(\"End of path list\");\n\t\t}\n\n\n\n\n\n\n\n/*\t\t// If you are not following a wall initially, find a wall to stick to!\n\t\tif(!isFollowingWall){\n\t\t\tif(getSpeed() < CAR_SPEED){\n\t\t\t\tapplyForwardAcceleration();\n\t\t\t}\n\t\t\t// Turn towards the north\n\t\t\tif(!getOrientation().equals(WorldSpatial.Direction.NORTH)){\n\t\t\t\tlastTurnDirection = WorldSpatial.RelativeDirection.LEFT;\n\t\t\t\tapplyLeftTurn(getOrientation(),delta);\n\t\t\t}\n\t\t\tif(checkNorth(currentView)){\n\t\t\t\t// Turn right until we go back to east!\n\t\t\t\tif(!getOrientation().equals(WorldSpatial.Direction.EAST)){\n\t\t\t\t\tlastTurnDirection = WorldSpatial.RelativeDirection.RIGHT;\n\t\t\t\t\tapplyRightTurn(getOrientation(),delta);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tisFollowingWall = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Once the car is already stuck to a wall, apply the following logic\n\t\telse{\n\n\t\t\t// Readjust the car if it is misaligned.\n\t\t\treadjust(lastTurnDirection,delta);\n\n\t\t\tif(isTurningRight){\n\t\t\t\tapplyRightTurn(getOrientation(),delta);\n\t\t\t}\n\t\t\telse if(isTurningLeft){\n\t\t\t\t// Apply the left turn if you are not currently near a wall.\n\t\t\t\tif(!checkFollowingWall(getOrientation(),currentView)){\n\t\t\t\t\tapplyLeftTurn(getOrientation(),delta);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tisTurningLeft = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Try to determine whether or not the car is next to a wall.\n\t\t\telse if(checkFollowingWall(getOrientation(),currentView)){\n\t\t\t\t// Maintain some velocity\n\t\t\t\tif(getSpeed() < CAR_SPEED){\n\t\t\t\t\tapplyForwardAcceleration();\n\t\t\t\t}\n\t\t\t\t// If there is wall ahead, turn right!\n\t\t\t\tif(checkWallAhead(getOrientation(),currentView)){\n\t\t\t\t\tlastTurnDirection = WorldSpatial.RelativeDirection.RIGHT;\n\t\t\t\t\tisTurningRight = true;\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t// This indicates that I can do a left turn if I am not turning right\n\t\t\telse{\n\t\t\t\tlastTurnDirection = WorldSpatial.RelativeDirection.LEFT;\n\t\t\t\tisTurningLeft = true;\n\t\t\t}\n\t\t}\n\n\t\t*/\n\n\t}", "public void updateUi() {\n\t\t// // update the car color to reflect premium status or lack thereof\n\t\t// ((ImageView)findViewById(R.id.free_or_premium)).setImageResource(mIsPremium\n\t\t// ? R.drawable.premium : R.drawable.free);\n\t\t//\n\t\t// // \"Upgrade\" button is only visible if the user is not premium\n\t\t// findViewById(R.id.upgrade_button).setVisibility(mIsPremium ?\n\t\t// View.GONE : View.VISIBLE);\n\t\t//\n\t\t// // \"Get infinite gas\" button is only visible if the user is not\n\t\t// subscribed yet\n\t\t// findViewById(R.id.infinite_gas_button).setVisibility(mSubscribedToInfiniteGas\n\t\t// ?\n\t\t// View.GONE : View.VISIBLE);\n\t\t//\n\t\t// // update gas gauge to reflect tank status\n\t\t// if (mSubscribedToInfiniteGas) {\n\t\t// ((ImageView)findViewById(R.id.gas_gauge)).setImageResource(R.drawable.gas_inf);\n\t\t// }\n\t\t// else {\n\t\t// int index = mTank >= TANK_RES_IDS.length ? TANK_RES_IDS.length - 1 :\n\t\t// mTank;\n\t\t// ((ImageView)findViewById(R.id.gas_gauge)).setImageResource(TANK_RES_IDS[index]);\n\t\t// }\n\t}", "protected void initialize() {\n \t//Robot.getFlywheel().setRunning(!Robot.getFlywheel().running());\n \t//Robot.getElevator().setRunning(!Robot.getElevator().running());\n \tif (run == false)\n \t{\n \t\tRobot.getFlywheel().setRunning(false);\n \t\t//Robot.getIndexer().setRunning(false);\n \t\tRobot.getFlywheel().setSetpoint(0.0);\n \t\tRobot.getFlywheel().disable();\n \t\t//Robot.getIndexer().disable();\n \t\tSystem.out.println(\"not running\");\n \t}\n \telse\n \t{\n \t\tRobot.getFlywheel().initialize();\n \t\tRobot.getFlywheel().enable();\n \t\tRobot.getFlywheel().setRunning(true);\n \t\tdouble m_motorLevel;\n \t\t//m_rpms = SmartDashboard.getNumber(\"FlywheelVelocity\", 1850);\n \t//m_motorLevel = m_rpms / 6750 * 1.35;//6750 = max rpms\n \tm_motorLevel =( m_rpms + 1000) / 6750 *1.1;//6750 = max rpms\n \tRobot.getFlywheel().setSetpoint(m_rpms);\n \tRobot.getFlywheel().setExpectedMotorLevel(m_motorLevel);\n \tSmartDashboard.putNumber(\"FlywheelVelocity\", m_rpms);\n \tSystem.out.println(m_rpms + \" \" + m_motorLevel + \" setpoint: \" + Robot.getFlywheel().getSetpoint());\n \t}\n }", "public void manageJunction() {\r\n for (Vehicle v : this.getVehicles()) {\r\n v.act();\r\n }\r\n }", "public void autonomousInit() {\n Jagbot.isAutonomous = true;\n int mode = (int)SmartDashboard.getNumber(RobotMap.Autonomous.MODE_KEY);\n switch (mode) {\n case 0:\n System.out.println(\"Standing still\");\n new StandStill().start();\n break;\n case 1:\n System.out.println(\"Driving forward\");\n new DriveStraight(1).start();\n break;\n \n case 2:\n System.out.println(\"Turning left and shooting to score\");\n new TurnAndScore(-1).start();\n break;\n case 3:\n System.out.println(\"Turning right and shooting to score\");\n new TurnAndScore(1).start();\n break;\n }\n }", "public void commonPeriodic()\n {\n double d1LeftJoystick = driver1.getAxis(driver1.LAxisUD);\n double d1RightJoystick = driver1.getAxis(driver1.RAxisUD);\n\n double d2LeftJoystick = driver2.getAxis(driver2.LAxisUD);\n double d2RightJoystick = driver2.getAxis(driver2.RAxisUD);\n\n // -------------------- DRIVER 1\n\n driveTrain.drive(d1LeftJoystick * speedModifier, d1RightJoystick * speedModifier);\n\n // driver1 controls ramp\n // press start and select together to deploy\n if(driver1.down(driver1.Start) && driver1.down(driver1.Select))\n {\n ramp.deploy();\n hatchArm.fingerGrab();\n }\n else\n {\n ramp.undeploy();\n }\n\n // driver 1 can double speed by holding L2\n //driveTrain.fastSpeed = driver1.down(driver1.L2);\n if(driver1.pressed(driver1.A))\n {\n driveTrain.slowSpeed = !driveTrain.slowSpeed;\n System.out.println(\"Fast speed toggled to: \" + driveTrain.slowSpeed);\n }\n\n //drive straight\n if(driver1.down(driver1.L1))\n {\n driveTrain.set_right_motors(speedModifier);\n }\n if(driver1.down(driver1.R1))\n {\n driveTrain.set_left_motors(speedModifier);\n }\n\n // flip drive orientation\n if(driver1.pressed(driver1.Select))\n {\n driveTrain.flip_orientation();\n \n if(driveTrain.isFacingForward())\n {\n camServForward.setSource(camFront);\n //camServReverse.setSource(camBack);\n // camBack.free();\n // camFront.close();\n // camFront = CameraServer.getInstance().startAutomaticCapture(0);\n // camBack = CameraServer.getInstance().startAutomaticCapture(1);\n }\n else\n {\n camServForward.setSource(camBack);\n //camServReverse.setSource(camFront);\n // camBack.close();\n // camFront.close();\n // camFront = CameraServer.getInstance().startAutomaticCapture(1);\n // camBack = CameraServer.getInstance().startAutomaticCapture(0);\n }\n }\n\n\n // -------------------- DRIVER 2\n\n\n // up is out\n // down is in\n // (when it's negated)\n cargoArm.spinBallMotor(-1 * d2LeftJoystick * 0.9);\n\n // control hatch placement pistons\n if(driver2.pressed(driver2.A))\n {\n hatchArm.pushPistons();\n }\n else if (driver2.released(driver2.A))\n {\n hatchArm.retractPistons();\n }\n\n // open/close hatch grabber arms\n if(driver2.pressed(driver2.B))\n {\n hatchArm.toggleGrabber();\n }\n\n if(driver2.pressed(driver2.Select))\n {\n //cargoArm.toggleArmLock();\n hatchArm.toggleFinger();\n }\n\n // extend/de-extend cargo hand\n if(driver2.pressed(driver2.Start))\n {\n cargoArm.toggleHand();\n }\n\n // button 7: L2\n // button 8: R2\n // L2 will reverse the finger\n // R2 will rotate it forward\n if(driver2.down(driver2.L1))\n {\n hatchArm.rotateFinger(1);\n }\n else\n {\n if(driver2.down(driver2.L2))\n {\n hatchArm.rotateFinger(-1);\n }\n else\n {\n hatchArm.rotateFinger(0);\n }\n }\n\n \n // button 5: L1\n // button 6: R1\n // L1 will move the hatch arm one way\n // R1 will move it the other way\n if(driver2.down(driver2.R1))\n {\n hatchArm.rotateArm(-1 * speedModifier);// * 0.75);\n }\n else\n {\n if(driver2.down(driver2.R2))\n {\n hatchArm.rotateArm(1 * speedModifier);// * 0.75);\n }\n else\n {\n hatchArm.rotateArm(0);\n }\n }\n\n \n // button 1: x\n // button 4: y\n // button 1 will move the ball arm one way\n // button 4 will move it the other way\n if(driver2.down(driver2.X))\n {\n //cargoArm.requestMove(-1 * speedModifier);\n cargoArm.rotateArm(-1);\n //cargoArm.solArmBrake.set(false);\n }\n else\n {\n if(driver2.down(driver2.Y))\n {\n //cargoArm.requestMove(2 * speedModifier);\n cargoArm.rotateArm(1);\n //cargoArm.solArmBrake.set(false);\n }\n else\n {\n //cargoArm.rotateArm(cargoArm.getArmCalculation());\n //cargoArm.solArmBrake.set(true);\n cargoArm.rotateArm(0);\n }\n }\n if(driver2.released(driver2.X) || driver2.released(driver2.Y))\n {\n //cargoArm.setArmTarget(cargoArm.currentPosition());\n //cargoArm.solArmBrake.set(true);\n cargoArm.rotateArm(0);\n }\n\n if(driver2.dpad(driver2.Up))\n {\n cargoArm.setArmUp();\n }\n if(driver2.dpad(driver2.Down))\n {\n cargoArm.setArmDown();\n }\n if(driver2.dpad(driver2.Left))\n {\n cargoArm.setArmMid();\n }\n if(driver2.dpad(driver2.Right))\n {\n cargoArm.setArmLow();\n }\n\n if(driver2.pressed(driver2.LThumb))\n {\n cargoArm.armLockEnabled = !cargoArm.armLockEnabled;\n \n }\n if(driver2.pressed(driver2.RThumb))\n {\n cargoArm.toggleBrake();\n }\n\n\n // allow move-to calculations to occur\n hatchArm.periodic();\n cargoArm.periodic();\n }", "@Override public void init_loop() {\n if (gyro.isCalibrated()) {\n telemetry.addData(\"Gyro\", \"Calibrated\");\n }\n\n /** Place any code that should repeatedly run after INIT is pressed but before the op mode starts here. **/\n }", "public abstract void setCarMake();", "@Override\n public void autonomousPeriodic() {\n \n //Switch is used to switch the autonomous code to whatever was chosen\n // on your dashboard.\n //Make sure to add the options under m_chooser in robotInit.\n switch (m_autoSelected) {\n case kCustomAuto:\n // Put custom auto code here\n break;\n case kDefaultAuto:\n default:\n if (m_timer.get() < 2.0){\n m_driveTrain.arcadeDrive(0.5, 0); //drive forward at half-speed\n } else {\n m_driveTrain.stopMotor(); //stops motors once 2 seconds have elapsed\n }\n break;\n }\n }", "@Override\n public void handle(Car car) {\n\t SimpleMaxXCar inter = (SimpleMaxXCar) Main.intersection;\n try {\n sleep(car.getWaitingTime());\n } catch (InterruptedException e) {\n e.printStackTrace();\n } // NU MODIFICATI\n\n\t try {\n\t\t System.out.println(\"Car \"+ car.getId() + \" has reached the roundabout from lane \"\n\t\t\t\t + car.getStartDirection());\n\t\t // semafor de x pt fiecare directie\n\t\t inter.s.get(car.getStartDirection()).acquire();\n\t\t System.out.println(\"Car \"+ car.getId() + \" has entered the roundabout from lane \"\n\t\t\t\t + car.getStartDirection());\n\n\t\t // sleep t secunde cand masina e in giratoriu\n\t\t sleep(inter.t);\n\n\t\t System.out.println(\"Car \"+ car.getId() +\" has exited the roundabout after \"\n\t\t\t\t + inter.t + \" seconds\");\n\n\t\t inter.s.get(car.getStartDirection()).release();\n\n\t } catch (InterruptedException e) {\n\t\t e.printStackTrace();\n\t }\n }", "public void update() {\n\n if (!isSelected){\n goalManagement();\n }\n\n if (chair != null){ // si une chaise lui est désigné\n if (!hasAGoal && !isSelected){ // et qu'il n'a pas d'objectif\n setSit(true);\n position.setX(chair.getX());\n }\n\n if (isSit){\n chair.setChairState(Chair.ChairState.OCCUPIED);\n }else {\n chair.setChairState(Chair.ChairState.RESERVED);\n }\n }\n\n if (tired > 0 ){\n tired -= Constants.TIRED_LOSE;\n }\n\n if (isSit && comfort>0){\n comfort -= Constants.COMFORT_LOSE;\n }\n\n if (isSitOnSofa && comfort<100){\n comfort += Constants.COMFORT_WIN;\n }\n\n if (!hasAGoal && moveToCoffee && coffeeMachine!=null){\n moveToCoffee = false;\n tired=100;\n\n coffeeMachine.setCoffeeTimer(new GameTimer()) ;\n coffeeMachine.getCoffeeTimer().setTimeLimit(Constants.COFFEE_TIME_TO_AVAILABLE);\n coffeeMachine = null;\n backToSpawn();\n }\n\n if (!hasAGoal && moveToSofa){\n moveToSofa = false;\n isSitOnSofa = true;\n dir = 0 ;\n position.setY(position.getY()-Constants.TILE_SIZE);\n }\n\n if (isSelected){\n flashingColor ++;\n if (flashingColor > 2 * flashingSpeed){\n flashingColor = 0;\n }\n }\n\n }", "@Override\n public void runOpMode () {\n motor1 = hardwareMap.get(DcMotor.class, \"motor1\");\n motor2 = hardwareMap.get(DcMotor.class, \"motor2\");\n\n telemetry.addData(\"Status\", \"Initialized\");\n telemetry.update();\n //Wait for game to start (driver presses PLAY)\n waitForStart();\n\n /*\n the overridden runOpMode method happens with every OpMode using the LinearOpMode type.\n hardwareMap is an object that references the hardware listed above (private variables).\n The hardwareMap.get method matches the name of the device used in the configuration, so\n we would have to change the names (ex. motorTest to Motor 1 or Motor 2 (or something else))\n if not, the opMode won't recognize the device\n\n in the second half of this section, it uses something called telemetry. In the first and\n second lines it sends a message to the driver station saying (\"Status\", \"Initialized\") and\n then it prompts the driver to press start and waits. All linear functions should have a wait\n for start command so that the robot doesn't start executing the commands before the driver\n wants to (or pushes the start button)\n */\n\n //run until end of match (driver presses STOP)\n double tgtpower = 0;\n while (opModeIsActive()) {\n telemetry.addData(\"Left Stick X\", this.gamepad1.left_stick_x);\n telemetry.addData(\"Left Stick Y\", this.gamepad1.left_stick_y);\n telemetry.addData(\"Right Stick X\", this.gamepad1.right_stick_x);\n telemetry.addData(\"Right Stick Y\", this.gamepad1.right_stick_y);\n if (this.gamepad1.left_stick_y < 0){\n tgtpower=-this.gamepad1.left_stick_y;\n motor1.setPower(tgtpower);\n motor2.setPower(-tgtpower);\n }else if (this.gamepad1.left_stick_y > 0){\n tgtpower=this.gamepad1.left_stick_y;\n motor1.setPower(-tgtpower);\n motor2.setPower(tgtpower);\n }else if (this.gamepad1.left_stick_x > 0){\n tgtpower=this.gamepad1.left_stick_x;\n motor1.setPower(tgtpower);\n motor2.setPower(tgtpower);\n }else if (this.gamepad1.left_stick_x < 0){\n tgtpower=-this.gamepad1.left_stick_x;\n motor1.setPower(-tgtpower);\n motor2.setPower(-tgtpower);\n }else{\n motor1.setPower(0);\n motor2.setPower(0);\n }\n telemetry.addData(\"Motor1 Power\", motor1.getPower());\n telemetry.addData(\"Motor2 Power\", motor2.getPower());\n telemetry.addData(\"Status\", \"Running\");\n telemetry.update ();\n\n\n /*\n if (this.gamepad1.right_stick_x == 1){\n //trying to make robot turn right, == 1 may be wrong\n motor2.setPower(-1);\n }\n else if (this.gamepad1.right_stick_x == -1){\n //trying to make robot turn left, == -1 may be wrong\n motor1.setPower(-1);\n }\n else {\n\n }\n */\n\n\n /*\n After the driver presses start,the opMode enters a while loop until the driver presses stop,\n while the loop is running it will continue to send messages of (\"Status\", \"Running\") to the\n driver station\n */\n\n\n }\n }", "@Override public void init() {\n /// Important Step 2: Get access to a list of Expansion Hub Modules to enable changing caching methods.\n all_hubs_ = hardwareMap.getAll(LynxModule.class);\n /// Important Step 3: Option B. Set all Expansion hubs to use the MANUAL Bulk Caching mode\n for (LynxModule module : all_hubs_ ) {\n switch (motor_read_mode_) {\n case BULK_READ_AUTO:\n module.setBulkCachingMode(LynxModule.BulkCachingMode.AUTO);\n break;\n case BULK_READ_MANUAL:\n module.setBulkCachingMode(LynxModule.BulkCachingMode.MANUAL);\n break;\n case BULK_READ_OFF:\n default:\n module.setBulkCachingMode(LynxModule.BulkCachingMode.OFF);\n break;\n }\n }\n\n /// Use the hardwareMap to get the dc motors and servos by name.\n\n motorLF_ = hardwareMap.get(DcMotorEx.class, lfName);\n motorLB_ = hardwareMap.get(DcMotorEx.class, lbName);\n motorRF_ = hardwareMap.get(DcMotorEx.class, rfName);\n motorRB_ = hardwareMap.get(DcMotorEx.class, rbName);\n motorLF_.setDirection(DcMotor.Direction.REVERSE);\n motorLB_.setDirection(DcMotor.Direction.REVERSE);\n\n // map odometry encoders\n verticalLeftEncoder = hardwareMap.get(DcMotorEx.class, verticalLeftEncoderName);\n verticalRightEncoder = hardwareMap.get(DcMotorEx.class, verticalRightEncoderName);\n horizontalEncoder = hardwareMap.get(DcMotorEx.class, horizontalEncoderName);\n\n if( USE_ENCODER_FOR_TELEOP ) {\n motorLF_.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n motorLF_.setMode ( DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n motorLB_.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n motorLB_.setMode ( DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n motorRF_.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n motorRF_.setMode ( DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n motorRB_.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n motorRB_.setMode ( DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n\n verticalLeftEncoder.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n verticalRightEncoder.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n horizontalEncoder.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n\n motorLF_.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n motorLB_.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n motorRF_.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n motorRB_.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n }\n\n if( USE_INTAKE ) {\n motor_left_intake_ = hardwareMap.get(DcMotorEx.class, \"motorLeftIntake\");\n motor_right_intake_ = hardwareMap.get(DcMotorEx.class, \"motorRightIntake\");\n motor_right_intake_.setDirection(DcMotor.Direction.REVERSE) ;\n\n motor_left_intake_.setMode( DcMotor.RunMode.STOP_AND_RESET_ENCODER );\n motor_left_intake_.setMode( DcMotor.RunMode.RUN_USING_ENCODER );\n motor_right_intake_.setMode( DcMotor.RunMode.STOP_AND_RESET_ENCODER );\n motor_right_intake_.setMode( DcMotor.RunMode.RUN_USING_ENCODER );\n\n servo_left_intake_ = hardwareMap.servo.get(\"servoLeftIntake\");\n servo_left_intake_pos_ = CR_SERVO_STOP ;\n servo_left_intake_.setPosition(CR_SERVO_STOP);\n servo_right_intake_ = hardwareMap.servo.get(\"servoRightIntake\");\n servo_right_intake_pos_ = CR_SERVO_STOP ;\n servo_right_intake_.setPosition(CR_SERVO_STOP);\n }\n if( USE_LIFT ) {\n motor_lift_ = hardwareMap.get(DcMotorEx.class, \"motorLift\");\n motor_lift_.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n motor_lift_.setMode( DcMotor.RunMode.STOP_AND_RESET_ENCODER );\n power_lift_ = 0.0;\n if( USE_RUN_TO_POS_FOR_LIFT ) {\n motor_lift_.setTargetPosition(0);\n motor_lift_.setMode( DcMotor.RunMode.RUN_TO_POSITION ); // must call setTargetPosition() before switching to RUN_TO_POSISTION\n } else {\n motor_lift_.setMode( DcMotor.RunMode.RUN_USING_ENCODER);\n }\n last_stone_lift_enc_ = -1;\n }\n\n if( USE_STONE_PUSHER ) {\n servo_pusher_ = hardwareMap.servo.get(\"servoPusher\");\n servo_pusher_.setPosition(PUSHER_INIT);\n servo_pusher_pos_ = PUSHER_INIT;\n }\n if( USE_STONE_GATER ) {\n servo_gater_ = hardwareMap.servo.get(\"servoGater\");\n servo_gater_.setPosition(GATER_INIT);\n servo_gater_pos_ = GATER_INIT;\n }\n\n if( USE_ARM ) {\n servo_arm_ = hardwareMap.servo.get(\"servoArm\");\n servo_arm_.setPosition(ARM_INIT);\n servo_arm_pos_ = ARM_INIT;\n servo_claw_ = hardwareMap.servo.get(\"servoClaw\");\n servo_claw_.setPosition(CLAW_OPEN);\n servo_claw_pos_ = CLAW_OPEN;\n }\n\n if( USE_HOOKS ) {\n servo_left_hook_ = hardwareMap.servo.get(\"servoLeftHook\");\n servo_left_hook_.setPosition(LEFT_HOOK_UP);\n servo_left_hook_pos_ = LEFT_HOOK_UP;\n servo_right_hook_ = hardwareMap.servo.get(\"servoRightHook\");\n servo_right_hook_.setPosition(RIGHT_HOOK_UP);\n servo_right_hook_pos_ = RIGHT_HOOK_UP;\n }\n\n if( USE_PARKING_STICKS ) {\n servo_left_park_ = hardwareMap.servo.get(\"servoLeftPark\");\n servo_left_park_.setPosition(LEFT_PARK_IN);\n servo_left_park_pos_ = LEFT_PARK_IN;\n servo_right_park_ = hardwareMap.servo.get(\"servoRightPark\");\n servo_right_park_.setPosition(RIGHT_PARK_IN);\n servo_right_park_pos_ = RIGHT_PARK_IN;\n }\n\n if( USE_RGB_FOR_STONE ) {\n rev_rgb_range_ = hardwareMap.get(LynxI2cColorRangeSensor.class, \"stoneColor\");\n //rev_rgb_range_ = hardwareMap.get(LynxI2cColorRangeSensor.class, \"stoneColorV3\"); // different interface for V3, can't define it as LynxI2cColorRangeSensor anymore, 2020/02/29\n if( rev_rgb_range_!=null ) {\n if( AUTO_CALIBRATE_RGB ) {\n int alpha = rev_rgb_range_.alpha();\n //double dist = rev_rgb_range_.getDistance(DistanceUnit.CM);\n double dist = rev_rgb_range_.getDistance(DistanceUnit.METER);\n if( alpha>=MIN_RGB_ALPHA && alpha<100000 ) {\n rev_rgb_alpha_init_ = alpha;\n }\n if( AUTO_CALIBRATE_RGB_RANGE && !Double.isNaN(dist) ) {\n if( dist>MIN_RGB_RANGE_DIST && dist<MAX_RGB_RANGE_DIST ) {\n rev_rgb_dist_init_ = dist;\n }\n }\n }\n }\n }\n if( USE_RGBV3_FOR_STONE ) {\n //rgb_color_stone_ = hardwareMap.get(ColorSensor.class, \"stoneColorV3\");\n rgb_range_stone_ = hardwareMap.get(DistanceSensor.class, \"stoneColorV3\");\n if( AUTO_CALIBRATE_RANGE && rgb_range_stone_!=null ) {\n while(true) { // wait till range sensor gets a valid reading\n double dis = getRangeDist(RangeName.RGB_RANGE_STONE);\n if( dis>0.0 && dis<0.2 ) {\n rgb_range_stone_dist_init_ = dis;\n break;\n }\n }\n }\n }\n\n if( USE_RIGHT_RANGE ) {\n range_right_ = (Rev2mDistanceSensor) (hardwareMap.get(DistanceSensor.class, \"rightRange\"));\n if( AUTO_CALIBRATE_RANGE && range_right_!=null ) {\n while(true) { // wait till range sensor gets a valid reading\n double dis = getRangeDist(RangeName.RANGE_RIGHT);\n if( dis>0.01 && dis<2.0 ) {\n range_right_dist_init_ = dis;\n break;\n }\n }\n }\n }\n if( USE_LEFT_RANGE ) {\n range_left_ = (Rev2mDistanceSensor) (hardwareMap.get(DistanceSensor.class, \"leftRange\"));\n if( AUTO_CALIBRATE_RANGE && range_left_!=null ) {\n while(true) { // wait till range sensor gets a valid reading\n double dis = getRangeDist(RangeName.RANGE_LEFT);\n if( dis>0.01 && dis<2.0 ) {\n range_left_dist_init_ = dis;\n break;\n }\n }\n }\n }\n\n if( USE_RANGE_FOR_STONE) {\n range_stone_ = (Rev2mDistanceSensor) (hardwareMap.get(DistanceSensor.class, \"stoneRange\"));\n if( AUTO_CALIBRATE_RANGE && range_stone_!=null ) {\n while(true) { // wait till range sensor gets a valid reading\n double dis = getRangeDist(RangeName.RANGE_STONE);\n if( dis>0.01 && dis<0.5 ) {\n range_stone_dist_init_ = dis;\n break;\n }\n }\n }\n }\n\n if( USE_INTAKE_MAG_SWITCH ) {\n intake_mag_switch_ = hardwareMap.get(DigitalChannel.class, \"intake_mag_switch\");\n intake_mag_switch_.setMode(DigitalChannelController.Mode.INPUT);\n intake_mag_prev_state_ = intake_mag_switch_.getState();\n intake_mag_change_time_ = 0.0;\n }\n if( USE_STONE_LIMIT_SWITCH ) {\n stone_limit_switch_ = hardwareMap.get(DigitalChannel.class, \"stone_limit_switch\");\n stone_limit_switch_.setMode(DigitalChannelController.Mode.INPUT);\n stone_limit_switch_prev_state_ = stone_limit_switch_.getState();\n }\n\n\n /////***************************** JOY STICKS *************************************/////\n\n /// Set joystick deadzone, any value below this threshold value will be considered as 0; moved from init() to init_loop() to aovid crash\n if(gamepad1!=null) gamepad1.setJoystickDeadzone( JOYSTICK_DEAD_ZONE );\n if(gamepad2!=null) gamepad2.setJoystickDeadzone( JOYSTICK_DEAD_ZONE );\n\n resetControlVariables();\n }", "@Override\n public void robotInit() {\n // Instantiate our RobotContainer. This will perform all our button bindings, and put our\n // autonomous chooser on the dashboard.\n m_robotContainer = new RobotContainer();\n \n left_motor_1= new CANSparkMax(2,MotorType.kBrushless);\n left_motor_2=new CANSparkMax(3,MotorType.kBrushless);\n right_motor_1=new CANSparkMax(5,MotorType.kBrushless);\n right_motor_2=new CANSparkMax(6,MotorType.kBrushless);\n ball_collection_motor=new CANSparkMax(4,MotorType.kBrushless);\n left_high_eject=new CANSparkMax(1, MotorType.kBrushless);\n right_high_eject=new CANSparkMax(7,MotorType.kBrushless);\n left_belt=new TalonSRX(9);\n right_belt=new TalonSRX(11);\n left_low_eject=new TalonSRX(8);\n right_low_eject=new TalonSRX(12);\n double_solenoid_1=new DoubleSolenoid(0,1);\n joystick=new Joystick(1);\n servo=new Servo(0);\n if_correted=false;\n xbox_controller=new XboxController(0);\n servo_angle=1;\n eject_speed=0;\n go_speed=0;\n turn_speed=0;\n high_eject_run=false;\n clockwise=false;\n left_motor_1.restoreFactoryDefaults();\n left_motor_2.restoreFactoryDefaults();\n right_motor_1.restoreFactoryDefaults();\n right_motor_2.restoreFactoryDefaults();\n \n left_motor_2.follow(left_motor_1);\n right_motor_1.follow(right_motor_2);\n servo.set(0);\n currentServoAngle = 0;\n factor = 0.01;\n pushed = false;\n //right_high_eject.follow(left_high_eject);\n //right_low_eject.follow(left_low_eject);\n\n }", "@Override\n\tpublic void autonomousInit() {\n\t\tRobot.driveSubsystem.shiftDown();\n\n\t\tRobot.driveSubsystem.setBrakeMode();\n\n\t\tm_autoCmd = m_chooser.getSelected();\n\t\tif (m_autoCmd != null) {\n\t\t\tm_autoCmd.start();\n\t\t}\n\t}", "public void execute()\n {\n // obtain object references\n ttlAG = (TTL_Autoguider)TTL_Autoguider.getInstance();\n AUTOGUIDE a = (AUTOGUIDE)command;\n AGS_State desired = null;\n pmc = new AltAzPointingModelCoefficients();\n telescope.getMount().getPointingModel().addCoefficients( pmc );\n\n // start of command execution\n Timestamp start = telescope.getTimer().getTime();\n\n try\n {\n AutoguideMode mode = a.getAutoguideMode();\n\n // Guide on the Brightest guide star\n if( mode == AutoguideMode.BRIGHTEST )\n {\n\tttlAG.guideOnBrightest();\n\tdesired = AGS_State.E_AGS_ON_BRIGHTEST;\n }\n\n // Gide on a guide star between magnitudes i1 and i2\n else if( mode == AutoguideMode.RANGE )\n {\n\tint i1 = (int)\n\t ( Math.rint\n\t ( a.getFaintestMagnitude() ) * 1000.0 );\n\n\tint i2 = (int)\n\t ( Math.rint\n\t ( a.getBrightestMagnitude() ) * 1000.0 );\n\n\tttlAG.guideOnRange( i1, i2 );\n\tdesired = AGS_State.E_AGS_ON_RANGE;\n }\n\n // Guide on teh Nth brightest star\n else if( mode == AutoguideMode.RANK )\n {\n\tttlAG.guideOnRank( a.getBrightnessRank() );\n\tdesired = AGS_State.E_AGS_ON_RANK;\n }\n\n // Guide on the star at pixel coords X,Y\n else if( mode == AutoguideMode.PIXEL )\n {\n\tint i1 = (int)\n\t ( Math.rint( a.getXPixel() * 1000.0 ) );\n\n\tint i2 = (int)\n\t ( Math.rint( a.getYPixel() * 1000.0 ) );\n\n\tttlAG.guideOnPixel( i1, i2 );\n\tdesired = AGS_State.E_AGS_ON_PIXEL;\n }\n\n\n // wait for AGS state change and see if it's the desired one\n // after 200 seconds\n int sleep = 5000;\n while( ( ttlAG.get_AGS_State() == AGS_State.E_AGS_WORKING )&&\n\t ( slept < TIMEOUT ) )\n {\n\n\ttry\n\t{\n\t Thread.sleep( sleep );\n\t slept += sleep;\n\t}\n\tcatch( InterruptedException ie )\n\t{\n\t logger.log( 1, logName, ie.toString() );\n\t}\n }\n\n AGS_State actual = ttlAG.get_AGS_State();\n if( actual != desired )\n {\n\tString s = ( \"after \"+slept+\"ms AGS has acheived \"+actual.getName()+\n\t\t \" state, desired state is \"+desired.getName() );\n\tcommandDone.setErrorMessage( s );\n\tlogger.log( 1, logName, s );\n\treturn;\n }\n\n\n // get x,y of guide star depending on mode and check for age of\n // returned centroids - centroids MUST have been placed SINCE this\n // cmd impl was started.\n TTL_AutoguiderCentroid centroid;\n\n // sleep for 0.5 sec to check values have been updated\n int updateSleep = 500;\n do\n {\n\ttry\n\t{\n\t Thread.sleep( 500 );\n\t slept += 500;\n\t}\n\tcatch( InterruptedException ie )\n\t{\n\t logger.log( 1, logName, ie.toString() );\n\t}\n\n\tcentroid = ttlAG.getCentroidData();\n }\n while( centroid.getTimestamp().getSeconds() < start.getSeconds() );\n\n guideStar = ttlAG.getGuideTarget( centroid );\n\n }\n catch( TTL_SystemException se )\n {\n\n }\n\n stopGuiding = false;\n new Thread( this ).start();\n\n commandDone.setSuccessful( true );\n }", "@Override\n public void robotPeriodic() {\n\n SmartDashboard.putString(\"DB/String 0\", \": \" + ControllerMap.driverMode);\n SmartDashboard.putString(\"DB/String 3\",\n \"pot value: \" + String.valueOf(Intake.getInstance().potentiometer.getVoltage()));\n SmartDashboard.putString(\"DB/String 7\", \"Zero position: \" + Intake.getInstance().getStartingWristEncoderValue());\n SmartDashboard.putString(\"DB/String 8\",\n \"wrist encoder: \" + String.valueOf(Hardware.intakeWrist.getSensorCollection().getQuadraturePosition()));\n SmartDashboard.putString(\"DB/String 9\",\n \"Corrected wrist: \" + String.valueOf(Intake.getInstance().getCorrectedWristEncoderValue()));\n // SmartDashboard.putString(\"DB/String 4\", \"pot value: \" +\n // String.valueOf(intake.potentiometer.getValue()));\n // SmartDashboard.putString(\"DB/String 9\", \"pot voltage: \" +\n // String.valueOf(intake.potentiometer.getVoltage()));\n }", "private void refreshAC(){\n if (this.selectedTrain.getAC() == 1){\n\n this.acOnRadioButton.setSelected(true);\n\n if (this.selectedTrain.getTemp() >= this.setTemp){ this.selectedTrain.updateTemp();}\n }\n else if (this.selectedTrain.getAC() == 0){ this.acOffRadioButton.setSelected(true); }\n else if (this.selectedTrain.getAC() == -1){ this.acFailureRadioButton.setSelected(true); }\n }", "public void init() {\n//\t\tint anglesToEncTicks = (int) ((90 - currentAngle) * encoderTicksPerRev);\n//\t\tarmMotor.setEncPosition(anglesToEncTicks);\n\t\twhile (armMotor.isFwdLimitSwitchClosed() != true) {\n\t\t\tarmMotor.set(.2);\n\t\t}\n\t\tSystem.out.println(\"Calibrated!\");\n\t\tarmMotor.setEncPosition(0);\n\t}" ]
[ "0.6896747", "0.62366486", "0.6027645", "0.59955543", "0.5942654", "0.592911", "0.5907956", "0.5873553", "0.5868417", "0.5861261", "0.5847369", "0.579443", "0.5744976", "0.57422996", "0.573041", "0.57278717", "0.56926817", "0.5687348", "0.5667021", "0.56568", "0.56476265", "0.56419504", "0.56019807", "0.5592687", "0.55906177", "0.5582884", "0.5581207", "0.55785835", "0.5558006", "0.55552745", "0.5538724", "0.5518127", "0.5507294", "0.5505945", "0.5490138", "0.54786503", "0.5471392", "0.5468092", "0.5467106", "0.5456977", "0.54513955", "0.5449689", "0.54476434", "0.54472", "0.5434853", "0.54326177", "0.5427216", "0.5426668", "0.54199374", "0.54009", "0.5399019", "0.53947043", "0.53878254", "0.53861225", "0.5381588", "0.53812385", "0.53773296", "0.5367988", "0.53658974", "0.53656346", "0.53648126", "0.53613776", "0.53481716", "0.53457606", "0.5343816", "0.5342572", "0.5339129", "0.53294146", "0.53274065", "0.5324005", "0.532015", "0.53199226", "0.5319313", "0.53167456", "0.53162706", "0.53144586", "0.53134793", "0.5312727", "0.53073394", "0.5304972", "0.5304372", "0.53041226", "0.5301965", "0.5301192", "0.52922887", "0.52903324", "0.5289018", "0.5288659", "0.5288261", "0.5275873", "0.5274111", "0.52713907", "0.52682865", "0.52658564", "0.5259725", "0.5258385", "0.52527803", "0.5251396", "0.5244715", "0.52434564", "0.52419925" ]
0.0
-1
Lets the caller know whether this AutoPilot can take over the control. Some types of AutoPilot (such as TurningAutoPilot) only takes over control at certain tiles.
public boolean canTakeCharge();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean takeControl() {\n\t\tif (Squirrel.us.getDistance() <= 30 && Squirrel.notDetected)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public boolean isControllable() {\n return stats.isControllable();\n }", "@Override\n\tpublic boolean takeControl() {\n\t\treturn (Math.abs(Motor.A.getTachoCount() - Settings.motorAAngle) > 5 || (Motor.A.getTachoCount() == 0 && Settings.motorAAngle == -90));\n\t}", "public interface AutoPilot {\n /**\n * This is called on each update cycle. The AutoPilot looks at the environment\n * (via the Car object), and then make a decision about what car controls to use\n * at that cycle.\n * that encapsulates the information needed for decision-making.\n *\n * @see ActuatorAction\n * @param delta Seconds passed since last update\n * @param carStatus\n * @return\n */\n ActuatorAction handle(float delta, SensorInfo carStatus);\n\n /**\n * Lets the caller know whether this AutoPilot can take over the control. Some\n * types of AutoPilot (such as TurningAutoPilot) only takes over control at\n * certain tiles.\n *\n * @return true if it is ready to take over control.\n */\n public boolean canTakeCharge();\n\n /**\n * Lets the caller know whether this AutoPilot can be swapped out.\n * \n * Sometimes, AutoPilots are in certain crtical states (like in the process of making a turn),\n * and should not be interrupted. Otherwise, the car will end up in an unrecoverable state (like\n * halfway in the turning trajectory).\n * \n * @return true if it can be swapped out.\n */\n public boolean canBeSwappedOut();\n\n}", "@Override\n\tpublic void canTakeOff() {\n\t\tSystem.out.println(\"I CANNOT TAKE OFF UNLESS YA JUMP ME OVER SOMMAT\");\n\t}", "public boolean takeControl() {\n\t\tif (!sharedState.isFindingObject()) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// returns true if the shared state return in 1\r\n\t\treturn sharedState.getCurrentBehaviour()==1; \r\n\t}", "public boolean canHit() {\n\t\treturn this.hand.countValue().first() < 17;\n\t}", "public boolean mayPickup(Player debug1) {\n/* 112 */ return true;\n/* */ }", "private void checkForInstability(boolean overshoot) { \n if (overshoot == true) {\n setUnstable();\n } else {\n setStable();\n }\n }", "public boolean takeControl() {\r\n\t\treturn (StandardRobot.ts.isPressed() || (StandardRobot.us.getRange() < 25));\r\n\t}", "public void battleOver()\r\n {\r\n isBattleOver = true;\r\n }", "public boolean shouldHit() {\r\n\t\tif(getHandVal() < 17) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false; \r\n\t}", "@Override\n public boolean activate() {\n //When will this activate?\n return Areas.FALADOR.contains(ctx.players.local().tile())\n && ctx.widgets.component(1371,0).visible()\n && !ctx.objects.select().name(\"Waterpump\").within(6.0).isEmpty();\n }", "boolean gameOver() {\n return piecesContiguous(BP) || piecesContiguous(WP);\n }", "public boolean isOverhit()\n\t{\n\t\treturn overhit;\n\t}", "public abstract boolean hasBeenPickedUp();", "public boolean isOver() {\n\t\treturn over;\n\t}", "public abstract boolean interactionPossible(Robot robot);", "public boolean interupted(Creature Opponent){\n if (Opponent.selected_manuever.type.equals(\"Attack\") && Opponent.maneuver_pass && this.interruptable) { interupt_count++; return true; }\n else { return false; }\n }", "public boolean takeControl() {\n\t\treturn Project2a.curState == Project2a.RobotState.Forward && Project2a.getCurTime() - 500 > MoveForward.startTime;\n\t}", "public boolean isOver() {\n \treturn status == GameStatus.victory || status == GameStatus.draw || status == GameStatus.quit;\n }", "private boolean _requiresOnboarding() {\n return OnboardingModel.getOnboardingData() == null;\n }", "public boolean isBonusShotAllowed() {\n\t\treturn isLastFrame() && (isStrike() || isSpare());\n\t}", "public boolean canPung(int tile) {\n\t\tint[] numbers = getTileNumbers();\n\t\tint instances = TileAnalyser.in(tile, numbers);\n\t\treturn instances>1;\n\t}", "public boolean canRequestPower();", "@Override\n\tpublic boolean takeControl() {\n\t\treturn false;\n\t}", "public boolean canAttackWithItem() {\n/* 253 */ return false;\n/* */ }", "public boolean canAttackWithItem() {\n/* 215 */ return false;\n/* */ }", "public static boolean controlManager() {\n boolean empty = false;\n\n if(OnAirPlane.isEmpty()) {\n empty = true;\n }\n return empty;\n }", "@Override\n public void interact(Object obj) {\n // TODO: Cave Code - Add additional Agility to the player while on this Tile\n }", "boolean canMove(Tile t);", "boolean isAchievable();", "@java.lang.Override\n public boolean hasActivePokemon() {\n return activePokemon_ != null;\n }", "public boolean isOver() {\n \t\treturn isOver;\n \t}", "private boolean isOver() {\r\n return players.size() == 1;\r\n }", "@Override\n\tpublic boolean getIsOver();", "public boolean canInteract(){\n\t\treturn false;\n\t}", "public boolean isOver() {\r\n return isOver;\r\n }", "public boolean shouldExecute() {\n return ShulkerEntity.this.world.getDifficulty() == Difficulty.PEACEFUL ? false : super.shouldExecute();\n }", "abstract public boolean isPickedBy(Point p);", "public boolean isBattleOver() {\n\t\treturn battleOver;\n\t}", "public boolean shouldContinueExecuting() {\n return ShulkerEntity.this.getAttackTarget() == null && this.peekTime > 0;\n }", "private boolean canTakeControl(String[] procIds)\n\t{\n\t\tIServerProxy proxy = (IServerProxy) ServiceManager.get(IServerProxy.class);\n\t\tif (proxy.getCurrentServer().getRole().equals(ServerRole.MONITORING)) return false;\n\t\t// Ensure that all are uncontrolled.\n\t\tfor (String procId : procIds)\n\t\t{\n\t\t\tif (s_procMgr.isLocallyLoaded(procId))\n\t\t\t{\n\t\t\t\tIProcedure proc = s_procMgr.getProcedure(procId);\n\t\t\t\t// If local and already controlled by me\n\t\t\t\tIExecutionInformation info = proc.getRuntimeInformation();\n\t\t\t\t\n\t\t\t\t// Do not allow in certain procedure status\n\t\t\t\tExecutorStatus st = info.getStatus();\n\t\t\t\tswitch(st)\n\t\t\t\t{\n\t\t\t\tcase LOADED:\n\t\t\t\tcase RELOADING:\n\t\t\t\tcase UNINIT:\n\t\t\t\tcase UNKNOWN:\n\t\t\t\t\treturn false;\n\t\t\t\tdefault: break;\n\t\t\t\t}\n\n\t\t\t\t// Do not allow if we are already the controller\n\t\t\t\tIProcedureClient client = info.getControllingClient();\n\t\t\t\tif (client != null)\n\t\t\t\t{\n\t\t\t\t\tString cClient = client.getKey();\n\t\t\t\t\tif (cClient.equals(s_proxy.getClientKey())) { return false; }\n\t\t\t\t}\n\n\t\t\t\t// If local and being monitored by me\n\t\t\t\tIProcedureClient[] mClients = info.getMonitoringClients();\n\t\t\t\tif (mClients != null)\n\t\t\t\tfor (IProcedureClient mclient : mClients)\n\t\t\t\t{\n\t\t\t\t\tif (mclient.getKey().equals(s_proxy.getClientKey())) { return false; }\n\t\t\t\t}\n\t\t\t}\n\t\t\t// When it is remote or it is not already controlled by my gui\n\t\t\t// allow to take control \n\t\t}\n\t\treturn true;\n\t}", "private static void decisionWhenAttacking() {\n\t\tif (isNewAttackState()) {\n\t\t\tchangeStateTo(STATE_ATTACK_PENDING);\n\n\t\t\t// We will try to define place for our army where to attack. It\n\t\t\t// probably will be center around a crucial building like Command\n\t\t\t// Center. But what we really need is the point where to go, not the\n\t\t\t// unit. As long as the point is defined we can attack the enemy.\n\n\t\t\t// If we don't have defined point where to attack it means we\n\t\t\t// haven't yet decided where to go. So it's the war's very start.\n\t\t\t// Define this assault point now. It would be reasonable to relate\n\t\t\t// it to a particular unit.\n\t\t\t// if (!isPointWhereToAttackDefined()) {\n\t\t\tStrategyManager.defineInitialAttackTarget();\n\t\t\t// }\n\t\t}\n\n\t\t// Attack is pending, it's quite \"regular\" situation.\n\t\tif (isGlobalAttackInProgress()) {\n\n\t\t\t// Now we surely have defined our point where to attack, but it can\n\t\t\t// be so, that the unit which was the target has been destroyed\n\t\t\t// (e.g. just a second ago), so we're standing in the middle of\n\t\t\t// wasteland.\n\t\t\t// In this case define next target.\n\t\t\t// if (!isSomethingToAttackDefined()) {\n\t\t\tdefineNextTarget();\n\t\t\t// }\n\n\t\t\t// Check again if continue attack or to retreat.\n\t\t\tboolean shouldAttack = decideIfWeAreReadyToAttack();\n\t\t\tif (!shouldAttack) {\n\t\t\t\tretreatsCounter++;\n\t\t\t\tchangeStateTo(STATE_RETREAT);\n\t\t\t}\n\t\t}\n\n\t\t// If we should retreat... fly you fools!\n\t\tif (isRetreatNecessary()) {\n\t\t\tretreat();\n\t\t}\n\t}", "@Override\n public boolean canInteractWith(EntityPlayer player)\n {\n return teKeeper.isUsableByPlayer(player);\n }", "private void checkLoosePLayer(){\n if (hero.getHp()<=0){\n loose();\n }\n\n }", "private boolean checkTileImprovementPlan(TileImprovementPlan tip) {\n return validateTileImprovementPlan(tip, getEuropeanAIPlayer());\n }", "private boolean isAllAreaAchievable() throws ReachabilityException {\n\t\t\n\t\t// mark all points that the player should reach as 1, else as 0\n\t\tint[][] tempMap = new int[height][width];\n\t\tfor (int i = 0; i < height; i++) {\n\t\t\tfor (int j = 0; j < width; j++) {\n\t\t\t\tif (mapElementArray[i][j] instanceof Item\n\t\t\t\t\t\t|| mapElementArray[i][j] instanceof Teleporter\n\t\t\t\t\t\t|| mapElementArray[i][j] instanceof PlayerSpawnPoint)\n\t\t\t\t\ttempMap[i][j] = 1;\n\t\t\t\telse\n\t\t\t\t\ttempMap[i][j] = 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//try to reach all area\n\t\treachAllValidPoint(tempMap, aPlayerSpawnPointRow, aPlayerSpawnPointCol);\n\t\t\n\t\t//check if all area have been reached\n\t\tint unreachablePoint = 0;\n\t\tfor (int i = 0; i < height; i++) {\n\t\t\tfor (int j = 0; j < width; j++) {\n\t\t\t\tif (tempMap[i][j] == 1) {\n\t\t\t\t\tunreachablePoint++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n//\t\ttry {\n\t\t\tif (unreachablePoint > 0) {\n\t\t\t\tSystem.out.println(unreachablePoint + \" points are unreachable\");\n\t\t\t\tthrow new ReachabilityException();\n\t\t\t}else {\n\t\t\t\treturn true;\n\t\t\t}\n\t/*\t} catch (ReachabilityException e) {\n\t\t\tSystem.out.println(e);\n\t\t\t//print out map with invalid area\n\t\t\tfor (int i = 0; i < height; i++) {\n\t\t\t\tfor (int j = 0; j <width; j++) {\n\t\t\t\t\tSystem.out.print(tempMap[i][j]);\n\t\t\t\t}\n\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t}\n\t\t\treturn false;\n\t\t}*/\n\n\t}", "boolean hasActivePokemon();", "public boolean canBeSwappedOut();", "private boolean inGameInvariant(){\n if (owner != null && troops >= 1)\n return true;\n else\n throw new IllegalStateException(\"A Territory is left without a Master or Troops\");\n }", "protected boolean isAIEnabled()\n {\n return true;\n }", "public boolean canHit(Figure entity) {\n return true;\n }", "public boolean isPickable() {\n return false;\n }", "boolean canFall();", "private boolean tryAttack(Tile fromTile) {\r\n\t\tint size = getBoard().getTiles().length;\r\n\r\n\t\t// if attacker is on power-up tile\r\n\t\tif (fromTile.getTileType().equals(\"PowerUp\")) {\r\n\t\t\tif (fromTile.getPiece().getLEAGUE() == League.SHARK && fromTile.getTer().territoryName().equals(\"Shark\")) {\r\n\t\t\t\tfromTile.getPiece().setPower(fromTile.getPiece().getPower() + 1);\r\n\t\t\t}\r\n\r\n\t\t\tif (fromTile.getPiece().getLEAGUE() == League.EAGLE && fromTile.getTer().territoryName().equals(\"Eagle\")) {\r\n\t\t\t\tfromTile.getPiece().setPower(fromTile.getPiece().getPower() + 1);\r\n\t\t\t} else if (fromTile.getTer().territoryName().equals(\"Neutral\")) {\r\n\t\t\t\tfromTile.getPiece().setPower(fromTile.getPiece().getPower() + 1);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t// if the defender is on power-up tile\r\n\t\tif (tile.getTileType().equals(\"PowerUp\")) {\r\n\t\t\tif (tile.getPiece().getLEAGUE() == League.SHARK && tile.getTer().territoryName().equals(\"Shark\")) {\r\n\t\t\t\ttile.getPiece().setPower(tile.getPiece().getPower() + 1);\r\n\t\t\t}\r\n\r\n\t\t\tif (tile.getPiece().getLEAGUE() == League.EAGLE && tile.getTer().territoryName().equals(\"Eagle\")) {\r\n\t\t\t\ttile.getPiece().setPower(tile.getPiece().getPower() + 1);\r\n\t\t\t} else if (tile.getTer().territoryName().equals(\"Neutral\")) {\r\n\t\t\t\ttile.getPiece().setPower(tile.getPiece().getPower() + 1);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tif (fromTile.getPiece().getPower() >= tile.getPiece().getPower()) {\r\n\t\t\tif (tile.getPiece().getTYPE() == PieceType.FLAG) {\r\n\t\t\t\tfromTile.getPiece().setHasEnemyFlag(true);\r\n\t\t\t\tUtilities.infoAlert(\"Enemy Flag Captured!\", \"Get that piece with the flag back to your territory quickly!\");\r\n\t\t\t} else {\r\n\t\t\t\tif (tile.getPiece().getHasEnemyFlag() == true) {\r\n\t\t\t\t\tUtilities.infoAlert(\"Flag Recaptured!\", \"Enemy piece carrying your flag has been killed.\\nYour flag has respawned in your territory.\");\r\n\r\n\t\t\t\t\t// generate the dropped flag at its original position\r\n\t\t\t\t\t// or generate the dropped flag on first available tile on first or last row\r\n\t\t\t\t\t// if the default position has a piece on it\r\n\t\t\t\t\tif (tile.getPiece().getLEAGUE() == League.EAGLE) {\r\n\t\t\t\t\t\tif (getBoard().getTiles()[size - 1][(size / 2) - 1].getPiece() == null) {\r\n\t\t\t\t\t\t\tgetBoard().getTiles()[size - 1][(size / 2) - 1].setPiece(new SharkFlag());\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tfor (int sharkCol = 0; sharkCol < getBoard().getTiles().length; sharkCol++) {\r\n\t\t\t\t\t\t\t\tif (getBoard().getTiles()[size - 1][sharkCol].getPiece() == null) {\r\n\t\t\t\t\t\t\t\t\tgetBoard().getTiles()[size - 1][sharkCol].setPiece(new SharkFlag());\r\n\t\t\t\t\t\t\t\t\tbreak;\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} else {\r\n\t\t\t\t\t\tif (getBoard().getTiles()[0][size / 2].getPiece() == null) {\r\n\t\t\t\t\t\t\tgetBoard().getTiles()[0][size / 2].setPiece(new EagleFlag());\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tfor (int eagleCol = 0; eagleCol < getBoard().getTiles().length; eagleCol++) {\r\n\t\t\t\t\t\t\t\tif (getBoard().getTiles()[0][eagleCol].getPiece() == null) {\r\n\t\t\t\t\t\t\t\t\tgetBoard().getTiles()[0][eagleCol].setPiece(new EagleFlag());\r\n\t\t\t\t\t\t\t\t\tbreak;\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\treturn movePiece(fromTile);\r\n\t\t} else {\r\n\t\t\tUtilities.infoAlert(\"Invalid action\", \"Enemy power level higher at level \" + tile.getPiece().getPower()\r\n\t\t\t\t\t+ \". \" + \"\\nYour current piece is not able to defeat it and has cowered back in fear.\");\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "boolean gameOver() {\n return piecesContiguous(BLACK) || piecesContiguous(WHITE);\n }", "public boolean checkReached(float xTile, float yTile)\r\n/* 134: */ {\r\n/* 135:149 */ if ((this.mission) && (tileReachObjectives(xTile, yTile)))\r\n/* 136: */ {\r\n/* 137:152 */ this.reach[((int)xTile)][((int)yTile)] = 0;\r\n/* 138:153 */ this.reachablePlaces -= 1;\r\n/* 139:154 */ if (this.reachablePlaces == 0) {\r\n/* 140:156 */ return true;\r\n/* 141: */ }\r\n/* 142: */ }\r\n/* 143:160 */ return false;\r\n/* 144: */ }", "public boolean takeControl(){\r\n\t\tif(sound.readValue()>40){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public void isPickingUpPowerup(Player player) {\n if (player.getActivePowerup() == null) {\n for (Powerup powerup : powerups) {\n if (powerup.getBoundsInParent().intersects(player.getBoundsInParent())) {\n player.setActivePowerup(powerup);\n fieldPane.getChildren().remove(powerup);\n cleanup.add(powerup);\n }\n }\n }\n }", "public abstract void isgameover(AnchorPane paneArena);", "public void onTurnOver() {}", "boolean canBuildDome(Tile t);", "public boolean action_allowed(){\r\n\t\treturn action_holds.size()==0;\r\n\t}", "@Override\r\n public void checkWarGameOver(){\r\n if(this.checkOnePlayerDecksEmpty(0)){\r\n // Set gameOver flag to true\r\n this.isGameOver = true; \r\n \r\n }\r\n \r\n }", "public boolean isGameOver() {\r\n if(timesAvoid == 3) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "private boolean isGameOverAutomatico() {\n\t\tif(this.getEquipesAtivas().size() == 1)\n\t\t\treturn true;\n\t\t\n\t\tboolean temCosmo = false;\n\t\tfor(Equipe equipe : this.getEquipesAtivas()){\n\t\t\tif(equipe.getCosmo() > 0){\n\t\t\t\ttemCosmo = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn !temCosmo;\n\t}", "protected boolean canTriggerWalking() {\n/* 140 */ return false;\n/* */ }", "public void action() {\r\n\t\tLCD.drawString(\"Avoid Behavior!\", 0, 7);\r\n\r\n\t\tMapUpdate.updateWithoutObject(0);\r\n\t\tMapUpdate.updateWithObject(StandardRobot.us.getRange());\r\n\r\n\t\tif (StandardRobot.ts.isPressed()) {\r\n\t\t\tStandardRobot.pilot.setTravelSpeed(7);\r\n\t\t\tStandardRobot.pilot.travel(-5);\r\n\t\t\tcounter.countTravel();\r\n\r\n\t\t\tif (store.getFlag() == 0) {\r\n\t\t\t\tStandardRobot.pilot.rotate(-90);\r\n\t\t\t\tcounter.countTurn();\r\n\t\t\t} else {\r\n\t\t\t\tStandardRobot.pilot.rotate(90);\r\n\t\t\t\tcounter.countTurn();\r\n\t\t\t}\r\n\t\t} else {\r\n\r\n\t\t\tif (store.getFlag() == 0) {\r\n\t\t\t\tStandardRobot.pilot.rotate(-90);\r\n\t\t\t\tcounter.countTurn();\r\n\t\t\t} else {\r\n\t\t\t\tStandardRobot.pilot.rotate(90);\r\n\t\t\t\tcounter.countTurn();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public boolean isShooting()\r\n\t{\r\n\t\treturn false;\r\n\t}", "public boolean isValid() {\n return super.isValid()\n && getUnit().isPerson()\n && checkTileImprovementPlan(tileImprovementPlan)\n && (hasTools() || checkColonyForTools(getAIUnit(), colonyWithTools));\n }", "boolean checkWin(Tile initialTile);", "boolean canPickup(int x, int y) {\n return ((posX == x) && (posY == y));\n }", "public void tryAct() {\n\n List<Player> onCardPlayers = new ArrayList<Player>();\n List<Player> offCardPlayers = new ArrayList<Player>();\n if (currentPlayer.isEmployed() == true) {\n if(!currentPlayer.getHasPlayed()){\n onCardPlayers = findPlayers(currentPlayer.getLocation().getOnCardRoles());\n offCardPlayers = findPlayers(currentPlayer.getLocation().getOffCardRoles());\n currentPlayer.act(onCardPlayers, offCardPlayers);\n refreshPlayerPanel();\n }\n else{\n view.showPopUp(currentPlayer.isComputer(), \"You've already moved, rehearsed or acted this turn. Try a different command or click `end turn` to end your turn.\");\n }\n }\n else {\n view.showPopUp(currentPlayer.isComputer(), \"You're not employed, so you need to take a role before you can act.\");\n }\n view.updateSidePanel(playerArray);\n }", "protected abstract boolean isPlayerActivatable(PlayerSimple player);", "boolean canCrit();", "abstract boolean shouldTaskActivate();", "boolean isPickEnabled();", "@DISPID(30)\r\n\t// = 0x1e. The runtime will prefer the VTID if present\r\n\t@VTID(30)\r\n\tboolean failedOver();", "@Override\n public boolean canExecute() {\n return true;\n }", "private void checkEnabled() {\n }", "@Override\n public boolean isUsable(Player player, boolean firstTurn) {\n\n return player.canPlaceOnThisTurn(firstTurn) && player.canUseCardOnThisTurn(firstTurn) && player.getGrid().getPlacedDice() >0;\n }", "public boolean canProceedWithTapAction() {\n return ClickDelayHelper.canProceedWithTapAction();\n }", "public boolean isCanBypassIntermediate() {\n return getFlow().isCanBypassIntermediate();\n }", "public void playerHasInvincibility() {\n\t\tthis.state = canBeKilled;\n\t}", "public boolean canCollide() {\n\t\treturn false;\r\n\t}", "public boolean isAdmissible();", "public abstract boolean canUse();", "private boolean checkTransitionToShooting() {\n if (mOperatorInterface.getShoot() /* && (!mStorage.isEmpty()) && result.HasResult*/) {\n mRobotLogger.log(\"Changing to shoot because our driver said so...\");\n switch (mState) {\n\n /** Disables intake if transitioning from intake */\n case INTAKE:\n mIntake.stop();\n mStorage.stop();\n mIntakeState = IntakeState.IDLE;\n break;\n default:\n break;\n }\n mState = State.SHOOTING;\n\n /** Sets the shooting state to preparing if it's not already */\n if (mShootingState == ShootingState.IDLE) {\n mShootingState = ShootingState.PREPARE_TO_SHOOT;\n }\n return true;\n } else {\n // mRobotLogger.info(\"Could not shoot because \" + (!mStorage.isEmpty()) + \" \" +\n // mOperatorInterface.getShoot());\n return false;\n }\n }", "@Override\n public boolean continueExecuting()\n {\n theEntity.decrementRearingCounter();;\n Boolean continueExecuting = theEntity.getRearingCounter()>0; \n if (!continueExecuting)\n {\n theEntity.setRearing(false);\n theEntity.setAttackTarget(theEntity.getLastAttacker()); // now attack back\n }\n // DEBUG\n if (theEntity.getAITarget() != null)\n {\n System.out.println(\"AIPanic continueExecuting = \"+continueExecuting+\", rearingCounter = \"+theEntity.getRearingCounter()+\", isRearing = \"\n +theEntity.isRearing()+\", Attack Target = \"+theEntity.getAITarget().getClass().getSimpleName()+\", client side = \"+theEntity.worldObj.isRemote);\n }\n else\n {\n System.out.println(\"AIPanic continueExecuting = \"+continueExecuting+\", rearingCounter = \"+theEntity.getRearingCounter()+\", isRearing = \"\n +theEntity.isRearing()+\", Attack Target = null\"+\", client side = \"+theEntity.worldObj.isRemote);\n }\n return (continueExecuting);\n }", "public boolean isBypassable() {\n return mIsBypassable;\n }", "private boolean gameOver() {\r\n\t\treturn (lifeBar == null || mehran == null);\r\n\t}", "public boolean getIsBattleOver()\r\n {\r\n return isBattleOver;\r\n }", "public boolean gameIsOver() {return revealedShips >= 4;}", "public boolean isHolding();", "public boolean isUseable()\n {\n if (state == 0)\n {\n return true;\n }\n return false;\n }", "private boolean canEnlist() {\n\n return uiStateManager.getState().equals(GameUIState.WAVE_IN_PROGRESS)\n || uiStateManager.getState().equals(GameUIState.STANDBY);\n }", "@NonNull boolean canBreakWithHand();", "public boolean shouldExecute() {\n return this.entity.getAttackTarget() != null && this.isBowInMainhand();\n }", "public final void turnOver() {\n this.currentMovementAllowance = this.details.getMaxMovementAllowance();\n this.onTurnOver();\n }", "@Override\n\tpublic boolean shouldExecute() {\n\t\tif (!theEntity.isTamed())\n\t\t\treturn false;\n\t\telse if (theEntity.isInWater())\n\t\t\treturn false;\n\t\telse if (!theEntity.onGround)\n\t\t\treturn false;\n\t\telse {\n\t\t\tfinal EntityLivingBase var1 = theEntity.getOwner();\n\t\t\treturn var1 == null ? true\n\t\t\t\t\t: theEntity.getDistanceSqToEntity(var1) < 144.0D\n\t\t\t\t\t\t\t&& var1.getAITarget() != null ? false : isSitting;\n\t\t}\n\t}" ]
[ "0.65507555", "0.63502526", "0.6324516", "0.6255006", "0.6229328", "0.617584", "0.6146702", "0.60707027", "0.60536295", "0.60147536", "0.5978985", "0.58957034", "0.58904856", "0.58121735", "0.5806277", "0.5794062", "0.5789018", "0.57848734", "0.57770044", "0.57420063", "0.56870747", "0.5676681", "0.56762004", "0.56689835", "0.5653855", "0.56453663", "0.5644948", "0.56201845", "0.5606109", "0.55949175", "0.5591172", "0.5579743", "0.55747783", "0.5574541", "0.5572088", "0.5562077", "0.5555751", "0.55543363", "0.55462945", "0.5543937", "0.55334264", "0.55293053", "0.55243784", "0.5524216", "0.5518666", "0.5514387", "0.55048853", "0.5497907", "0.5495936", "0.5492867", "0.5492088", "0.5481968", "0.54815274", "0.54795206", "0.5474852", "0.54680175", "0.5455152", "0.5450583", "0.5443782", "0.54410255", "0.54390883", "0.5428943", "0.54281956", "0.54242027", "0.5421351", "0.541952", "0.5418634", "0.5418593", "0.5417997", "0.54148954", "0.5412481", "0.54107404", "0.54098004", "0.54070634", "0.5403182", "0.53977185", "0.53968483", "0.53954583", "0.5387973", "0.53860366", "0.53800344", "0.53798705", "0.5379023", "0.5378389", "0.53775287", "0.5374192", "0.5374045", "0.5372658", "0.53713495", "0.53669536", "0.53625166", "0.5362425", "0.53574604", "0.53555256", "0.5355149", "0.53523326", "0.53493065", "0.53479785", "0.53459215", "0.5345273", "0.5344868" ]
0.0
-1
Lets the caller know whether this AutoPilot can be swapped out. Sometimes, AutoPilots are in certain crtical states (like in the process of making a turn), and should not be interrupted. Otherwise, the car will end up in an unrecoverable state (like halfway in the turning trajectory).
public boolean canBeSwappedOut();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isSwitched();", "public interface AutoPilot {\n /**\n * This is called on each update cycle. The AutoPilot looks at the environment\n * (via the Car object), and then make a decision about what car controls to use\n * at that cycle.\n * that encapsulates the information needed for decision-making.\n *\n * @see ActuatorAction\n * @param delta Seconds passed since last update\n * @param carStatus\n * @return\n */\n ActuatorAction handle(float delta, SensorInfo carStatus);\n\n /**\n * Lets the caller know whether this AutoPilot can take over the control. Some\n * types of AutoPilot (such as TurningAutoPilot) only takes over control at\n * certain tiles.\n *\n * @return true if it is ready to take over control.\n */\n public boolean canTakeCharge();\n\n /**\n * Lets the caller know whether this AutoPilot can be swapped out.\n * \n * Sometimes, AutoPilots are in certain crtical states (like in the process of making a turn),\n * and should not be interrupted. Otherwise, the car will end up in an unrecoverable state (like\n * halfway in the turning trajectory).\n * \n * @return true if it can be swapped out.\n */\n public boolean canBeSwappedOut();\n\n}", "protected final boolean wasSwitchedOff() {\r\n\t\treturn switchedOff;\r\n\t}", "public boolean switchOut(Pokemon p) {\n return false;\n }", "public boolean switchOff(){\n if(!this.is_Switched_On){\n return false;\n }\n this.is_Switched_On = false;\n return true;\n }", "@Override\n protected void interrupted() {\n Robot.drive.setCoastMode();\n Robot.tapeAlignSys.disable();\n Robot.lidarAlignSys.disable();\n }", "@Override\n\tpublic void canTakeOff() {\n\t\tSystem.out.println(\"I CANNOT TAKE OFF UNLESS YA JUMP ME OVER SOMMAT\");\n\t}", "public boolean isSwitchedOn(){\r\n return _switchedOn;\r\n }", "boolean UnlockedEscapeTheIsland() {\n if (allMissions.missionStatus.get(\"Escape the island\") == true) {\n return false;\n }\n return true;\n }", "public void changeIsInvincible()\r\n\t{\r\n\t\tisInvincible = !isInvincible;\r\n\t}", "void toggleInAir() {\n inAir = !inAir;\n }", "public boolean try_toggle() {\n if (Pneumatics.get_instance().get_solenoids()) {\n return retract();\n }\n return try_extend();\n }", "private void canRepair(boolean b) {\n\t\t\n\t}", "public void ValidSwitch(int x, int y) {\n\n SaveState();\n int temp = pictures[x][y - 1];\n pictures[x][y - 1] = pictures[previousX][previousY - 1];\n pictures[previousX][previousY - 1] = temp;\n for (int i = 0; i < 9; i++) {\n for (int j = 0; j < 9; j++) {\n pictures2[i][j] = pictures[i][j];\n }\n }\n\n combinationValid = 0;\n LabelingCandiesToDestroy();\n\n if (combinationValid == 0) { //if there's no combination from the switch, it resets it to the original state\n ResetState();\n } else {\n if (InsideMovesRemainingExists == 0) {//checks if there is a playable move left\n combinationValid = 0;\n MovesRemainingExists();\n }\n }\n }", "@Override\r\n\tpublic boolean reActivateIt() {\n\t\treturn false;\r\n\t}", "private boolean checkTransitionToClimbing() {\n if (mOperatorInterface.climbStart() && Config.getInstance().getBoolean(Key.CLIMBER__ENABLED)) {\n mRobotLogger.log(\"Changing to climbing\");\n\n /** Disables intake if transitioning from intake */\n switch (mState) {\n case INTAKE:\n mIntake.stop();\n mStorage.stop();\n mIntakeState = IntakeState.IDLE;\n break;\n default:\n break;\n }\n\n /** Sets the climbing state to idle if it's not already */\n mState = State.CLIMBING;\n\n mDrive.setClimbingSpeed(true);\n\n if (mClimbingState == ClimbingState.IDLE) {\n mClimbingState = ClimbingState.WAIT;\n }\n return true;\n } else {\n return false;\n }\n }", "public boolean isUnPauseable()\n\t{\n\t\treturn unPauseable;\n\t}", "public boolean isAbsorbed()\n\t{\n\t\treturn absorbed;\n\t}", "private void checkStateChange() {\n\t\tif(previousState == null){\n\t\t\tpreviousState = getOrientation();\n\t\t}\n\t\telse{\n\t\t\tif(previousState != getOrientation()){\n\t\t\t\tif(isTurningLeft){\n\t\t\t\t\tisTurningLeft = false;\n\t\t\t\t}\n\t\t\t\tif(isTurningRight){\n\t\t\t\t\tisTurningRight = false;\n\t\t\t\t}\n\t\t\t\tpreviousState = getOrientation();\n\t\t\t}\n\t\t}\n\t}", "abstract boolean shouldTaskActivate();", "boolean canFall();", "public void invalidSwap() {\n JOptionPane.showMessageDialog(frame, \"Invalid skip\", \"Invalid skip\", JOptionPane.ERROR_MESSAGE);\n\n }", "private boolean preVote() {\n try {\n if (timeout > 0 ) {\n bar.attemptBarrier(timeout);\n } else {\n bar.barrier();\n }\n } catch ( Exception e ) {\n _logger.log(Level.FINE, \"synchronization.prevote.failed\", e);\n return false;\n }\n return true;\n }", "public boolean isInterruptible();", "public final void turnOver() {\r\n\t\tif (inPlay() == player1())\r\n\t\t\tsetInPlay(player2());\r\n\t\telse if (inPlay() == player2())\r\n\t\t\tsetInPlay(player1());\r\n\t\telse\r\n\t\t\tthrow new IllegalStateException(\"Can`t swap players for game! \"\r\n\t\t\t\t\t+ this);\r\n\t}", "public boolean isInterruptible() {\n/* 31 */ return true;\n/* */ }", "@Override\n public boolean isWaitingForTurnPhase() {return true;}", "@Override\n public boolean canMove() {\n return storage.isRampClosed();\n }", "public void revert()\n\t{\n\t\tswingingWay1 = !swingingWay1;\n\t}", "public boolean goingWrongWay() {\n\t\t// The dot product of the car and the segments normal is positive\n\t\ttemp.set(segments.get(curSeg*2+1)).sub(segments.get(curSeg*2));\n\t\ttemp.rotate90(1);\n\t\ttemp2.setAngleRad(angle);\n\t\treturn temp.dot(temp2) < 0;\n\t}", "public boolean unparkCar(final int index) {\n char type = bays.get(index);\n if (SLOT_FREE.equals(type)\n || DISABLED_SLOT_FREE.equals(type)\n || PEDESTRIAN_SLOT.equals(type)) {\n return false;\n } else {\n if (DISABLED_SLOT_TAKEN.equals(type)) {\n bays.set(index, DISABLED_SLOT_FREE);\n parkedCars--;\n return true;\n } else {\n bays.set(index, SLOT_FREE);\n parkedCars--;\n return true;\n }\n }\n }", "public void cantPlayGoNext() {\n\t switchTurn();\n }", "public boolean isAbortable();", "public Boolean shouldAbandon() {\n return false;\n }", "public boolean switchOn(){\n if(this.is_Switched_On){\n return false;\n }\n this.is_Switched_On = true;\n return true;\n }", "public void notifySwitchAway() { }", "private boolean deactivate() {\r\n // Automatically shutdown thruster if no input was given for a given interval\r\n if(state != State.Inactive) {\r\n state = State.Inactive;\r\n if(!isServer) {\r\n thruster.setParticlesPerSec(0);\r\n }\r\n if(null != engineSound && engineSound.getStatus().equals(AudioSource.Status.Playing)) {\r\n engineSound.stop();\r\n }\r\n return true;\r\n }\r\n return false;\r\n }", "public boolean isParked() {\r\n\t\tif (vehicleState == \"parked\") {\r\n\t\t\twasParked = true;\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 boolean interupted(Creature Opponent){\n if (Opponent.selected_manuever.type.equals(\"Attack\") && Opponent.maneuver_pass && this.interruptable) { interupt_count++; return true; }\n else { return false; }\n }", "@Override\n\tpublic void action() {\n\t\tsuppressed = false;\n\t\t//if (Settings.motorAAngle == -90) Settings.motorAAngle = -95;\n\n\t\tMotor.A.rotateTo(Settings.motorAAngle, true);\n\n\t\twhile (Motor.A.isMoving() && !Motor.A.isStalled() && !suppressed);\t\t\t\n\t\t\n\t\tMotor.A.stop();\n\t}", "public boolean isUnblockable();", "private void breakSpecialState() {\n this.inSpecialState = false;\n this.resetXMovement();\n }", "public void interactWhenSteppingOn() {\r\n\t\t\r\n\t}", "public abstract void deactivate();", "private boolean poleSwitchEngaged(){\n return true; //poleSwitch.get();\n }", "public void playerHasInvincibility() {\n\t\tthis.state = canBeKilled;\n\t}", "public boolean willNotBeResurrected() {\n return state == State.FRESH || state == State.ERROR;\n }", "private static void policyInNoFaultState(AutoPolicy autoPolicy1) {\n\t\tSystem.out.println (\"The auto policy:\");\n\t\tSystem.out.printf(\"Account %d; car %s%n ; state %s; \"\n\t\t\t\t+ \"%s no-fault state %n\", \n\t\t\t\tautoPolicy1.getAccountNumber(),\n\t\t\t\tautoPolicy1.getMakeAndModel(), \n\t\t\t\tautoPolicy1.getState(),\n\t\t\t\t(autoPolicy1.isNoFaultState() ? \"is\": \"is not\"));\n\t}", "protected void interrupted() {\n \n this.getPIDController().disable();\n shooter.setShooterMotor(0.0);\n }", "public boolean canRevert(IBlockState state) {\n\t\tfor (IBiStateMapping i : this) {\n\t\t\tif (i.canRevert(state)) return true;\n\t\t}\n\t\treturn false;\n\t}", "public boolean canCollide() {\n\t\treturn false;\r\n\t}", "@Override\n\tprotected void onInterruption() throws SimControlException {\n\t\t\n\t}", "public boolean isSwitchingPlayerOneTime()\n {\n boolean change = changePlayerOneTime != null;\n changePlayerOneTime = null;\n return change;\n }", "private boolean tryInactivate() {\n if (active) {\n if (!pool.tryDecrementActiveCount())\n return false;\n active = false;\n }\n return true;\n }", "private boolean tryInactivate() {\n if (active) {\n if (!pool.tryDecrementActiveCount())\n return false;\n active = false;\n }\n return true;\n }", "public void tryMove() {\n if(!currentPlayer.getHasPlayed()){\n if (!currentPlayer.isEmployed()) {\n String destStr = chooseNeighbor();\n\n currentPlayer.moveTo(destStr, getBoardSet(destStr));\n if(currentPlayer.getLocation().getFlipStage() == 0){\n currentPlayer.getLocation().flipSet();\n }\n refreshPlayerPanel();\n }\n else {\n view.showPopUp(currentPlayer.isComputer(), \"Since you are employed in a role, you cannot move but you can act or rehearse if you have not already\");\n }\n }\n else{ \n view.showPopUp(currentPlayer.isComputer(), \"You've already moved, rehearsed or acted this turn. Try a different command or click `end turn` to end turn your turn.\");\n }\n view.updateSidePanel(playerArray);\n }", "public void changeAvailability() {\n\t\tavailability = !availability;\n\t}", "boolean CanFinishTurn();", "public boolean isShivering();", "private boolean turnIfNeeded() {\n\t\tif (needToTurn()) {\n\t\t\tturnToDesiredDirection();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public boolean takeControl() {\n\t\tif (Squirrel.us.getDistance() <= 30 && Squirrel.notDetected)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public boolean swap() {\r\n\t\tif(origination == null || destination == null)\r\n\t\t\treturn false;\r\n\t\tLocation l = origination;\r\n\t\torigination = destination;\r\n\t\tdestination = l;\r\n\t\treturn true;\r\n\t}", "public boolean isResuming();", "public boolean takeControl() {\n\t\tif (!sharedState.isFindingObject()) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// returns true if the shared state return in 1\r\n\t\treturn sharedState.getCurrentBehaviour()==1; \r\n\t}", "public void toggleGearState() {\n shifter.set(!shifter.get());\n }", "private boolean checkTransitionToShooting() {\n if (mOperatorInterface.getShoot() /* && (!mStorage.isEmpty()) && result.HasResult*/) {\n mRobotLogger.log(\"Changing to shoot because our driver said so...\");\n switch (mState) {\n\n /** Disables intake if transitioning from intake */\n case INTAKE:\n mIntake.stop();\n mStorage.stop();\n mIntakeState = IntakeState.IDLE;\n break;\n default:\n break;\n }\n mState = State.SHOOTING;\n\n /** Sets the shooting state to preparing if it's not already */\n if (mShootingState == ShootingState.IDLE) {\n mShootingState = ShootingState.PREPARE_TO_SHOOT;\n }\n return true;\n } else {\n // mRobotLogger.info(\"Could not shoot because \" + (!mStorage.isEmpty()) + \" \" +\n // mOperatorInterface.getShoot());\n return false;\n }\n }", "@NonNull boolean canBreakWithHand();", "protected void beforeUnlockWaitingForBooleanCondition() {\n }", "public Boolean isHeld() { return held; }", "public abstract boolean hasBeenPickedUp();", "public boolean canEndTurn() {\n\t\tif (hasMoved || hasCaptured) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public boolean mayPickup(Player debug1) {\n/* 112 */ return true;\n/* */ }", "@Override\n\tpublic boolean takeControl() {\n\t\treturn (Math.abs(Motor.A.getTachoCount() - Settings.motorAAngle) > 5 || (Motor.A.getTachoCount() == 0 && Settings.motorAAngle == -90));\n\t}", "public boolean wasParked() {\r\n\t\tif (wasParked == true) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "protected abstract boolean isCardActivatable(Card card);", "void accelerate() {\n isAccelerating = true;\n Bukkit.getScheduler().scheduleSyncRepeatingTask(Cars.getInstance(), new BukkitRunnable() {\n @Override\n public void run() {\n if (!isAccelerating) {\n cancel();\n return;\n } else if (CAR.getAcceleration(DIRECTION.getOpposite()).isAccelerating) {\n // Just stop the car if both cars are accelerating because it means the driver is holding down 's'\n // and 'w' at the same time.\n CAR.stopCompletely();\n return;\n }\n\n Minecart minecart = CAR.getMinecart();\n Vector velocity = minecart.getVelocity();\n velocity.add(/* TODO ACCELERATION direction*/new Vector());\n if (velocity.length() >= minecart.getMaxSpeed()) isAccelerating = false;\n minecart.setDerailedVelocityMod(velocity);\n }\n }, 1, 1);\n }", "void finishSwitching();", "public void tryAct() {\n\n List<Player> onCardPlayers = new ArrayList<Player>();\n List<Player> offCardPlayers = new ArrayList<Player>();\n if (currentPlayer.isEmployed() == true) {\n if(!currentPlayer.getHasPlayed()){\n onCardPlayers = findPlayers(currentPlayer.getLocation().getOnCardRoles());\n offCardPlayers = findPlayers(currentPlayer.getLocation().getOffCardRoles());\n currentPlayer.act(onCardPlayers, offCardPlayers);\n refreshPlayerPanel();\n }\n else{\n view.showPopUp(currentPlayer.isComputer(), \"You've already moved, rehearsed or acted this turn. Try a different command or click `end turn` to end your turn.\");\n }\n }\n else {\n view.showPopUp(currentPlayer.isComputer(), \"You're not employed, so you need to take a role before you can act.\");\n }\n view.updateSidePanel(playerArray);\n }", "public boolean canBeLeft();", "public boolean canPostponeShutdown() {\n if (mState != STATE_SHUTDOWN_PREPARE) {\n throw new IllegalStateException(\"wrong state\");\n }\n return (mParam & VehicleApPowerStateShutdownParam.SHUTDOWN_IMMEDIATELY) == 0;\n }", "public void Switch()\n {\n if(getCurrentPokemon().equals(Pokemon1))\n {\n // Change to pokemon2\n setCurrentPokemon(Pokemon2);\n }\n // if my current pokemon is the same as pokemon2\n else if(getCurrentPokemon().equals(Pokemon2))\n {\n // swap to pokemon1\n setCurrentPokemon(Pokemon1);\n }\n }", "private ScanState switchState(ScanState desired,EnumSet<ScanState> allowed) {\n final ScanState old;\n final long timestamp;\n final long sequence;\n synchronized(this) {\n old = state;\n if (!allowed.contains(state))\n throw new IllegalStateException(state.toString());\n state = desired;\n timestamp = System.currentTimeMillis();\n sequence = getNextSeqNumber();\n }\n LOG.fine(\"switched state: \"+old+\" -> \"+desired);\n if (old != desired)\n queueStateChangedNotification(sequence,timestamp,old,desired);\n return old;\n }", "public boolean switchPhase() {\n int cpuShipCounter = 0;\n int playerShipCounter = 0;\n do {\n cpuShipCounter = 0;\n playerShipCounter = 0;\n if (!cpuHasPlaced) {\n placeComputerShipsDumb((int) (Math.random() * 19) + 1);\n }\n for(int i = 0; i < 10; i++){\n for(int j = 0; j <10; j++){\n if(humanPlayerBoard[i][j] == board.ship.ordinal()){\n playerShipCounter++;\n }\n if (computerPlayerBoard[i][j] == board.ship.ordinal()) {\n cpuShipCounter++;\n }\n }\n }\n if (cpuShipCounter != 17) {\n cpuHasPlaced = false;\n cpuShipCounter = 0;\n playerShipCounter = 0;\n for (int i = 0; i < 10; i++) {\n for (int j = 0; j < 10; j++) {\n computerPlayerBoard[i][j] = 0;\n }\n }\n }\n\n } while (cpuShipCounter != 17);\n\n if(cpuShipCounter == 17 && playerShipCounter == 17){\n inGame = true;\n return true;\n }\n\n return false;\n }", "@Override\r\n\tpublic boolean canPause() {\n\t\treturn true;\r\n\t}", "protected void interrupted() {\n \tRobotMap.gearIntakeRoller.set(0);\n }", "public void motorSafetyCheck() {\r\n if (leftMotor_0.getMotorType() == MotorType.kBrushed\r\n || leftMotor_1.getMotorType() == MotorType.kBrushed\r\n || leftMotor_2.getMotorType() == MotorType.kBrushed\r\n || rightMotor_0.getMotorType() == MotorType.kBrushed\r\n || rightMotor_1.getMotorType() == MotorType.kBrushed\r\n || rightMotor_2.getMotorType() == MotorType.kBrushed) {\r\n System.out.println(\"Brushed motor selected\");\r\n System.exit(0);\r\n }\r\n }", "private void turnOffAirCond(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_turnOffAirCond\n\n this.selectedTrain.setAC(0);\n this.operatingLogbook.add(\"Turned off AC.\");\n this.printOperatingLogs();\n }", "protected boolean isFinished() {\n\t\treturn Robot.gearIntake.getPegSwitch();\n\t}", "@Override\n\tpublic void action() {\n\t\tsuppressed = false;\n\t\tSettings.readState = true;\n\t\tSettings.atStartOfMaze = false;\n\t\tpilot.travel(-5);\n\t\tpilot.rotate(100);\n\t\twhile( pilot.isMoving() && !suppressed );\n\t\tpilot.stop();\n\t}", "@Override\n protected void interrupted() {\n Robot.driveTrain.StopPolarXPID();\n Robot.driveTrain.StopPolarYPID();\n }", "@Override\n protected boolean isFinished() {\n return Robot.arm.getArmLimitSwitch();\n }", "public boolean isHolding();", "@Override\n public boolean isInterruptible() {\n return true;\n }", "public boolean isRepairMode() {\n return false;\n }", "@Override\n public boolean isVoidSigActive() {\n if (!isShutDown()) {\n for (Mounted m : getMisc()) {\n EquipmentType type = m.getType();\n if (type.hasFlag(MiscType.F_VOIDSIG) && m.curMode().equals(\"On\") && m.isReady()) {\n return true;\n }\n }\n }\n return false;\n }", "public boolean canMove() {\r\n return (state == State.VULNERABLE || state == State.INVULNERABLE);\r\n\r\n }", "public void action() {\r\n\t\tLCD.drawString(\"Avoid Behavior!\", 0, 7);\r\n\r\n\t\tMapUpdate.updateWithoutObject(0);\r\n\t\tMapUpdate.updateWithObject(StandardRobot.us.getRange());\r\n\r\n\t\tif (StandardRobot.ts.isPressed()) {\r\n\t\t\tStandardRobot.pilot.setTravelSpeed(7);\r\n\t\t\tStandardRobot.pilot.travel(-5);\r\n\t\t\tcounter.countTravel();\r\n\r\n\t\t\tif (store.getFlag() == 0) {\r\n\t\t\t\tStandardRobot.pilot.rotate(-90);\r\n\t\t\t\tcounter.countTurn();\r\n\t\t\t} else {\r\n\t\t\t\tStandardRobot.pilot.rotate(90);\r\n\t\t\t\tcounter.countTurn();\r\n\t\t\t}\r\n\t\t} else {\r\n\r\n\t\t\tif (store.getFlag() == 0) {\r\n\t\t\t\tStandardRobot.pilot.rotate(-90);\r\n\t\t\t\tcounter.countTurn();\r\n\t\t\t} else {\r\n\t\t\t\tStandardRobot.pilot.rotate(90);\r\n\t\t\t\tcounter.countTurn();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected DynAction nextStateAfterCarTrip(DynAction oldAction, double now) {\n\t\tif (this.parkingManager.parkVehicleHere(Id.create(this.agent.getId(), Vehicle.class), agent.getCurrentLinkId(), now)){\n\t\tthis.lastParkActionState = LastParkActionState.PARKACTIVITY;\n\t\tthis.currentlyAssignedVehicleId = null;\n\t\tthis.parkingLogic.reset();\n\t\t\treturn new IdleDynActivity(this.stageInteractionType, now + configGroup.getParkduration());\n\t\t}\n\t\telse throw new RuntimeException (\"No parking possible\");\n\t}", "public void playerMissedBall(){ active = false;}", "private void abandonTileImprovementPlan() {\n if (tileImprovementPlan != null) {\n if (tileImprovementPlan.getPioneer() == getAIUnit()) {\n tileImprovementPlan.setPioneer(null);\n }\n tileImprovementPlan = null;\n }\n }" ]
[ "0.6390825", "0.60290545", "0.5924728", "0.5735936", "0.56591594", "0.5655706", "0.5634278", "0.55704576", "0.5536007", "0.5534542", "0.55141544", "0.5511089", "0.54709464", "0.5469116", "0.5462813", "0.5459536", "0.5456828", "0.54542273", "0.54339755", "0.53963584", "0.5376305", "0.534712", "0.5342963", "0.5315513", "0.5302246", "0.5298144", "0.5284336", "0.52750903", "0.5262041", "0.5247354", "0.5234671", "0.5226382", "0.5218861", "0.52150196", "0.52103895", "0.5210253", "0.5208008", "0.5200316", "0.5198597", "0.5197991", "0.5197381", "0.519735", "0.5192787", "0.51893353", "0.517702", "0.51755166", "0.5168527", "0.5162148", "0.5161302", "0.51562005", "0.51544785", "0.51535416", "0.5151238", "0.5147147", "0.5147147", "0.51389605", "0.51266557", "0.51259375", "0.51257414", "0.5118138", "0.511681", "0.5114765", "0.5113893", "0.5112437", "0.5111611", "0.51106274", "0.50967103", "0.5093479", "0.50931185", "0.50893116", "0.5083731", "0.50736207", "0.5072065", "0.506826", "0.50672305", "0.50670546", "0.5064716", "0.5054052", "0.5050502", "0.5047868", "0.50465554", "0.50458884", "0.50405204", "0.50381833", "0.5037738", "0.5035337", "0.50309336", "0.5029145", "0.5022913", "0.50224084", "0.5020234", "0.5017343", "0.50172067", "0.50116557", "0.5006064", "0.5005016", "0.5001576", "0.5000686", "0.49891186", "0.49821734" ]
0.6774537
0
/ List names=Arrays.asList("Navin","Pinto","Sameer","Aayat"); names.forEach(s>System.out.println(s)); // Lambda Expression names.forEach(System.out::println);// Method Reference
public static void main(String[] args) { String str="Ashok Singh"; MyPrinter myPrinter=new MyPrinter(); //myPrinter.print(str); myPrinter.print(str, new Parser() { public String parse(String str) { return StringParser.convert(str); } }); myPrinter.print(str, s->StringParser.convert(s)); // Lambda Expresion myPrinter.print(str, StringParser::convert); // Method Reference }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n\n List<String> namelist=new ArrayList<>();\n namelist.add(\"Pranta\");\n namelist.add(\"Tandra\");\n namelist.add(\"Prodip\");\n namelist.add(\"Aunidra\");\n\n\n\n\n /**\n * Without lamda\n */\n\n// for (String names:namelist\n// ) {\n// System.out.println(names);\n// }\n /**\n * With lamda\n */\n namelist.forEach(\n (names)-> System.out.println(names)\n );\n }", "public static void lambda(List<String> list) {\n System.out.println(\"ForEach.lambda\");\n list.forEach(s -> System.out.println(s));\n }", "public static void main(String[] args) {\n\n\n Arrays.asList(\"a\",\"b\",\"c\").forEach(e -> System.out.println(e));\n\n }", "public static void main(String[] args) {\n\t\tConsumer<String> print = x -> System.out.println(x);//\n print.accept(\"kumar\");\n \n \n \n List<Integer> list = Arrays.asList(1, 2, 3, 4, 5);\n Consumer<Integer> consumer = (Integer x) -> System.out.println(x);\n forEach(list, consumer);\n forEach(list, (Integer x) -> System.out.println(x));\n\n //to find string lenth()\n List<String> lenth = Arrays.asList(\"a\", \"chinna\", \"Swamy\");\n forEachString(lenth, (String x) -> System.out.println(x.length()));\n\n }", "public void forEachExample(){\n createPeople()\n .stream()\n .forEach(print);\n }", "public static void methodReference(List<String> list) {\n System.out.println(\"ForEach.functionalInterface\");\n list.forEach(System.out::println);\n }", "public void printList(){\n myList.forEach(System.out::println);\n }", "public static void main(String[] args) {\n\t\t\n\t\tList<String> names = Arrays.asList(\"ammi\", \"khamer\",\"sam\",\"rayan\",\"raheel\",\"raqeeb\");\n\t\t\n\t\t\n\t\t Consumer<String> consumberObj = new Consumer<String>() {\n\t\t \n\t\t public void accept(String s) { System.out.println(s); } };\n\t\t \n\t\t\n\t\tnames.forEach(name -> System.out.println(name));\n\t\t\n\t\t\n\n\t}", "@Test\n public void test1() {\n final Car car = Car.create(Car::new);\n final List<Car> cars = Collections.singletonList(car);\n final Car police = Car.create(Car::new);\n cars.forEach(police::follow);\n cars.forEach(c -> police.follow(c)); // 等价于写成lambda表达式的形式\n }", "public static void main(String[] args) {\n\t\tStream<Integer> stream = Stream.of(1, 2, 3, 4, 5, 6);\n\t\tstream.forEach(System.out::print);\n\t\t//:: is called method refrence \n\t\tStream<Integer> stream1 = Stream.of(new Integer[]{1,2,3,4});\n\t\tstream1.forEach(System.out::println);\n\t\t\n\t\tStream<String> names2 = Stream.of(\"D\", \"A\", \"Z\", \"R\");\n names2.sorted(Comparator.naturalOrder()).forEach(System.out::println);\n\t\t \n \n\t}", "public static void main(String[] args) {\n List<String> names = Arrays.asList(\n \"Ivan\",\n \"Petr Arsentev\"\n );\n// Consumer<String> out = (name) -> cutOut(name);\n Consumer<String> out = RefMethod::cutOut;\n names.forEach(out);\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tnew Thread(new Runnable() {\r\n\t\t\tpublic void run() {\r\n\t\t\t\tSystem.out.println(\"Before JAVA 8, too much code for too little to do\");\r\n\t\t\t}\r\n\t\t}).start();\r\n\t\t\r\n\t\t// Java 8 way:\r\n\t\t\r\n\t\tnew Thread( () -> System.out.println(\"In Java 8, Lambda Expression rocks !!\") ).start();\r\n\t\t\r\n\t\tSystem.out.println(\"-----------*************************-------------\");\r\n\t\t\r\n\t\t// Iterating Over List Using Lambda Expressions\r\n\t\t\r\n\t\tList features = Arrays.asList(\"Lambdas\",\"Default Method\",\"Stream API\",\"DAte and Time API\");\r\n\t\t\r\n\t\tfeatures.forEach(n -> System.out.println(n));\r\n\r\n\t\tSystem.out.println(\"-----------*************************-------------\");\r\n\t\t\t\t\r\n\t\t// Even better use method reference feature of Java 8\r\n\t\t// method reference is denoted by :: ****double colon***** operator\r\n\t\t// looks similar to scope resolution operator of C++\r\n\t\t\r\n\t\tfeatures.forEach(System.out::println);\r\n\r\n\t}", "public static void runExercise1() {\n students.stream().map(student -> student.getLastName().toUpperCase()).forEach(System.out::println);\n }", "public static void main(String[] args) {\n Vector<String> list = new Vector<>();\n list.add(\"tom\");\n list.add(\"ricky\");\n list.add(\"bob\");\n foreach(list);\n enumeration(list);\n iterator(list);\n System.out.println(testFunction(\"abc\",s ->s.toUpperCase()));\n String[] strings = testSupplier(3,( ) -> {\n String[] ss = new String[3];\n for (int i = 0;i < ss.length;i++){\n ss[i] = ((int)(Math.random() * 100) + \"\");\n }return ss;\n });\n for (String s : strings){\n System.out.println(s);\n }\n }", "public static void main(String[] args) {\n // Create a list of Strings.\n ArrayList<String> myList = new ArrayList<>();\n myList.add(\"Alpha\");\n myList.add(\"Beta\");\n myList.add(\"Gamma\");\n myList.add(\"Delta\");\n myList.add(\"Phi\");\n myList.add(\"Omega\");\n // Obtain a Stream to the array list.\n\n Stream<String> myStream = myList.stream();\n // Obtain an iterator to the stream.\n Iterator<String> itr = myStream.iterator();\n // Iterate the elements in the stream.\n while (itr.hasNext())\n System.out.println(itr.next());\n\n }", "public static void main(String[] args) {\n\r\n\t\t\r\n\t\tList<Integer> list = new ArrayList<Integer>(); \r\n\t\t\r\n\t\tlist.add(10);\r\n\t\tlist.add(20);\r\n\t\tlist.add(30);\r\n\t\tlist.add(40);\r\n\t\t\r\n\t\t//list.forEach(n->System.out.println(n));\r\n\t\t\r\n\t\tConsumer<Integer> c = new ConsImpl();\r\n\t\tlist.forEach(c);\r\n\t}", "public static void main(String[] args) {\n File directory1=new File(\"./src/main/java\");\n String[] fileNames = directory1.list(new java.io.FilenameFilter() {\n @Override\n public boolean accept(File dir, String name) {\n return name.endsWith(\".java\");\n }\n });\n System.out.println(Arrays.asList(fileNames));\n\n //Lambda expression implementing FilenameFilter\n File directory2 = new File(\"./src/main/java\");\n String[] names1 = directory2.list((dir, name) -> name.endsWith(\".java\"));\n System.out.println(Arrays.asList(names1));\n\n //Lambda expression with explicit data types\n File directory3 = new File(\"./src/main/java\");\n String[] names2 = directory3.list((File dir, String name) -> name.endsWith(\".java\"));\n System.out.println(Arrays.asList(names2));\n\n //A block lambda\n File directory4 = new File(\"./src/main/java\");\n String[] names3 = directory4.list((File dir, String name) -> {\n return name.endsWith(\".java\");\n });\n System.out.println(Arrays.asList(names3));\n\n }", "private void exercise1() {\n final List<String> list = asList(\n \"The\", \"Quick\", \"BROWN\", \"Fox\", \"Jumped\", \"Over\", \"The\", \"LAZY\", \"DOG\");\n\n final List<String> lowerList = list.stream()\n .map(String::toLowerCase)\n .peek(System.out::println)\n .collect(toList());\n }", "private void streamWithSimpleForEach() {\n List<String> myList = Arrays.asList(\"a1\", \"a2\", \"b1\", \"c2\", \"c1\");\n\n myList.stream()\n .filter(s -> s.startsWith(\"c\")).map(String::toUpperCase)\n .sorted()\n .forEach(System.out::println);\n }", "public static void runExample() {\n students.stream().map(student -> student.getName()).forEach(System.out::println);\n }", "public static void main(String[] args) {\n\t\tprint((a,b) -> System.out.println(a+\" \"+b), \"Hello\",\"Java\");\r\n\t\tprint((a,b) -> System.out.println(a+\"-\"+b), \"Hello\",\"Java\");\r\n\t}", "public static void main(String[] args) {\n List.of(\"1\", \"2\", \"3\").forEach(n -> System.out.println(n));\n // Bytecode instructions for Consumer call in forEach:\n // 9: invokedynamic #19, 0 // InvokeDynamic #0:accept:()Ljava/util/function/Consumer;\n // 14: invokeinterface #23, 2 // InterfaceMethod java/util/List.forEach:(Ljava/util/function/Consumer;)V\n }", "void forEach(BiConsumer<? super String, ? super String> consumer);", "public static void main(String[] args) {\n\n\t\tList<Integer> values = Arrays.asList(1,2,3,4);\n\t\t\n\t\tvalues.forEach(i -> System.out.println(i));\n\t\t\n\t}", "public static void main(String[] args) {\n Consumer<String> c1 = System.out::println;\n Consumer<String> c2 = x -> System.out.println(x);\n\n c1.accept(\"Annie\");\n c2.accept(\"Annie\");\n }", "public static void main(String args[]) {\n\t\tList<String> words = Arrays.asList(\"hi\",\"hello\",\"Bye\",\"Goodbye\");\n\t\twords.stream().forEach(s->s=\" __ \"+s);\n\t\twords.forEach(s->System.out.println(s));\n\t\tSystem.out.println();\n\t\t\n\t\t//using method reference \n\t\twords.stream().map(s->\"_\"+s).forEach(System.out::println);\n\t\tSystem.out.println();\n\t\t\n\t\t//operations using map\n\t\twords.stream().map(s-> s.replace(\"i\", \"eye\")).forEach(System.out::println);\n\t\tSystem.out.println();\n\t\t\n\t\t//filter\n\t\twords.stream().filter(s->s.length()<7).forEach(System.out::println);\n\t\tSystem.out.println();\n\t\t\n\t\t//reduce operation and concatenate operation\n\t\tSystem.out.println(words.stream().reduce(\"\",(s1,s2)->s1.toUpperCase()+(s2.toUpperCase())));\n\t\t\n\t\t//Reduce using map and concat\n\t\tSystem.out.println(words.stream().map(s->s.toUpperCase()).reduce(\"\", (s1,s2)->s1.concat(s2)));\n\t\t\n\t\t//concate words with commas in between them\n\t\tSystem.out.println(words.stream().reduce((s1,s2)->s1.concat(\",\"+s2)).get());\n\t\t\n\t\t//Large array of doubles\n\t\tdouble[] list= new Random().doubles(10).toArray();\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tLinkedList<NameList> names = new LinkedList<>();\n\t\tnames.add(new NameList(\"Camara\"));\n\t\tnames.add(new NameList(\"Amadou\"));\n\t\tnames.add(new NameList(\"Serigne\"));\n\t\tnames.add(new NameList(\"Abdoulaye\"));\n\t\t\n\t\t//names.stream().forEach(a -> System.out.print(a+ \" \"));\n\n\t\t\n\t\tfor(int i=0; i< names.size(); i++) {\n\t\t\tSystem.out.print(names.get(i)+ \" \");\n\t\t}\n\t\tSystem.out.println(\"\\n\"+ \"====================================\");\n\t\tfor(int i = 0; i< names.size(); i++) {\n\t\t\tif(i==0 || i ==names.size()-1) {\n\t\t\tnames.remove(i);\n\t\t\tSystem.out.println(names);\n\t\t\n\t\t}\n\t\t\t//Iterator<NameList> itnames = names.iterator();\n\t\t\t\n\t}\n\t\t\n\t}", "@Test\n public void streamsExample() {\n List<Integer> list = asList(1, 2, 3, 4, 5);\n \n list.stream().forEach(out::println);\n \n out.println();\n \n list.stream().parallel().forEachOrdered(out::println);\n \n \n }", "public static void main(String[] args) {\n var list = List.of(\"one\", \"two\", \"three\", \"four\");\n for(var element: list) {\n System.out.println(element);\n }\n }", "public static void main(String[] args) {\r\n ArrayList<String> canciones = new ArrayList<>();\r\n\r\n// Le agregamos datos\r\n canciones.add(\"Canciones 1\");\r\n canciones.add(\"Canciones 2\");\r\n canciones.add(\"Canciones 3\");\r\n\r\n// Método 1\r\n System.out.println(\"Recorriendo con método 1\");\r\n for (String cancion : canciones) {\r\n System.out.println(cancion);\r\n }\r\n\r\n// Método 2\r\n System.out.println(\"Recorriendo con método 2\");\r\n for (int x = 0; x < canciones.size(); x++) {\r\n String cancion = canciones.get(x);\r\n System.out.println(cancion);\r\n }\r\n// Método 3\r\n System.out.println(\"Recorriendo con método 3\");\r\n canciones.forEach((cancion) -> {\r\n System.out.println(cancion); });\r\n }", "@Test\n public void testInstanceMethodReference() {\n final Car car = Car.create(Car::new);\n final List<Car> cars = Collections.singletonList(car);\n cars.forEach(Car::repair);\n cars.forEach(c -> c.repair()); // 等价于写成lambda表达式的形式\n }", "public static void main(String[] args) {\n\t\tList<Employee> employeesList = StreamGetListOfEmployees.getListOfEmployees();\n\t\tList<String> employeeNames = employeesList.stream()\n .map(e -> e.getName())\n .collect(Collectors.toList());\n\t\tSystem.out.println(employeeNames);\n\t\t\n\t\t/**\n\t\t * You can also use map even if it produces result of same type.\n\t\t\t* In case, you want employee name in uppercase, you can use another map()\n\t\t\t* function to convert string to uppercase.\n\t\t */\n\t\temployeeNames = employeesList.stream()\n .map(e -> e.getName())\n .map(s -> s.toUpperCase())\n .collect(Collectors.toList());\n\t\tSystem.out.println(employeeNames);\n\t\t\n\t\t/**\n\t\t * FLAT MAP\n\t\t */\n\t\tList<String> listOfCities = employeesList.stream()\n .flatMap(e -> e.getListOfCities().stream())\n .collect(Collectors.toList());\n\n\t\tSystem.out.println(\"listOfCities: \" +listOfCities);\n\n\t\t//Output\n\t\t//listOfCities: [Newyork, Banglore, Paris, London, Pune, Seattle, Chennai, Hyderabad]\n\t}", "public static void main ( String[] args)\n {\n ArrayList<String> names = new ArrayList<String>();\n names.add( \"Amy\" ); names.add( \"Bob\" );\n names.add( \"Chris\" ); names.add( \"Deb\" );\n names.add( \"Elaine\" ); names.add( \"Frank\" );\n names.add( \"Gail\" ); names.add( \"Hal\" );\n\n // Create an iterator for the list\n Iterator<String> iter = names.iterator();\n\n // Use the iterator to visit each element\n while ( iter.hasNext() )\n System.out.println( iter.next() );\n\n }", "public static void main(String[] args) {\n\t\tArrayList<String>list=new ArrayList<String>(Arrays.asList(\"c\",\"c++\",\"java\",\"python\",\"html\"));\r\n\t\tStringJoiner sj=new StringJoiner(\",\",\"{\",\"}\");\r\n\t\tlist.forEach(e->sj.add(e));\r\n\t\tSystem.out.println(sj);\r\n\t}", "public static void main(String[] args) {\n\t\tLambdaExpression le = (String name) ->{\n\t\t\tSystem.out.println(\"Hello\" + name);\n\t\t};\n\t\tle.randomMethod(\"samarth\");\n\t\t\n\t\t\n\t\t\n\n\t}", "public static void main(String[] args) {\n\r\n\t\t String s1=\"Lambda\";\r\n\r\n\t\t String s2=\"Expression\";\r\n\r\n\t\t \r\n\r\n\t\t StringFormatter x=(a1,a2)->a1+\" \"+a2;\r\n\r\n\t\t StringFormatter y=(a1,a2)->a1+\"-\"+a2;\r\n\r\n\t\t StringFormatter z=(a1,a2)->a1.toUpperCase()+\" \"+a2.toUpperCase();\r\n\r\n\t\t \r\n\r\n\t\t System.out.println(x.format(s1, s2));\r\n\r\n\t\t System.out.println(y.format(s1, s2));\r\n\r\n\t\t System.out.println(z.format(s1, s2));\r\n\r\n}", "public void ShowAllUsers()\r\n {\r\n userList.forEach((s) -> { System.out.println(s); });\r\n }", "public void step4(){\n\n Collections.sort(names,(a,b)->b.compareTo(a));\n\n\n System.out.println(\"names sorted are :\"+names);\n }", "public static void main(String[] args) {\n\t\tString a = \"Jerin\";\r\n\t\t\r\n\t\tPrintDisplay p = () ->{\r\n\t\t\tSystem.out.println(a);\r\n\t\t};\r\n\t\tp.display();\r\n\r\n\t}", "public void comparatorSample() {\n\t\tList<Person> persons = Arrays.asList(new Person(\"Charles\", \"Dicken\", 60), new Person(\"Niharika\", \"Kothari\", 25),\n\t\t\t\tnew Person(\"Havilah\", \"Thathaputi\", 24), new Person(\"Alekya\", \"Saladi\", 24),\n\t\t\t\tnew Person(\"Muthu\", \"Sakthivel\", 27));\n\n\t\t/** Before Java 8: */\n\t\tSystem.out.println(\"Without Lambda Expressions:\");\n\t\t// Sort list by last name\n\t\tCollections.sort(persons, new Comparator<Person>() {\n\t\t\t@Override\n\t\t\tpublic int compare(Person p1, Person p2) {\n\t\t\t\treturn p1.getFirstName().compareTo(p2.getFirstName());\n\t\t\t}\n\t\t});\n\t\t// Create a method that prints all elements in the list\n\t\tSystem.out.println(\"Print all the data:\");\n\t\tprintAll(persons);\n\t\t// Create a method print all the last names start with 'T'\n\t\tSystem.out.println(\"Print data based on char:\");\n\t\tprintConditionally(persons, \"H\", new Condition() {\n\t\t\t@Override\n\t\t\tpublic boolean test(Person p, String letter) {\n\t\t\t\treturn p.getFirstName().startsWith(letter);\n\t\t\t}\n\t\t});\n\n\t\t/** Java 8: */\n\t\tSystem.out.println(\"With Lambda Expressions:\");\n\t\t// Sort list by last name\n\t\tCollections.sort(persons, (p1, p2) -> p1.getFirstName().compareTo(p2.getLastName()));\n\t\t// Create a method that prints all elements in the list\n\t\tSystem.out.println(\"Print all the data:\");\n\t\tprintAll(persons);\n\t\t// Create a method print all the last names start with 'T'\n\t\tSystem.out.println(\"Print data based on char:\");\n\t\tprintConditionally(persons, \"H\", (p, letter) -> p.getFirstName().startsWith(letter));\n\n\t}", "public void printItemsUsingLambdaCollectorsJDK8(List<Item> items){\n\t\tIO.print(\"\\nPrint average of all items price using JDK8 stream, method reference, collector!\");\r\n\t\t// average requires total sum and no of items as well.\r\n\t\t// collect returns ONLY one value throughout the stream. So we need some kind of placer where we will keep storing sum, count during stream.\r\n\t\tAverager avg = items\r\n\t\t\t.stream()\r\n\t\t\t.map(Item::getPrice) \r\n\t\t\t// alternate of item -> item.getPrice()\r\n\t\t\t.collect(Averager::new, Averager::accept, Averager::mergeIntermediateAverage); \r\n\t\t\t//accept takes one double value from stream and call merge.. method, which combines previous averger`s sum, count.\r\n\t\t\t// All Averager`s methods have no return type except for average which is not used in stream processing.\r\n\t\tIO.print(\"Average of price: \" + String.format(\"%.4f\", avg.average()));\r\n\t\t\r\n\t\tIO.print(\"\\nPrint total of items price using JDK8 stream, collector, suming!\");\r\n\t\tdouble total = items\r\n\t\t\t.stream()\r\n\t\t\t.collect(Collectors.summingDouble(Item::getPrice)); // no need for map as well.\r\n\t\tIO.print(\"Total price: \" + String.format(\"%.4f\", total)); // same result\r\n\t\t\r\n\t\tIO.print(\"\\nPrint total of all items price using JDK8 stream, collector toList!\");\r\n\t\tList<Double> prices = items\r\n\t\t\t.stream()\r\n\t\t\t.map(Item::getPrice) \r\n\t\t\t// alternate of item -> item.getPrice()\r\n\t\t\t.collect(Collectors.toList()); \r\n\t\t\t// collects stream of elements i.e. price, and creates a List of price.\r\n\t\tIO.print(\"List of prices: \" + prices); \r\n\t\t\r\n\t\tIO.print(\"\\nPrint total of all items price using JDK8 stream, collector toCollection!\");\r\n\t\tprices = items\r\n\t\t\t.stream()\r\n\t\t\t.map(Item::getPrice) \r\n\t\t\t.collect(Collectors.toCollection(ArrayList::new)); // same as toList: Here, we can get prices in any list form; TreeSet, HashSet, ArrayList.\r\n\t\tIO.print(\"List of prices: \" + prices);\r\n\t\t\r\n\t\tIO.print(\"\\nPrint total of all items price using JDK8 stream, collector joining!\");\r\n\t\tString priceString = items\r\n\t\t\t.stream()\r\n\t\t\t.map(Item::getPrice)\r\n\t\t\t.map(Object::toString) //basically, double.toString() as upper map converts stream of Item into stream of Double\r\n\t\t\t.collect(Collectors.joining(\", \")); // same as toList.\r\n\t\tIO.print(\"List of prices: [\" + priceString + \"]\"); \r\n\t\t\r\n\t\tIO.print(\"\\nPrint items based on type using JDK8 stream, collector grouping!\");\r\n\t\tMap<ITEM_TYPE, List<Item>> byType = items\r\n\t\t\t.stream()\r\n\t\t\t.collect(Collectors.groupingBy(Item::getType));\r\n\t\tIO.print(\"Items by Type: \" + byType ); \r\n\t\t\r\n\t\tIO.print(\"\\nPrint items based on type using JDK8 stream, collector grouping!\");\r\n\t\tMap<ITEM_TYPE, Double> sumByType = items\r\n\t\t\t.stream()\r\n\t\t\t.collect(Collectors.groupingBy(Item::getType, Collectors.summingDouble(Item::getPrice)));\r\n\t\tIO.print(\"Total prices by Type: \" + sumByType); \r\n\t\t\r\n\t\tIO.print(\"\\nPrint items based on type using JDK8 stream, collector grouping!\");\r\n\t\tMap<ITEM_TYPE, Optional<Item>> largetstByType = items\r\n\t\t\t.stream()\r\n\t\t\t.collect(Collectors.groupingBy(Item::getType, Collectors.maxBy(Comparator.comparing(Item::getPrice) )));\r\n\t\tIO.print(\"Total prices by Type: \" + largetstByType); \r\n\t}", "public static void printStudents(List<Student> students) {\n }", "@Test\n public void test2() {\n Consumer<String> consumer = System.out::println;\n consumer.accept(\"lambda V5!\");\n }", "public static void main(String[] args) {\r\n\t// challenge #1: anonymous to lambda expression\r\n\r\n Runnable runnable = new Runnable() {\r\n @Override\r\n public void run() {\r\n String myString = \"Let's split this up into an string\";\r\n String[] parts = myString.split(\" \");\r\n for (String part : parts) {\r\n System.out.println(part);\r\n }\r\n }\r\n };\r\n\r\n Runnable runable = () -> {\r\n String myString = \"Let's split this up into an string\";\r\n String[] parts = myString.split(\" \");\r\n for (String part : parts) {\r\n System.out.println(part);\r\n }\r\n };\r\n\r\n /*challenge #2: write the following method as a lambda expression*/\r\n Function<String,String> lambdaFunction = s -> {\r\n StringBuilder returnVal = new StringBuilder();\r\n for (int i=0; i<s.length(); i++) {\r\n if (i % 2 == 1) {\r\n returnVal.append(s.charAt(i));\r\n }\r\n }\r\n return returnVal.toString();\r\n };\r\n\r\n /* challenge #3: execute the function with the argument of \"123456789\"*/\r\n\r\n// System.out.println(lambdaFunction.apply(\"123456789\"));\r\n\r\n // challenge #5\r\n String result = everySecondCharacter(lambdaFunction,\"123456789\");\r\n System.out.println(result);\r\n\r\n // challenge #6\r\n// Supplier<String> iLoveJava = () -> \"i love java\";\r\n Supplier<String> iLoveJava = () -> {return \"i love java\";};\r\n\r\n // challenge #7\r\n String supplierResult = iLoveJava.get();\r\n System.out.println(supplierResult);\r\n\r\n\r\n List<String> topNames2015 = Arrays.asList(\r\n \"Amelia\",\r\n \"Olivia\",\r\n \"emily\",\r\n \"Isla\",\r\n \"Ava\",\r\n \"oliver\",\r\n \"Jack\",\r\n \"Charlie\",\r\n \"harry\",\r\n \"Jacob\"\r\n );\r\n\r\n List<String> firstUpperCaseList = new ArrayList<>();\r\n topNames2015.forEach(name -> {\r\n firstUpperCaseList.add(name.substring(0,1).toUpperCase() + name.substring(1));\r\n });\r\n firstUpperCaseList.sort(String::compareTo);\r\n firstUpperCaseList.forEach(System.out::println);\r\n\r\n System.out.println(\"-----------\");\r\n topNames2015.stream()\r\n .map(name -> name.substring(0,1).toUpperCase() + name.substring(1))\r\n .sorted()\r\n .forEach(System.out::println);\r\n\r\n long namesBeginningWithA = topNames2015.stream()\r\n .map(name -> name.substring(0,1).toUpperCase() + name.substring(1))\r\n .filter(name ->name.startsWith(\"A\"))\r\n .count();\r\n\r\n System.out.println(\"Numbers of name begining with A\" + namesBeginningWithA);\r\n\r\n // Stream chain is lazy evaluated\r\n topNames2015\r\n .stream()\r\n .map(name -> name.substring(0,1).toUpperCase() + name.substring(1))\r\n .peek(System.out::println)\r\n .sorted(String::compareTo)\r\n .collect(Collectors.toList());\r\n\r\n\r\n\r\n\r\n }", "public static void runExercise7() {\n students.stream().filter(student -> student.getAge()>20).map(student -> student.getLastName() + \" \" + student.getFirstName()).sorted().forEach(System.out::println);\n }", "public static void main(String[] args) {\n /**\n * void main function.\n */\n String[] names = new String[]{\n \"keerthana\",\"Rishab\",\"Sai\",\"Laksh\",\"Anisha\"};\n for (String string : names) {\n System.out.println(string);\n }\n }", "private static void print(Collection<String> data) {\r\n\r\n\t\tdata.stream().forEach(s -> out.println(s));\r\n\t}", "public static void main(String...args){\n\t\tIntStream.rangeClosed(2, 5).forEach(x -> System.out.println(x));\n\t\tSystem.out.println(IntStream.rangeClosed(2, 5).forEach(x -> System.out.println(x)));\n\t}", "private static void filter(List<String> names, Predicate functionExpression) {\n\t\tnames.forEach(x -> {\n\t\t\tif (functionExpression.test(x)) {\n\t\t\t\tSystem.out.println(\"Name - \" + x);\n\t\t\t}\n\t\t});\n\n\t}", "public static void main(String[] args) {\n\t\tList<String> lines = Arrays.asList(\"spring\", \"node\", \"mkyong\");\r\n\r\n List<String> result = lines.stream() // convert list to stream\r\n .filter(line -> !\"mkyong\".equals(line)) // we dont like mkyong\r\n .collect(Collectors.toList()); // collect the output and convert streams to a List\r\n\r\n result.forEach(System.out::println); //output : spring, node\r\n \r\n \r\n \r\n \r\n //Streams filter(), findAny() and orElse()\r\n List<Person> persons = Arrays.asList(\r\n new Person(\"mkyong\", 30),\r\n new Person(\"jack\", 20),\r\n new Person(\"lawrence\", 40)\r\n );\r\n\r\n Person result1 = persons.stream() // Convert to steam\r\n .filter(x -> \"jack\".equals(x.getName())) // we want \"jack\" only\r\n .findAny() // If 'findAny' then return found\r\n .orElse(null); // If not found, return null\r\n\r\n System.out.println(result1);\r\n \r\n \r\n \r\n \r\n //A List of Strings to Uppercase\r\n List<String> alpha = Arrays.asList(\"a\", \"b\", \"c\", \"d\");\r\n // Java 8\r\n List<String> collect = alpha.stream().map(String::toUpperCase).collect(Collectors.toList());\r\n System.out.println(collect); //[A, B, C, D]\r\n\r\n\t}", "private void print(String... toPrint) {for (String print : toPrint) System.out.println(print);}", "public static void main(String[] args) {\n\t\t//Até o java 7\n\t\tnew Thread(new Runnable() {\n\n\t\t @Override\n\t\t public void run() {\n\t\t System.out.println(\"Executando um Runnable\");\n\t\t }\n\n\t\t}).start();\n\t\t//A partir do java 8\n\t\tnew Thread(() -> System.out.println(\"Executando um Runnable\")).start();\n\t\t\n\t\t//iterando com java 8: classe anonima\n\t\ttexto.forEach(new Consumer<String>() {\n\t\t public void accept(String s) {\n\t\t System.out.println(s);\n\t\t }\n\t\t});\n\t\t//iterando com java 8: lambda\n\t\t//Essa sintaxe funciona para qualquer interface \n\t\t//que tenha apenas um método abstrato\n\t\ttexto.forEach((String s) -> {\n\t\t System.out.println(s);\n\t\t});\n\t\t//ou\n\t\ttexto.forEach((s) -> {\n\t\t System.out.println(s);\n\t\t});\n\t\t//ou\n\t\ttexto.forEach(s -> {\n\t\t System.out.println(s);\n\t\t});\n\t\t//ou\n\t\ttexto.forEach(s -> System.out.println(s));\n\t\t// Uma interface que possui apenas um método abstrato \n\t\t//é agora conhecida como interface funcional e pode ser utilizada dessa forma\n\t\t\n\t\t//Outro exemplo é o próprio Comparator. Se utilizarmos a forma \n\t\t//de classe anônima, teremos essa situação: \n\t\ttexto.sort(new Comparator<String>() {\n\t\t public int compare(String s1, String s2) {\n\t\t if (s1.length() < s2.length())\n\t\t return -1;\n\t\t if (s1.length() > s2.length())\n\t\t return 1;\n\t\t return 0;\n\t\t }\n\t\t});\n\t\t//ou com lambda\n\t\ttexto.sort((s1, s2) -> {\n\t\t if (s1.length() < s2.length())\n\t\t return -1;\n\t\t if (s1.length() > s2.length())\n\t\t return 1;\n\t\t return 0;\n\t\t});\n\t\t//ou\n\t\ttexto.sort((s1, s2) -> {\n\t\t return Integer.compare(s1.length(), s2.length());\n\t\t});\n\t\t//ou como há apenas um único statement, podemos remover as chaves\n\t\ttexto.sort((s1, s2) -> Integer.compare(s1.length(), s2.length()));\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tList l = List.of(\"1\",\"2\",\"3\");\n\t\tl.forEach(i -> System.out.println(i));\n\t\tSystem.out.println(\"Immutable.....1\");\n\t\t//l.add(\"4\");\n\t\t//System.out.println(\"Immutable.....2\");\n\t\t//l.forEach(i -> System.out.println(i));\n\t\tMap m = Map.of(1,\"a\",2,\"b\");\n\t\tSystem.out.println(m.get(1));\n\t\tm.forEach((j,k) -> System.out.println(k));\n\t}", "public static void main(String[] args) {\n\tDouble totalSalaryExpense = employeeList.stream().map(emp -> emp.getSalary()).reduce(0.00, (a, b) -> a + b);\n\tSystem.out.println(\"Total salary expense: \" + totalSalaryExpense);\n\n\t// Example 2: Using Stream.reduce() method for finding employee with\n\t// maximum salary\n\tOptional<Employee> maxSalaryEmp = employeeList.stream()\n\t\t.reduce((Employee a, Employee b) -> a.getSalary() < b.getSalary() ? b : a);\n\n\tif (maxSalaryEmp.isPresent()) {\n\t System.out.println(\"Employee with max salary: \" + maxSalaryEmp.get());\n\t}\n\n\t// Java 8 code showing Stream.map() method usage\n\tList<String> mappedList = employeeList.stream().map(emp -> emp.getName()).collect(Collectors.toList());\n\tSystem.out.println(\"\\nEmployee Names\");\n\tmappedList.forEach(System.out::println);\n\n\t// Definition & usage of flatMap() method\n\tList<String> nameCharList = employeeList.stream().map(emp -> emp.getName().split(\"\"))\n\t\t.flatMap(array -> Arrays.stream(array)).map(str -> str.toUpperCase()).filter(str -> !(str.equals(\" \")))\n\t\t.collect(Collectors.toList());\n\tnameCharList.forEach(str -> System.out.print(str));\n\n\tStream<String[]> splittedNames = employeeList.stream().map(emp -> emp.getName().split(\"\"));\n\t// splittedNames.forEach(System.out::println);\n\tStream<String> characterStream = splittedNames.flatMap(array -> Arrays.stream(array));\n\tSystem.out.println();\n\t// characterStream.forEach(System.out::print);\n\tStream<String> characterStreamWOSpace = characterStream.filter(str -> !str.equalsIgnoreCase(\" \"));\n\t// characterStreamWOSpace.forEach(System.out::print);\n\n\tList<String> listOfUpperChars = characterStreamWOSpace.map(str -> str.toUpperCase())\n\t\t.collect(Collectors.toList());\n\tlistOfUpperChars.forEach(System.out::print);\n\n }", "@Test\n public void testStaticMethodReference() {\n final Car car = Car.create(Car::new);\n final List<Car> cars = Collections.singletonList(car);\n cars.forEach(Car::collide);\n// cars.forEach(c -> c.collide()); // 写不成这种lambda表达式,因为它是静态方法\n }", "public static void main(String args[]) {\n\t\tTreeSet<Car> treeset = new TreeSet<>();\r\n\r\n\t\ttreeset.add(new Car(\"Diablo\", 600000, 1998, \"Chrevolet\"));\r\n\t\ttreeset.add(new Car(\"Focus\", 300000, 1990, \"Fords\"));\r\n\t\ttreeset.add(new Car(\"Indica\", 200000, 1890, \"Tata\"));\r\n\r\n\t\t//Lambda expression for printing value\r\n\t\ttreeset.stream().forEach((name) -> System.out.println(name));\r\n\r\n\t}", "public static void main( String[] args )\n {\n \tString[] arrStr= {\"Ram\",\"Shyam\",\"Jodhu\",\"Modhu\",\"Rahim\",\"Anitha\",\"Bhabesh\"};\n \t\n\t\t// Style -1 Using comparator\n \t/* \n\t\t Arrays.sort(arrStr, new Comparator<String>() { public int compare(String\n\t\t s1,String s2) { return s1.compareTo(s2); } });\n\t\t \n\t\t System.out.println(Arrays.toString(arrStr));\n\t\t */\n \t\n \t// Style -2 - Using Lambdaexpression 1\n \t/*\n\t\t Comparator<String> empNameComparator = (String s1, String s2) -> { return\n\t\t (s1.compareTo(s2)); };\n\t\t */\n \t\n \t// Style -2 - Using Lambdaexpression 2\n \t Comparator<String> empNameComparator = (s1, s2) -> {\n \t return (s1.compareTo(s2));\n \t };\n \t \n \t \n \t Arrays.sort(arrStr, empNameComparator);\n \t System.out.println(Arrays.toString(arrStr));\n \t //employeeList.forEach(System.out::println);\n \t\n }", "static void disList(List<Integer> list) {\n\t\tConsumer<List<Integer>> disList = (l) -> l.forEach(a -> System.out.println(a));\n\t\tdisList.accept(list);\n\t}", "public static void main(String[] args) {\n\n\t\tList<String> listNames= new ArrayList<>();\n\t\tlistNames.add(\"Rama\");\n\t\tlistNames.add(\"test\");\n\t\tlistNames.add(\"rama1\");\n\t\tlistNames.forEach((s)-> System.out.println(s));\n\t\t\n\t\tlistNames.removeIf((s)-> s.startsWith(\"t\"));\n\t\tlistNames.forEach(System.out::println);\n\t\t\n\t\t\t\t\n\t}", "public static void main(String[] args){\n StringLengthLambda myLambda = s -> s.length();\n\n //we can also pass this sysout - lambda into a method\n //System.out.println(myLambda.getLength(\"Roy Bairstow\"));\n\n //it can be pass in like this\n printLambda(myLambda);\n\n //or\n printLambda(s -> s.length());// in this case we wont need the above lambda expression\n //the argument in printLambda takes a lambda expression, but its interface type is from\n //stringlengthlambda so any argument passed into this method has to have the same\n //signature - that is int return type, and pass a string argument\n\n }", "public static void main(String[] args) {\n\n\t\tUnaryOperator<Integer> func=x->x*7;\t\t\n\t\tint num=func.apply(10);\n\t\tSystem.out.println(num);\n\t\t\n\t\tFunction<Integer, Integer> func1=x->x*10;\n\t\tSystem.out.println(func1.apply(10));\n\t\t\n\t\tList<String> langList=new ArrayList<String>();\n\t\tlangList.add(\"Java\");\n\t\tlangList.add(\"Ruby\");\n\t\tlangList.add(\"Python\");\n\t\t\n\t\tSystem.out.println(langList);\n\t\t\n\t\tlangList.replaceAll(ele -> ele +\" Deeps\");\n\t\tSystem.out.println(langList);\n\t}", "public void lambaAsObjectExample() {\n }", "public static void main(String[] args) {\n List<Character> charachterList = Arrays.asList('T', 'h', 'i', 's', ' ', 'i', 's', ' ', 'S', 'p', 'a', 'r', 't', 'a', '!');\n String strings = charachterList.stream()\n .map(c -> c.toString())\n .collect(Collectors.joining());\n\n System.out.println(strings);\n }", "public static void main(String[] args){\n\n String[] test = new String[10];\n changeArray(test);\n Arrays.stream(test).forEach(i -> System.out.println(i));\n\n }", "public static void main(String[] args) {\n\t\t// | Functional Interfaces | #Parameters | Return Type | Single Abstract Method |\n\t\t// +----------------------------------------------------------------------------+\n\t\t// | Consumer<T> | 1 (T) | void | accept |\n\t\t// +----------------------------------------------------------------------------+\n\t\t\n\t\t\n\t\tConsumer<String> print1 = System.out::println;\n\t\tConsumer<String> print2 = x -> System.out.println(x);\n\t\t\n\t\tprint1.accept(\"Amer\");\n\t\tprint2.accept(\"Java\");\n\t}", "public static void main(String[] args) {\n IntStream\n .range(1, 10) //loops 1-9\n .forEach(System.out::println); //for each element print them\n System.out.println();\n\n }", "public static void main(final String[] args) {\n\t\tfinal Function<Student, String> nameFunction = student -> student.getName();\r\n\r\n\t\tfinal List<String> studentNames = new ArrayList<>();\r\n\r\n\t\tfor (final Student student : Students.getAll()) {\r\n\t\t\tstudentNames.add(nameFunction.apply(student));\r\n\t\t}\r\n\r\n\t\tSystem.out.println(studentNames);\r\n\r\n\t}", "public void builtInFunctionalInterfaces() {\n\t\tSystem.out.println(\"\\n\\n************Built In Functional Interfaces**********\");\n\t\tList<String> names = Arrays.asList(\"bob\", \"josh\", \"megan\");\n\n\t\tPredicate<String> predicate = s -> s.length() < 5;\n\t\tSystem.out.println(predicate.test(\"Predicate Test\"));\n\t\t// filter uses predicate functional interface\n\t\tList<String> namesWithM = names.stream().filter(name -> name.startsWith(\"m\")).collect(Collectors.toList());\n\n\t\tConsumer<Integer> consumer = a -> System.out.println(\"Print: \" + (a + 10));\n\t\tconsumer.accept(15);\n\t\t// ForEach uses consumer functional interface\n\t\tnames.forEach(name -> System.out.println(\"Hello, \" + name));\n\n\t\tSupplier<String> supplier = () -> \"Print Supplier\";\n\t\tSystem.out.println(supplier.get());\n\n\t\tFunction<String, Integer> function = (s) -> s.length();\n\t\tSystem.out.println(\"String Length: \" + function.apply(\"Function Test\"));\n\n\t\tBinaryOperator<Integer> binaryOperator = (a, b) -> a + b;\n\t\tSystem.out.println(\"Addition: \" + binaryOperator.apply(8, 9));\n\n\t\tUnaryOperator<String> unaryOperator = s -> s.toUpperCase();\n\t\t// ReplaceAll uses unary operator functional interface\n\t\tnames.replaceAll(unaryOperator); // or names.replaceAll(name -> name.toUpperCase());\n\t\tnames.forEach(i -> System.out.print(i + \" \"));\n\n\t\tRunnable runnable = () -> System.out.println(\"Execute Run Method\");\n\t\trunnable.run();\n\n\t\tComparator<Integer> comparator = (a, b) -> b - a;\n\t\tList<Integer> list = Arrays.asList(5, 3, 7, 2, 4);\n\t\tCollections.sort(list, comparator);\n\t\tlist.forEach(i -> System.out.print(i + \" \"));\n\t}", "public static void main(String[] args) {\n Collection values = new ArrayList();\n values.add(5);\n values.add(6);\n\n for (Object valu : values) {\n System.out.println(valu);\n }\n\n }", "public Object lambda73(Object lis) {\n return C1259lists.member(this.elt, lis, this.staticLink.$Eq);\n }", "public Object lambda57(Object lis) {\n return C1259lists.member(this.f129x, lis, this.staticLink.$Eq);\n }", "public static void main(String[] args) throws Exception{\n\t\tCollection<Integer> values = new ArrayList<>();\r\n\t\tvalues.add(3);\r\n\t\tvalues.add(77);\r\n\t\tvalues.add(5);\r\n\t\t//to fetch the values we have tow ways 1. Iterator 2.enhacned for loop\r\n\t\t/*Iterator i = values.iterator();\r\n\t\twhile(i.hasNext()){\r\n\t\t\tSystem.out.println(i.next());\r\n\t\t}\r\n\t\t*/\r\n\t\t//or for each\r\n\t\tvalues.forEach(i->System.out.println(i));\r\n\r\n\r\n\r\n\r\n\t}", "public static void main(String[] args) {\n\n\t\tArrayList<Integer> numbers = new ArrayList<Integer> ();\n\t\t\n\t\tfor(int i=1; i<=10; i++) {\n\t\t\tnumbers.add(i);\n\t\t}\n\t\t\n\t\tSystem.out.println(\"numbers \" + numbers);\n\t\t\n\t\tnumbers.stream().filter(num-> num%2==0).forEach(s->System.out.println(s));\n\t\tSystem.out.println(\"=========after map==========\");\n\t\tnumbers.stream().map(num->num+5).forEach(s->System.out.println(s));\n\t}", "public static void main(String[] args) {\n\n char[] animal = {'k', 'u', 't', 'y', 'a'};\n Arrays.stream(new String(animal).split(\" \")).forEach(System.out::print);\n\n }", "public void printWithFP(List<String> list) {\n\t\tlist.stream().forEach(item -> System.out.println(\"item: \" + item));\n\t}", "public static void main(String[] args) {\n\t\tList<String> ls=new ArrayList<String>();\r\n\t\tls.add(\"xyz\");\r\n\t\tls.add(\"abc\");\r\n\t\tls.add(\"pqr\");\r\n\t\tls.add(\"uvw\");\r\n\t\tls.add(\"mno\");\r\n\t\tfor(String element:ls) {\r\n\t\t\tSystem.out.println(element);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\r\n\t}", "public static void main(String[] args) {\n\t\tList<Employee> empList = new ArrayList<>();\r\n\t\tempList.add(new Employee(\"Rashim\", \"SDFSDFJLK\", 52));\r\n\t\tempList.add(new Employee(\"Amit\", \"JLKSDFJKLL79989\", 67));\r\n\t\tempList.add(new Employee(\"Ranjit\", \"ASDFJLKSJLF78676\", 45));\r\n\t\tempList.add(new Employee(\"Shymala\", \"SDFJLSJU8907\", 34));\r\n\t\t\r\n\t\t\r\n//\t\tfirst select only employees whose salary is greater than 50\r\n//\t\tand sort the employees based on their names (ignore case)\r\n//\t\tand print each employee of the stream.\r\n\t\tempList.stream().filter(emp -> emp.getSalary() > 50).sorted((e1, e2) -> e1.getName().compareToIgnoreCase(e2.getName())).forEach(emp -> System.out.println(emp));\r\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tprint(s -> s.substring(0, 3)); //mnow we are passing the action not the variable\n\t}", "public static void main(String[] args) {\r\n\t\t\r\n\t\tSystem.out.println(\"-------1. Stream filter() example---------\");\r\n\t\t//We can use filter() method to test stream elements for a condition and generate filtered list.\r\n\t\t\r\n\t\tList<Integer> myList = new ArrayList<>();\r\n\t\tfor(int i=0; i<100; i++) myList.add(i);\r\n\t\tStream<Integer> sequentialStream = myList.stream();\r\n\r\n\t\tStream<Integer> highNums = sequentialStream.filter(p -> p > 90); //filter numbers greater than 90\r\n\t\tSystem.out.print(\"High Nums greater than 90=\");\r\n\t\thighNums.forEach(p -> System.out.print(p+\" \"));\r\n\t\t//prints \"High Nums greater than 90=91 92 93 94 95 96 97 98 99 \"\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"-------2. Stream map() example---------\");\r\n\t\t//We can use map() to apply functions to an stream\r\n\t\tStream<String> names = Stream.of(\"aBc\", \"d\", \"ef\");\r\n\t\tSystem.out.println(names.map(s -> {\r\n\t\t\t\treturn s.toUpperCase();\r\n\t\t\t}).collect(Collectors.toList()));\r\n\t\t//prints [ABC, D, EF]\r\n\t\t\r\n\t\tSystem.out.println(\"-------3. Stream sorted() example---------\");\r\n\t\t//We can use sorted() to sort the stream elements by passing Comparator argument.\r\n\t\tStream<String> names2 = Stream.of(\"aBc\", \"d\", \"ef\", \"123456\");\r\n\t\tList<String> reverseSorted = names2.sorted(Comparator.reverseOrder()).collect(Collectors.toList());\r\n\t\tSystem.out.println(reverseSorted); // [ef, d, aBc, 123456]\r\n\r\n\t\tStream<String> names3 = Stream.of(\"aBc\", \"d\", \"ef\", \"123456\");\r\n\t\tList<String> naturalSorted = names3.sorted().collect(Collectors.toList());\r\n\t\tSystem.out.println(naturalSorted); //[123456, aBc, d, ef]\r\n\t\t\r\n\t\tSystem.out.println(\"-------4. Stream flatMap() example---------\");\r\n\t\t//We can use flatMap() to create a stream from the stream of list.\r\n\t\tStream<List<String>> namesOriginalList = Stream.of(\r\n\t\t\t\tArrays.asList(\"Pankaj\"), \r\n\t\t\t\tArrays.asList(\"David\", \"Lisa\"),\r\n\t\t\t\tArrays.asList(\"Amit\"));\r\n\t\t\t//flat the stream from List<String> to String stream\r\n\t\t\tStream<String> flatStream = namesOriginalList\r\n\t\t\t\t.flatMap(strList -> strList.stream());\r\n\r\n\t\t\tflatStream.forEach(System.out::println);\r\n\r\n\t}", "private static void ejercicio1() {\n List<Integer> numeros = Arrays.asList(1, 2, 3, 4, 5);\n numeros.stream().map(numero -> Main.calculaCubo(numero)).forEach(numero -> System.out.print(numero + \" \"));\n System.out.println();\n numeros.stream().map(Main::calculaCubo).forEach(numero -> System.out.print(numero + \" \"));\n }", "static void print(List list)\r\n\t{\n\t\tfor(int i= 0; i < list.size(); i++){\r\n\t\t\tSystem.out.println(list.get(i));\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\t\tList<Person> personList = Arrays.asList( new Person(\"narendra\", \"nirala\", 27), \r\n\t\t\t\tnew Person(\"pankaj\", \"yadav\", 27),\r\n\t\t\t\tnew Person(\"sanjay\", \"sahu\", 28),\r\n\t\t\t\tnew Person(\"prakash\", \"solemn\", 27),\r\n\t\t\t\tnew Person(\"bhagwat\", \"chandra\", 30));\r\n\t\t\r\n\t\t\r\n\t\tComparator<Person> comp = new Comparator<Person>() {\t\r\n\t\t\t@Override\r\n\t\t\tpublic int compare(Person p1, Person p2) {\r\n\t\t\t\treturn p1.getFirstName().compareTo(p2.getFirstName());\r\n\t\t\t}\r\n\t\t};\r\n\t\t\r\n\t\tCollections.sort(personList, comp);\r\n\t\t\r\n\t\tSystem.out.println(personList);\r\n\t\t\r\n\t\t//------Java 8 way\r\n\t\tList<Person> personList2 = Arrays.asList( new Person(\"narendra\", \"nirala\", 27), \r\n\t\t\t\tnew Person(\"pankaj\", \"yadav\", 27),\r\n\t\t\t\tnew Person(\"sanjay\", \"sahu\", 28),\r\n\t\t\t\tnew Person(\"prakash\", \"solemn\", 27),\r\n\t\t\t\tnew Person(\"bhagwat\", \"chandra\", 30));\r\n\t\t\r\n\t\tCollections.sort(personList2, (person1,person2) -> person1.getFirstName().compareTo(person2.getFirstName()));\r\n\t\tSystem.out.println(personList2);\r\n\t\t\r\n\t\t\r\n\t\t//---------------------------Task 2 - print all elements\r\n\t\tSystem.out.println(\"-------------Task 2 - print all elements------------------\");\r\n\t\t// java 8 way 1\r\n\t\tpersonList2.forEach(System.out::println);\r\n\t\t\r\n\t\t// java 8 way 2\r\n\t\t\r\n\t\tpersonList2.forEach(s -> System.out.println(s));\r\n\t\t\r\n\t\t//------------------------Task 3 - Print conditionally and define what to do if condition satisfied\r\n\t\t// Java 8 way\r\n\t\tSystem.out.println(\"----------Task 3 - Print conditionally---------------------\");\r\n\t\tprintConditionally(personList, p -> p.getFirstName().startsWith(\"b\") , p -> System.out.println(p.getFirstName().toUpperCase()));\r\n\t\tprintConditionally(personList, p -> p.getLastName().startsWith(\"s\"), p -> System.out.println(p.getFirstName().toUpperCase()));\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\tAnimal cat = () -> System.out.println(\"MEAW\");\n\t\t\n\t\tAnimal dog = () -> System.out.println(\"BARK\");\n\t\t\n\t\tAnimal lion = () -> System.out.println(\"ROAR\");\n\t\t\n\t\tcat.speak();\n\t\tdog.speak();\n\t\tlion.speak();\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tConsumer<String> imprimirUmaFrase = System.out::println;\n\t\tConsumer<String> imprimirOutraFrase = frase -> System.out.println(frase);\n\t\t\n\t\timprimirUmaFrase.accept(\"Hello World\");\n\t\timprimirOutraFrase.accept(\"Ola Mundo\");\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tComparator<String> stringCompare = \n\t\t\t\t(String o1, String o2) -> {\n\t\t\t\t\tSystem.out.println(\"Lambda Block\");\n\t\t\t\t\treturn o1.compareTo(o2);\n\t\t\t\t};\n\t\t\t\t\n\t\tint result = stringCompare.compare(\"hello\", \"h2kStudents\");\n\t\tSystem.out.println(\"With Lambda :: \" + result);\n\n\t}", "public static void main(String[] args) {\n List<String> names = Arrays.asList(\"Smith\", \"Gourav\", \"Heather\", \"John\", \"Catania\");\n Function<String, Integer> nameSize = String::length;\n var newList = names.stream().map(nameSize).collect(Collectors.toList());\n System.out.println(newList);\n System.out.println(\"----------------------------------------------------------\");\n var newList1 = testMyFunc(names, s -> s.concat(\" A\"));\n System.out.println(newList1);\n System.out.println(\"----------------------------------------------------------\");\n\n // For two arguments\n Map<String, Integer> salaries = new HashMap<>();\n salaries.put(\"John\", 40000);\n salaries.put(\"Freddy\", 30000);\n salaries.put(\"Samuel\", 50000);\n BiFunction<String, Integer, Integer> bf =\n (name, oldValue) -> name.equals(\"Freddy\") ? oldValue : oldValue + 5000;\n salaries.replaceAll(bf);\n System.out.println(salaries);\n }", "void mo54419a(List<String> list);", "public static void main(String... args) {\n\n Person p1 = new Person(\"Mike\", 25);\n Person p2 = new Person(\"John\", 33);\n Person p3 = new Person(\"Slavek\", 48);\n Person p4 = new Person(\"Pawel\", 15);\n Person p5 = new Person(\"MJerry\", 66);\n Person p6 = new Person(\"White\", 35);\n\n List<Person>list = new ArrayList<>(Arrays.asList(p1,p2,p3,p4,p5,p6));\n\n list.forEach(System.out::println);\n list.removeIf(ps->ps.getAge()<25);\n System.out.println(\"after removal\");\n list.forEach(System.out::println);\n System.out.println(\"Trasformation\");\n list.replaceAll(p->new Person(p.getName().toUpperCase(),p.getAge()-5));\n System.out.println(\"After replacement\");\n list.forEach(System.out::println);\n list.sort((s1,s2)->s1.getAge()-s2.getAge());\n System.out.println(\"after sorting\");\n list.forEach(System.out::println);\n list.sort((s1,s2)->s1.getAge()-s2.getAge());\n list.sort(Comparator.comparing(Person::getAge));\n list.sort(Comparator.comparing(Person::getName).reversed());\n\n List<String >sd = Arrays.asList(\"okkok\");\n sd.stream().map(value-> {\n char ss = value.toUpperCase().charAt(0);\n return ss;\n }\n );\n sd.forEach(System.out::println);\n\n\n\n\n }", "public static void main(String[] args) {\n\t\t\n\t\tMap<String, String> map = new HashMap<>();\n\t\t\n\t\tArrayList<String> lista = new ArrayList<>();\n\t\t\n\t\tString a = \"Juan\";\n\t\tString b = \"ObiJuan\";\n\t\tString c = \"Paco\";\n\t\t\n\t\tlista.add(a);\n\t\tlista.add(b);\n\t\tlista.add(c);\n\t\t\n\t\tmap.put(\"primero\", a);\n\t\tmap.put(\"segundo\", b);\n\t\tmap.put(\"tercero\", c);\n\t\t\n\t\tSystem.out.println(lista.get(1));\n\t\tSystem.out.println(lista.get(lista.indexOf(\"ObiJuan\")));\n\t\t\n\t\tSystem.out.println(\"----------------\");\n\t\t\n\t\tSystem.out.println(map.get(\"primero\"));\n\t\t\n\t\tlista.remove(lista.indexOf(\"Paco\"));\n\t\t\n\t\t\n\t\tfor (String palabra : lista) {\n\t\t\tSystem.out.println(palabra);\n\t\t}\n\t\tSystem.out.println(\"----------------\");\n\t\tfor (String key : map.keySet()) {\n\t\t\tSystem.out.println(\"Clave: \" + key);\n\t\t\tSystem.out.println(\"Valor: \" + map.get(key));\n\t\t\tSystem.out.println(\"----------------\");\n\t\t}\n\t\tSystem.out.println(\"----------------\");\n\t\tSystem.out.println(\"----------------\");\n\t\t\n\t\tlista.forEach(elemento -> System.out.println(elemento));\n\t\t\n\t\tSystem.out.println(\"----------------\");\n\t\t\n//\t\tmap.forEach(clave, valor -> (\n//\t\t\tSystem.out.println(\"Clave con lambda: \" + clave);\n//\t\t\tSystem.out.println(\"Valor con lambda: \" + valor);\n//\t\t);\n//\t\t\n\t}", "private static void printList(Student[] students)\r\n {\r\n for(int index = 0; index < students.length; index++)\r\n {\r\n System.out.println(students[index].toString());\r\n }\r\n }", "public static void main(String[] args) {\n\r\n\t\tArrays.asList(\"Fred\", \"jim\", \"Sheila\")\r\n\t\t.stream()\r\n\t\t.peek(System.out::println)\r\n\t\t.allMatch(s -> s.startsWith(\"F\")); // fred jim\r\n\t}", "public void performLambdaOperations(){\n functionalInterfaceLambdaService.printFunctionalInterfaceWithAndWithoutLambda();\n runnableLambdaService.printRunnableInterfaceWithAndWithoutLambda();\n comparatorLambdaService.printComparatorInterfaceWithAndWithoutLambda();\n }", "public static void main(String[] args) {\n\t\tchilclass cObj = new chilclass();\r\n\t\t\r\n\t\tString result = cObj.my.sayhello(\"Haseeb\");\r\n\t\tSystem.out.println(result);\r\n\t\t\r\n\t// convert chaining method expression into lambda\r\n\t\t\r\n\t\t\r\n\t\t//() -> {}\r\n\t\t\r\n\t\t//lambda functions only work with functional interfaces\r\n\t\tmyfuncinterf obj = (p) -> \"Hello\" + p + \"\\this is from lambda function\";\r\n\t\r\n\t\t\t\t\r\n\t\tSystem.out.println(obj.sayhello(\"Allen\"));\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\n\t\tString[] str = { \"a\", \"b\", \"c\" };\n\n\t\tgetAll(str).ifPresent(a -> a.forEach(System.out::println));\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tList<String> list = Arrays.asList(\"Mukesh\", \"Vishal\", \"Amar\");\n\t\tString result = list.parallelStream().collect(StringBuilder::new,\n\t\t\t\t(response, element) -> response.append(\" \").append(element),\n\t\t\t\t(response1, response2) -> response1.append(\",\").append(response2.toString())).toString();\n\t\tSystem.out.println(\"Result: \" + result);\n\t}", "public void printList()\n {\n tasks.forEach(task -> System.out.println(task.getDetails()));\n }", "public void filterMapExample() {\n List<String> result = createPeople()\n .stream()\n .filter(predicate)\n .map(Person::getName)\n .map(String::toUpperCase)\n .collect(Collectors.toUnmodifiableList());\n print.accept(result);\n }", "public static void main(String[] args) {\n final FilenameFilter filter = new FilenameFilter() {\n @Override\n public boolean accept(File dir, String name) {\n return name.toLowerCase().endsWith(\".txt\");\n }\n };\n\n //use a lambda\n final FilenameFilter filterLambda1 = (File dir, String name) -> { return name.toLowerCase().endsWith(\".txt\");};\n\n //also you can not use the types anymore, let the compiler figure them out\n final FilenameFilter filterLambda2 = (dir, name) -> { return name.toLowerCase().endsWith(\".txt\"); };\n\n //lose the return and {}\n final FilenameFilter filterLambda3 = (dir, name) -> !dir.isDirectory()&&name.toLowerCase().endsWith(\".txt\");\n\n File homeDir = new File(System.getProperty(\"user.home\"));\n String[] files = homeDir.list(filterLambda3);\n for(String file:files){\n System.out.println(file);\n }\n\n }", "public static void main(String[] args) throws IOException {\n\t\tList<String> people = Arrays.asList(\"Al\", \"Ankit\", \"Kushal\", \"Brent\", \"Sarika\", \"amanda\", \"Hans\", \"Shivika\");\n\t\tpeople\n\t\t\t.stream()\n\t\t\t.map(String::toLowerCase)\n\t\t\t.filter(x -> x.startsWith(\"a\"))\n\t\t\t.forEach(System.out::println);\n\t}", "public static void main(String[] args) {\n\n Employee e1 = new Employee(\"hewenjie\",10);\n Employee e2 = e1;\n e2.setName(\"e233\");\n System.out.println(e1.getName());\n //Comparator.comparing()\n //ArrayList list = new ArrayList();\n //list.forEach(o -> System.out.println(o.toString()));\n // int sum = 0;\n // list.forEach(i -> {sum += i;});\n }" ]
[ "0.817536", "0.75928754", "0.71803343", "0.6913192", "0.69054437", "0.6885158", "0.6868023", "0.67667145", "0.6653517", "0.6598061", "0.656213", "0.6358805", "0.63438934", "0.63205487", "0.6264533", "0.6251562", "0.6233137", "0.6205933", "0.6167456", "0.6154486", "0.61059994", "0.60302806", "0.60187733", "0.601159", "0.59983104", "0.5982462", "0.59698284", "0.59617454", "0.5953112", "0.5951175", "0.5934675", "0.5871128", "0.5867215", "0.58636546", "0.58551747", "0.5829929", "0.58279645", "0.5827679", "0.5821375", "0.58159614", "0.5815614", "0.57744056", "0.5753909", "0.57450235", "0.5738035", "0.5716037", "0.57070386", "0.5696099", "0.5695234", "0.5680351", "0.5676748", "0.5676074", "0.56708056", "0.5653685", "0.56476784", "0.56424606", "0.5641875", "0.5639353", "0.562841", "0.5627524", "0.5616083", "0.5610622", "0.56096447", "0.56067455", "0.5576848", "0.5574456", "0.5567698", "0.5559726", "0.5553878", "0.55434614", "0.5541576", "0.55391645", "0.5538076", "0.55368567", "0.55161333", "0.5515717", "0.550353", "0.5499511", "0.54979086", "0.5496806", "0.54905367", "0.54770875", "0.5463188", "0.5459446", "0.54410034", "0.54389745", "0.5434385", "0.5427264", "0.54221076", "0.541957", "0.5418776", "0.5417576", "0.5415488", "0.5414714", "0.541335", "0.541274", "0.5407028", "0.54050565", "0.54040825", "0.5396441" ]
0.56154037
61
String username = RandomStringUtils.random(12, true, true);
public static void main(String[] args) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String generateRandomUsername() {\n final String randomFirst = Long.toHexString(Double.doubleToLongBits(Math\n .random()));\n final String randomSecond = Long.toHexString(Double.doubleToLongBits(Math\n .random()));\n final String randomThird = Long.toHexString(Double.doubleToLongBits(Math\n .random()));\n String userName = randomFirst + randomSecond + randomThird;\n\n userName = userName.substring(0, 10) + \"@ngetestmail.com\";\n\n return userName;\n }", "private String getRandomName(){\n return rndString.nextString();\n }", "public String generateToken(String username) {\n\t\tString token = username;\n\t\tLong l = Math.round(Math.random()*9);\n\t\ttoken = token + l.toString();\n\t\treturn token;\n\t}", "private static String genString(){\n final String ALPHA_NUMERIC_STRING =\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n int pwLength = 14; //The longer the password, the more likely the user is to change it.\n StringBuilder pw = new StringBuilder();\n while (pwLength-- != 0) {\n int character = (int)(Math.random()*ALPHA_NUMERIC_STRING.length());\n pw.append(ALPHA_NUMERIC_STRING.charAt(character));\n }\n return pw.toString(); //\n }", "public static String randomEmail() {\n\t\tRandom randomGenerator = new Random(); \n\t\tint randomInt = randomGenerator.nextInt(10000); \n\t\treturn \"username\"+ randomInt +\"@yopmail.com\"; \n\t}", "private final String getRandomString() {\n StringBuffer sbRan = new StringBuffer(11);\n String alphaNum = \"1234567890abcdefghijklmnopqrstuvwxyz\";\n int num;\n for (int i = 0; i < 11; i++) {\n num = (int) (Math.random() * (alphaNum.length() - 1));\n sbRan.append(alphaNum.charAt(num));\n }\n return sbRan.toString();\n }", "private String getRandomString() {\n\t\tStringBuilder salt = new StringBuilder();\n\t\tRandom rnd = new Random();\n\t\twhile (salt.length() <= 5) {\n\t\t\tint index = (int) (rnd.nextFloat() * SALTCHARS.length());\n\t\t\tsalt.append(SALTCHARS.charAt(index));\n\t\t}\n\t\tString saltStr = salt.toString();\n\t\treturn saltStr;\n\t}", "private static String getRandString() {\r\n return DigestUtils.md5Hex(UUID.randomUUID().toString());\r\n }", "public String genUserToken()\n\t{\n\t\tString token = \"\";\n\t\tfor (int i = 0; i < 16; i++)\n\t\t{\n\t\t\ttoken = token + tokenGenerator.nextInt(10);\n\t\t}\n\t\treturn token;\n\t}", "public static String getRandomString() {\n return RandomStringUtils.random(20, true, false);\n }", "public String randomName() {\n return RandomStringUtils.randomAlphabetic( 10 );\n }", "static String getSaltString() {\n String SALTCHARS = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890\";\n StringBuilder salt = new StringBuilder();\n Random rnd = new Random();\n while (salt.length() < 18) { // length of the random string.\n int index = (int) (rnd.nextFloat() * SALTCHARS.length());\n salt.append(SALTCHARS.charAt(index));\n }\n String saltStr = salt.toString();\n return saltStr;\n }", "@Override\r\n\tpublic String randString(int n) {\n\t\tString base=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\r\n\t\treturn randString(n, base);\r\n\t}", "public static String randomeString() {\n\t\t\tString generatedString = RandomStringUtils.randomAlphabetic(8);\n\t\t\tSystem.out.println(generatedString);\n\t\t\treturn generatedString;\n\t\t\t\n\t\t}", "String selectRandomSecretWord();", "public static String createUsername() {\r\n\t\tboolean complete = false;\r\n\t\tString username = \"\";\r\n\t\t\r\n\t\twhile(complete == false) {\r\n\t\t\tSystem.out.println(\"Please type a username (no spaces):\");\r\n\t\t\tusername = scan.nextLine();\r\n\t\t\t//us.checkExit(username);\r\n\t\t\t\r\n\t\t\tif(us.checkUniqueUsername(username) == false) {\r\n\t\t\t\tSystem.out.println(\"Username is taken, try again, partner.\");\r\n\t\t\t\tcontinue;\r\n\t\t\t} else if(username.contains(\" \")) {\r\n\t\t\t\tSystem.out.println(\"Invalid username - contains space(s)\");\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tcomplete = true;\r\n\t\t}//While1\r\n\t\t\r\n\t\treturn username;\r\n\t}", "public static String rndLetterString() {\r\n int spLen = RBytes.rndInt(10, 20);\r\n char[] c = RBytes.rndCharArray('a', 'z');\r\n char[] C = RBytes.rndCharArray('A', 'Z');\r\n char[] d = RBytes.rndCharArray('0', '9');\r\n String special = \"\";\r\n for (int s = 0; s < spLen; s++) {\r\n special += \"!@#$%^&*()-_~`=+:;.,\";\r\n }\r\n String s1 = new String(c) + new String(d) + new String(C) + special;\r\n return shaffleString(s1);\r\n }", "public String generateUsername(String firstname, String lastname) throws SQLException, ClassNotFoundException {\n\t\t//Setup the connection if it does not already exist\n\t\tif(database == null)\n\t\t\tdatabase = new DatabaseHandler();\n\t\t//Sanitize firstname and last name just to be safe\n\t\tString generated = Sanitizer.sanitizeInput(firstname.substring(0,2) + lastname.substring(0,4));\n\t\tStatement findUsernameIfExists;\n \tResultSet Result;\n \tfindUsernameIfExists = database.getConnection().createStatement();\n \t//Loop until we find a username that does not exist.\n \twhile(true) {\n \t//query the database for the generated username\n String query = \"SELECT username FROM personnel WHERE username= \" + generated + \";\";\n \tResult = findUsernameIfExists.executeQuery(query);\n \t//if that username is not occupied then return it to the callee\n \tif(Result.wasNull())\n \t\treturn generated.toLowerCase(); // we only return if we find a unique username\n \telse\n \t{\n \t\t//otherwise mess with it.\n \t\tRandom rand = new Random();\n \t\t//pick a random position to switch the character\n \t\tint position = rand.nextInt(6);\n \t\t//pick a random character to switch with\n \t\tchar c = (char)(rand.nextInt(26) + 'a');\n \t\tchar[] cs = generated.toCharArray();\n \t\t//change the character from a random position with a new random character\n \t\tcs[position] = c;\n \t\tgenerated = new String(cs);\n \t}\n \t//and then check again if that exists.\n \t}\n\t}", "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 }", "protected String random(String value) {\n \t\treturn value + new Random().nextInt(100);\n \t}", "private static String accountNumberGenerator() {\n char[] chars = new char[10];\n for (int i = 0; i < 10; i++) {\n chars[i] = Character.forDigit(rnd.nextInt(10), 10);\n }\n return new String(chars);\n }", "private String newPassword() {\n\t\tchar[] vet = new char[10];\n\t\tfor(int i=0; i<10; i++) {\n\t\t\tvet[i] = randomChar();\n\t\t}\n\t\treturn new String(vet);\n\t}", "public static String generateRandomNonce() {\n Random r = new Random();\n StringBuffer n = new StringBuffer();\n for (int i = 0; i < r.nextInt(8) + 2; i++) {\n n.append(r.nextInt(26) + 'a');\n }\n return n.toString();\n }", "public String createPassword() {\n String alphabet= \"abcdefghijklmnopqrstuvwxyz\";\n int count=0;\n String randomPass=\"\";\n while (count<this.length){\n randomPass+=alphabet.charAt(this.randomNumber.nextInt(alphabet.length()-1));\n count++;\n }\n return randomPass;\n }", "public static String getToken(String username)\n\t{\n\t\tif(Application.getAccountLibrary().getAccount(username) == null)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\tString token = StringUtils.getRandomStringOfLettersAndNumbers(10)\n\t\t\t\t.toUpperCase();\n\t\tusernames.put(token, username);\n\t\treturn token;\n\t}", "public static String getRandomString(int length)\r\n {\r\n if (length <= 0) length = 8;\r\n byte[] bytes = new byte[length];\r\n random.nextBytes(bytes);\r\n StringBuffer sb = new StringBuffer(length);\r\n for (int i = 0; i < length; i++)\r\n {\r\n sb.append(m_alphanumeric[Math.abs(bytes[i]%36)]);\r\n }\r\n return sb.toString();\r\n }", "private String createFakeName() {\n final int firstLowercaseLetterAscii = 97;\n final int lowercaseLetterRange = 25;\n\n // Maximum length random name = 20\n final int minNameLength = 4;\n int randomNameLength = (random.nextInt(17)) + minNameLength;\n\n // Algorithm to generate the random name\n StringBuilder randomName = new StringBuilder();\n for (int i = 0; i < randomNameLength; i++) {\n char randChar = (char) (random.nextInt(lowercaseLetterRange + 1) + firstLowercaseLetterAscii);\n randomName.append(randChar);\n }\n return randomName.toString();\n }", "public void generateRandomPassword() {\n\t\tString randomPassword = \"\";\n\t\tchar[] chars = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\".toCharArray();\n\t\tjava.util.Random random = new java.util.Random();\n\t\tfor (int i = 0; i < 20; i++) {\n\t\t char c = chars[random.nextInt(chars.length)];\n\t\t randomPassword += c;\n\t\t}\n\t\tthis.password = randomPassword;\n\t}", "public void testRandomStrings() throws Exception {\n checkRandomData(random(), a, 200 * RANDOM_MULTIPLIER);\n }", "public static String getRandomString() {\n \tif (random == null)\n \t\trandom = new Random();\n \treturn new BigInteger(1000, random).toString(32);\n }", "public static String randomString() {\n\t\tint leftLimit = 97; // letter 'a'\n\t\tint rightLimit = 122; // letter 'z'\n\t\tint targetStringLength = 10;\n\t\tRandom random = new Random();\n\n\t\treturn random.ints(leftLimit, rightLimit + 1).limit(targetStringLength)\n\t\t\t\t.collect(StringBuilder::new, StringBuilder::appendCodePoint, StringBuilder::append).toString();\n\t}", "public static synchronized String getRandomPassword() {\n\t\t StringBuilder password = new StringBuilder();\n\t\t int j = 0;\n\t\t for (int i = 0; i < MINLENGTHOFPASSWORD; i++) {\n\t\t \t//System.out.println(\"J is \"+j);\n\t\t password.append(getRandomPasswordCharacters(j));\n\t\t j++;\n\t\t \n\t\t if (j == 4) {\n\t\t j = 0;\n\t\t }\n\t\t }\n\t\t return password.toString();\n\t\t}", "long getUserCode(String username) {\n\n return (long) (Math.random() * 99999999999l);\n }", "public static String rndString() {\r\n char[] c = RBytes.rndCharArray();\r\n return new String(c);\r\n\r\n }", "private String generateRandomId(){\n\n //creates a new Random object\n Random rnd = new Random();\n\n //creates a char array that is made of all the alphabet (lower key + upper key) plus all the digits.\n char[] characters = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890\".toCharArray();\n\n //creates the initial, empty id string\n String id = \"\";\n\n /*Do this 20 times:\n * randomize a number from 0 to the length of the char array, characters\n * add the id string the character from the index of the randomized number*/\n for (int i = 0; i < 20; i++){\n id += characters[rnd.nextInt(characters.length)];\n }\n\n //return the 20 random chars long string\n return id;\n\n }", "String getUserUsername();", "private static String generateRandomString(int size) {\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < size / 2; i++) sb.append((char) (64 + r.nextInt(26)));\n return sb.toString();\n }", "private\tString\tgenerateUUID(){\n\t\treturn\tUUID.randomUUID().toString().substring(0, 8).toUpperCase();\n\t}", "private String generateRandomWord()\n {\t\n\tRandom randomNb = new Random(System.currentTimeMillis());\n\tchar [] word = new char[randomNb.nextInt(3)+5];\n\tfor(int i=0; i<word.length; i++)\n\t word[i] = letters[randomNb.nextInt(letters.length)];\n\treturn new String(word);\n }", "private String generateToken () {\n SecureRandom secureRandom = new SecureRandom();\n long longToken;\n String token = \"\";\n for ( int i = 0; i < 3; i++ ) {\n longToken = Math.abs( secureRandom.nextLong() );\n token = token.concat( Long.toString( longToken, 34 + i ) );//max value of radix is 36\n }\n return token;\n }", "public static String getDynamicSalt() {\n\t\treturn RandomStringUtils.randomAlphanumeric(8);\n\t}", "public static String generatePass(){\r\n \r\n String password = new Random().ints(10, 33, 122).collect(StringBuilder::new,\r\n StringBuilder::appendCodePoint, StringBuilder::append)\r\n .toString();\r\n return password;\r\n\r\n }", "private static String randomString(int length) {\n\t\tStringBuilder builder = new StringBuilder();\n\t\tfor (int i = 0; i < length; i++) {\n\t\t\tint index = randInt(0, ALPHA_NUMERIC_STRING.length() - 1);\n\t\t\tbuilder.append(ALPHA_NUMERIC_STRING.charAt(index));\n\t\t}\n\t\treturn builder.toString();\n\t}", "private String randomPassword(int length) {\r\n\t\tString passSet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%\";\r\n\t\tchar[] password = new char[length];\r\n\t\tfor(int i=0;i<length;i++) {\r\n\t\t\tint ind = (int) (Math.random()*passSet.length());\r\n\t\t\tpassword[i] = passSet.charAt(ind);\r\n\t\t}\r\n\t\treturn new String(password);\r\n\t}", "private String randomPassword(int length){\r\n\t\tString passwordSet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!?$#@\";\r\n\t\t\tchar[] password = new char[length];\r\n\t\t\t\t\r\n\t\t\tfor(int i = 0; i < length; i++){\r\n\t\t\t\tint rand = (int) (Math.random() * passwordSet.length());\r\n\t\t\t\tpassword[i] = passwordSet.charAt(rand);\r\n\t\t\t}\r\n\t\treturn new String(password);\r\n\t}", "public static String randomIdentifier() {\r\n\t\tfinal String lexicon = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\r\n\t\tfinal java.util.Random rand = new java.util.Random();\r\n\t\t// consider using a Map<String,Boolean> to say whether the identifier is\r\n\t\t// being used or not\r\n\t\tfinal Set<String> identifiers = new HashSet<String>();\r\n\r\n\t\tStringBuilder builder = new StringBuilder();\r\n\t\twhile (builder.toString().length() == 0) {\r\n\t\t\tint length = rand.nextInt(5) + 5;\r\n\t\t\tfor (int i = 0; i < length; i++)\r\n\t\t\t\tbuilder.append(lexicon.charAt(rand.nextInt(lexicon.length())));\r\n\t\t\tif (identifiers.contains(builder.toString()))\r\n\t\t\t\tbuilder = new StringBuilder();\r\n\t\t}\r\n\t\treturn builder.toString();\r\n\t}", "String getNewRandomTag() {\n\t\tbyte t[] = new byte[tagLength];\n\t\tfor (int i = 0; i < tagLength; i++) {\n\t\t\tt[i] = (byte) rand('a', 'z');\n\t\t}\n\t\treturn new String(t);\n\t}", "public String generatePassword(int size) {\n\n int wordIndx = getRandomWord();\n String newPassword = threeCharWords.get(wordIndx);\n return newPassword + getRandomNumber(size);\n\n\n }", "private String getTempPassword(int length) {\r\n\t\tRandom rand = new Random(9845936902l);\r\n\t\tchar[] buf = new char[length];\r\n\t\tfor (int idx = 0; idx < buf.length; ++idx)\r\n\t\t\tbuf[idx] = symbols[rand.nextInt(symbols.length)];\r\n\t\treturn new String(buf);\r\n\t}", "public String generate() {\r\n String result = RandomStringUtils.random(8,true,true);\r\n return result;\r\n }", "public static String generateRandomAlphanumericString(int length) {\n return RandomStringUtils.randomAlphanumeric(length).toLowerCase();\n }", "public static String randInt(){\n return String.valueOf(rand.nextInt(10));\n }", "public static String random(final int count) {\r\n\t\treturn org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric(count);\r\n\t}", "public String createPassword() {\n while (i < length){\n temp += abc.charAt(random.nextInt(26));\n i++;\n }\n\n this.password = this.temp;\n this.temp = \"\";\n this.i = 0;\n return password;\n }", "public static String randomString(int length,boolean flag) {\n\t\tString alpha=\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\r\n\t\tString num=\"0123456789\";\r\n\t\tchar[] characterSet;\r\n\t\tif(flag) // flag alpha is set both alphabets and numbers are considered.\r\n\t\tcharacterSet = (num+alpha).toCharArray();\r\n\t\telse // flag alpha is not set only numbers are considered.\r\n\t\tcharacterSet = (num).toCharArray();\r\n\t Random random = new SecureRandom();\r\n\t char[] result = new char[length];\r\n\t for (int i = 0; i < result.length; i++) {\r\n\t // picks a random index out of character set > random character\r\n\t int randomCharIndex = random.nextInt(characterSet.length);\r\n\t result[i] = characterSet[randomCharIndex]; //generates ramdomnumber\r\n\t }\r\n\t return new String(result);\r\n\t}", "static String getRandomString(int n){\n StringBuilder sb = new StringBuilder(n); \r\n \r\n for (int i = 0; i < n; i++) { \r\n \r\n // generate a random number between \r\n // 0 to AlphaNumericString variable length \r\n int index = (int)(alphabet.length() * Math.random()); \r\n \r\n // add Character one by one in end of sb \r\n sb.append(alphabet.charAt(index)); \r\n } \r\n \r\n return sb.toString(); \r\n }", "private String generateRandomHexString(){\n return Long.toHexString(Double.doubleToLongBits(Math.random()));\n }", "public String generate(int length) {\r\n\t\tString chars = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890\";\r\n\t\tString pass = \"\";\r\n\t\tfor (int x = 0; x < length; x++) {\r\n\t\t\tint i = (int) Math.floor(Math.random() * 62);\r\n\t\t\tpass += chars.charAt(i);\r\n\t\t}\r\n\r\n\t\treturn pass;\r\n\t}", "static public int getHobgoblinStr(){\n str = rand.nextInt(3) + 3;\n return str;\n }", "public static String randomNumberString() {\n\r\n Random random = new Random();\r\n int i = random.nextInt(999999);\r\n\r\n\r\n return String.format(\"%06d\", i);\r\n }", "static String getAlphaNumericString(int n) \n {\n byte[] array = new byte[256]; \n new Random().nextBytes(array); \n \n String randomString \n = new String(array, Charset.forName(\"UTF-8\")); \n \n // Create a StringBuffer to store the result \n StringBuffer r = new StringBuffer(); \n \n // Append first 20 alphanumeric characters \n // from the generated random String into the result \n for (int k = 0; k < randomString.length(); k++) { \n \n char ch = randomString.charAt(k); \n \n if (((ch >= 'a' && ch <= 'z') \n || (ch >= 'A' && ch <= 'Z') \n || (ch >= '0' && ch <= '9')) \n && (n > 0)) { \n \n r.append(ch); \n n--; \n } \n } \n \n // return the resultant string \n return r.toString(); \n }", "@NonNull\n public static String random(int length) {\n String uuid = UUIDUtils.random();\n return uuid.substring(0, Math.min(length, uuid.length()));\n }", "public static void main(String[] args) {\n\t\t\n\t\tfinal String letters = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*\";\n\n\t\t// b. have a random number generator\n\n\t\tRandom rand = new Random();\n\n\t\t// c. use the random generator to get the charAt a random location based on the\n\t\t// number of characters\n\n\t\tchar char1 = letters.charAt(rand.nextInt(letters.length()));\n\t\tchar char2 = letters.charAt(rand.nextInt(letters.length()));\n\t\tchar char3 = letters.charAt(rand.nextInt(letters.length()));\n\t\tchar char4 = letters.charAt(rand.nextInt(letters.length()));\n\t\tchar char5 = letters.charAt(rand.nextInt(letters.length()));\n\t\tchar char6 = letters.charAt(rand.nextInt(letters.length()));\n\t\tchar char7 = letters.charAt(rand.nextInt(letters.length()));\n\t\tchar char8 = letters.charAt(rand.nextInt(letters.length()));\n\t\t// d. concatenate the characters together to get the word\n\n\t\tSystem.out.println(\"\" + char1 + char2 + char3 + char4 + char5 + char6 + char7 + char8);\n\t\tSystem.out.println(String.valueOf(char1)+String.valueOf(char2)+String.valueOf(char3)+String.valueOf(char4)+String.valueOf(char5)+String.valueOf(char6)+String.valueOf(char7)+String.valueOf(char8));\n\t\t\t\t\n\n\t\t\n\t\t\n\t\t//Build a username generator absed on lastname and firstname inputs from the user\n\t\t//Conditions: \n\t\t//\t\t\tNo more than 1 username can include either the whole first or last name\n\t\t//\t\t\tAt least 1 username should include numbers\n\t\t//\t\t\tThere needs to be a random component in at least 2 name generations\n\t\t//\t\t\tThe usernames should adhere to the characteristics of typical usernames\n\t\t\n\t\tfinal String numbers = \"1234567890.\";\n\t\tScanner scan = new Scanner(System.in);\n\t\tSystem.out.println(\"Type in your first name > \");\n\t\tString fName = scan.nextLine();\n\t\tSystem.out.println(\"Type in your last name > \");\n\t\tString lName = scan.nextLine();\n\t\t\n\t\tString part1 = fName.toLowerCase().substring(0, rand.nextInt(fName.length()));\n\t\tString part2 = lName.toLowerCase().substring(0, rand.nextInt(lName.length()));\n\t\t\n\t\tSystem.out.println(\"A possible username \" + part1+part2);\n\t\t\n\t\tString part3 = String.valueOf(numbers.charAt(rand.nextInt(numbers.length())));\n\t\tString part4 = String.valueOf(numbers.charAt(rand.nextInt(numbers.length())));\n\t\t\n\t\tSystem.out.println(\"A possible username \" + part1+part2+part3+part4);\n\t\t\n\t\t//Take inputs and Build a decision tree that decides whether to issue a loan or not\n\t\t\n\t\t//https://www.brcommunity.com/images/articles/b624-2full.png\n\t\t\t\n\n\t}", "private String randomPassword(int length) {\r\n\t\t\tString passwordSet=\"ABCDEFGHIJKLMNOPQRSTUWXYZ0123456789!@#$%\";\r\n\t\t\tchar [] password = new char[length];\r\n\t\t\tfor(int i=0; i<length; i++) {\r\n\t\t\t\tint rand=(int)(Math.random() * passwordSet.length());\r\n\t\t\t\tpassword[i] = passwordSet.charAt(rand);\r\n\t\t\t\tSystem.out.println(rand);\r\n\t\t\t\tSystem.out.println(passwordSet.charAt(rand));\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\treturn new String(password);\r\n\t\t\t\r\n\t\t}", "public static String randomString() {\n\t\tfinal long value = RANDOMIZER.nextLong();\n\t\treturn String.valueOf(value < 0 ? value * -1 : value);\n\t}", "public String randomString() {\n return new BigInteger(130, random).toString(32);\n }", "static public String hobNameGen(){\n int i = rand.nextInt(8);\n String hName = name[i];\n return hName;\n }", "public static String generateString(int count) {\r\n String ALPHA_NUMERIC_STRING = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\";\r\n StringBuilder builder = new StringBuilder();\r\n while (count-- != 0) {\r\n int character = (int) (Math.random() * ALPHA_NUMERIC_STRING.length());\r\n builder.append(ALPHA_NUMERIC_STRING.charAt(character));\r\n }\r\n return builder.toString();\r\n }", "@Test\n public void testUtil() {\n String random = Util.getInstance().getRandomString(15);\n\n assertEquals(15, random.length());\n }", "public String generate(final int count){\n return RandomStringUtils.random(count, true, true);\n }", "public static String randomStringGenerator(int len)\n {\n \t int lLimit = 97; \n \t int rLimit = 122; \n \t int targetStringLength =len;\n \t Random random = new Random();\n String generatedString = random.ints(lLimit, rLimit + 1)\n \t .limit(targetStringLength)\n \t .collect(StringBuilder::new, StringBuilder::appendCodePoint, StringBuilder::append)\n \t .toString();\n return generatedString;\n }", "protected static String generateString(int length) {\n String characters = \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n Random rnd = new Random(System.nanoTime());\n char[] text = new char[length];\n for (int i = 0; i < length; i++) {\n text[i] = characters.charAt(rnd.nextInt(characters.length()));\n }\n return new String(text);\n }", "String getUsername();", "String getUsername();", "String getUsername();", "String getUsername();", "String getUsername();", "String getUsername();", "public static String createUser(String a, String b)\n\t{\n\t\tString aa = a.substring(0, 3);\n\t\t//gets the first three characters of string a\n\t\tString bb = b.substring(b.length()-3);\n\t\treturn new String(aa+bb);\n\t}", "private String getRandName() {\n int firstName = (int)(Math.random() * listFirstNames.length);\n String fName = listFirstNames[firstName].trim();\n int lastName = (int)(Math.random() * listLastNames.length);\n String lName = listLastNames[lastName].trim();\n return ( fName + \" \" + lName ); \n }", "public static int getRandomNumberString() {\n // It will generate 6 digit random Number.\n // from 0 to 999999\n Random rnd = new Random();\n int number = rnd.nextInt(999999);\n\n // this will convert any number sequence into 6 character.\n return number;\n }", "public static synchronized String generateUniqueToken(int length) {\n\n byte random[] = new byte[length];\n Random randomGenerator = new Random();\n StringBuffer buffer = new StringBuffer();\n\n randomGenerator.nextBytes(random);\n\n for (int j = 0; j < random.length; j++)\n {\n byte b1 = (byte) ((random[j] & 0xf0) >> 4);\n byte b2 = (byte) (random[j] & 0x0f);\n if (b1 < 10)\n buffer.append((char) ('0' + b1));\n else\n buffer.append((char) ('A' + (b1 - 10)));\n if (b2 < 10)\n buffer.append((char) ('0' + b2));\n else\n buffer.append((char) ('A' + (b2 - 10)));\n }\n\n return (buffer.toString());\n }", "public static String getRandomString(int n) \r\n {\n String AlphaNumericString = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\r\n + \"0123456789\"\r\n + \"abcdefghijklmnopqrstuvxyz\"; \r\n \r\n // create StringBuffer size of AlphaNumericString \r\n StringBuilder sb = new StringBuilder(n); \r\n \r\n for (int i = 0; i < n; i++) { \r\n \r\n // generate a random number between \r\n // 0 to AlphaNumericString variable length \r\n int index \r\n = (int)(AlphaNumericString.length() \r\n * Math.random()); \r\n \r\n // add Character one by one in end of sb \r\n sb.append(AlphaNumericString \r\n .charAt(index)); \r\n } \r\n \r\n return sb.toString(); \r\n }", "public String getRandomCustName() {\n\t\tString generatedCustName = RandomStringUtils.randomAlphanumeric(Integer.valueOf(custNameLimit));\n\t\tlog.info(\"generatedCustName: \" + generatedCustName);\n\t\treturn generatedCustName;\n\t}", "public static String getRandomString(int len){\n\n String pool =\"\";\n for(int i='0';i<='9';i++)\n pool+=(char)i;\n for(int i='A'; i<= 'Z'; i++){\n pool+=(char)i;\n }\n for(int i='a'; i<='z'; i++){\n pool+=(char)i;\n }\n char[] cs = new char[len];\n for(int i=0;i<len;i++){\n cs[i] = pool.charAt( (int)(Math.random()*(pool.length())));\n }\n return new String(cs);\n\n }", "public static String generateRandomString(int length) {\n String CHAR = \"ABCDEF\";\n String NUMBER = \"0123456789\";\n\n String DATA_FOR_RANDOM_STRING = CHAR + NUMBER;\n SecureRandom random = new SecureRandom();\n\n if (length < 1) throw new IllegalArgumentException();\n\n StringBuilder sb = new StringBuilder(length);\n\n for (int i = 0; i < length; i++) {\n // 0-62 (exclusive), random returns 0-61\n int rndCharAt = random.nextInt(DATA_FOR_RANDOM_STRING.length());\n char rndChar = DATA_FOR_RANDOM_STRING.charAt(rndCharAt);\n\n sb.append(rndChar);\n }\n\n return sb.toString();\n }", "public static String createPassword()\r\n\t{\r\n\t\treturn getRandomPwd(4);\r\n\t}", "private void setAccountNumber() // setare numar de cont\n {\n int random = ThreadLocalRandom.current().nextInt(1, 100 + 1);\n accountNumber = ID + \"\" + random + SSN.substring(0,2);\n System.out.println(\"Your account number is: \" + accountNumber);\n }", "private String randomNonEmptyString() {\n while (true) {\n final String s = TestUtil.randomUnicodeString(random()).trim();\n if (s.length() != 0 && s.indexOf('\\u0000') == -1) {\n return s;\n }\n }\n }", "public static final String getRandomId() {\r\n return (\"\" + Math.random()).substring(2);\r\n }", "String generateUniqueName();", "@Override\r\n\tpublic String rollString() {\r\n\t\treturn \"\"+Randomizer.getRandomNumber(possibleValues);\r\n\t}", "public static String buildTestString(int length, Random random) {\n char[] chars = new char[length];\n for (int i = 0; i < length; i++) {\n chars[i] = (char) random.nextInt();\n }\n return new String(chars);\n }", "public static String getRandomName() {\n Faker faker = new Faker();\n return faker.name().fullName();\n }", "public String generateName(long chatID) throws SQLException {\n Set<String> userNames = chatdao.getUserNames(chatID);\n int size = userNames.size();\n Set<String> randomNames = userdao.getNUsernames(size + 1);\n String randomName = \"\";\n\n randomName = generateRandomName(randomNames, userNames, true);\n return randomName;\n }", "private String randomName() {\n\n String name = this.names.get(intRandom(names.size() - 1));\n return name;\n }", "private String creatNewText() {\n\t\tRandom rnd = new Random();\n\t\treturn \"Some NEW teXt U9\" + Integer.toString(rnd.nextInt(999999));\n\t}", "private String createId() {\n int idLength = 5;\n String possibleChars = \"1234567890\";\n Random random = new Random();\n StringBuilder newString = new StringBuilder();\n\n for (int i = 0; i < idLength; i++) {\n int randomInt = random.nextInt(10);\n newString.append(possibleChars.charAt(randomInt));\n }\n\n return newString.toString();\n }", "private char generateRandomCharacter(){\n String alphabets = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n Random rand = new Random();\n int randomNumber = rand.nextInt(26);\n return alphabets.charAt(randomNumber);\n }", "public static String rndString(int length) {\r\n char[] c = RBytes.rndCharArray(length);\r\n return new String(c);\r\n\r\n }", "protected String generateKey(){\n Random bi= new Random();\n String returnable= \"\";\n for(int i =0;i<20;i++)\n returnable += bi.nextInt(10);\n return returnable;\n }" ]
[ "0.80314064", "0.7487398", "0.7396803", "0.73441267", "0.70586985", "0.69668496", "0.6961382", "0.6893028", "0.67969716", "0.67216694", "0.6689561", "0.6643967", "0.6639593", "0.6629917", "0.6629656", "0.6575325", "0.6574177", "0.65738994", "0.6570467", "0.6538382", "0.65219945", "0.65070426", "0.64974767", "0.64934033", "0.6481264", "0.6451508", "0.644724", "0.6445058", "0.6441378", "0.6429866", "0.6426064", "0.64122045", "0.6405869", "0.639986", "0.63841087", "0.63584036", "0.6355869", "0.6355314", "0.6347549", "0.6338228", "0.6317533", "0.6314939", "0.63098425", "0.63093877", "0.63030636", "0.63026965", "0.6290429", "0.62735635", "0.62709296", "0.62638056", "0.6254088", "0.6248305", "0.6245195", "0.6232363", "0.6227081", "0.62250227", "0.62232155", "0.6219773", "0.6219346", "0.62140036", "0.61890477", "0.6179251", "0.6174837", "0.6173847", "0.61714786", "0.61621207", "0.6159413", "0.61401373", "0.61366904", "0.61334896", "0.6126123", "0.6124372", "0.6121631", "0.6121631", "0.6121631", "0.6121631", "0.6121631", "0.6121631", "0.6117808", "0.6114931", "0.610756", "0.6093395", "0.6085002", "0.60774493", "0.607566", "0.6074869", "0.607283", "0.60710925", "0.60680884", "0.6062296", "0.606186", "0.60577", "0.6056793", "0.6053042", "0.60526866", "0.60399765", "0.60357755", "0.6026798", "0.6017408", "0.6017231", "0.6014297" ]
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) { V13q33 ref1=new V13q33(50); V13q33 ref2=new V13q33(125); V13q33 ref3=new V13q33(100); ref1.doPrint(); ref2.doPrint(); ref3.doPrint(); }
{ "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
Read input from a given file
public FileCommandInput(File inputFile) throws FileNotFoundException { Validate.notNull(inputFile, "Input can't be NULL"); this.in = new LineNumberReader(new FileReader(inputFile)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void readFromFile() {\n\t\tPath filePath = Paths.get(inputFile);\n\n\t\ttry (BufferedReader reader = Files.newBufferedReader(filePath,\n\t\t\t\tCharset.forName(\"UTF-8\"));) {\n\t\t\tString line = null;\n\n\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\tString[] splitLine = line.split(\",\");\n\t\t\t\tcurrentGen.setValue(Integer.parseInt(splitLine[0]),\n\t\t\t\t\t\tInteger.parseInt(splitLine[1]), true);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Could not find file provided.\");\n\t\t}\n\t}", "void openInput(String file)\r\n\t{\n\t\ttry{\r\n\t\t\tfstream = new FileInputStream(file);\r\n\t\t\tin = new DataInputStream(fstream);\r\n\t\t\tis = new BufferedReader(new InputStreamReader(in));\r\n\t\t}catch(Exception e)\r\n\t\t{\r\n\t\t\tSystem.err.println(e);\r\n\t\t}\r\n\r\n\t}", "public void fileRead() {\n\t\tString a, b;\n\t\t\n\t\twhile (input.hasNext()) {\n\t\t\ta = input.next();\n\t\t\tb = input.next();\n\t\t\tSystem.out.printf(\"%s %s\\n\", a, b);\n\t\t}\n\t}", "public static void reading(String fileName)\n {\n\n }", "@Override\n public Ini read(File file) throws IOException {\n try ( Reader reader = new FileReader(file)) {\n return read(reader);\n }\n }", "public InputStream readFile( String fileName, FileType type );", "public void processInput(String theFile){processInput(new File(theFile));}", "public void fileRead(String filename) throws IOException;", "public void readFromFile() {\n\n\t}", "public void readFile(File file){\n try{\n scan = new Scanner(file);\n while(scan.hasNextLine()){\n String line = scan.nextLine();\n if(line.startsWith(\"//\")){\n continue;\n }\n process(line);\n }\n }catch(IOException e){\n Alert alert = new Alert(AlertType.INFORMATION);\n alert.setTitle(\"\");\n alert.setHeaderText(null);\n alert.setContentText(\"Oops the input was not read properly\");\n alert.showAndWait();\n e.printStackTrace();\n }catch(NullPointerException e){\n Alert alert = new Alert(AlertType.INFORMATION);\n alert.setTitle(\"\");\n alert.setHeaderText(null);\n alert.setContentText(\"Oops the input was not read properly\");\n alert.showAndWait();\n e.printStackTrace();\n \n }\n }", "public static void main (String[] args) throws IOException\n {\n Scanner fileScan, lineScan;\n String fileName;\n\n Scanner scan = new Scanner(System.in);\n\n System.out.print (\"Enter the name of the input file: \");\n fileName = scan.nextLine();\n fileScan = new Scanner(new File(fileName));\n\n // Read and process each line of the file\n\n\n\n\n }", "public InputReader(File file){\n try {\n inputStream = new Scanner(file);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n instantiate();\n assert(invariant());\n }", "public static BufferedInputStream getInput(File file) throws IOException {\n return getInput(file.toPath());\n }", "public InputFileReader(String fileName) throws IOException{\n\t\t\n\t\tthis.contentsByLine = new ArrayList<>();\n\t\t\n\t\ttry {\n\t\t\tStream<String> stream = Files.lines(Paths.get(fileName));\n\t\t\tcontentsByLine = stream.collect(Collectors.toList());\n\t\t\tstream.close();\n\t\t} catch(IOException e) {\n\t\t\tthrow e;\n\t\t}\n\t}", "public void readIn(String file) {\r\n\r\n\t\ttry {\r\n\r\n\t\t\t/** Initialise loop variable **/\r\n\r\n\t\t\tusedSize = 0;\r\n\r\n\t\t\t/** Set up file for reading **/\r\n\r\n\t\t\tFileReader reader = new FileReader(file);\r\n\r\n\t\t\tScanner in = new Scanner(reader);\r\n\r\n\t\t\t/** Loop round reading in data while array not full **/\r\n\r\n\t\t\twhile (in.hasNextInt() && (usedSize < size)) {\r\n\r\n\t\t\t\tA[usedSize] = in.nextInt();\r\n\r\n\t\t\t\tusedSize++;\r\n\r\n\t\t\t}\r\n\r\n\t\t} catch (IOException e) {\r\n\r\n\t\t\tSystem.out.println(\"Error processing file \" + file);\r\n\r\n\t\t}\r\n\r\n\t}", "private void readFile() {\r\n\t\tScanner sc = null; \r\n\t\ttry {\r\n\t\t\tsc = new Scanner(inputFile);\t\r\n\t\t\twhile(sc.hasNextLine()){\r\n\t\t\t\tgrade.add(sc.nextLine());\r\n\t } \r\n\t\t}\r\n\t\tcatch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tsc.close();\r\n\t\t}\t\t\r\n\t}", "Auditorium(java.util.Scanner input, java.io.File file){\r\n\t\t\r\n\t\tString line = input.next(); // read in next line from file // or nextLine()\r\n\t\tboolean flag = true;\r\n\t\tcolumns = line.length();\r\n\t\twhile(line != \"\" && flag != false) {\r\n\t\t\trows++; // increment number of rows\r\n\t\t\tif (!input.hasNext())\r\n\t\t\t\tflag = false;\r\n\t\t\tparseLine(line, rows, columns); // send line, array, and rows to a parse function\r\n\t\t\tif(input.hasNext())\r\n\t\t\t\tline = input.next(); //read in next line\r\n\t\t}\r\n\t}", "private static Scanner determineInputSource(String[] args) throws FileNotFoundException{\n if (args.length > 0) {\n //Reading from file\n return new Scanner(new File(args[0]));\n }\n else {\n //Reading from standard Input\n return new Scanner(System.in);\n }\n }", "public static void readfile() {\r\n\t\t// read input file\r\n\t\ttry {\r\n\t\t File inputObj = new File(\"input.txt\");\r\n\t\t Scanner inputReader = new Scanner(inputObj);\r\n\t\t int i = 0;\r\n\t\t while (inputReader.hasNextLine()) {\r\n\t\t String str = inputReader.nextLine();\r\n\t\t str = str.trim();\r\n\t\t if(i == 0) {\r\n\t\t \tnumQ = Integer.parseInt(str);\r\n\t\t \torign_queries = new String[numQ];\r\n\t\t \t//queries = new ArrayList<ArrayList<String>>();\r\n\t\t }\r\n\t\t else if(i == numQ + 1) {\r\n\t\t \tnumKB = Integer.parseInt(str);\r\n\t\t \torign_sentences = new String[numKB];\r\n\t\t \t//sentences = new ArrayList<ArrayList<String>>();\r\n\t\t }\r\n\t\t else if(0 < i && i< numQ + 1) {\t\r\n\t\t \torign_queries[i-1] = str;\r\n\t\t \t//queries.add(toCNF(str));\r\n\t\t }\r\n\t\t else {\r\n\t\t \torign_sentences[i-2-numQ] = str;\r\n\t\t \t//sentences.add(toCNF(str));\r\n\t\t }\t\t \r\n\t\t i++;\r\n\t\t }\r\n\t\t inputReader.close();\r\n\t\t } catch (FileNotFoundException e) {\r\n\t\t System.out.println(\"An error occurred when opening the input file.\");\r\n\t\t }\r\n\t}", "public void openFile(){\n\t\ttry{\n\t\t\t//input = new Scanner (new File(\"input.txt\")); // creates file \"input.txt\" or will rewrite existing file\n\t\t\tFile inFile = new File(\"input.txt\");\n\t\t\tinput = new Scanner(inFile);\n\t\t\t//for (int i = 0; i < 25; i ++){\n\t\t\t\t//s = input.nextLine();\n\t\t\t\t//System.out.println(s);\n\t\t\t//}\n\t\t}catch (SecurityException securityException){ // catch errors\n\t\t\tSystem.err.println (\"You do not have the write access to this file.\");\n\t\t\tSystem.exit(1);\n\t\t}catch (FileNotFoundException fnf){// catch errors\n\t\t\tSystem.err.println (\"Trouble opening file\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t}", "@Override\n public Ini read(Path path) throws IOException {\n try (Reader reader = Files.newBufferedReader(path)) {\n return read(reader);\n }\n }", "public void readData(String infile) throws Exception {\r\n \t\tScanner in = new Scanner(new FileReader(infile));\r\n \t}", "void readFile()\n {\n Scanner sc2 = new Scanner(System.in);\n try {\n sc2 = new Scanner(new File(\"src/main/java/ex45/exercise45_input.txt\"));\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n while (sc2.hasNextLine()) {\n Scanner s2 = new Scanner(sc2.nextLine());\n while (s2.hasNext()) {\n //s is the next word\n String s = s2.next();\n this.readFile.add(s);\n }\n }\n }", "static Stream<String> readIn(File file) \r\n\t{\r\n\t\ttry \r\n\t\t{\r\n\t\t\treturn Files.readAllLines(file.toPath()).stream();\r\n\t\t} \r\n\t\tcatch (IOException ioe) \r\n\t\t{\r\n\t\t\tthrow new UncheckedIOException(ioe);\r\n\t\t}\r\n\t}", "public ReadFile (String file) throws java.io.FileNotFoundException\n {\n reader = new java.io.FileReader(file);\t\t//Construct the file reader\n br = new java.io.BufferedReader(reader);\t//Wrap it with a BufferedReader\n assert this.isValid(); \t\t\t//Make sure all is well and we can read the file\n }", "public static void main(String[] args) throws FileNotFoundException {\n\n\t\t// define a file object for the file on our computer we want to read\n\t\t// provide a path to the file when defining a File object\n\t\t//\n\t\t// paths can be: absolute - code all the parts from the root folder of your OS (Windows)\n\t\t//\n\t\t// paths can be: relative - code the part from the assumed current position to the file\n\t\t//\n\t\t// absolute paths should be avoided - they tightly couple the program to the directory structure it was created on\n\t\t//\t\t\t\t\t\t\t\t\t\t\tif the program is run on a machine with a different directory structure it won't work\n\t\t//\t\t\t\t\t\t\t\t\t\t\t\tbecause the absolute path doesn't exist in a different directory structure\n\t\t//\n\t\t// relative paths are preferred because you have loosely coupled the file to the directory structure\n\t\t//\t\t\tit is more likely that the relative paths will be the same from machine to machine\n\t\t//\n\t\t// path: . = current directory\n\t\t//\t\t/ = then (sub-directory or file follows)\n\t\t//\t\tnumbers.txt - file name\n\n\t\tFile theFile = new File(\"./data/numbers.txt\"); // give the File object the path to our file\n\n\t\t// define a scanner for the File object we created for the file on our computer\n\t\tScanner scannerForFile = new Scanner(theFile); // give Scanner the file object we created\n\n\t\tString aLine = \"\"; // hold a line of input from the file\n\n\n\t\tint sum = 0; // hold the sum of the numbers in a line\n\n\t\t// if we want to get all the lines in the file\n\t\t// we need to go through and get each line in the file one at a time\n\t\t// but we can't get a line from the file if there are no more lines in the file\n\t\t// we can use the Scanner class hasNextLine() method to see if there is another line in the file\n\t\t// we can set a loop to get a line from the file and process it as long as there are lines in the file\n\t\t// we will use while loop since we want loop based on a condition (as long as there are line in the file)\n\t\t// \t\t\tand not a count of lines in the file, in which case we would use a for-loop\n\t\t//\t\t\t\tfor-each-loops only work for collection classes\n\n\t\t// add up each line from my file\n\t\t// the file has one or more numbers separated by a single space in each line\n\n\t\twhile (scannerForFile.hasNextLine()) { // loop while there ia a line in the file\n\n\t\t\taLine = scannerForFile.nextLine(); // get a line from the file and store it in aLine\n\n\t\t\t// break apart the numbers in the line based on spaces\n\t\t\t// String .split() will create an array of Strings of the values separated by the delimiter\n\n\t\t\tString[] theNumbers = aLine.split(\" \"); // break apart the numbers in the line based on spaces\n\n\t\t\tSystem.out.println(\"Line from the file: \" + aLine); // display the line from the file\n\n\t\t\t// reset teh sum to 0 to clear it of the value from the last time through the loop\n\t\t\tsum = 0;\n\n\t\t\t// loop through the array of Strings holding the numbers from the line in the file\n\n\t\t\tfor (String aNumber : theNumbers) { // aNumber will hold the current element that is in the array\n\t\t\t\t\tsum = sum + Integer.parseInt(aNumber); // add the number to a sum after converting the String to an int\n\t\t\t}\n\n\t\t\t// now that we have the sum, we can display it\n\n\t\t\tSystem.out.println(\"Sum of the numbers is: \" + sum);\n\t\t\tSystem.out.println(\"Average of the numbers is: \" + sum / theNumbers.length);\n\n\t\t} // end of while loop\n\n\n\t\t\n}", "public void readFile();", "public void read_file(String filename)\n {\n out.println(\"READ\");\n out.println(filename);\n try\n {\n String content = null;\n content = in.readLine();\n System.out.println(\"READ content : \"+content);\n }\n catch (IOException e) \n {\n \tSystem.out.println(\"Read failed\");\n \tSystem.exit(-1);\n }\n }", "public static BufferedReader generateInputReader(String[] args) \n\t\t\tthrows IOException\n\t{\n\t\tif(args.length == 0)\n\t\t{\n\t\t\tInputStream stream = Main.class.getResourceAsStream(\"input.txt\");\n\t\t\treturn new BufferedReader(new InputStreamReader(stream));\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn new BufferedReader(new FileReader(args[0]));\n\t\t}\n\t}", "public static BufferedReader generateInputReader(String[] args) \n\t\t\tthrows IOException\n\t{\n\t\tif(args.length == 0)\n\t\t{\n\t\t\tInputStream stream = Main.class.getResourceAsStream(\"input.txt\");\n\t\t\treturn new BufferedReader(new InputStreamReader(stream));\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn new BufferedReader(new FileReader(args[0]));\n\t\t}\n\t}", "public static void readFile(String fileName)throws FileNotFoundException{ \r\n\t\t\r\n\t\tScanner sc = new Scanner(fileName);\r\n\t\t \r\n\t\twhile (sc.hasNextLine()) {\r\n\t\t\tString q1 = sc.next();\r\n\t\t\tString q1info = sc.next();\r\n\t\t}\r\n\t}", "public Input readFromFile (String fileName) {\n\t\tFileReader fr = null;\n\t\tBufferedReader br = null;\n\t\tString sCurrentLine = \"test\";\n\t\tint numberOfProducts = 0;\n\t\tint numberOfSurveys = 0;\n\t\tList <String> products = new ArrayList<> ();\n\t\tList <String> surveyPrices = new ArrayList<> ();\n\t\tInput input = new Input ();\n\t\t\n\t\ttry {\n\t\t\tfr = new FileReader(fileName);\n\t\t\tbr = new BufferedReader(fr);\n\t\t\tint line = 1;\n\t\t\tboolean isAllProductsAdded = false;\n\t\t\twhile ((sCurrentLine = br.readLine()) != null) {\n\t\t\t\t\n\t\t\t\tif (line == 1 ) {\n\t\t\t\t\tnumberOfProducts = new Integer(sCurrentLine).intValue();\n\t\t\t\t}else {\n\t\t\t\t\tif (products.size() == numberOfProducts) {\n\t\t\t\t\t\tif (numberOfSurveys == 0) {\n\t\t\t\t\t\t\tnumberOfSurveys = new Integer(sCurrentLine).intValue();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsurveyPrices.add(sCurrentLine);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (products.size() < numberOfProducts )\n\t\t\t\t\t\t\tproducts.add(sCurrentLine);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tline++;\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\tinput.setNumberOfProducts(numberOfProducts);\n\t\tinput.setNumberofSurveyedPrices(numberOfSurveys);\n\t\tinput.setProducts(products);\n\t\tinput.setSurveys(surveyPrices);\n\t\treturn input;\n\t}", "public abstract void runInput(String stringFile) throws IOException;", "public static BufferedInputStream getInput(String fileName) throws IOException {\n return getInput(getPath(fileName));\n }", "public static Scanner openInput(String fname){\n\t Scanner infile = null;\n\t try {\n\t infile = new Scanner(new File(fname));\n\t } catch(FileNotFoundException e) {\n\t System.out.printf(\"Cannot open file '%s' for input\\n\", fname);\n\t System.exit(0);\n\t }\n\t return infile;\n\t }", "public void parseInputFile(String filename) throws BadInputFormatException {\r\n\t\tString line;\r\n\r\n\t\ttry {\r\n\t\t\tInputStream fis = new FileInputStream(filename);\r\n\t\t\tInputStreamReader isr = new InputStreamReader(fis);\r\n\t\t\tBufferedReader br = new BufferedReader(isr);\r\n\r\n\t\t\twhile ((line = br.readLine()) != null) {\r\n\t\t\t\tparseMessage(line);\r\n\t\t\t}\r\n\t\t\tbr.close();\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "private void readInter() throws FileNotFoundException {\n\t\t\r\n\t\tFile file = new File(\"input.txt\");\r\n\r\n\t\tScanner input = new Scanner(file);\r\n\r\n\t\twhile (input.hasNext()) {\r\n\r\n\t\t\tint x = input.nextInt();\r\n\t\t\tint y = input.nextInt();\r\n\t\t\t\r\n\t\t\tintervals.add(new Point(x, y));\r\n\t\t}\r\n\t\t\r\n\t\t//Close 'input.txt'\r\n\t\tinput.close();\r\n\t\t\r\n\t}", "public void readFromTxtFile(String filename){\n try{\n File graphFile = new File(filename); \n Scanner myReader = new Scanner(graphFile); \n parseFile(myReader);\n myReader.close();\n } \n catch(FileNotFoundException e){\n System.out.println(\"ERROR: DGraphEdges, readFromTxtFile: file not found.\");\n e.printStackTrace();\n } \n }", "protected abstract Object readFile(BufferedReader buf) throws IOException, FileParseException;", "private void readFromFile(){\n\t\t\n\t\ttry {\n\t\t\tFile file=new File(\"controller.txt\");\n\t\t\tFileInputStream fin;\n\t\t\tfin = new FileInputStream(file);\n\t\t\tDataInputStream din=new DataInputStream(fin);\n\t\t\tBufferedReader br=new BufferedReader(new InputStreamReader(din));\n\t\t\t\n\t\t\tfor(int i=0; i<2; i++){\n\t\t\t\tif(i==0)\n\t\t\t\t\tcodedUserName=br.readLine();\n\t\t\t\telse \n\t\t\t\t\tcodedPassword=br.readLine();\n\t\t\t}\n\t\t\t\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "public static void main(String[] args) throws FileNotFoundException {\n Scanner scanner = new Scanner(new FileInputStream(\"/Users/guoziren/IdeaProjects/剑指offer for Java/src/main/java/com/ustc/leetcode/algorithmidea/dynamicprogramming/input.txt\"));\n }", "public void readFile(String name) {\n\t\tString filename = this.path + name;\n\t\tFile file = new File(filename);\n\t\t\n\t\t\n\t\ttry {\t\t \n\t\t\tScanner reader = new Scanner(file);\n\t\t\t\n\t\t\twhile (reader.hasNextLine()) {\n\t\t\t\tString data = reader.nextLine();\n\t\t System.out.println(data);\n\t\t\t}\n\t\t reader.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t System.out.println(\"File not found!\");\n\t\t} \n\t}", "public static void readMyFile() throws IOException {\n\n List<String> allLines = Files.readAllLines(Paths.get(\"src/ErfansInputFile\"));\n System.out.println(\"allLines = \" + allLines);\n System.out.println(\"Reading the file in my computer. \");\n\n throw new FileNotFoundException(\"Kaboom, file is not found!!!\");\n }", "private void ReadTextFile(String FilePath) {\n\t\t\n\t\t\n\t}", "public List<Task> readFile() throws FileNotFoundException, DukeException {\n List<Task> output = new ArrayList<>();\n Scanner sc = new Scanner(file);\n while (sc.hasNext()) {\n output.add(readTask(sc.nextLine()));\n }\n return output;\n }", "private static void initializeInput(String filename) {\n\t\t// Reading from specified file.\n\t\ttry\n\t\t{\n\t\t\tfileInput = new Scanner(new FileInputStream(filename));\n\t\t}\n\t\tcatch(FileNotFoundException e) \n\t\t{ \n\t\t\tSystem.err.println(\"\\nFile not found. Please re-enter.\");\n\t\t\tinitializeInput(getFilename());\n\t\t}\n\t}", "public MyInputStream(String fileName)\n {\n try\n {\n in = new BufferedReader\n (new FileReader(fileName));\n }\n catch (FileNotFoundException e)\n {throw new MyInputException(e.getMessage());}\n }", "public static String read(String filename) throws IOException {\n // Reading input by lines:\n BufferedReader in = new BufferedReader(new FileReader(filename));\n// BufferedInputStream in2 = new BufferedInputStream(new FileInputStream(filename));\n String s;\n int s2;\n StringBuilder sb = new StringBuilder();\n while((s = in.readLine())!= null)\n sb.append( s + \"\\n\");\n// sb.append((char) s2);\n in.close();\n return sb.toString();\n }", "public TabbedLineReader openInput(File inFile) throws IOException {\n TabbedLineReader retVal;\n if (inFile == null) {\n log.info(\"Input will be taken from the standard input.\");\n retVal = new TabbedLineReader(System.in);\n } else if (! inFile.canRead())\n throw new FileNotFoundException(\"Input file \" + inFile + \" is not found or is unreadable.\");\n else {\n log.info(\"Input will be read from {}.\", inFile);\n retVal = new TabbedLineReader(inFile);\n }\n return retVal;\n }", "protected abstract void readFile();", "public List<RankList> readInput(String inputFile) {\n/* 661 */ return FeatureManager.readInput(inputFile, mustHaveRelDoc, useSparseRepresentation);\n/* */ }", "public abstract void readFromFile( ) throws Exception;", "public static void processInput() throws IOException {\r\n\t\t\r\n\t\t//Out statement let user know the input file is being read\t\r\n\t\tScanner scnr;\r\n\t\tString[] splitString;\r\n\t\t\r\n\t\tFile file = new File(\"Project_04_Input01.txt\");\r\n\t\tscnr = new Scanner(file);\r\n\t\t\r\n\t\tSystem.out.println(\"Reading data from \" + file + \"...\");\r\n\t\t\r\n\t\twhile(scnr.hasNextLine()) {\r\n\t\t\tString line = scnr.nextLine();\r\n\t\t\tsplitString = line.split(\",\");\r\n\r\n\t\t\tif (splitString[0].contains(\"STUDENT\")) {\r\n\t\t\t\t\r\n\t\t\t\t// Call processStudentData\r\n\t\t\t\tprocessStudentData(splitString);\r\n\t\t\t\tSystem.out.println(\"'STUDENT' has been found in the file.\");\r\n\r\n\t\t\t} // End if\r\n\t\t\t\r\n\t\t\telse if (splitString[0].contains(\"GRADEITEM\") ) {\r\n\t\t\t\t\r\n\t\t\t\t// Call processGradeItemData\r\n\t\t\t\tprocessGradeItemData(splitString);\r\n\t\t\t\tSystem.out.println(\"'GRADEITEM' has been found in the file.\");\r\n\t\t\t\t\r\n\t\t\t} // End if\r\n\t\t} // End while\r\n\t\t\r\n\t\t// Close the file\r\n\t\tscnr.close();\r\n\t\t\t\r\n\t}", "private int inputFile(Integer parameterIndex) throws ExceptionMalformedInput\n {\n this.inputFile = parseParameter(args, parameterIndex+1);\n//TODO check that the file exists and is readable\n return parameterIndex + 1;\n }", "MafSource readSource(File sourceFile);", "public void readIn(String fileName) throws FileNotFoundException {\n\t\tScanner scanner = new Scanner(new FileInputStream(fileName));\n\t\ttry {\n\t\t\tscanner.nextLine(); // Skip line 1 (header)\n\t\t\tscanner.nextLine(); // Skip line 2 (header)\n\t\t\twhile (scanner.hasNextLine()){\n\t\t\t\tprocess(scanner.nextLine());\n\t\t\t}\n\t\t\tCollections.sort(allCoords); //Sort allCoords by z-value\n\t\t}\n\t\tfinally{\n\t\t\tscanner.close();\n\t\t}\n\t}", "public Object readFile(File file) throws IOException, FileParseException {\n\t\tBufferedReader buffer = new BufferedReader( new FileReader(file));\n\t\treturn readFile(buffer);\n\t}", "String input() {\n\n try {\n\n FileReader reader = new FileReader(\"the text.txt\");\n BufferedReader bufferedReader = new BufferedReader(reader);\n StringBuilder builder = new StringBuilder();\n String line;\n\n while ((line = bufferedReader.readLine()) != null)\n builder.append(line);\n\n return builder.toString();\n\n } catch (IOException e) {\n\n System.out.println(\"Input Failure\");\n return null;\n }\n }", "String[] readFile(File file) {\n ArrayList<String> list = new ArrayList<>();\n String[] output = null;\n Scanner reader = null;\n try {\n if (file.isFile()) {\n reader = new Scanner(file);\n while (reader.hasNextLine()) {\n list.add(reader.nextLine());\n }\n }\n } catch (FileNotFoundException e) {\n System.out.println(\"File not found exception\");\n }\n output = new String[list.size()];\n for (int i = 0; i < list.size(); i++) output[i] = list.get(i);\n reader.close();\n return output;\n }", "private void readFromFile(String filename) {\n\t\ttry {\n\t\t Scanner read = new Scanner(new File(filename));\n\t\t String line;\n\t\t int counter = 0;\n\t\t String temp;\n\t\t line = read.nextLine();\n\t\t temp = line.substring(0);\n\t\t height = convertToInt(temp);\n\n\t\t line = read.nextLine();\n\t\t temp = line.substring(0);\n\n\t\t length = convertToInt(temp);\n\t\t size = height*length;\n\t\t \n\t\t squares = new Square[size][size];\n\n\t\t while(read.hasNextLine()) {\n\t\t\t\tline = read.nextLine();\n\t\t \tfor (int i = 0; i < line.length(); i++) {\n\t\t \t temp = line.substring(i, i+1);\n\n\t\t \t if (temp.equals(\".\")) {\n\t\t \t\t\tsquares[counter][i] = new FindValue(0);\n\t\t \t } \n\t\t \t else {\n\t\t\t\t\t\tsquares[counter][i] = new PreFilled(convertToInt(temp));\n\t\t\t \t\t}\n\t\t \t}\n\t\t \tcounter++;\n\t\t }\n\t\t} catch(IOException e) {\n\t\t e.printStackTrace();\n\t\t}\n }", "private void openAndReadFile() throws IOException {\n\t\tFileReader fr = new FileReader(path);\n\t\tBufferedReader textreader = new BufferedReader(fr);\n\t\tString line;\n\t\tString[] parsedLine;\n\t\twhile ((line = textreader.readLine()) != null) {\n\t\t\tparsedLine = pattern.split(line);\n\t\t\tif (parsedLine.length == 2) {\n\t\t\t\tfileData.put(parsedLine[0], parsedLine[1]);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"Couldn't read line \" + line + \" in \" + path);\n\t\t\t}\n\t\t}\n\t\ttextreader.close();\n\t\tfr.close();\n\t}", "public static void main(String[] args) throws IOException {\n\t\t FileInputStream file=new FileInputStream(\"C:\\\\Users\\\\DELL\\\\Desktop\\\\test.txt\");\r\n Scanner scan=new Scanner(file);\r\n while(scan.hasNextLine()){\r\n \t System.out.println(scan.nextLine());\r\n }\r\n \r\n file.close();\r\n\t}", "private void ReadInputFile(String filePath){\n String line;\n\n try{\n BufferedReader br = new BufferedReader(new FileReader(filePath));\n while((line = br.readLine()) != null){\n //add a return at each index\n inputFile.add(line + \"\\r\");\n }\n\n\n }catch(IOException ex){\n System.out.print(ex);\n }\n\n }", "private void load(FileInputStream input) {\n\t\t\r\n\t}", "public static void main(String[] args) throws FileNotFoundException {\n\t\t\t\n\t\tScanner scan = new Scanner(new File(\"input.txt\"));\n\t\t\n\t\tParser parse;\n\t\tCode code = new Code();\n\t\tSymbolTable st = new SymbolTable();\n\t\t\n\t\twhile(scan.hasNextLine()) {\n\t\t\tString inCode = scan.nextLine();\t\n\t\t\tparse = new Parser(inCode);\n\t\t}\n\t\t\n\t}", "List readFile(String pathToFile);", "public static void readFile( String file ) throws Exception\r\n\t{\r\n\t\tString format;\r\n\t\tint width, height, maxPixel;\r\n\t\t\r\n\t\tScanner get = new Scanner( new FileReader( file ) );\r\n\t\t\r\n\t\tformat = get.next();\r\n\t\twidth = get.nextInt();\r\n\t\theight = get.nextInt();\r\n\t\tmaxPixel = get.nextInt();\r\n\t\t\r\n\t\tif ( ( width != WIDTH ) || ( height != HEIGHT ) || ( maxPixel != MAX_PIXEL ) )\r\n\t\t{\r\n\t\t\tSystem.out.println( \"Error in file format. Exiting...\" );\r\n\t\t\tSystem.exit( 1 );\r\n\t\t}\r\n\t\t\t\r\n\t\tif ( format.equals(\"P2\") )\r\n\t\t{\r\n\t\t\tfor ( int i = 0; i < WIDTH; i++ )\r\n\t\t\t{\r\n\t\t\t\tfor ( int j = 0; j < HEIGHT; j++ )\r\n\t\t\t\t{\r\n\t\t\t\t\torig_pixels[i][j] = get.nextByte( );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif ( format.equals( \"P5\" ) )\r\n\t\t{\r\n\t\t\tget.close();\r\n\t\t\t\r\n\t\t\tDataInputStream input = new DataInputStream( new FileInputStream( file ) );\r\n\r\n\t\t\tfor ( int i = 0; i < 15; i++ )\r\n\t\t\t\tinput.readUnsignedByte();\r\n\t\t\t\r\n\t\t\tfor ( int i = 0; i < WIDTH; i++ )\r\n\t\t\t{\r\n\t\t\t\tfor ( int j = 0; j < HEIGHT; j++ )\r\n\t\t\t\t{\r\n\t\t\t\t\torig_pixels[i][j] = input.readUnsignedByte();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tinput.close();\r\n\t\t}\r\n\t\t\r\n\t}", "public static void main(String[] args) throws FileNotFoundException {\n\t\t\r\n\t\tFile filename = new File(\"D://normal.txt\");\r\n\t\tFileInputStream fstream = new FileInputStream(filename);\r\n\t\tFileReader fr = new FileReader(filename);\r\n\t\t\r\n\t}", "public abstract T readDataFile(String fileLine);", "public interface ReaderFromFile {\n\t\n\tpublic List<Data> readDataFromFile (String filename);\n}", "public void readVotes(File inFile);", "public void readFromFile(String fileName)\r\n\t{\r\n\r\n\t\tScanner fileScanner = null;\r\n\t\ttry\r\n\t\t{\r\n\t\t\tfileScanner = new Scanner(new File(fileName));\r\n\t\t}\r\n\t\tcatch(FileNotFoundException e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\twhile(fileScanner.hasNext())\r\n\t\t{\r\n\t\t\tString fileLine = fileScanner.nextLine();\r\n\t\t\tString[] splitLines = fileLine.split(\" \",2);\r\n\t\t\t//checks each word and makes sure it is ok\r\n\t\t\tif(splitLines[0].equalsIgnoreCase(\"Name\"))\r\n\t\t\t{\r\n\t\t\t\tname = splitLines[1];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(splitLines[0].equalsIgnoreCase(\"Speed\"))\r\n\t\t\t{\r\n\t\t\t\tspeed = Double.parseDouble(splitLines[1]);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(splitLines[0].equalsIgnoreCase(\"Strength\"))\r\n\t\t\t{\r\n\t\t\t\tstrength = Integer.parseInt(splitLines[1]);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(splitLines[0].equalsIgnoreCase(\"HP\"))\r\n\t\t\t{\r\n\t\t\t\thp = Integer.parseInt(splitLines[1]);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(splitLines[0].equalsIgnoreCase(\"Weapon\"))\r\n\t\t\t{\r\n\t\t\t\t\tweapon = splitLines[1];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tfileScanner.close();\r\n\t\r\n\t}", "public void inputForAnalysis() throws IOException\n {\n ArrayList<String> words = new ArrayList<String>(0);\n \n File fileName = new File(\"ciphertext.txt\");\n Scanner inFile = new Scanner(fileName);\n \n int index = 0;\n while(inFile.hasNext())\n {\n words.add(inFile.next());\n index++;\n }\n inFile.close();\n analyze(words);\n }", "public static void readInFile(Scanner inFile) {\n\t\twhile(inFile.hasNext()) {\n\t\t\tString strIn = inFile.nextLine();\n\t\t\tSystem.out.println(strIn);\n\t\t}\n\t\tinFile.close();\n\t}", "public void readInFile(String filename) {\r\n String lineOfData = new String (\"\");\r\n boolean done = false;\r\n //set up the BufferedReader\r\n BufferedReader fin = null;\r\n\ttry {\r\n fin = new BufferedReader(new InputStreamReader(new FileInputStream(filename)));\r\n lineOfData = fin.readLine();\r\n\t}\r\n catch(Exception c) {\r\n System.out.println(\"ERROR: Input read failed!\");\r\n }\r\n\r\n //read in additional strings until the file is empty\r\n while (done != true){\r\n String temp[] = lineOfData.split(\" \");\r\n graph.add(new Edge(temp[0], temp[1], Integer.parseInt(temp[2]))); //add current string to graph\r\n try {\r\n lineOfData = fin.readLine();\r\n if (lineOfData == null){\r\n done = true;\r\n }\r\n }\r\n catch(IOException ioe){\r\n System.out.println(\"ERROR: Input read failed!\");\r\n }\r\n }\r\n }", "public void readFile(String file)\n\t{\t\n\t\tfindPieces(file);\n\t}", "public static DataInputStream getDataInput(File file) throws IOException {\n return getDataInput(file.toPath());\n }", "public String parse(File file);", "public static BufferedInputStream getInput(Path path) throws IOException {\n return get(Files.newInputStream(path));\n }", "private static String readInput() {\n String kbString = \"\";\n File kbFile = new File(\"kb.txt\");\n if(kbFile.canRead()){\n try {\n FileInputStream fileInputStream = new FileInputStream(kbFile);\n\n int c;\n while((c = fileInputStream.read()) != -1){\n kbString += (char) c;\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return kbString;\n }", "public void readDataFromFile() {\n System.out.println(\"Enter address book name: \");\n String addressBookFile = sc.nextLine();\n Path filePath = Paths.get(\"C:\\\\Users\\\\Muthyala Aishwarya\\\\git\" + addressBookFile + \".txt\");\n try {\n Files.lines(filePath).map(line -> line.trim()).forEach(line -> System.out.println(line));\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "void fileReader(String filename) \r\n\t\t{\r\n\r\n\t\ttry (Scanner s = new Scanner(new FileReader(filename))) { \r\n\t\t while (s.hasNext()) { \r\n\t\t \tString name = s.nextLine(); // read name untill space\r\n\t\t \tString str[] = name.split(\",\");\r\n\t\t \tString nam = str[0]; \r\n\t\t \tint number = Integer.parseInt(str[1]); // read number untill space\r\n\t\t this.addContact(nam, number);\r\n\t\t\r\n\t\t }\t\t \r\n\t\t \r\n\t\t} \r\n\t\tcatch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t}", "protected abstract InputStream getInStreamImpl(String filename) throws IOException;", "public InputData getData() throws IOException {\n\n ObjectMapper mapper = new ObjectMapper();\n return mapper.readValue(Paths.get(inFile).toFile(), InputData.class);\n }", "public void readFile(File inputFile) throws IOException {\n\t\tCSVParser csvParser = CSVParser.parse(inputFile, charset, csvFormat);\n\t\trecordList = csvParser.getRecords();\n\t}", "public String readFromFile(String filePath){\n String fileData = \"\";\n try{\n File myFile = new File(filePath);\n Scanner myReader = new Scanner(myFile);\n while (myReader.hasNextLine()){\n String data = myReader.nextLine();\n fileData += data+\"\\n\";\n }\n myReader.close();\n } catch(FileNotFoundException e) {\n System.out.println(\"An error occurred.\");\n e.printStackTrace();\n }\n return fileData;\n }", "public FilesInputStreamLoad readFile() throws ArcException {\r\n\tFile dir = new File(this.archiveChargement + \".dir\");\r\n\tString fileName = ManipString.substringAfterFirst(this.idSource, \"_\");\r\n\tFile toRead = new File(dir + File.separator + ManipString.redoEntryName(fileName));\r\n\tFilesInputStreamLoad filesInputStreamLoadReturned = null;\r\n\ttry {\r\n\t\tfilesInputStreamLoadReturned = new FilesInputStreamLoad (toRead);\r\n\t} catch (IOException ioReadException) {\r\n\t\tthrow new ArcException(ioReadException, ArcExceptionMessage.FILE_READ_FAILED, toRead);\r\n\t}\r\n\treturn filesInputStreamLoadReturned;\r\n }", "public static void readFile() {\n\t\tbufferedReader = null;\n\t\ttry {\n\t\t\tFileReader fileReader = new FileReader(\"/home/bridgeit/Desktop/number.txt\");\n\t\t\tbufferedReader = new BufferedReader(fileReader);\n\n\t\t\tString line;\n\t\t\twhile ((line = bufferedReader.readLine()) != null) {\n\t\t\t\tString[] strings = line.split(\" \");\n\t\t\t\tfor (String integers : strings) {\n\t\t\t\t\thl.add(Integer.parseInt(integers));\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"File Not Found...\");\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\ttry {\n\t\t\tbufferedReader.close();\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}", "@Override\n public InputStream openInputFile(String pathname) throws IOException {\n return new FileInputStream(pathname);\n }", "private static List<String[]> readInput(String filePath) {\n List<String[]> result = new ArrayList<>();\n int numOfObject = 0;\n\n try {\n Scanner sc = new Scanner(new File(filePath));\n sc.useDelimiter(\"\");\n if (sc.hasNext()) {\n numOfObject = Integer.parseInt(sc.nextLine());\n }\n for (int i=0;i<numOfObject;i++) {\n if (sc.hasNext()) {\n String s = sc.nextLine();\n if (s.trim().isEmpty()) {\n continue;\n }\n result.add(s.split(\" \"));\n }\n }\n sc.close();\n }\n catch (FileNotFoundException e) {\n System.out.println(\"FileNotFoundException\");\n }\n return result;\n }", "@Override\r\n\tpublic DocumentData read(File in) throws Exception {\r\n\t\tDocumentData doc = new DocumentData(in);\r\n\t\tBufferedReader reader = FileHandler.getBufferedReader(in);\r\n\t\tBufferedReader nested = null;\r\n\t\tString inpath = in.getAbsolutePath();\r\n\t\tFile nestin = new File (inpath.substring(0,inpath.length()-5)+SUBSUFFIX);\r\n\t\tif(nestin.exists())\r\n\t\t\tnested = FileHandler.getBufferedReader(nestin);\r\n\t\tint lcnt=0;\r\n\t\tint scnt=0;\r\n\t\tint start=-1;\r\n\t\tint nstart = -1;\r\n\t\tSentenceData sent = null;\r\n\t\twhile(true){\r\n\t\t\tString line = reader.readLine();\r\n\t\t\tString nline = null;\r\n\t\t\tif(nested!=null)\r\n\t\t\t\tnline = nested.readLine();\r\n\t\t\tif(line==null) {\r\n\t\t\t\tif(sent!=null){\r\n\t\t\t\t\tdoc.addSentenceData(sent);\r\n\t\t\t\t\tsent=null;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tline = line.trim();\r\n\t\t\tlcnt++;\r\n\t\t\tif(line.length()==0){\r\n\t\t\t\tif(sent!=null){\r\n\t\t\t\t\tdoc.addSentenceData(sent);\r\n\t\t\t\t\tsent=null;\r\n\t\t\t\t\tscnt=0;\r\n\t\t\t\t}else\r\n\t\t\t\t\tSystem.out.println(\"Skip empty line in line:\"+lcnt);\r\n\t\t\t}else if(line.startsWith(\"#\")){\r\n\t\t\t\tSystem.out.println(\"Skip comments in line:\"+lcnt+\"; \"+line);\r\n\t\t\t}else{\r\n\t\t\t\tif(sent==null)\r\n\t\t\t\t\tsent = new SentenceData();\r\n\t\t\t\tscnt++;\r\n\t\t\t\t\r\n\t\t\t\tString tmp[] = line.split(\"\\t\");\r\n\t\t\t\tsent.addTokens(tmp[0]);\r\n\t\t\t\tString mark = tmp[tmp.length-1];// last column is the markables;\r\n\t\t\t\tif(mark.equals(\"O\")){\r\n\t\t\t\t\tif(start>=0)\r\n\t\t\t\t\t\tsent.addMarkables(start, scnt-1);\r\n\t\t\t\t\tstart=-1;\r\n\t\t\t\t}else if(mark.startsWith(\"I-\")||mark.startsWith(\"B-\")){\r\n\t\t\t\t\tif(start<0)\r\n\t\t\t\t\t\tstart = scnt;//support both IOB1 and IOB2\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthrow new Exception(\"Please input only IOB or IOB2 scheme (main): \"+lcnt+\": \"+line);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(nline!=null){\r\n\t\t\t\t\tString ntmp[] = nline.split(\"\\t\");\r\n\t\t\t\t\tString nmark = ntmp[ntmp.length-1];\r\n\t\t\t\t\tif(nmark.equals(\"O\")){\r\n\t\t\t\t\t\tif(nstart>=0)\r\n\t\t\t\t\t\t\tsent.addMarkables(start, scnt-1);\r\n\t\t\t\t\t\tnstart=-1;\r\n\t\t\t\t\t}else if(nmark.startsWith(\"I-\")||nmark.startsWith(\"B-\")){\r\n\t\t\t\t\t\tif(nstart<0)\r\n\t\t\t\t\t\t\tnstart = scnt;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthrow new Exception(\"Please input only IOB or IOB2 scheme (nested): \"+lcnt+\": \"+nline);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn doc;\r\n\t}", "@Override\n public List<Object> readFile(File file) {\n Scanner scanner = createScanner(file);\n if (Objects.isNull(scanner)) {\n return Collections.emptyList();\n }\n List<Object> readingDTOList = new ArrayList<>();\n scanner.nextLine();\n List<List<String>> allLines = new ArrayList<>();\n while (scanner.hasNext()) {\n List<String> line = parseLine((scanner.nextLine()));\n if (!line.isEmpty()) {\n allLines.add(line);\n }\n }\n if (!allLines.isEmpty()) {\n for (List<String> line : allLines) {\n String sensorId = line.get(0);\n String dateTime = line.get(1);\n String value = line.get(2);\n String unit = line.get(3);\n LocalDateTime readingDateTime;\n if (sensorId.contains(\"RF\")) {\n LocalDate readingDate = LocalDate.parse(dateTime, DateTimeFormatter.ofPattern(\"dd/MM/uuuu\"));\n readingDateTime = readingDate.atStartOfDay();\n } else {\n ZonedDateTime zonedDateTime = ZonedDateTime.parse(dateTime);\n readingDateTime = zonedDateTime.toLocalDateTime();\n }\n double readingValue = Double.parseDouble(value);\n ReadingDTO readingDTO = ReadingMapper.mapToDTOwithIDandUnits(sensorId, readingDateTime, readingValue, unit);\n readingDTOList.add(readingDTO);\n }\n }\n return readingDTOList;\n }", "public void readFile()\r\n\t{\r\n\t\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\tx = new Scanner(new File(\"clean vipr measles results.txt\"));\r\n\t\t\t\r\n\t\t\twhile (x.hasNext())\r\n\t\t\t{\r\n\t\t\t\tString a = x.next();\r\n\t\t\t\tString b = x.next();\r\n\t\t\t\tString c = x.next();\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.printf(\"%s %s %s \\n\\n\", a,b,c);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tx.close();\r\n\t\t}\r\n\t\tcatch (Exception e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"file not found\");\r\n\t\t}\r\n\t\r\n\t}", "public void readFile(String filename) throws IOException {\n BufferedReader buffer = new BufferedReader(new FileReader(filename));\n\n String line;\n int row = 0;\n isFirstLine = true;\n\n while ((line = buffer.readLine()) != null) {\n String[] vals = line.trim().split(\"\\\\s+\");\n int length = vals.length;\n \n if(isFirstLine) {\n \tfor(int col = 0; col < 2; col++) {\n \t\tif(col == 0)\n \t\t\trowSize = Integer.parseInt(vals[col]);\n \t\telse\n \t\t\tcolSize = Integer.parseInt(vals[col]);\n \t}\n \tskiMap = new int[rowSize][colSize];\n \tisFirstLine = false;\n }\n else {\n \tfor (int col = 0; col < length; col++) {\n \tskiMap[row][col] = Integer.parseInt(vals[col]);\n }\n \t row++;\n }\n }\n \n if(buffer != null)\n \tbuffer.close();\n }", "public abstract void readFromFile(String key, String value);", "public void read() {\n String line = \"\";\n int counter = 0;\n try {\n input = new BufferedReader(new FileReader(file));\n while (line != null) {\n if (!(line.equals(\"arglebargle\"))) {//not a default\n names.add(line);\n }\n }\n input.close();\n }\n catch (IOException e) {\n }\n }", "public String readFromFile() throws IOException {\n return br.readLine();\n }", "static void experiment1Day1Part1() {\n\n File file = new File(\"src/main/java/weekone/input01.txt\");\n FileReader fileReader = null;\n BufferedReader bufferedReader = null;\n int sum = 0;\n\n try {\n fileReader = new FileReader(file);\n bufferedReader = new BufferedReader(fileReader);\n\n while ((bufferedReader.read() != -1)) {\n String line = bufferedReader.readLine();\n System.out.println(\"\\nThe string is: \" + line);\n int number = Integer.valueOf(line);\n\n System.out.println(\"The number is: \" + number);\n\n }\n\n\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n if (fileReader != null)\n fileReader.close();\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n }\n System.out.println(\"The sum is: \" + sum);\n }", "public String readFile(String filename)\n {\n StringBuilder texts = new StringBuilder();\n \n try \n {\n FileReader inputFile = new FileReader(filename);\n Scanner parser = new Scanner(inputFile);\n \n while (parser.hasNextLine())\n {\n String line = parser.nextLine();\n texts.append(line + \";\");\n }\n \n inputFile.close();\n parser.close();\n return texts.toString();\n \n }\n \n catch(FileNotFoundException exception) \n {\n String error = filename + \" not found\";\n System.out.println(error);\n return error;\n }\n \n catch(IOException exception) \n {\n String error = \"Unexpected I/O error occured\";\n System.out.println(error); \n return error;\n } \n }", "void readFromFile(String file)\n {\n try\n {\n employees.clear();\n FileReader inputFile = new FileReader(fileName);\n BufferedReader input = new BufferedReader(inputFile);\n String line = input.readLine();\n \n while(line != null)\n {\n Employee worker = new Employee();\n StringTokenizer stringParser = new StringTokenizer(line, \",\");\n while(stringParser.hasMoreElements())\n {\n worker.setName(stringParser.nextElement().toString());\n worker.setHours(Integer.parseInt(stringParser.nextElement().toString()));\n worker.setRate(Float.parseFloat(stringParser.nextElement().toString()));\n }\n employees.add(worker);\n line = input.readLine();\n }\n inputFile.close();\n }\n catch(FileNotFoundException e)\n {\n e.getStackTrace();\n }\n catch(IOException e)\n {\n e.getStackTrace();\n }\n }" ]
[ "0.7058502", "0.6894788", "0.6810729", "0.6697581", "0.66368264", "0.66358864", "0.6497842", "0.64966017", "0.6493736", "0.64688224", "0.6457323", "0.64241785", "0.64120835", "0.6361571", "0.6330989", "0.63074523", "0.6298625", "0.629514", "0.6268836", "0.6258322", "0.62576294", "0.6257256", "0.62564826", "0.62169635", "0.6200861", "0.61790454", "0.6177626", "0.61569715", "0.6144112", "0.6144112", "0.61420316", "0.6130187", "0.61254084", "0.611941", "0.6116137", "0.6100084", "0.6098354", "0.6094775", "0.607442", "0.6066988", "0.60294247", "0.6010765", "0.6008799", "0.59522253", "0.59495515", "0.59451294", "0.5941565", "0.5925118", "0.5919216", "0.5913955", "0.5904141", "0.5894969", "0.5888043", "0.58879256", "0.58813787", "0.5880095", "0.58791834", "0.58736145", "0.5866002", "0.58658564", "0.5852464", "0.5847689", "0.58428293", "0.58354306", "0.57977045", "0.57936054", "0.5792091", "0.57832426", "0.5763309", "0.575757", "0.5751216", "0.5748624", "0.57379884", "0.57335913", "0.5730918", "0.57264924", "0.57218176", "0.57206327", "0.5717051", "0.5715914", "0.5712071", "0.5710635", "0.5704583", "0.56963605", "0.56963605", "0.56878924", "0.56834143", "0.5682687", "0.5681902", "0.56776", "0.5677317", "0.5674309", "0.5672048", "0.5671982", "0.56696516", "0.5666524", "0.5662749", "0.56626236", "0.5655119", "0.5651344" ]
0.58738744
57
form a connection with system.in
public static void main(String[] args) throws Exception { BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); //declare variables String roll,name,interest; //accept data System.out.println("Enter Name: "); name = input.readLine(); //accept roll System.out.println("Enter roll num: "); roll = input.readLine(); //accept interest System.out.println("field of interest: "); interest = input.readLine(); //print information System.out.println("\nEntered info: "); System.out.println("My name is " + name + " and my roll number is " + roll + ". My field of interest is "+ interest); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void openConnection () {\n String[] labels = {\"Host :\", \"Port :\"};\n String[] initialValues = {\"localhost\", \"1111\"};\n StandardDialogClient openHandler = new StandardDialogClient () {\n\t@Override\n\tpublic void dialogDismissed (StandardDialog d, int code) {\n\t try {\n\t InputDialog inputD = (InputDialog)d;\n\t if (inputD.wasCancelled ()) return;\n\t String[] results = inputD.getResults ();\n\t String host = results[0];\n\t String port = results[1];\n\t TwGateway connection =\n\t (TwGateway)TwGateway.openConnection (host, port);\n\t // The following call will fail if the G2 is secure.\n\t connection.login();\n\t setConnection (connection);\n\t } catch (Exception e) {\n\t new WarningDialog (null, \"Error During Connect\", true, e.toString (), null).setVisible (true);\n\t }\n\t}\n };\t \n\n new ConnectionInputDialog (getCurrentFrame (), \"Open Connection\",\n\t\t\t\t true, labels, initialValues,\n\t\t\t\t (StandardDialogClient) openHandler).setVisible (true);\n }", "void registerInputConnector(String name, InputConnector in);", "public void initiateContact(){\n try{\n clientSocket = new Socket(hostName, portNumber); \n inFromUser = new BufferedReader(new InputStreamReader(System.in)); \n outToServer = new DataOutputStream(clientSocket.getOutputStream()); \n inFromServer = new BufferedReader(new InputStreamReader(clientSocket.getInputStream())); \n }catch(IOException e){\n System.err.println(\"Caught IOException in initiateContact: \" + e.getMessage());\n }\n }", "public abstract void connectSystem();", "public void acceptConnection(SystemServiceConnection connection);", "private void openConnection(){}", "@FXML\n\tprivate void handleConnection() {\n\t\tString pseudo = this.nickName.getText();\n\t\tif (pseudo != null && !pseudo.equals(\"\")) {\n\t\t\tUser user = new User(pseudo);\n\t\t\tthis.mainApp.setUser(user);\n\t\t\t//Un fois que l'utilisateur a été créé dans la main ap, on peut appeler la méthode de connection\n\t\t\tthis.mainApp.connect();\n\t\t}\n\t\telse {\n\t\t\t\n\t\t}\n\t}", "private void handleInput()\n {\n String instructions = \"Options:\\n<q> to disconnect\\n<s> to set a value to the current time\\n<p> to print the map contents\\n<?> to display this message\";\n System.out.println(instructions);\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n try {\n while (true) {\n String line = br.readLine();\n if (line.equals(\"q\")) {\n System.out.println(\"Closing...\");\n break;\n } else if (line.equals(\"s\")) {\n System.out.println(\"setting value cli_app to current time\");\n collabMap.set(\"cli_app\", System.currentTimeMillis());\n } else if (line.equals(\"?\")) {\n System.out.println(instructions);\n } else if (line.equals(\"p\")) {\n System.out.println(\"Map contents:\");\n for (String key : collabMap.keys()) {\n System.out.println(key + \": \" + collabMap.get(key));\n }\n }\n }\n } catch (Exception ex) {\n }\n\n if (document != null)\n document.close();\n System.out.println(\"Closed\");\n }", "public void launch() throws IOException {\n initBinding();\n var request = this.password == null ? new AnonymousConnection(login)\n : new AuthentificatedConnection(login, password);\n\n this.uniqueContext.putInQueue(request.toBuffer());\n console.setDaemon(true);\n console.start();// run stdin thread\n\n var lastCheck = System.currentTimeMillis();\n while (!Thread.interrupted()) {\n // printKeys();\n try {\n if (uniqueContext.isClosed()) {\n console.interrupt();\n selector.close();\n serverSocketChannel.close();\n sc.close();\n return;\n }\n selector.select(this::treatKey);\n processCommands();\n var currentTime = System.currentTimeMillis();\n if (currentTime >= lastCheck + TIMEOUT) {\n lastCheck = currentTime;\n clearInvalidSelectionKey();\n }\n } catch (UncheckedIOException tunneled) {\n throw tunneled.getCause();\n }\n }\n }", "public void run() {\n\t\ttry {\n\t\t\tSystem.out.println(\"Local IP: \"+InetAddress.getByAddress(simpella.connectIP));\n\t\t} catch (UnknownHostException e1) {\n\t\t\tSystem.out.println(\"Cannot resolve localhost name...exiting\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t\tSystem.out.println(\"Simpella Net Port: \"+simpella.serverPortNo);\n\t\tSystem.out.println(\"Downloading Port: \"+simpella.downloadPortNo);\n\t\tSystem.out.println(\"simpella version 0.6 (c) 2002-2003 XYZ\");\n\t\tinp=new BufferedReader(new InputStreamReader(System.in));\n\t\twhile(true)\n\t\t{\n\t\t\t\t\t\t\n\t\t\ttry {\n\t\t\t\tuserInput = inp.readLine();\n\t\t\t} catch (Exception e) {\n\t\t\t\t//e.printStackTrace();\n\t\t\t\tSystem.out.println(\"Invalid Input!!...Exiting\");\n\t\t\t\t//System.exit(1);\n\t\t\t}\n\t\t\tif(userInput.equalsIgnoreCase(\"quit\") || userInput.equalsIgnoreCase(\"bye\"))\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"Exiting....\");\n\t\t\t\t\tSystem.exit(1);\n\t\t\t\t}\n\t\t\telse if(userInput.startsWith(\"info\"))\n\t\t\t{\n\t\t\t\tString[] token=userInput.split(\" \");\n\t\t\t\tif(token.length==2)\n\t\t\t\t\tinfo(token[1]);\n\t\t\t\telse\n\t\t\t\t\tSystem.out.println(\"Usage: info [cdhnqs]\");\n\t\t\t}\n\t\t\telse if(userInput.startsWith(\"share\"))\n\t\t\t{\n\t\t\t\tString[] token=userInput.split(\" \");\n\t\t\t\tString argument=\"\";\n\t\t\t\tfor(int i=1;i<token.length;i++)\n\t\t\t\t\targument=argument + token[i] +\" \";\n\t\t\t\t//System.out.println(argument+\"len=\"+argument.length());\n\t\t\t\tshare(argument);\n\t\t\t\t\n\t\t\t}\n\t\t\t\t\n\t\t\telse if(userInput.startsWith(\"open\")){\n\t\t\t\t// Insert validation for input string\n\t\t\t\tString[] token=userInput.split(\" \");\n\t\t\t\tif(client.noOfConn<3)\n\t\t\t\topen(token[1]);\n\t\t\t\telse\n\t\t\t\t\tSystem.out.println(\"Client:SIMPELLA/0.6 503 Maximum number of connections reached. Sorry!\\r\\n\");\n\t\t\t}\n\t\t\t\n\t\t\telse if(userInput.equals(\"scan\")){\n\t\t\t\tscan();\n\t\t\t}\n\t\t\telse if(userInput.startsWith(\"download\")){\n\t\t\t\tString[] token=userInput.split(\" \");\n\t\t\t\ttry {\n\t\t\t\t\tdownload(Integer.parseInt(token[1]));\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tSystem.out.println(\"Usage: download <number>\");\n\t\t\t\t\t//e.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(userInput.equals(\"monitor\")){\n\t\t\t\ttry {\n\t\t\t\t\tmonitor();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(userInput.startsWith(\"clear\")){\n\t\t\t\tString[] token=userInput.split(\" \");\n\t\t\t\t//System.out.println(\"No of arguments=\"+token.length);\n\t\t\t\tif(token.length==1)\n\t\t\t\t\tclear(-1);\n\t\t\t\telse\n\t\t\t\t\tclear(Integer.parseInt(token[1]));\n\t\t\t}\n\t\t\telse if(userInput.equals(\"list\")){\n\t\t\t\ttry {\n\t\t\t\t\tint k=Connection.list_port.size();\n\t\t\t\t\tlist1(0, k);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(userInput.startsWith(\"find\")){\n\t\t\t\tString[] token=userInput.split(\" \");\n\t\t\t\tString argument=\"\";\n\t\t\t\tfor(int i=1;i<token.length;i++)\n\t\t\t\t\targument=argument + token[i] +\" \";\n\t\t\t\t//System.out.println(argument+\"len=\"+argument.length());\n\t\t\t\ttry {\n\t\t\t\t\tfind(argument);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(userInput.equals(\"update\")){\n\t\t\t\ttry {\n\t\t\t\t\tupdate();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tSystem.out.println(\"Client:Error calling update\");\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t\tSystem.out.println(\"Invalid Command\");\n\t\t}\n\t}", "public void connect();", "public void connect();", "public void connect();", "private void connect() throws IOException {\n\t\tString serverAddress = ipaddress.getText();\n\n\t\t// int port = portnum.getText();\n\t\tportint = Integer.parseInt(portnum.getText());\n\n\t\tSocket s = new Socket(serverAddress, portint);\n\n\t\t// Pass data from the client to server\n\t\tOutputStream out = s.getOutputStream();\n\t\tPrintWriter writer = new PrintWriter(out, true);\n\t\twriter.println(\"task:meetting at the uni\");\n\n\t\tBufferedReader input = new BufferedReader(new InputStreamReader(s.getInputStream()));\n\t\tString answer = input.readLine();\n\t\t// JOptionPane.showMessageDialog(null, answer);\n\t\tSystem.out.println(\"Blairs server: \" + answer);\n\t\toutput.setText(\"The date is : \" + answer);\n\t\titems.add(new DataItem(answer, answer));\n\t\t// PostgresJDBC();\n\n\t}", "void requestInput();", "public void connect() {}", "public void input()\n\t{\n\t\t// this facilitates the output\n\t\tScanner sc = new Scanner(System.in) ; \n\t\tSystem.out.print(\"The Bike Number:- \") ;\n\t \tthis.bno = sc.nextInt() ; \t\n\t\tSystem.out.print(\"The Biker Name:- \") ; \n\t \tthis.name = new Scanner(System.in).nextLine() ; \t\n\t\tSystem.out.print(\"The Phone number:- \") ; \n\t \tthis.phno = sc.nextInt() ; \t\n\t\tSystem.out.print(\"The number of days:- \") ; \n\t \tthis.days = sc.nextInt() ; \t\n\t}", "private void inicializar()\n\t{\n\t\tif( this.getIn() != null )\n\t\t\tthrow new ConsolaTecladoSoloPuedeHaberUnaInstanciaException();\n\t\t\t\n\t\tthis.setIn( new Scanner( System.in ) );\n\t}", "private void getInput() {\n\t\tSystem.out.println(\"****Welcome to TNEB online Payment*****\");\r\n\t\tScanner scan = new Scanner(System.in);\r\n\t\tSystem.out.println(\"Enter your current unit\");\r\n\t\tunit = scan.nextInt();\r\n\t}", "public static void main(String[] args) {\n\n\t\ttry (Socket socket = new Socket(\"codebank.xyz\", 38001)){\n\t\t\tSystem.out.println(\"Connected to: \" + socket.getInetAddress() + \":\" + socket.getPort());\n\n\t\t\tPrintWriter pw = new PrintWriter(socket.getOutputStream());\n\t\t\tBufferedReader br = new BufferedReader\n\t\t\t\t\t(new InputStreamReader(socket.getInputStream(), \"UTF-8\"));\t\n\n\n\t\t\tScanner kb = new Scanner(System.in);\n\t\t\tSystem.out.print(\"Enter a user name: \");\n\t\t\tString input = kb.nextLine();\n\t\t\tpw.println(input);\n\n\t\t\tif (!(br.ready() && br.readLine().equals(\"Name in use.\"))){\n\t\t\t\tnew Listener(socket, br).start();\n//\t\t\t\twhile (!input.toLowerCase().equals(\"exit\")){\n\t\t\t\twhile (true){\n\t\t\t\t\tpw.flush();\n\t\t\t\t\tinput = kb.nextLine();\n\t\t\t\t\tpw.println(input);\n\t\t\t\t}\n\t\t\t}\n\t\t\tpw.close();\t//Noting that these closes are not reached, and the code must either be refactored to change the while(true)\n\t\t\tbr.close();\t//loop or remove these closes.\n\t\t\tkb.close();\n\t\t} catch (UnknownHostException ue) {\n\t\t\tSystem.out.println(\"Host error! \" + ue.getMessage());\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Error! \" + e.getMessage());\n\t\t}\n\t}", "public void connect() {\n\t\ttry {\n\t\t\tconnection = new Socket(ip, serverPort); // 128.39.83.87 // 127.0.0.1\n\t\t\t\n\t\t\toutput = new BufferedWriter(new OutputStreamWriter(\n connection.getOutputStream()));\n\t\t\tinput = new BufferedReader(new InputStreamReader(\n connection.getInputStream()));\n\t\t\t\n\t\t\tif (hostName.equals(Constants.IDGK + Main.userName))\n\t\t\t\tsendText(\"1\" + Main.userName);\n\t\t\telse\n\t\t\t\tsendText(\"2\" + Main.userName);\n\t\t\t\n\t\t} catch (UnknownHostException e) {\n\t\t\tMain.LOGGER.log(Level.SEVERE, \"Error connecting server\", e);\n\t\t} catch (IOException e) {\n\t\t\tMain.LOGGER.log(Level.WARNING, \"Error making output/input\", e);\n\t\t}\n\t}", "public void transmit()\n { \n try\n {\n JSch jsch=new JSch(); //object that allows for making ssh connections\n //Log into the pi\n Session session=jsch.getSession(USERNAME, HOSTNAME, 22); //pi defaults to using port 22 \n session.setPassword(PASSWORD);\n session.setConfig(\"StrictHostKeyChecking\", \"no\"); //necessary to access the command line easily\n \n session.connect(1000);//connect to the pi\n \n Channel channel = session.openChannel(\"exec\");//set session to be a command line \n ((ChannelExec)channel).setCommand(this.command); //send command to the pi\n \n channel.setInputStream(System.in); \n channel.setOutputStream(System.out);\n //connect to the pi so the command can go through\n channel.connect(1000);\n }\n catch(Exception e)\n {\n JOptionPane.showMessageDialog(frame, \"Error connecting to infrared light\", \"Error Message\", JOptionPane.ERROR_MESSAGE);\n }\n }", "private String getClientInput() {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String input = null;\n try {\n input = br.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return input;\n }", "public static void main (String arg[]) throws IOException\n {\n try\n {\n Socket socket = new Socket(\"127.0.0.1\", 3000);\n //System.out.println(\"Connected!\");\n DataInputStream inputStream = new DataInputStream(socket.getInputStream());\n String received = inputStream.readUTF();\n System.out.println(received);\n }\n catch(Exception e) {}\n\n IO ioMenu = new IO();\n ioMenu.runMenu();\n }", "ClientConnection connection();", "public void connecting() {\n\n }", "public void console() throws RemoteException {\r\n Scanner in = new Scanner(System.in);\r\n do {\r\n System.out.println(\"Select one of the following options:\");\r\n System.out.println(\" 1: Be a publisher\");\r\n System.out.println(\" 2: Be a subscriber\");\r\n System.out.println(\" 3: Save & quit\");\r\n System.out.print(\"Enter a number:\");\r\n int choice = 0;\r\n try {\r\n choice = in.nextInt();\r\n } catch (Exception e) {\r\n System.err.println(\"Provide a Valid Option... \");\r\n }\r\n switch (choice) {\r\n case 1: {\r\n optionsForPublisher();\r\n break;\r\n }\r\n case 2: {\r\n optionsForSubscriber();\r\n break;\r\n }\r\n case 3: {\r\n in.close();\r\n saveState();\r\n break;\r\n }\r\n default: System.out.println(\"Input not recognized, Please enter a valid option...\");\r\n }\r\n } while (true);\r\n }", "public static void main(String[] args){\n String data = JOptionPane.showInputDialog(null,\"What is the IP Address of the server?\", \"Connect to Server\", JOptionPane.PLAIN_MESSAGE);\n if(data != null){\n CoronosClient c = new CoronosClient(data);\n }\n else{\n System.exit(0);\n }\n }", "private void openConnection(String host){\n try {\n this.socket = new Socket(host, PORT);\n this.fromServer = new DataInputStream(socket.getInputStream());\n this.toServer = new DataOutputStream(socket.getOutputStream());\n\n } catch (SecurityException e){\n report(\"Connect is not allowed\");\n } catch (UnknownHostException e) {\n report(\"the ip address is not found.\");\n } catch (IOException e){\n report(\"Can not connect to the server\\\"\"+host+\"\\\"\");\n }\n }", "public telalogin() {\n initComponents();\n conexao = ModuloConexao.conector();\n // a linha abaixo serve de apoio ao status da conexao\n // System.out.println(conexao);\n\n }", "private void connect()\r\n\t{\r\n\t\tString remoteHostName = txtComputerName.getText();\r\n\t\tint remoteHostPort = Integer.parseInt(txtPort.getText());\r\n\t\tif (remoteHostName == null || remoteHostName.equals(\"\"))\r\n\t\t{\r\n\t\t\twriteLine(\"Enter a Computer Name\", 0);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif (remoteHostPort <= 0)\r\n\t\t\t{\r\n\t\t\t\twriteLine(\"Enter a Port\", 0);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// we can now connect\r\n\t\t\t\t// set our cursor to notify the user that they might need to\r\n\t\t\t\t// wait\r\n\t\t\t\twriteLine(\"Connecting to: \" + remoteHostName + \" : \"\r\n\t\t\t\t\t\t+ remoteHostPort, 0);\r\n\t\t\t\tthis.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));\r\n\t\t\t\t// lets try to connect to the remote server\r\n\r\n\t\t\t\ttheSocket = new CommSocket(remoteHostName, remoteHostPort);\r\n\r\n\t\t\t\tif (theSocket.connect())\r\n\t\t\t\t{\r\n\t\t\t\t\twriteLine(\r\n\t\t\t\t\t\t\t\"We are successfuly connected to: \"\r\n\t\t\t\t\t\t\t\t\t+ theSocket.getRemoteHostIP(), 0);\r\n\t\t\t\t\twriteLine(\"On Port: \" + theSocket.getRemoteHostPort(), 0);\r\n\t\t\t\t\trunning = true;\r\n\t\t\t\t\t// socketListener();\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\twriteLine(\"We failed to connect!\", 0);\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.setCursor(Cursor\r\n\t\t\t\t\t\t.getPredefinedCursor(Cursor.DEFAULT_CURSOR));\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public MyInputStream()\n {\n in = new BufferedReader\n (new InputStreamReader(System.in));\n }", "private void logIn() throws IOException {\n\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n String line = reader.readLine();\n String[] a = line.split(\";\");\n\n String user = a[0];\n String password = a[1];\n boolean rez = service.checkPassword(user, password);\n if(rez == TRUE)\n System.out.println(\"Ok\");\n else\n System.out.println(\"Not ok\");\n }", "private void ConnectDialog(){\n\t\tAlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);\n\t\tbuilder.setIcon(R.mipmap.ic_launcher);\n\t\tbuilder.setTitle(\"请输入主机名称和密码\");\n\t\t// 通过LayoutInflater来加载一个xml的布局文件作为一个View对象\n\t\tView view = LayoutInflater.from(MainActivity.this).inflate(R.layout.dialog, null);\n\t\t// 设置我们自己定义的布局文件作为弹出框的Content\n\t\tbuilder.setView(view);\n\n\t\tfinal EditText username = (EditText)view.findViewById(R.id.username);\n\t\tfinal EditText password = (EditText)view.findViewById(R.id.password);\n\n\t\tbuilder.setPositiveButton(\"确定\", new DialogInterface.OnClickListener()\n\t\t{\n\t\t\t@Override\n\t\t\tpublic void onClick(DialogInterface dialog, int which)\n\t\t\t{\n\t\t\t\tString a = username.getText().toString().trim();\n\t\t\t\tString b = password.getText().toString().trim();\n\n\t\t\t\tSwitchToSlaveRemoteController(a,b);\n\t\t\t}\n\t\t});\n\t\tbuilder.setNegativeButton(\"取消\", new DialogInterface.OnClickListener()\n\t\t{\n\t\t\t@Override\n\t\t\tpublic void onClick(DialogInterface dialog, int which)\n\t\t\t{\n\n\t\t\t}\n\t\t});\n\t\tbuilder.show();\n\t}", "public static void main(String[] args){\n\t\ttry{\n\t\t\tServerSocket ss = new ServerSocket(6665);\n\t\t\tSocket s = ss.accept();\n\t\t\t//in = s.getInputStream();\n\t\t\t//out = s.getOutputStream();\n\t\t\tBufferedReader keyboard = new BufferedReader(new InputStreamReader(System.in));\n\t\t\tBufferedReader ind = new BufferedReader(new InputStreamReader(s.getInputStream()));\n\t\t\tPrintWriter outd = new PrintWriter(s.getOutputStream());\n\t\t\tString db = null;\n\t\t\t//System.out.println(\"Client:\" + ind.readLine());\n\t\t\tdb = ind.readLine();\n\t\t\twhile(!db.equals(\"bye\")){\n\t\t\t\tSystem.out.println(\"Client:\" + db);\n\t\t\t\tdb = ind.readLine();\n\t\t\t}\n\n\n\t\t\t/*\n\t\t\tdb = keyboard.readLine();\n\t\t\twhile(!db.equals(\"bye\")){\n\t\t\t\toutd.println(db);\n\t\t\t\tSystem.out.println(\"Me:\"+db);\n\t\t\t\tSystem.out.println(\"Client:\"+ind.readLine());\n\t\t\t\tdb = keyboard.readLine();\n\t\t\t}\n\t\t\t*/\n\t\t\tind.close();\n\t\t\toutd.close();\n\t\t\ts.close();\n\t\t}catch(IOException e){\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void accept() {\n try {\n BufferedReader fromConsole = new BufferedReader(new InputStreamReader(System.in));\n String message;\n\n // loops infinitely, until #quit command is called, which sets run = false, and\n // stops the loop\n while (run) {\n message = fromConsole.readLine();\n if (message != null) {\n if (message.charAt(0) == '#') {\n command(message.substring(1));\n } else {\n client.handleMessageFromClientUI(message);\n }\n } else {\n client.handleMessageFromClientUI(message);\n }\n }\n }\n\n // Exceptions where the reader encounters an error\n catch (Exception ex) {\n System.out.println(\"Unexpected error while reading from console!\");\n System.out.println(ex.getMessage());\n }\n }", "public static void main(String[] args)throws IOException \r\n\t{\n\t\tInetAddress addr = InetAddress.getByName(null);\r\n\t\t\r\n\t\t// Alternatively, you can use the address or name:\r\n\t\t// InetAddress addr = InetAddress.getByName(\"127.0.0.1\");\r\n\t\t// InetAddress addr = InetAddress.getByName(\"localhost\");\r\n\t\tSystem.out.println(\"addr = \" + addr);\r\n\t\tSocket socket = new Socket(addr, 10000);\r\n\t\t\r\n\t\t// Guard everything in a try-finally to make\r\n\t\t// sure that the socket is closed:\r\n\t\ttry\r\n\t\t{\r\n\t\t\tSystem.out.println(\"socket = \" + socket);\r\n\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\r\n\t\t\tBufferedReader in = \r\n\t\t\t\tnew BufferedReader(new InputStreamReader(socket.getInputStream()));\r\n\t\t\t\r\n\t\t\t// Output is automatically flushed by PrintWriter:\r\n\t\t\tPrintWriter out =\r\n\t\t\t\tnew PrintWriter(new BufferedWriter(new OutputStreamWriter(socket.getOutputStream())),true);\r\n\r\n\t\t\twhile(true){\r\n\t\t\tSystem.out.print(\"Enter Some String: \");\r\n\t\t\t//int num=Integer.parseInt(br.readLine()); // Reading from KeyBoard\r\n\t\t\tString str=br.readLine();\r\n\t\t\tout.println(str);}\r\n\t\t\t//int addnum = Integer.parseInt(in.readLine()); // Reading from Server\r\n\t\t//\tSystem.out.println(\"Result from Server: \"+addnum);\r\n\t\t}catch(Exception e){e.printStackTrace();}\r\n\t\r\n\t\r\n\t}", "void login() {\r\n\t\t// to show the window and the data input\r\n\t\td = new Dialog(f, true);\r\n\t\thost = new TextField(10);\r\n\t\ttf_name = new TextField(10);\r\n\t\td.setLayout(new GridLayout(3, 2));\r\n\t\td.add(new Label(\"host:\"));\r\n\t\td.add(host);\r\n\t\td.add(new Label(\"name:\"));\r\n\t\td.add(tf_name);\r\n\t\tButton b = new Button(\"OK\");\r\n\t\tb.addActionListener(new ActionListener() {\r\n\t\t\t// if the input is ended, then use the realLogin method to login the server\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\trealLogin(host.getText(), tf_name.getText());\r\n\t\t\t\td.dispose();\r\n\t\t\t}\r\n\t\t});\r\n\t\td.add(b);\r\n\t\td.setResizable(true);\r\n\t\td.setSize(200, 150);\r\n\t\td.show();\r\n\t\t(new Thread(this)).start();\r\n\t}", "public void sendInput(String input) throws IOException {\n\t\tmShell.sendCommand(\"INPUT:\" + mStag + \":\" + input + \":\");\n\t}", "static void in_to_acc(String passed) throws IOException{\n\t\tSystem.out.print(\"Input to port \"+hexa_to_deci(passed.substring(3))+\" : \");\n\t\tString enter = scan.readLine();\n\t\tregisters.put('A',enter);\n\t}", "private void start_Connexion()throws UnknownHostException, IOException{\n \tsocket = new Socket(IP,num_Socket);\n \tout = new ObjectOutputStream(socket.getOutputStream());\n \tin = new ObjectInputStream(socket.getInputStream());\n \t\n }", "@Override\n public void input() {\n super.input();\n Scanner sc = new Scanner(System.in);\n System.out.printf(\"Nhập số trang sách giáo khoa: \");\n amountPage = Integer.valueOf(sc.nextLine());\n System.out.printf(\"Nhập tình trạng sách giáo khoa: \");\n status = sc.nextLine();\n System.out.printf(\"Nhập số lượng mượn: \");\n amountBorrow= Integer.valueOf(sc.nextLine());\n }", "public static void main(String[] args) {\nConnection connection =ConnectionUtil.getConnection();\r\nSystem.out.println(connection);\r\n\t}", "private void cmdNet() {\n int port = 1777;\n try {\n Log.verbose(\"waiting for connection on port \" + port + \"...\");\n ServerSocket socket = new ServerSocket(port);\n Socket client = socket.accept();\n InetAddress clientAddr = client.getInetAddress();\n Log.verbose(\"connected to \" + clientAddr.getHostName() + \"/\"\n + client.getPort());\n Readline readline = new SocketReadline(client, true, \"net>\");\n fReadlineStack.push(readline);\n } catch (IOException ex) {\n Log.error(\"Can't bind or listen on port \" + port + \".\");\n }\n }", "public static void CreateClient(int port, String ip, String inname, String incolor){\n Client charlie = new Client(port, ip);\n charlie.clientName = inname;\n charlie.outhexColor = incolor; \n //charlie.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n charlie.startRunning(port);\n }", "private static void setupConnection() {\r\n\t\t\r\n\t\t// Variable used to keep track of if a connection is sucessful\r\n\t\tboolean connectionSuccess;\r\n\t\t\r\n\t\t// Loop until a sucessful connection is made\r\n\t\tdo {\r\n\t\t\tconnectionSuccess = true;\r\n\t\t\t\r\n\t\t\t// Get server info from user\r\n\t\t\tString serverInfo = JOptionPane.showInputDialog(null, \"Please input the server IP and port\"\r\n\t\t\t\t\t+ \" in the form \\\"IP:Port\\\"\", \"Server Connection Details\", JOptionPane.PLAIN_MESSAGE);\r\n\t\t\t\r\n\t\t\t// If the X button or cancel is clicked exit the program\r\n\t\t\tif(serverInfo == null) {\r\n\t\t\t\tSystem.exit(-1);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tString[] serverInfoArray = serverInfo.split(\":\", 2);\r\n\t\t\tint port = 0;\r\n\t\t\t\r\n\t\t\t// Check that both the port and IP have been inputted\r\n\t\t\tif(serverInfoArray.length > 1) {\r\n\t\t\t\t\r\n\t\t\t\t// Check that the port inputted is valid\r\n\t\t\t\ttry{\r\n\t\t\t\t\tport = Integer.parseInt(serverInfoArray[1]);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(port > 65536 || port < 0) {\r\n\t\t\t\t\t\tshowMSG(PORT_ERROR_MSG);\r\n\t\t\t\t\t\tconnectionSuccess = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t} catch(NumberFormatException e) {\r\n\t\t\t\t\tshowMSG(PORT_ERROR_MSG);\r\n\t\t\t\t\tconnectionSuccess = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse {\r\n\t\t\t\tshowMSG(\"Please input a port number and IP address\");\r\n\t\t\t\tconnectionSuccess = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// After port validation try to connect to the server\r\n\t\t\tif(connectionSuccess == true) {\r\n\t\t\t\t\r\n\t\t\t\ttry {\r\n\t\t\t\t\tsock = new Socket(serverInfoArray[0], port);\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\tshowMSG(CONNECTION_ERROR_MSG);\r\n\t\t\t\t\tconnectionSuccess = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Loop until a successful connection to the server is made\r\n\t\t} while(connectionSuccess == false);\r\n\t\t\r\n\t\t\r\n\t\t// Setup buffered reader to read from the server\r\n\t\ttry {\r\n\t\t\tserverReader = new BufferedReader(new InputStreamReader(sock.getInputStream()));\r\n\t\t\t\r\n\t\t} catch (IOException e) {\r\n\t\t\tshowMSG(CONNECTION_ERROR_MSG);\r\n\t\t\tSystem.exit(-1);\r\n\t\t}\r\n\t}", "public static void main(String[] args) throws IOException {\n NetworksClient client = new NetworksClient();\n client.startConnection(\"127.0.0.1\", 18741);\n \n System.out.println(\"Enter a command:\");\n while(true){\n Scanner input = new Scanner(System.in);\n String message = input.nextLine();\n\n if(\".\".equals(message)){\n client.stopConnection();\n return;\n }\n\n String response = client.sendMessage(message);\n\n System.out.println(\"From server: \" + response);\n }\n }", "InputPort createInputPort();", "@Override\r\n public void getInput() { \r\n \r\n String command;\r\n Scanner inFile = new Scanner(System.in);\r\n \r\n do {\r\n \r\n this.display();\r\n \r\n command = inFile.nextLine();\r\n command = command.trim().toUpperCase();\r\n \r\n switch (command) {\r\n case \"B\":\r\n this.helpMenuControl.displayBoardHelp();\r\n break;\r\n case \"C\":\r\n this.helpMenuControl.displayComputerPlayerHelp();\r\n break;\r\n case \"G\":\r\n this.helpMenuControl.displayGameHelp();\r\n break; \r\n case \"Q\": \r\n break;\r\n default: \r\n new Connect4Error().displayError(\"Invalid command. Please enter a valid command.\");\r\n }\r\n } while (!command.equals(\"Q\")); \r\n }", "public void login(){\n if (this.method.equals(\"Facebook\")){\n Scanner in = new Scanner(System.in);\n\n System.out.println(\"Enter your Facebook username :\");\n String username = in.next();\n\n System.out.println(\"Enter your Facebook password :\");\n String password = in.next();\n\n connector.connectToDb();\n\n System.out.println(\"Success : Logged In !\");\n }\n }", "public void accept(){\n\t\ttry{\n\t\t\tBufferedReader fromConsole = new BufferedReader(new InputStreamReader(System.in));\n\t\t\tString message;\n\t\t\twhile (true){\n\t\t\t\tmessage = fromConsole.readLine();\n\t\t\t\tthis.handleMessage(message);\n\t\t\t}\n\t\t} \n\t\tcatch (Exception exception){\n\t\t\tSystem.out.println\n\t\t\t(\"Unexpected error while reading from console!\");\n\t\t}\n\t}", "public synchronized void listen() {\n// synchronized (this) {\n try {\n String input;\n if ((input = in.readLine()) != null) {\n parseCommand(input);\n }\n } catch (IOException ex) {\n Logger.getLogger(ClientIO.class.getName()).log(Level.SEVERE, null, ex);\n }\n// }\n }", "InputPromptTransmitter getInputPromptTransmitter();", "private void connectButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_connectButtonActionPerformed\n sC = new SocketConnect();\n hostName = localhostText.getText();\n sC.run(); \n }", "public CLI(String inputCommand)\r\n\t{\r\n\t\t//lvl = new Level();\r\n\t\tthis.inputCommand = inputCommand;\r\n\t\tin = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\r\n\t}", "public void start() throws Exception {\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\t// Ask the user for a host name and port\n\t\tgetHostnameAndPort(sc);\n\t\t\n\t\t// Connect the socket\n\t\tif (!connect()) {\n\t\t\treturn;\n\t\t}\n\t\t\t\t\n\t\ttry (\n\t\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n\t\t\t\tPrintWriter writer = new PrintWriter(socket.getOutputStream(), true);\n\t\t) {\n\t\t\t\n\t\t\tString response = null;\n\t\t\twhile (true) {\n\n\t\t\t String input = getUserInput(sc);\n\t\t\t if (input == null || input.trim().isEmpty()) {\n\t\t\t \tcontinue;\n\t\t\t }\n\t\t\t \n\t\t\t writer.println(input);\n\t\t\t \n\t\t\t\tresponse = reader.readLine();\n\t\t\t\tif (response == null) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t processResponse(response, reader);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t} catch (SocketException e) {\n\t\t\tSystem.err.println(\"SocketException: The connection has most likely been closed.\");\n\t\t\tSystem.exit(-1);\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(-1);\n\t\t\t\n\t\t} finally {\n\t\t\t\n\t\t\tif (sc != null) {\n\t\t\t\tsc.close();\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "public void run()\r\n {\r\n Scanner sc = new Scanner(System.in);\r\n while(socket.isConnected())\r\n {\r\n String comm = sc.nextLine();\r\n\r\n }\r\n }", "@SuppressWarnings(\"unchecked\")\r\n\tpublic CommandInput( HttpServletRequest req ){\r\n\t\t\t\t\r\n\t\tlogger.debug( \"CommandInput() start\" );\r\n\r\n\t\t//Parameter automatisch in die Map laden\r\n\t\tthis.params = new HashMap<String, Object>( (HashMap<String, Object>)req.getParameterMap() );\r\n\t\t\r\n\t\t//Session speichern\r\n\t\tthis.session = req.getSession();\r\n\t\t\r\n\t\tthis.locale = req.getLocale();\r\n\r\n\t\tlogger.debug( \"CommandInput() end\" );\r\n\r\n\t}", "public Console(Client client, Controller controller){\r\n\t\tsuper(client,controller);\r\n\t\tsc = new Scanner(System.in);\r\n\t\tnew Thread(new ReadInput()).start();\r\n\t}", "private void connect() {\n\t\ttry {\n\t\t\tsocket = new Socket(Server.ADDRESS, Server.PORT_NUMBER);\n\t\t\tthis.oos = new ObjectOutputStream(socket.getOutputStream());\n\t\t\tthis.ois = new ObjectInputStream(socket.getInputStream());\n\t\t\tServerListener serverlistener = new ServerListener();\n\t\t\tserverlistener.start();\n\t\t\tRequest request = new Request(RequestCode.START_DOCUMENT_STREAM);\n\t\t\trequest.setUsername(user.getUsername());\n\t\t\toos.writeObject(request);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "void realLogin(String host, String name) {\r\n\t\ttry {\r\n\t\t\t// connect to the server\r\n\t\t\tthis.name = name;\r\n\t\t\tserver = new Socket(host, port);\r\n\t\t\tin = new BufferedReader(new InputStreamReader(server.getInputStream()));\r\n\t\t\tout = new PrintWriter(server.getOutputStream());\r\n\r\n\t\t\t// sending login cmd\r\n\t\t\tout.println(\"login \" + name);\r\n\t\t\tout.flush();\r\n\t\t\trepaint();\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.exit(1);\r\n\t\t}\r\n\t}", "private void inputHandler(String input) throws Exception{\n\n switch (input) {\n\n case \"/quit\":\n done = true;\n break;\n\n default:\n PduMess mess = new PduMess(input);\n outStream.writeToServer(mess.getByteArray());\n break;\n }\n }", "private void doConnect(Stage stage) {\n try {\n if (validateInput() && isConnectionValid()) {\n Connection con = new Connection(connectionsCB.getEditor().getText(), rpcPort.getText(), asyncPort.getText(), nameTF.getText(), fullControlRB.isSelected());\n // remove it if connection already exists\n if (connectionMap.get(connectionsCB.getEditor().getText()) != null) {\n connectionMap.remove(connectionsCB.getEditor().getText());\n }\n con.setLastUsed(true);\n connectionMap.put(connectionsCB.getEditor().getText(), con);\n updateConnectionsList();\n ConnectionManager.getInstance().setConnected(true);\n\n stage.hide();\n }\n } catch (Exception ex) {\n LOG.error(\"Error durring connection to TRex server\", ex);\n }\n }", "public static void main(String[] args) {\n\t\trouter = new CommandRouter();\n\t\ttry {\n\t\t\t// setup our socket connection to the tv, but don't connect yet\n\t\t\tconn = new Connection(HOST, PORT, router);\n\n\t\t\t// Tell out router which network connection to use\n\t\t\trouter.setConnection(conn);\n\n\t\t\t// setup a handler for incoming GrantedSessionCommand message\n\t\t\t// objects\n\t\t\ttry {\n\t\t\t\trouter.registerCommandSubscriber(new ICommandSubscriber() {\n\t\t\t\t\tpublic void onCommandReceived(AbstractCommand command) {\n\t\t\t\t\t\t// Filter out the messages we care about\n\t\t\t\t\t\tif (command instanceof GrantedSessionCommand) {\n\t\t\t\t\t\t\t// Print our our unique key, this will be used for\n\t\t\t\t\t\t\t// subsequent connections\n\t\t\t\t\t\t\tUtilities.log(\"Your instanceId is \" + ((GrantedSessionCommand) command).getInstanceId());\n\n\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t//let's make the dock show up on the TV\n\t\t\t\t\t\t\t\trouter.publishCommand(new NavigationInputCommand(\"press_yahoo\"));\n\n\t\t\t\t\t\t\t\tThread.sleep(2000); //sleep for 2 seconds so the animation to dock finishes\n\n\t\t\t\t\t\t\t\t// Lets do something cool, like tell the TV to navigate to the right. Then do a little dance\n\t\t\t\t\t\t\t\t// This is the same as pressing \"right\" on your remote\n\t\t\t\t\t\t\t\trouter.publishCommand(new NavigationInputCommand(\"press_right\"));\n\n\t\t\t\t\t\t\t\tThread.sleep(1000);\n\n\t\t\t\t\t\t\t\t// slide to the left\n\t\t\t\t\t\t\t\trouter.publishCommand(new NavigationInputCommand(\"press_left\"));\n\n\t\t\t\t\t\t\t\tThread.sleep(1000);\n\n\t\t\t\t\t\t\t\t//slide to the right\n\t\t\t\t\t\t\t\trouter.publishCommand(new NavigationInputCommand(\"press_right\"));\n\n\t\t\t\t\t\t\t\tThread.sleep(1000);\n\n\t\t\t\t\t\t\t\t//take it back now, y'all\n\t\t\t\t\t\t\t\trouter.publishCommand(new NavigationInputCommand(\"press_left\"));\n\n\t\t\t\t\t\t\t\t//cha cha cha\n\t\t\t\t\t\t\t\trouter.publishCommand(new NavigationInputCommand(\"press_up\"));\n\t\t\t\t\t\t\t\tThread.sleep(1000);\n\t\t\t\t\t\t\t\trouter.publishCommand(new NavigationInputCommand(\"press_down\"));\n\t\t\t\t\t\t\t\tThread.sleep(1000);\n\t\t\t\t\t\t\t\trouter.publishCommand(new NavigationInputCommand(\"press_up\"));\n\t\t\t\t\t\t\t\tThread.sleep(1000);\n\t\t\t\t\t\t\t\trouter.publishCommand(new NavigationInputCommand(\"press_down\"));\n\t\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\t\tUtilities.log(\"Problem writing to the network connection\");\n\t\t\t\t\t\t\t\tconn.close();\n\t\t\t\t\t\t\t\tSystem.exit(-1);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Notify the main thread that everything we wanted to\n\t\t\t\t\t\t\t// do is done.\n\t\t\t\t\t\t\tsynchronized (conn) {\n\t\t\t\t\t\t\t\tconn.notifyAll();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else { // print out the others for educational purposes\n\t\t\t\t\t\t\tUtilities.log(\"Received: \" + command.toString());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tpublic void onConnectionLost(Connection conn) {\n\t\t\t\t\t\tUtilities.log(\"Connection Lost!\");\n\t\t\t\t\t}\n\t\t\t\t}, GrantedSessionCommand.class);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\t// Establish a connection\n\t\t\t\tconn.establish();\n\t\t\t\t// Since this is the first time we are connecting, we must\n\t\t\t\t// create a new session\n\t\t\t\trouter.publishCommand(new CreateSessionCommand(APP_ID, CONSUMER_KEY, SECRET, APP_NAME));\n\n\t\t\t\tString message = getUserInput(\"Code: \");\n\t\t\t\trouter.publishCommand(new AuthSessionCommand(message, conn.getPeerCertificate()));\n\n\t\t\t\t// Let's wait until everything is done. This thread will get\n\t\t\t\t// notified once we are ready to clean up\n\t\t\t\ttry {\n\t\t\t\t\tsynchronized (conn) {\n\t\t\t\t\t\tconn.wait();\n\t\t\t\t\t}\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t} catch (IOException ioe) {\n\t\t\t\tUtilities.log(\"Error establishing connection to \" + HOST + \":\" + PORT);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\tUtilities.log(\"Error establishing connection to \" + HOST + \":\" + PORT);\n\t\t\t}\n\n\t\t\t// It is always good practice to clean up after yourself\n\t\t\tconn.close();\n\n\t\t} catch (UnknownHostException e) {\n\t\t\tUtilities.log(\"Error resolving \" + HOST);\n\t\t\tSystem.exit(-1);\n\t\t} catch (IOException e) {\n\t\t\tUtilities.log(\"Problem writing to the network connection\");\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(-1);\n\t\t}\n\n\t\tSystem.exit(1);\n\t}", "@Override\n\tpublic void connect() {\n\t\t\n\t}", "@Override\n\tpublic void connect() {\n\t\t\n\t}", "void createConnection();", "@Override\n\tpublic void connectInputWire(Wire connectingWire, String inputName) {\n\t\t\n\t}", "private void connect(InProgInfo inProg, String address, String port, String interfaceName) throws InterruptedException\n {\n \n System.out.println(\"Starting connection to Real Time Session...\");\n \n channelSessions.add(new EDFChannelSession());\n if (channelSessions.get(channelSessions.size() - 1).initTransport(false, error) < CodecReturnCodes.SUCCESS)\n System.exit(error.errorId());\n\n // enable XML tracing\n if (CommandLine.booleanValue(\"x\"))\n {\n channelSessions.get(channelSessions.size() - 1).enableXmlTrace(dictionaryHandler.dictionary());\n }\n\n // get connect options from the channel session\n ConnectOptions copts = channelSessions.get(channelSessions.size() - 1).getConnectOptions();\n\n // set the connection parameters on the connect options\n copts.unifiedNetworkInfo().address(address);\n copts.unifiedNetworkInfo().serviceName(port);\n copts.unifiedNetworkInfo().interfaceName(interfaceName);\n copts.blocking(false);\n copts.connectionType(ConnectionTypes.SEQUENCED_MCAST);\n\n channelSessions.get(channelSessions.size() - 1).connect(inProg, error);\n }", "String getUserInput();", "void toConnect() throws Exception {\n\t\tnameField.setVisible(false);\n\t\tf.setTitle(nameField.getText());\n\t\tsocketToServer = new Socket(\"127.0.0.1\", 5050);\n\t\tmyOutputStream = new ObjectOutputStream(socketToServer.getOutputStream());\n\t\tmyInputStream = new ObjectInputStream(socketToServer.getInputStream()); \n\t\tconnected();\n\t\tstart();\n\t}", "public InputConnector getInputConnector(String connectorName);", "public void processInput( String input ){\n\t\tString opponent;//holds either \"client\" or \"server\". Whichever is the opponent\n\t\tif( parent.whichPlayer.equals(\"server\") ) opponent = \"client\";\n\t\telse opponent = \"server\";\n\t\t\n\t\t//create a string array to hold the input split around spaces\n\t\tString[] split = input.split(\" \");\n\t\t\n\t\t//input was mouseclick\n\t\tif( split[0].equals(\"C\") ) {\n\t\t\t//If the line contains mouseClick information, then send it to handleMouseClick\n\t\t\tparent.handleMouseClick(Integer.parseInt(split[1]), Integer.parseInt(split[2]), opponent);\n\t\t}\n\n\t\t//input was name\n\t\telse if(split[0].equals(\"N\")) {\n\t\t\t//if this window is the server, set the recieved name to the client\n\t\t\tif( parent.serverRadio.isSelected() ) {\n\t\t\t\tparent.playerTwoTextField.setText(split[1]);\n\t\t\t}\n\t\t\t//if this window is the client, set the recieved name to the server\n\t\t\telse {\n\t\t\t\tparent.playerOneTextField.setText(split[1]);\n\t\t\t}\n\t\t}\n\t\t//if a quit flag was sent\n\t\telse if(split[0].equals(\"Q\")){\n\t\t\ttry {\n\t\t\t\tsock.close();\n\t\t\t\tss.close();\n\t\t\t\tpw.close();\n\t\t\t\tsc.close();\n\t\t\t}catch(Exception e) {\n\t\t\t\tSystem.out.println(\"Unable to close the connection!\");\n\t\t\t}\n\t\t}\n\n\t}", "public static void main(String[] args) {\n\r\n\t\ttry {\r\n\t\t\t/////String host = InetAddress.getLocalHost().getHostName();\r\n \t\tSocket client = new Socket(\"131.159.52.1\", 50000);\r\n\t\t\t\t\r\n\t\t\tPrintWriter writer = new PrintWriter(client.getOutputStream());\r\n\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(client.getInputStream()));\r\n\r\n\t\t\tBufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));\r\n\t\t\t\r\n\t\t\tSystem.out.println(reader.readLine()); //read welcome message\r\n\t\t\t\r\n\t\t\tString message;\r\n\t\t\t\r\n\t\t\twhile (true) {\r\n\t\t\t\t////System.out.print(\"Enter message to echo or Exit to end : \");\r\n\t\t\t\tmessage = stdin.readLine();\r\n\t\t\t\t\r\n\t\t\t\tif (message == null || message.equalsIgnoreCase(\"exit\"))\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t\twriter.println(message);\r\n\t\t\t\twriter.flush();\r\n\t\t\t\tSystem.out.println(reader.readLine());\r\n\t\t\t}\r\n\t\t\tclient.close();\r\n\t\t\t\t\t\r\n\t\t}catch (Exception ex) {\r\n\t\t\tSystem.out.println(\"Exception: \"+ex);\r\n\t\t}\r\n\t}", "public void userInput() {\r\n System.out.println(\"You want to convert from:\");\r\n this.fromUnit = in.nextLine();\r\n System.out.print(\"to: \");\r\n this.toUnit = in.nextLine();\r\n System.out.print(\"The value is \");\r\n this.value = in.nextDouble();\r\n }", "private static void takeInput() throws IOException {\n\n System.out.println(\"Enter number 1\");\n BufferedReader br= new BufferedReader(new InputStreamReader(System.in));\n String number1=br.readLine();\n System.out.println(\"Enter number 2\");\n String number2=br.readLine();\n System.out.println(\"Operation\");\n String op=br.readLine();\n //WhiteHatHacker processes the input\n WhiteHatHacker hack=new WhiteHatHacker(number1,number2,op);\n hack.processInput();\n }", "public static void main(String[] args) throws IOException {\n\t\tin = new Scanner(System.in);\r\n\t\tString email = null;\r\n\t\tString password = null;\r\n\t\tSystem.out.println(\"Please enter your email: \");\r\n\t\temail = in.next();\r\n\t\t\r\n\t\tSystem.out.println(\"Please enter your password: \");\r\n\t\tpassword = in.next();\r\n\t\t\r\n\t\tString urlLink = \"http://localhost/java/java.php?email=\"+email+\"&password=\"+password;\r\n\t\tURL url = new URL(urlLink);\r\n\t\tHttpURLConnection conn = (HttpURLConnection)url.openConnection();\r\n\t\tconn.setRequestMethod(\"GET\");\r\n\t\t\r\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));\r\n\t\tStringBuffer sb = new StringBuffer();\r\n\t\tString line;\r\n\t\t\r\n\t\twhile ((line = in.readLine()) != null){\r\n\t\t\tsb.append(line);\r\n\t\t}\r\n\t\tin.close();\r\n\t\tSystem.out.println(sb.toString());\r\n\t\t\r\n\t}", "private void aplicarTextPrompt() {\n TextPrompt textPrompt = new TextPrompt(\"jdbc:mysql://localhost:3306/mydb\", urlJTF);\n TextPrompt textPrompt1 = new TextPrompt(\"root\", usernameJTF);\n TextPrompt textPrompt2 = new TextPrompt(\"*********\", passwordJPF);\n }", "public DateClient(String serverName, int portNumber) {\n try {\n socket = new Socket(serverName, portNumber);\n stdIn = new BufferedReader (new InputStreamReader(System.in));\n socketIn = new BufferedReader (new InputStreamReader (socket.getInputStream()));\n socketOut = new PrintWriter (socket.getOutputStream(), true);\n }catch (UnknownHostException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void connect(String ipAddr) {\n try {\n // Connect to specified Pi\n telnet.connect(ipAddr, usrID, passwrd);\n // Get input and output stream references\n in = telnet.getInputStream();\n out = new PrintStream(telnet.getOutputStream());\n // Log the user in\n readUntil(\"login: \");\n write(usrID);\n readUntil(\"Password: \");\n write(passwrd);\n // Advance to a prompt\n readUntil(prompt + \" \");\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public static void main(String[] args) {\n\t\tSocket socket = null;\r\n\t\ttry {\r\n\t\t\tsocket = new Socket(\"localhost\", 18094);\r\n\t\t\tSystem.out.println(\"------客户端连接上了-------\");\r\n\t\t\t// socket.connect(new InetSocketAddress(), 1000);\r\n\t\t\tOutputStream out = socket.getOutputStream();\r\n\r\n\t\t\tScanner sc = new Scanner(System.in);\r\n\r\n\t\t\tString data = sc.next() + \"\\n\";\r\n\t\t\tSystem.out.println(data);\r\n\t\t\tout.write(data.getBytes(\"UTF-8\"));\r\n\t\t\tout.flush();\r\n\t\t\tsocket.shutdownOutput();\r\n\r\n\t\t\tInputStream is = socket.getInputStream();\r\n\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(is, \"UTF-8\"));\r\n\t\t\tString str = \"\";\r\n\t\t\twhile ((str = reader.readLine()) != null) {\r\n\t\t\t\tSystem.out.println(\"客户端接收服务端的数据:\" + str);\r\n\t\t\t}\r\n\r\n\t\t\treader.close();\r\n\t\t\t// is.close();\r\n\t\t\tif(!socket.isClosed()){\r\n\t\t\t\t//socket.shutdownInput();\r\n\t\t\t\tsocket.close();\r\n\t\t\t\t// out.close();\r\n\t\t\t}\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t}", "public CLI(BufferedReader in, Writer out) {\n\t\t_in = in;\n\t\t_out = out;\n\t}", "public void run() {\n try {\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n System.out.print(\"> \");\n String input = in.readLine();\n input = input.trim().toLowerCase();\n InetAddress dir;\n String arg;\n\n if (!input.isEmpty()) {\n char opcion = input.charAt(0);\n input = input.substring(1).trim();\n switch (opcion) {\n case 'c':\n arg = input.split(\"\\\\s+\")[0];\n maquinaCliente m;\n dir = InetAddress.getByName(arg);\n if (clientes.containsKey(dir.getHostAddress())) {\n m = clientes.get(dir.getHostAddress());\n if (m.verificarConexion()) {\n chequear_maquina(m);\n } else {\n Servidor.logger.log(Level.INFO, \"Se perdio conexion con {0}\", dir.getHostAddress());\n clientes.remove(dir.getHostAddress());\n }\n } else {\n System.out.println(\"Direccion de Host no registrada\");\n }\n break;\n\n case 'e': //cerrar conexion y salir\n Servidor.logger.log(Level.INFO, \"Conexion finalizada exitosamente\");\n active = false;\n break;\n case 't':\n this.verificarTodas();\n break;\n case 'a':\n arg = input.split(\"\\\\s+\")[0];\n dir = InetAddress.getByName(arg);\n if (clientes.containsKey(dir.getHostAddress())) {\n this.verificarActiva(dir.getHostAddress());\n } else {\n Servidor.logger.log(Level.INFO, \"Direccion de Host no registrada\");\n }\n break;\n case 'h': // imprimir ayuda\n System.out.println(\"AYUDA:\");\n System.out.println(\"c <host>: \\tPermite chequear el status del hosts con sus procesos asociados\");\n System.out.println(\"a <host>: \\tPermite verificar la conexion con un host en especifico\");\n System.out.println(\"p <host>: \\tPermite listar todos los procesos que corre un host en especifico\");\n System.out.println(\"t: \\t Permite verificar todas las conexiones con todos los host\");\n System.out.println(\"s: \\t Permite activar el modo de servidor de verificacion automatica\");\n System.out.println(\"e: \\t Cerrar la conexion.\");\n break;\n case 'l':\n Enumeration e = clientes.keys();\n if (e.hasMoreElements()) {\n while (e.hasMoreElements()) {\n System.out.println(\"Host \" + ((String) e.nextElement()));\n }\n } else {\n System.out.println(\"No hay host registrados.\");\n }\n break;\n case 'p':\n arg = input.split(\"\\\\s+\")[0];\n dir = InetAddress.getByName(arg);\n if (clientes.containsKey(dir.getHostAddress())) {\n listarProcesosCliente(dir.getHostAddress());\n } else {\n Servidor.logger.log(Level.INFO, \"Direccion de Host no registrada\");\n }\n break;\n case 's':\n activarModoServidor();\n break;\n default:\n System.out.println(\"Error Opcion invalida\");\n run();\n }\n } else {\n System.out.println(\"Error Opcion invalida\");\n run();\n }\n } catch (IOException ex) {\n System.out.println(\"Direccion de Host invalida\");\n run();\n }\n }", "private static String getUserInput(String prompt){ \r\n Scanner in = new Scanner(System.in);\r\n System.out.print(prompt);\r\n return in.nextLine();\r\n }", "@FXML\n\tprivate void connectEventHandler(ActionEvent event) {\n\t\tif (loggedInUser != null) {\n\t\t\talert(\"You are logged in!\");\n\t\t\treturn;\n\t\t}\n\t\tloggedInUser = model.logIn(userNameField.getText());\n\t\tif (loggedInUser == null) {\n\t\t\talert(\"Wrong user name!\");\n\t\t\treturn;\n\t\t}\n\t\t// Checking the password\n\t\tif (!loggedInUser.getPasswordHash().equals(hashPassword(passwordField.getText(), SALT))) {\n\t\t\talert(\"Wrong password!\");\n\t\t\tloggedInUser = null;\n\t\t\treturn;\n\t\t}\n//\t\tloggedInUser = new User(\"Bence\", \"\", KnowledgeLevel.EXPERT, 100, false);\n\t\t// Connection succeeded\n\t\tprintUserData();\n\t}", "public void talk() {\n\t try{\t\n\t \twhile(exit) {\n\t\t \t\t//Definizione stream per la comunicazione\n\t\t \t\ttastiera = new BufferedReader(new InputStreamReader(System.in));\n\t\t \t\tout = new DataOutputStream(connection.getOutputStream());\n\t\t\t\t in = new DataInputStream(connection.getInputStream());\n\t\t\t\t \n\t\t \t\t//Invio messaggio\n\t\t\t\t System.out.println(\"Inserisci il messaggio da mandare al server: \\n\");\n\t\t\t\t mess = tastiera.readLine();\n\t\t\t\t\tout.writeUTF(mess + \"\\n\");\n\t\t\t\t\t\n\t\t\t\t\t//Ricezione risposta server\n\t\t\t\t\tservermess = in.readUTF();\n\t\t\t System.out.println(\"Risposta dal server: \"+servermess);\n\t\t\t if(mess.equals(\"FINE\")) {\n\t\t\t \texit = false;\n\t\t\t }\n\t\t\t\t}\n\t\t }\n\t\t catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t }\n\t \tfinally {\n\t\t\t try {\n\t\t\t\t if (connection!=null)\n\t\t\t\t {\n\t\t\t\t connection.close();\n\t\t\t\t System.out.println(\"Connessione chiusa!\");\n\t\t\t\t }\n\t\t\t\t\t}\n\t\t\t catch(IOException e){\n\t\t\t System.err.println(\"Errore nella chiusura della connessione!\");\n\t\t\t }\n\t \t}\t\n \t}", "private void initNewConnect() {\r\n\t\tthis.newConnect = new JMenu(\"Connect To\");\r\n\t\t\r\n\t\t// textfield for ip address with keylistener\r\n\t\tJTextField ipAddress = new JTextField(\"000.000.0.000\");\r\n ipAddress.setPreferredSize(new Dimension(100,18));\r\n ipAddress.setMaximumSize(new Dimension(100,18));\r\n\t\tipAddress.addKeyListener(new KeyListener() {\r\n\t\t\tpublic void keyTyped(KeyEvent e) {}\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\r\n\t\t\t\tint key = e.getKeyCode();\r\n\t\t\t\tif(key == KeyEvent.VK_ENTER) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tactController.setRemoteIPadress(e);\r\n\t\t\t\t\t} catch (UnknownHostException e1) {\r\n\t\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tpublic void keyReleased(KeyEvent e) {}\r\n\t\t});\r\n\t\r\n\t\t// add textfield to newconnect\r\n newConnect.add(ipAddress);\r\n \r\n // add newconnect to option\r\n\t\tthis.option.add(newConnect);\r\n\t}", "private void signInRequest() {\n errorContainer.getChildren().clear();\n if (!validateForm()) {\n displayErrorMessages();\n } else {\n\n //update the UI to notify the user that the connection is in \n //progress.\n startWorkInProgress(\"Connecting\");\n\n final Runnable connectionRequestRunnable = new Runnable() {\n @Override\n public void run() {\n mConnectionRequestCommand.setLogin(userNameField.getText());\n mConnectionRequestCommand.setPassword(passwordField.getText());\n mConnectionRequestCommand.execute();\n }\n };\n new Thread(connectionRequestRunnable, \"Connection Request\").start();\n\n }\n }", "@UiHandler(\"go\")\n void connexion(ClickEvent e) {\n loginField.setFocus(false);\n passwordField.setFocus(false);\n domains.setFocus(false);\n\n String login = loginField.getText();\n String password = passwordField.getText();\n login(login, password, domains.getValue(domains.getSelectedIndex()));\n\n\n }", "@Override\r\n\tpublic void connect() {\n\t\tport=\"tastecard\";\r\n\t\tSystem.out.println(\"This is the implementation of db for the taste card\"+port);\r\n\t}", "StreamConnectionIO(Mux mux, OutputStream out, InputStream in) {\n\tsuper(mux);\n\tthis.out = out;\n//\tthis.out = new BufferedOutputStream(out);\n\tthis.in = in;\n\n\toutChannel = newChannel(out);\n\tinChannel = newChannel(in);\n sendQueue = new LinkedList<Buffer>();\n }", "public void startInfo() {\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"Enter your name:\");\n\t\tString name = this.getInputString();\n\t\tSystem.out.println(\"Enter your mobile number:\");\n\t\tint number = this.getInputInteger();\n\t\tSystem.out.println(\"Enter your email:\");\n\t\tString email = this.getInputString();\n\t}", "public static void main(String[] args) {//Èë¿Ú\n\t\tinitLog4j();\n\t\tlogger.info(\"Client launched successfully\");\n\t\t\n\n\t\t// Application logic\n\t\tApplicationLogic applicationLogic = new ApplicationLogic();\n\n\t\tsysReader = new BufferedReader(new InputStreamReader(System.in));\n\t\tString str = null;\n\t\twhile (true) {\n\t\t\tSystem.out.print(\"EchoClient> \");\n\t\t\t// Read from system input\n\t\t\ttry {\n\t\t\t\tstr = sysReader.readLine();\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.out.println(\"Failed to read from system input\");\n\t\t\t\tlogger.error(\"Failed to read from system input\");\n\t\t\t}\n\t\t\tif (!str.trim().equals(\"\")) {\n\t\t\t\t// Get command\n\t\t\t\tString[] token = str.split(\" \");\n\t\t\t\tString cmd = token[0];\n\t\t\t\t// Send\n\t\t\t\tif (cmd.equals(\"send\")) {\n\t\t\t\t\tString msg = str.substring(4, str.length()).trim();\n\t\t\t\t\tif (!msg.equals(\"\")) {\n\t\t\t\t\t\tapplicationLogic.send(msg);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// connect\n\t\t\t\telse if (cmd.equals(\"connect\")) {\n\t\t\t\t\tint length = token.length;\n\t\t\t\t\tif (length == 3) {\n\t\t\t\t\t\t// Get remote server address and port\n\t\t\t\t\t\tString add = token[1];\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tint port = Integer.parseInt(token[2]);\n\t\t\t\t\t\t\tString REMOTE_IP = add;\n\t\t\t\t\t\t\tint REMOTE_PORT = port;\n\t\t\t\t\t\t\tapplicationLogic.connect(REMOTE_IP, REMOTE_PORT);\n\t\t\t\t\t\t} catch (NumberFormatException e) {\n\t\t\t\t\t\t\tSystem.out.println(\"Illigal port format\");\n\t\t\t\t\t\t\tlogger.warn(\"Illigal port format\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Wrong format\n\t\t\t\t\telse {\n\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t.println(\"Connect command should be as follow:\\nconnect <address> <port>\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// disconnect\n\t\t\t\telse if (cmd.equals(\"disconnect\")) {\n\t\t\t\t\tapplicationLogic.disconnect();\n\t\t\t\t}\n\t\t\t\t// logLevel\n\t\t\t\telse if (cmd.equals(\"logLevel\")) {\n\t\t\t\t\tint length = token.length;\n\t\t\t\t\tif (length == 2) {\n\t\t\t\t\t\t// Get logLevel\n\t\t\t\t\t\tString logLevel = token[1];\n\t\t\t\t\t\tapplicationLogic.logLevel(logLevel);\n\t\t\t\t\t}\n\t\t\t\t\t// Wrong format\n\t\t\t\t\telse {\n\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t.println(\"logLevel command should be as follow:\\nlogLevel <Level> \");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// help\n\t\t\t\telse if (cmd.equals(\"help\")) {\n\t\t\t\t\tapplicationLogic.help();\n\t\t\t\t}\n\t\t\t\t// quit\n\t\t\t\telse if (cmd.equals(\"quit\")) {\n\t\t\t\t\tapplicationLogic.quit();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// other inputs\n\t\t\t\telse {\n\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t.println(\"Incorrect command, please try again or input 'help'\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public In(){\n\t\tscanner=new Scanner(new BufferedInputStream(System.in),CHARSET_NAME);\n\t\tscanner.useLocale(LOCALE);\n\t}", "public WriteToClient(Socket c) throws IOException { //initialize printwirte and scanner\r\n\t\ttoClient = new PrintWriter(c.getOutputStream());\r\n\t\tstdin = new Scanner(System.in);\r\n\t}", "Connection createConnection();", "@Override\r\n\tpublic void actionPerformed(ActionEvent e)\r\n\t{\r\n\t\t\r\n\r\n\t\t// Get input from GUI window\r\n\t\tString input = m_GUI.getInput();\r\n\r\n\t\tif (input.isEmpty())\r\n\t\t\treturn;\r\n\r\n\t\tString message = new String();\r\n\r\n\t\tif (input.startsWith(\"/\"))\r\n\t\t{\r\n\t\t\t// Input is a command\r\n\t\t\tString command = new String(input.split(\" \")[0].trim().toLowerCase());\r\n\r\n\t\t\tswitch (command)\r\n\t\t\t{\r\n\t\t\tcase \"/connect\":\r\n\t\t\tcase \"/c\":\r\n\t\t\t\tString hostname = input.split(\" \")[1];\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tm_connection.connect(hostname);\r\n\t\t\t\t} catch (IOException e1)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.err.println(\"Error: IO exception when conencting to server\");\r\n\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"/disconnect\":\r\n\t\t\tcase \"/dc\":\r\n\t\t\t\tm_connection.disconnect();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"/whisper\":\r\n\t\t\tcase \"/w\":\r\n\t\t\t\tString recepient = input.split(\" \")[1];\r\n\t\t\t\tmessage = input.split(\" \", 3)[2];\r\n\t\t\t\tm_connection.whisper(recepient, message);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"/list\":\r\n\t\t\tcase \"/l\":\r\n\t\t\t\tm_connection.list();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t} else\r\n\t\t{\r\n\t\t\t// Type is broadcast\r\n\t\t\tmessage = input;\r\n\t\t\tm_connection.broadcast(message);\r\n\t\t}\r\n\t\tm_GUI.clearInput();\r\n\t}", "public void run() {\n\t\t//if this is the server side, create a server socket\n\t\tif( parent.whichPlayer.equals(\"server\") ){\n\t\t\t//create serverSocket on port 1234\n\t\t\ttry {\n\t\t\t\tss = new ServerSocket(1234);\n\t\t\t\tsock = ss.accept();\n\t\t\t\tsc = new Scanner(sock.getInputStream());\n\t\t\t\tpw = new PrintWriter(sock.getOutputStream());\n\t\t\t}catch(Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\tSystem.out.println(\"Server Socket not able to be established on port 1234\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"Input stream created, waiting for input from foreign socket\");\n\t\t}\n\n\t\t//if this is the client side, create a normal socket\n\t\telse{\n\t\t\t//try to create a socket on 1234\n\t\t\ttry {\n\t\t\t\tsock = new Socket(parent.hostnameField.getText(),1234);//create a socket on the IP specified by the player in the hostname box\n\t\t\t\tsc = new Scanner( sock.getInputStream() );\n\t\t\t\tpw = new PrintWriter(sock.getOutputStream());\n\t\t\t}catch(Exception e) {\n\t\t\t\tSystem.out.println(\"Could not create connection on localhost\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\t\n\t\t\n\t\t//send a single line with name to other side\n\t\tpw.println(\"N \" + parent.myName);\n\t\tpw.flush();\n\t\t\n\t\t//read single line for name`\n\t\t//wait for input from client side\n\t\tString input = sc.nextLine();\n\t\tprocessInput(input);\n\t\tparent.displayInstruction.setText(\"Connection Established, It is \" + parent.playerOneTextField.getText() + \"'s turn\");\n\t\tparent.beginGame = true;\n\t\t\n\t\t//loop and continue to read from the other side\n\t\twhile( sc.hasNextLine() ) {\n\t\t\tinput = sc.nextLine();\n\t\t\tSystem.out.println(\"Read \" + input + \" from the client side\");\n\t\t\tprocessInput(input);\n\t\t}\n\t\t\n\t\t//close all of the scanners and sockets\n\t\t//This should already be handled by the quit button, but in case the player just exits the window\n\t\ttry {\n\t\t\tsock.close();\n\t\t\tpw.close();\n\t\t\tss.close();\n\t\t\tsc.close();\n\t\t}catch(Exception e) {\n\t\t\tSystem.out.println(\"Could not close the sockets/scanner\");\n\t\t}\n\t\t\n\t\tSystem.out.println(\"All sockets and scanners successfully closed\");\n\t\tparent.displayInstruction.setText(\"Connect Lost, Ending Gamplay\");\n\t\tparent.beginGame = false;\n\t\t\n\t}", "private void establishConnection() throws IOException {\n\t\tthis.inReader = new BufferedReader(new InputStreamReader(this.conn.getInputStream()));\n\t\tthis.outWriter = new BufferedWriter(new OutputStreamWriter(this.conn.getOutputStream()));\n\t}", "InOut createInOut();", "public void connectDB() {\n\t\tSystem.out.println(\"CONNECTING TO DB\");\n\t\tSystem.out.print(\"Username: \");\n\t\tusername = scan.nextLine();\n\t\tConsole console = System.console(); // Hides password input in console\n\t\tpassword = new String(console.readPassword(\"Password: \"));\n\t\ttry {\n\t\t\tDriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());\n\t\t\tconnection = DriverManager.getConnection(url, username, password);\n\t\t} catch(Exception Ex) {\n\t\t\tSystem.out.println(\"Error connecting to database. Machine Error: \" + Ex.toString());\n\t\t\tEx.printStackTrace();\n\t\t\tSystem.out.println(\"\\nCONNECTION IS REQUIRED: EXITING\");\n\t\t\tSystem.exit(0); // No need to make sure connection is closed since it wasn't made\n\t\t}\n\t}" ]
[ "0.6494472", "0.6001148", "0.5955425", "0.5927752", "0.58031774", "0.5799444", "0.5798513", "0.5750304", "0.57372016", "0.5705976", "0.5664163", "0.5664163", "0.5664163", "0.5660216", "0.5631027", "0.56241256", "0.5620973", "0.5610405", "0.5582297", "0.5571822", "0.5564951", "0.55636024", "0.55603427", "0.55516213", "0.55401003", "0.55377597", "0.5533143", "0.5530021", "0.55035794", "0.5500053", "0.5490656", "0.5487486", "0.5472677", "0.5461327", "0.54474694", "0.5419327", "0.5416353", "0.5412126", "0.5410695", "0.5406263", "0.5401144", "0.54010195", "0.5398785", "0.53935504", "0.5392046", "0.5378775", "0.5373753", "0.5373025", "0.53704464", "0.53690976", "0.5368268", "0.5365197", "0.53610533", "0.5348117", "0.53475046", "0.5344287", "0.5342747", "0.53370917", "0.53163886", "0.5316239", "0.5315705", "0.53151697", "0.5314706", "0.5314265", "0.53105026", "0.53105026", "0.5308961", "0.53074116", "0.5306119", "0.53020686", "0.52912724", "0.52780056", "0.52735025", "0.5268923", "0.5266412", "0.5250254", "0.5249562", "0.5247466", "0.5245738", "0.5245117", "0.52380776", "0.52309537", "0.522687", "0.52213776", "0.52181035", "0.52127564", "0.5209053", "0.5207013", "0.52061826", "0.5202219", "0.519617", "0.519131", "0.51904476", "0.5181813", "0.51804245", "0.5176955", "0.5172863", "0.5171825", "0.5167451", "0.51662195", "0.516363" ]
0.0
-1
When: A todo is deleted from the todolist Then: The response should be correct
@Test @Sql({"classpath:sql/truncate.sql", "classpath:/sql/single_todolist_with_two_todos.sql"}) public void shouldDeleteTodoFromTodoList() { ApiTodoList todoList = given() .standaloneSetup(controller, apiControllerAdvice) .spec(RequestSpecification.SPEC) .delete("/todolists/1/todos/2") .then() .statusCode(HttpStatus.NO_CONTENT.value()) .extract() .as(ApiTodoList.class); // And: The returned todolist should only contain the correct todo assertThat(todoList.getItems().size()).isEqualTo(1); assertThat(todoList.getItems().get(0).getText()).isEqualTo("Existing Todo 1"); // And: The todolist should only contain one todo in the db doInJPA(this::getEntityManagerFactory, em -> { TodoList todoListInDb = em.find(TodoList.class, 1L); assertThat(todoListInDb.getItems().size()).isEqualTo(1); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void test_03() {\n\n\t\tResponse reponse = given().\n\t\t\t\twhen().\n\t\t\t\tdelete(\"http://localhost:3000/posts/_3cYk0W\");\n\n\t\tSystem.out.println(\"updated response data \"+ reponse.asString());\t\t\n\t}", "@Test\n public void testDelete() throws Exception {\n // pretend the entity was deleted\n doNothing().when(Service).deleteCitation(any(String.class));\n\n // call delete\n ModelAndView mav = Controller.delete(\"\");\n\n // test to see that the correct view is returned\n Assert.assertEquals(\"result\", mav.getViewName());\n\n // test to see that Json is formated properly\n Map<String, Object> map = mav.getModel();\n String result = (String) map.get(\"message\");\n\n Assert.assertEquals(\"{\\\"result\\\":\\\"deleted\\\"}\", result);\n }", "@Test\n public void delete01() {\n Response responseGet = given().\n spec(spec03).\n when().\n get(\"/3\");\n responseGet.prettyPrint();\n\n Response responseDel = given().\n spec(spec03).\n when().\n delete(\"/3\");\n responseDel.prettyPrint();\n\n\n // responseDel yazdirildiginda not found cevabi gelirse status code 404 ile test edilir.\n // Eger bos bir satir donerse status code 200 ile test edilir.\n\n responseDel.\n then().\n statusCode(200);\n\n\n // hard assert\n\n assertTrue(responseDel.getBody().asString().contains(\" \"));\n\n // soft assertion\n\n SoftAssert softAssert = new SoftAssert();\n softAssert.assertTrue(responseDel.getBody().asString().contains(\" \"));\n softAssert.assertAll();\n }", "@Test\n public void delete01(){\n Response responseGet=given().\n spec(spec03).\n when().\n get(\"/198\");\n responseGet.prettyPrint();\n //delete islemi\n Response responseDel =given().\n spec(spec03).\n when().\n delete(\"/198\");\n responseDel.prettyPrint();\n //responseDel yazdirildiginda \"Not Found\" cevabi gelirse status code 404 ile test edilir. Eger bos bir\n // satir donerse Ststus code 200 ile test edilir.\n responseDel.then().assertThat().statusCode(200);\n // Hard assert\n assertTrue(responseDel.getBody().asString().contains(\"\"));\n //softAssertion\n SoftAssert softAssert = new SoftAssert();\n softAssert.assertTrue(responseDel.getBody().asString().contains(\"\"));\n softAssert.assertAll();\n\n\n }", "@Test\n void shouldDeleteTask() throws Exception {\n mockMvc\n .perform(MockMvcRequestBuilders\n .delete(\"/v1/task/{id}\", 123))\n .andExpect(MockMvcResultMatchers.status().is(200));\n }", "@Test\n public void deleteOrderTest() {\n Long orderId = 10L;\n api.deleteOrder(orderId);\n\n verify(exactly(1), deleteRequestedFor(urlEqualTo(\"/store/order/10\")));\n }", "public void testDelete() {\n TDelete_Return[] PriceLists_delete_out = priceListService.delete(new String[] { path + alias });\n\n // test if deletion was successful\n assertEquals(\"delete result set\", 1, PriceLists_delete_out.length);\n\n TDelete_Return PriceList_delete_out = PriceLists_delete_out[0];\n\n assertNoError(PriceList_delete_out.getError());\n\n assertEquals(\"deleted?\", true, PriceList_delete_out.getDeleted());\n }", "@Test\n void deleteNoteSuccess() {\n noteDao.delete(noteDao.getById(2));\n assertNull(noteDao.getById(2));\n }", "@Test\n public void deleteTest(){\n given().pathParam(\"id\",1)\n .when().delete(\"/posts/{id}\")\n .then().statusCode(200);\n }", "public void delete(T ob) throws ToDoListException;", "@After(value = \"@deleteList\", order = 1)\n public void deleteList() {\n String listId = context.getDataCollection((\"list\")).get(\"id\");\n context.setRequestSpec(AuthenticationUtils.getLoggedReqSpec());\n given(context.getRequestSpecification()).when().delete(\"/lists/\".concat(listId));\n }", "@Test\n void deleteTest() {\n URI uri = URI.create(endBody + \"/delete\");\n\n // get the response\n HttpResponse<String> response = HttpMethods.delete(uri);\n\n assertEquals(200, response.statusCode());\n }", "public void verifyToDoDeteteBackend(String engagementField, String engagementValue, String todoName, String status) throws SyncFactoryException {\n try {\n getLogger().info(\"Verify To-Do delete status on database.\");\n JSONObject jsonObject = MongoDBService.getToDoObject(getEngagementCollection(), engagementField, engagementValue, todoName);\n System.out.println(\"+++++++++++++++++++++++++++++++++++++++++++jsonObject = \" + jsonObject.get(\"status\"));\n //TODO get from properties file\n if (jsonObject.get(\"status\").toString().equals(status)) {\n NXGReports.addStep(\"Verify To-Do delete status on database.\", LogAs.PASSED, null);\n } else {\n AbstractService.sStatusCnt++;\n NXGReports\n .addStep(\"Verify To-Do delete status on database.\", LogAs.FAILED, new CaptureScreen(CaptureScreen.ScreenshotOf.BROWSER_PAGE));\n }\n } catch (Exception ex) {\n NXGReports.addStep(\"Verify To-Do delete status on database.\", LogAs.FAILED, new CaptureScreen(CaptureScreen.ScreenshotOf.BROWSER_PAGE));\n ex.printStackTrace();\n }\n }", "@Override\n @Modifying\n public ResponseEntity<GenericResponseDTO> deleteTask(String codeTask) {\n Optional<TaskEntity> oldTask;\n try{\n oldTask = taskRepository.findByCodeTask(codeTask);\n if(oldTask.isPresent()){\n taskRepository.delete(oldTask.get());\n return new ResponseEntity<>(GenericResponseDTO.builder()\n .message(\"tarea eliminada\")\n .objectResponse(codeTask)\n .statusCode(HttpStatus.OK.value())\n .build(), HttpStatus.OK);\n }else{\n return new ResponseEntity<>(GenericResponseDTO.builder()\n .message(\"No se pudo eliminar la tarea\")\n .objectResponse(codeTask)\n .statusCode(HttpStatus.OK.value())\n .build(), HttpStatus.OK);\n }\n }catch (Exception e){\n log.error(\"Algo fallo en la creacion de la tarea \" + e);\n return new ResponseEntity<>(GenericResponseDTO.builder()\n .message(\"Error eliminando tarea: \" + e.getMessage())\n .objectResponse(null)\n .statusCode(HttpStatus.BAD_REQUEST.value())\n .build(), HttpStatus.BAD_REQUEST);\n }\n }", "@Test\n public void givenStatus_whenDeleteByEntity_ThenReturnStatus() {\n ThreeEntity entity = new ThreeEntity(1,1,1);\n\n given(threeDao.delete(entity)).willReturn(Status.OK);\n\n StatusEntity status = threeService.delete(entity);\n\n assertEquals(Status.OK.getName(), status.getStatus());\n }", "@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}", "@Override\n\tpublic ResultWrapper<Boolean> delete(Integer todoId) {\n\t\tResultWrapper<Boolean> rs = new ResultWrapper<Boolean>();\n\t\tif (todoId <= 0 || todoId == null) {\n\t\t\trs.error(false, \"Id Should be greater than 0 or can not be null\");\n\t\t} else {\n\t\t\ttry {\n\t\t\t\ttodosRepo.deleteById(todoId);\n\t\t\t\trs.succeedDeleted(true);\n\n\t\t\t} catch (Exception e) {\n\t\t\t\trs.fail(false, \" Exception Occurs \"+e);\n\t\t\t\treturn rs;\n\t\t\t}\n\n\t\t}\n\t\treturn rs;\n\n\t}", "@Test\n final void testDeleteDevice() {\n when(deviceDao.deleteDevice(user, DeviceFixture.SERIAL_NUMBER)).thenReturn(Long.valueOf(1));\n ResponseEntity<String> response = deviceController.deleteDevice(DeviceFixture.SERIAL_NUMBER);\n assertEquals(200, response.getStatusCodeValue());\n assertEquals(\"Device with serial number 1 deleted\", response.getBody());\n }", "@Test\n void deleteSuccess() {\n dao.delete(dao.getById(3));\n assertNull(dao.getById(3));\n }", "int deleteByExample(StatusRepliesExample example);", "@Test\r\n\tpublic void testDelete() {\n\t\tint todos = modelo.getAll().size();\r\n\r\n\t\tassertTrue(modelo.delete(1));\r\n\r\n\t\t// comprobar que este borrado\r\n\t\tassertNull(modelo.getById(1));\r\n\r\n\t\t// borrar un registro que no existe\r\n\t\tassertFalse(modelo.delete(13));\r\n\t\tassertNull(modelo.getById(13));\r\n\r\n\t\tassertEquals(\"debemos tener un registro menos\", (todos - 1), modelo\r\n\t\t\t\t.getAll().size());\r\n\r\n\t}", "@Test\n void deleteSuccess() {\n dao.delete(dao.getById(2));\n assertNull(dao.getById(2));\n }", "@Test\n\tpublic void test_delete_user_success(){\n template.delete(REST_SERVICE_URI + \"/\" + getLastUser().getId() + ACCESS_TOKEN + token);\n }", "public void deleteRequest() {\n assertTrue(true);\n }", "@Test\n void deleteSuccess() {\n\n UserDOA userDao = new UserDOA();\n User user = userDao.getById(1);\n String orderDescription = \"February Large Test-Tshirt Delete\";\n\n Order newOrder = new Order(orderDescription, user, \"February\");\n user.addOrder(newOrder);\n\n dao.delete(newOrder);\n List<Order> orders = dao.getByPropertyLike(\"description\", \"February Large Test-Tshirt Delete\");\n assertEquals(0, orders.size());\n }", "@Test\r\n\tvoid testDeleteToDoItem() {\r\n\t\tSortedList list = new SortedList(\"List\");\r\n\r\n\t\t// case 1: deleting one item from a one-item list\r\n\t\tlist.insert(toDoItem1);\r\n\t\tlist.remove(\"Item 1\");\r\n\t\tif (list.getSize() != 0 || list.getHead() != null) {\r\n\t\t\tfail(\"Removed a single item from a size 1 list incorrectly\");\r\n\t\t}\r\n\r\n\t\t// case 2: deleting one item from a two-item list\r\n\t\tlist.insert(toDoItem1);\r\n\t\tlist.insert(toDoItem2);\r\n\t\tlist.remove(\"Item 2\");\r\n\t\tif (list.getSize() != 1) {\r\n\t\t\tfail(\"Incorrect size: should be 1\");\r\n\t\t}\r\n\t\tif (!list.getHead().getName().equals(\"Item 1\")) {\r\n\t\t\tfail(\"Head set incorrectly: should be \\\"Item 1\\\"\");\r\n\t\t}\r\n\t\tif (list.getHead().getNext() != null) {\r\n\t\t\tfail(\"The next item for head was set incorrectly\");\r\n\t\t}\r\n\r\n\t\tlist.clear();\r\n\r\n\t\t// case 3: adding several items and removing multiple\r\n\t\tlist.insert(toDoItem1);\r\n\t\tlist.insert(toDoItem2);\r\n\t\tlist.insert(toDoItem3);\r\n\t\tlist.insert(toDoItem4);\r\n\t\tlist.insert(toDoItem5);\r\n\t\tlist.insert(toDoItem6);\r\n\t\tlist.remove(\"Item 1\");\r\n\t\tlist.remove(\"Item 6\");\r\n\t\tlist.remove(\"Item 4\");\r\n\r\n\t\tToDoItem tempHead = list.getHead();\r\n\t\tString currList = \"|\";\r\n\t\tString correctList = \"|Item 2|Item 3|Item 5|\";\r\n\r\n\t\twhile (tempHead != null) {\r\n\t\t\tcurrList += tempHead.getName() + \"|\";\r\n\t\t\ttempHead = tempHead.getNext();\r\n\t\t}\r\n\t\tif (!currList.equals(correctList)) {\r\n\t\t\tfail(\"The list was ordered incorrectly after inserting and deleting the case 3 items\");\r\n\t\t}\r\n\t}", "public void verifyTodoDeletedFrontend(String toDoName, String status) {\n try {\n getLogger().info(\"Verify a Todo not exist. Name: \" + toDoName);\n //Thread.sleep(smallTimeOut);\n //TODO move xpath to properties file, very low peformance\n getDriver().findElement(By.xpath(\"//input[@class='newTodoInput'][@value='\" + toDoName + \"']\"));\n if (status.equals(\"INACTIVE\")) {\n AbstractService.sStatusCnt++;\n NXGReports.addStep(\"Verify a Todo not exist. Name: \" + toDoName, LogAs.FAILED,\n new CaptureScreen(CaptureScreen.ScreenshotOf.BROWSER_PAGE));\n } else {\n NXGReports.addStep(\"Verify a Todo exist. Name: \" + toDoName, LogAs.PASSED, null);\n }\n } catch (NoSuchElementException ex) {\n getLogger().info(ex);\n AbstractService.sStatusCnt++;\n if (status.equals(\"INACTIVE\")) {\n NXGReports.addStep(\"Verify a Todo not exist. Name: \" + toDoName, LogAs.PASSED, null);\n } else {\n AbstractService.sStatusCnt++;\n NXGReports\n .addStep(\"Verify a Todo exist. Name: \" + toDoName, LogAs.FAILED, new CaptureScreen(CaptureScreen.ScreenshotOf.BROWSER_PAGE));\n }\n } catch (Exception ex) {\n getLogger().info(ex.getStackTrace());\n }\n }", "@Test\n @OperateOnDeployment(\"server\")\n public void shouldDeleteResourcesByIds() {\n given().header(\"Authorization\", \"Bearer access_token\").expect().statusCode(200).when().delete(\n getBaseTestUrl() + \"/1/tags/delete/json/ids;1;3;\");\n // Then then the resources should be deleted\n given().header(\"Authorization\", \"Bearer access_token\").expect().body(\"size\", equalTo(1)).and().expect().body(\"items.item.name\",\n hasItem(\"Concept\")).and().expect().body(\"items.item.name\", not(hasItem(\"Task\"))).and().expect().body(\"items.item.name\",\n not(hasItem(\"Reference\"))).when().get(getBaseTestUrl() + \"/1/tags/get/json/all?expand=\" +\n \"{\\\"branches\\\":[{\\\"trunk\\\":{\\\"name\\\":\\\"tags\\\"}}]})\");\n }", "@Test\n public void testDeleteTravel() throws Exception{\n \n doNothing().when(databaseMock).deleteTravel(anyInt());\n \n mockMVC.perform(delete(\"/user/1/travel/1\")\n .header(\"Authorization\", \"1\"))\n .andExpect(status().isNoContent());\n \n verify(databaseMock, times(1)).getUser(1);\n verify(databaseMock, times(1)).deleteTravel(1);\n verifyNoMoreInteractions(databaseMock);\n }", "@Test\n public void deleteId() throws Exception {\n Role role = create(new Role(\"roleName\"));\n\n //Attempt to remove from the database with delete request\n try {\n mvc.perform(MockMvcRequestBuilders.delete(\"/auth/roles/{id}\", UUIDUtil.UUIDToNumberString(role.getUuid()))\n .header(\"Authorization\", authPair[0])\n .header(\"Function\", authPair[1])\n )\n .andExpect(status().isOk());\n } catch (Exception e) {\n remove(role.getUuid());\n throw e;\n }\n\n //Check if successfully removed from database\n try {\n //Remove from database (above get function should have thrown an error if the object was no longer in the database)\n remove(role.getUuid());\n fail(\"DELETE request did not succesfully delete the object from the database\");\n } catch (ObjectNotFoundException e) {\n //Nothing because the object is no longer present in the database which is expected\n }\n }", "int deleteByExample(ComplainNoteDOExample example);", "@Test\n public void testDeleteDietStatus() throws Exception{\n \tString URI = \"/healthreminder/delete_dietstatus_by_id/{patientId}\"; \n \tFollowUpDietStatusInfo followUpDietStatusInfo = new FollowUpDietStatusInfo();\n followUpDietStatusInfo.setPatientId(1);\n followUpDietStatusInfo.setDietStatus(true);\n\n Mockito.when(followUpDietStatusInfoServices.findDietStatusById(Mockito.anyInt())).thenReturn(followUpDietStatusInfo);\n Mockito.when(followUpDietStatusInfoServices.deleteDietStatus(Mockito.any())).thenReturn(true);\n MvcResult mvcResult = this.mockMvc.perform(MockMvcRequestBuilders.delete(URI,1).accept(MediaType.\n \t\tAPPLICATION_JSON)).andReturn();\n MockHttpServletResponse mockHttpServletResponse = mvcResult.getResponse();\n\n Assert.assertEquals(HttpStatus.OK.value(), mockHttpServletResponse.getStatus());\n\n }", "public DeleteItemOutcome deleteItem(DeleteItemSpec spec);", "@Test\n public void test_checkin_delete() throws OAuthUnauthorizedException {\n Response response1 = getTrakt().checkin().deleteActiveCheckin();\n assertThat(response1.getStatus()).isEqualTo(204);\n }", "@Test (groups = \"create_post\")\n public void LTest_Delete_Post_success(){\n\n System.out.println(\"Delete PostID# \"+ createdPost);\n System.out.println(\"Request to: \" + resourcePath + \"/\" + createdPost);\n\n given()\n .spec(RequestSpecs.generateToken())\n //.body(testPost)\n .when()\n .delete(resourcePath + \"/\" + createdPost)\n .then()\n .body(\"message\", equalTo(\"Post deleted\"))\n .and()\n .statusCode(200)\n .spec(ResponseSpecs.defaultSpec());\n }", "@org.junit.Test\r\n public void testDelete() {\r\n System.out.println(\"delete\");\r\n String emailid = \"dnv3@gmail.com\";\r\n ContactDao instance = new ContactDao();\r\n List<ContactResponse> expResult = new ArrayList<ContactResponse>();\r\n ContactResponse c = new ContactResponse(\"Contact Deleted\");\r\n expResult.add(c);\r\n List<ContactResponse> result = instance.delete(emailid);\r\n String s=\"No such contact ID found\";\r\n if(!result.get(0).getMessage().equals(s))\r\n assertEquals(expResult.get(0).getMessage(), result.get(0).getMessage());\r\n // TODO review the generated test code and remove the default call to fail.\r\n }", "int deleteByExample(TaskExample example);", "@Test\n void deleteSuccess() {\n genericDao.delete(genericDao.getById(3));\n assertNull(genericDao.getById(3));\n }", "@Test\n public void testDeleteShoppinglistsIdAction() throws ClientException, IOException, ProcessingException {\n CloudResponse response = this.actions.deleteShoppinglistsIdAction(\"{id}\");\n List<Integer> expectedResults = Arrays.asList(204, 400, 403, 404);\n LOG.info(\"Got status {}\", response.getStatusLine());\n Assert.assertTrue(expectedResults.contains(response.getStatusLine().getStatusCode()));\n\n if(response.getStatusLine().getStatusCode() == 400) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 403) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 404) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n \n }", "@Test\n public void testDeleteTravel_RecordNotFoundExceptionDeleteTravel() throws Exception {\n doThrow(new RecordNotFoundException()).when(databaseMock).deleteTravel(anyInt());\n \n mockMVC.perform(delete(\"/user/1/travel/1\")\n .header(\"Authorization\", \"1\"))\n .andExpect(status().isNotFound());\n \n verify(databaseMock, times(1)).getUser(anyInt());\n verify(databaseMock, times(1)).deleteTravel(anyInt());\n verifyNoMoreInteractions(databaseMock);\n }", "@DeleteMapping(\"/tasks/{id}\")\n public ResponseEntity<Map<String,Boolean>> deleteTask(@PathVariable Long id){\n Task task = taskRepository.findById(id)\n .orElseThrow(() -> new ResourceNotFoundException(\"Task not found with Id of \" + id));\n\n taskRepository.delete(task);\n Map<String,Boolean> response = new HashMap<>();\n response.put(\"deleted\", Boolean.TRUE);\n return ResponseEntity.ok(response);\n }", "@PreAuthorize(\"hasRole('ADMIN') or hasRole('DBA')\")\n\t@DeleteMapping(value=\"/delete/{taskId}\",produces= { MediaType.APPLICATION_JSON_VALUE })\n\tpublic StatusDTO deleteTask(@PathVariable(\"taskId\") Integer taskId)\n\t{\n\t\ttaskService.deleteTask(taskId);\n\t\tStatusDTO status = new StatusDTO();\n\t\tstatus.setMessage(\"Task Status deleted successfully\");\n\t\tstatus.setStatus(200);\n\t\treturn status;\n\t}", "@GetMapping(\"/deleteItem\")\n\tpublic String deleteItem(HttpServletRequest servletRequest) {\n\t\t\n\t\ttoDoListService.deleteById(Long.parseLong(servletRequest.getParameter(\"itemId\"))); // Delete the to do list item record.\n\t\t\n\t\treturn \"redirect:/welcome\";\n\t}", "@Test\n\tvoid deleteDoctorTest() throws Exception {\n\t\tList<DoctorDetail> doctorDetail = new ArrayList<>();\n\t\tDoctorDetail doctorfind = new DoctorDetail();\n\t\tdoctorfind.setId(\"1\");\n\t\tdoReturn(doctorDetail).when(doctorServiceImplementation).deleteDoctorService(doctorfind.getId());\n\t\tmockMvc.perform(get(\"/doctor/delete?id=/{id}\", 1L)).andExpect(status().isOk());\n\t}", "boolean deleteMyNote(MyNoteDto usernote);", "@Test\n public void givenStatus_whenDeleteById_ThenReturnStatus() {\n int id = 1;\n\n given(threeDao.deleteById(1)).willReturn(Status.OK);\n\n StatusEntity status = threeService.deleteById(id);\n\n assertEquals(Status.OK.getName(), status.getStatus());\n }", "public boolean delete(Reminder reminder);", "public abstract Response delete(Request request, Response response);", "@Test\n public void myMetingList_deleteAction_shouldRemoveItem() {\n // Given : We remove the element at position 1\n onView(ViewMatchers.withId(R.id.recyclerview)).check(withItemCount(ITEMS_COUNT));\n // When perform a click on a delete icon\n onView(ViewMatchers.withId(R.id.recyclerview))\n .perform(RecyclerViewActions.actionOnItemAtPosition(1, new DeleteViewAction()));\n // Then : the number of element is 1\n onView(ViewMatchers.withId(R.id.recyclerview)).check(withItemCount(ITEMS_COUNT-1));\n }", "@Test\n public void testDeleteShoppinglistsIdEntriesEntryIdAction() throws ClientException, IOException, ProcessingException {\n CloudResponse response = this.actions.deleteShoppinglistsIdEntriesEntryIdAction(\"{id}\", \"{entryId}\");\n List<Integer> expectedResults = Arrays.asList(204, 400, 403, 404);\n LOG.info(\"Got status {}\", response.getStatusLine());\n Assert.assertTrue(expectedResults.contains(response.getStatusLine().getStatusCode()));\n\n if(response.getStatusLine().getStatusCode() == 400) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 403) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 404) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n \n }", "@Test\n public void testDeleteItem() throws Exception {\n\n Tracker tracker = new Tracker();\n\n String action = \"0\";\n String yes = \"y\";\n String no = \"n\";\n\n // add first item\n\n String name1 = \"task1\";\n String desc1 = \"desc1\";\n String create1 = \"3724\";\n\n Input input1 = new StubInput(new String[]{action, name1, desc1, create1, yes});\n new StartUI(input1).init(tracker);\n\n // add second item\n\n String name2 = \"task2\";\n String desc2 = \"desc2\";\n String create2 = \"97689\";\n\n Input input2 = new StubInput(new String[]{action, name2, desc2, create2, yes});\n new StartUI(input2).init(tracker);\n\n // get first item id\n\n String id = \"\";\n\n Filter filter = new FilterByName(name1);\n Item[] result = tracker.findBy(filter);\n for (Item item : result) {\n if (item !=null && item.getName().equals(name1)) {\n id = item.getId();\n break;\n }\n }\n\n // delete first item\n\n String action2 = \"2\";\n\n Input input3 = new StubInput(new String[]{action2, id, yes});\n new StartUI(input3).init(tracker);\n\n Assert.assertNull(tracker.findById(id));\n }", "@Test\n\tpublic void testDeleteExistedRecipe() {\n\t\twhen(mockCoffeeMaker.getRecipes()).thenReturn(recipeList);\n\t\tassertEquals(\"Coffee\", mockCoffeeMaker.deleteRecipe(0));\n\t}", "@Test\n void deleteSuccess() {\n genericDAO.delete(genericDAO.getByID(2));\n assertNull(genericDAO.getByID(2));\n }", "void afterDelete(T resource);", "@Test\n public void shouldDeleteClient() throws Exception {\n mockMvc.perform(delete(\"/v1/clients/1\")\n .contentType(MediaType.APPLICATION_JSON)\n .accept(MediaType.APPLICATION_JSON))\n .andExpect(status().isOk());\n verify(clientFacade, times(1)).deletedById(any());\n }", "@Test\n\tpublic void testDeleteTask1() {\n\t\tString label = testData.getCurrLabel();\n\t\ttestData.addTask(new Task(1, label , \"Task 1\",\n\t\t\t\tnew TDTDateAndTime(), false));\n\t\ttestData.addTask(new Task(2, label, \"Task 2\",\n\t\t\t\tnew TDTDateAndTime(), false));\n\t\ttestData.addTask(new Task(3, label, \"Task 3\",\n\t\t\t\tnew TDTDateAndTime(), false));\n\t\t\n\t\tDeleteCommand comd = new DeleteCommand(\"\", 2);\n\t\tassertEquals(DeleteCommand.MESSAGE_DELETE_TASK, comd.execute(testData));\n\t\t\n\t\tArrayList<Task> taskList = testData.getTaskListFromLabel(label);\n\t\tassertEquals(2, taskList.size());\n\t\tassertTrue(taskList.get(0).getDetails().equals(\"Task 1\"));\n\t\tassertTrue(taskList.get(1).getDetails().equals(\"Task 3\"));\n\t}", "@Test\r\n\tpublic void deleteProductDetails() {\r\n\t\tRestAssured.baseURI = \"http://localhost:9000/products\";\r\n\t\tRequestSpecification request = RestAssured.given();\r\n\t\tJSONObject requestParams = new JSONObject();\r\n\t\trequestParams.put(\"name\", \"Almond\");\r\n\t\trequest.header(\"Content-Type\", \"application/json\");\r\n\t\trequest.body(requestParams.toString());\r\n\t\tResponse response = request.delete(\"/7\");\r\n\t\tSystem.out.println(\"DELETE Responce Body ----->\" + response.asString());\r\n\t\tint statusCode = response.getStatusCode();\r\n\t\tAssert.assertEquals(statusCode, 200);\r\n\r\n\t}", "@Test\n\tpublic void deleteBook() {\n\t\tRestAssured.baseURI = \"http://216.10.245.166\";\n\t\t given().log().all().queryParam(\"ID\", \"321wergt\")\n\t\t\t\t.header(\"Content-Type\", \"application/json\").when()\n\t\t\t\t.delete(\"/Library/DeleteBook.php\").then().log().all()\n\t\t\t\t.assertThat().statusCode(200);\n\n\t\n\t /*JsonPath js = new JsonPath(response); \n\t String id = js.get(\"ID\");\n\t System.out.println(id);*/\n\t \n\t }", "@Test\n public void deleteDoctor() {\n\t\tList<Doctor> doctors = drepository.findByName(\"Katri Halonen\");\n\t\tassertThat(doctors).hasSize(1);\n \tdrepository.deleteById((long) 3);\n \tdoctors = drepository.findByName(\"Katri Halonen\");\n \tassertThat(doctors).hasSize(0);\n }", "@Test\r\n\tpublic void testDeleteNotes2(){\r\n\t\tNoteDao dao=ac.getBean(\"noteDao\",NoteDao.class);\r\n\t\tList<String> list= \r\n\t\t\tnew ArrayList<String>();\r\n\t\tlist.add(\"84b2d98b-af39-4655-8aa8-d8869d043cca\");\r\n\t\tlist.add(\"c347f832-e2b2-4cb7-af6f-6710241bcdf6\");\r\n\t\tlist.add(\"07305c91-d9fa-420d-af09-c3ff209608ff\");\r\n\t\tint n = dao.deleteNotessByList(list);\r\n\t\tSystem.out.println(n); \r\n\t}", "@Test\n public void deleteFlightTest() throws Exception {\n mockMvc.perform(delete(\"/v1/flight/deleteFlight?flightId=1\")\n .contentType(MediaType.APPLICATION_JSON))\n .andExpect(status().is(200));\n\n }", "@Test(dataProvider = \"DataForDelete\")\n public void testDelete(int id) throws JsonProcessingException {\n\n JSONObject jsonResult = new JSONObject();\n jsonResult.put(\"id\", id);\n\n given()\n .header(\"Content-Type\", \"application/json\")\n .contentType(ContentType.JSON)\n .accept(ContentType.JSON)\n .body(jsonResult)\n .when()\n .delete(\"https://reqres.in/api/users/2\")\n .then()\n .statusCode(204);\n }", "@Test\n public void deletePerson_ShouldReturnUpdatedRecordAnd_NO_CONTENT() {\n ResponseEntity<Person> response = personController.deletePerson(3L);\n\n //assert\n Mockito.verify(personService).deletePerson(3L);\n assertEquals(null, response.getBody());\n assertEquals(HttpStatus.NO_CONTENT, response.getStatusCode());\n }", "@Test\n public void n4_testDelete() throws Exception {\n mockMvc.perform(delete(API_PATH + \"/TestDataType/\" + lkUUID)\n .accept(APPLICATION_JSON))\n .andDo(print())\n .andExpect(status().isOk())\n .andExpect(content()\n .json(\"{'bool':false,'text':'lk','domain1':{},'numberDouble':0,'numberLong':100, 'date':''}\", false)); // TODO need strict true\n mockMvc.perform(get(API_PATH + \"/TestDataType/lk\")\n .accept(APPLICATION_JSON))\n .andExpect(status().is4xxClientError());\n mockMvc.perform(get(API_PATH + \"/TestDataType/\" + lkUUID)\n .accept(APPLICATION_JSON))\n .andExpect(status().is4xxClientError());\n }", "@Test\n public void testDeleteProductShouldCorrect() throws Exception {\n // Mock method\n when(productRepository.findOne(product.getId())).thenReturn(product);\n doNothing().when(productRepository).delete(product);\n\n testResponseData(RequestInfo.builder()\n .request(delete(PRODUCT_DETAIL_ENDPOINT, product.getId()))\n .token(adminToken)\n .httpStatus(HttpStatus.OK)\n .build());\n }", "public boolean removeTodo(TodoDto todo)\n {\n Todo model = new Todo();\n model.setId(todo.getId());\n return dao.removeTodo(model);\n }", "@Test\n public void hTestDeletePlaylist() {\n given()\n .header(\"X-Authorization\", token)\n .delete(\"/playlists/\" + playlistId)\n .then()\n .statusCode(200);\n }", "public void deleteMessageTest(){\n\t\tint messageId = 102;\n\t\tgiven()\n\t\t\t.pathParam(\"messageId\", messageId)\n\t\t.when()\n\t\t\t.delete(\"/message/{messageId}\")\n\t\t.then()\n\t\t\t.statusCode(200)\n\t\t\t.body(\"message\", is(\"Message Deleted \"+messageId));\n\t}", "public void testDelete() {\n TDelete_Return[] Basket_delete_out = basketService.delete(new String[] { BasketPath });\n assertNoError(Basket_delete_out[0].getError());\n }", "public void deleteTodo(Long todoId) {\n todoRepository.deleteById(todoId);\n }", "int deleteByExample(UploadStateRegDTOExample example);", "int deleteByExample(BehaveLogExample example);", "@Test\n @Sql({\"classpath:sql/truncate.sql\", \"classpath:/sql/empty_todolist_only.sql\"})\n public void shouldGet404WhenDeletingMissingTodo() {\n ApiError apiError = given()\n .standaloneSetup(controller, apiControllerAdvice)\n .spec(RequestSpecification.SPEC)\n .delete(\"/todolists/1/todos/2\")\n .then()\n .statusCode(HttpStatus.NOT_FOUND.value())\n .extract()\n .as(ApiError.class);\n\n // And: The error response should be correct\n assertThat(apiError.getErrorType()).isEqualTo(ErrorType.TODO_NOTFOUND);\n assertThat(apiError.getObjectId()).isEqualTo(\"2\");\n }", "@Test\n void deleteMovieById_whenExist() throws Exception {\n // Setup\n when(movieService.deleteMovieById(ArgumentMatchers.any(Long.class))).thenReturn(true);\n\n // Exercise\n mockMvc.perform(delete(baseUrl+ \"/1\").accept(MediaType.APPLICATION_JSON))\n .andExpect(status().isOk())\n .andExpect(jsonPath(\"$\").doesNotExist());\n }", "int deleteByExample(NotifictionExample example);", "@Test\n void deleteList() {\n }", "@Override\n\tpublic Integer delete(ReplyDTO dto) {\n\t\treturn mapper.delete(dto);\n\t}", "int deleteByExample(DebtsRecordEntityExample example);", "@Test\n @Sql({\"classpath:sql/truncate.sql\"})\n public void shouldGet404WhenDeletingTodoFromMissingList() {\n ApiError apiError = given()\n .standaloneSetup(controller, apiControllerAdvice)\n .spec(RequestSpecification.SPEC)\n .delete(\"/todolists/1/todos/2\")\n .then()\n .statusCode(HttpStatus.NOT_FOUND.value())\n .extract()\n .as(ApiError.class);\n\n // And: The error response should be correct\n assertThat(apiError.getErrorType()).isEqualTo(ErrorType.TODOLIST_NOTFOUND);\n assertThat(apiError.getObjectId()).isEqualTo(\"1\");\n }", "@DeleteMapping(\"/produtos/{id}\")\n @Timed\n public ResponseEntity<Void> deleteProduto(@PathVariable Long id) {\n log.debug(\"REST request to delete Produto : {}\", id);\n\n//////////////////////////////////REQUER PRIVILEGIOS\n if (PrivilegioService.podeDeletar(cargoRepository, ENTITY_NAME)) {\n produtoRepository.delete(id);\n } else {\n log.error(\"TENTATIVA DE EXCUIR SEM PERMISSÃO BLOQUEADA! \" + ENTITY_NAME + \" : {}\", id);\n return ResponseEntity.badRequest().headers(HeaderUtil.createFailureAlert(ENTITY_NAME, \"privilegios insuficientes.\", \"Este usuario não possui privilegios sufuentes para deletar esta entidade.\")).body(null);\n }\n//////////////////////////////////REQUER PRIVILEGIOS\n return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build();\n }", "int deleteByExample(NjOrderCallbackLogExample example);", "@Test\n\tvoid testDeletePlant() {\n\t\tList<Plant> plant = service.deletePlant(50);\n\t\tassertFalse(plant.isEmpty());\n\t}", "int deleteByExample(ClOrderInfoExample example);", "public void deleteTodoById(@PathVariable(\"id\") long id, Model model) throws RecordNotFoundException {\n TodoItem todoItem = getTodoItemById(id);\n todoItemRepository.delete(todoItem);\n model.addAttribute(\"todoItems\", todoItemRepository.findAll());\n }", "int deleteByExample(StatusByUserExample example);", "@Test\n\tpublic void testDeleteCorrectParamNoDeletePb() {\n\t\tfinal String owner = \"1\";\n\t\tfinal Long piiUniqueId = (long) 12345789;\n\t\t\n\t\tPiiDeleteRequest piiRequest = new PiiDeleteRequest();\n\t\tpiiRequest.setOwner(owner);\n\t\tpiiRequest.setPiiUniqueId(piiUniqueId);\n\t\t\n\t\tPiiDeleteResponse piiDeleteResponse = new PiiDeleteResponse();\n\t\tpiiDeleteResponse.setDeleted(true);\n\t\twhen(mPiiService.delete(piiRequest)).thenReturn(piiDeleteResponse);\n\t\t\n\t\tResponse response = piiController.delete(piiRequest);\n\t\t\n\t\tverify(mPiiService).delete(piiRequest);\n\t\tverifyZeroInteractions(mPuidDao);\n\t\tassertEquals(200, response.getStatus());\n\t\t\n\t\tPiiDeleteResponse returnedResponse = (PiiDeleteResponse) response.getEntity();\n\t\tassertTrue(returnedResponse.isDeleted());\n\t}", "@Test\n void deleteSuccess() {\n carDao.delete(carDao.getById(1));\n assertNull(carDao.getById(1));\n\n //Delete repairs\n GenericDao<Repair> repairDao = new GenericDao(Repair.class);\n Repair repair = repairDao.getById(2);\n assertNull(carDao.getById(2));\n\n //Delete part\n GenericDao<Part> partDao = new GenericDao(Part.class);\n Role part = partDao.getById(2);\n assertNull(partDao.getById(2));\n }", "int deleteByExample(TourstExample example);", "int deleteByExample(TNavigationExample example);", "private void deleteOrder(HttpServletRequest request, HttpServletResponse response) {\n\t\t\n\t}", "int deleteByExample(NjOrderWork2Example example);", "public void postDoDelete(T entity)\n {\n }", "@Test\n public void givenResourceDoesNotExist_whenDeleteIsTriggered_thenNoExceptions() {\n final long randomId = IDUtil.randomPositiveLong();\n givenEntityExists(randomId);\n\n // When\n getApi().delete(randomId);\n\n // Then\n }", "public int delete(o dto);", "int logicalDeleteByExample(@Param(\"example\") BehaveLogExample example);", "@Test\n\tpublic void testDeleteTask3() {\n\t\tString label = \"TEST\";\n\t\ttestData.getTaskMap().put(label, new ArrayList<Task>());\n\t\ttestData.addTask(new Task(1, label , \"Task 1\",\n\t\t\t\tnew TDTDateAndTime(), false));\n\t\ttestData.addTask(new Task(2, label, \"Task 2\",\n\t\t\t\tnew TDTDateAndTime(), false));\n\t\ttestData.addTask(new Task(3, label, \"Task 3\",\n\t\t\t\tnew TDTDateAndTime(), false));\n\n\t\tDeleteCommand comd = new DeleteCommand(label, 3);\n\t\tcomd.execute(testData);\n\n\t\tArrayList<Task> taskList = testData.getTaskListFromLabel(label);\n\t\tassertEquals(2, taskList.size());\n\t\tassertTrue(taskList.get(0).getDetails().equals(\"Task 1\"));\n\t\tassertTrue(taskList.get(1).getDetails().equals(\"Task 2\"));\n\t}", "@Test\n public void testDeleteUser() {\n User testUser = new User();\n testUser.setUserEmail(TEST_EMAIL);\n testUser.setUserPassword(TEST_PASSWORD);\n \n Mockito.doNothing().when(userService).deleteUser((User) Matchers.anyObject());\n \n given().body(testUser).contentType(ContentType.JSON).when()\n .delete(URLPREFIX + \"delete\").then()\n .statusCode(HttpServletResponse.SC_OK)\n .contentType(ContentType.JSON).body(equalTo(\"true\"));\n }", "int deleteByExample(EventDetail eventDetail);", "@DELETE(\"pomodorotasks\")\n Call<PomodoroTask> pomodorotasksDelete(\n @Body PomodoroTask pomodoroTask\n );", "private void assertRemoved()\n\t{\n\t\ttry\n\t\t{\n\t\t\ttestController.getContentTypeDefinitionVOWithId(testDefinition.getId());\n\t\t\tfail(\"The ContentTypeDefinition was not deleted\");\n\t\t}\n\t\tcatch(Exception e)\n\t\t{ /* expected */ }\n\t}" ]
[ "0.70479363", "0.6912734", "0.68870425", "0.68643516", "0.682037", "0.67388767", "0.6724443", "0.6712658", "0.67099535", "0.6693703", "0.6684576", "0.66657794", "0.6632989", "0.6610785", "0.6591082", "0.65647304", "0.65594614", "0.64954484", "0.64883703", "0.6482218", "0.6481545", "0.6473269", "0.64649475", "0.64546824", "0.6452859", "0.6435613", "0.6433434", "0.63965064", "0.63951755", "0.637929", "0.6375307", "0.6370779", "0.6367391", "0.63583684", "0.635249", "0.6351359", "0.6326197", "0.6304604", "0.6303349", "0.6295854", "0.6291169", "0.6286018", "0.6281841", "0.62758356", "0.6271388", "0.62642473", "0.6263346", "0.6260101", "0.62598515", "0.6258539", "0.62567246", "0.62556314", "0.62555707", "0.6255032", "0.6247028", "0.62464005", "0.62368417", "0.62297994", "0.6229736", "0.6226031", "0.6221328", "0.62210673", "0.6217547", "0.6212572", "0.6211555", "0.62071097", "0.6198617", "0.6194086", "0.6189697", "0.61874455", "0.6185531", "0.6183897", "0.6179726", "0.61789227", "0.6175914", "0.6149294", "0.61487645", "0.61480486", "0.6144235", "0.61406094", "0.61402583", "0.61304986", "0.6128638", "0.6128547", "0.6126444", "0.61262447", "0.6125086", "0.6120401", "0.61195403", "0.6109309", "0.61080647", "0.61018133", "0.61005723", "0.60998625", "0.60961175", "0.6087932", "0.60869795", "0.6085803", "0.60857123", "0.6082216" ]
0.74031246
0
When: We try to delete a todo from a list that does not exist. Then: We should get a 404
@Test @Sql({"classpath:sql/truncate.sql"}) public void shouldGet404WhenDeletingTodoFromMissingList() { ApiError apiError = given() .standaloneSetup(controller, apiControllerAdvice) .spec(RequestSpecification.SPEC) .delete("/todolists/1/todos/2") .then() .statusCode(HttpStatus.NOT_FOUND.value()) .extract() .as(ApiError.class); // And: The error response should be correct assertThat(apiError.getErrorType()).isEqualTo(ErrorType.TODOLIST_NOTFOUND); assertThat(apiError.getObjectId()).isEqualTo("1"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n @Sql({\"classpath:sql/truncate.sql\", \"classpath:/sql/empty_todolist_only.sql\"})\n public void shouldGet404WhenDeletingMissingTodo() {\n ApiError apiError = given()\n .standaloneSetup(controller, apiControllerAdvice)\n .spec(RequestSpecification.SPEC)\n .delete(\"/todolists/1/todos/2\")\n .then()\n .statusCode(HttpStatus.NOT_FOUND.value())\n .extract()\n .as(ApiError.class);\n\n // And: The error response should be correct\n assertThat(apiError.getErrorType()).isEqualTo(ErrorType.TODO_NOTFOUND);\n assertThat(apiError.getObjectId()).isEqualTo(\"2\");\n }", "@Test\n @Sql({\"classpath:sql/truncate.sql\", \"classpath:/sql/single_todolist_with_two_todos.sql\"})\n public void shouldDeleteTodoFromTodoList() {\n ApiTodoList todoList = given()\n .standaloneSetup(controller, apiControllerAdvice)\n .spec(RequestSpecification.SPEC)\n .delete(\"/todolists/1/todos/2\")\n .then()\n .statusCode(HttpStatus.NO_CONTENT.value())\n .extract()\n .as(ApiTodoList.class);\n\n // And: The returned todolist should only contain the correct todo\n assertThat(todoList.getItems().size()).isEqualTo(1);\n assertThat(todoList.getItems().get(0).getText()).isEqualTo(\"Existing Todo 1\");\n\n // And: The todolist should only contain one todo in the db\n doInJPA(this::getEntityManagerFactory, em -> {\n TodoList todoListInDb = em.find(TodoList.class, 1L);\n assertThat(todoListInDb.getItems().size()).isEqualTo(1);\n });\n }", "@Test\n public void givenResourceDoesNotExist_whenDeleteIsTriggered_thenNoExceptions() {\n final long randomId = IDUtil.randomPositiveLong();\n givenEntityExists(randomId);\n\n // When\n getApi().delete(randomId);\n\n // Then\n }", "@Test\n public void testDeleteTravel_RecordNotFoundExceptionDeleteTravel() throws Exception {\n doThrow(new RecordNotFoundException()).when(databaseMock).deleteTravel(anyInt());\n \n mockMVC.perform(delete(\"/user/1/travel/1\")\n .header(\"Authorization\", \"1\"))\n .andExpect(status().isNotFound());\n \n verify(databaseMock, times(1)).getUser(anyInt());\n verify(databaseMock, times(1)).deleteTravel(anyInt());\n verifyNoMoreInteractions(databaseMock);\n }", "@Test\n public void delete01(){\n Response responseGet=given().\n spec(spec03).\n when().\n get(\"/198\");\n responseGet.prettyPrint();\n //delete islemi\n Response responseDel =given().\n spec(spec03).\n when().\n delete(\"/198\");\n responseDel.prettyPrint();\n //responseDel yazdirildiginda \"Not Found\" cevabi gelirse status code 404 ile test edilir. Eger bos bir\n // satir donerse Ststus code 200 ile test edilir.\n responseDel.then().assertThat().statusCode(200);\n // Hard assert\n assertTrue(responseDel.getBody().asString().contains(\"\"));\n //softAssertion\n SoftAssert softAssert = new SoftAssert();\n softAssert.assertTrue(responseDel.getBody().asString().contains(\"\"));\n softAssert.assertAll();\n\n\n }", "@Test\n public void delete01() {\n Response responseGet = given().\n spec(spec03).\n when().\n get(\"/3\");\n responseGet.prettyPrint();\n\n Response responseDel = given().\n spec(spec03).\n when().\n delete(\"/3\");\n responseDel.prettyPrint();\n\n\n // responseDel yazdirildiginda not found cevabi gelirse status code 404 ile test edilir.\n // Eger bos bir satir donerse status code 200 ile test edilir.\n\n responseDel.\n then().\n statusCode(200);\n\n\n // hard assert\n\n assertTrue(responseDel.getBody().asString().contains(\" \"));\n\n // soft assertion\n\n SoftAssert softAssert = new SoftAssert();\n softAssert.assertTrue(responseDel.getBody().asString().contains(\" \"));\n softAssert.assertAll();\n }", "@Test\n public void deleteTest(){\n given().pathParam(\"id\",1)\n .when().delete(\"/posts/{id}\")\n .then().statusCode(200);\n }", "@Test\n void incorrectDeletePathTest() {\n URI uri = URI.create(endBody + \"/dummy\");\n\n // get the response\n HttpResponse<String> response = HttpMethods.delete(uri);\n\n // it should receive 404\n assertNotEquals(200, response.statusCode());\n assertEquals(404, response.statusCode());\n }", "@Test\n void shouldDeleteTask() throws Exception {\n mockMvc\n .perform(MockMvcRequestBuilders\n .delete(\"/v1/task/{id}\", 123))\n .andExpect(MockMvcResultMatchers.status().is(200));\n }", "@Test\n public void removeWorkflow_404() throws Exception {\n\n // PREPARE THE DATABASE\n // Fill in the workflow db\n addMOToDb(1);\n addMOToDb(2);\n Integer id = addMOToDb(3).getId();\n\n // PREPARE THE TEST\n Integer unknownId = id + 1;\n\n // DO THE TEST\n Response response = callAPI(VERB.DELETE, \"/mo/\" + unknownId.toString(), null);\n\n // CHECK RESULTS\n int status = response.getStatus();\n assertEquals(404, status);\n\n String body = response.readEntity(String.class);\n assertEquals(\"No workflow exists with Id:\" + unknownId.toString(), body);\n }", "public void verifyTodoDeletedFrontend(String toDoName, String status) {\n try {\n getLogger().info(\"Verify a Todo not exist. Name: \" + toDoName);\n //Thread.sleep(smallTimeOut);\n //TODO move xpath to properties file, very low peformance\n getDriver().findElement(By.xpath(\"//input[@class='newTodoInput'][@value='\" + toDoName + \"']\"));\n if (status.equals(\"INACTIVE\")) {\n AbstractService.sStatusCnt++;\n NXGReports.addStep(\"Verify a Todo not exist. Name: \" + toDoName, LogAs.FAILED,\n new CaptureScreen(CaptureScreen.ScreenshotOf.BROWSER_PAGE));\n } else {\n NXGReports.addStep(\"Verify a Todo exist. Name: \" + toDoName, LogAs.PASSED, null);\n }\n } catch (NoSuchElementException ex) {\n getLogger().info(ex);\n AbstractService.sStatusCnt++;\n if (status.equals(\"INACTIVE\")) {\n NXGReports.addStep(\"Verify a Todo not exist. Name: \" + toDoName, LogAs.PASSED, null);\n } else {\n AbstractService.sStatusCnt++;\n NXGReports\n .addStep(\"Verify a Todo exist. Name: \" + toDoName, LogAs.FAILED, new CaptureScreen(CaptureScreen.ScreenshotOf.BROWSER_PAGE));\n }\n } catch (Exception ex) {\n getLogger().info(ex.getStackTrace());\n }\n }", "@Test\n public void testDeleteList() throws Exception {\n System.out.println(\"deleteList\");\n String permalink = testList.getPermalink();\n\n WordListApi.deleteList(token, permalink);\n }", "public void delete(T ob) throws ToDoListException;", "@Test\r\n\tvoid testDeleteToDoItem() {\r\n\t\tSortedList list = new SortedList(\"List\");\r\n\r\n\t\t// case 1: deleting one item from a one-item list\r\n\t\tlist.insert(toDoItem1);\r\n\t\tlist.remove(\"Item 1\");\r\n\t\tif (list.getSize() != 0 || list.getHead() != null) {\r\n\t\t\tfail(\"Removed a single item from a size 1 list incorrectly\");\r\n\t\t}\r\n\r\n\t\t// case 2: deleting one item from a two-item list\r\n\t\tlist.insert(toDoItem1);\r\n\t\tlist.insert(toDoItem2);\r\n\t\tlist.remove(\"Item 2\");\r\n\t\tif (list.getSize() != 1) {\r\n\t\t\tfail(\"Incorrect size: should be 1\");\r\n\t\t}\r\n\t\tif (!list.getHead().getName().equals(\"Item 1\")) {\r\n\t\t\tfail(\"Head set incorrectly: should be \\\"Item 1\\\"\");\r\n\t\t}\r\n\t\tif (list.getHead().getNext() != null) {\r\n\t\t\tfail(\"The next item for head was set incorrectly\");\r\n\t\t}\r\n\r\n\t\tlist.clear();\r\n\r\n\t\t// case 3: adding several items and removing multiple\r\n\t\tlist.insert(toDoItem1);\r\n\t\tlist.insert(toDoItem2);\r\n\t\tlist.insert(toDoItem3);\r\n\t\tlist.insert(toDoItem4);\r\n\t\tlist.insert(toDoItem5);\r\n\t\tlist.insert(toDoItem6);\r\n\t\tlist.remove(\"Item 1\");\r\n\t\tlist.remove(\"Item 6\");\r\n\t\tlist.remove(\"Item 4\");\r\n\r\n\t\tToDoItem tempHead = list.getHead();\r\n\t\tString currList = \"|\";\r\n\t\tString correctList = \"|Item 2|Item 3|Item 5|\";\r\n\r\n\t\twhile (tempHead != null) {\r\n\t\t\tcurrList += tempHead.getName() + \"|\";\r\n\t\t\ttempHead = tempHead.getNext();\r\n\t\t}\r\n\t\tif (!currList.equals(correctList)) {\r\n\t\t\tfail(\"The list was ordered incorrectly after inserting and deleting the case 3 items\");\r\n\t\t}\r\n\t}", "@Test\n public void testDeleteTravel_NumberFormatExceptionTravelId() throws Exception {\n \n mockMVC.perform(delete(\"/user/1/travel/a\")\n .header(\"Authorization\", \"1\"))\n .andExpect(status().isInternalServerError());\n \n verifyNoMoreInteractions(databaseMock);\n }", "@Test\n public void deletePerson_ShouldReturnError404_WhenPersonNotFoundException() {\n Mockito.doThrow(PersonNotFoundException.class).when(personService).deletePerson(3L);\n\n //act\n ResponseEntity<Person> response = personController.deletePerson(3L);\n\n //assert\n assertEquals(HttpStatus.NOT_FOUND, response.getStatusCode());\n assertEquals(null, response.getBody());\n }", "public void deleteTodoById(@PathVariable(\"id\") long id, Model model) throws RecordNotFoundException {\n TodoItem todoItem = getTodoItemById(id);\n todoItemRepository.delete(todoItem);\n model.addAttribute(\"todoItems\", todoItemRepository.findAll());\n }", "@Test\n public void testDeleteTravel_RecordNotFoundExceptionGetUser() throws Exception {\n when(databaseMock.getUser(anyInt())).thenThrow(new RecordNotFoundException());\n \n mockMVC.perform(delete(\"/user/1/travel/1\")\n .header(\"Authorization\", \"1\"))\n .andExpect(status().isNotFound());\n \n verify(databaseMock, times(1)).getUser(anyInt());\n verifyNoMoreInteractions(databaseMock);\n }", "@After(value = \"@deleteList\", order = 1)\n public void deleteList() {\n String listId = context.getDataCollection((\"list\")).get(\"id\");\n context.setRequestSpec(AuthenticationUtils.getLoggedReqSpec());\n given(context.getRequestSpecification()).when().delete(\"/lists/\".concat(listId));\n }", "@Test\n\tpublic void testDeleteNotExistedRecipe() {\n\t\twhen(mockCoffeeMaker.getRecipes()).thenReturn(recipeList);\n\t\tassertEquals(null, mockCoffeeMaker.deleteRecipe(20));\n\t}", "@Test\n public void hTestDeletePlaylist() {\n given()\n .header(\"X-Authorization\", token)\n .delete(\"/playlists/\" + playlistId)\n .then()\n .statusCode(200);\n }", "@Test\n public void testDeleteFileNotFound() throws IOException{\n ExcelFile testFile = new ExcelFile();\n Mockito.when(excelService.deleteFile(anyString())).thenReturn(null);\n given().accept(\"application/json\").delete(\"/excel/0\").peek().\n then().assertThat()\n .statusCode(404);\n }", "@Test\n public void testDeleteTravel() throws Exception{\n \n doNothing().when(databaseMock).deleteTravel(anyInt());\n \n mockMVC.perform(delete(\"/user/1/travel/1\")\n .header(\"Authorization\", \"1\"))\n .andExpect(status().isNoContent());\n \n verify(databaseMock, times(1)).getUser(1);\n verify(databaseMock, times(1)).deleteTravel(1);\n verifyNoMoreInteractions(databaseMock);\n }", "@Test\n public void deleteOrderTest() {\n Long orderId = 10L;\n api.deleteOrder(orderId);\n\n verify(exactly(1), deleteRequestedFor(urlEqualTo(\"/store/order/10\")));\n }", "@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}", "@Test\n void deleteList() {\n }", "@Test\n void testDelete_incorrectId() {\n assertThrows(NotFoundException.class, () -> propertyInfoDao.delete(\"randomString\"));\n }", "@Test\n public void testDeleteShoppinglistsIdAction() throws ClientException, IOException, ProcessingException {\n CloudResponse response = this.actions.deleteShoppinglistsIdAction(\"{id}\");\n List<Integer> expectedResults = Arrays.asList(204, 400, 403, 404);\n LOG.info(\"Got status {}\", response.getStatusLine());\n Assert.assertTrue(expectedResults.contains(response.getStatusLine().getStatusCode()));\n\n if(response.getStatusLine().getStatusCode() == 400) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 403) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 404) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n \n }", "@Test\n public void testDeleteShoppinglistsIdEntriesEntryIdAction() throws ClientException, IOException, ProcessingException {\n CloudResponse response = this.actions.deleteShoppinglistsIdEntriesEntryIdAction(\"{id}\", \"{entryId}\");\n List<Integer> expectedResults = Arrays.asList(204, 400, 403, 404);\n LOG.info(\"Got status {}\", response.getStatusLine());\n Assert.assertTrue(expectedResults.contains(response.getStatusLine().getStatusCode()));\n\n if(response.getStatusLine().getStatusCode() == 400) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 403) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 404) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n \n }", "@Test\n void deleteSuccess() {\n dao.delete(dao.getById(2));\n assertNull(dao.getById(2));\n }", "public void test_03() {\n\n\t\tResponse reponse = given().\n\t\t\t\twhen().\n\t\t\t\tdelete(\"http://localhost:3000/posts/_3cYk0W\");\n\n\t\tSystem.out.println(\"updated response data \"+ reponse.asString());\t\t\n\t}", "@Test\n void deleteSuccess() {\n dao.delete(dao.getById(3));\n assertNull(dao.getById(3));\n }", "@Test\n public void foodDeletedGoesAway() throws Exception {\n createFood();\n // locate the food item\n\n // delete the food item\n\n // check that food item no longer locatable\n\n }", "@Test\n\tpublic void testDeleteExistedRecipe() {\n\t\twhen(mockCoffeeMaker.getRecipes()).thenReturn(recipeList);\n\t\tassertEquals(\"Coffee\", mockCoffeeMaker.deleteRecipe(0));\n\t}", "@Test\n public void testDeleteProductShouldThrowNotFoundWhenProductNotFound() throws Exception {\n // Mock method\n when(productRepository.findOne(product.getId())).thenReturn(null);\n\n testResponseData(RequestInfo.builder()\n .request(delete(PRODUCT_DETAIL_ENDPOINT, product.getId()))\n .token(adminToken)\n .httpStatus(HttpStatus.NOT_FOUND)\n .build());\n }", "@Test\n void deleteMovieById_whenExist() throws Exception {\n // Setup\n when(movieService.deleteMovieById(ArgumentMatchers.any(Long.class))).thenReturn(true);\n\n // Exercise\n mockMvc.perform(delete(baseUrl+ \"/1\").accept(MediaType.APPLICATION_JSON))\n .andExpect(status().isOk())\n .andExpect(jsonPath(\"$\").doesNotExist());\n }", "@Test\n public void testDeleteItem() throws Exception {\n\n Tracker tracker = new Tracker();\n\n String action = \"0\";\n String yes = \"y\";\n String no = \"n\";\n\n // add first item\n\n String name1 = \"task1\";\n String desc1 = \"desc1\";\n String create1 = \"3724\";\n\n Input input1 = new StubInput(new String[]{action, name1, desc1, create1, yes});\n new StartUI(input1).init(tracker);\n\n // add second item\n\n String name2 = \"task2\";\n String desc2 = \"desc2\";\n String create2 = \"97689\";\n\n Input input2 = new StubInput(new String[]{action, name2, desc2, create2, yes});\n new StartUI(input2).init(tracker);\n\n // get first item id\n\n String id = \"\";\n\n Filter filter = new FilterByName(name1);\n Item[] result = tracker.findBy(filter);\n for (Item item : result) {\n if (item !=null && item.getName().equals(name1)) {\n id = item.getId();\n break;\n }\n }\n\n // delete first item\n\n String action2 = \"2\";\n\n Input input3 = new StubInput(new String[]{action2, id, yes});\n new StartUI(input3).init(tracker);\n\n Assert.assertNull(tracker.findById(id));\n }", "@Test\n void deleteNoteSuccess() {\n noteDao.delete(noteDao.getById(2));\n assertNull(noteDao.getById(2));\n }", "@Test\n public void testExposesDelete() throws Exception {\n List<Link> customers = findCustomersLinks();\n assertThat(\"Customers exist to work with\",\n customers.size(),\n greaterThan(0));\n\n Link customer = customers.get(customers.size() - 1);\n\n mockMvc\n .perform(delete(customer.getHref()))\n .andExpect(status().isNoContent());\n\n mockMvc\n .perform(get(customer.getHref()))\n .andExpect(status().isNotFound());\n }", "@Test\n @OperateOnDeployment(\"server\")\n public void shouldDeleteResourcesByIds() {\n given().header(\"Authorization\", \"Bearer access_token\").expect().statusCode(200).when().delete(\n getBaseTestUrl() + \"/1/tags/delete/json/ids;1;3;\");\n // Then then the resources should be deleted\n given().header(\"Authorization\", \"Bearer access_token\").expect().body(\"size\", equalTo(1)).and().expect().body(\"items.item.name\",\n hasItem(\"Concept\")).and().expect().body(\"items.item.name\", not(hasItem(\"Task\"))).and().expect().body(\"items.item.name\",\n not(hasItem(\"Reference\"))).when().get(getBaseTestUrl() + \"/1/tags/get/json/all?expand=\" +\n \"{\\\"branches\\\":[{\\\"trunk\\\":{\\\"name\\\":\\\"tags\\\"}}]})\");\n }", "@Test\n void deleteTest() {\n URI uri = URI.create(endBody + \"/delete\");\n\n // get the response\n HttpResponse<String> response = HttpMethods.delete(uri);\n\n assertEquals(200, response.statusCode());\n }", "@Test\n\t@Override\n\tpublic void testDeleteObjectNotFoundJson() throws Exception {\n\t}", "@Test\n public void shouldGive404ResponseCodeIfAttemptIsMadeToDeleteNonExistentPayment() throws Exception {\n ResponseEntity<String> deleteResponse = restTemplate.exchange(paymentsUrl + \"/nonexistentPayment\", HttpMethod.DELETE, null, String.class);\n //then: the response should be 404 'not found':\n assertEquals(HttpStatus.NOT_FOUND, deleteResponse.getStatusCode());\n }", "@Test\n public void testEditTravel_RecordNotFoundExceptionTravelId() throws Exception {\n mockMVC.perform(put(\"/user/1/travel/404\")\n .contentType(TestUtil.APPLICATION_JSON_UTF8)\n .content(TestUtil.convertObjectToJsonBytes(dto))\n .header(\"Authorization\", \"1\"))\n .andExpect(status().isNotFound());\n \n verify(databaseMock, times(1)).getUser(anyInt());\n verifyNoMoreInteractions(databaseMock);\n }", "@Test\n public void deleteByHealthCodeSilentlyFails() {\n dao.deleteUploadsForHealthCode(\"nonexistentHealthCode\");\n }", "@Test\n public void deleteId() throws Exception {\n Role role = create(new Role(\"roleName\"));\n\n //Attempt to remove from the database with delete request\n try {\n mvc.perform(MockMvcRequestBuilders.delete(\"/auth/roles/{id}\", UUIDUtil.UUIDToNumberString(role.getUuid()))\n .header(\"Authorization\", authPair[0])\n .header(\"Function\", authPair[1])\n )\n .andExpect(status().isOk());\n } catch (Exception e) {\n remove(role.getUuid());\n throw e;\n }\n\n //Check if successfully removed from database\n try {\n //Remove from database (above get function should have thrown an error if the object was no longer in the database)\n remove(role.getUuid());\n fail(\"DELETE request did not succesfully delete the object from the database\");\n } catch (ObjectNotFoundException e) {\n //Nothing because the object is no longer present in the database which is expected\n }\n }", "@Test\n public void testDelete() throws Exception {\n // pretend the entity was deleted\n doNothing().when(Service).deleteCitation(any(String.class));\n\n // call delete\n ModelAndView mav = Controller.delete(\"\");\n\n // test to see that the correct view is returned\n Assert.assertEquals(\"result\", mav.getViewName());\n\n // test to see that Json is formated properly\n Map<String, Object> map = mav.getModel();\n String result = (String) map.get(\"message\");\n\n Assert.assertEquals(\"{\\\"result\\\":\\\"deleted\\\"}\", result);\n }", "@Test\n @OperateOnDeployment(\"server\")\n public void shouldFailToGetResourceWhenIncorrectScopeForEndpoint() {\n given().header(\"Authorization\", \"Bearer access_token\").expect().statusCode(403).when().delete(\n getBaseTestUrl() + \"/1/category/delete/json/1\");\n }", "@Test\r\n\tpublic void testDelete() {\n\t\tint todos = modelo.getAll().size();\r\n\r\n\t\tassertTrue(modelo.delete(1));\r\n\r\n\t\t// comprobar que este borrado\r\n\t\tassertNull(modelo.getById(1));\r\n\r\n\t\t// borrar un registro que no existe\r\n\t\tassertFalse(modelo.delete(13));\r\n\t\tassertNull(modelo.getById(13));\r\n\r\n\t\tassertEquals(\"debemos tener un registro menos\", (todos - 1), modelo\r\n\t\t\t\t.getAll().size());\r\n\r\n\t}", "public void testDelete() {\n TDelete_Return[] PriceLists_delete_out = priceListService.delete(new String[] { path + alias });\n\n // test if deletion was successful\n assertEquals(\"delete result set\", 1, PriceLists_delete_out.length);\n\n TDelete_Return PriceList_delete_out = PriceLists_delete_out[0];\n\n assertNoError(PriceList_delete_out.getError());\n\n assertEquals(\"deleted?\", true, PriceList_delete_out.getDeleted());\n }", "public Todo remove(long todoId) throws NoSuchTodoException;", "@Test\r\n\tpublic void deleteAnExistingRouteFather(){\r\n\t\tRouteFather deleted = routeFatherDAO.delete(this.routeFather);\r\n\t\tAssert.assertNotNull(\"it should returns a not null object\", deleted);\r\n\t}", "@Test\n\tpublic void testDeleteIncorrectParam() {\n\n\t\tResponse response = piiController.delete(null);\n\t\t\n\t\tverifyZeroInteractions(mPiiService);\n\t\tverifyZeroInteractions(mPuidDao);\n\t\tassertEquals(400, response.getStatus());\n\t\t\n\t\tObject entity = response.getEntity();\n\t\tassertNull(entity);\n\t}", "@Test\n void deleteSuccess() {\n genericDao.delete(genericDao.getById(3));\n assertNull(genericDao.getById(3));\n }", "@GetMapping(\"/deleteItem\")\n\tpublic String deleteItem(HttpServletRequest servletRequest) {\n\t\t\n\t\ttoDoListService.deleteById(Long.parseLong(servletRequest.getParameter(\"itemId\"))); // Delete the to do list item record.\n\t\t\n\t\treturn \"redirect:/welcome\";\n\t}", "public void verifyToDoNotExist(String todoName) {\n try {\n getLogger().info(\"Verify deleted todo: \" + todoName);\n boolean isExisted = false;\n for (int i = 0; i < eleToDoNameRow.size(); i++) {\n if (todoName.equals(getTextByAttributeValue(eleToDoNameRow.get(i), \"Todo expected not Exist\"))) {\n AbstractService.sStatusCnt++;\n NXGReports.addStep(\"Fail: Todo still existed: \" + todoName, LogAs.FAILED,\n new CaptureScreen(CaptureScreen.ScreenshotOf.BROWSER_PAGE));\n isExisted = true;\n }\n }\n if (!isExisted) {\n NXGReports.addStep(\"Todo deleted success\", LogAs.PASSED, null);\n }\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }", "@Test\n void deleteSuccess() {\n genericDAO.delete(genericDAO.getByID(2));\n assertNull(genericDAO.getByID(2));\n }", "@Test\r\n\tpublic void testDeleteCheckList() {\n\t\tthis.checklistDAO.saveOrUpdateCheckList(this.checklist);\r\n\t\tString id = this.checklist.getId();\r\n\r\n\t\t// Test the method deleteCheckList with an checklist existing into the\r\n\t\t// db.\r\n\t\tthis.checklistDAO.deleteCheckList(this.checklist);\r\n\r\n\t\t// See if this.checklist is now absent in the db.\r\n\t\tCheckList checklistTmp = (CheckList) this.checklistDAO.getCheckList(id);\r\n\t\tassertNull(checklistTmp);\r\n\r\n\t\t// Test the method deleteCheckList with an checklist unexisting into the\r\n\t\t// db.\r\n\t\t// Normally here there are no exception thrown.\r\n\t\tthis.checklistDAO.deleteCheckList(this.checklist);\r\n\t}", "@Test\n\tvoid deleteDoctorTest() throws Exception {\n\t\tList<DoctorDetail> doctorDetail = new ArrayList<>();\n\t\tDoctorDetail doctorfind = new DoctorDetail();\n\t\tdoctorfind.setId(\"1\");\n\t\tdoReturn(doctorDetail).when(doctorServiceImplementation).deleteDoctorService(doctorfind.getId());\n\t\tmockMvc.perform(get(\"/doctor/delete?id=/{id}\", 1L)).andExpect(status().isOk());\n\t}", "@Test\r\n public void testDeleteNonExistRecipe() {\r\n assertNull(coffeeMaker.deleteRecipe(1)); // Test do not exist recipe\r\n }", "@Test\r\n\tpublic void deleteANonExistingRouteFather(){\r\n\t\tRouteFather toDelete = new RouteFather(123123);\r\n\t\tRouteFather deleted = routeFatherDAO.delete(toDelete);\r\n\t\tAssert.assertNull(\"it should returns a null object\", deleted);\r\n\t}", "@Test\n void testDeleteCity() {\n CityList cityList = mockCityList();\n cityList.delete(mockCity());\n\n assertFalse(cityList.hasCity(mockCity()));\n assertTrue(cityList.countCities() == 0);\n\n }", "public void deleteRequest() {\n assertTrue(true);\n }", "@Test\n public void removeWorkflow_400() throws Exception {\n\n // PREPARE THE DATABASE\n // Fill in the workflow db\n addMOToDb(1);\n addMOToDb(2);\n addMOToDb(3);\n\n // PREPARE THE TEST\n String badId = \"bad_id\";\n\n // DO THE TEST\n Response response = callAPI(VERB.DELETE, \"/mo/\" + badId, null);\n\n // CHECK RESULTS\n int status = response.getStatus();\n assertEquals(400, status);\n\n String body = response.readEntity(String.class);\n assertEquals(\"\", body);\n }", "void delete(int index) throws ListException;", "void delete(long id) throws NotFoundException;", "@Test \n public void testReperimentoNumeroInesistente() {\n Response rDelete = rubrica.path(nome+cognome).path(nome+cognome).request().delete();\n \n // Verifica che la risposta sia 404 Not Found\n assertEquals(Response.Status.NOT_FOUND.getStatusCode(),rDelete.getStatus());\n }", "@Test\n void testDeleteException() {\n CityList cityList = mockCityList();\n cityList.delete(mockCity());\n\n /**create a city and don't add it to the mockCityList**/\n City throwsCity = new City(\"x\",\"y\");\n\n /**citation: https://howtodoinjava.com/junit5/expected-exception-example/**/\n\n assertThrows(IllegalArgumentException.class, () -> {\n cityList.delete(throwsCity);\n });\n }", "@Test\n public void testEditTravel_ForeignKeyNotFoundException() throws Exception {\n doThrow(new ForeignKeyNotFoundException()).when(databaseMock).updateTravel(anyInt(), anyInt(), any(Travel.class));\n \n mockMVC.perform(put(\"/user/1/travel/1\")\n .contentType(TestUtil.APPLICATION_JSON_UTF8)\n .content(TestUtil.convertObjectToJsonBytes(dto))\n .header(\"Authorization\", \"1\"))\n .andExpect(status().isNotFound());\n \n verify(databaseMock, times(1)).getUser(anyInt());\n verify(databaseMock, times(1)).updateTravel(anyInt(), anyInt(), any(Travel.class));\n verifyNoMoreInteractions(databaseMock);\n }", "void deleteRecipe(Recipe recipe) throws ServiceFailureException;", "@Test\n public void testDeleteTravel_NumberFormatExceptionUserId() throws Exception {\n \n mockMVC.perform(delete(\"/user/a/travel/1\")\n .header(\"Authorization\", \"1\"))\n .andExpect(status().isInternalServerError());\n \n verifyNoMoreInteractions(databaseMock);\n }", "public void deletelist(){\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- current list should be deleted\");\r\n\t\ttry{\r\n\r\n\t\t\twaitForElement(locator_split(\"lnkdeletelist\"));\r\n\t\t\tclick(locator_split(\"lnkdeletelist\"));\r\n\r\n\t\t\tThread.sleep(3000);\r\n\t\t\twaitForElement(locator_split(\"btnconfirmdeletelist\"));\r\n\t\t\tclick(locator_split(\"btnconfirmdeletelist\"));\r\n\r\n\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- list is deleted\");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- list is not deleted \"+elementProperties.getProperty(\"lnkdeletelist\"));\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"lnkdeletelist\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\t\r\n\r\n\r\n\t}", "public static void testDeleteTodoView(){\n\n }", "@Test\n public void testDeleteProductShouldCorrect() throws Exception {\n // Mock method\n when(productRepository.findOne(product.getId())).thenReturn(product);\n doNothing().when(productRepository).delete(product);\n\n testResponseData(RequestInfo.builder()\n .request(delete(PRODUCT_DETAIL_ENDPOINT, product.getId()))\n .token(adminToken)\n .httpStatus(HttpStatus.OK)\n .build());\n }", "@Test\n public void deleteSample_onSampleNotFound_throwResourceNotFoundException() {\n assertThrows(\n ResourceNotFoundException.class,\n () -> molecularSampleRepository.delete(UUID.fromString(\"00000000-0000-0000-0000-000000000000\")\n ));\n }", "@Override\n @Modifying\n public ResponseEntity<GenericResponseDTO> deleteTask(String codeTask) {\n Optional<TaskEntity> oldTask;\n try{\n oldTask = taskRepository.findByCodeTask(codeTask);\n if(oldTask.isPresent()){\n taskRepository.delete(oldTask.get());\n return new ResponseEntity<>(GenericResponseDTO.builder()\n .message(\"tarea eliminada\")\n .objectResponse(codeTask)\n .statusCode(HttpStatus.OK.value())\n .build(), HttpStatus.OK);\n }else{\n return new ResponseEntity<>(GenericResponseDTO.builder()\n .message(\"No se pudo eliminar la tarea\")\n .objectResponse(codeTask)\n .statusCode(HttpStatus.OK.value())\n .build(), HttpStatus.OK);\n }\n }catch (Exception e){\n log.error(\"Algo fallo en la creacion de la tarea \" + e);\n return new ResponseEntity<>(GenericResponseDTO.builder()\n .message(\"Error eliminando tarea: \" + e.getMessage())\n .objectResponse(null)\n .statusCode(HttpStatus.BAD_REQUEST.value())\n .build(), HttpStatus.BAD_REQUEST);\n }\n }", "@Test\n public void iTestDeleteUser() {\n given()\n .header(\"X-Authorization\", token)\n .delete(\"/users\")\n .then()\n .statusCode(200);\n }", "@Test\n void testRemoveExistingElement(){\n ToDoList list = new ToDoList();\n ToDo t = new ToDo(\"lala\");\n list.add(t);\n assertTrue(list.remove(t));\n }", "@Test\n public void deleteFlightTest() throws Exception {\n mockMvc.perform(delete(\"/v1/flight/deleteFlight?flightId=1\")\n .contentType(MediaType.APPLICATION_JSON))\n .andExpect(status().is(200));\n\n }", "@Test\n public void testRemoveNegativeNonExistingId() throws Exception{\n Assert.assertFalse(itemDao.delete(\"non existing item\"));\n }", "@Test\n public void myMetingList_deleteAction_shouldRemoveItem() {\n // Given : We remove the element at position 1\n onView(ViewMatchers.withId(R.id.recyclerview)).check(withItemCount(ITEMS_COUNT));\n // When perform a click on a delete icon\n onView(ViewMatchers.withId(R.id.recyclerview))\n .perform(RecyclerViewActions.actionOnItemAtPosition(1, new DeleteViewAction()));\n // Then : the number of element is 1\n onView(ViewMatchers.withId(R.id.recyclerview)).check(withItemCount(ITEMS_COUNT-1));\n }", "public void verifyToDoDeteteBackend(String engagementField, String engagementValue, String todoName, String status) throws SyncFactoryException {\n try {\n getLogger().info(\"Verify To-Do delete status on database.\");\n JSONObject jsonObject = MongoDBService.getToDoObject(getEngagementCollection(), engagementField, engagementValue, todoName);\n System.out.println(\"+++++++++++++++++++++++++++++++++++++++++++jsonObject = \" + jsonObject.get(\"status\"));\n //TODO get from properties file\n if (jsonObject.get(\"status\").toString().equals(status)) {\n NXGReports.addStep(\"Verify To-Do delete status on database.\", LogAs.PASSED, null);\n } else {\n AbstractService.sStatusCnt++;\n NXGReports\n .addStep(\"Verify To-Do delete status on database.\", LogAs.FAILED, new CaptureScreen(CaptureScreen.ScreenshotOf.BROWSER_PAGE));\n }\n } catch (Exception ex) {\n NXGReports.addStep(\"Verify To-Do delete status on database.\", LogAs.FAILED, new CaptureScreen(CaptureScreen.ScreenshotOf.BROWSER_PAGE));\n ex.printStackTrace();\n }\n }", "@Test\n public void test_checkin_delete() throws OAuthUnauthorizedException {\n Response response1 = getTrakt().checkin().deleteActiveCheckin();\n assertThat(response1.getStatus()).isEqualTo(204);\n }", "@Test\n void shouldThrowExceptionWhenTheProjectBeingDeletedWithGivenUuidDoesNotExists() {\n assertThrows(NotFoundException.class, () -> projectService.deleteProject(UUID.randomUUID()));\n }", "@Test\r\n\t\tpublic void readANonExistingRouteFatherList(){\r\n\t\t\trouteFatherDAO.delete(this.routeFather);\r\n\t\t\tList<RouteFather> routeFathers = routeFatherDAO.read();\r\n\t\t\tAssert.assertTrue(\"it should returns empty list\", routeFathers.isEmpty());\r\n\t\t}", "@Test\n public void testDeleteWordFromList() throws Exception {\n System.out.println(\"deleteWordFromList\");\n\n String permalink = testList.getPermalink();\n String word = \"test\";\n WordListApi.deleteWordFromList(token, permalink, word);\n\n // check that the list is now empty\n List<WordListWord> result = WordListApi.getWordsFromList(token, permalink);\n KnickerLogger.getLogger().log(\"****************************************\");\n KnickerLogger.getLogger().log(result.toString());\n KnickerLogger.getLogger().log(\"****************************************\");\n\n assertEquals(result.size(), 0);\n }", "@Test\n void deleteItem() {\n }", "public void deleteAllExistedTodoItems() {\n waitForVisibleElement(createToDoBtnEle, \"createTodoBtn\");\n getLogger().info(\"Try to delete all existed todo items.\");\n try {\n Boolean isInvisible = findNewTodoItems();\n System.out.println(\"isInvisible: \" + isInvisible);\n if (isInvisible) {\n Thread.sleep(smallTimeOut);\n waitForClickableOfElement(todoAllCheckbox);\n getLogger().info(\"Select all Delete mail: \");\n System.out.println(\"eleTodo CheckboxRox is: \" + eleToDoCheckboxRow);\n todoAllCheckbox.click();\n waitForClickableOfElement(btnBulkActions);\n btnBulkActions.click();\n deleteTodoSelectionEle.click();\n waitForCssValueChanged(deteleConfirmForm, \"Delete confirm form\", \"display\", \"block\");\n waitForClickableOfElement(deleteTodoBtn);\n waitForTextValueChanged(deleteTodoBtn, \"Delete Todo Btn\", \"Delete\");\n deleteTodoBtn.click();\n waitForCssValueChanged(deteleConfirmForm, \"Delete confirm form\", \"display\", \"none\");\n getLogger().info(\"Delete all Todo items successfully\");\n NXGReports.addStep(\"Delete all Todo items\", LogAs.PASSED, null);\n } else {\n getLogger().info(\"No items to delele\");\n NXGReports.addStep(\"Delete all Todo items\", LogAs.PASSED, null);\n }\n } catch (Exception e) {\n AbstractService.sStatusCnt++;\n e.printStackTrace();\n NXGReports.addStep(\"Delete all Todo items\", LogAs.FAILED, new CaptureScreen(CaptureScreen.ScreenshotOf.BROWSER_PAGE));\n\n }\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}", "@Test\n public void testGetTravel_RecordNotFoundExceptionTravelId() throws Exception {\n \n mockMVC.perform(get(\"/user/1/travel/404\")\n .header(\"Authorization\", \"1\"))\n .andExpect(status().isNotFound());\n \n verify(databaseMock, times(1)).getUser(anyInt());\n verifyNoMoreInteractions(databaseMock);\n }", "@Test\n void testRemoveNotExistingElement(){\n ToDoList list = new ToDoList();\n ToDo t = new ToDo(\"lala\");\n assertFalse(list.remove(t));\n }", "private void discoverDelete(RoutingContext rctx) {\n rctx.response().end(new ObjectBuilder().build());\n }", "@Test\n public void testDeleteFileFound() throws IOException{\n ExcelFile testFile = new ExcelFile();\n Mockito.when(excelService.deleteFile(anyString())).thenReturn(testFile);\n given().accept(\"application/json\").delete(\"/excel/0\").peek().\n then().assertThat()\n .statusCode(200);\n }", "int deleteByExample(TaskExample example);", "@Test\n\tvoid testDeletePlant() {\n\t\tList<Plant> plant = service.deletePlant(50);\n\t\tassertFalse(plant.isEmpty());\n\t}", "@Test\n public void givenStatus_whenDeleteByEntity_ThenReturnStatus() {\n ThreeEntity entity = new ThreeEntity(1,1,1);\n\n given(threeDao.delete(entity)).willReturn(Status.OK);\n\n StatusEntity status = threeService.delete(entity);\n\n assertEquals(Status.OK.getName(), status.getStatus());\n }", "@Test\n\tpublic void deleteBook() {\n\t\tRestAssured.baseURI = \"http://216.10.245.166\";\n\t\t given().log().all().queryParam(\"ID\", \"321wergt\")\n\t\t\t\t.header(\"Content-Type\", \"application/json\").when()\n\t\t\t\t.delete(\"/Library/DeleteBook.php\").then().log().all()\n\t\t\t\t.assertThat().statusCode(200);\n\n\t\n\t /*JsonPath js = new JsonPath(response); \n\t String id = js.get(\"ID\");\n\t System.out.println(id);*/\n\t \n\t }", "@Test\n public void deleteDoctor() {\n\t\tList<Doctor> doctors = drepository.findByName(\"Katri Halonen\");\n\t\tassertThat(doctors).hasSize(1);\n \tdrepository.deleteById((long) 3);\n \tdoctors = drepository.findByName(\"Katri Halonen\");\n \tassertThat(doctors).hasSize(0);\n }", "int deleteByExample(TNavigationExample example);", "@Test\n public void testAccountDelete() {\n Response response = webTarget\n .path(\"account/1\")\n .request(APPLICATION_JSON)\n .delete();\n assertThat(response.getStatus(), anyOf(is(200), is(202), is(204)));\n }" ]
[ "0.75850064", "0.7510054", "0.7014477", "0.6846323", "0.6815243", "0.6782464", "0.67690426", "0.66584957", "0.66018057", "0.65148115", "0.6497381", "0.6475696", "0.6473616", "0.645296", "0.6434627", "0.64117175", "0.6408009", "0.6404096", "0.64030904", "0.637309", "0.6359565", "0.6355295", "0.6325212", "0.63166416", "0.63050646", "0.62873214", "0.62861645", "0.62831336", "0.6270355", "0.62685275", "0.6261969", "0.62563235", "0.6232574", "0.6205291", "0.62042725", "0.6201792", "0.61657923", "0.61615294", "0.61477596", "0.61474395", "0.6136982", "0.6133108", "0.611894", "0.6112491", "0.61111724", "0.61106867", "0.6094129", "0.60940254", "0.60906035", "0.60855347", "0.60821825", "0.6068517", "0.6058988", "0.6030448", "0.6028444", "0.60264707", "0.60233754", "0.5993798", "0.59936464", "0.5992748", "0.5992329", "0.59876484", "0.598758", "0.5981054", "0.59776515", "0.59703434", "0.59677035", "0.5956167", "0.59433645", "0.59430075", "0.59404725", "0.5933009", "0.5924984", "0.5921245", "0.59004337", "0.5892711", "0.58787626", "0.5869899", "0.5865049", "0.5864946", "0.5862455", "0.58620614", "0.5862061", "0.58617485", "0.5860322", "0.5847175", "0.58448607", "0.58424336", "0.58405447", "0.58395565", "0.58387303", "0.5834814", "0.58317316", "0.58301944", "0.58299375", "0.5828274", "0.58247006", "0.5820073", "0.58125716", "0.57984483" ]
0.7331783
2
When: We try to delete a missing todo form a todolist without items Then: We should get a 404
@Test @Sql({"classpath:sql/truncate.sql", "classpath:/sql/empty_todolist_only.sql"}) public void shouldGet404WhenDeletingMissingTodo() { ApiError apiError = given() .standaloneSetup(controller, apiControllerAdvice) .spec(RequestSpecification.SPEC) .delete("/todolists/1/todos/2") .then() .statusCode(HttpStatus.NOT_FOUND.value()) .extract() .as(ApiError.class); // And: The error response should be correct assertThat(apiError.getErrorType()).isEqualTo(ErrorType.TODO_NOTFOUND); assertThat(apiError.getObjectId()).isEqualTo("2"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n @Sql({\"classpath:sql/truncate.sql\", \"classpath:/sql/single_todolist_with_two_todos.sql\"})\n public void shouldDeleteTodoFromTodoList() {\n ApiTodoList todoList = given()\n .standaloneSetup(controller, apiControllerAdvice)\n .spec(RequestSpecification.SPEC)\n .delete(\"/todolists/1/todos/2\")\n .then()\n .statusCode(HttpStatus.NO_CONTENT.value())\n .extract()\n .as(ApiTodoList.class);\n\n // And: The returned todolist should only contain the correct todo\n assertThat(todoList.getItems().size()).isEqualTo(1);\n assertThat(todoList.getItems().get(0).getText()).isEqualTo(\"Existing Todo 1\");\n\n // And: The todolist should only contain one todo in the db\n doInJPA(this::getEntityManagerFactory, em -> {\n TodoList todoListInDb = em.find(TodoList.class, 1L);\n assertThat(todoListInDb.getItems().size()).isEqualTo(1);\n });\n }", "@Test\n @Sql({\"classpath:sql/truncate.sql\"})\n public void shouldGet404WhenDeletingTodoFromMissingList() {\n ApiError apiError = given()\n .standaloneSetup(controller, apiControllerAdvice)\n .spec(RequestSpecification.SPEC)\n .delete(\"/todolists/1/todos/2\")\n .then()\n .statusCode(HttpStatus.NOT_FOUND.value())\n .extract()\n .as(ApiError.class);\n\n // And: The error response should be correct\n assertThat(apiError.getErrorType()).isEqualTo(ErrorType.TODOLIST_NOTFOUND);\n assertThat(apiError.getObjectId()).isEqualTo(\"1\");\n }", "@Test\n public void givenResourceDoesNotExist_whenDeleteIsTriggered_thenNoExceptions() {\n final long randomId = IDUtil.randomPositiveLong();\n givenEntityExists(randomId);\n\n // When\n getApi().delete(randomId);\n\n // Then\n }", "@Test\n public void delete01(){\n Response responseGet=given().\n spec(spec03).\n when().\n get(\"/198\");\n responseGet.prettyPrint();\n //delete islemi\n Response responseDel =given().\n spec(spec03).\n when().\n delete(\"/198\");\n responseDel.prettyPrint();\n //responseDel yazdirildiginda \"Not Found\" cevabi gelirse status code 404 ile test edilir. Eger bos bir\n // satir donerse Ststus code 200 ile test edilir.\n responseDel.then().assertThat().statusCode(200);\n // Hard assert\n assertTrue(responseDel.getBody().asString().contains(\"\"));\n //softAssertion\n SoftAssert softAssert = new SoftAssert();\n softAssert.assertTrue(responseDel.getBody().asString().contains(\"\"));\n softAssert.assertAll();\n\n\n }", "@Test\n public void delete01() {\n Response responseGet = given().\n spec(spec03).\n when().\n get(\"/3\");\n responseGet.prettyPrint();\n\n Response responseDel = given().\n spec(spec03).\n when().\n delete(\"/3\");\n responseDel.prettyPrint();\n\n\n // responseDel yazdirildiginda not found cevabi gelirse status code 404 ile test edilir.\n // Eger bos bir satir donerse status code 200 ile test edilir.\n\n responseDel.\n then().\n statusCode(200);\n\n\n // hard assert\n\n assertTrue(responseDel.getBody().asString().contains(\" \"));\n\n // soft assertion\n\n SoftAssert softAssert = new SoftAssert();\n softAssert.assertTrue(responseDel.getBody().asString().contains(\" \"));\n softAssert.assertAll();\n }", "@Test\n public void testDeleteItem() throws Exception {\n\n Tracker tracker = new Tracker();\n\n String action = \"0\";\n String yes = \"y\";\n String no = \"n\";\n\n // add first item\n\n String name1 = \"task1\";\n String desc1 = \"desc1\";\n String create1 = \"3724\";\n\n Input input1 = new StubInput(new String[]{action, name1, desc1, create1, yes});\n new StartUI(input1).init(tracker);\n\n // add second item\n\n String name2 = \"task2\";\n String desc2 = \"desc2\";\n String create2 = \"97689\";\n\n Input input2 = new StubInput(new String[]{action, name2, desc2, create2, yes});\n new StartUI(input2).init(tracker);\n\n // get first item id\n\n String id = \"\";\n\n Filter filter = new FilterByName(name1);\n Item[] result = tracker.findBy(filter);\n for (Item item : result) {\n if (item !=null && item.getName().equals(name1)) {\n id = item.getId();\n break;\n }\n }\n\n // delete first item\n\n String action2 = \"2\";\n\n Input input3 = new StubInput(new String[]{action2, id, yes});\n new StartUI(input3).init(tracker);\n\n Assert.assertNull(tracker.findById(id));\n }", "@Test\n public void testDeleteTravel_RecordNotFoundExceptionDeleteTravel() throws Exception {\n doThrow(new RecordNotFoundException()).when(databaseMock).deleteTravel(anyInt());\n \n mockMVC.perform(delete(\"/user/1/travel/1\")\n .header(\"Authorization\", \"1\"))\n .andExpect(status().isNotFound());\n \n verify(databaseMock, times(1)).getUser(anyInt());\n verify(databaseMock, times(1)).deleteTravel(anyInt());\n verifyNoMoreInteractions(databaseMock);\n }", "@Test\n\tpublic void testDeleteNotExistedRecipe() {\n\t\twhen(mockCoffeeMaker.getRecipes()).thenReturn(recipeList);\n\t\tassertEquals(null, mockCoffeeMaker.deleteRecipe(20));\n\t}", "@Test\r\n\tvoid testDeleteToDoItem() {\r\n\t\tSortedList list = new SortedList(\"List\");\r\n\r\n\t\t// case 1: deleting one item from a one-item list\r\n\t\tlist.insert(toDoItem1);\r\n\t\tlist.remove(\"Item 1\");\r\n\t\tif (list.getSize() != 0 || list.getHead() != null) {\r\n\t\t\tfail(\"Removed a single item from a size 1 list incorrectly\");\r\n\t\t}\r\n\r\n\t\t// case 2: deleting one item from a two-item list\r\n\t\tlist.insert(toDoItem1);\r\n\t\tlist.insert(toDoItem2);\r\n\t\tlist.remove(\"Item 2\");\r\n\t\tif (list.getSize() != 1) {\r\n\t\t\tfail(\"Incorrect size: should be 1\");\r\n\t\t}\r\n\t\tif (!list.getHead().getName().equals(\"Item 1\")) {\r\n\t\t\tfail(\"Head set incorrectly: should be \\\"Item 1\\\"\");\r\n\t\t}\r\n\t\tif (list.getHead().getNext() != null) {\r\n\t\t\tfail(\"The next item for head was set incorrectly\");\r\n\t\t}\r\n\r\n\t\tlist.clear();\r\n\r\n\t\t// case 3: adding several items and removing multiple\r\n\t\tlist.insert(toDoItem1);\r\n\t\tlist.insert(toDoItem2);\r\n\t\tlist.insert(toDoItem3);\r\n\t\tlist.insert(toDoItem4);\r\n\t\tlist.insert(toDoItem5);\r\n\t\tlist.insert(toDoItem6);\r\n\t\tlist.remove(\"Item 1\");\r\n\t\tlist.remove(\"Item 6\");\r\n\t\tlist.remove(\"Item 4\");\r\n\r\n\t\tToDoItem tempHead = list.getHead();\r\n\t\tString currList = \"|\";\r\n\t\tString correctList = \"|Item 2|Item 3|Item 5|\";\r\n\r\n\t\twhile (tempHead != null) {\r\n\t\t\tcurrList += tempHead.getName() + \"|\";\r\n\t\t\ttempHead = tempHead.getNext();\r\n\t\t}\r\n\t\tif (!currList.equals(correctList)) {\r\n\t\t\tfail(\"The list was ordered incorrectly after inserting and deleting the case 3 items\");\r\n\t\t}\r\n\t}", "@Test\n void shouldDeleteTask() throws Exception {\n mockMvc\n .perform(MockMvcRequestBuilders\n .delete(\"/v1/task/{id}\", 123))\n .andExpect(MockMvcResultMatchers.status().is(200));\n }", "public void verifyTodoDeletedFrontend(String toDoName, String status) {\n try {\n getLogger().info(\"Verify a Todo not exist. Name: \" + toDoName);\n //Thread.sleep(smallTimeOut);\n //TODO move xpath to properties file, very low peformance\n getDriver().findElement(By.xpath(\"//input[@class='newTodoInput'][@value='\" + toDoName + \"']\"));\n if (status.equals(\"INACTIVE\")) {\n AbstractService.sStatusCnt++;\n NXGReports.addStep(\"Verify a Todo not exist. Name: \" + toDoName, LogAs.FAILED,\n new CaptureScreen(CaptureScreen.ScreenshotOf.BROWSER_PAGE));\n } else {\n NXGReports.addStep(\"Verify a Todo exist. Name: \" + toDoName, LogAs.PASSED, null);\n }\n } catch (NoSuchElementException ex) {\n getLogger().info(ex);\n AbstractService.sStatusCnt++;\n if (status.equals(\"INACTIVE\")) {\n NXGReports.addStep(\"Verify a Todo not exist. Name: \" + toDoName, LogAs.PASSED, null);\n } else {\n AbstractService.sStatusCnt++;\n NXGReports\n .addStep(\"Verify a Todo exist. Name: \" + toDoName, LogAs.FAILED, new CaptureScreen(CaptureScreen.ScreenshotOf.BROWSER_PAGE));\n }\n } catch (Exception ex) {\n getLogger().info(ex.getStackTrace());\n }\n }", "@Test\n public void foodDeletedGoesAway() throws Exception {\n createFood();\n // locate the food item\n\n // delete the food item\n\n // check that food item no longer locatable\n\n }", "@Test\n public void deleteTest(){\n given().pathParam(\"id\",1)\n .when().delete(\"/posts/{id}\")\n .then().statusCode(200);\n }", "@Test\n void incorrectDeletePathTest() {\n URI uri = URI.create(endBody + \"/dummy\");\n\n // get the response\n HttpResponse<String> response = HttpMethods.delete(uri);\n\n // it should receive 404\n assertNotEquals(200, response.statusCode());\n assertEquals(404, response.statusCode());\n }", "public void deleteAllExistedTodoItems() {\n waitForVisibleElement(createToDoBtnEle, \"createTodoBtn\");\n getLogger().info(\"Try to delete all existed todo items.\");\n try {\n Boolean isInvisible = findNewTodoItems();\n System.out.println(\"isInvisible: \" + isInvisible);\n if (isInvisible) {\n Thread.sleep(smallTimeOut);\n waitForClickableOfElement(todoAllCheckbox);\n getLogger().info(\"Select all Delete mail: \");\n System.out.println(\"eleTodo CheckboxRox is: \" + eleToDoCheckboxRow);\n todoAllCheckbox.click();\n waitForClickableOfElement(btnBulkActions);\n btnBulkActions.click();\n deleteTodoSelectionEle.click();\n waitForCssValueChanged(deteleConfirmForm, \"Delete confirm form\", \"display\", \"block\");\n waitForClickableOfElement(deleteTodoBtn);\n waitForTextValueChanged(deleteTodoBtn, \"Delete Todo Btn\", \"Delete\");\n deleteTodoBtn.click();\n waitForCssValueChanged(deteleConfirmForm, \"Delete confirm form\", \"display\", \"none\");\n getLogger().info(\"Delete all Todo items successfully\");\n NXGReports.addStep(\"Delete all Todo items\", LogAs.PASSED, null);\n } else {\n getLogger().info(\"No items to delele\");\n NXGReports.addStep(\"Delete all Todo items\", LogAs.PASSED, null);\n }\n } catch (Exception e) {\n AbstractService.sStatusCnt++;\n e.printStackTrace();\n NXGReports.addStep(\"Delete all Todo items\", LogAs.FAILED, new CaptureScreen(CaptureScreen.ScreenshotOf.BROWSER_PAGE));\n\n }\n\n }", "@Test\n public void removeWorkflow_404() throws Exception {\n\n // PREPARE THE DATABASE\n // Fill in the workflow db\n addMOToDb(1);\n addMOToDb(2);\n Integer id = addMOToDb(3).getId();\n\n // PREPARE THE TEST\n Integer unknownId = id + 1;\n\n // DO THE TEST\n Response response = callAPI(VERB.DELETE, \"/mo/\" + unknownId.toString(), null);\n\n // CHECK RESULTS\n int status = response.getStatus();\n assertEquals(404, status);\n\n String body = response.readEntity(String.class);\n assertEquals(\"No workflow exists with Id:\" + unknownId.toString(), body);\n }", "@Test\n @OperateOnDeployment(\"server\")\n public void shouldDeleteResourcesByIds() {\n given().header(\"Authorization\", \"Bearer access_token\").expect().statusCode(200).when().delete(\n getBaseTestUrl() + \"/1/tags/delete/json/ids;1;3;\");\n // Then then the resources should be deleted\n given().header(\"Authorization\", \"Bearer access_token\").expect().body(\"size\", equalTo(1)).and().expect().body(\"items.item.name\",\n hasItem(\"Concept\")).and().expect().body(\"items.item.name\", not(hasItem(\"Task\"))).and().expect().body(\"items.item.name\",\n not(hasItem(\"Reference\"))).when().get(getBaseTestUrl() + \"/1/tags/get/json/all?expand=\" +\n \"{\\\"branches\\\":[{\\\"trunk\\\":{\\\"name\\\":\\\"tags\\\"}}]})\");\n }", "@Test\n public void testDeleteShoppinglistsIdEntriesEntryIdAction() throws ClientException, IOException, ProcessingException {\n CloudResponse response = this.actions.deleteShoppinglistsIdEntriesEntryIdAction(\"{id}\", \"{entryId}\");\n List<Integer> expectedResults = Arrays.asList(204, 400, 403, 404);\n LOG.info(\"Got status {}\", response.getStatusLine());\n Assert.assertTrue(expectedResults.contains(response.getStatusLine().getStatusCode()));\n\n if(response.getStatusLine().getStatusCode() == 400) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 403) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 404) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n \n }", "@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 verifyEmptyToDoList() {\n getLogger().info(\"Verify empty todo list\");\n if (verifyEmptyToDoImage()) {\n NXGReports.addStep(\"All ToDo deleted, Image Empty exist\", LogAs.PASSED, null);\n } else {\n NXGReports.addStep(\"Fail: Delete all fail, Image Empty not exist\", LogAs.FAILED,\n new CaptureScreen(CaptureScreen.ScreenshotOf.BROWSER_PAGE));\n }\n }", "@Test\n\tpublic void testDeleteExistedRecipe() {\n\t\twhen(mockCoffeeMaker.getRecipes()).thenReturn(recipeList);\n\t\tassertEquals(\"Coffee\", mockCoffeeMaker.deleteRecipe(0));\n\t}", "@Test\n public void myMetingList_deleteAction_shouldRemoveItem() {\n // Given : We remove the element at position 1\n onView(ViewMatchers.withId(R.id.recyclerview)).check(withItemCount(ITEMS_COUNT));\n // When perform a click on a delete icon\n onView(ViewMatchers.withId(R.id.recyclerview))\n .perform(RecyclerViewActions.actionOnItemAtPosition(1, new DeleteViewAction()));\n // Then : the number of element is 1\n onView(ViewMatchers.withId(R.id.recyclerview)).check(withItemCount(ITEMS_COUNT-1));\n }", "public void deleteTodoById(@PathVariable(\"id\") long id, Model model) throws RecordNotFoundException {\n TodoItem todoItem = getTodoItemById(id);\n todoItemRepository.delete(todoItem);\n model.addAttribute(\"todoItems\", todoItemRepository.findAll());\n }", "@Test\n public void testDeleteTravel_NumberFormatExceptionTravelId() throws Exception {\n \n mockMVC.perform(delete(\"/user/1/travel/a\")\n .header(\"Authorization\", \"1\"))\n .andExpect(status().isInternalServerError());\n \n verifyNoMoreInteractions(databaseMock);\n }", "public void delete(T ob) throws ToDoListException;", "@Test\r\n public void testDeleteNonExistRecipe() {\r\n assertNull(coffeeMaker.deleteRecipe(1)); // Test do not exist recipe\r\n }", "@Test\n public void deleteOrderTest() {\n Long orderId = 10L;\n api.deleteOrder(orderId);\n\n verify(exactly(1), deleteRequestedFor(urlEqualTo(\"/store/order/10\")));\n }", "@Test\n public void testDeleteShoppinglistsIdAction() throws ClientException, IOException, ProcessingException {\n CloudResponse response = this.actions.deleteShoppinglistsIdAction(\"{id}\");\n List<Integer> expectedResults = Arrays.asList(204, 400, 403, 404);\n LOG.info(\"Got status {}\", response.getStatusLine());\n Assert.assertTrue(expectedResults.contains(response.getStatusLine().getStatusCode()));\n\n if(response.getStatusLine().getStatusCode() == 400) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 403) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 404) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n \n }", "public void test_03() {\n\n\t\tResponse reponse = given().\n\t\t\t\twhen().\n\t\t\t\tdelete(\"http://localhost:3000/posts/_3cYk0W\");\n\n\t\tSystem.out.println(\"updated response data \"+ reponse.asString());\t\t\n\t}", "@Test\n\t@Override\n\tpublic void testDeleteObjectNotFoundJson() throws Exception {\n\t}", "@Test\n public void testDeleteTravel_RecordNotFoundExceptionGetUser() throws Exception {\n when(databaseMock.getUser(anyInt())).thenThrow(new RecordNotFoundException());\n \n mockMVC.perform(delete(\"/user/1/travel/1\")\n .header(\"Authorization\", \"1\"))\n .andExpect(status().isNotFound());\n \n verify(databaseMock, times(1)).getUser(anyInt());\n verifyNoMoreInteractions(databaseMock);\n }", "@Test\n void deleteSuccess() {\n dao.delete(dao.getById(3));\n assertNull(dao.getById(3));\n }", "@Test\r\n\tpublic void testDelete() {\n\t\tint todos = modelo.getAll().size();\r\n\r\n\t\tassertTrue(modelo.delete(1));\r\n\r\n\t\t// comprobar que este borrado\r\n\t\tassertNull(modelo.getById(1));\r\n\r\n\t\t// borrar un registro que no existe\r\n\t\tassertFalse(modelo.delete(13));\r\n\t\tassertNull(modelo.getById(13));\r\n\r\n\t\tassertEquals(\"debemos tener un registro menos\", (todos - 1), modelo\r\n\t\t\t\t.getAll().size());\r\n\r\n\t}", "@Test\n public void testDeleteProductShouldThrowNotFoundWhenProductNotFound() throws Exception {\n // Mock method\n when(productRepository.findOne(product.getId())).thenReturn(null);\n\n testResponseData(RequestInfo.builder()\n .request(delete(PRODUCT_DETAIL_ENDPOINT, product.getId()))\n .token(adminToken)\n .httpStatus(HttpStatus.NOT_FOUND)\n .build());\n }", "@Test\n public void testDeleteTravel() throws Exception{\n \n doNothing().when(databaseMock).deleteTravel(anyInt());\n \n mockMVC.perform(delete(\"/user/1/travel/1\")\n .header(\"Authorization\", \"1\"))\n .andExpect(status().isNoContent());\n \n verify(databaseMock, times(1)).getUser(1);\n verify(databaseMock, times(1)).deleteTravel(1);\n verifyNoMoreInteractions(databaseMock);\n }", "@Test\n public void testDeleteFileNotFound() throws IOException{\n ExcelFile testFile = new ExcelFile();\n Mockito.when(excelService.deleteFile(anyString())).thenReturn(null);\n given().accept(\"application/json\").delete(\"/excel/0\").peek().\n then().assertThat()\n .statusCode(404);\n }", "@Test\n void deleteSuccess() {\n dao.delete(dao.getById(2));\n assertNull(dao.getById(2));\n }", "public void deleteRequest() {\n assertTrue(true);\n }", "@Test\n void deleteNoteSuccess() {\n noteDao.delete(noteDao.getById(2));\n assertNull(noteDao.getById(2));\n }", "public void verifyToDoNotExist(String todoName) {\n try {\n getLogger().info(\"Verify deleted todo: \" + todoName);\n boolean isExisted = false;\n for (int i = 0; i < eleToDoNameRow.size(); i++) {\n if (todoName.equals(getTextByAttributeValue(eleToDoNameRow.get(i), \"Todo expected not Exist\"))) {\n AbstractService.sStatusCnt++;\n NXGReports.addStep(\"Fail: Todo still existed: \" + todoName, LogAs.FAILED,\n new CaptureScreen(CaptureScreen.ScreenshotOf.BROWSER_PAGE));\n isExisted = true;\n }\n }\n if (!isExisted) {\n NXGReports.addStep(\"Todo deleted success\", LogAs.PASSED, null);\n }\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }", "@Test\n public void hTestDeletePlaylist() {\n given()\n .header(\"X-Authorization\", token)\n .delete(\"/playlists/\" + playlistId)\n .then()\n .statusCode(200);\n }", "@Test\n void testDelete_incorrectId() {\n assertThrows(NotFoundException.class, () -> propertyInfoDao.delete(\"randomString\"));\n }", "@Test\n public void testDeleteList() throws Exception {\n System.out.println(\"deleteList\");\n String permalink = testList.getPermalink();\n\n WordListApi.deleteList(token, permalink);\n }", "@Test\n public void deleteByHealthCodeSilentlyFails() {\n dao.deleteUploadsForHealthCode(\"nonexistentHealthCode\");\n }", "@Test\n public void testRemoveNegativeNonExistingId() throws Exception{\n Assert.assertFalse(itemDao.delete(\"non existing item\"));\n }", "@Test\n public void testExposesDelete() throws Exception {\n List<Link> customers = findCustomersLinks();\n assertThat(\"Customers exist to work with\",\n customers.size(),\n greaterThan(0));\n\n Link customer = customers.get(customers.size() - 1);\n\n mockMvc\n .perform(delete(customer.getHref()))\n .andExpect(status().isNoContent());\n\n mockMvc\n .perform(get(customer.getHref()))\n .andExpect(status().isNotFound());\n }", "@GetMapping(\"/deleteItem\")\n\tpublic String deleteItem(HttpServletRequest servletRequest) {\n\t\t\n\t\ttoDoListService.deleteById(Long.parseLong(servletRequest.getParameter(\"itemId\"))); // Delete the to do list item record.\n\t\t\n\t\treturn \"redirect:/welcome\";\n\t}", "@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}", "@Test\n\tpublic void testDeleteIncorrectParam() {\n\n\t\tResponse response = piiController.delete(null);\n\t\t\n\t\tverifyZeroInteractions(mPiiService);\n\t\tverifyZeroInteractions(mPuidDao);\n\t\tassertEquals(400, response.getStatus());\n\t\t\n\t\tObject entity = response.getEntity();\n\t\tassertNull(entity);\n\t}", "@Test\n void deleteItem() {\n }", "@Test\n void testDeleteOnlyReportErrorsIfItAddsNewInformation() {\n\n Setup setup =\n new Setup.Builder()\n .trackedEntity(\"xK7H53f4Hc2\")\n .isNotValid()\n .enrollment(\"t1zaUjKgT3p\")\n .isNotValid()\n .relationship(\"Te3IC6TpnBB\", trackedEntity(\"xK7H53f4Hc2\"), enrollment(\"t1zaUjKgT3p\"))\n .isNotValid()\n .build();\n\n PersistablesFilter.Result persistable =\n filter(setup.bundle, setup.invalidEntities, TrackerImportStrategy.DELETE);\n\n assertAll(\n () -> assertIsEmpty(persistable.get(TrackedEntity.class)),\n () -> assertIsEmpty(persistable.get(Enrollment.class)),\n () -> assertIsEmpty(persistable.get(Relationship.class)),\n () -> assertIsEmpty(persistable.getErrors()));\n }", "@Test\n void deleteList() {\n }", "@Test \n public void testReperimentoNumeroInesistente() {\n Response rDelete = rubrica.path(nome+cognome).path(nome+cognome).request().delete();\n \n // Verifica che la risposta sia 404 Not Found\n assertEquals(Response.Status.NOT_FOUND.getStatusCode(),rDelete.getStatus());\n }", "@Test\n void deleteMovieById_whenExist() throws Exception {\n // Setup\n when(movieService.deleteMovieById(ArgumentMatchers.any(Long.class))).thenReturn(true);\n\n // Exercise\n mockMvc.perform(delete(baseUrl+ \"/1\").accept(MediaType.APPLICATION_JSON))\n .andExpect(status().isOk())\n .andExpect(jsonPath(\"$\").doesNotExist());\n }", "@Test\n public void testDAM31101001() {\n // Data preparation\n {\n clearAndCreateTestDataForBook();\n }\n\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n\n TodoListPage todoListPage = dam3IndexPage.dam31101001Click();\n\n // Confirmation of database state before any update\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"3\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"7\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"10\"));\n\n TodoRegisterPage todoRegisterPage = todoListPage.registerTodo();\n\n todoRegisterPage.setTodoCategory(\"CA3\");\n todoRegisterPage.setTodoId(\"0000001000\");\n\n // checking whether the delete statement really entered as a title value really delete the records.\n todoRegisterPage.setTodoTitle(\"<![CDATA[delete * from t_todo;]]>\");\n\n // add a todo to confirm sql injection does not occur.\n todoRegisterPage.addTodo();\n webDriverOperations.displayPage(getPackageRootUrl());\n dam3IndexPage = new DAM3IndexPage(driver);\n\n todoListPage = dam3IndexPage.dam31101001Click();\n\n // Confirmation of database state whether the title value has been executed and deleted the ToDos?\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"3\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"8\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"11\"));\n\n TodoDetailsPage todoDetailsPage = todoListPage.displayTodoDetail(\n \"0000001000\");\n\n // title value is inserted as it is.\n assertThat(todoDetailsPage.getTodoTitle(), equalTo(\n \"&lt;![CDATA[delete * from t_todo;]]&gt;\"));\n assertThat(todoDetailsPage.getTodoID(), equalTo(\"0000001000\"));\n assertThat(todoDetailsPage.getTodoCategory(), equalTo(\"CA3\"));\n assertThat(todoDetailsPage.getTodoStatus(), equalTo(\"false\"));\n assertThat(todoDetailsPage.getTodoCreatedDate(), equalTo(\"2016/12/28\"));\n assertThat(todoDetailsPage.getTodoVersion(), equalTo(\"0\"));\n }", "@Test\n\tvoid testDeletePlant() {\n\t\tList<Plant> plant = service.deletePlant(50);\n\t\tassertFalse(plant.isEmpty());\n\t}", "@Test\n @OperateOnDeployment(\"server\")\n public void shouldFailToGetResourceWhenIncorrectScopeForEndpoint() {\n given().header(\"Authorization\", \"Bearer access_token\").expect().statusCode(403).when().delete(\n getBaseTestUrl() + \"/1/category/delete/json/1\");\n }", "@After(value = \"@deleteList\", order = 1)\n public void deleteList() {\n String listId = context.getDataCollection((\"list\")).get(\"id\");\n context.setRequestSpec(AuthenticationUtils.getLoggedReqSpec());\n given(context.getRequestSpecification()).when().delete(\"/lists/\".concat(listId));\n }", "@Test\n public void deletePerson_ShouldReturnError404_WhenPersonNotFoundException() {\n Mockito.doThrow(PersonNotFoundException.class).when(personService).deletePerson(3L);\n\n //act\n ResponseEntity<Person> response = personController.deletePerson(3L);\n\n //assert\n assertEquals(HttpStatus.NOT_FOUND, response.getStatusCode());\n assertEquals(null, response.getBody());\n }", "@Test\n public void testEditTravel_RecordNotFoundExceptionTravelId() throws Exception {\n mockMVC.perform(put(\"/user/1/travel/404\")\n .contentType(TestUtil.APPLICATION_JSON_UTF8)\n .content(TestUtil.convertObjectToJsonBytes(dto))\n .header(\"Authorization\", \"1\"))\n .andExpect(status().isNotFound());\n \n verify(databaseMock, times(1)).getUser(anyInt());\n verifyNoMoreInteractions(databaseMock);\n }", "public static void testDeleteTodoView(){\n\n }", "@Test\n public void testDelete() throws Exception {\n // pretend the entity was deleted\n doNothing().when(Service).deleteCitation(any(String.class));\n\n // call delete\n ModelAndView mav = Controller.delete(\"\");\n\n // test to see that the correct view is returned\n Assert.assertEquals(\"result\", mav.getViewName());\n\n // test to see that Json is formated properly\n Map<String, Object> map = mav.getModel();\n String result = (String) map.get(\"message\");\n\n Assert.assertEquals(\"{\\\"result\\\":\\\"deleted\\\"}\", result);\n }", "@Test\n public void removeWorkflow_400() throws Exception {\n\n // PREPARE THE DATABASE\n // Fill in the workflow db\n addMOToDb(1);\n addMOToDb(2);\n addMOToDb(3);\n\n // PREPARE THE TEST\n String badId = \"bad_id\";\n\n // DO THE TEST\n Response response = callAPI(VERB.DELETE, \"/mo/\" + badId, null);\n\n // CHECK RESULTS\n int status = response.getStatus();\n assertEquals(400, status);\n\n String body = response.readEntity(String.class);\n assertEquals(\"\", body);\n }", "@Test\n public void testDeleteProductShouldCorrect() throws Exception {\n // Mock method\n when(productRepository.findOne(product.getId())).thenReturn(product);\n doNothing().when(productRepository).delete(product);\n\n testResponseData(RequestInfo.builder()\n .request(delete(PRODUCT_DETAIL_ENDPOINT, product.getId()))\n .token(adminToken)\n .httpStatus(HttpStatus.OK)\n .build());\n }", "public DeleteItemOutcome deleteItem(DeleteItemSpec spec);", "@Test\n void deleteSuccess() {\n genericDao.delete(genericDao.getById(3));\n assertNull(genericDao.getById(3));\n }", "@Test\n public void testEditTravel_ForeignKeyNotFoundException() throws Exception {\n doThrow(new ForeignKeyNotFoundException()).when(databaseMock).updateTravel(anyInt(), anyInt(), any(Travel.class));\n \n mockMVC.perform(put(\"/user/1/travel/1\")\n .contentType(TestUtil.APPLICATION_JSON_UTF8)\n .content(TestUtil.convertObjectToJsonBytes(dto))\n .header(\"Authorization\", \"1\"))\n .andExpect(status().isNotFound());\n \n verify(databaseMock, times(1)).getUser(anyInt());\n verify(databaseMock, times(1)).updateTravel(anyInt(), anyInt(), any(Travel.class));\n verifyNoMoreInteractions(databaseMock);\n }", "@Test\n void deleteTest() {\n URI uri = URI.create(endBody + \"/delete\");\n\n // get the response\n HttpResponse<String> response = HttpMethods.delete(uri);\n\n assertEquals(200, response.statusCode());\n }", "@Test\n void deleteSuccess() {\n genericDAO.delete(genericDAO.getByID(2));\n assertNull(genericDAO.getByID(2));\n }", "@Test\n public void shouldGive404ResponseCodeIfAttemptIsMadeToDeleteNonExistentPayment() throws Exception {\n ResponseEntity<String> deleteResponse = restTemplate.exchange(paymentsUrl + \"/nonexistentPayment\", HttpMethod.DELETE, null, String.class);\n //then: the response should be 404 'not found':\n assertEquals(HttpStatus.NOT_FOUND, deleteResponse.getStatusCode());\n }", "@Test\n public void myNeighboursList_deleteAction_shouldRemoveItem() {\n // Given : We remove the element at position 2\n onView(allOf(ViewMatchers.withId(R.id.list_neighbours),isDisplayed()))\n .check(withItemCount(ITEMS_COUNT));\n // When perform a click on a delete icon\n onView(allOf(ViewMatchers.withId(R.id.list_neighbours),isDisplayed()))\n .perform(RecyclerViewActions.actionOnItemAtPosition(1, new DeleteViewAction()));\n // Then : the number of element is 11\n onView(allOf(ViewMatchers.withId(R.id.list_neighbours),isDisplayed())).check(withItemCount(ITEMS_COUNT-1));\n }", "public Todo remove(long todoId) throws NoSuchTodoException;", "@Test\n void testRemoveNotExistingElement(){\n ToDoList list = new ToDoList();\n ToDo t = new ToDo(\"lala\");\n assertFalse(list.remove(t));\n }", "@Test\n public void myNeighboursList_deleteAction_shouldRemoveItem() {\n // Given : We remove the element at position 2\n onView(ViewMatchers.withId(R.id.list_neighbours)).check(withItemCount(ITEMS_COUNT));\n // When perform a click on a delete icon\n onView(ViewMatchers.withId(R.id.list_neighbours))\n .perform(RecyclerViewActions.actionOnItemAtPosition(1, new DeleteViewAction()));\n // Then : the number of element is 11\n onView(ViewMatchers.withId(R.id.list_neighbours)).check(withItemCount(ITEMS_COUNT-1));\n\n }", "@Test\n void testDeleteCity() {\n CityList cityList = mockCityList();\n cityList.delete(mockCity());\n\n assertFalse(cityList.hasCity(mockCity()));\n assertTrue(cityList.countCities() == 0);\n\n }", "void deleteRecipe(Recipe recipe) throws ServiceFailureException;", "@Test\r\n public void testDelete() {\r\n assertTrue(false);\r\n }", "@Test\n public void removeNegativeIdItemTest() {\n List<Item> items = itemSrv.getAllItems();\n Assert.assertNotNull(\"List of items is null\", items);\n\n Assert.assertEquals(\"Wrong initial size of the list, should be 0\", 0, items.size());\n\n Assert.assertEquals(\"Should have returned REMOVE_NON_EXISTENT code\", ErrCode.REMOVE_NON_EXISTENT, itemSrv.removeItemById(-1L));\n Assert.assertEquals(\"Negative and non-existing item deletion was attempted, count should be still 0\", 0, itemSrv.getAllItems().size());\n }", "@Test\n void testDeleteAllEntries() {\n ToDoList todoList = new ToDoList();\n ToDo todo1 = new ToDo(\"Todo1\");\n todo1.setInhalt(\"Dies ist ein Test\");\n todoList.add(todo1);\n todo1.setStatus(Status.BEENDET);\n todoList.add(new ToDo((\"Todo2\")));\n ToDo todo3 = new ToDo(\"Todo3\");\n todo3.setInhalt(\"3+3=6\");\n todo3.setStatus(Status.IN_ARBEIT);\n todoList.add(todo3);\n\n //Entferne alle Elemente mittels Iterator\n Iterator it = todoList.iterator();\n while (it.hasNext()){\n it.next();\n it.remove();\n }\n\n assertEquals(0, todoList.size());\n }", "@Test\n public void removing_item_that_does_not_exist_should_throw_exception() {\n\n assertThrows(itemNotFoundException.class,\n ()->restaurant.removeFromMenu(\"French fries\"));\n }", "@Test\r\n\tpublic void deleteProductDetails() {\r\n\t\tRestAssured.baseURI = \"http://localhost:9000/products\";\r\n\t\tRequestSpecification request = RestAssured.given();\r\n\t\tJSONObject requestParams = new JSONObject();\r\n\t\trequestParams.put(\"name\", \"Almond\");\r\n\t\trequest.header(\"Content-Type\", \"application/json\");\r\n\t\trequest.body(requestParams.toString());\r\n\t\tResponse response = request.delete(\"/7\");\r\n\t\tSystem.out.println(\"DELETE Responce Body ----->\" + response.asString());\r\n\t\tint statusCode = response.getStatusCode();\r\n\t\tAssert.assertEquals(statusCode, 200);\r\n\r\n\t}", "@Test\n public void testAddTravel_ForeignKeyNotFoundException() throws Exception {\n when(databaseMock.createTravel(anyInt(), any(Travel.class)))\n .thenThrow(new ForeignKeyNotFoundException());\n \n mockMVC.perform(post(\"/user/1/travel\")\n .contentType(TestUtil.APPLICATION_JSON_UTF8)\n .content(TestUtil.convertObjectToJsonBytes(dto))\n .header(\"Authorization\", \"1\"))\n .andExpect(status().isNotFound());\n \n verify(databaseMock, times(1)).getUser(anyInt());\n verify(databaseMock, times(1)).createTravel(anyInt(), any(Travel.class));\n verifyNoMoreInteractions(databaseMock);\n }", "public void deletelist(){\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- current list should be deleted\");\r\n\t\ttry{\r\n\r\n\t\t\twaitForElement(locator_split(\"lnkdeletelist\"));\r\n\t\t\tclick(locator_split(\"lnkdeletelist\"));\r\n\r\n\t\t\tThread.sleep(3000);\r\n\t\t\twaitForElement(locator_split(\"btnconfirmdeletelist\"));\r\n\t\t\tclick(locator_split(\"btnconfirmdeletelist\"));\r\n\r\n\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- list is deleted\");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- list is not deleted \"+elementProperties.getProperty(\"lnkdeletelist\"));\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"lnkdeletelist\").toString().replace(\"By.\", \" \")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\t\r\n\r\n\r\n\t}", "public void testDelete() {\n TDelete_Return[] PriceLists_delete_out = priceListService.delete(new String[] { path + alias });\n\n // test if deletion was successful\n assertEquals(\"delete result set\", 1, PriceLists_delete_out.length);\n\n TDelete_Return PriceList_delete_out = PriceLists_delete_out[0];\n\n assertNoError(PriceList_delete_out.getError());\n\n assertEquals(\"deleted?\", true, PriceList_delete_out.getDeleted());\n }", "@Test\r\n\tpublic void deleteAnExistingRouteFather(){\r\n\t\tRouteFather deleted = routeFatherDAO.delete(this.routeFather);\r\n\t\tAssert.assertNotNull(\"it should returns a not null object\", deleted);\r\n\t}", "@Test\n public void testDeleteTravel_NumberFormatExceptionUserId() throws Exception {\n \n mockMVC.perform(delete(\"/user/a/travel/1\")\n .header(\"Authorization\", \"1\"))\n .andExpect(status().isInternalServerError());\n \n verifyNoMoreInteractions(databaseMock);\n }", "@Test\n void testRemoveExistingElement(){\n ToDoList list = new ToDoList();\n ToDo t = new ToDo(\"lala\");\n list.add(t);\n assertTrue(list.remove(t));\n }", "@Test\n public void deleteTaskByIdAndGettingTasks() {\n mDatabase.taskDao().insertTask(TASK);\n\n //When deleting a task by id\n mDatabase.taskDao().deleteTaskById(TASK.getId());\n\n //When getting the tasks\n List<Task> tasks = mDatabase.taskDao().getTasks();\n // The list is empty\n assertThat(tasks.size(), is(0));\n }", "@Test\n void deleteSuccess() {\n\n UserDOA userDao = new UserDOA();\n User user = userDao.getById(1);\n String orderDescription = \"February Large Test-Tshirt Delete\";\n\n Order newOrder = new Order(orderDescription, user, \"February\");\n user.addOrder(newOrder);\n\n dao.delete(newOrder);\n List<Order> orders = dao.getByPropertyLike(\"description\", \"February Large Test-Tshirt Delete\");\n assertEquals(0, orders.size());\n }", "@Test\n public void testDAM30204001() {\n {\n clearAndCreateTestDataForBook();\n }\n\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n // Connect to DB and fetch the Todo list\n TodoListPage todoListPage = dam3IndexPage.dam30204001Click();\n\n TodoRegisterPage registerTodoPage = todoListPage.registerTodo();\n\n registerTodoPage.setTodoId(\"0000000030\");\n registerTodoPage.setTodoCategory(\"CA2\");\n\n TodoDetailsPage todoDetailsPage = registerTodoPage\n .addTodoWithNullTitle();\n // confirm that the ToDo registered with null title is saved in DB\n assertThat(todoDetailsPage.getTodoTitle(), equalTo(\"\"));\n assertThat(todoDetailsPage.getTodoID(), equalTo(\"0000000030\"));\n assertThat(todoDetailsPage.getTodoCategory(), equalTo(\"CA2\"));\n assertThat(todoDetailsPage.getTodoStatus(), equalTo(\"In-Complete\"));\n assertThat(todoDetailsPage.getTodoCreatedDate(), equalTo(\"2016/12/28\"));\n assertThat(todoDetailsPage.getTodoVersion(), equalTo(\"0\"));\n }", "@Test\r\n\tpublic void testDeleteCheckList() {\n\t\tthis.checklistDAO.saveOrUpdateCheckList(this.checklist);\r\n\t\tString id = this.checklist.getId();\r\n\r\n\t\t// Test the method deleteCheckList with an checklist existing into the\r\n\t\t// db.\r\n\t\tthis.checklistDAO.deleteCheckList(this.checklist);\r\n\r\n\t\t// See if this.checklist is now absent in the db.\r\n\t\tCheckList checklistTmp = (CheckList) this.checklistDAO.getCheckList(id);\r\n\t\tassertNull(checklistTmp);\r\n\r\n\t\t// Test the method deleteCheckList with an checklist unexisting into the\r\n\t\t// db.\r\n\t\t// Normally here there are no exception thrown.\r\n\t\tthis.checklistDAO.deleteCheckList(this.checklist);\r\n\t}", "public void verifyToDoDeteteBackend(String engagementField, String engagementValue, String todoName, String status) throws SyncFactoryException {\n try {\n getLogger().info(\"Verify To-Do delete status on database.\");\n JSONObject jsonObject = MongoDBService.getToDoObject(getEngagementCollection(), engagementField, engagementValue, todoName);\n System.out.println(\"+++++++++++++++++++++++++++++++++++++++++++jsonObject = \" + jsonObject.get(\"status\"));\n //TODO get from properties file\n if (jsonObject.get(\"status\").toString().equals(status)) {\n NXGReports.addStep(\"Verify To-Do delete status on database.\", LogAs.PASSED, null);\n } else {\n AbstractService.sStatusCnt++;\n NXGReports\n .addStep(\"Verify To-Do delete status on database.\", LogAs.FAILED, new CaptureScreen(CaptureScreen.ScreenshotOf.BROWSER_PAGE));\n }\n } catch (Exception ex) {\n NXGReports.addStep(\"Verify To-Do delete status on database.\", LogAs.FAILED, new CaptureScreen(CaptureScreen.ScreenshotOf.BROWSER_PAGE));\n ex.printStackTrace();\n }\n }", "@Test\n void testGetOpenToDos() {\n ToDoList todoList = new ToDoList();\n ToDo todo1 = new ToDo(\"Todo1\");\n todoList.add(todo1);\n todoList.add(new ToDo((\"Todo2\")));\n assertEquals(2, todoList.getOpenEntries());\n\n ToDo todo3 = new ToDo(\"ToDo3\");\n todoList.add(todo3);\n assertEquals(3, todoList.getOpenEntries());\n todo3.setStatus(Status.IN_ARBEIT);\n todo3.setStatus(Status.BEENDET);\n assertEquals(2, todoList.getOpenEntries());\n todoList.remove(todo3);\n assertEquals(2, todoList.getOpenEntries());\n todoList.remove(todo1);\n assertEquals(1, todoList.getOpenEntries());\n }", "@Test\n public void testDAM30802001() {\n // Data preparation\n {\n clearAndCreateTestDataForBook();\n }\n\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n\n TodoListPage todoListPage = dam3IndexPage.dam30802001Click();\n\n // Confirmation of database state before batch update\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"3\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"7\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"10\"));\n\n // set date : the completed todos having creation date before this date would be deleted in batch\n todoListPage.setCutOffDate(\"2016-12-30\");\n\n todoListPage = todoListPage.batchDelete();\n\n String cntOfUpdatedTodo = todoListPage.getCountOfBatchRegisteredTodos();\n\n assertThat(cntOfUpdatedTodo, equalTo(\n \"Total Todos Registered/Updated in Batch : 3\"));\n\n // Confirmation of database state before batch update\n assertThat(todoListPage.getCompletedTodoCount(), equalTo(\"0\"));\n assertThat(todoListPage.getIncompletTodoCount(), equalTo(\"7\"));\n assertThat(todoListPage.getTotalTodoCount(), equalTo(\"7\"));\n }", "@When(\"^users want to delete a project with guid not existent$\")\n public void usersWantToDeleteAProjectWithGuidNotExistent(DataTable dataTable) {\n rs.get().contentType(ContentType.JSON).body(dataTableToJson(dataTable.asList(BodyElement.class))).delete(\"/project\");\n response.set(rs.get().contentType(ContentType.JSON).body(dataTableToJson(dataTable.asList(BodyElement.class))).delete(\"/project\"));\n }", "@Test\r\n\tpublic void testDeleteSuggestionButNoSuggestionToDelete() {\n\t\tWebDriver driver2 = new HtmlUnitDriver();\r\n\t\tadminLogin();\r\n\t\tSuggestion suggestion = suggestionRepository.save(new Suggestion(null, \"suggestion\", true));\r\n\t\t// go to \"/suggestions\"\r\n\t\tdriver.get(suggestionsUrl);\r\n\t\tassertThat(driver.getPageSource()).contains(\"Home\", \"New suggestion\", \"Logged as Admin\", \"Logout\");\r\n\t\tassertThat(driver.findElement(By.id(\"suggestions_table\")).getText()).contains(\"ID\", \"Suggestions\",\r\n\t\t\t\tsuggestion.getId().toString(), suggestion.getSuggestionText());\r\n\t\t// go to \"/suggestions/delete/{id}\"\r\n\t\tdriver.findElement(By.linkText(\"Delete\")).click();\r\n\r\n\t\t// user number 2 log himself\r\n\t\t// go to login page\r\n\t\tdriver2.get(loginUrl);\r\n\t\t// fill the form\r\n\t\tdriver2.findElement(By.name(\"username\")).sendKeys(USERNAME);\r\n\t\tdriver2.findElement(By.name(\"password\")).sendKeys(PASSWORD);\r\n\t\t// submit login\r\n\t\tdriver2.findElement(By.name(\"btn_submit\")).click();\r\n\t\t// go to suggestions page\r\n\t\tdriver2.get(suggestionsUrl);\r\n\t\t// go to \"/suggestions/delete/{id}\"\r\n\t\tdriver2.findElement(By.linkText(\"Delete\")).click();\r\n\t\t// delete by clicking the button\r\n\t\tassertThat(suggestionRepository.findAll().size()).isEqualTo(1);\r\n\t\tdriver2.findElement(By.name(\"btn_submit\")).click();\r\n\t\tassertThat(suggestionRepository.findAll().size()).isZero();\r\n\t\tdriver2.quit();\r\n\t\t// user 1 try to delete but the suggestion does not exist anymore\r\n\t\t// submit the edit\r\n\t\tdriver.findElement(By.name(\"btn_submit\")).click();\r\n\t\tassertThat(driver.getCurrentUrl()).isEqualTo(errorUrl);\r\n\t\tassertThat(driver.getPageSource()).contains(\"Error\", \"Home\",\r\n\t\t\t\t\"It is not possible to delete a suggestion with the id: \" + suggestion.getId());\r\n\t}", "@Test\r\n\t\tpublic void readANonExistingRouteFatherList(){\r\n\t\t\trouteFatherDAO.delete(this.routeFather);\r\n\t\t\tList<RouteFather> routeFathers = routeFatherDAO.read();\r\n\t\t\tAssert.assertTrue(\"it should returns empty list\", routeFathers.isEmpty());\r\n\t\t}", "private void assertRemoved()\n\t{\n\t\ttry\n\t\t{\n\t\t\ttestController.getContentTypeDefinitionVOWithId(testDefinition.getId());\n\t\t\tfail(\"The ContentTypeDefinition was not deleted\");\n\t\t}\n\t\tcatch(Exception e)\n\t\t{ /* expected */ }\n\t}", "@Test\n void testDeleteException() {\n CityList cityList = mockCityList();\n cityList.delete(mockCity());\n\n /**create a city and don't add it to the mockCityList**/\n City throwsCity = new City(\"x\",\"y\");\n\n /**citation: https://howtodoinjava.com/junit5/expected-exception-example/**/\n\n assertThrows(IllegalArgumentException.class, () -> {\n cityList.delete(throwsCity);\n });\n }", "@Test\r\n\tpublic void deleteANonExistingRouteFather(){\r\n\t\tRouteFather toDelete = new RouteFather(123123);\r\n\t\tRouteFather deleted = routeFatherDAO.delete(toDelete);\r\n\t\tAssert.assertNull(\"it should returns a null object\", deleted);\r\n\t}" ]
[ "0.72568804", "0.7155947", "0.6976755", "0.68408746", "0.67632276", "0.67482656", "0.66896075", "0.6607844", "0.66059077", "0.65794015", "0.6567262", "0.65580875", "0.6543278", "0.6524696", "0.64994246", "0.6433646", "0.6382567", "0.6376014", "0.63614184", "0.6350313", "0.6342484", "0.6333724", "0.63326347", "0.6311241", "0.6296913", "0.62934214", "0.62678933", "0.6265997", "0.6258101", "0.62559986", "0.6254526", "0.6233393", "0.6232365", "0.6230925", "0.6224617", "0.62194675", "0.6213317", "0.62100357", "0.61907685", "0.61811167", "0.6174706", "0.6172558", "0.6157253", "0.61534554", "0.61365557", "0.6131529", "0.61297095", "0.6122103", "0.6113866", "0.6109003", "0.61050165", "0.610056", "0.60879534", "0.6084069", "0.60730135", "0.60673165", "0.6063881", "0.6058486", "0.6054916", "0.60426563", "0.6035083", "0.60275227", "0.6024572", "0.6022583", "0.6021571", "0.6001923", "0.5992046", "0.598703", "0.59768367", "0.5962275", "0.5961348", "0.5961222", "0.5956028", "0.5953492", "0.5951131", "0.5950762", "0.59499985", "0.59499806", "0.593499", "0.59298706", "0.5916651", "0.59097344", "0.59089816", "0.5897573", "0.5897221", "0.58906186", "0.588657", "0.58799046", "0.587958", "0.58793074", "0.58720165", "0.58708215", "0.5868622", "0.5853385", "0.5832925", "0.58266324", "0.5824374", "0.5815755", "0.5815024", "0.58131194" ]
0.74742573
0
String null or empty.
public static boolean stringNullOrEmpty ( String string ) { if ( string == null ) return true; if ( string.isEmpty() ) return true; return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String getStringOrNull (String value) {\n if (value == null || value.isEmpty()) value = null;\n return value;\n }", "public static String dispNull (String input) {\n //because of short circuiting, if it's null, it never checks the length.\n if (input == null || input.length() == 0)\n return \"N/A\";\n else\n return input;\n }", "public static String dispNull (String input) {\n //because of short circuiting, if it's null, it never checks the length.\n if (input == null || input.length() == 0)\n return \"N/A\";\n else\n return input;\n }", "public static String dispNull (String input) {\n //because of short circuiting, if it's null, it never checks the length.\n if (input == null || input.length() == 0)\n return \"N/A\";\n else\n return input;\n }", "public static String displayNull (String input)\r\n {\r\n //because of short circuiting, if it's null, it never checks the length.\r\n if (input == null || input.length() == 0)\r\n return \"N/A\";\r\n else\r\n return input;\r\n }", "private String notNull(String value) {\n return value != null ? value : \"\";\n }", "@Test\n\tpublic void testNullString() {\n\t\tString s = null;\n\t\tassertTrue(\"Null string\", StringUtil.isEmpty(s));\n\t}", "public static String nullToEmpty ( final String n )\n {\n return null == n ? \"\" : n;\n }", "public static String requireNullOrNonEmpty(String str, String message) {\n if (str != null && str.isEmpty()) {\n throw new IllegalArgumentException(message);\n }\n return str;\n }", "public static String requireNullOrNonEmpty(String str) {\n if (str != null && str.isEmpty()) {\n throw new IllegalArgumentException();\n }\n return str;\n }", "public String notNull(String text)\n {\n return text == null ? \"\" : text;\n }", "public java.lang.CharSequence getDefaultStringEmpty() {\n\t throw new java.lang.UnsupportedOperationException(\"Get is not supported on tombstones\");\n\t }", "public java.lang.CharSequence getDefaultStringEmpty() {\n return defaultStringEmpty;\n }", "private String setNullIfEmpty(String in) {\n if (in != null && in.trim().length() == 0) {\n return null;\n }\n return in;\n }", "public static String getNonEmptyString() {\n String result;\n\n do {\n result = getString();\n } while (result.isEmpty());\n return result;\n }", "public java.lang.CharSequence getDefaultStringEmpty() {\n return defaultStringEmpty;\n }", "public static String fromNullToEmtpyString(String a) {\r\n\t\tif (a == null) {\r\n\t\t\treturn \"\";\r\n\t\t} else {\r\n\t\t\treturn a;\r\n\t\t}\r\n\t}", "public static String nullToEmpty(String string)\r\n {\r\n return (string == null)?\"\":string;\r\n }", "static String checkEmptyString(String str, String strName) {\n String errorMsg = \"empty \" + strName;\n str = Optional.ofNullable(str).map(s -> {\n if(s.isEmpty()) {\n throw new NullPointerException(errorMsg);\n }\n return s;\n }).orElseThrow(() -> new NullPointerException(errorMsg));\n return str;\n }", "String getDefaultNull();", "public static String checkString(String s) {\n if(s==null || s.length()==0) return null;\n return s;\n }", "private boolean checkForEmptyString(Object value)\n\t{\n\t\tif (value == null || value.toString().isEmpty()) \n\t\t\treturn true;\n\t\treturn false;\n\t}", "String toString(String value) {\n value = value.trim();\n if (\".\".equals(value)) value = \"\";\n if (\"n/a\".equals(value)) value = \"\";\n return (!\"\".equals(value) ? value : Tables.CHARNULL);\n }", "public static String formatNull() {\n\t\treturn \"null\";\n\t}", "public static String notNull(String p_in) {\n\t\tString ret = p_in;\n\t\tif (ret==null) ret=\"\";\n\t\treturn ret;\n\n\t}", "private String getString() {\n\t\treturn null;\n\t}", "private String getNullValueText() {\n return getNull();\n }", "public static String requireNonEmpty(String str) {\n if (str.isEmpty()) {\n throw new IllegalArgumentException();\n }\n return str;\n }", "@Test\n\tpublic void zeroLength() {\n\t\tString s = \"\";\n\t\tassertTrue(\"Zero length string\", StringUtil.isEmpty(s));\n\t}", "protected String compString() {\n\t\treturn null;\n\t}", "private boolean isEmpty(String str) {\n return (str == null) || (str.equals(\"\"));\n }", "public static String defaultString(String val) {\n\t\tif (val == null || val.isBlank()) return \"\";\n\t\telse return val.trim();\n\t}", "private static boolean isEmpty(CharSequence str) {\n return str == null || str.length() == 0;\n }", "public String checkNull(String result) {\r\n\t\tif (result == null || result.equals(\"null\")) {\r\n\t\t\treturn \"\";\r\n\t\t} else {\r\n\t\t\treturn result;\r\n\t\t}\r\n\t}", "@Override\n public String createString() {\n return null;\n }", "private static boolean isEmpty(String str) {\n return str == null || str.trim().isEmpty();\n }", "public static String convertNullToBlank(String s) {\n \tif(s==null) return \"\";\n \treturn s;\n }", "public static String requireNonEmpty(String str, String message) {\n if (str.isEmpty()) {\n throw new IllegalArgumentException(message);\n }\n return str;\n }", "public String NullSave()\n {\n return \"null\";\n }", "@Override\r\n public String toString() {\r\n return (value == null) ? \"\" : value;\r\n }", "private static String null2unknown(String in) {\r\n\t\tif (in == null || in.length() == 0) {\r\n\t\t\treturn null;\r\n\t\t} else {\r\n\t\t\treturn in;\r\n\t\t}\r\n\t}", "private String parseNull () {\r\n \r\n assert iMessage!=null;\r\n assert iIndex>=0;\r\n assert iIndex<=iMessage.length();\r\n\r\n char chr=next();//get next character\r\n assert chr=='n';//assert correct first character\r\n skip(3);//skip to end of null token\r\n \r\n return \"null\";//return string representation of null\r\n \r\n }", "public String toSimpleString() {\n\t\treturn null;\n\t}", "public static boolean isNullOrEmptyString(Object obj) {\r\n\t\treturn (obj instanceof String) ? ((String)obj).trim().equals(\"\") : obj==null;\r\n\t}", "public static String defaultString(String value) {\n return value == null ? \"\" : value;\n }", "private final static boolean isEmpty(String field) {\n return field == null || field.trim().length() == 0;\n }", "static boolean isNullOrEmpty(String string) {\n return string == null || string.isEmpty();\n }", "public static String checkNull(String string1) {\n if (string1 != null)\n return string1;\n else\n return \"\";\n }", "private static final boolean isEmpty(String s) {\n return s == null || s.trim().length() < 1;\n }", "boolean canMatchEmptyString() {\n return false;\n }", "static String emptyToNull(String value) {\n if (value == null || value.trim().isEmpty())\n return null;\n return value.trim();\n }", "private boolean hasValue (String s) { return s != null && s.length() != 0; }", "private boolean isEmpty(String s) {\n return s == null || \"\".equals(s);\n }", "java.lang.String getOptionalValue();", "public String fullString();", "public static String nullToBlank(Object texto) {\n try {\n if (texto == null) {\n return \"\";\n }\n if (texto.toString().trim().equals(\"null\")) {\n return \"\";\n }\n return texto.toString().trim();\n } catch (Exception e) {\n return \"\";\n }\n\n }", "public static boolean nullity(String param) {\n return (param == null || param.trim().equals(\"\"));\n }", "private String checkNullString(String text) {\n if ( text.contains( \" \" )) {\n return null;\n }\n\n // otherwise, we're totally good\n return text;\n }", "private static boolean isEmpty(CharSequence str) {\n if (str == null || str.length() == 0) {\n return true;\n } else {\n return false;\n }\n }", "static <T> boolean isNullOrEmpty(T t){\n if(t == null){\n return true;\n }\n String str = t.toString();\n if(str.isEmpty()){\n return true;\n }\n if(str.length() == 0){\n return true;\n }\n return false;\n }", "private static String getPropertyValueOrDefault(String value) {\n return value != null ? value : \"\";\n }", "public static String nullifyNullOrEmptyString(final String targetString) {\n\t\tString outputString = null;\n\n\t\tif (targetString != null) {\n\t\t\tString targetStringTrim = targetString.trim();\n\t\t\tif ((!\"null\".equalsIgnoreCase(targetStringTrim)) && (targetStringTrim.length() > 0)) {\n\t\t\t\toutputString = targetStringTrim;\n\t\t\t}\n\t\t}\n\n\t\treturn outputString;\n\t}", "@Test\n\tvoid testCheckString4() {\n\t\tassertFalse(DataChecker.checkString((String)null));\n\t}", "@Test\n\tpublic void nonEmptyString() {\n\t\tString s = \" H \";\n\t\tassertFalse(\"Non empty string\", StringUtil.isEmpty(s));\n\t}", "protected boolean isEmpty(String s) {\n return s == null || s.trim().isEmpty();\n }", "public static String makeSafe(String s) {\n return (s == null) ? \"\" : s;\n }", "public static String mapEmptyToNull(String strIn)\r\n {\r\n if (strIn == null || strIn.trim().equals(\"\"))\r\n {\r\n return null;\r\n }\r\n return strIn;\r\n }", "public static String anyLenString() {\n\t\treturn RString.ANY_LEN_STRING;\n\t}", "public static boolean IsNullOrEmpty(String text) {\n\t\treturn text == null || text.length() == 0;\n\t}", "private final boolean emptyVal(String val) {\n return ((val == null) || (val.length() == 0));\n }", "public static String nullConv(String value){\r\n\t\tif(value==null){\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\t\treturn value;\r\n\t}", "public static String removeNullString(String value) {\r\n if(value == null) {\r\n value = NULL_STRING_INDICATOR;\r\n }\r\n\r\n /*else\r\n if(value.trim().equals(\"\")) {\r\n value = EMPTY_STRING_INDICATOR;\r\n }*/\r\n return value;\r\n }", "@Override\n\tpublic String display() {\n\t\treturn \"null\";\n\t}", "static boolean isNullOrEmpty(String str){\n if(str == null){\n return true;\n }\n if(str.isEmpty()){\n return true;\n }\n if(str.length() == 0){\n return true;\n }\n if(str.equalsIgnoreCase(\" \")){\n return true;\n }\n return false;\n }", "private boolean isEmpty(String string) {\n\t\treturn string == null || string.isEmpty();\n\t}", "public static String emptyToNull(String string)\r\n {\r\n return TextUtil.isEmpty(string)?null:string;\r\n }", "public static String convertNULLtoString(Object object) {\n return object == null ? EMPTY : object.toString();\n }", "public String asText() {\n\t\treturn \"\";\n\t}", "@Override\n public String asText() {\n return null;\n }", "@Test\n\tpublic void caseNameWithEmpty() {\n\t\tString caseName = \" \";\n\t\ttry {\n\t\t\tStringNumberUtil.stringUtil(caseName);\n\t\t} catch (StringException e) {\n\t\t}\n\t}", "public static boolean isEmptyOrNullString (final String in) {\n\t\treturn StringUtils.EMPTY_STRING.equals(in);\n\t}", "public static boolean isNullOrEmpty(String strIn)\r\n {\r\n return (strIn == null || strIn.equals(\"\"));\r\n }", "public static boolean isNullOrEmpty(String param) {\n return param == null || param.trim().length() == 0;\n }", "String getString();", "String getString();", "String getString();", "public static String checkEmpty(String string1, String string2) {\n if (string1 != null && string1.length() > 0)\n return string1;\n else if (string2 != null && string2.length() > 0)\n return string2;\n else\n return \"\";\n }", "public boolean isNullOrEmpty(String str){\n \treturn str!=null && !str.isEmpty() ? false : true;\n }", "public static String checkNullObject(Object val) {\n\n if (val != null) {\n if (\"\".equals(val.toString().trim())) {\n return \"\";\n }\n return val.toString();\n } else {\n return \"\";\n }\n }", "public static CharSequence emptyCharSequence() {\n return EMPTY;\n }", "public void testCheckNull() {\n Util.checkNull(\" \", \"test\");\n }", "public static final boolean isEmpty(String strSource){\n return strSource==null ||strSource.equals(\"\")|| strSource.trim().length()==0; \n }", "public boolean hasDefaultStringEmpty() {\n return fieldSetFlags()[1];\n }", "public static String checkNull(String sInString) {\n\n\t\tString sOutString = \"\";\n\n\t\tif (sInString == null || sInString.trim().equals(\"\")) {\n\t\t\tsOutString = \"\";\n\t\t} else {\n\t\t\tsOutString = sInString.trim();\n\t\t}\n\n\t\treturn sOutString;\n\n\t}", "@Override\n\tpublic String stringValue(final Attribute att) {\n\t\treturn null;\n\t}", "public static boolean isEmptyString(String s) {\n return (s==null || s.equals(\"\"));\n }", "public static Boolean IsStringNullOrEmpty(String value) {\n\t\treturn value == null || value == \"\" || value.length() == 0;\n\t}", "protected boolean notEmpty(String s) {\n return s != null && s.length() != 0;\n }", "@Test\n void trim_null() {\n assertNull(stringUtil.trim(null));\n }", "public boolean isString() {\n return false;\n }" ]
[ "0.7649189", "0.7386626", "0.73415", "0.73415", "0.72630763", "0.7184553", "0.70762765", "0.6981202", "0.6917396", "0.6888617", "0.6816589", "0.6809679", "0.6793836", "0.67802376", "0.67790866", "0.67696303", "0.67515343", "0.67261904", "0.6686696", "0.6625863", "0.6623644", "0.6596359", "0.65949094", "0.6549337", "0.6546608", "0.65356714", "0.6525946", "0.6525194", "0.6499861", "0.64986694", "0.64853334", "0.64825827", "0.6457387", "0.6426612", "0.6403694", "0.63821495", "0.6380714", "0.6359848", "0.6346235", "0.6334083", "0.63263184", "0.63194263", "0.63119555", "0.63052905", "0.629949", "0.62875897", "0.62745935", "0.6272467", "0.62699115", "0.6264053", "0.62626874", "0.624051", "0.61917037", "0.6181928", "0.617368", "0.6157703", "0.6157491", "0.6152796", "0.6152205", "0.61496985", "0.6148521", "0.6146227", "0.6128811", "0.6120955", "0.6119679", "0.611901", "0.61187637", "0.61108184", "0.61060447", "0.60979813", "0.6081758", "0.60787845", "0.60692674", "0.606745", "0.60655606", "0.60582507", "0.6056511", "0.6038301", "0.6022381", "0.6015681", "0.60122436", "0.6007834", "0.60041904", "0.6003964", "0.6003964", "0.6003964", "0.60017055", "0.5996864", "0.59799397", "0.59729564", "0.59631926", "0.59597456", "0.5955589", "0.5949723", "0.59467524", "0.5934596", "0.590896", "0.5897306", "0.5893038", "0.5883724" ]
0.60372066
78
Validate response no result.
public static boolean validateResponseNoResult ( ResponseWSDTO pResponse ) { if ( pResponse != null && pResponse.getCode() != null && !pResponse.getCode().isEmpty() && pResponse.getCode() != null && !pResponse.getCode().isEmpty() && pResponse.getCode().equals( ConstantCommon.WSResponse.CODE_ZERO ) && pResponse.getType().equals( ConstantCommon.WSResponse.TYPE_NORESULT ) ) { return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ValidationResponse validate();", "public void cbEmptyResponse()\n {\n }", "public boolean validateReponse(Response response, int id,int which)\n {\n return response.isSuccessful();\n }", "public boolean validateResponse(Response response) {\n return response.isSuccessful();\n }", "public String badOrMissingResponseData();", "@Test(description = \"TC004 - Validate returned response body is not empty\")\n public void validateResponseIsNotEmpty() {\n\tRestActions apiObject = new RestActions(\"https://alexwohlbruck.github.io/cat-facts\");\n\tResponse catFact = apiObject.performRequest(RequestType.GET, 200, \"/\");\n\tAssertions.assertNull(RestActions.getResponseBody(catFact), AssertionType.NEGATIVE, \"Will pass only if Response body is not empty!\");\n }", "@Test\n public void testNonEmptyResponse(){\n Assert.assertTrue(respArray.length() != 0, \"Empty response\");\n }", "default boolean checkJsonResp(JsonElement response) {\n return false;\n }", "protected abstract boolean isResponseValid(SatelMessage response);", "@Override\n public boolean hasErrorResults() {\n return false;\n }", "@Test\n public void testEmptyResponseHeaderValidity() {\n assertFalse(\"Valid header on empty response.\", EMPTY.isHeaderValid());\n }", "private String validateValidResponse(Response response) {\n\n\t\t\n\t\tlogger.debug(response.getBody().asString());\n\t\tlogger.debug(response.body().asString());\n\t\t\n\t\treturn response.body().asString();\n\t}", "public boolean hasResult()\n/* */ {\n/* 119 */ return this.result != RESULT_NONE;\n/* */ }", "@Override\n\tpublic boolean isResponseExpected() {\n\t\treturn false;\n\t}", "default boolean checkForError(HttpResponse response) {\n parameters.clear();\n\n\n if (response.getStatusCode() == 500) {\n System.out.println(\"Internal server error\");\n return true;\n } else if (response.getStatusCode() == 400) {\n System.out.println(\"Your input was not as expected. Use \\\"help\\\"-command to get more help.\");\n System.out.println(response.getBody());\n return true;\n } else if (response.getStatusCode() == 404) {\n System.out.println(\"The resource you were looking for could not be found. Use \\\"help\\\"-command to get more help.\");\n }\n\n return false;\n\n }", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "Boolean responseHasErrors(MovilizerResponse response);", "private void clearResponse() { response_ = null;\n bitField0_ = (bitField0_ & ~0x00000001);\n }", "private void clearResponse() { response_ = null;\n bitField0_ = (bitField0_ & ~0x00000002);\n }", "boolean hasInitialResponse();", "public void resultIsNull(){\n if(alertDialog.isShowing()){\n return;\n }\n if(inActive){\n return;\n }\n }", "boolean getMissingResults();", "public boolean isError() {\n\t\tif (response.containsKey(\"Result\")) {\n\t\t\tif (response.get(\"Result\").equals(\"E\") || response.get(\"Result\").equals(\"MISSING\")) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public CheckResponseDeserializer() {\n this(null);\n }", "private void prepareNoResponse() {\n when(mSentenceDataRepository.getTodaysSentenceResponse()).thenReturn(null);\n }", "boolean getReturnPartialResponses();", "private String validateErrorResponse(Response response) {\n\t\t\n\t\tlogger.debug(response.body().asString());\t\n\t\treturn response.body().asString();\n\t\t\n\t\t\n\t}", "public SimpleResponse NOT_AUTHORIZED() {\n this.state = NOT_AUTHORIZED;\n return ERROR_CUSTOM();\n }", "public boolean hasResponse() {\n return response_ != null;\n }", "@SuppressWarnings(\"unchecked\")\n private boolean checkResponse (HttpResponse<?> pResponse) {\n boolean result = false;\n if (pResponse != null\n && pResponse.getStatus() == 200\n && pResponse.getBody() != null) {\n HttpResponse<String> response = (HttpResponse<String>)pResponse;\n JSONObject body = new JSONObject(response.getBody());\n if (body.has(\"result\")) {\n result = Boolean.TRUE.equals(body.getBoolean(\"success\"));\n }\n }\n return result;\n }", "@Override\n\t\t\tpublic boolean hasError(ClientHttpResponse response) throws IOException {\n\t\t\t\treturn false;\n\t\t\t}", "public boolean isNotOk() {\n return _type == Type.OK;\n }", "public static void ensureResultMessageIsSet() {\r\n final EventHandlerContext context = ContextStore.get().getEventHandlerContext();\r\n if (!context.parameterExists(RESULT_MESSAGE_PARAMETER)\r\n || StringUtil.isNullOrEmpty(context.getParameter(RESULT_MESSAGE_PARAMETER))) {\r\n context.addResponseParameter(RESULT_MESSAGE_PARAMETER, RESULT_MESSAGE_OK);\r\n }\r\n }", "public abstract boolean validate(Request request, Response response);", "@Test\n public void testProcessNoResponse() {\n // NOTE: this json file is a RESPONSE, not a request\n String request = ResourceUtils.getResourceAsString(\"org/onap/policy/simulators/appclcm/appc.lcm.success.json\");\n assertNotNull(request);\n\n server.onTopicEvent(CommInfrastructure.NOOP, MY_TOPIC, request);\n\n verify(sink, never()).send(any());\n }", "public boolean isEmpty() {\n boolean response = false;\n if (size == 0) {\n response = true;\n }\n return response;\n }", "public boolean hasResponse() {\n return response_ != null;\n }", "public boolean hasResponse() {\n return response_ != null;\n }", "public boolean hasResponse() {\n return response_ != null;\n }", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000100) == 0x00000100);\n }", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000100) == 0x00000100);\n }", "public boolean hasResponse() {\n return responseBuilder_ != null || response_ != null;\n }", "private void clearResponse() { response_ = null;\n \n }", "private void clearResponse() { response_ = null;\n \n }", "public void noError()\n\t\t\t{\n\t\t\t\tsend(\"<error />\", false);\n\t\t\t}", "public void verifyResponseHasGreaterThanZeroComments(){\n JSONArray listOfComments=parseResponseAsJSONArray(response);\n Assert.assertTrue(!listOfComments.isEmpty());\n Assert.assertTrue(listOfComments.length()>0);\n System.out.println(\"Verify response has more than zero comments\");\n }", "public boolean hasResponse() {\n return responseBuilder_ != null || response_ != null;\n }", "public boolean hasResult() {\r\n\t\t\treturn ((bitField0_ & 0x00000001) == 0x00000001);\r\n\t\t}", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "public boolean hasResult() {\r\n\t\t\t\treturn ((bitField0_ & 0x00000001) == 0x00000001);\r\n\t\t\t}", "@Test\n public void testReceiverReturnsNoParams() {\n ResponseEntity response = dataController.getReceiverDataByOrgans(\"N\", null, null, null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "public boolean getEmptyOk() {\r\n return _emptyok;\r\n }", "public void __getReplyNoReport() {\n __getReply(false);\n }", "@Test\n public void test_invalid() throws Exception {\n matchInvoke(serviceURL, \"PWDDIC_testSearch_invalid_req.xml\",\n \"PWDDIC_testSearch_invalid_res.xml\");\n }", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "void faild_response();", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "@Test\n\tpublic void performRequestValidation() throws Exception {\n\n\t\tString responseBody = TestUtils.getValidResponse();\n\n\t\ttry {\n\t\t\t@SuppressWarnings(\"unused\")\n\t\t\tResponseEntity<ResponseWrapper> responseEntity = prepareReponseEntity(responseBody);\n\n\t\t\tthis.mockServer.verify();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public Builder clearResult() {\n bitField0_ = (bitField0_ & ~0x00000001);\n result_ = com.rpg.framework.database.Protocol.ResponseCode.SUCCESS;\n onChanged();\n return this;\n }", "public Builder clearResult() {\n bitField0_ = (bitField0_ & ~0x00000001);\n result_ = com.rpg.framework.database.Protocol.ResponseCode.SUCCESS;\n onChanged();\n return this;\n }", "public Builder clearResult() {\n bitField0_ = (bitField0_ & ~0x00000001);\n result_ = com.rpg.framework.database.Protocol.ResponseCode.SUCCESS;\n onChanged();\n return this;\n }", "public Builder clearResult() {\n bitField0_ = (bitField0_ & ~0x00000001);\n result_ = com.rpg.framework.database.Protocol.ResponseCode.SUCCESS;\n onChanged();\n return this;\n }", "public Builder clearResult() {\n bitField0_ = (bitField0_ & ~0x00000001);\n result_ = com.rpg.framework.database.Protocol.ResponseCode.SUCCESS;\n onChanged();\n return this;\n }", "boolean isValid()\n {\n return isRequest() && isResponse();\n }", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasResponse() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public ValidaExistePersonaRespuesta() {\n\t\theader = new EncabezadoRespuesta();\n\t\t}", "public boolean hasResult() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "boolean hasResponseMessage();", "protected Response checkResponse(Response plainAnswer) throws WSException{\n if(plainAnswer!=null)\n switch(plainAnswer.getStatus()){\n //good answers\n case 200: {\n return plainAnswer;\n }//OK\n case 202: {\n return plainAnswer;\n }//ACCEPTED \n case 201: {\n return plainAnswer;\n }//CREATED\n //To be evaluate\n case 204: {\n return plainAnswer;\n }//NO_CONTENT\n //bad answers\n case 400: {\n throw new WSException400(\"BAD REQUEST! The action can't be completed\");\n }//BAD_REQUEST \n case 409: {\n throw new WSException409(\"CONFLICT! The action can't be completed\");\n }//CONFLICT \n case 403: {\n throw new WSException403(\"FORBIDDEN!The action can't be completed\");\n }//FORBIDDEN \n case 410: {\n throw new WSException410(\"GONE! The action can't be completed\");\n }//GONE\n case 500: {\n throw new WSException500(\"INTERNAL_SERVER_ERROR! The action can't be completed\");\n }//INTERNAL_SERVER_ERROR \n case 301: {\n throw new WSException301(\"MOVED_PERMANENTLY! The action can't be completed\");\n }//MOVED_PERMANENTLY \n case 406: {\n throw new WSException406(\"NOT_ACCEPTABLE! The action can't be completed\");\n }//NOT_ACCEPTABLE\n case 404: {\n throw new WSException404(\"NOT_FOUND! The action can't be completed\");\n }//NOT_FOUND\n case 304: {\n throw new WSException304(\"NOT_MODIFIED! The action can't be completed\");\n }//NOT_MODIFIED \n case 412: {\n throw new WSException412(\"PRECONDITION_FAILED! The action can't be completed\");\n }//PRECONDITION_FAILED \n case 303: {\n throw new WSException303(\"SEE_OTHER! The action can't be completed\");\n }//SEE_OTHER\n case 503: {\n throw new WSException503(\"SERVICE_UNAVAILABLE! The action can't be completed\");\n }//SERVICE_UNAVAILABLE\n case 307: {\n throw new WSException307(\"TEMPORARY_REDIRECT! The action can't be completed\");\n }//TEMPORARY_REDIRECT \n case 401: {\n throw new WSException401(\"UNAUTHORIZED! The action can't be completed\");\n }//UNAUTHORIZED \n case 415: {\n throw new WSException415(\"UNSUPPORTED_MEDIA_TYPE! The action can't be completed\");\n }//UNSUPPORTED_MEDIA_TYPE \n }\n return plainAnswer;\n }", "public boolean wasOkay();", "@Nullable\n public abstract T response();", "boolean hasListResponse();", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public static void errorCardIfNonePresent(CdsResponse response) {\n if (response.getCards() == null || response.getCards().size() == 0) {\n Card card = new Card();\n card.setIndicator(Card.IndicatorEnum.WARNING);\n Source source = new Source();\n source.setLabel(\"Da Vinci CRD Reference Implementation\");\n card.setSource(source);\n card.setSummary(\"Unable to process hook request from provided information.\");\n response.addCard(card);\n }\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasResult() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "private AddressBookResponse NPECheck(String name, String lname){\n\t\tAddressBookResponse addressBookResponse = null;\n\t\tif(name == null || name .isEmpty()){\n\t\t\taddressBookResponse = new AddressBookResponse();\n\t\t\taddressBookResponse.setCode(Status.BAD_REQUEST);\n\t\t\taddressBookResponse.setMessage(\"name cannot be '\"+ name +\"'\");\n\t\t}else if (lname == null || lname .isEmpty()){\n\t\t\taddressBookResponse = new AddressBookResponse();\n\t\t\taddressBookResponse.setCode(Status.BAD_REQUEST);\n\t\t\taddressBookResponse.setMessage(\"name cannot be '\"+ name +\"'\");\n\t\t}\n\t\treturn addressBookResponse;\n\t}", "public boolean isDeclined()\n\t{\n\t\tif(response.containsKey(\"Result\")) {\n\t\t\tif(response.get(\"Result\").equals(\"DECLINED\")) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}" ]
[ "0.6313465", "0.62877697", "0.6229236", "0.62050223", "0.6167139", "0.61350214", "0.60804874", "0.60534954", "0.6049542", "0.60281545", "0.60214233", "0.5950533", "0.59064734", "0.5896832", "0.58946013", "0.5875426", "0.5875426", "0.5875426", "0.5875426", "0.5875426", "0.5875426", "0.5875426", "0.5875426", "0.5875426", "0.5853101", "0.5815999", "0.5801773", "0.5787758", "0.5778974", "0.5755462", "0.57547593", "0.57494265", "0.5746385", "0.5728999", "0.5720051", "0.5694689", "0.568487", "0.56814283", "0.5667034", "0.5660694", "0.56573665", "0.5636457", "0.5623439", "0.5620437", "0.5607135", "0.5607135", "0.5607135", "0.56033313", "0.5593743", "0.5585709", "0.5582887", "0.5582887", "0.5576802", "0.5549539", "0.55421054", "0.55412894", "0.5540474", "0.55402863", "0.5535118", "0.55248994", "0.55213064", "0.551892", "0.551102", "0.5509383", "0.550856", "0.5506102", "0.54981947", "0.5496828", "0.5493305", "0.5493305", "0.54922444", "0.54922444", "0.54922444", "0.5490711", "0.5490317", "0.5490317", "0.5490317", "0.54900044", "0.5482727", "0.548233", "0.5480287", "0.5479144", "0.5478032", "0.5465434", "0.5459979", "0.54561216", "0.54561216", "0.54561216", "0.5455136", "0.5455136", "0.5455136", "0.5453529", "0.545328", "0.545328", "0.5452794", "0.54527485", "0.54527485", "0.54527485", "0.5447206", "0.5443452" ]
0.7917514
0
Validate response success xml output.
public static boolean validateResponseSuccessXMLOutput ( ResponseWSDTO pResponse ) { if ( pResponse != null && pResponse.getCode() != null && !pResponse.getCode().isEmpty() && pResponse.getCode() != null && !pResponse.getCode().isEmpty() && pResponse.getCode().equals( ConstantCommon.WSResponse.CODE_ONE ) && pResponse.getType().equals( ConstantCommon.WSResponse.TYPE_SUCCESS ) && pResponse.getDataResponseXML() != null && !pResponse.getDataResponseXML().isEmpty() ) { return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static boolean checkOk(String response) {\n\t\tMatcher m = PAT_ES_SUCCESS.matcher(response);\n\t\tif (m.find()) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "ValidationResponse validate();", "public boolean validateResponse(Response response) {\n return response.isSuccessful();\n }", "@Override\n\t\tpublic boolean hasPassedXMLValidation() {\n\t\t\treturn false;\n\t\t}", "@XmlTransient\n\tpublic boolean isSuccess() {\n\t\treturn errorCode == ActionErrorCode.SUCCESS;\n\t}", "private String parseSOAPResponse(SoapObject response) {\n\n\t\tString isSuccess =response.getPrimitivePropertySafelyAsString(\"UpdateStundentDetailsResult\");\n\t\t\n\t\treturn isSuccess;\n\t}", "boolean getSuccess();", "boolean getSuccess();", "boolean getSuccess();", "boolean getSuccess();", "@Override\n\t\tpublic boolean isSuccess() {\n\t\t\treturn false;\n\t\t}", "private boolean isSuccessful(SocketMessage response) {\r\n if (\"success\".equals(response.getValue(\"status\"))) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "public boolean isSuccess();", "public boolean isSuccess();", "private String validateValidResponse(Response response) {\n\n\t\t\n\t\tlogger.debug(response.getBody().asString());\n\t\tlogger.debug(response.body().asString());\n\t\t\n\t\treturn response.body().asString();\n\t}", "public boolean isSuccessful()\n\t{\n\t\tif (response.get(\"Result\").equals(\"APPROVED\") && !response.get(\"MESSAGE\").equals(\"DUPLICATE\")) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public static boolean parseResp(String xml) throws Exception {\n\t\tboolean isSuccess = false;\n\t\tSAXReader reader = new SAXReader();\n\t\tDocument document = reader.read(new ByteArrayInputStream(xml.getBytes(DEFAULT_ENCODE)));\n\t\tElement root = document.getRootElement();\n\t\tElement statusElement = root.element(\"returnstatus\");\n\t\tString returnstatus = statusElement.getText();\n\t\tif (\"Success\".equals(returnstatus))\n\t\t\tisSuccess = true;\n\t\treturn isSuccess;\n\t}", "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();", "boolean isSuccess();", "protected abstract boolean isResponseValid(SatelMessage response);", "public void checkOutputXML (IInternalContest contest) {\n \n try {\n DefaultScoringAlgorithm defaultScoringAlgorithm = new DefaultScoringAlgorithm();\n String xmlString = defaultScoringAlgorithm.getStandings(contest, new Properties(), log);\n \n // getStandings should always return a well-formed xml\n assertFalse(\"getStandings returned null \", xmlString == null);\n assertFalse(\"getStandings returned empty string \", xmlString.trim().length() == 0);\n \n DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();\n DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();\n documentBuilder.parse(new InputSource(new StringReader(xmlString)));\n } catch (Exception e) {\n assertTrue(\"Error in XML output \" + e.getMessage(), true);\n e.printStackTrace();\n }\n }", "protected boolean isSuccessful(Response response) {\n if (response == null) {\n return false;\n }\n //System.out.println(\" Get Status is \" + response.getStatus());\n return response.getStatus() == 200;\n }", "public boolean verifySuccess() {\r\n return driver.findElement(successMsg).isDisplayed();\r\n }", "@Override\n protected void verifyResultDocument(TransformerFactory transformerFactory, Document resultDocument) throws Throwable {\n List<UpConversionFailure> upConversionFailures = UpConversionUtilities.extractUpConversionFailures(resultDocument);\n String result;\n if (upConversionFailures.isEmpty()) {\n /* Should have succeeded, so verify as normal */\n super.verifyResultDocument(transformerFactory, resultDocument);\n }\n else {\n /* Make sure we get the correct error code(s) */\n result = expectedXML.replaceAll(\"<.+?>\", \"\"); /* (Yes, it's not really XML in this case!) */\n if (result.charAt(0)!='!') {\n Assert.fail(\"Did not expect up-conversion errors!\");\n }\n String[] expectedErrorCodes = result.substring(1).split(\",\\\\s*\");\n Assert.assertEquals(expectedErrorCodes.length, upConversionFailures.size());\n for (int i=0; i<expectedErrorCodes.length; i++) {\n Assert.assertEquals(expectedErrorCodes[i], upConversionFailures.get(i).getErrorCode().toString());\n }\n }\n }", "@Override\n protected Result validate() {\n return successful(this);\n }", "boolean hasIsSuccess();", "@SuppressWarnings(\"unchecked\")\n private boolean checkResponse (HttpResponse<?> pResponse) {\n boolean result = false;\n if (pResponse != null\n && pResponse.getStatus() == 200\n && pResponse.getBody() != null) {\n HttpResponse<String> response = (HttpResponse<String>)pResponse;\n JSONObject body = new JSONObject(response.getBody());\n if (body.has(\"result\")) {\n result = Boolean.TRUE.equals(body.getBoolean(\"success\"));\n }\n }\n return result;\n }", "protected void buildResponse() {\r\n appendResponse(\"<?xml version=\\\"1.0\\\" standalone=\\\"no\\\"?>\\r\\n\");\r\n appendResponse(\"<!DOCTYPE RETS SYSTEM \\\"RETS-20021015.dtd\\\">\\r\\n\");\r\n appendResponse(\"<RETS ReplyCode=\\\"\");\r\n appendResponse(replyCode);\r\n appendResponse(\"\\\" ReplyText=\\\"\");\r\n appendResponse(replyText);\r\n appendResponse(\"\\\"\");\r\n\r\n if (getReplyCode() != REPLY_CODE_SUCCESS) {\r\n cat.debug(\"*****ERROR\");\r\n appendResponse(\" />\");\r\n } else {\r\n appendResponse(\" >\\n\");\r\n\r\n fillContent();\r\n\r\n appendResponse(\"</RETS>\\r\\n\");\r\n }\r\n\r\n cat.debug(\"RESPONSE ::\" + this.response.toString());\r\n }", "public boolean isSuccess()\r\n {\r\n return success;\r\n }", "private void IfTreeIsValid(HttpServletRequest request, HttpServletResponse response) throws IOException {\n XMLTree tree;\n tree = XMLTree.getInstance();\n response.getWriter().write(tree.validate());\n }", "public String healthmonitorscansuccess(String xml) throws Exception {\n\t\tAlertType alertType = IMonitorUtil.getAlertTypes().get(\n\t\t\t\tConstants.MONITOR_DEVICE_HEALTH_SUCCESS);\n\t\tQueue<KeyValuePair> resultQueue = updateAlertAndExecuteRule(xml,\n\t\t\t\talertType);\n\n\t\tXStream stream = new XStream();\n\t\treturn stream.toXML(resultQueue);\n\t}", "public boolean validateReponse(Response response, int id,int which)\n {\n return response.isSuccessful();\n }", "public boolean isSuccess() {\r\n return success;\r\n }", "public boolean isSuccess() {\r\n return success;\r\n }", "Boolean responseHasErrors(MovilizerResponse response);", "public String getSuccessResult(String response) {\n\t\tString result=\"result\";\n\t\tPattern pattern = Pattern.compile(SUCCESS);\n\t\tMatcher match = pattern.matcher(response);\n\t\tif (match.find(1)) {\n\t\t\tresult= (match.group(1));\n\t\t}\n\t\treturn result;\n\t}", "public boolean isDocumentGeneratorResponseValid(DocumentGeneratorResponse response) {\n boolean isDocGeneratorResponseValid = true;\n\n LOGGER.info(\"DocumentGeneratorResponseValidator: validating document generator response\");\n\n if (!isPeriodEndOnInDocGeneratorResponse(response)) {\n isDocGeneratorResponseValid = false;\n }\n\n if (!isDescriptionInDocGeneratorResponse(response)) {\n isDocGeneratorResponseValid = false;\n }\n\n if (!isIxbrlInDocGeneratorResponse(response)) {\n isDocGeneratorResponseValid = false;\n }\n\n LOGGER.info(\"DocumentGeneratorResponseValidator: validation has finished\");\n\n return isDocGeneratorResponseValid;\n }", "private void postValidationResponseCodeSuccess() throws APIRestGeneratorException\r\n\t{\r\n\t\tfinal Iterator<String> iterator = this.localResponses.getResponsesMap().keySet().iterator() ;\r\n\t\tboolean found \t\t\t\t = false ;\r\n\t\t\r\n\t\twhile (iterator.hasNext() && !found)\r\n\t\t{\r\n\t\t\tfinal String codeKey = iterator.next() ;\r\n\t\t\tfound \t\t\t\t = ConstantsMiddle.RESP_CODE_SUCCESS.equals(codeKey) ;\r\n\t\t}\r\n\t\t\r\n\t\tif (!found)\r\n\t\t{\r\n\t\t\tfinal String errorString = \"The path '\" + this.pathValue + \"' ('\" + this.pathOp + \"' operation) \" +\r\n\t\t\t\t\t\t\t\t\t \"needs a defined response with code \" + ConstantsMiddle.RESP_CODE_SUCCESS ;\r\n\t\t\t\r\n\t\t\tResponsesPostValidator.LOGGER.error(errorString) ;\r\n\t \tthrow new APIRestGeneratorException(errorString) ;\r\n\t\t}\r\n\t}", "public boolean isSuccess() {\n return success;\n }", "public boolean isSuccess() {\n return success;\n }", "public boolean isSuccess() {\n return success;\n }", "public boolean patenteSuccess() {\n return this.success;\n }", "public boolean isOK() {\r\n return getPayload().getString(\"status\").equals(\"ok\");\r\n }", "public Message buildSuccessResponse(byte... responseAttrs) {\n return buildResponse(true /* isSuccess */, responseAttrs);\n }", "public void testGetDocumentForSuccess() {\n String document = myAuthorizationConfiguration.getXmlFile();\n assertNotNull(document);\n }", "public Boolean getSuccess() {\n\t\treturn success;\n\t}", "private boolean validateParameterAndIsNormalSAMLResponse(String sAMLResponse) {\n try {\n LOG.trace(\"Validating Parameter SAMLResponse\");\n EIDASUtil.validateParameter(\n ColleagueResponseServlet.class.getCanonicalName(),\n EIDASParameters.SAML_RESPONSE.toString(), sAMLResponse,\n EIDASErrors.COLLEAGUE_RESP_INVALID_SAML);\n return true;\n } catch (InvalidParameterEIDASException e) {\n LOG.info(\"ERROR : SAMLResponse parameter is missing\",e.getMessage());\n LOG.debug(\"ERROR : SAMLResponse parameter is missing\",e);\n throw new InvalidParameterException(\"SAMLResponse parameter is missing\");\n }\n }", "@Override\n public boolean validate() throws SmogException {\n\n // List of validation messages\n ArrayList<XmlError> validationMessages = new ArrayList<>();\n\n // Validate the missive document\n boolean isValid = this.missiveDocument.validate(new XmlOptions().setErrorListener(validationMessages));\n\n // Check if the missive document is valid\n if (isValid) {\n return true;\n } else {\n\n // Validation message\n String validationMessage = \"\";\n\n // Iterator for validation messages\n Iterator<XmlError> iterator = validationMessages.iterator();\n\n // Build the complete error message\n while(iterator.hasNext()) {\n\n // Add validation message separtor\n if (!validationMessage.equals(\"\")) {\n validationMessage += \"\\n\";\n }\n\n // Concatenate validation messages\n validationMessage += iterator.next().getMessage();\n }\n\n throw new SmogException(validationMessage);\n }\n }", "public boolean getSuccess() {\n return success_;\n }", "public boolean getSuccess() {\n return (transactionFailure == null && amountConverted != null);\n }", "public boolean getSuccess() {\n return success_;\n }", "public boolean getSuccess() {\n return success_;\n }", "public boolean getSuccess() {\n return success_;\n }", "public boolean getSuccess() {\n return success_;\n }", "public boolean getSuccess() {\n return instance.getSuccess();\n }", "public boolean getSuccess() {\n return instance.getSuccess();\n }", "public boolean getSuccess() {\n return instance.getSuccess();\n }", "public void setSuccess(boolean value) {\r\n this.success = value;\r\n }", "public boolean isSuccessful() {\n return responseCode >= 200 && responseCode < 300;\n }", "public boolean isValid()\r\n {\r\n try {\r\n validate();\r\n }\r\n catch (org.exolab.castor.xml.ValidationException vex) {\r\n return false;\r\n }\r\n return true;\r\n }", "public boolean isValid()\r\n {\r\n try {\r\n validate();\r\n }\r\n catch (org.exolab.castor.xml.ValidationException vex) {\r\n return false;\r\n }\r\n return true;\r\n }", "public boolean isValid()\r\n {\r\n try {\r\n validate();\r\n }\r\n catch (org.exolab.castor.xml.ValidationException vex) {\r\n return false;\r\n }\r\n return true;\r\n }", "public boolean isValid()\r\n {\r\n try {\r\n validate();\r\n }\r\n catch (org.exolab.castor.xml.ValidationException vex) {\r\n return false;\r\n }\r\n return true;\r\n }", "public boolean isValid()\r\n {\r\n try {\r\n validate();\r\n }\r\n catch (org.exolab.castor.xml.ValidationException vex) {\r\n return false;\r\n }\r\n return true;\r\n }", "public void setSuccess(boolean success) {\n this.success = success;\n }", "public void setSuccess(boolean success) {\n this.success = success;\n }", "protected GlobalRequestResponse(boolean succeeded) {\n this.succeeded = succeeded;\n }", "@Override\n\tpublic boolean repOk() {\n\t\treturn true;\n\t}", "@Then(\"^Validate that response contains correct information$\")\n public void validateThatResponseContainsCorrectInformation() {\n id = myResponse.then().extract().path(\"id\").toString();\n System.out.println(\"Wishlist ID is: \" + id);\n }", "@Override\n\t\t\tpublic void onSuccess(ParseResult result) {\n\t\t\t\tassertFalse(result.getMessage().isEmpty());\n\n\t\t\t\t// Now that we have received a response, we need to tell the test runner\n\t\t\t\t// that the test is complete. You must call finishTest() after an\n\t\t\t\t// asynchronous test finishes successfully, or the test will time out.\n\t\t\t\tOXPathValidatorTest.this.finishTest();\n\t\t\t}", "@Override\n\tpublic BaseResponse testResponse() {\n\t\treturn setResultSuccess();\n\t}", "protected void handleSuccessMessage(Response response) {\n\t\tonRequestResponse(response);\n\t}", "boolean isSuccessful();", "public boolean isIsSuccess() {\r\n return isSuccess;\r\n }", "public int getSuccess() {\n return success;\n }", "@Override\n\t\tprotected void onPostExecute(String result) {\n\t\t\tsuper.onPostExecute(result);\n\t\t\t\n\t\t\tif(response1.contains(\"success\"))\n\t\t\t{\n\t\t\t\trg_parsingmethod();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tToast.makeText(getApplicationContext(), \"No new registrations\", Toast.LENGTH_SHORT).show();\n\t\t\t}\n\t\t}", "public int getSuccessCount() {\r\n return root.getSuccessCount();\r\n }", "public String doneXML() {\n if ( (MyLocation != null) && (MyName != null)) {\n return null;\n }\n return new String(\"Incomplete \" + XML_TAG + \" XML specification\");\n }", "@Override\n public void onSuccess(int statusCode, Header[] headers, byte[] server_response) {\n try {\n String response = String.valueOf(new String(server_response, \"UTF-8\"));\n Log.e(TAG, \"response login=>\" + response);\n /* hide progressbar */\n progress.dismiss();\n\n /* parse xml response */\n XMLParser parser = new XMLParser();\n Document doc = parser.getDomElement(response, url);\n\n if (doc == null) {\n Dialog.simpleWarning(Lang.get(\"returned_xml_failed\"), context);\n } else {\n NodeList errorsNode = doc.getElementsByTagName(\"errors\");\n\n /* handle errors */\n if (errorsNode.getLength() > 0) {\n Element element = (Element) errorsNode.item(0);\n NodeList errors = element.getChildNodes();\n\n if (errors.getLength() > 0) {\n Element error = (Element) errors.item(0);\n String key_error = error.getTextContent();\n Dialog.simpleWarning(Lang.get(key_error), context);\n }\n }\n /* process login */\n else {\n NodeList accountNode = doc.getElementsByTagName(\"account\");\n confirmLogin(accountNode);\n alertDialog.dismiss();\n }\n }\n\n } catch (UnsupportedEncodingException e1) {\n\n }\n }", "@Test\n public void testVisaCCPositive_XML() {\n String visaCCNumber = UtilityParsers.xmlHelper(visaInputFilePathXML);\n CreditCardValidator creditCardValidator = new VisaCCValidator(visaCCNumber);\n assertTrue(creditCardValidator.validateCreditCard());\n }", "public boolean isSuccess() {\n\t\tif (Status.OK == status) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public boolean isValid() {\n try {\n validate();\n } catch (org.exolab.castor.xml.ValidationException vex) {\n return false;\n }\n return true;\n }", "public boolean isIsSuccess() {\n return isSuccess;\n }", "private String validateErrorResponse(Response response) {\n\t\t\n\t\tlogger.debug(response.body().asString());\t\n\t\treturn response.body().asString();\n\t\t\n\t\t\n\t}", "public Integer getIsSuccess() {\n return isSuccess;\n }", "public String getOk() {\r\n\t\treturn \"\";\r\n\t}", "public java.lang.String getResponseXml(){\n return localResponseXml;\n }", "public SuccessResponse() {\r\n super(HttpStatus.OK, \"Successfully processed the request.\");\r\n }", "public boolean isSetSuccess() {\r\n return this.success != null;\r\n }", "public boolean isSetSuccess() {\r\n return this.success != null;\r\n }", "public boolean isSetSuccess() {\r\n return this.success != null;\r\n }", "public boolean isSetSuccess() {\r\n return this.success != null;\r\n }", "public boolean isSetSuccess() {\r\n return this.success != null;\r\n }", "public boolean isSetSuccess() {\r\n return this.success != null;\r\n }", "public boolean isValid()\n {\n try {\n validate();\n }\n catch (org.exolab.castor.xml.ValidationException vex) {\n return false;\n }\n return true;\n }" ]
[ "0.62816083", "0.60978675", "0.5997748", "0.5885486", "0.58654743", "0.58491504", "0.5844826", "0.5844826", "0.5844826", "0.5844826", "0.5831767", "0.5781623", "0.57449985", "0.57449985", "0.57352275", "0.5700731", "0.5697731", "0.5667976", "0.5667976", "0.5667976", "0.5667976", "0.5667976", "0.5667976", "0.5667976", "0.5658111", "0.5649277", "0.5644727", "0.5583173", "0.5577222", "0.5533752", "0.55128294", "0.5490689", "0.5461869", "0.54425794", "0.5434028", "0.54288876", "0.5418603", "0.54072714", "0.54072714", "0.54017615", "0.5399875", "0.5384987", "0.53848076", "0.53678864", "0.53678864", "0.53678864", "0.53437626", "0.5333824", "0.53248596", "0.5297131", "0.5277357", "0.5271983", "0.52711535", "0.52610976", "0.5257188", "0.52568406", "0.52568406", "0.52568406", "0.52568406", "0.5252667", "0.5252667", "0.5252667", "0.52451104", "0.5234105", "0.52249086", "0.52249086", "0.52249086", "0.52249086", "0.52249086", "0.5224296", "0.5224296", "0.5218396", "0.52083117", "0.5197136", "0.5195173", "0.5193666", "0.5188875", "0.51886296", "0.5186213", "0.51777864", "0.51707697", "0.5168564", "0.51653993", "0.5162468", "0.51592374", "0.5155462", "0.5154448", "0.51540715", "0.513442", "0.51338756", "0.5130433", "0.51294386", "0.51270366", "0.51259387", "0.51259387", "0.51259387", "0.51259387", "0.51259387", "0.51259387", "0.51241505" ]
0.74698234
0
Save coorinates x,y when mouse is pressed
public void mousePressed(MouseEvent e) { oldX = e.getX(); oldY = e.getY(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void mousePressed(MouseEvent e) {\n x_pressed = e.getX();\n y_pressed = e.getY();\n \n }", "@Override\n public void mousePressed(MouseEvent e) {\n x_pressed = e.getX();\n y_pressed = e.getY();\n \n }", "@Override\n public void mousePressed(MouseEvent e) {\n x_pressed = e.getX();\n y_pressed = e.getY();\n \n }", "@Override\n public void mousePressed(MouseEvent e) {\n x_pressed = e.getX();\n y_pressed = e.getY();\n \n }", "private void formMousePressed(java.awt.event.MouseEvent evt) {\n xx=evt.getX();\n xy=evt.getY();\n \n }", "private void formMousePressed(java.awt.event.MouseEvent evt) {\n xx=evt.getX();\n xy=evt.getY();\n \n }", "public void mousePressed(MouseEvent e)\n {\n points.setX(e.getX());\n points.setY(e.getY());\n }", "@Override\r\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\torigin.x=e.getX();\r\n\t\t\t\torigin.y=e.getY();\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void mouseDown(MouseEvent e) {\n\t\t\t\tx=e.x;\r\n\t\t\t\ty=e.y;\t\t\t\t\r\n\r\n\t\t\t}", "public void mousePressed(MouseEvent e) {\n xinitial = e.getX() / 5; //get the x value\r\n yinitial = e.getY() / 5; //get the y value\r\n }", "public void mousePressed(MouseEvent e) {\n pX = e.getX();\n pY = e.getY();\n }", "@Override\n public void mousePressed(MouseEvent e) {\n\n prevMouse.x = x(e);\n prevMouse.y = y(e);\n\n // 3D mode\n if (getChart().getView().is3D()) {\n if (handleSlaveThread(e)) {\n return;\n }\n }\n\n // 2D mode\n else {\n\n Coord2d startMouse = prevMouse.clone();\n\n if (maintainInAxis)\n maintainInAxis(startMouse);\n\n\n\n // stop displaying mouse position on roll over\n mousePosition = new MousePosition();\n\n // start creating a selection\n mouseSelection.start2D = startMouse;\n mouseSelection.start3D = screenToModel(startMouse.x, startMouse.y);\n\n if (mouseSelection.start3D == null)\n System.err.println(\"Mouse.onMousePressed projection is null \");\n\n\n // screenToModel(bounds3d.getCorners())\n\n }\n }", "@Override\n public void mousePressed(MouseEvent me) {\n mouse_x = me.getX();\n mouse_y = me.getY();\n super.mousePressed(me);\n }", "void mousePressed(double x, double y, MouseEvent e );", "public void mouseMoved(MouseEvent e)\n {\n int x=e.getX();\n int y=e.getY();\n }", "public void mouseMoved (MouseEvent me) { mouse_x = me.getX(); mouse_y = me.getY(); repaint(); }", "@Override\n public void mouseMoved(MouseEvent e) {\n // Simply find x and y and then overwrite last frame data\n int x = e.getX();\n int y = e.getY();\n\n old_x = x;\n old_y = y;\n }", "public void pointToMouse() {\n pointToXY(p.mouseX,p.mouseY);\n }", "@Override\n\tpublic void mousePressed(MouseEvent e) {\n\t\tpvo3 = getPosition(e.getPoint());\n\t\t// System.out.println(pvo1.getX()+\",\"+pvo1.getY());\n\t}", "private void toolbarEmpMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_toolbarEmpMousePressed\n lastX = evt.getXOnScreen();\n lastY = evt.getYOnScreen();\n }", "public void mousePressed(MouseEvent e) {\n mouseX = e.getX();\n mouseY = e.getY();\n\n lastClicked = canvas.getElementAt(new GPoint(e.getPoint()));\n\n }", "@Override\r\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\tclickPoint = e.getPoint();\r\n\t\t\t\tselectionBounds = null;\r\n//\t\t\t\tSystem.out.println(\"Bac dau\" + e.getPoint().toString());\r\n\t\t\t\tbacdauX = (int) e.getPoint().getX();\r\n\t\t\t\tbacdauY = (int) e.getPoint().getY();\r\n\t\t\t}", "@Override\n\t\tpublic void mouseMoved(MouseEvent e) {\n\t\t\tint x = e.getX();\n\t\t\tint y = e.getY();\n\t\t\t//System.out.println(\"X: \" + x + \" Y: \" +y);\n\n\t\t}", "public void mousePressed(MouseEvent e)\n { \n this.startX=e.getX();\n this.startY=e.getY();\n\n }", "public void mousePressed(int mouseX, int mouseY) {\n\t\t// your code here\n\t\txI = mouseX;\n\t\tyI = mouseY;\n\t}", "@Override\n public void mousePressed(MouseEvent e) {\n // this.getVision().getCare().set(this.getVision().getSoul().newMemento());\n if (e.getButton() != MouseEvent.BUTTON1) {\n return;\n }\n if (getVerticallyPointOnGraph(e.getX(), e.getY()) != null) {\n setCurrentPoint(getVerticallyPointOnGraph(e.getX(), e.getY()));\n } else {\n setCurrentPoint(null);\n }\n \n if (getCurrentPoint() != null) {\n double toy = Math.min(Math.max(tCanvasPadding, e.getY()), getHeight() - bCanvasPadding);\n // System.out.println(\"moving to [\"+tox+\",\"+toy+\"]\");\n adapter.moveImagePoint(getCurrentPoint(), c2gy(toy));\n // getCurrentPoint().movePoint(getCurrentPoint(),\n // c2gx(tox),c2gy(toy,getCurrentPoint().getDataSet()));\n }\n // System.out.println(\"Current point is \"+currentPoint);\n }", "static void setTextMousePoint(int i,int j){tmpx=i;tmpy=j;}", "@Override\n\tpublic void mouseReleased(MouseEvent e) {\n\t\tnow_X = 'X';\n\t\tnow_Y = 'X';\n\t\trepaint();\n\t}", "@Override\n\tpublic void mousePressed(MouseEvent arg0) {\n\t\tint x = arg0.getX() / 20;\n\t\tint y = arg0.getY() / 20;\n\t\tGraphics g = this.getGraphics();\n\t\tg.setColor(Color.black);\n\t\tg.fillRect(x * 20, y * 20, 20, 20);\n\t\tg.setColor(Color.gray);\n\t\tg.drawRect(x * 20, y * 20, 20, 20);\n\t\t// System.out.println(\"x: \" + x + \" y: \" + y);\n\t\tthis.selected.add(y * 64 + x);\n\n\t}", "public void mouseClicked(MouseEvent e) {\n p.x = e.getX();\n p.y = e.getY();\n repaint();\n }", "private Point2D mouseLocation() {\n return FXGL.getInput().getMousePositionWorld();\n\n }", "@Override\npublic void mouseClicked(MouseEvent e)\n{\n\tSystem.out.println(e.getX() + \" :: \" + e.getY());\n}", "@Override\r\n\tpublic void press(EditorInterface i, MouseEvent e) {\r\n\t\tthis.x = e.getX();\r\n\t\tthis.y = e.getY();\r\n\t\t\r\n\t\r\n\t}", "public void mouseMoved(MouseEvent e) {\n mouseX = e.getX();\n mouseY = e.getY();\n }", "private void drawPanelMousePressed(java.awt.event.MouseEvent evt) {\n \n clicks = evt.getPoint();\n \n clicks = getClosedPoint(clicks);\n //System.out.print(ClickSX + \", \" + ClickSY + \",\\n \" );\n \n }", "public void mousePressed(MouseEvent event)\n\t\t{\n\t\t\ttempPoint1 = event.getPoint();\n\t\t}", "void mouseMoved(double x, double y, MouseEvent e );", "public void mousePressed(MouseEvent evt) {\n Location x = new Location( evt.getX(), evt.getY() );\n pond.checkAxis( x );\n\n }", "@Override\n\tpublic void drawPoint(MouseEvent e, int state) {\n\n\t}", "@Override\n\tpublic void mousePressed(MouseEvent arg0) {\n\t\tint x = arg0.getX();\n\t\tint y = arg0.getY();\n\t\tcurrentPoint = getPoint(x, y);\n\t\tif (currentPoint == null) {\n\t\t\tcurrentPoint = createPoint(x, y);\n\t\t\trepaint();\n\t\t}\n\t}", "@Override\r\n\tpublic void mousePressed(MouseEvent e) {\n\t\tPoint point = new Point();\r\n\t\tpoint.x = e.getX();\r\n\t\tpoint.y = e.getY();\r\n\r\n\t switch (shape) {\r\n\t \r\n\t case LINE :\r\n\r\n\t \tthis.clicksforLine.add(point);\r\n\t \tbreak;\r\n\t case CIRCLE:\r\n\r\n\t \tthis.clicksforCircle.add(point);\r\n\t \tbreak;\r\n\t case POLYGON:\r\n\r\n\t \tthis.clicksforPoly.add(point);\r\n\t \tbreak;\r\n\t case CURVE:\r\n\r\n\t \tthis.clicksforCurve.add(point);\r\n\t \tbreak;\r\n\t case CLEAR:\r\n\t {\r\n\t }\r\n\t \tbreak;\r\n\t default:\r\n\t \tbreak;\r\n\t }\r\n \r\n\t\tSystem.out.println(point.x+ \",\"+point.y);\r\n repaint();\r\n\t\t\r\n\t}", "private void cursorPosChanged( double x, double y )\n {\n }", "public void mouseMoved(MouseEvent e) {\n mX=e.getX();\n mY=e.getY();\n }", "public void mouseMoved(MouseEvent me)\n\t{\n m_mousePosition.x = me.getX();\n m_mousePosition.y = me.getY();\n m_brush = frame.getBrushValue();\n //System.out.println(m_mousePosition.x + \" \" + m_mousePosition.y + \" \");\n repaint();\n\t}", "public void mouseMoved(MouseEvent e) {\n \tapp.updateCoord(e.getX(),e.getY());\n }", "public void mouseMoved(MouseEvent evt) {\n\n\t\t\tif (isDrawing) {\n\t\t\t\tnewX = evt.getX();\n\t\t\t\tnewY = evt.getY();\n\t\t\t\t\n\t\t\t\trepaint();\n\n\t\t\t}\n\t\t}", "@Override\n public void mouseMoved(MouseEvent e) {\n mouseXPosition = e.getX();\n }", "@Override\r\n\t\t\tpublic void mouseUp(MouseEvent e) {\n\t\t\t\tx=y=-1;\r\n\t\t\t}", "public void mouseClickPositionSensor(int x, int y)\n\t{\n\t\t\n\t\tsensorActive = true;\n\t\tsensorX_Coordinate = x;\n\t\tsensorY_Coordinate = y;\n\n\t\tupdateCanvas();\n\t}", "void mouseClicked(double x, double y, MouseEvent e );", "@Override\n\tpublic void mousePressed(MouseEvent arg0) {\n\t\tgraphics.panel.requestFocus();\n\t\tx=arg0.getX();\n\t\ty=arg0.getY();\n\t}", "private void userInput(){\n if(mousePressed){\n rX -= (mouseY - pmouseY) * 0.002f;//map(mouseY,0,height,-PI,PI);\n rY -= (mouseX - pmouseX) * 0.002f;// map(mouseX,0,width,PI,-PI);\n }\n rotateX(rX);\n rotateY(rY);\n\n if(keyPressed){\n if(keyCode == UP){\n zoom += 0.01f;\n }\n if(keyCode == DOWN){\n zoom -= 0.01f;\n }\n }\n }", "@Override\r\n\tpublic void mousePressed(MouseEvent e) {\n\t\tpoints.add(new Point(e.getX(),e.getY()));\r\n\t\trepaint();\r\n\t}", "public void mouseClicked(int mouseX, int mouseY, int mouse) {}", "public void mouseMoved (MouseEvent n)\r\n {\r\n \tmouseX = n.getX();\r\n \tmouseY = n.getY();\r\n }", "@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\t\tint x = e.getX();\n\t\tint y = e.getY();\n\t\tSystem.out.println(x);\n\t\tSystem.out.println(y);\n\t}", "private void formMouseDragged(java.awt.event.MouseEvent evt) {\n int x = evt.getXOnScreen();\n int y = evt.getYOnScreen();\n setLocation(x-xMouse , y-yMouse);\n }", "public abstract void mousePressed(Point p);", "private void mouseMove() {\n if (this.holding) {\n Point point = new Point(mousex, mousey);\n this.addPixel(point);\n }\n }", "private void frameDragMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_frameDragMousePressed\n xMouse = evt.getX();\n yMouse = evt.getY();\n }", "@Override\n\tpublic void mouseMoved(MouseEvent arg0) {\n\t\t\n\t\tdouble x = arg0.getX();\n\t\tdouble y = arg0.getY();\n\t\tint row, column;\n\t\t\n\t\tcolumn = (int) (x * VerilogSprite.PIXEL_COLUMNS / width);\n\t\trow = (int) (y * VerilogSprite.PIXEL_ROWS / height);\n\t\t\n\t\tif (leftDown) {\n\t\t\t\n\t\t\tsprite.data[row][column] = 1;\n\t\t}\n\t\tif (rightDown)\n\t\t{\n\t\t\t\n\t\t\tsprite.data[row][column] = 0;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}", "public void\tmouseMoved(int oldx, int oldy, int newx, int newy) \n {\n mouseX = newx;\n mouseY = newy;\n }", "@Override\n public void mouseClicked(MouseEvent e) {\n //location where mouse was pressed\n Point mousePoint = e.getPoint();\n //conversion to location on frame\n Vec2 worldPoint = view.viewToWorld(mousePoint);\n float fx = e.getPoint().x;\n float fy = e.getPoint().y;\n float vx = worldPoint.x;\n float vy = worldPoint.y;\n //Completes checks for pressing of GUI components\n restartCheck(vx, vy);\n settingsCheck(vx, vy);\n zoomCheck(fx, fy);\n }", "public void mouseDragged(MouseEvent e) {\n mouseX = e.getX();\n mouseY = e.getY();\n }", "public void mouseReleased(MouseEvent evt) {\n\t\t\t// newX = evt.getX();\n\t\t\t// newY = evt.getY();\n\t\t\t// System.out.println(newX + \" released \" + newY);\n\t\t}", "public void mouseMoved(MouseEvent e){}", "@Override\n public boolean mouseClicked(double posX, double posY, int mouseButton) {\n if(gettingSigned){\n return super.superMouseClicked(posX, posY, mouseButton);\n }\n\n int mouseX = (int)Math.floor(posX);\n int mouseY = (int)Math.floor(posY);\n\n undoStarted = true;\n touchedCanvas = false;\n if(undoStack.size() >= maxUndoLength){\n undoStack.removeLast();\n }\n undoStack.push(pixels.clone());\n\n if(inCanvas(mouseX, mouseY)){\n if(isPickingColor){\n int x = (mouseX - canvasX)/ canvasPixelScale;\n int y = (mouseY - canvasY)/ canvasPixelScale;\n if(x >= 0 && y >= 0 && x < canvasPixelWidth && y < canvasPixelHeight){\n int color = getPixelAt(x, y);\n carriedColor = new PaletteUtil.Color(color);\n setCarryingColor();\n playSound(SoundEvents.COLOR_PICKER_SUCK);\n }\n }\n else{\n clickedCanvas(mouseX, mouseY, mouseButton);\n playBrushSound();\n }\n }\n\n if(inBrushMeter(mouseX, mouseY)){\n int selectedSize = 3 - (mouseY - brushMeterY)/brushSpriteSize;\n if(selectedSize >= 0){\n brushSize = selectedSize;\n }\n }\n return super.mouseClicked(mouseX, mouseY, mouseButton);\n }", "void mouseReleased(double x, double y, MouseEvent e );", "public void mousePressed() {\n }", "void onMouseMoved(double mouseX, double mouseY, double prevMouseX, double prevMouseY);", "private void setMousePossition() {\n mouseX = Mouse.getMouseX() / Display.SCALE;\n mouseY = Mouse.getMouseY() / Display.SCALE;\n }", "public void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "public void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\r\n public void mouseDragged(MouseEvent e) {\r\n int deltaX = e.getXOnScreen() - screenX;\r\n int deltaY = e.getYOnScreen() - screenY; \r\n \r\n setLocation(myX + deltaX, myY + deltaY);\r\n }", "public void mousePressed(MouseEvent evt) {\r\n xPressed = evt.getX(); // store the x coordinate of the mouse\r\n yPressed = evt.getY(); // store the y coordinate of the mouse\r\n System.out.println(\"Mouse key pressed at coordinate (\"\r\n + xPressed + \", \" + yPressed + \").\");\r\n System.out.println(\"calling method mousePressed() of class PaintTool.\");\r\n ge.mousePressed(xPressed, yPressed, gra);\r\n // call method mousePressed() of class PaintTool\r\n System.out.println(\"method mousePressed() of class PaintTool executed.\");\r\n }", "@Override\n\tpublic void mouseClicked(MouseEvent e)\n\t{\n\t\tSystem.out.println(e.getX()+\",\"+e.getY());\n\t\t\n\t\t//On envoie au controller les coordonnées selectionnées:\n\t\tcontroller.clicOnMap(e.getX(), e.getY());\n\t}", "@Override\r\n public void mouseMoved(MouseEvent e) {\r\n int mouseX = e.getX();\r\n int mouseY = e.getY();\r\n\r\n if (eyesOpen == true) {\r\n //top left\r\n if (mouseX <= 385) {\r\n System.out.println(\"385\");\r\n }\r\n if (mouseX >= 390) {\r\n System.out.println(\"390\");\r\n }\r\n if (mouseX <= 385 && mouseY <= 245 && mouseY > 207) {\r\n eyeball1X = 380;\r\n eyeball1Y = 240;\r\n eyeball2X = 417;\r\n eyeball2Y = 240;\r\n }\r\n //bottom left\r\n if (mouseX <= 385 && mouseY >= 257) {\r\n eyeball1X = 380;\r\n eyeball1Y = 245;\r\n eyeball2X = 417;\r\n eyeball2Y = 245;\r\n }\r\n //top middle\r\n if (mouseX >= 390 && mouseX <= 410 && mouseY > 207) {\r\n eyeball1X = 385;\r\n eyeball1Y = 240;\r\n eyeball2X = 420;\r\n eyeball2Y = 240;\r\n }\r\n //bottom middle\r\n if (mouseX >= 390 && mouseX <= 410 && mouseY >= 267) {\r\n eyeball1X = 385;\r\n eyeball1Y = 245;\r\n eyeball2X = 420;\r\n eyeball2Y = 245;\r\n }\r\n //top right\r\n if (mouseX > 410 && mouseY <= 245 && mouseY > 207) {\r\n eyeball1X = 390;\r\n eyeball1Y = 240;\r\n eyeball2X = 425;\r\n eyeball2Y = 240;\r\n }\r\n //bottom right\r\n if (mouseX > 410 && mouseY >= 257) {\r\n eyeball1X = 390;\r\n eyeball1Y = 245;\r\n eyeball2X = 425;\r\n eyeball2Y = 245;\r\n }\r\n\r\n }\r\n }", "public void mouseMoved(MouseEvent e) {}", "@Override\n\tpublic void mousePressed(MouseEvent e) {\n\t\t\n\t\tif(e.getSource()==b) {\n\t\t\ty = Double.parseDouble(tf.getText());\n\t\t\ty = (5.0/9.0)*(y-32.0);\n\t\t\tx = Double.toString(y);\n\t\t\tl1.setText(x);\n\t\t}\n\t\t\n\t\t\n\t}", "public void mouseMoved(MouseEvent e) {}", "public void mouseMoved(MouseEvent e) {}", "@Override\r\n\tpublic void mouseMoved(MouseEvent e) {\n\t\thero.x = e.getX();\r\n\t\thero.y = e.getY();\r\n\t\tSystem.out.println(hero.x + \":\" + hero.y);\r\n\t\t\r\n\t}", "@Override\r\n\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\tx = e.getX();\r\n\t\t\ty = e.getY();\r\n\r\n\t\t\tsetTitle(\"x=\" + x + \",y=\" + y);\r\n\r\n\t\t\trepaint(); // paint()를 호출\r\n\t\t}", "public void mousePressed(MouseEvent e) {\n\t\t// It's true that the mouse is pressed\n\t\tmousePress = true;\n\t\t// Record the point user presses as starting point\n\t\tstartTrunk = new Point2D.Double(e.getX(), e.getY());\n\t}", "public void mousePressed() {\n vy = -17;\n //if we weren't playing the game when pressing the mouse, we want to start\n //the game. We do this by reseting all the values used while playing the game\n if(gamestate==1) {\n wx[0] = 600;\n wy[0] = y = height/2;\n wx[1] = 900;\n wy[1] = 600;\n x = gamestate = score = 0;\n }\n}", "public void mouseDragged( MouseEvent e ){\n\t\t\t\t\tint xValue, yValue;// comments similar to mousePressed method\n\t\t\t\t\tCoordinate currentMousePosition;\n\t\t\t\t\txValue = e.getX();\n\t\t\t\t\tyValue = e.getY();\n\t\t\t\t\tcurrentMousePosition = new Coordinate(xValue, yValue);\n\t\t\t\t\tmousePositionOnBoard(currentMousePosition);\n\t\t\t\t\trepaint();\n\t\t\t\t}", "public void mouseClicked(MouseEvent e) {\n System.out.println(e.getX()+\" \"+e.getY());\n \n switch(state){\n case DEFAULT:\n if(e.isMetaDown()){\n String info = \"\";\n \n }\n break;\n \n case ROAD_BUILDING:\n //TODO\n break;\n \n case SETTLEMENT_BUILDING:\n //TODO\n break;\n \n case CITY_BUILDING:\n //TODO\n break;\n \n case ROBBER:\n int[] coordinates = new int[2];\n //coordinates[0]\n break;\n }\n }", "public void tick() {\n\t\ta = Window.frame.getMousePosition();\n\t\tif (a != null) {\n\t\t\tmx = (int)a.getX();\n\t\t\tmy = (int)a.getY();\n\t\t}\n\t\t//System.out.println(a);\n\t}", "public void mousePressed(MouseEvent e) {\n }", "@Override\n public void handle(MouseEvent event) {\n double doubleX = event.getSceneX()/cellSize;\n double doubleY = event.getSceneY()/cellSize;\n positionX = (int) doubleX;\n positionY = (int) doubleY;\n }", "protected void userDrawing(MouseEvent e){\n\t}", "@Override\n public void mousePressed(MouseEvent e) {\n idx = getIdx(e);\n }", "@Override\n public void mouseMoved(MouseEvent e) {\n\n }", "public void Draw(Graphics2D g2d, Point mousePosition)\n {\n \n }", "public void mousePressed(MouseEvent e) {}", "public void mousePressed(MouseEvent e) {}", "public void mousePressed(MouseEvent e) {}", "@Override\r\n public void mousePressed(MouseEvent e) {\n startDrag = new Point(e.getX(), e.getY());\r\n endDrag = startDrag;\r\n repaint();\r\n\r\n }", "@Override\r\n\tpublic void mousePressed(MouseEvent e) {\n\t\tint mx= e.getX();\r\n\t\tint my= e.getY();\r\n\t\t\r\n\t\tSystem.out.println(\"X: \"+mx +\"Y: \"+my);\r\n\r\n\t\t// playButton\r\n\t\tif (mx >= Frame.width / 2 - 95 && mx <= Frame.width / 2 + 295) {\r\n\t\t\tif (my >= 450 && my <= 560 && state == STATE.MENU) {\r\n\t\t\t\tstate = STATE.GAME;\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// quitButton\r\n\t\tif (mx >= Frame.width / 2 - 95 && mx <= Frame.width / 2 + 295) {\r\n\t\t\tif (my >= 650 && my <= 770 && state == STATE.MENU) {\r\n\t\t\t\tSystem.exit(1);\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// MenuButton\r\n\t\tif (mx >= Frame.width / 2 - 95 && mx <= Frame.width / 2 + 295) {\r\n\t\t\tif (my >= 450 && my <= 560 && state == STATE.GOVER) {\r\n\t\t\t\tstate = STATE.MENU;\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// quitButton\r\n\t\tif (mx >= Frame.width / 2 - 95 && mx <= Frame.width / 2 + 295) {\r\n\t\t\tif (my >= 650 && my <= 770 && state == STATE.GOVER) {\r\n\t\t\t\tSystem.exit(1);\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "@Override\n public void mouseMoved(MouseEvent e){\n \n }" ]
[ "0.773072", "0.773072", "0.773072", "0.75990117", "0.72675323", "0.72675323", "0.724931", "0.7230228", "0.7190003", "0.7132299", "0.70433396", "0.69200945", "0.6906912", "0.6869073", "0.686367", "0.6852782", "0.68526167", "0.68258893", "0.6813664", "0.6811191", "0.6713555", "0.66823626", "0.66816956", "0.663923", "0.662712", "0.6612035", "0.660339", "0.65537137", "0.6542785", "0.6533077", "0.6506233", "0.6503143", "0.64923835", "0.64709646", "0.643463", "0.6413813", "0.641295", "0.64024705", "0.6401639", "0.63929373", "0.63856", "0.63828826", "0.6373741", "0.6365062", "0.6358166", "0.6355095", "0.6347922", "0.6346022", "0.62938136", "0.62836564", "0.6279354", "0.6263175", "0.62549996", "0.6249453", "0.6214088", "0.618583", "0.6185194", "0.61836636", "0.6165811", "0.6159478", "0.615461", "0.61528414", "0.6149897", "0.61472213", "0.6104452", "0.60965264", "0.609583", "0.6089997", "0.6087675", "0.60860133", "0.60789275", "0.6078662", "0.6078662", "0.60785806", "0.60751486", "0.60749876", "0.60744196", "0.6074293", "0.60732645", "0.6059965", "0.6059965", "0.6059386", "0.60570735", "0.6050194", "0.60368943", "0.6034657", "0.60279864", "0.60203224", "0.60173666", "0.6015101", "0.60091203", "0.60061836", "0.6005556", "0.6005023", "0.59934837", "0.59934837", "0.59934837", "0.59907806", "0.5988062", "0.59801865" ]
0.72238916
8
Coordinates x,y when mouse is dragged
public void mouseDragged(MouseEvent e) { currX = e.getX(); currY = e.getY(); if(g2 != null) { // Draw line if g2 context is not null g2.drawLine(oldX, oldY, currX, currY); // Refresh draw area to repaint repaint(); // Stores current coordinates x,y as old x,y oldX = currX; oldY = currY; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void mouseMoved(MouseEvent e)\n {\n int x=e.getX();\n int y=e.getY();\n }", "public void mouseDragged(MouseEvent e) {\n mouseX = e.getX();\n mouseY = e.getY();\n }", "@Override\n\t\tpublic void mouseMoved(MouseEvent e) {\n\t\t\tint x = e.getX();\n\t\t\tint y = e.getY();\n\t\t\t//System.out.println(\"X: \" + x + \" Y: \" +y);\n\n\t\t}", "public void mouseDragged (MouseEvent n)\r\n {\r\n \tmouseX = n.getX();\r\n \tmouseY = n.getY();\r\n }", "void mouseDragged(double x, double y, MouseEvent e );", "@Override\n public void mouseMoved(MouseEvent e) {\n mouseXPosition = e.getX();\n }", "@Override\n\tpublic void mouseDragged(MouseEvent e) {\n\t\tdx=dx+(e.getX()-x);\n\t\tdy=dy+(e.getY()-y);\n\t\t\n\t\tx=e.getX();\n\t\ty=e.getY();\n\t}", "public void mouseDragged(MouseEvent evt) {\n\t\t\t// newX = evt.getX();\n\t\t\t// newY = evt.getY();\n\t\t\t// System.out.println(newX + \" dragged \" + newY);\n\t\t}", "@Override\r\n\t\t\tpublic void mouseDown(MouseEvent e) {\n\t\t\t\tx=e.x;\r\n\t\t\t\ty=e.y;\t\t\t\t\r\n\r\n\t\t\t}", "@Override\r\n public void mouseDragged(MouseEvent e) {\r\n int deltaX = e.getXOnScreen() - screenX;\r\n int deltaY = e.getYOnScreen() - screenY; \r\n \r\n setLocation(myX + deltaX, myY + deltaY);\r\n }", "private void formMouseDragged(java.awt.event.MouseEvent evt) {\n int x = evt.getXOnScreen();\n int y = evt.getYOnScreen();\n setLocation(x-xMouse , y-yMouse);\n }", "public void mouseMoved(MouseEvent e) {\n mX=e.getX();\n mY=e.getY();\n }", "double getXPosition();", "@Override\n public void mouseDragged(MouseEvent evt) {\n setLocation(evt.getXOnScreen() - posX, evt.getYOnScreen() - posY);\n }", "public void mouseMoved(MouseEvent e) {\n mouseX = e.getX();\n mouseY = e.getY();\n }", "public void mouseDragged( MouseEvent evt ){\n Location x = new Location( evt.getX(), evt.getY() );\n pond.moveAxis(x, canvas);\n\n }", "@Override\r\n\tpublic void drag(EditorInterface i, MouseEvent e) {\r\n\t\t\r\n\t\tthis.x = e.getX();\r\n\t\tthis.y = e.getY();\r\n\t}", "void mouseMoved(double x, double y, MouseEvent e );", "public void mousePressed(MouseEvent e) {\n xinitial = e.getX() / 5; //get the x value\r\n yinitial = e.getY() / 5; //get the y value\r\n }", "public void mouseDragged( MouseEvent e ){\n\t\t\t\t\tint xValue, yValue;// comments similar to mousePressed method\n\t\t\t\t\tCoordinate currentMousePosition;\n\t\t\t\t\txValue = e.getX();\n\t\t\t\t\tyValue = e.getY();\n\t\t\t\t\tcurrentMousePosition = new Coordinate(xValue, yValue);\n\t\t\t\t\tmousePositionOnBoard(currentMousePosition);\n\t\t\t\t\trepaint();\n\t\t\t\t}", "public void mouseDragged (MouseEvent e) {}", "public void mouseMoved(MouseEvent e) {\n ptDragStart = e.getPoint();\r\n\r\n }", "@Override\n\tpublic void mouseDragged(MouseEvent e) {\n\t\tplayerx = e.getX();\n\t\tplayery = e.getY();\n\t}", "@Override\n public void drag(int x, int y)\n {\n }", "public void mouseMoved (MouseEvent me) { mouse_x = me.getX(); mouse_y = me.getY(); repaint(); }", "private void frameDragMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_frameDragMousePressed\n xMouse = evt.getX();\n yMouse = evt.getY();\n }", "public void mouseDragged(MouseEvent e) {}", "public void mouseDragged(MouseEvent e){}", "@Override\n public void mousePressed(MouseEvent e) {\n x_pressed = e.getX();\n y_pressed = e.getY();\n \n }", "@Override\n public void mousePressed(MouseEvent e) {\n x_pressed = e.getX();\n y_pressed = e.getY();\n \n }", "@Override\n public void mousePressed(MouseEvent e) {\n x_pressed = e.getX();\n y_pressed = e.getY();\n \n }", "public int getXPos();", "@Override\r\n public void mouseDragged(MouseEvent e) {\n int thisX = getLocation().x;\r\n int thisY = getLocation().y;\r\n\r\n //determina el desplazamiento\r\n int xMoved = (thisX + e.getX()) - (thisX + initialClick.x);\r\n int yMoved = (thisY + e.getY()) - (thisY + initialClick.y);\r\n\r\n //mueve la ventana a su nueva posicion\r\n int X = thisX + xMoved;\r\n int Y = thisY + yMoved;\r\n this.setLocation(X, Y);\r\n }", "public void mouseDragged( MouseEvent event ){}", "public void mouseMoved (MouseEvent n)\r\n {\r\n \tmouseX = n.getX();\r\n \tmouseY = n.getY();\r\n }", "private void formMousePressed(java.awt.event.MouseEvent evt) {\n xx=evt.getX();\n xy=evt.getY();\n \n }", "private void formMousePressed(java.awt.event.MouseEvent evt) {\n xx=evt.getX();\n xy=evt.getY();\n \n }", "public void mouseMoved(MouseEvent e) {\n \tapp.updateCoord(e.getX(),e.getY());\n }", "@Override\n public void mousePressed(MouseEvent e) {\n x_pressed = e.getX();\n y_pressed = e.getY();\n \n }", "public void mouseDragged(MouseEvent mouseDrag)\r\n\t{\r\n\t\tmouseDraggedX = mouseDrag.getX();\r\n\t\tmouseDraggedY = mouseDrag.getY();\r\n\t\tmouseDraggedFlag = true;\r\n\t\t//System.out.println(\"mouseDraggedX: \" + mouseDraggedX);\r\n\t\t//System.out.println(\"mouseDraggedY: \" + mouseDraggedY);\r\n\t\t\r\n\t\t\r\n\t}", "public void mouseDragged(MouseEvent e) {\n }", "public void mouseDragged(MouseEvent e)\n {}", "boolean onMouseDragged(double mouseX, double mouseY, double prevMouseX, double prevMouseY);", "public void drag(Point p);", "private Point2D mouseLocation() {\n return FXGL.getInput().getMousePositionWorld();\n\n }", "public void mouseDragged(MouseEvent event) { }", "public void mouseDragged( MouseEvent e ) {\n }", "double getPositionX();", "double getPositionX();", "double getPositionX();", "public void mouseDragged(MouseEvent e) {\n\n }", "@Override\r\n\t\t\tpublic void mouseDragged(MouseEvent e) {\n\t\t\t\tPoint point=getLocation();\r\n\t\t\t\tsetLocation(point.x + (e.getX() - origin.x), point.y + (e.getY() - origin.y));\r\n\t\t\t}", "@Override\npublic void mouseClicked(MouseEvent e)\n{\n\tSystem.out.println(e.getX() + \" :: \" + e.getY());\n}", "void onMouseMoved(double mouseX, double mouseY, double prevMouseX, double prevMouseY);", "public void mouseMoved(MouseEvent e) {}", "public void mouseMoved(MouseEvent e) {}", "public int getX(){ return xPosition; }", "@Override\n public double getLocationX() {\n return myMovable.getLocationX();\n }", "public int getX() { return position.x; }", "public void mouseDragged(MouseEvent e) {\n int x = e.getX();\n int y = e.getY();\n Dimension size = e.getComponent().getSize();\n\n float thetaY = 360.0f * ( (float)(x-prevMouseX)/(float)size.width);\n float thetaX = 360.0f * ( (float)(prevMouseY-y)/(float)size.height);\n \n prevMouseX = x;\n prevMouseY = y;\n\n view_rotx += thetaX;\n view_roty += thetaY;\n }", "public void mouseDragged(MouseEvent e) {\n\t\t\n\t}", "public void mouseDragged(MouseEvent e) {\n\t\t\r\n\t}", "public void mouseDragged(MouseEvent e) {\n\t\t\r\n\t}", "@Override\n\tpublic void mousePressed(MouseEvent e) {\n\t\tpvo3 = getPosition(e.getPoint());\n\t\t// System.out.println(pvo1.getX()+\",\"+pvo1.getY());\n\t}", "public void mouseDragged(MouseEvent e) {\n\t}", "private void PanelPertamaMouseDragged(java.awt.event.MouseEvent evt) {\n int x = evt.getXOnScreen();\n int y = evt.getYOnScreen();\n this.setLocation(x - xx, y - xy);\n }", "public void mouseMoved( MouseEvent event )\n\t {\n\t \t /*\n\t \t * Change one unit into pixels sx = width/(b-a)\n\t \t * X = (x-a)*sx\n\t \t * \n\t \t * sy = height/(ymax - ymin)\n\t \t * Y1 = height - (y-ymin)*sy\n\t \t * Y2 = (ymax-y)*sy\n\t \t * Y1=Y2(same expression)\n\t \t */\n\t \t double b = InputView.getEnd();\n\t \t\t double a = InputView.getStart();\n\t \t DecimalFormat df = new DecimalFormat(\"#.##\");\n\t \t double sx = 594/(b-a);\n\t \t double sy = 572/(PlotPoints.getMax()-PlotPoints.getMin());\n\t \t coords.setText( \"(\"+ df.format((event.getX()/sx)+a-.02) + \", \" + df.format((.17 + PlotPoints.getMax()) - (event.getY()/sy)) + \")\" );\n\t }", "public void mouseMoved(MouseEvent e){}", "public double getMouseX() {\n\t\treturn getMousePosition().getX();\n\t}", "public double getXPos(){\n return xPos;\n }", "@Override\n public void handleMouseDragged(int x, int y)\n {\n windowManager.mouseDragged(deskXToAbst(x), deskYToAbst(y));\n }", "@Override\n public void mouseDragged(MouseEvent arg0) {\n \n }", "private void frameDragMouseDragged(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_frameDragMouseDragged\n int x = evt.getXOnScreen();\n int y = evt.getYOnScreen();\n \n this.setLocation(x - xMouse, y - yMouse);\n }", "public void mouseMoved(MouseEvent e) {}", "public abstract void mouseMoved(Point p);", "public void mouseMoved(MouseEvent evt) { }", "@Override\r\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\torigin.x=e.getX();\r\n\t\t\t\torigin.y=e.getY();\r\n\t\t\t}", "public void mousePressed(MouseEvent e) {\n pX = e.getX();\n pY = e.getY();\n }", "@FXML\n private void mouseDown(MouseEvent event) {\n preDragX = event.getX();\n preDragY = event.getY();\n }", "@Override\n\tpublic Point getPosition (Interface inter) {\n\t\tif (dragging) {\n\t\t\tPoint point=new Point(position);\n\t\t\tpoint.translate(inter.getMouse().x-attachPoint.x,inter.getMouse().y-attachPoint.y);\n\t\t\treturn point;\n\t\t}\n\t\treturn position;\n\t}", "public abstract void mouseMoved(int displayX, int displayY);", "public double getMouseClickedX() {\n\t\treturn Lel.coreEngine.panelPositionToWorld(input.getMouseClickedPosition()).getX();\n\t}", "public void mouseDragged(java.awt.event.MouseEvent evt) {\n tmp.setLocation(cuadroSeleccionado.getLocation().x + evt.getX() - 18, cuadroSeleccionado.getLocation().y + evt.getY() - 28);\n }", "public void mouseDragged(MouseEvent e) {\n\t \t\t\n\t \t}", "@Override\r\n\tpublic void mouseMoved(MouseEvent e) {\n\t\thero.x = e.getX();\r\n\t\thero.y = e.getY();\r\n\t\tSystem.out.println(hero.x + \":\" + hero.y);\r\n\t\t\r\n\t}", "public void mousePressed(MouseEvent e) {\n oldX = e.getX();\r\n oldY = e.getY();\r\n }", "@Override\n public void mouseMoved(MouseEvent e) {\n // Simply find x and y and then overwrite last frame data\n int x = e.getX();\n int y = e.getY();\n\n old_x = x;\n old_y = y;\n }", "@Override\r\n public void mouseDragged(MouseEvent e) {\n }", "public void mouseMoved(MouseEvent e,double w,double h) throws RemoteException;", "@Override\n\tpublic void mouseDragged(MouseEvent e) \n\t{\n\t\tsuper.mouseDragged(e);\n\n\t\tthis.model.setPosition(e.getX()/2, e.getY()/2);\t//TODO: Important: test this! is it always /2 ? \n\t}", "public void mouseMoved(MouseEvent event) {\n }", "@Override\n public void mouseDragged(MouseEvent e) {\n\n }", "public int getX() {\r\n return xpos;\r\n }", "public void mouseMoved(MouseEvent e) {\n }", "private void toolbarEmpMouseDragged(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_toolbarEmpMouseDragged\n int x = evt.getXOnScreen();\n int y = evt.getYOnScreen();\n // Move frame by the mouse delta\n setLocation(getLocationOnScreen().x + x - lastX,\n getLocationOnScreen().y + y - lastY);\n lastX = x;\n lastY = y;\n }", "public int getXPosition(){\n\t\treturn xPosition;\n\t}", "@Override\n\t\tpublic void mouseDragged(MouseEvent arg0) {\n\t\t\t\n\t\t}", "@Override\n\tpublic void mouseDragged(MouseEvent arg0) {\n\t\tif (currentPoint != null) {\n\t\t\tcurrentPoint.setLocation(arg0.getX() - dx, arg0.getY() - dy);\n\t\t\trepaint();\n\t\t}\n\t}", "public int getXPosition()\n {\n return xPosition;\n }", "public int getXPosition()\n {\n return xPosition;\n }", "public void mouseDragged(MouseEvent e) {\n\n try {\n dragEndScreen = e.getPoint();\n //Create a point2d.float with the\n Point2D.Float dragStart = transformPoint(dragStartScreen);\n Point2D.Float dragEnd = transformPoint(dragEndScreen);\n //calculate how far the screen is dragged from its start position.\n double dx = dragEnd.getX() - dragStart.getX();\n double dy = dragEnd.getY() - dragStart.getY();\n transform.translate(dx, dy);\n\n //remember to reposition points to avoid unstable dragging.\n dragStartScreen = dragEndScreen;\n dragEndScreen = null;\n repaint();\n } catch (NoninvertibleTransformException ex) {\n ex.printStackTrace();\n }\n\n }" ]
[ "0.80597997", "0.7867468", "0.7789806", "0.7673341", "0.7569077", "0.7517933", "0.74987745", "0.7489209", "0.7410563", "0.7357674", "0.7347557", "0.7320135", "0.73020333", "0.7224214", "0.7220279", "0.7218572", "0.7217164", "0.71928877", "0.7174046", "0.71319604", "0.712461", "0.71210325", "0.7111977", "0.71094716", "0.71084094", "0.7086545", "0.7078553", "0.7068182", "0.70216006", "0.70216006", "0.70216006", "0.70006275", "0.69985116", "0.6978112", "0.6963673", "0.69437504", "0.69437504", "0.6930908", "0.69282943", "0.6925958", "0.6912009", "0.6904168", "0.6898974", "0.68862313", "0.68844074", "0.6878404", "0.68702334", "0.68335545", "0.68335545", "0.68335545", "0.68312615", "0.6822685", "0.67812586", "0.6768559", "0.67608726", "0.67608726", "0.6755645", "0.6752294", "0.6730228", "0.6730002", "0.6728011", "0.672231", "0.672231", "0.671691", "0.66996175", "0.66921365", "0.66897404", "0.6684652", "0.66834176", "0.6675153", "0.6668877", "0.666643", "0.66661006", "0.66635245", "0.6663382", "0.665783", "0.6657029", "0.6649097", "0.6645924", "0.6643935", "0.6642933", "0.6634125", "0.6632144", "0.66267955", "0.6626062", "0.662452", "0.66102165", "0.6609375", "0.6603754", "0.6598926", "0.6594147", "0.65929323", "0.6589016", "0.65742904", "0.6559112", "0.65590245", "0.65512127", "0.65496683", "0.65494084", "0.65494084", "0.65460175" ]
0.0
-1
Apply red color on g2 context
public void red() { g2.setPaint(Color.red); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void modeColor(Graphics2D g2d) { g2d.setColor(RTColorManager.getColor(\"label\", \"default\")); }", "public void green() {\n g2.setPaint(Color.green);\r\n }", "@Override\n\tpublic String getColor() {\n\t\treturn \"red\";\n\t}", "public Color getColor()\r\n\t{\r\n\t\treturn _g2.getColor();\r\n\t}", "@Override\r\n\tpublic void howToColor() {\n\t\t\r\n\t}", "public void blue() {\n g2.setPaint(Color.blue);\r\n }", "public void setColor(int r, int g, int b);", "@Override\n\tpublic void setColour(float r, float g, float b) {\n\n\t}", "public void applyColor() {\n\t\tSystem.out.println(\"Yellow\");\n\n\t}", "@Override\n public void redCell() {\n gCell.setFill(Color.ORANGERED);\n }", "@Override\r\n\tpublic void execute(Graphics2D g) {\r\n\t\tg.setColor(drawColor);\r\n\t}", "@Override\n\tpublic String getColor() {\n\t\treturn \"blue\";\n\t}", "Color(int R, int G, int B) {\r\n\t\t this.rgb = new RGB(R,G,B);\r\n\t\t this.colorific = true;\r\n\t }", "void setColor(int r, int g, int b);", "void setRed(int x, int y, int value);", "@Override\n\tpublic String addcolor() {\n\t\treturn \"Green color is applied\";\n\t}", "@Override\n\tpublic void changeColor2(Color color) {\n\n\t}", "public void draw(Graphics2D g2){\n g2.setColor(color);\n g2.fillOval(x,y, w, w);\n }", "@Override\n\tpublic void color() {\n\t\tSystem.out.println(\"Colour is red\");\n\t\t\n\t}", "String getColor();", "@Override\n public void color(double red, double green, double blue, double alpha) {\n GL11.glColor4d(red, green, blue, alpha);\n }", "private void changeShapeColor(int r, int g, int b)\n\t{\n\t\tthis.red = r;\n\t\tthis.green = g;\n\t\tthis.blue = b;\n\t}", "public void setRrColor(Color value) {\n rrColor = value;\n }", "private void colorNode(Node root2, Color c) {\r\n pMap.get(root2.getId()).changeColor(\"fillColor\", c, null, null);\r\n }", "public void Color() {\n\t\t\r\n\t}", "public void setColor(float r, float g, float b, float a);", "public int getColor();", "public int getColor();", "private void\tsetColor(GL2 gl, int r, int g, int b, int a)\n\t{\n\t\tgl.glColor4f(r / 255.0f, g / 255.0f, b / 255.0f, a / 255.0f);\n\t}", "public RMColor getColor() { return getFill()==null? RMColor.black : getFill().getColor(); }", "public String getColor() { \n return color; \n }", "@Override\n\tpublic void Red() {\n\t\tSystem.out.println(\"Red Light\");\n\t\t\n\t}", "public Color4 getEffectColorAdd();", "@Override\n public Color getColor() {\n return color;\n }", "public void magenta() {\n g2.setPaint(Color.magenta);\r\n }", "private native void setModelColor(float r,float g,float b);", "public void init_colors_red(){\t\n\t\tColor c1 = new Color(0,0,0);\t\t// BLACK\t\t\n\t\tColor c2 = new Color(255,0,0);\t// RED\n\t\tColor c3 = new Color(255,170,0);\t// ORANGE\n\t\tColor c4 = new Color(255,255,255);\t// WHITE\n\t\t\n\t\tinit_colors(c1,c2,c3,c4);\n\t}", "@Override\n public ShapeColor setColor(int r, int g, int b) {\n return new ShapeColor(r, g, b);\n }", "public int getRed() {\n\t\treturn 100;\n\t}", "RGB getNewColor();", "RGB getOldColor();", "@Override\n\t\tpublic Color color() { return color; }", "protected void paint2D (Graphics2D g2) {\n\t AffineTransform tform = AffineTransform.getTranslateInstance( 0, 0);\n\t tform.scale(0.1, 0.1); \n\t //set the properties of g2\n\t g2.setTransform( tform);\n\t g2.setColor( Color.BLUE); \n\t }", "public String getColor(){\r\n return color;\r\n }", "int getRed(int x, int y);", "java.awt.Color getColor();", "public void setColor(Graphics2D g){\r\n if(color.equals(\"yellow\") || color.equals(\"Yellow\"))\r\n g.setColor(Color.yellow);\r\n if(color.equals(\"red\") || color.equals(\"Red\"))\r\n g.setColor(Color.red);\r\n if(color.equals(\"blue\") || color.equals(\"Blue\"))\r\n g.setColor(Color.blue);\r\n \r\n }", "public void setRed(final int red) {\n\t\tthis.r = red;\n\t}", "@NoProxy\n @NoWrap\n @NoDump\n public String getColor() {\n return color;\n }", "public abstract BossColor getColor();", "public Color getColor() { return color; }", "@Override\n Color getColor() {\n return new Color(32, 83, 226, 255);\n }", "@Override\n public void excute() {\n drawable.setColor(color);\n }", "public String getColor(){\n return this.color;\n }", "public String getColor(){\n return this._color;\n }", "public Color getColor(){\r\n return color_rey;\r\n }", "public void draw(Graphics2D g2)\n {\n Rectangle2D.Double grass= new Rectangle2D.Double(Xx,Yy,Ww,Hh);\n \n Color greeen = new Color(41,112,24);\n \n g2.setColor(greeen);\n g2.fill(grass);\n \n }", "public void setColor(int red, int green, int blue){\r\n this.red = red;\r\n this.green = green;\r\n this.blue = blue;\r\n }", "abstract public String getColor();", "abstract public String getColor();", "public int getColor(){\r\n\t\treturn color;\r\n\t}", "@Override\n public String getTokenColorLetter() {\n return \"R\";\n }", "@Override\n public String getColor() {\n return this.color;\n }", "@Override\r\n\tpublic String getColor() {\n\t\treturn \"white\";\r\n\t}", "public GameColor getColor();", "abstract String getColor();", "void setColor(){\n this.objectColour = new Color(rValue,gValue,bValue,timeToLive).brighter();\n }", "default Color getColor() {\r\n\t\treturn Color.RED;\r\n\t}", "Color getColor();", "Color getColor();", "Color getColor();", "Color getColor();", "Color getColor();", "@Override\n public String getType() {\n return \"Color change\";\n }", "@Override\n public void render(Graphics2D g2) {\n g2.setColor(super.getColor());\n g2.fillPolygon(triangleFill);\n }", "public void setColor(int gnum, Color col);", "private void red(){\n\t\tthis.arretes_fR();\n\t\tthis.coins_fR();\n\t\tthis.coins_a1R();\n\t\tthis.coins_a2R();\n\t\tthis.aretes_aR();\n\t\tthis.cube[13] = \"R\";\n\t}", "@Override\n\tprotected char getColor(int position) {\n\t\treturn color;\n\t}", "public String getColor()\n {\n return color;\n }", "public String getColor()\n {\n return color;\n }", "public Color getColor();", "public Color getColor();", "public Color getColor();", "void setRed(int red){\n \n this.red = red;\n }", "public Color(double newR, double newG, double newB) {\n\n\t\tr = newR;\n\t\tg = newG;\n\t\tb = newB;\n\t}", "public String getColorString();", "public int getColor(){\n\t\treturn color;\n\t}", "public int getColor(){\n\t\treturn color;\n\t}", "public int getColor() {\n \t\treturn color;\n \t}", "public String getColor() {\r\n return color;\r\n }", "@Override\r\n public Llama.Color getColor() {\r\n return color;\r\n }", "@Override\n public ShapeColor getColor() {\n return new ShapeColor(this.r, this.g, this.b);\n }", "private static Color newColor(int red, int green, int blue) {\n return new Color(red / 255.0, green / 255.0, blue / 255.0);\n }", "public void draw(Graphics2D g_)\n {\n // put your code here\n g_.setColor(col);\n g_.fillRect(rX, rY, x, y);\n }", "public ColorPaletteBuilder color2(Color color)\n {\n if (color2 == null) colorsCount++;\n this.color2 = color;\n return this;\n }", "String getColour();", "public void fillColor() {\n\t\tSystem.out.println(\"Blue color\");\n\t}", "public int getColor() {\n return color;\n }", "public void apply(Graphics2D g2d) {\n g2d.setColor(AWTColor.toAWT(color));\n\n // Text\n String name = g2d.getFont().getFontName();\n int size = g2d.getFont().getSize();\n Font f = new Font(name, Font.PLAIN, (int) (size * annotationFontSizeFactor));\n g2d.setFont(f);\n\n // Stroke\n g2d.setStroke(borderStroke);\n }", "public RMColor getColor()\n {\n return getStyle().getColor();\n }" ]
[ "0.68812126", "0.6579603", "0.63495326", "0.6308641", "0.62098163", "0.6147181", "0.6135254", "0.6115798", "0.6102461", "0.6102228", "0.60735494", "0.6053685", "0.60239726", "0.60046935", "0.6003301", "0.59575266", "0.5936625", "0.5918217", "0.58963734", "0.58926284", "0.5887022", "0.5836358", "0.58293784", "0.5801872", "0.5800787", "0.5770161", "0.5764418", "0.5764418", "0.5761668", "0.57323354", "0.5724083", "0.5718393", "0.57126725", "0.5690663", "0.5686846", "0.5683487", "0.56798875", "0.5679566", "0.5659972", "0.5651198", "0.5646698", "0.56459016", "0.5637482", "0.56370616", "0.56235623", "0.56078947", "0.56044555", "0.5600268", "0.5593951", "0.55891997", "0.55857706", "0.55809706", "0.5561437", "0.5559259", "0.55565053", "0.55392295", "0.553424", "0.5525076", "0.55238175", "0.55238175", "0.5521027", "0.5520137", "0.5513346", "0.5510911", "0.55104107", "0.5503456", "0.5499706", "0.54824597", "0.54747456", "0.54747456", "0.54747456", "0.54747456", "0.54747456", "0.54722226", "0.5470302", "0.5465263", "0.5458407", "0.54568076", "0.5452092", "0.5452092", "0.5449677", "0.5449677", "0.5449677", "0.54444075", "0.5439763", "0.5439738", "0.54393834", "0.54393834", "0.54335016", "0.54283035", "0.54251575", "0.5424451", "0.5419826", "0.5410681", "0.5410593", "0.5401979", "0.5401296", "0.54000086", "0.53989", "0.53953665" ]
0.7307221
0
Apply black color on g2 context
public void black() { g2.setPaint(Color.black); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void modeColor(Graphics2D g2d) { g2d.setColor(RTColorManager.getColor(\"label\", \"default\")); }", "protected void drawBlack(java.awt.Graphics2D g, float a) {\r\n Color oldColor = g.getColor();\r\n g.setColor(Color.BLACK);\r\n g.setComposite(AlphaComposite.SrcOver.derive(a));\r\n g.fillRect(0, 0, GamePanel.WIDTH, GamePanel.HEIGHT);\r\n g.setComposite(AlphaComposite.SrcOver.derive(1.0f));\r\n g.setColor(oldColor);\r\n }", "public void green() {\n g2.setPaint(Color.green);\r\n }", "public void blue() {\n g2.setPaint(Color.blue);\r\n }", "public void red() {\n g2.setPaint(Color.red);\r\n }", "@Override\r\n\tpublic String getColor() {\n\t\treturn \"white\";\r\n\t}", "public void magenta() {\n g2.setPaint(Color.magenta);\r\n }", "public void erase() {\n g2.setPaint(Color.white);\r\n }", "@Override\n\tpublic void setColour(float r, float g, float b) {\n\n\t}", "void fill(int rgb);", "public void draw(Graphics2D g2){\n g2.setColor(color);\n g2.fillOval(x,y, w, w);\n }", "void glClearColor(float red, float green, float blue, float alpha);", "public Color getBlack() {\n return fBlack;\n }", "public void setBlack(RBNode<T> node) {\n if(node != null) {\r\n node.color = BLACK;\r\n }\r\n }", "Color(int R, int G, int B) {\r\n\t\t this.rgb = new RGB(R,G,B);\r\n\t\t this.colorific = true;\r\n\t }", "private Image blackSquare() {\n\t\tWritableImage wImage = new WritableImage(40, 40);\n\t\tPixelWriter writer = wImage.getPixelWriter();\n\t\tfor (int i = 0; i < 30; i++) {\n\t\t\tfor (int j = 0; j < 30; j++) {\n\t\t\t\twriter.setColor(i, j, Color.BLACK);\n\t\t\t}\n\t\t}\n\t\treturn wImage;\n\t}", "@Override\r\n\tpublic void howToColor() {\n\t\t\r\n\t}", "@Override\n\tpublic void changeColor2(Color color) {\n\n\t}", "public Colour() {\n\t\tset(0, 0, 0);\n\t}", "public boolean isBlack () { return (this == PlayColour.BLACK);}", "public void applyColor() {\n\t\tSystem.out.println(\"Yellow\");\n\n\t}", "@Override\n protected Color getflameC ()\n {\n return null;\n }", "public void setBlackAndWhite()\n {\n if(eyeL != null) // only if it's painted already...\n {\n eyeL.changeColor(\"black\");\n eyeR.changeColor(\"black\");\n nose.changeColor(\"black\");\n mouthM.changeColor(\"black\");\n mouthL.changeColor(\"black\");\n mouthR.changeColor(\"black\");\n }\n }", "protected void paint2D (Graphics2D g2) {\n\t AffineTransform tform = AffineTransform.getTranslateInstance( 0, 0);\n\t tform.scale(0.1, 0.1); \n\t //set the properties of g2\n\t g2.setTransform( tform);\n\t g2.setColor( Color.BLUE); \n\t }", "@Override\r\n\tpublic void execute(Graphics2D g) {\r\n\t\tg.setColor(drawColor);\r\n\t}", "public void draw(Graphics2D g2)\n {\n Rectangle2D.Double grass= new Rectangle2D.Double(Xx,Yy,Ww,Hh);\n \n Color greeen = new Color(41,112,24);\n \n g2.setColor(greeen);\n g2.fill(grass);\n \n }", "public void wipe(){\n\t \tg2d.setColor(Color.yellow);\n g2d.fillRect(0,0, width, height);\n\t\t\n\n\t }", "public SVGBuilder setWhiteMode() {\n this.fillColorFilter = new PorterDuffColorFilter(Color.WHITE, PorterDuff.Mode.SRC_IN);\n return this;\n }", "protected ColorUIResource getBlack() { return fBlack; }", "private boolean isBlack(Color color){\r\n return color == Color.black;\r\n }", "public void useStarObjectColor ( ) {\r\n\t\tcolor = null;\r\n\t}", "private native void setModelColor(float r,float g,float b);", "@Override\r\n protected void paintComponent(Graphics g) {\r\n\r\n Graphics2D g2d = (Graphics2D) g;\r\n\r\n g2d.setColor(new Color(52, 73, 94));\r\n g2d.fillRect(0, 0, getWidth(), getHeight());\r\n }", "private HepRepColor() {\n }", "boolean getNoColor();", "protected Green() {\n\n super();\n }", "@Override\n public void draw(GL2 gl) {\n super.fill(gl);\n }", "@Override\n public void draw(GL2 gl) {\n super.fill(gl);\n }", "@Override\n public void setColorFilter(ColorFilter colorFilter) {}", "public boolean isBlack() {\r\n\t\treturn !isRed();\r\n\t}", "public Color getColor()\r\n\t{\r\n\t\treturn _g2.getColor();\r\n\t}", "@Override\n public GralColor setForegroundColor(GralColor color)\n {\n return null;\n }", "void glClear(int mask);", "public void clear(int color);", "@Override\n\t\t\tpublic void setColorFilter(ColorFilter cf) {\n\t\t\t\t\n\t\t\t}", "private final void shade(Object value) throws UninterruptiblePragma {\n if (value != null) {\n while (true) {\n final int gcColor = VmMagic.getObjectColor(value);\n if (gcColor > ObjectFlags.GC_WHITE) {\n // Not white or yellow, we're done\n return;\n }\n if (helper.atomicChangeObjectColor(value, gcColor,\n ObjectFlags.GC_GREY)) {\n // Change to grey, we're done\n changed = true;\n return;\n }\n }\n }\n }", "public CompositeContext createContext(ColorModel paramColorModel1, ColorModel paramColorModel2, RenderingHints paramRenderingHints) {\n/* 70 */ return new SunCompositeContext(this, paramColorModel1, paramColorModel2);\n/* */ }", "public void onSurfaceCreated(GL10 unused, EGLConfig config) {\n GLES20.glClearColor(0.2f, 0.7f, 0.0f, 1.0f);\n }", "public RMColor getColor() { return getFill()==null? RMColor.black : getFill().getColor(); }", "public void resetGc(GC gc, DiagramContext context) {\n\t\tgc.setForeground(getForeground(context));\n\t\tgc.setBackground(getBackground(context));\n\t\tgc.setLineWidth(2); // 0.2 mm\n\t\tgc.setLineStyle(SWT.LINE_SOLID);\n\t\tgc.setAlpha(255);\n\t}", "private boolean isBlack(Node node) {\n Circle temp = (Circle) node;\n return temp.getFill() == Paint.valueOf(\"black\");\n }", "public void fade2black() {\n int var3 = this.field_723 * this.field_724;\n int var2 = 0;\n if(field_759 || var2 < var3) {\n do {\n int var1 = this.pixels[var2] & 16777215;\n this.pixels[var2] = (var1 >>> 1 & 8355711) + (var1 >>> 2 & 4144959) + (var1 >>> 3 & 2039583) + (var1 >>> 4 & 986895);\n ++var2;\n } while(var2 < var3);\n\n }\n }", "private void colorNode(Node root2, Color c) {\r\n pMap.get(root2.getId()).changeColor(\"fillColor\", c, null, null);\r\n }", "private void m76755g() {\n this.f61635e = new Paint();\n this.f61635e.setAntiAlias(true);\n this.f61635e.setColor(this.f61636f);\n this.f61635e.setStyle(Style.FILL);\n this.f61635e.setStrokeWidth(2.0f);\n }", "public Color() {\n\n\t\tthis(0, 0, 0);\n\t}", "public void Color() {\n\t\t\r\n\t}", "private void colorDetermine(PGraphics pg) {\n\t\tif(this.getDepth() < 70){\n\t\t\tpg.fill(255,255,0);\n\t\t}else if(this.getDepth() >= 70 && this.getDepth() < 300){\n\t\t\tpg.fill(0, 0, 255);\n\t\t}else if(this.getDepth() >= 300){\n\t\t\tpg.fill(255, 0, 0);\n\t\t}\n\t}", "@Override\n public void render(Graphics2D g2) {\n g2.setColor(super.getColor());\n g2.fillPolygon(triangleFill);\n }", "public void setBlackAndWhite()\n {\n if (wall != null) // only if it's painted already...\n {\n wall.changeColor(\"black\");\n window.changeColor(\"white\");\n roof.changeColor(\"black\");\n sun.changeColor(\"black\");\n }\n }", "@Override\n\tpublic void setColorFilter(ColorFilter cf) {\n\n\t}", "private void drawBlack() throws IOException, ReversiException {\n playSound(PLAY_SOUND);\n // get the list of stones need to be changed\n String list = fromServer.readUTF();\n // draw black the list of stones\n boardComponent.drawBlack(list);\n\n setScoreText();\n\n // followed by the TURN command\n responseToServer();\n }", "public void paintComponent(Graphics2D g2)\r\n {\r\n g2.setColor(preferredColor());\r\n if (isPhasing)\r\n g2.draw(shape());\r\n else\r\n g2.fill(shape());\r\n }", "public void setColor(int r, int g, int b);", "private void bufferImageGrey()\n {\n int col = 0;\n int[][] heightmap = parent.normaliseMap(parent.getPreviewMap(), 255);\n \n bufferedImage = createImage(heightmap.length, heightmap[0].length);\n Graphics bg = bufferedImage.getGraphics();\n for(int i = 0; i < heightmap.length; i ++) {\n for(int j = 0; j < heightmap[i].length - 1; j++) {\n col = heightmap[i][j];\n if(col > 255)\n col = 255;\n bg.setColor(new Color(col, col, col));\n bg.drawLine(i, j, i, j);\n }\n }\n }", "RGB getNewColor();", "private void drawNone(){\n drawAbstract(R.color.white);\n }", "public void setBlackAndWhite()\n {\n if(wall != null) // only if it's painted already...\n {\n wall.changeColor(\"black\");\n window.changeColor(\"white\");\n roof.changeColor(\"black\");\n sun.changeColor(\"black\");\n }\n }", "public void setBlackAndWhite()\n {\n if(wall != null) // only if it's painted already...\n {\n wall.changeColor(\"black\");\n window.changeColor(\"white\");\n roof.changeColor(\"black\");\n sun.changeColor(\"black\");\n }\n }", "void setNoColor(boolean mono);", "public String getColor() {\n\t\treturn null;\n\t}", "void setColor(){\n this.objectColour = new Color(rValue,gValue,bValue,timeToLive).brighter();\n }", "protected void greyOutCell(int x, int y) {\n\t\tsquares[x][y].setBackground(Color.LIGHT_GRAY);\n\t}", "public abstract View getBlackBackground();", "public Color() {\n\t\tr = 0;\n\t\tg = 0;\n\t\tb = 0;\n\t}", "void setColor(int r, int g, int b);", "public void draw(Graphics2D g_)\n {\n // put your code here\n g_.setColor(col);\n g_.fillRect(rX, rY, x, y);\n }", "public void resetBlockColor() {\n for(int i=0;i<gridWidth; i++) {\n for(int j=0;j<gridHeight;j++) {\n getBlock(i,j).setDarker(false);\n }\n }\n repaint();\n }", "private ColorUtil() {\n // do nothing\n }", "public void draw(Graphics2D g2) {\n\t\tsuper.draw(g2);\n\t\tg2.setColor(Color.LIGHT_GRAY);\n\t\tif(this.getIsActive())\n\t\t\tg2.setColor(Color.BLUE);\n\t\tg2.fill(new Rectangle2D.Double(this.getX()+1,this.getY()+1,this.getDimension()-1,this.getDimension()/2 -1));\n\t\tg2.setColor(Color.BLACK);\n\t\tg2.setFont(new Font(\"SERIF\", Font.TRUETYPE_FONT, 13));\n\t\tg2.drawString(this.getLabel(), this.getX()+2, this.getY()+this.getDimension()/2 -2);\n\t}", "@Override\n public Color getFontColor(){\n return Color.BLACK;\n }", "public static Drawable m94088a(Context context, int i, int i2) {\n Drawable drawable = ContextCompat.getDrawable(context, i);\n drawable.mutate().setColorFilter(ContextCompat.getColor(context, i2), PorterDuff.Mode.SRC_IN);\n drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());\n return drawable;\n }", "public MapColor getMapColor(IBlockState state)\r\n {\r\n return MapColor.BLACK;\r\n }", "private void colorDetermine(PGraphics pg) {\r\n\t\tfloat depth = getDepth();\r\n\t\t\r\n\t\tif (depth < THRESHOLD_INTERMEDIATE) {\r\n\t\t\tpg.fill(255, 255, 0);\r\n\t\t}\r\n\t\telse if (depth < THRESHOLD_DEEP) {\r\n\t\t\tpg.fill(0, 0, 255);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tpg.fill(255, 0, 0);\r\n\t\t}\r\n\t}", "@Override\n public void normalCell() {\n gCell.setFill(Color.BLACK);\n }", "public void changeEvenToBlack()\n {\n for (int i = 0; i < sqList.size(); i += 2)\n {\n sqList.get(i).setColor(\"black\");\n }\n }", "public static void drawPicture2(Graphics2D g2) {\r\n\t// set stroke to be thick for all beds\r\n\tStroke thick = new BasicStroke (4.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL);\r\n g2.setStroke(thick);\r\n\tBunkBed b2 = new BunkBed(100, 300, 50, 80, 20);\r\n\tShape sb2 = ShapeTransforms.scaledCopyOfLL(b2,2,2); \r\n sb2 = ShapeTransforms.translatedCopyOf(sb2,300,0); \r\n\t// set colors, draw different beds, do some more transforms\r\n g2.setColor(Color.RED); \r\n\tg2.draw(sb2); \r\n g2.setColor(Color.CYAN);\r\n g2.draw(b2);\r\n\tg2.setColor(Color.BLACK);\r\n\tsb2 = ShapeTransforms.translatedCopyOf(sb2,400,40);\r\n\tsb2 = ShapeTransforms.rotatedCopyOf(sb2, Math.PI/4.0);\r\n\tg2.draw(sb2);\r\n g2.drawString(\"red white and black bunk beds, by Ian Vernon\", 20,20);\r\n }", "protected boolean isBlack() {\n return this.black;\n }", "public LightBulb(int red, int green,int blue){\r\n _switchedOn=false;\r\n\t\tif ((red < 0)||(red > 255)||(green < 0)||(green > 255)||(blue < 0)\r\n\t\t\t\t||(blue > 255)){\r\n\t\t\t_color = new RGBColor();\r\n\t\t}\r\n\t\telse {\r\n\t\t\t_color = new RGBColor(red, green, blue);\r\n\t\t}\r\n\t\r\n }", "public Paint getBlockColor() {\n return rectangle.getFill();\n }", "@Override\r\n\t\tpublic void setColorFilter(ColorFilter cf)\r\n\t\t{\n\t\t\t\r\n\t\t}", "@Override\n public void init(GLAutoDrawable drawable) {\n \tdrawable.setGL(new DebugGL2(new TraceGL2(drawable.getGL().getGL2(), System.err)));\n\n //OR uncomment this line to just get debugging\n //drawable.setGL(new DebugGL2(drawable.getGL().getGL2()));\n GL2 gl = drawable.getGL().getGL2();\n\n gl.glClearColor(1.0f, 1.0f, 1.0f, 1f); // White Background\n }", "public static void makeBackgroundGray(){\r\n\t\tStdDraw.clear(StdDraw.LIGHT_GRAY);\r\n\t}", "public String blackText(String word) {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tString colorWord = sb.append(ConsoleColour.BLACK).append(word).append(ConsoleColour.RESET).toString();\n\t\treturn colorWord;\n\t}", "private void setDefaultTextColor(Context context) {\n\n }", "private void resetSkyDrawing() {\n\t\tgc = canvas.getGraphicsContext2D();\n\t\tgc.setFill(usercolors[6]);\n\t\tgc.fillRect(0, 0, VIEWING_AREA_WIDTH, VIEWING_AREA_HEIGHT);\n\t\tdrawCircle(VIEWING_AREA_WIDTH / 2, VIEWING_AREA_WIDTH / 2, VIEWING_AREA_HEIGHT / 2, usercolors[4]);\n\t\tdrawCircleOutline(VIEWING_AREA_WIDTH / 2, VIEWING_AREA_HEIGHT / 2 ,VIEWING_AREA_WIDTH / 2, usercolors[5]);\n\t}", "String getColor();", "@Override\n public void fill(GL2 gl) {\n super.draw(gl);\n }", "public PaintBucketTool() {\n color = Color.black;\n registerObservers();\n }", "public void draw(Graphics2D g2)\n\t{\n\t\tEllipse2D.Double oval = new Ellipse2D.Double(x, y, width, height) ;\n\t\tg2.setColor(Color.yellow) ;\n\t\tg2.fill(oval) ;\n\t\tg2.setColor(Color.BLUE);\n\t\tg2.draw(boundingBox);\n\t}", "public void blackScreen() {\n boolean var5 = field_759;\n int var1 = this.field_723 * this.field_724;\n int var2;\n if(this.interlace) {\n var2 = 0;\n int var3 = -this.field_724;\n if(var5 || var3 < 0) {\n do {\n int var4 = -this.field_723;\n if(var5) {\n this.pixels[var2++] = 0;\n ++var4;\n }\n\n while(var4 < 0) {\n this.pixels[var2++] = 0;\n ++var4;\n }\n\n var2 += this.field_723;\n var3 += 2;\n } while(var3 < 0);\n\n }\n } else {\n var2 = 0;\n if(var5 || var2 < var1) {\n do {\n this.pixels[var2] = 0;\n ++var2;\n } while(var2 < var1);\n\n }\n }\n }" ]
[ "0.63252664", "0.6187127", "0.5956271", "0.5889562", "0.5885674", "0.57129645", "0.5697297", "0.5681712", "0.567448", "0.5589116", "0.5583332", "0.55805314", "0.5505618", "0.54628575", "0.54585147", "0.54516804", "0.5447343", "0.5446029", "0.5440782", "0.5439746", "0.539709", "0.53732663", "0.5371453", "0.53680867", "0.5351362", "0.5341024", "0.53305435", "0.53176695", "0.53136086", "0.5303451", "0.5299576", "0.5292069", "0.5288174", "0.52795464", "0.527219", "0.52686286", "0.52591014", "0.52591014", "0.5258707", "0.52554774", "0.5238722", "0.5232868", "0.52310604", "0.52116543", "0.5200138", "0.51978844", "0.5183658", "0.5182059", "0.5177707", "0.5172885", "0.51631534", "0.5160756", "0.5152659", "0.5149064", "0.5147486", "0.5138152", "0.5137306", "0.5132891", "0.51322883", "0.51311773", "0.51284057", "0.51269937", "0.5125393", "0.51205504", "0.5118058", "0.5116663", "0.5111623", "0.5111623", "0.5098223", "0.5090229", "0.50893486", "0.50800014", "0.50759155", "0.50696146", "0.5069395", "0.5068661", "0.5065638", "0.5057965", "0.50547653", "0.50506496", "0.5050561", "0.503595", "0.5035711", "0.5031814", "0.5028178", "0.5027999", "0.5015786", "0.50143117", "0.5011338", "0.500946", "0.5006971", "0.49979025", "0.49962243", "0.49896032", "0.4982585", "0.49808916", "0.49803188", "0.49732268", "0.4967028", "0.49652612" ]
0.7419582
0
Apply magenta color on g2 context
public void magenta() { g2.setPaint(Color.magenta); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void modeColor(Graphics2D g2d) { g2d.setColor(RTColorManager.getColor(\"label\", \"default\")); }", "public void green() {\n g2.setPaint(Color.green);\r\n }", "public void red() {\n g2.setPaint(Color.red);\r\n }", "public void applyColor() {\n\t\tSystem.out.println(\"Yellow\");\n\n\t}", "public void blue() {\n g2.setPaint(Color.blue);\r\n }", "public void black() {\n g2.setPaint(Color.black);\r\n }", "@Override\n\tpublic void setColour(float r, float g, float b) {\n\n\t}", "private native void setModelColor(float r,float g,float b);", "public void apply(Graphics2D g2d) {\n g2d.setColor(AWTColor.toAWT(color));\n\n // Text\n String name = g2d.getFont().getFontName();\n int size = g2d.getFont().getSize();\n Font f = new Font(name, Font.PLAIN, (int) (size * annotationFontSizeFactor));\n g2d.setFont(f);\n\n // Stroke\n g2d.setStroke(borderStroke);\n }", "@Override\n\tpublic void changeColor2(Color color) {\n\n\t}", "public Color getColor()\r\n\t{\r\n\t\treturn _g2.getColor();\r\n\t}", "@Override\r\n\tpublic void execute(Graphics2D g) {\r\n\t\tg.setColor(drawColor);\r\n\t}", "public void setColor(int r, int g, int b);", "void setColor(int r, int g, int b);", "private void setDefaultTextColor(Context context) {\n\n }", "public void draw(Graphics2D g2){\n g2.setColor(color);\n g2.fillOval(x,y, w, w);\n }", "private void colorNode(Node root2, Color c) {\r\n pMap.get(root2.getId()).changeColor(\"fillColor\", c, null, null);\r\n }", "public void setColor(int gnum, Color col);", "public Color4 getEffectColorMul();", "public Color4 getEffectColorAdd();", "@Override\n public Color getNormalColor() { return getLine().getMapColor(); }", "Color(int R, int G, int B) {\r\n\t\t this.rgb = new RGB(R,G,B);\r\n\t\t this.colorific = true;\r\n\t }", "RGB getNewColor();", "@Override\n\tpublic String addcolor() {\n\t\treturn \"Green color is applied\";\n\t}", "void setGreen(int x, int y, int value);", "protected Green() {\n\n super();\n }", "protected void paint2D (Graphics2D g2) {\n\t AffineTransform tform = AffineTransform.getTranslateInstance( 0, 0);\n\t tform.scale(0.1, 0.1); \n\t //set the properties of g2\n\t g2.setTransform( tform);\n\t g2.setColor( Color.BLUE); \n\t }", "@Override\n public String getTokenColorLetter() {\n return \"R\";\n }", "@Override\n\tpublic void yellow() {\n\t\tSystem.out.println(\"Yellow Light\");\n\t\t\n\t}", "@Override\n\tpublic void color() {\n\t\tSystem.out.println(\"Colour is red\");\n\t\t\n\t}", "public Color getCurrentColor();", "@Override\n\tpublic String getColor() {\n\t\treturn \"blue\";\n\t}", "@Override\n public void color(double red, double green, double blue, double alpha) {\n GL11.glColor4d(red, green, blue, alpha);\n }", "@Override\n\tpublic void green() {\n\t\tSystem.out.println(\"Green Light\");\n\t}", "String getColor();", "@Override\r\n\tpublic void howToColor() {\n\t\t\r\n\t}", "RGB getOldColor();", "void setRed(int x, int y, int value);", "public void draw(Graphics2D g2)\n\t{\n\t\tEllipse2D.Double oval = new Ellipse2D.Double(x, y, width, height) ;\n\t\tg2.setColor(Color.yellow) ;\n\t\tg2.fill(oval) ;\n\t\tg2.setColor(Color.BLUE);\n\t\tg2.draw(boundingBox);\n\t}", "@Override\n\tpublic String getColor() {\n\t\treturn \"red\";\n\t}", "public void setColor(float r, float g, float b, float a);", "@Override\r\n\tpublic String getColor() {\n\t\treturn \"white\";\r\n\t}", "void setColor(){\n this.objectColour = new Color(rValue,gValue,bValue,timeToLive).brighter();\n }", "private static Color newColor(int red, int green, int blue) {\n return new Color(red / 255.0, green / 255.0, blue / 255.0);\n }", "@Override\n public GralColor setForegroundColor(GralColor color)\n {\n return null;\n }", "void fill(int rgb);", "public ColorPaletteBuilder color2(Color color)\n {\n if (color2 == null) colorsCount++;\n this.color2 = color;\n return this;\n }", "public void setColor(Graphics2D g){\r\n if(color.equals(\"yellow\") || color.equals(\"Yellow\"))\r\n g.setColor(Color.yellow);\r\n if(color.equals(\"red\") || color.equals(\"Red\"))\r\n g.setColor(Color.red);\r\n if(color.equals(\"blue\") || color.equals(\"Blue\"))\r\n g.setColor(Color.blue);\r\n \r\n }", "private void\tsetColor(GL2 gl, int r, int g, int b, int a)\n\t{\n\t\tgl.glColor4f(r / 255.0f, g / 255.0f, b / 255.0f, a / 255.0f);\n\t}", "public static void setBlue() {\r\n playerTeam.setColor(blue);\r\n updateMessage(\"Seu time agora é azul\");\r\n }", "public void drawSelected(Graphics2D g2) {\n\t\tfloat[] dashes = {1,1,1};\n \tBasicStroke stroke = new BasicStroke(2, BasicStroke.CAP_SQUARE, BasicStroke.CAP_SQUARE, 10, dashes, 10);\n \tg2.setColor(Color.RED);\n\t\tg2.draw(stroke.createStrokedShape(new Rectangle2D.Double(this.getX()-2,this.getY()-2,this.getDimension()+4,this.getDimension()/2 +4)));\n\t}", "public ColorPlus darkenRGB(int value) {\n\t\tint r = this.getRed();\n\t\tint g = this.getGreen();\n\t\tint b = this.getBlue();\n\n\t\tr = (Math.max(r - value, 0));\n\t\tg = (Math.max(g - value, 0));\n\t\tb = (Math.max(b - value, 0));\n\t\treturn new ColorPlus(r,g,b);\n\t}", "public void Color() {\n\t\t\r\n\t}", "public void drawSelectedStyle(Graphics2D g2) {\n final int PADDING = 2;\n final Color selectColor = new Color(100, 100, 100);\n\n final BasicStroke dashed = new BasicStroke(1.0f, BasicStroke.CAP_BUTT,\n BasicStroke.JOIN_MITER, 10.0f, new float[] {2f}, 0.0f);\n\n final Rectangle inRectangle = new Rectangle(bounds.x + PADDING, bounds.y\n + PADDING, bounds.width - 2 * PADDING,\n bounds.height - 2 * PADDING);\n\n final Rectangle outRectangle = new Rectangle(bounds.x - PADDING, bounds.y\n - PADDING, bounds.width + 2 * PADDING,\n bounds.height + 2 * PADDING);\n\n g2.setStroke(dashed);\n g2.setColor(selectColor);\n\n g2.drawRect(inRectangle.x, inRectangle.y, inRectangle.width,\n inRectangle.height);\n g2.drawRect(outRectangle.x, outRectangle.y, outRectangle.width,\n outRectangle.height);\n }", "public LightBulb(RGBColor color){\r\n _color = new RGBColor(color);\r\n }", "private void changeShapeColor(int r, int g, int b)\n\t{\n\t\tthis.red = r;\n\t\tthis.green = g;\n\t\tthis.blue = b;\n\t}", "public abstract BossColor getColor();", "@Override\n Color getColor() {\n return new Color(32, 83, 226, 255);\n }", "private void lineColor() {\n\n\t}", "public abstract void setCurForeground(Color colr);", "@Override\n\tpublic void Red() {\n\t\tSystem.out.println(\"Red Light\");\n\t\t\n\t}", "@Override\n public void excute() {\n drawable.setColor(color);\n }", "@Override \n\tpublic void setNormalColor(){\n\t\tthis.setColor(Color.PINK);\n\t}", "public void fillColor() {\n\t\tSystem.out.println(\"Blue color\");\n\t}", "@Override\n public void setCommunityColor(String strCommunity, String strColor, TimeFrame tf){\n icommunityColors.setCommunityColor(strCommunity, strColor, tf);\n }", "int getHighLightColor();", "void setBlue(int x, int y, int value);", "@Override\n\tpublic void drawmodier(Graphics2D g) {\n\t\tcolor judgeColor = new color();\n\t\tthis.c = judgeColor.colorChoosing((this.color));\n\t\tg.setColor(this.c);\n\t\tsetBasicStroke setbs = new setBasicStroke();\n\t\tthis.b= setbs.chooseBasicStroke(this.basicStroke);\n\t\tg.setStroke(this.b);\n\n\t}", "void glClearColor(float red, float green, float blue, float alpha);", "void seeGreen() {\n\t\tbar.setForeground(Color.GREEN);\n\t}", "public static void setGlobalTextColor(Context context, int color){\n SharedPreferences.Editor edit = context.getSharedPreferences(\"DEFAULTS\", Context.MODE_PRIVATE).edit();\n edit.putInt(\"textColor\", color);\n edit.apply();\n\n ArrayList<Outfit> list = getOutfitList(context);\n if(list.size()>0){\n for(int i = 0 ; i<list.size(); i++){\n list.get(i).setTextColor(color);\n }\n saveOutfitJSON(context, list);\n }\n }", "public static String setColour(Token token) {\n switch(token.getType()) {\n case \"RESERVED\":\n return \"\\t\\t\\t<font color=\\\"#FF00E8\\\" size=\\\"14\\\">\" + token.getValue().toLowerCase() + \"</font>\\n\";\n \n case \"ID\":\n int index = Integer.parseInt(token.getValue()) - 1;\n return \"\\t\\t\\t<font color=\\\"#FFF300\\\" size=\\\"14\\\">\" + symbols.get(index) + \"</font>\\n\";\n\n case \"TERMINAL\":\n return \"\\t\\t\\t<font color=\\\"#0FFF00\\\" size=\\\"14\\\">\" + token.getValue() + \"</font>\\n\";\n\n case \"INTEGER\":\n return \"\\t\\t\\t<font color=\\\"#005DFF\\\" size=\\\"14\\\">\" + token.getValue() + \"</font>\\n\";\n\n case \"DOUBLE\":\n return \"\\t\\t\\t<font color=\\\"#00FFC1\\\" size=\\\"14\\\">\" + token.getValue() + \"</font>\\n\";\n \n case \"COMPARATOR\":\n return \"\\t\\t\\t<font color=\\\"#FF9300\\\" size=\\\"14\\\">\" + token.getValue() + \"</font>\\n\";\n \n case \"ERROR\":\n return \"\\t\\t\\t<font color=\\\"#FF0000\\\" size=\\\"14\\\">\" + token.getValue() + \"</font>\\n\";\n\n case \"SPACE\":\n return \"\\t\\t\\t<font size=\\\"14\\\">&nbsp</font>\\n\";\n\n case \"TAB\":\n return \"\\t\\t\\t<font size=\\\"14\\\">&nbsp&nbsp&nbsp&nbsp</font>\\n\";\n \n case \"NEWLINE\":\n return \"\\t\\t</p>\\n\\t\\t<p>\\n\";\n\n case \"END\":\n return \"\\t\\t\\t<font color=\\\"#FFFFFF\\\" size=\\\"14\\\">\" + token.getValue() + \"</font>\\n\";\n\n }\n\n return \"\";\n }", "public LightBulb(int red, int green,int blue){\r\n _switchedOn=false;\r\n\t\tif ((red < 0)||(red > 255)||(green < 0)||(green > 255)||(blue < 0)\r\n\t\t\t\t||(blue > 255)){\r\n\t\t\t_color = new RGBColor();\r\n\t\t}\r\n\t\telse {\r\n\t\t\t_color = new RGBColor(red, green, blue);\r\n\t\t}\r\n\t\r\n }", "public void setColor(double value) {\r\n\t\tif (value < 0) {\r\n\t\t\tpg.fill(140+(int)(100*(-value)), 0, 0);\r\n\t\t} else {\r\n\t\t\tpg.fill(0, 140+(int)(100*(value)), 0);\r\n\t\t}\r\n\t}", "public void resetGc(GC gc, DiagramContext context) {\n\t\tgc.setForeground(getForeground(context));\n\t\tgc.setBackground(getBackground(context));\n\t\tgc.setLineWidth(2); // 0.2 mm\n\t\tgc.setLineStyle(SWT.LINE_SOLID);\n\t\tgc.setAlpha(255);\n\t}", "public final int getG() {\n\t\treturn green;\n\t}", "public Color getColor() {\n return Color.YELLOW;\n }", "private final void shade(Object value) throws UninterruptiblePragma {\n if (value != null) {\n while (true) {\n final int gcColor = VmMagic.getObjectColor(value);\n if (gcColor > ObjectFlags.GC_WHITE) {\n // Not white or yellow, we're done\n return;\n }\n if (helper.atomicChangeObjectColor(value, gcColor,\n ObjectFlags.GC_GREY)) {\n // Change to grey, we're done\n changed = true;\n return;\n }\n }\n }\n }", "private HepRepColor() {\n }", "void setColor(ChatColor color);", "@Override\n public void redCell() {\n gCell.setFill(Color.ORANGERED);\n }", "private void colorNode(NodeImpl node) {\n nodeColorizer.color(node);\n }", "private void changeColors(){\n \n Color vaccanceColor = vaccance.getValue();\n String vaccRGB = getRGB(vaccanceColor);\n databaseHandler.setTermColor(\"vaccance\", vaccRGB);\n \n Color travailColor = travail.getValue();\n String travailRGB = getRGB(travailColor);\n databaseHandler.setTermColor(\"travail\", travailRGB);\n \n Color AnnivColor = anniverssaire.getValue();\n String summerSemRGB = getRGB(AnnivColor);\n databaseHandler.setTermColor(\"annivessaire\", summerSemRGB);\n \n Color formationColor = formation.getValue();\n String formationRGB = getRGB(formationColor);\n databaseHandler.setTermColor(\"formation\", formationRGB);\n \n Color workshopColor = workshop.getValue();\n String workshopRGB = getRGB(workshopColor);\n databaseHandler.setTermColor(\"workshop\", workshopRGB);\n \n Color certifColor = certif.getValue();\n String certifRGB = getRGB(certifColor);\n databaseHandler.setTermColor(\"certif\", certifRGB);\n \n Color importantColor = important.getValue();\n String importantRGB = getRGB(importantColor);\n databaseHandler.setTermColor(\"important\", importantRGB);\n \n Color urgentColor = urgent.getValue();\n String allHolidayRGB = getRGB(urgentColor);\n databaseHandler.setTermColor(\"urgent\", allHolidayRGB);\n \n \n \n }", "public void draw(Graphics2D g2)\n {\n Rectangle2D.Double grass= new Rectangle2D.Double(Xx,Yy,Ww,Hh);\n \n Color greeen = new Color(41,112,24);\n \n g2.setColor(greeen);\n g2.fill(grass);\n \n }", "public static int color(Context context) {\n\t\tSharedPreferences prefs = PreferenceManager\n\t\t\t\t.getDefaultSharedPreferences(context);\n\t\tint bg = prefs.getInt(\"menu.background\", 0x7c000000);\n\t\tint alpha =\t((bg>>24)&0xFF);\n\t\tint red = \t((bg>>16)&0xFF);\n\t\tint green = ((bg>>8)&0xFF);\n\t\tint blue = \t((bg)&0xFF);\n\t\tdouble lum = ((0.2126*(red)+0.7152*(green)+0.0722*(blue))*((alpha)/255.0))/255.0;\n\t\tif(lum>0.35)\n\t\t\treturn 0xFF000000;//black\n\t\telse return 0xFFFFFFFF;//white\n\t}", "public void changeColor(double d, Color color, Color color2, boolean bl) {\n block2: {\n void difference;\n void dragging;\n if (dragging == false) break block2;\n if (difference == Double.longBitsToDouble(Double.doubleToLongBits(1.2749872908217061E308) ^ 0x7FE6B20E10D32E17L)) {\n void zeroColor;\n this.setting.setValue(new Color(zeroColor.getRed(), zeroColor.getGreen(), zeroColor.getBlue(), this.setting.getValue().getAlpha()));\n } else {\n void color3;\n this.setting.setValue(new Color(color3.getRed(), color3.getGreen(), color3.getBlue(), this.setting.getValue().getAlpha()));\n }\n }\n }", "public int getColor();", "public int getColor();", "@Override\n public void onGenerated(Palette palette) {\n int defaultValue = 0x000000;\n chosenColor = palette.getDarkMutedColor(defaultValue);\n collapsingToolbar.setContentScrimColor(chosenColor);\n\n //changing the status bar color\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n Window window = getWindow();\n window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);\n window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);\n int darkerColorChosen=getDarkerColor(chosenColor, 0.8f);\n window.setStatusBarColor(darkerColorChosen);\n }\n\n }", "public void greenToYellow() {\n\t\tif (StringUtils.isEmpty(this.nextProgram)) {\n\t\t\tthrow new RuntimeException(\n\t\t\t\t\tnew IllegalStateException(\"Method call not allowed as long as nextProgram is not set.\"));\n\t\t}\n\n\t\tString state;\n\t\ttry {\n\t\t\tstate = (String) connection.do_job_get(Trafficlight.getRedYellowGreenState(tls.getId()));\n\t\t} catch (Exception e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t\tString newState = JunctionUtil.getRedYellowGreenState(this.tls.getId(), this.nextProgram, 0);\n\n\t\tif (state.length() != newState.length()) {\n\t\t\tthrow new RuntimeException(\"TlsState \" + state + \" and \" + newState + \" need to have the same length!\");\n\t\t}\n\n\t\tchar[] yellowState = state.toCharArray();\n\t\tfor (int i = 0; i < state.length(); i++) {\n\t\t\tchar cCurrent = state.charAt(i);\n\t\t\tchar cNew = newState.charAt(i);\n\n\t\t\tif (cNew == 'r' && (cCurrent == 'G' || cCurrent == 'g')) {\n\t\t\t\tyellowState[i] = 'y';\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\tconnection.do_job_set(Trafficlight.setRedYellowGreenState(tls.getId(), new String(yellowState)));\n\t\t\tthis.nextProgramScheduledTimestep = ((double) connection.do_job_get(Simulation.getTime()))\n\t\t\t\t\t+ TraasServer.YELLOW_PHASE;\n\t\t} catch (Exception e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\n\t\tregisterMe();\n\t}", "private Color NewColor(int numb) {\r\n\r\n\t\tswitch(numb){\r\n\t\tcase 0: return Color.BLACK;\r\n\t\tcase 1: return Color.RED;\r\n\t\tcase 3: return Color.BLUE;\r\n\t\t}\r\n\t\treturn Color.MAGENTA;\r\n\t}", "public String _setcirclecolor(int _nonvaluecolor,int _innercolor) throws Exception{\n_mcirclenonvaluecolor = _nonvaluecolor;\n //BA.debugLineNum = 61;BA.debugLine=\"mCircleFillColor = InnerColor\";\n_mcirclefillcolor = _innercolor;\n //BA.debugLineNum = 62;BA.debugLine=\"Draw\";\n_draw();\n //BA.debugLineNum = 63;BA.debugLine=\"End Sub\";\nreturn \"\";\n}", "private void green(){\n\t\tthis.arretes_fG();\n\t\tthis.coins_fG();\n\t\tthis.coins_a1G();\n\t\tthis.coins_a2G();\n\t\tthis.aretes_aG();\n\t\tthis.cube[31] = \"G\";\n\t}", "public void saveColor()\r\n\t{\r\n\t\tsavedColor = g.getColor();\r\n\t}", "public void setStrokeColor(Color color);", "public void setColor( GraphColor newVal ) {\n color = newVal;\n }", "public void setColorAccordingToAge() {\n float brightness = (float) Math.max(0f, Math.min(1f, getLifetime() / fullbrightnessLifetime));\n Color color = Color.getHSBColor(.5f, 1f, brightness);\n setColor(color);\n }", "public void paintConnection(Graphics2D g2) {\n Color connClr = Node.NODE_FOREGROUND;\n boolean dashed = false;\n \n \n switch(_error) {\n \n case NONE:\n connClr = _isHighlighted ? Node.NODE_HIGHLIGHT : Node.NODE_FOREGROUND;\n break;\n \n \n case ERROR:\n \n connClr = _isHighlighted ? Node.NODE_ERROR_HL : Node.NODE_ERROR;\n dashed = !_isHighlighted;\n break;\n \n \n case UPSTREAM:\n \n connClr = _isHighlighted ? Node.NODE_WARN_HL : Node.NODE_WARN;\n dashed = !_isHighlighted; \n \n break;\n \n }//endswitch\n \n \n BasicStroke stroke;\n if(dashed) {\n stroke = new BasicStroke(3, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND, 0, new float[]{7,7}, 0);\n \n } else {\n stroke = new BasicStroke(3); \n }\n\n g2.setStroke(stroke);\n g2.setColor(connClr);\n g2.draw(_connCurve);\n \n \n }", "public void init_colors_red(){\t\n\t\tColor c1 = new Color(0,0,0);\t\t// BLACK\t\t\n\t\tColor c2 = new Color(255,0,0);\t// RED\n\t\tColor c3 = new Color(255,170,0);\t// ORANGE\n\t\tColor c4 = new Color(255,255,255);\t// WHITE\n\t\t\n\t\tinit_colors(c1,c2,c3,c4);\n\t}", "@Override\n public Color getColor() {\n return Utils.Pion.BLANC.getCouleur();\n }" ]
[ "0.6363697", "0.60801286", "0.6043691", "0.59464616", "0.5628305", "0.53886735", "0.5386428", "0.53256357", "0.52789235", "0.5265824", "0.52640975", "0.5244921", "0.5230126", "0.51638275", "0.51374227", "0.5130497", "0.5118889", "0.5115823", "0.50974274", "0.5090194", "0.5074629", "0.50625986", "0.5057405", "0.5052267", "0.5043268", "0.50334394", "0.50287044", "0.50220865", "0.50149184", "0.49801794", "0.4965862", "0.49598238", "0.49520373", "0.49446467", "0.49342108", "0.49332216", "0.49323687", "0.492127", "0.4920225", "0.49120808", "0.49088204", "0.4892134", "0.48802465", "0.48737663", "0.4869203", "0.48613253", "0.48497936", "0.48423883", "0.48330393", "0.4826848", "0.481202", "0.48117393", "0.48006192", "0.47879463", "0.47602722", "0.47508562", "0.47496283", "0.4746829", "0.4742948", "0.4741748", "0.47304824", "0.47295776", "0.47293139", "0.4723789", "0.4721422", "0.4711342", "0.46962374", "0.46950364", "0.46939746", "0.46925607", "0.469024", "0.46899793", "0.46898937", "0.4689616", "0.4685501", "0.4682011", "0.46818125", "0.46752313", "0.46748218", "0.46738088", "0.46677837", "0.46656817", "0.46572092", "0.46560735", "0.46538997", "0.46537265", "0.46500555", "0.46500555", "0.46457177", "0.46453243", "0.4644418", "0.46434167", "0.46395367", "0.46382275", "0.4628043", "0.46274596", "0.46241435", "0.46167317", "0.4615563", "0.46139282" ]
0.7374835
0
Apply green color on g2 context
public void green() { g2.setPaint(Color.green); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void red() {\n g2.setPaint(Color.red);\r\n }", "public void modeColor(Graphics2D g2d) { g2d.setColor(RTColorManager.getColor(\"label\", \"default\")); }", "@Override\n\tpublic String addcolor() {\n\t\treturn \"Green color is applied\";\n\t}", "private void green(){\n\t\tthis.arretes_fG();\n\t\tthis.coins_fG();\n\t\tthis.coins_a1G();\n\t\tthis.coins_a2G();\n\t\tthis.aretes_aG();\n\t\tthis.cube[31] = \"G\";\n\t}", "void setGreen(int x, int y, int value);", "void sendToGreen();", "public void setGreen(final int green) {\n\t\tthis.g = green;\n\t}", "@Override\n\tpublic void green() {\n\t\tSystem.out.println(\"Green Light\");\n\t}", "@Override\r\n\tpublic void execute(Graphics2D g) {\r\n\t\tg.setColor(drawColor);\r\n\t}", "void setGreen(int green){\n \n this.green = green;\n }", "public void blue() {\n g2.setPaint(Color.blue);\r\n }", "public Color getColor()\r\n\t{\r\n\t\treturn _g2.getColor();\r\n\t}", "public final int getG() {\n\t\treturn green;\n\t}", "public void greenToYellow() {\n\t\tif (StringUtils.isEmpty(this.nextProgram)) {\n\t\t\tthrow new RuntimeException(\n\t\t\t\t\tnew IllegalStateException(\"Method call not allowed as long as nextProgram is not set.\"));\n\t\t}\n\n\t\tString state;\n\t\ttry {\n\t\t\tstate = (String) connection.do_job_get(Trafficlight.getRedYellowGreenState(tls.getId()));\n\t\t} catch (Exception e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t\tString newState = JunctionUtil.getRedYellowGreenState(this.tls.getId(), this.nextProgram, 0);\n\n\t\tif (state.length() != newState.length()) {\n\t\t\tthrow new RuntimeException(\"TlsState \" + state + \" and \" + newState + \" need to have the same length!\");\n\t\t}\n\n\t\tchar[] yellowState = state.toCharArray();\n\t\tfor (int i = 0; i < state.length(); i++) {\n\t\t\tchar cCurrent = state.charAt(i);\n\t\t\tchar cNew = newState.charAt(i);\n\n\t\t\tif (cNew == 'r' && (cCurrent == 'G' || cCurrent == 'g')) {\n\t\t\t\tyellowState[i] = 'y';\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\tconnection.do_job_set(Trafficlight.setRedYellowGreenState(tls.getId(), new String(yellowState)));\n\t\t\tthis.nextProgramScheduledTimestep = ((double) connection.do_job_get(Simulation.getTime()))\n\t\t\t\t\t+ TraasServer.YELLOW_PHASE;\n\t\t} catch (Exception e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\n\t\tregisterMe();\n\t}", "public float getGreen() {\n return green;\n }", "public void applyColor() {\n\t\tSystem.out.println(\"Yellow\");\n\n\t}", "public boolean isGreen()\n {\n // TODO: replace this line with your code\n }", "public int getGreen()\n\t{\n\t\treturn green;\n\t}", "public void setGreen(boolean green) {\n this.green = green;\n }", "protected Green() {\n\n super();\n }", "public void draw(Graphics2D g2){\n g2.setColor(color);\n g2.fillOval(x,y, w, w);\n }", "@Override\n\tpublic void setColour(float r, float g, float b) {\n\n\t}", "public void setColor(int r, int g, int b);", "int getGreen(int x, int y);", "public void setColor(Graphics2D g){\r\n if(color.equals(\"yellow\") || color.equals(\"Yellow\"))\r\n g.setColor(Color.yellow);\r\n if(color.equals(\"red\") || color.equals(\"Red\"))\r\n g.setColor(Color.red);\r\n if(color.equals(\"blue\") || color.equals(\"Blue\"))\r\n g.setColor(Color.blue);\r\n \r\n }", "Color(int R, int G, int B) {\r\n\t\t this.rgb = new RGB(R,G,B);\r\n\t\t this.colorific = true;\r\n\t }", "void setColor(int r, int g, int b);", "@Override\n public void color(double red, double green, double blue, double alpha) {\n GL11.glColor4d(red, green, blue, alpha);\n }", "String getColor();", "@Override\n\tpublic void changeColor2(Color color) {\n\n\t}", "@Override\n\tpublic String getColor() {\n\t\treturn \"blue\";\n\t}", "private void\tsetColor(GL2 gl, int r, int g, int b, int a)\n\t{\n\t\tgl.glColor4f(r / 255.0f, g / 255.0f, b / 255.0f, a / 255.0f);\n\t}", "public void saveColor()\r\n\t{\r\n\t\tsavedColor = g.getColor();\r\n\t}", "void seeGreen() {\n\t\tbar.setForeground(Color.GREEN);\n\t}", "@Override\r\n\tpublic void howToColor() {\n\t\t\r\n\t}", "public void onClickGreen(View view){\n int col;\n col = 3;\n byte[] colorBytes = {(byte)Color.red(col),\n (byte)Color.green(col),\n (byte)Color.blue(col),\n 0x0A};\n //remove spurious line endings so the serial device doesn't get confused\n for (int i=0; i<colorBytes.length-1; i++){\n if (colorBytes[i] == 0x0A){\n colorBytes[i] = 0x0B;\n }\n }\n //send the color to the serial device\n if (sPort != null){\n try{\n sPort.write(colorBytes, 500);\n }\n catch (IOException e){\n Log.e(TAG, \"couldn't write color bytes to serial device\");\n }\n }\n }", "public boolean isGreen() {\n return green;\n }", "@Override\n\tpublic void paintComponent(java.awt.Graphics g) {\n\t\tsuper.paintComponent(g);\n\t\tg.setColor(java.awt.Color.green);\n\t\tg.fillOval(x, y, 50, 50);\n\t\tg.setColor(java.awt.Color.black);\n\t\tg.drawOval(x, y, 50, 50);\n\t}", "public void draw(Graphics2D g2)\n {\n Rectangle2D.Double grass= new Rectangle2D.Double(Xx,Yy,Ww,Hh);\n \n Color greeen = new Color(41,112,24);\n \n g2.setColor(greeen);\n g2.fill(grass);\n \n }", "int getGreen(){\n\n return this.green;\n }", "public ColouredFeature(IGeometry geom, Color colour) {\n super(geom);\n this.setId(idCounter.getAndIncrement());\n if (colour == null) {\n this.symbolColour = Color.RED;\n } else {\n this.symbolColour = colour;\n }\n }", "public void magenta() {\n g2.setPaint(Color.magenta);\r\n }", "RGB getNewColor();", "public void setColor(int gnum, Color col);", "@Override\n\tpublic String getColor() {\n\t\treturn \"red\";\n\t}", "public abstract BossColor getColor();", "public void write(Appendable out, GxpContext gxpContext) throws IOException {\n out.append(\"#\");\n if (isFourBit(red) && isFourBit(green) && isFourBit(blue)) {\n appendNybble(out, red);\n appendNybble(out, green);\n appendNybble(out, blue);\n } else {\n appendByte(out, red);\n appendByte(out, green);\n appendByte(out, blue);\n }\n }", "public void drawSelected(Graphics2D g2) {\n\t\tfloat[] dashes = {1,1,1};\n \tBasicStroke stroke = new BasicStroke(2, BasicStroke.CAP_SQUARE, BasicStroke.CAP_SQUARE, 10, dashes, 10);\n \tg2.setColor(Color.RED);\n\t\tg2.draw(stroke.createStrokedShape(new Rectangle2D.Double(this.getX()-2,this.getY()-2,this.getDimension()+4,this.getDimension()/2 +4)));\n\t}", "public static int setGreen(int color, int green) {\n return (color & 0xFFFF00FF) | (green << 8);\n }", "private int checkGreenColorProduct() {\r\n if (product == null) {\r\n return -1;\r\n } else {\r\n if (!product.isSafeFood()) {\r\n return Color.RED;\r\n }\r\n if (userHalal && !product.isHalal() || userKashir && !product.isKashir() ||\r\n userVegetarian && !product.isVegetarian() || userVegan && !product.isVegan()) {\r\n return Color.RED;\r\n }\r\n if (userSoy && product.isSoy() || userFish && product.isFish() ||\r\n userEggs && product.isEggs() || userGluten && product.isGluten() ||\r\n userLactose && product.isLactose() || userNuts && product.isNuts()) {\r\n return Color.RED;\r\n }\r\n return Color.GREEN;\r\n }\r\n }", "public void draw(Graphics2D g2)\n {\n Rectangle grassLawn = new Rectangle(xCord,yCord,xLength,yWidth);\n \n g2.setPaint(Color.GREEN);\n g2.fill(grassLawn);\n }", "private native void setModelColor(float r,float g,float b);", "public ColouredFeature(IGeometry geom) {\n super(geom);\n this.setId(idCounter.getAndIncrement());\n this.symbolColour = Color.RED;\n }", "@Override\r\n\tpublic void draw(Graphics g) {\n\t\tg.setColor(Color.green);\r\n\t\tg.fillRect(getX(), getY(), getWidth(), getHeight());\r\n\t}", "@Override\n public void render(Graphics2D g2) {\n g2.setColor(super.getColor());\n g2.fillPolygon(triangleFill);\n }", "static public int getGreen(int color) {\n return (color >> 8) & 0xff;\n }", "protected void paint2D (Graphics2D g2) {\n\t AffineTransform tform = AffineTransform.getTranslateInstance( 0, 0);\n\t tform.scale(0.1, 0.1); \n\t //set the properties of g2\n\t g2.setTransform( tform);\n\t g2.setColor( Color.BLUE); \n\t }", "public void draw(Graphics2D g2)\n\t{\n\t\tEllipse2D.Double oval = new Ellipse2D.Double(x, y, width, height) ;\n\t\tg2.setColor(Color.yellow) ;\n\t\tg2.fill(oval) ;\n\t\tg2.setColor(Color.BLUE);\n\t\tg2.draw(boundingBox);\n\t}", "public void draw(Graphics2D g2) {\n\t\tsuper.draw(g2);\n\t\tg2.setColor(Color.LIGHT_GRAY);\n\t\tif(this.getIsActive())\n\t\t\tg2.setColor(Color.BLUE);\n\t\tg2.fill(new Rectangle2D.Double(this.getX()+1,this.getY()+1,this.getDimension()-1,this.getDimension()/2 -1));\n\t\tg2.setColor(Color.BLACK);\n\t\tg2.setFont(new Font(\"SERIF\", Font.TRUETYPE_FONT, 13));\n\t\tg2.drawString(this.getLabel(), this.getX()+2, this.getY()+this.getDimension()/2 -2);\n\t}", "public int getColor();", "public int getColor();", "String getColour();", "public void Color() {\n\t\t\r\n\t}", "private void colorNode(Node root2, Color c) {\r\n pMap.get(root2.getId()).changeColor(\"fillColor\", c, null, null);\r\n }", "public Color4 getEffectColorAdd();", "public void setColor(float r, float g, float b, float a);", "public int getColorGREEN(WebDriver driver, String xpath, String css, Boolean ifPrint) throws NumberFormatException, IOException {\n\t\tif(ifPrint){ fileWriterPrinter(\"GREEN = \" + getColorRGBarray(driver, xpath, css, false)[1]); }\n\t\treturn getColorRGBarray(driver, xpath, css, false)[1];\n\t}", "public void paintComponent(Graphics g){\n\t\t\tGraphics2D g2d = (Graphics2D) g;\n\t\t\tGradientPaint gradient = new GradientPaint(0, 0, Color.ORANGE, this.getWidth(), this.getHeight(), Color.RED);\n\t\t\tg2d.setPaint(gradient);\n\t\t\tg2d.fillRect(0, 0, this.getWidth(), this.getHeight());\n\t\t\t\n\t\t\tg2d.setColor(Color.green);\n\t\t\tg2d.fillOval(x, y, 40, 40);\n\t\t\n\t\t}", "public void paintComponent(Graphics2D g2)\r\n {\r\n g2.setColor(preferredColor());\r\n if (isPhasing)\r\n g2.draw(shape());\r\n else\r\n g2.fill(shape());\r\n }", "int getColour();", "public CompositeContext createContext(ColorModel paramColorModel1, ColorModel paramColorModel2, RenderingHints paramRenderingHints) {\n/* 70 */ return new SunCompositeContext(this, paramColorModel1, paramColorModel2);\n/* */ }", "public String getColor() { \n return color; \n }", "public void setColor(int red, int green, int blue){\r\n this.red = red;\r\n this.green = green;\r\n this.blue = blue;\r\n }", "private static Color newColor(int red, int green, int blue) {\n return new Color(red / 255.0, green / 255.0, blue / 255.0);\n }", "public void draw(Graphics2D g_)\n {\n // put your code here\n g_.setColor(col);\n g_.fillRect(rX, rY, x, y);\n }", "private final void shade(Object value) throws UninterruptiblePragma {\n if (value != null) {\n while (true) {\n final int gcColor = VmMagic.getObjectColor(value);\n if (gcColor > ObjectFlags.GC_WHITE) {\n // Not white or yellow, we're done\n return;\n }\n if (helper.atomicChangeObjectColor(value, gcColor,\n ObjectFlags.GC_GREY)) {\n // Change to grey, we're done\n changed = true;\n return;\n }\n }\n }\n }", "private void changeShapeColor(int r, int g, int b)\n\t{\n\t\tthis.red = r;\n\t\tthis.green = g;\n\t\tthis.blue = b;\n\t}", "public boolean isGreen(Color c, int GB, int RG){\n\n\t\treturn ( GB > ts.getGreen_GB() && RG > ts.getGreen_RG() && c.getGreen() > ts.getGreen_g());\n\n\n\t}", "@Override\n public String getType() {\n return \"Color change\";\n }", "@Override\r\n\tpublic String getColor() {\n\t\treturn \"white\";\r\n\t}", "@Override\n\tpublic void color() {\n\t\tSystem.out.println(\"Colour is red\");\n\t\t\n\t}", "public void setvColor(float red, float green, float blue)\n {\n GLES20.glUniform4f(uColor, red, green, blue, 1.0f);\n }", "public GlyphColor GetGlythColor(GlyphPos pos)\n {\n GlyphColor color = GlyphColor.NONE;\n // TODO LIST, add logic here to termine the color\n switch(pos) {\n case DOOR_NEAR:\n //TODO: read the hue of the color sensor on the door, and check the value.\n break;\n case DOOR_FAR:\n //TODO: read the hue of the color sensor on the door, and check the value.\n break;\n default:\n break;\n }\n return color;\n }", "@Override\n\tpublic void paintComponent(Graphics g){\n\t\tsuper.paintComponent(g);\n\t\tg.setColor(indicateColor);\n\t\tg.fillOval(0, 0, checkerSize, checkerSize);\t\n\t\t\n\t}", "protected void drawColorFill(java.awt.Graphics2D g, float a, Color c) {\r\n Color oldColor = g.getColor();\r\n g.setColor(c);\r\n g.setComposite(AlphaComposite.SrcOver.derive(a));\r\n g.fillRect(0, 0, GamePanel.WIDTH, GamePanel.HEIGHT);\r\n g.setComposite(AlphaComposite.SrcOver.derive(1.0f));\r\n g.setColor(oldColor);\r\n }", "public static int getGreen(int color) {\n return color & 0x000000FF;\n }", "public void drawSelectedStyle(Graphics2D g2) {\n final int PADDING = 2;\n final Color selectColor = new Color(100, 100, 100);\n\n final BasicStroke dashed = new BasicStroke(1.0f, BasicStroke.CAP_BUTT,\n BasicStroke.JOIN_MITER, 10.0f, new float[] {2f}, 0.0f);\n\n final Rectangle inRectangle = new Rectangle(bounds.x + PADDING, bounds.y\n + PADDING, bounds.width - 2 * PADDING,\n bounds.height - 2 * PADDING);\n\n final Rectangle outRectangle = new Rectangle(bounds.x - PADDING, bounds.y\n - PADDING, bounds.width + 2 * PADDING,\n bounds.height + 2 * PADDING);\n\n g2.setStroke(dashed);\n g2.setColor(selectColor);\n\n g2.drawRect(inRectangle.x, inRectangle.y, inRectangle.width,\n inRectangle.height);\n g2.drawRect(outRectangle.x, outRectangle.y, outRectangle.width,\n outRectangle.height);\n }", "public GameColor getColor();", "@Override\n public void changeColor(ColorEvent ce) {\n \n txtRed.setText(\"\"+ ce.getColor().getRed());\n txtGreen.setText(\"\"+ ce.getColor().getGreen());\n txtBlue.setText(\"\"+ ce.getColor().getBlue());\n \n \n }", "java.awt.Color getColor();", "public String getColor(){\r\n return color;\r\n }", "@Override\n\tpublic void yellow() {\n\t\tSystem.out.println(\"Yellow Light\");\n\t\t\n\t}", "public static int color(Context context) {\n\t\tSharedPreferences prefs = PreferenceManager\n\t\t\t\t.getDefaultSharedPreferences(context);\n\t\tint bg = prefs.getInt(\"menu.background\", 0x7c000000);\n\t\tint alpha =\t((bg>>24)&0xFF);\n\t\tint red = \t((bg>>16)&0xFF);\n\t\tint green = ((bg>>8)&0xFF);\n\t\tint blue = \t((bg)&0xFF);\n\t\tdouble lum = ((0.2126*(red)+0.7152*(green)+0.0722*(blue))*((alpha)/255.0))/255.0;\n\t\tif(lum>0.35)\n\t\t\treturn 0xFF000000;//black\n\t\telse return 0xFFFFFFFF;//white\n\t}", "public void setColour(int redValue, int greenValue, int blueValue) {\n HelpFunctions.checkValue(\"Red pin value\", redValue, 0, 255);\n HelpFunctions.checkValue(\"Green pin value\", greenValue, 0, 255);\n HelpFunctions.checkValue(\"Blue pin value\", blueValue, 0, 255);\n\n this.redValue = redValue;\n this.greenValue = greenValue;\n this.blueValue = blueValue;\n\n update(redValue, greenValue, blueValue);\n }", "public ColouredFeature(IGeometry geom, Color colour, int widthPixels) {\n super(geom);\n this.setId(idCounter.getAndIncrement());\n this.widthPixels = widthPixels;\n // Set colour to red if null\n Color actualColour = colour;\n if (colour == null) {\n actualColour = Color.RED;\n }\n this.symbolColour = actualColour;\n }", "@Override\n\t\tprotected void paintComponent(Graphics g) {\n\t\t\tsuper.paintComponent(g);\n\t\t\tGraphics2D ga = (Graphics2D) g; \n\t\t\tif (currentColor == color) {\n\t\t\t\tShape check = factory.getShape(ShapeFactory.CHECK);\n\t\t\t\tcheck.setPosition(new Point2D.Double(point.getX() + getPreferredSize().width/2 - 7, point.getY()+ 25));\n\t\t\t\tga.setColor(currentColor);\n\t\t\t\tcheck.draw(ga);\n\t\t\t}\n\t\t}", "int getGreen(){\n return getPercentageValue(\"green\");\n }", "public Color getCurrentColor();", "@Override\n\tpublic void paintObject(Graphics g) {\n\t\tg.setColor(this.color);\n\t\tGraphics2D g2d = (Graphics2D) g;\n\t\tg2d.setStroke(new BasicStroke(3));\n\t\tg2d.drawOval(x, y, width, height);\n\t\tg2d.fillOval(x, y, width, height);\n\t}", "@Override\n\tpublic void draw(GraphicsContext gc) {\n\t\tgc.setFill(this.color.getColor());\n\t\tgc.fillRect(MyPoint.point[0], MyPoint.point[1], this.width, this.height);\n\t}" ]
[ "0.63950413", "0.6286947", "0.62732077", "0.62656707", "0.6195492", "0.61367697", "0.61231095", "0.6054799", "0.60418653", "0.6022904", "0.6006533", "0.59694177", "0.5954759", "0.59310323", "0.5912617", "0.5898914", "0.58677214", "0.5858834", "0.58500713", "0.58417237", "0.5781048", "0.57173043", "0.5684477", "0.564847", "0.5640019", "0.5628703", "0.56158406", "0.5615043", "0.5589741", "0.5575968", "0.5571179", "0.5547673", "0.55347437", "0.5531284", "0.5518803", "0.5516987", "0.5490476", "0.54792625", "0.54773885", "0.54561114", "0.54421735", "0.5437078", "0.5430353", "0.54120934", "0.54089427", "0.5390843", "0.5385642", "0.5384844", "0.538411", "0.535716", "0.53468645", "0.5338242", "0.53290355", "0.5327792", "0.5318493", "0.53167963", "0.5313103", "0.5307068", "0.5305446", "0.53030324", "0.53030324", "0.5299149", "0.52942353", "0.528614", "0.5281697", "0.5267055", "0.52646375", "0.525415", "0.52475035", "0.52372843", "0.5236046", "0.52312356", "0.52308756", "0.5227174", "0.52193224", "0.52179426", "0.52093637", "0.5203037", "0.5202173", "0.5184819", "0.5180674", "0.51795447", "0.51775485", "0.51741827", "0.5170891", "0.5169462", "0.5157819", "0.51492894", "0.51482767", "0.5135124", "0.5133748", "0.5133633", "0.5132545", "0.51258034", "0.5125048", "0.5123023", "0.5122844", "0.51189744", "0.5117341", "0.511523" ]
0.75725365
0
Apply blue color on g2 context
public void blue() { g2.setPaint(Color.blue); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void modeColor(Graphics2D g2d) { g2d.setColor(RTColorManager.getColor(\"label\", \"default\")); }", "public void green() {\n g2.setPaint(Color.green);\r\n }", "public void red() {\n g2.setPaint(Color.red);\r\n }", "public void draw(Graphics2D g2){\n g2.setColor(color);\n g2.fillOval(x,y, w, w);\n }", "@Override\n\tpublic String getColor() {\n\t\treturn \"blue\";\n\t}", "public Color getColor()\r\n\t{\r\n\t\treturn _g2.getColor();\r\n\t}", "@Override\n\tpublic void setColour(float r, float g, float b) {\n\n\t}", "void setBlue(int x, int y, int value);", "public static void setBlue() {\r\n playerTeam.setColor(blue);\r\n updateMessage(\"Seu time agora é azul\");\r\n }", "@Override\r\n\tpublic void execute(Graphics2D g) {\r\n\t\tg.setColor(drawColor);\r\n\t}", "public void draw(Graphics2D g2)\n\t{\n\t\tEllipse2D.Double oval = new Ellipse2D.Double(x, y, width, height) ;\n\t\tg2.setColor(Color.yellow) ;\n\t\tg2.fill(oval) ;\n\t\tg2.setColor(Color.BLUE);\n\t\tg2.draw(boundingBox);\n\t}", "public void fillColor() {\n\t\tSystem.out.println(\"Blue color\");\n\t}", "@Override\n\tpublic void changeColor2(Color color) {\n\n\t}", "public void draw(Graphics2D g2) {\n\t\tsuper.draw(g2);\n\t\tg2.setColor(Color.LIGHT_GRAY);\n\t\tif(this.getIsActive())\n\t\t\tg2.setColor(Color.BLUE);\n\t\tg2.fill(new Rectangle2D.Double(this.getX()+1,this.getY()+1,this.getDimension()-1,this.getDimension()/2 -1));\n\t\tg2.setColor(Color.BLACK);\n\t\tg2.setFont(new Font(\"SERIF\", Font.TRUETYPE_FONT, 13));\n\t\tg2.drawString(this.getLabel(), this.getX()+2, this.getY()+this.getDimension()/2 -2);\n\t}", "protected void paint2D (Graphics2D g2) {\n\t AffineTransform tform = AffineTransform.getTranslateInstance( 0, 0);\n\t tform.scale(0.1, 0.1); \n\t //set the properties of g2\n\t g2.setTransform( tform);\n\t g2.setColor( Color.BLUE); \n\t }", "public void black() {\n g2.setPaint(Color.black);\r\n }", "public void setColor(int r, int g, int b);", "Color(int R, int G, int B) {\r\n\t\t this.rgb = new RGB(R,G,B);\r\n\t\t this.colorific = true;\r\n\t }", "public void applyColor() {\n\t\tSystem.out.println(\"Yellow\");\n\n\t}", "@Override\r\n\tpublic void howToColor() {\n\t\t\r\n\t}", "@Override\n public void color(double red, double green, double blue, double alpha) {\n GL11.glColor4d(red, green, blue, alpha);\n }", "public ColorPaletteBuilder color2(Color color)\n {\n if (color2 == null) colorsCount++;\n this.color2 = color;\n return this;\n }", "@Override\n public void render(Graphics2D g2) {\n g2.setColor(super.getColor());\n g2.fillPolygon(triangleFill);\n }", "void setColor(int r, int g, int b);", "public void paintComponent(Graphics2D g2)\r\n {\r\n g2.setColor(preferredColor());\r\n if (isPhasing)\r\n g2.draw(shape());\r\n else\r\n g2.fill(shape());\r\n }", "public static String blue(String text){\n return ANSI_BLUE + text + ANSI_BLUE;\n }", "private void changeShapeColor(int r, int g, int b)\n\t{\n\t\tthis.red = r;\n\t\tthis.green = g;\n\t\tthis.blue = b;\n\t}", "public void draw(Graphics2D g2)\n {\n Rectangle2D.Double grass= new Rectangle2D.Double(Xx,Yy,Ww,Hh);\n \n Color greeen = new Color(41,112,24);\n \n g2.setColor(greeen);\n g2.fill(grass);\n \n }", "public LightBulb(int red, int green,int blue){\r\n _switchedOn=false;\r\n\t\tif ((red < 0)||(red > 255)||(green < 0)||(green > 255)||(blue < 0)\r\n\t\t\t\t||(blue > 255)){\r\n\t\t\t_color = new RGBColor();\r\n\t\t}\r\n\t\telse {\r\n\t\t\t_color = new RGBColor(red, green, blue);\r\n\t\t}\r\n\t\r\n }", "private void colorNode(Node root2, Color c) {\r\n pMap.get(root2.getId()).changeColor(\"fillColor\", c, null, null);\r\n }", "public void apply(Graphics2D g2d) {\n g2d.setColor(AWTColor.toAWT(color));\n\n // Text\n String name = g2d.getFont().getFontName();\n int size = g2d.getFont().getSize();\n Font f = new Font(name, Font.PLAIN, (int) (size * annotationFontSizeFactor));\n g2d.setFont(f);\n\n // Stroke\n g2d.setStroke(borderStroke);\n }", "public void draw(Graphics2D g_)\n {\n // put your code here\n g_.setColor(col);\n g_.fillRect(rX, rY, x, y);\n }", "public void setColor(Graphics2D g){\r\n if(color.equals(\"yellow\") || color.equals(\"Yellow\"))\r\n g.setColor(Color.yellow);\r\n if(color.equals(\"red\") || color.equals(\"Red\"))\r\n g.setColor(Color.red);\r\n if(color.equals(\"blue\") || color.equals(\"Blue\"))\r\n g.setColor(Color.blue);\r\n \r\n }", "public void magenta() {\n g2.setPaint(Color.magenta);\r\n }", "@Override\n public ShapeColor setColor(int r, int g, int b) {\n return new ShapeColor(r, g, b);\n }", "private void blue(){\n\t\tthis.arretes_fB();\n\t\tthis.coins_fB();\n\t\tthis.coins_a1B();\n\t\tthis.coins_a2B();\n\t\tthis.aretes_aB();\n\t\tthis.cube[22] = \"B\";\n\t}", "private void appendColor(StringBuilder sb) {\n if (colorsEnabled) {\n // if color given, use that, else take color from default flag-to-color mapping\n if (colorCode != null) {\n sb.append(colorCode);\n } else {\n sb.append(colorMap.get(flagSymbol));\n }\n }\n }", "public void drawSelected(Graphics2D g2) {\n\t\tfloat[] dashes = {1,1,1};\n \tBasicStroke stroke = new BasicStroke(2, BasicStroke.CAP_SQUARE, BasicStroke.CAP_SQUARE, 10, dashes, 10);\n \tg2.setColor(Color.RED);\n\t\tg2.draw(stroke.createStrokedShape(new Rectangle2D.Double(this.getX()-2,this.getY()-2,this.getDimension()+4,this.getDimension()/2 +4)));\n\t}", "public void bolita2() {\n fill(colores[f]); // Color random seg\\u00fan array anteriormente mencionado.\n noStroke();\n ellipse(y, x, a, b);\n }", "public void Color() {\n\t\t\r\n\t}", "@Override\n\tpublic String addcolor() {\n\t\treturn \"Green color is applied\";\n\t}", "public abstract void setCurForeground(Color colr);", "public ShadesOfBlue(){\n super( Settings.ObjectivesProperties.SHADES_OF_BLUE.getTitle(),\n Settings.ObjectivesProperties.SHADES_OF_BLUE.getDescription(),\n Settings.ObjectivesProperties.SHADES_OF_BLUE.getPath(),\n Settings.ObjectivesProperties.SHADES_OF_BLUE.getPoints(),\n Colour.BLUE);\n }", "@Override\n public Color getColor() {\n return Utils.Pion.BLANC.getCouleur();\n }", "String getColor();", "public Color(double newR, double newG, double newB) {\n\n\t\tr = newR;\n\t\tg = newG;\n\t\tb = newB;\n\t}", "public Color getBlue() {\n return fBlue;\n }", "@Override\n\t\t\tprotected void paintComponent(Graphics g) {\n\t\t\t\tGraphics2D g2d = (Graphics2D) g;\n\t\t g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,\n\t\t RenderingHints.VALUE_ANTIALIAS_ON);\n\t\t \n\t\t GradientPaint gp = new GradientPaint(0, 0,\n\t\t Const.BACKGROUND_COLOR.brighter(), 0, getHeight(),\n\t\t Color.BLUE);\n\t\t \n\t\t g2d.setPaint(gp);\n\t\t g2d.fillRect(0, 0, getWidth(), getHeight());\n\n\t\t\t\tsuper.paintComponent(g);\n\t\t\t}", "private native void setModelColor(float r,float g,float b);", "public Colour(double r, double g, double b) {\n\t\tset(r, g, b);\n\t}", "public void setBlue(boolean blue) {\r\n this.blue = blue;\r\n }", "private void\tsetColor(GL2 gl, int r, int g, int b, int a)\n\t{\n\t\tgl.glColor4f(r / 255.0f, g / 255.0f, b / 255.0f, a / 255.0f);\n\t}", "@Override\n public GralColor setForegroundColor(GralColor color)\n {\n return null;\n }", "protected Green() {\n\n super();\n }", "public TankBlue(){\n this.setTankColor(TANK_COLORS.blue);\n this.initializeSoundsFilesMap();\n }", "@Override\n\tpublic void onBlue() {\n\t\taddSequential(new DriveStraightByDistance(PEG_STRAIGHT - ROBOT_LENGTH / 2), 3.5);\n\t\t//TODO: might need to change to a little less\n\t\taddSequential(new TurnDegrees(90), 2.5);\n\t\taddSequential(new DriveStraightByDistance(EXTRA_DIS), 4);\n\t\taddSequential(new OpenPlacer2());\n\t\taddSequential(new ArcadeDriveByValues(-0.5, -0.5), 1);// TODO change commad\n\t\taddSequential(new ClosePlacer());\n\t\t\n\t}", "void fill(int rgb);", "public void drawSelectedStyle(Graphics2D g2) {\n final int PADDING = 2;\n final Color selectColor = new Color(100, 100, 100);\n\n final BasicStroke dashed = new BasicStroke(1.0f, BasicStroke.CAP_BUTT,\n BasicStroke.JOIN_MITER, 10.0f, new float[] {2f}, 0.0f);\n\n final Rectangle inRectangle = new Rectangle(bounds.x + PADDING, bounds.y\n + PADDING, bounds.width - 2 * PADDING,\n bounds.height - 2 * PADDING);\n\n final Rectangle outRectangle = new Rectangle(bounds.x - PADDING, bounds.y\n - PADDING, bounds.width + 2 * PADDING,\n bounds.height + 2 * PADDING);\n\n g2.setStroke(dashed);\n g2.setColor(selectColor);\n\n g2.drawRect(inRectangle.x, inRectangle.y, inRectangle.width,\n inRectangle.height);\n g2.drawRect(outRectangle.x, outRectangle.y, outRectangle.width,\n outRectangle.height);\n }", "public static void drawPicture2(Graphics2D g2) {\r\n\t// set stroke to be thick for all beds\r\n\tStroke thick = new BasicStroke (4.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL);\r\n g2.setStroke(thick);\r\n\tBunkBed b2 = new BunkBed(100, 300, 50, 80, 20);\r\n\tShape sb2 = ShapeTransforms.scaledCopyOfLL(b2,2,2); \r\n sb2 = ShapeTransforms.translatedCopyOf(sb2,300,0); \r\n\t// set colors, draw different beds, do some more transforms\r\n g2.setColor(Color.RED); \r\n\tg2.draw(sb2); \r\n g2.setColor(Color.CYAN);\r\n g2.draw(b2);\r\n\tg2.setColor(Color.BLACK);\r\n\tsb2 = ShapeTransforms.translatedCopyOf(sb2,400,40);\r\n\tsb2 = ShapeTransforms.rotatedCopyOf(sb2, Math.PI/4.0);\r\n\tg2.draw(sb2);\r\n g2.drawString(\"red white and black bunk beds, by Ian Vernon\", 20,20);\r\n }", "public void setColor(float r, float g, float b, float a);", "public void onClickBlue(View view){\n int col;\n col = 2;\n byte[] colorBytes = {(byte)Color.red(col),\n (byte)Color.green(col),\n (byte)Color.blue(col),\n 0x0A};\n //remove spurious line endings so the serial device doesn't get confused\n for (int i=0; i<colorBytes.length-1; i++){\n if (colorBytes[i] == 0x0A){\n colorBytes[i] = 0x0B;\n }\n }\n //send the color to the serial device\n if (sPort != null){\n try{\n sPort.write(colorBytes, 500);\n }\n catch (IOException e){\n Log.e(TAG, \"couldn't write color bytes to serial device\");\n }\n }\n\n }", "public Color getForeground();", "@Override\n\tpublic String getColor() {\n\t\treturn \"red\";\n\t}", "void setColor(){\n this.objectColour = new Color(rValue,gValue,bValue,timeToLive).brighter();\n }", "public float getBlue() {\n return blue;\n }", "public void fillRect(Color c, Rectangle2D rect2d);", "@Override\r\n protected void paintComponent(Graphics g) {\r\n\r\n Graphics2D g2d = (Graphics2D) g;\r\n\r\n g2d.setColor(new Color(52, 73, 94));\r\n g2d.fillRect(0, 0, getWidth(), getHeight());\r\n }", "public void setFrameBackgroundColor(int i2) {\n this.n.setColor(i2);\n }", "public void chooseColor() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\t\r\n\t}", "@Override\r\n\tpublic void paintComponent(Graphics g)\r\n {\r\n\t\tsuper.paintComponent(g);\r\n\t\tg.setColor(getForeground());\r\n\t\tg.fillOval(0,0, this.getWidth(),this.getHeight());\r\n }", "public void setColor(int red, int green, int blue){\r\n this.red = red;\r\n this.green = green;\r\n this.blue = blue;\r\n }", "public abstract BossColor getColor();", "void setBlue(int blue){\n \n this.blue = blue;\n }", "java.awt.Color getColor();", "public FontRenderer setColor(float r, float g, float b) {\n\t\treturn setColor(new Vector4f(r, g, b, 1));\n\t}", "public CompositeContext createContext(ColorModel paramColorModel1, ColorModel paramColorModel2, RenderingHints paramRenderingHints) {\n/* 70 */ return new SunCompositeContext(this, paramColorModel1, paramColorModel2);\n/* */ }", "public void bindFragColour(GL2 gl2, String name) {\r\n gl2.glBindFragDataLocation(programID, 0, name); \r\n }", "public void setLEDs2(int i, int i2, int r, int g, int b) {\n m_ledBuffer.setRGB(i, r, g, b);\n m_ledBuffer.setRGB(i2, r, g, b);\n m_led.setData(m_ledBuffer);\n }", "public void setBlue(final int blue) {\n\t\tthis.b = blue;\n\t}", "private static Color newColor(int red, int green, int blue) {\n return new Color(red / 255.0, green / 255.0, blue / 255.0);\n }", "@Override\r\n public void draw(Graphics2D g, float x, float y) {\n g.setPaint(new GradientPaint(x, y,\r\n getColor() == Color.BLANCO ? java.awt.Color.CYAN : java.awt.Color.BLACK,\r\n x + 50, y + 50,\r\n java.awt.Color.WHITE));\r\n g.fill(new Ellipse2D.Float(x + 17, y + 15, 16, 16));\r\n g.fill(new Rectangle2D.Float(x + 15, y + 30, 20, 15));\r\n g.setPaint(java.awt.Color.BLACK);\r\n g.draw(new Ellipse2D.Float(x + 17, y + 15, 16, 16));\r\n g.draw(new Rectangle2D.Float(x + 15, y + 30, 20, 15));\r\n }", "void setGreen(int x, int y, int value);", "int getBlue(int x, int y);", "public void changeColor(double d, Color color, Color color2, boolean bl) {\n block2: {\n void difference;\n void dragging;\n if (dragging == false) break block2;\n if (difference == Double.longBitsToDouble(Double.doubleToLongBits(1.2749872908217061E308) ^ 0x7FE6B20E10D32E17L)) {\n void zeroColor;\n this.setting.setValue(new Color(zeroColor.getRed(), zeroColor.getGreen(), zeroColor.getBlue(), this.setting.getValue().getAlpha()));\n } else {\n void color3;\n this.setting.setValue(new Color(color3.getRed(), color3.getGreen(), color3.getBlue(), this.setting.getValue().getAlpha()));\n }\n }\n }", "private void setDefaultTextColor(Context context) {\n\n }", "private void setTeamInfo_Blue2() {\n blueTeamNumber2.setText(fixNumTeam(blueTeamNumber2.getText(), \"Blue 2\"));\n\n blueTeamNumber2.setBackground(Color.WHITE);\n\n FieldAndRobots.getInstance().setTeamNumber(FieldAndRobots.BLUE, FieldAndRobots.TWO,\n Integer.parseInt(blueTeamNumber2.getText()));\n FieldAndRobots.getInstance().actOnRobot(FieldAndRobots.BLUE,\n FieldAndRobots.TWO, FieldAndRobots.SpecialState.ZERO_BATTERY);\n\n if (!Main.isSimpleMode()) {\n PLC_Sender.getInstance().updatePLC_TeamNum(true);\n }\n }", "@Override\n public Color getColor() {\n return color;\n }", "public void paint(Graphics2D g){\n g.setColor(color);\n g.fill(shape);\n }", "public RMColor getColor() { return getFill()==null? RMColor.black : getFill().getColor(); }", "public static int getColor(int r, int g, int b) {\r\n return 0xff000000 | (r << 16) | (g << 8) | b;\r\n }", "@Override\n\tpublic void draw(GraphicsContext gc) {\n\t\tgc.setFill(this.color.getColor());\n\t\tgc.fillRect(MyPoint.point[0], MyPoint.point[1], this.width, this.height);\n\t}", "RGB getNewColor();", "public void render(Graphics2D g2D){\r\n g2D.setColor(colors.bases[colorIdx]);\r\n g2D.fill(polyGon);\r\n if(isActive){\r\n switch(highLight){\r\n case SELECTED:\r\n g2D.setColor(colors.selected);\r\n g2D.fill(polyGon);\r\n g2D.setColor(colors.selectBorder);\r\n g2D.setStroke(new BasicStroke(5));\r\n g2D.draw(polyGon);\r\n break;\r\n case REACHABLE:\r\n g2D.setColor(colors.reachable);\r\n g2D.fill(polyGon);\r\n g2D.setColor(colors.reachBorder);\r\n g2D.setStroke(new BasicStroke(3));\r\n g2D.draw(polyGon);\r\n break;\r\n default:\r\n g2D.setColor(Color.BLACK);\r\n g2D.setStroke(new BasicStroke(2));\r\n g2D.draw(polyGon);\r\n break;\r\n }\r\n if(tacUnit != null){\r\n tacUnit.render(g2D);\r\n } \r\n }else{\r\n g2D.setColor(colors.inactive);\r\n g2D.fill(polyGon);\r\n }\r\n if(showIDs) g2D.drawString((id+\"\"), (float)x, (float)y);\r\n }", "@Override\n\tpublic void drawmodier(Graphics2D g) {\n\t\tcolor judgeColor = new color();\n\t\tthis.c = judgeColor.colorChoosing((this.color));\n\t\tg.setColor(this.c);\n\t\tsetBasicStroke setbs = new setBasicStroke();\n\t\tthis.b= setbs.chooseBasicStroke(this.basicStroke);\n\t\tg.setStroke(this.b);\n\n\t}", "public void draw(Graphics2D g2)\n {\n Rectangle2D.Double land= new Rectangle2D.Double(xleft, ybottom, 10000, 100);\n Color mycolor= new Color(255, 222, 156);\n g2.setColor(mycolor);\n g2.draw(land);\n g2.fill(land);\n g2.draw(land);\n \n }", "public String getColor() { \n return color; \n }", "public Color(int red, int green, int blue) {\n\t\tStringBuilder stringBuilder = new StringBuilder(\"#000000\");\n\t\tString hexString = Integer.toHexString(getHexValue(red, green, blue));\n\t\tcolorCode = stringBuilder.replace(\n\t\t\t\tstringBuilder.length() - hexString.length(), \n\t\t\t\tstringBuilder.length(), \n\t\t\t\thexString).toString();\n\t\tthis.red = red;\n\t\tthis.green = green;\n\t\tthis.blue = blue;\n\t\tthis.alpha = DEFAULT_ALPHA;\n\t}", "public double getTwoColourCost() {\n return 0.16;\n }", "public void draw(Graphics2D g2)\n {\n Rectangle grassLawn = new Rectangle(xCord,yCord,xLength,yWidth);\n \n g2.setPaint(Color.GREEN);\n g2.fill(grassLawn);\n }", "@Override\n\t\tpublic Color color() { return color; }" ]
[ "0.68275887", "0.6677256", "0.6447518", "0.62135935", "0.6134168", "0.6097807", "0.60391927", "0.60094386", "0.5973086", "0.59616536", "0.59293216", "0.5928157", "0.5921205", "0.59153694", "0.5903045", "0.5890458", "0.5853349", "0.5830238", "0.582915", "0.58139664", "0.5784833", "0.578161", "0.57281786", "0.5722929", "0.56951165", "0.56669754", "0.5658357", "0.5646443", "0.56351674", "0.5628253", "0.562322", "0.56051546", "0.5588243", "0.5571622", "0.55370414", "0.5533234", "0.5515284", "0.55029356", "0.5487456", "0.547385", "0.54726565", "0.54695773", "0.54687375", "0.546827", "0.5462064", "0.5449477", "0.5448302", "0.5442698", "0.54367256", "0.54357594", "0.54319936", "0.5429121", "0.5427453", "0.5426407", "0.54226255", "0.5419964", "0.54130346", "0.5412235", "0.54021615", "0.54020476", "0.53972757", "0.53952444", "0.539037", "0.53841376", "0.53673524", "0.536597", "0.535859", "0.5343337", "0.53406024", "0.53402793", "0.5339612", "0.5338306", "0.5336308", "0.5331486", "0.5328793", "0.5327796", "0.5325347", "0.532376", "0.5322846", "0.5320911", "0.531973", "0.5317727", "0.53155726", "0.53123564", "0.5311952", "0.5303232", "0.53024244", "0.52926046", "0.528361", "0.52803665", "0.52602506", "0.5251747", "0.5247201", "0.52417177", "0.52355427", "0.52352196", "0.52264994", "0.5217665", "0.5215952", "0.5210048" ]
0.7484608
0
Apply blue color on g2 context
public void erase() { g2.setPaint(Color.white); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void blue() {\n g2.setPaint(Color.blue);\r\n }", "public void modeColor(Graphics2D g2d) { g2d.setColor(RTColorManager.getColor(\"label\", \"default\")); }", "public void green() {\n g2.setPaint(Color.green);\r\n }", "public void red() {\n g2.setPaint(Color.red);\r\n }", "public void draw(Graphics2D g2){\n g2.setColor(color);\n g2.fillOval(x,y, w, w);\n }", "@Override\n\tpublic String getColor() {\n\t\treturn \"blue\";\n\t}", "public Color getColor()\r\n\t{\r\n\t\treturn _g2.getColor();\r\n\t}", "@Override\n\tpublic void setColour(float r, float g, float b) {\n\n\t}", "void setBlue(int x, int y, int value);", "public static void setBlue() {\r\n playerTeam.setColor(blue);\r\n updateMessage(\"Seu time agora é azul\");\r\n }", "@Override\r\n\tpublic void execute(Graphics2D g) {\r\n\t\tg.setColor(drawColor);\r\n\t}", "public void draw(Graphics2D g2)\n\t{\n\t\tEllipse2D.Double oval = new Ellipse2D.Double(x, y, width, height) ;\n\t\tg2.setColor(Color.yellow) ;\n\t\tg2.fill(oval) ;\n\t\tg2.setColor(Color.BLUE);\n\t\tg2.draw(boundingBox);\n\t}", "public void fillColor() {\n\t\tSystem.out.println(\"Blue color\");\n\t}", "@Override\n\tpublic void changeColor2(Color color) {\n\n\t}", "public void draw(Graphics2D g2) {\n\t\tsuper.draw(g2);\n\t\tg2.setColor(Color.LIGHT_GRAY);\n\t\tif(this.getIsActive())\n\t\t\tg2.setColor(Color.BLUE);\n\t\tg2.fill(new Rectangle2D.Double(this.getX()+1,this.getY()+1,this.getDimension()-1,this.getDimension()/2 -1));\n\t\tg2.setColor(Color.BLACK);\n\t\tg2.setFont(new Font(\"SERIF\", Font.TRUETYPE_FONT, 13));\n\t\tg2.drawString(this.getLabel(), this.getX()+2, this.getY()+this.getDimension()/2 -2);\n\t}", "protected void paint2D (Graphics2D g2) {\n\t AffineTransform tform = AffineTransform.getTranslateInstance( 0, 0);\n\t tform.scale(0.1, 0.1); \n\t //set the properties of g2\n\t g2.setTransform( tform);\n\t g2.setColor( Color.BLUE); \n\t }", "public void black() {\n g2.setPaint(Color.black);\r\n }", "public void setColor(int r, int g, int b);", "Color(int R, int G, int B) {\r\n\t\t this.rgb = new RGB(R,G,B);\r\n\t\t this.colorific = true;\r\n\t }", "public void applyColor() {\n\t\tSystem.out.println(\"Yellow\");\n\n\t}", "@Override\r\n\tpublic void howToColor() {\n\t\t\r\n\t}", "@Override\n public void color(double red, double green, double blue, double alpha) {\n GL11.glColor4d(red, green, blue, alpha);\n }", "public ColorPaletteBuilder color2(Color color)\n {\n if (color2 == null) colorsCount++;\n this.color2 = color;\n return this;\n }", "@Override\n public void render(Graphics2D g2) {\n g2.setColor(super.getColor());\n g2.fillPolygon(triangleFill);\n }", "void setColor(int r, int g, int b);", "public void paintComponent(Graphics2D g2)\r\n {\r\n g2.setColor(preferredColor());\r\n if (isPhasing)\r\n g2.draw(shape());\r\n else\r\n g2.fill(shape());\r\n }", "public static String blue(String text){\n return ANSI_BLUE + text + ANSI_BLUE;\n }", "private void changeShapeColor(int r, int g, int b)\n\t{\n\t\tthis.red = r;\n\t\tthis.green = g;\n\t\tthis.blue = b;\n\t}", "public void draw(Graphics2D g2)\n {\n Rectangle2D.Double grass= new Rectangle2D.Double(Xx,Yy,Ww,Hh);\n \n Color greeen = new Color(41,112,24);\n \n g2.setColor(greeen);\n g2.fill(grass);\n \n }", "public LightBulb(int red, int green,int blue){\r\n _switchedOn=false;\r\n\t\tif ((red < 0)||(red > 255)||(green < 0)||(green > 255)||(blue < 0)\r\n\t\t\t\t||(blue > 255)){\r\n\t\t\t_color = new RGBColor();\r\n\t\t}\r\n\t\telse {\r\n\t\t\t_color = new RGBColor(red, green, blue);\r\n\t\t}\r\n\t\r\n }", "private void colorNode(Node root2, Color c) {\r\n pMap.get(root2.getId()).changeColor(\"fillColor\", c, null, null);\r\n }", "public void apply(Graphics2D g2d) {\n g2d.setColor(AWTColor.toAWT(color));\n\n // Text\n String name = g2d.getFont().getFontName();\n int size = g2d.getFont().getSize();\n Font f = new Font(name, Font.PLAIN, (int) (size * annotationFontSizeFactor));\n g2d.setFont(f);\n\n // Stroke\n g2d.setStroke(borderStroke);\n }", "public void draw(Graphics2D g_)\n {\n // put your code here\n g_.setColor(col);\n g_.fillRect(rX, rY, x, y);\n }", "public void setColor(Graphics2D g){\r\n if(color.equals(\"yellow\") || color.equals(\"Yellow\"))\r\n g.setColor(Color.yellow);\r\n if(color.equals(\"red\") || color.equals(\"Red\"))\r\n g.setColor(Color.red);\r\n if(color.equals(\"blue\") || color.equals(\"Blue\"))\r\n g.setColor(Color.blue);\r\n \r\n }", "public void magenta() {\n g2.setPaint(Color.magenta);\r\n }", "@Override\n public ShapeColor setColor(int r, int g, int b) {\n return new ShapeColor(r, g, b);\n }", "private void blue(){\n\t\tthis.arretes_fB();\n\t\tthis.coins_fB();\n\t\tthis.coins_a1B();\n\t\tthis.coins_a2B();\n\t\tthis.aretes_aB();\n\t\tthis.cube[22] = \"B\";\n\t}", "private void appendColor(StringBuilder sb) {\n if (colorsEnabled) {\n // if color given, use that, else take color from default flag-to-color mapping\n if (colorCode != null) {\n sb.append(colorCode);\n } else {\n sb.append(colorMap.get(flagSymbol));\n }\n }\n }", "public void drawSelected(Graphics2D g2) {\n\t\tfloat[] dashes = {1,1,1};\n \tBasicStroke stroke = new BasicStroke(2, BasicStroke.CAP_SQUARE, BasicStroke.CAP_SQUARE, 10, dashes, 10);\n \tg2.setColor(Color.RED);\n\t\tg2.draw(stroke.createStrokedShape(new Rectangle2D.Double(this.getX()-2,this.getY()-2,this.getDimension()+4,this.getDimension()/2 +4)));\n\t}", "public void bolita2() {\n fill(colores[f]); // Color random seg\\u00fan array anteriormente mencionado.\n noStroke();\n ellipse(y, x, a, b);\n }", "public void Color() {\n\t\t\r\n\t}", "@Override\n\tpublic String addcolor() {\n\t\treturn \"Green color is applied\";\n\t}", "public abstract void setCurForeground(Color colr);", "public ShadesOfBlue(){\n super( Settings.ObjectivesProperties.SHADES_OF_BLUE.getTitle(),\n Settings.ObjectivesProperties.SHADES_OF_BLUE.getDescription(),\n Settings.ObjectivesProperties.SHADES_OF_BLUE.getPath(),\n Settings.ObjectivesProperties.SHADES_OF_BLUE.getPoints(),\n Colour.BLUE);\n }", "@Override\n public Color getColor() {\n return Utils.Pion.BLANC.getCouleur();\n }", "String getColor();", "public Color(double newR, double newG, double newB) {\n\n\t\tr = newR;\n\t\tg = newG;\n\t\tb = newB;\n\t}", "public Color getBlue() {\n return fBlue;\n }", "@Override\n\t\t\tprotected void paintComponent(Graphics g) {\n\t\t\t\tGraphics2D g2d = (Graphics2D) g;\n\t\t g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,\n\t\t RenderingHints.VALUE_ANTIALIAS_ON);\n\t\t \n\t\t GradientPaint gp = new GradientPaint(0, 0,\n\t\t Const.BACKGROUND_COLOR.brighter(), 0, getHeight(),\n\t\t Color.BLUE);\n\t\t \n\t\t g2d.setPaint(gp);\n\t\t g2d.fillRect(0, 0, getWidth(), getHeight());\n\n\t\t\t\tsuper.paintComponent(g);\n\t\t\t}", "private native void setModelColor(float r,float g,float b);", "public Colour(double r, double g, double b) {\n\t\tset(r, g, b);\n\t}", "public void setBlue(boolean blue) {\r\n this.blue = blue;\r\n }", "private void\tsetColor(GL2 gl, int r, int g, int b, int a)\n\t{\n\t\tgl.glColor4f(r / 255.0f, g / 255.0f, b / 255.0f, a / 255.0f);\n\t}", "@Override\n public GralColor setForegroundColor(GralColor color)\n {\n return null;\n }", "protected Green() {\n\n super();\n }", "public TankBlue(){\n this.setTankColor(TANK_COLORS.blue);\n this.initializeSoundsFilesMap();\n }", "@Override\n\tpublic void onBlue() {\n\t\taddSequential(new DriveStraightByDistance(PEG_STRAIGHT - ROBOT_LENGTH / 2), 3.5);\n\t\t//TODO: might need to change to a little less\n\t\taddSequential(new TurnDegrees(90), 2.5);\n\t\taddSequential(new DriveStraightByDistance(EXTRA_DIS), 4);\n\t\taddSequential(new OpenPlacer2());\n\t\taddSequential(new ArcadeDriveByValues(-0.5, -0.5), 1);// TODO change commad\n\t\taddSequential(new ClosePlacer());\n\t\t\n\t}", "void fill(int rgb);", "public void drawSelectedStyle(Graphics2D g2) {\n final int PADDING = 2;\n final Color selectColor = new Color(100, 100, 100);\n\n final BasicStroke dashed = new BasicStroke(1.0f, BasicStroke.CAP_BUTT,\n BasicStroke.JOIN_MITER, 10.0f, new float[] {2f}, 0.0f);\n\n final Rectangle inRectangle = new Rectangle(bounds.x + PADDING, bounds.y\n + PADDING, bounds.width - 2 * PADDING,\n bounds.height - 2 * PADDING);\n\n final Rectangle outRectangle = new Rectangle(bounds.x - PADDING, bounds.y\n - PADDING, bounds.width + 2 * PADDING,\n bounds.height + 2 * PADDING);\n\n g2.setStroke(dashed);\n g2.setColor(selectColor);\n\n g2.drawRect(inRectangle.x, inRectangle.y, inRectangle.width,\n inRectangle.height);\n g2.drawRect(outRectangle.x, outRectangle.y, outRectangle.width,\n outRectangle.height);\n }", "public static void drawPicture2(Graphics2D g2) {\r\n\t// set stroke to be thick for all beds\r\n\tStroke thick = new BasicStroke (4.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL);\r\n g2.setStroke(thick);\r\n\tBunkBed b2 = new BunkBed(100, 300, 50, 80, 20);\r\n\tShape sb2 = ShapeTransforms.scaledCopyOfLL(b2,2,2); \r\n sb2 = ShapeTransforms.translatedCopyOf(sb2,300,0); \r\n\t// set colors, draw different beds, do some more transforms\r\n g2.setColor(Color.RED); \r\n\tg2.draw(sb2); \r\n g2.setColor(Color.CYAN);\r\n g2.draw(b2);\r\n\tg2.setColor(Color.BLACK);\r\n\tsb2 = ShapeTransforms.translatedCopyOf(sb2,400,40);\r\n\tsb2 = ShapeTransforms.rotatedCopyOf(sb2, Math.PI/4.0);\r\n\tg2.draw(sb2);\r\n g2.drawString(\"red white and black bunk beds, by Ian Vernon\", 20,20);\r\n }", "public void setColor(float r, float g, float b, float a);", "public void onClickBlue(View view){\n int col;\n col = 2;\n byte[] colorBytes = {(byte)Color.red(col),\n (byte)Color.green(col),\n (byte)Color.blue(col),\n 0x0A};\n //remove spurious line endings so the serial device doesn't get confused\n for (int i=0; i<colorBytes.length-1; i++){\n if (colorBytes[i] == 0x0A){\n colorBytes[i] = 0x0B;\n }\n }\n //send the color to the serial device\n if (sPort != null){\n try{\n sPort.write(colorBytes, 500);\n }\n catch (IOException e){\n Log.e(TAG, \"couldn't write color bytes to serial device\");\n }\n }\n\n }", "public Color getForeground();", "@Override\n\tpublic String getColor() {\n\t\treturn \"red\";\n\t}", "void setColor(){\n this.objectColour = new Color(rValue,gValue,bValue,timeToLive).brighter();\n }", "public float getBlue() {\n return blue;\n }", "public void fillRect(Color c, Rectangle2D rect2d);", "@Override\r\n protected void paintComponent(Graphics g) {\r\n\r\n Graphics2D g2d = (Graphics2D) g;\r\n\r\n g2d.setColor(new Color(52, 73, 94));\r\n g2d.fillRect(0, 0, getWidth(), getHeight());\r\n }", "public void setFrameBackgroundColor(int i2) {\n this.n.setColor(i2);\n }", "public void chooseColor() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\t\r\n\t}", "@Override\r\n\tpublic void paintComponent(Graphics g)\r\n {\r\n\t\tsuper.paintComponent(g);\r\n\t\tg.setColor(getForeground());\r\n\t\tg.fillOval(0,0, this.getWidth(),this.getHeight());\r\n }", "public void setColor(int red, int green, int blue){\r\n this.red = red;\r\n this.green = green;\r\n this.blue = blue;\r\n }", "public abstract BossColor getColor();", "void setBlue(int blue){\n \n this.blue = blue;\n }", "java.awt.Color getColor();", "public FontRenderer setColor(float r, float g, float b) {\n\t\treturn setColor(new Vector4f(r, g, b, 1));\n\t}", "public CompositeContext createContext(ColorModel paramColorModel1, ColorModel paramColorModel2, RenderingHints paramRenderingHints) {\n/* 70 */ return new SunCompositeContext(this, paramColorModel1, paramColorModel2);\n/* */ }", "public void bindFragColour(GL2 gl2, String name) {\r\n gl2.glBindFragDataLocation(programID, 0, name); \r\n }", "public void setLEDs2(int i, int i2, int r, int g, int b) {\n m_ledBuffer.setRGB(i, r, g, b);\n m_ledBuffer.setRGB(i2, r, g, b);\n m_led.setData(m_ledBuffer);\n }", "public void setBlue(final int blue) {\n\t\tthis.b = blue;\n\t}", "private static Color newColor(int red, int green, int blue) {\n return new Color(red / 255.0, green / 255.0, blue / 255.0);\n }", "@Override\r\n public void draw(Graphics2D g, float x, float y) {\n g.setPaint(new GradientPaint(x, y,\r\n getColor() == Color.BLANCO ? java.awt.Color.CYAN : java.awt.Color.BLACK,\r\n x + 50, y + 50,\r\n java.awt.Color.WHITE));\r\n g.fill(new Ellipse2D.Float(x + 17, y + 15, 16, 16));\r\n g.fill(new Rectangle2D.Float(x + 15, y + 30, 20, 15));\r\n g.setPaint(java.awt.Color.BLACK);\r\n g.draw(new Ellipse2D.Float(x + 17, y + 15, 16, 16));\r\n g.draw(new Rectangle2D.Float(x + 15, y + 30, 20, 15));\r\n }", "void setGreen(int x, int y, int value);", "int getBlue(int x, int y);", "public void changeColor(double d, Color color, Color color2, boolean bl) {\n block2: {\n void difference;\n void dragging;\n if (dragging == false) break block2;\n if (difference == Double.longBitsToDouble(Double.doubleToLongBits(1.2749872908217061E308) ^ 0x7FE6B20E10D32E17L)) {\n void zeroColor;\n this.setting.setValue(new Color(zeroColor.getRed(), zeroColor.getGreen(), zeroColor.getBlue(), this.setting.getValue().getAlpha()));\n } else {\n void color3;\n this.setting.setValue(new Color(color3.getRed(), color3.getGreen(), color3.getBlue(), this.setting.getValue().getAlpha()));\n }\n }\n }", "private void setDefaultTextColor(Context context) {\n\n }", "private void setTeamInfo_Blue2() {\n blueTeamNumber2.setText(fixNumTeam(blueTeamNumber2.getText(), \"Blue 2\"));\n\n blueTeamNumber2.setBackground(Color.WHITE);\n\n FieldAndRobots.getInstance().setTeamNumber(FieldAndRobots.BLUE, FieldAndRobots.TWO,\n Integer.parseInt(blueTeamNumber2.getText()));\n FieldAndRobots.getInstance().actOnRobot(FieldAndRobots.BLUE,\n FieldAndRobots.TWO, FieldAndRobots.SpecialState.ZERO_BATTERY);\n\n if (!Main.isSimpleMode()) {\n PLC_Sender.getInstance().updatePLC_TeamNum(true);\n }\n }", "@Override\n public Color getColor() {\n return color;\n }", "public void paint(Graphics2D g){\n g.setColor(color);\n g.fill(shape);\n }", "public RMColor getColor() { return getFill()==null? RMColor.black : getFill().getColor(); }", "public static int getColor(int r, int g, int b) {\r\n return 0xff000000 | (r << 16) | (g << 8) | b;\r\n }", "@Override\n\tpublic void draw(GraphicsContext gc) {\n\t\tgc.setFill(this.color.getColor());\n\t\tgc.fillRect(MyPoint.point[0], MyPoint.point[1], this.width, this.height);\n\t}", "RGB getNewColor();", "public void render(Graphics2D g2D){\r\n g2D.setColor(colors.bases[colorIdx]);\r\n g2D.fill(polyGon);\r\n if(isActive){\r\n switch(highLight){\r\n case SELECTED:\r\n g2D.setColor(colors.selected);\r\n g2D.fill(polyGon);\r\n g2D.setColor(colors.selectBorder);\r\n g2D.setStroke(new BasicStroke(5));\r\n g2D.draw(polyGon);\r\n break;\r\n case REACHABLE:\r\n g2D.setColor(colors.reachable);\r\n g2D.fill(polyGon);\r\n g2D.setColor(colors.reachBorder);\r\n g2D.setStroke(new BasicStroke(3));\r\n g2D.draw(polyGon);\r\n break;\r\n default:\r\n g2D.setColor(Color.BLACK);\r\n g2D.setStroke(new BasicStroke(2));\r\n g2D.draw(polyGon);\r\n break;\r\n }\r\n if(tacUnit != null){\r\n tacUnit.render(g2D);\r\n } \r\n }else{\r\n g2D.setColor(colors.inactive);\r\n g2D.fill(polyGon);\r\n }\r\n if(showIDs) g2D.drawString((id+\"\"), (float)x, (float)y);\r\n }", "@Override\n\tpublic void drawmodier(Graphics2D g) {\n\t\tcolor judgeColor = new color();\n\t\tthis.c = judgeColor.colorChoosing((this.color));\n\t\tg.setColor(this.c);\n\t\tsetBasicStroke setbs = new setBasicStroke();\n\t\tthis.b= setbs.chooseBasicStroke(this.basicStroke);\n\t\tg.setStroke(this.b);\n\n\t}", "public void draw(Graphics2D g2)\n {\n Rectangle2D.Double land= new Rectangle2D.Double(xleft, ybottom, 10000, 100);\n Color mycolor= new Color(255, 222, 156);\n g2.setColor(mycolor);\n g2.draw(land);\n g2.fill(land);\n g2.draw(land);\n \n }", "public String getColor() { \n return color; \n }", "public Color(int red, int green, int blue) {\n\t\tStringBuilder stringBuilder = new StringBuilder(\"#000000\");\n\t\tString hexString = Integer.toHexString(getHexValue(red, green, blue));\n\t\tcolorCode = stringBuilder.replace(\n\t\t\t\tstringBuilder.length() - hexString.length(), \n\t\t\t\tstringBuilder.length(), \n\t\t\t\thexString).toString();\n\t\tthis.red = red;\n\t\tthis.green = green;\n\t\tthis.blue = blue;\n\t\tthis.alpha = DEFAULT_ALPHA;\n\t}", "public double getTwoColourCost() {\n return 0.16;\n }", "public void draw(Graphics2D g2)\n {\n Rectangle grassLawn = new Rectangle(xCord,yCord,xLength,yWidth);\n \n g2.setPaint(Color.GREEN);\n g2.fill(grassLawn);\n }", "@Override\n\t\tpublic Color color() { return color; }" ]
[ "0.7484608", "0.68275887", "0.6677256", "0.6447518", "0.62135935", "0.6134168", "0.6097807", "0.60391927", "0.60094386", "0.5973086", "0.59616536", "0.59293216", "0.5928157", "0.5921205", "0.59153694", "0.5903045", "0.5890458", "0.5853349", "0.5830238", "0.582915", "0.58139664", "0.5784833", "0.578161", "0.57281786", "0.5722929", "0.56951165", "0.56669754", "0.5658357", "0.5646443", "0.56351674", "0.5628253", "0.562322", "0.56051546", "0.5588243", "0.5571622", "0.55370414", "0.5533234", "0.5515284", "0.55029356", "0.5487456", "0.547385", "0.54726565", "0.54695773", "0.54687375", "0.546827", "0.5462064", "0.5449477", "0.5448302", "0.5442698", "0.54367256", "0.54357594", "0.54319936", "0.5429121", "0.5427453", "0.5426407", "0.54226255", "0.5419964", "0.54130346", "0.5412235", "0.54021615", "0.54020476", "0.53972757", "0.53952444", "0.539037", "0.53841376", "0.53673524", "0.536597", "0.535859", "0.5343337", "0.53406024", "0.53402793", "0.5339612", "0.5338306", "0.5336308", "0.5331486", "0.5328793", "0.5327796", "0.5325347", "0.532376", "0.5322846", "0.5320911", "0.531973", "0.5317727", "0.53155726", "0.53123564", "0.5311952", "0.5303232", "0.53024244", "0.52926046", "0.528361", "0.52803665", "0.52602506", "0.5251747", "0.5247201", "0.52417177", "0.52355427", "0.52352196", "0.52264994", "0.5217665", "0.5215952", "0.5210048" ]
0.0
-1
/ JADX WARNING: Missing block: B:32:0x0049, code skipped: android.util.EventLog.writeEvent(com.android.server.EventLogTags.POWER_SCREEN_BROADCAST_SEND, 1); / JADX WARNING: Missing block: B:33:0x004e, code skipped: if (r1 != 1) goto L_0x0054; / JADX WARNING: Missing block: B:34:0x0050, code skipped: sendWakeUpBroadcast(); / JADX WARNING: Missing block: B:35:0x0054, code skipped: sendGoToSleepBroadcast(); / JADX WARNING: Missing block: B:36:0x0057, code skipped: return; / Code decompiled incorrectly, please refer to instructions dump.
private void sendNextBroadcast() { synchronized (this.mLock) { if (this.mBroadcastedInteractiveState == 0) { this.mPendingWakeUpBroadcast = false; this.mBroadcastedInteractiveState = 1; } else if (this.mBroadcastedInteractiveState == 1) { if (!(this.mPendingWakeUpBroadcast || this.mPendingGoToSleepBroadcast)) { if (this.mPendingInteractiveState != 2) { finishPendingBroadcastLocked(); return; } } this.mPendingGoToSleepBroadcast = false; this.mBroadcastedInteractiveState = 2; } else { if (!(this.mPendingWakeUpBroadcast || this.mPendingGoToSleepBroadcast)) { if (this.mPendingInteractiveState != 1) { finishPendingBroadcastLocked(); return; } } this.mPendingWakeUpBroadcast = false; this.mBroadcastedInteractiveState = 1; } this.mBroadcastStartTime = SystemClock.uptimeMillis(); int powerState = this.mBroadcastedInteractiveState; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void m14696c(com.facebook.appevents.AppEventsLogger.FlushReason r4) {\n /*\n r1 = f14526i;\n monitor-enter(r1);\n r0 = f14524g;\t Catch:{ all -> 0x0048 }\n if (r0 == 0) goto L_0x0009;\n L_0x0007:\n monitor-exit(r1);\t Catch:{ all -> 0x0048 }\n L_0x0008:\n return;\n L_0x0009:\n r0 = 1;\n f14524g = r0;\t Catch:{ all -> 0x0048 }\n r2 = new java.util.HashSet;\t Catch:{ all -> 0x0048 }\n r0 = f14521d;\t Catch:{ all -> 0x0048 }\n r0 = r0.keySet();\t Catch:{ all -> 0x0048 }\n r2.<init>(r0);\t Catch:{ all -> 0x0048 }\n monitor-exit(r1);\t Catch:{ all -> 0x0048 }\n m14700j();\n r0 = 0;\n r0 = m14688a(r4, r2);\t Catch:{ Exception -> 0x004b }\n L_0x0020:\n r1 = f14526i;\n monitor-enter(r1);\n r2 = 0;\n f14524g = r2;\t Catch:{ all -> 0x0054 }\n monitor-exit(r1);\t Catch:{ all -> 0x0054 }\n if (r0 == 0) goto L_0x0008;\n L_0x0029:\n r1 = new android.content.Intent;\n r2 = \"com.facebook.sdk.APP_EVENTS_FLUSHED\";\n r1.<init>(r2);\n r2 = \"com.facebook.sdk.APP_EVENTS_NUM_EVENTS_FLUSHED\";\n r3 = r0.f14508a;\n r1.putExtra(r2, r3);\n r2 = \"com.facebook.sdk.APP_EVENTS_FLUSH_RESULT\";\n r0 = r0.f14509b;\n r1.putExtra(r2, r0);\n r0 = f14525h;\n r0 = android.support.v4.content.LocalBroadcastManager.a(r0);\n r0.a(r1);\n goto L_0x0008;\n L_0x0048:\n r0 = move-exception;\n monitor-exit(r1);\t Catch:{ }\n throw r0;\n L_0x004b:\n r1 = move-exception;\n r2 = f14520a;\n r3 = \"Caught unexpected exception while flushing: \";\n com.facebook.internal.Utility.m25340a(r2, r3, r1);\n goto L_0x0020;\n L_0x0054:\n r0 = move-exception;\n monitor-exit(r1);\t Catch:{ }\n throw r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.facebook.appevents.AppEventsLogger.c(com.facebook.appevents.AppEventsLogger$FlushReason):void\");\n }", "private static synchronized void e(android.content.Context r11) {\n /*\n java.lang.Class<com.tencent.wxop.stat.g> r0 = com.tencent.wxop.stat.g.class\n monitor-enter(r0)\n if (r11 != 0) goto L_0x0007\n monitor-exit(r0)\n return\n L_0x0007:\n com.tencent.wxop.stat.a.f r1 = g // Catch:{ all -> 0x0099 }\n if (r1 != 0) goto L_0x0097\n java.lang.String r1 = com.tencent.wxop.stat.d.h // Catch:{ all -> 0x0099 }\n r2 = 0\n long r4 = com.tencent.wxop.stat.a.r.a((android.content.Context) r11, (java.lang.String) r1, (long) r2) // Catch:{ all -> 0x0099 }\n java.lang.String r1 = \"2.0.4\"\n long r6 = com.tencent.wxop.stat.a.n.b((java.lang.String) r1) // Catch:{ all -> 0x0099 }\n r1 = 1\n r8 = 0\n int r9 = (r6 > r4 ? 1 : (r6 == r4 ? 0 : -1))\n if (r9 > 0) goto L_0x003b\n com.tencent.wxop.stat.a.b r1 = r // Catch:{ all -> 0x0099 }\n java.lang.StringBuilder r9 = new java.lang.StringBuilder // Catch:{ all -> 0x0099 }\n java.lang.String r10 = \"MTA is disable for current version:\"\n r9.<init>(r10) // Catch:{ all -> 0x0099 }\n r9.append(r6) // Catch:{ all -> 0x0099 }\n java.lang.String r6 = \",wakeup version:\"\n r9.append(r6) // Catch:{ all -> 0x0099 }\n r9.append(r4) // Catch:{ all -> 0x0099 }\n java.lang.String r4 = r9.toString() // Catch:{ all -> 0x0099 }\n r1.d(r4) // Catch:{ all -> 0x0099 }\n r1 = 0\n L_0x003b:\n java.lang.String r4 = com.tencent.wxop.stat.d.i // Catch:{ all -> 0x0099 }\n long r2 = com.tencent.wxop.stat.a.r.a((android.content.Context) r11, (java.lang.String) r4, (long) r2) // Catch:{ all -> 0x0099 }\n long r4 = java.lang.System.currentTimeMillis() // Catch:{ all -> 0x0099 }\n int r6 = (r2 > r4 ? 1 : (r2 == r4 ? 0 : -1))\n if (r6 <= 0) goto L_0x0069\n com.tencent.wxop.stat.a.b r1 = r // Catch:{ all -> 0x0099 }\n java.lang.StringBuilder r4 = new java.lang.StringBuilder // Catch:{ all -> 0x0099 }\n java.lang.String r5 = \"MTA is disable for current time:\"\n r4.<init>(r5) // Catch:{ all -> 0x0099 }\n long r5 = java.lang.System.currentTimeMillis() // Catch:{ all -> 0x0099 }\n r4.append(r5) // Catch:{ all -> 0x0099 }\n java.lang.String r5 = \",wakeup time:\"\n r4.append(r5) // Catch:{ all -> 0x0099 }\n r4.append(r2) // Catch:{ all -> 0x0099 }\n java.lang.String r2 = r4.toString() // Catch:{ all -> 0x0099 }\n r1.d(r2) // Catch:{ all -> 0x0099 }\n r1 = 0\n L_0x0069:\n com.tencent.wxop.stat.d.a((boolean) r1) // Catch:{ all -> 0x0099 }\n if (r1 != 0) goto L_0x0070\n monitor-exit(r0)\n return\n L_0x0070:\n android.content.Context r11 = r11.getApplicationContext() // Catch:{ all -> 0x0099 }\n t = r11 // Catch:{ all -> 0x0099 }\n com.tencent.wxop.stat.a.f r1 = new com.tencent.wxop.stat.a.f // Catch:{ all -> 0x0099 }\n r1.<init>() // Catch:{ all -> 0x0099 }\n g = r1 // Catch:{ all -> 0x0099 }\n java.lang.String r1 = com.tencent.wxop.stat.a.n.a((int) r8) // Catch:{ all -> 0x0099 }\n l = r1 // Catch:{ all -> 0x0099 }\n long r1 = java.lang.System.currentTimeMillis() // Catch:{ all -> 0x0099 }\n long r3 = com.tencent.wxop.stat.d.p // Catch:{ all -> 0x0099 }\n r5 = 0\n long r1 = r1 + r3\n f79893b = r1 // Catch:{ all -> 0x0099 }\n com.tencent.wxop.stat.a.f r1 = g // Catch:{ all -> 0x0099 }\n com.tencent.wxop.stat.am r2 = new com.tencent.wxop.stat.am // Catch:{ all -> 0x0099 }\n r2.<init>(r11) // Catch:{ all -> 0x0099 }\n r1.a(r2) // Catch:{ all -> 0x0099 }\n L_0x0097:\n monitor-exit(r0)\n return\n L_0x0099:\n r11 = move-exception\n monitor-exit(r0)\n throw r11\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.tencent.wxop.stat.g.e(android.content.Context):void\");\n }", "public void handleReport(boolean r70) {\n /*\n r69 = this;\n r1 = r69\n r2 = r70\n long r3 = android.os.SystemClock.elapsedRealtime()\n long r5 = r1.mKeyguardDrawn\n r7 = 0\n int r0 = (r5 > r7 ? 1 : (r5 == r7 ? 0 : -1))\n if (r0 <= 0) goto L_0x0011\n goto L_0x0012\n L_0x0011:\n r5 = r3\n L_0x0012:\n r1.mKeyguardDrawn = r5\n long r5 = r1.mKeyguardDrawn\n long r9 = r1.mBlockScreenOnBegin\n long r5 = r5 - r9\n java.lang.String r9 = r69.getScreenOnDetail()\n java.lang.StringBuilder r0 = new java.lang.StringBuilder\n r0.<init>()\n r0.append(r9)\n java.lang.String r10 = \" block2keyDrawn=\"\n r0.append(r10)\n r0.append(r5)\n java.lang.String r10 = \" hasOn:\"\n r0.append(r10)\n r0.append(r2)\n java.lang.String r0 = r0.toString()\n java.lang.String r10 = \"ScreenOnMonitor\"\n android.util.Slog.i(r10, r0)\n java.lang.String r0 = r1.mTimeoutSummary\n if (r0 == 0) goto L_0x007e\n long r11 = r1.mLastReportTime\n int r0 = (r11 > r7 ? 1 : (r11 == r7 ? 0 : -1))\n if (r0 == 0) goto L_0x0051\n long r11 = r3 - r11\n r13 = 14400000(0xdbba00, double:7.1145453E-317)\n int r0 = (r11 > r13 ? 1 : (r11 == r13 ? 0 : -1))\n if (r0 <= 0) goto L_0x007b\n L_0x0051:\n r1.mLastReportTime = r3\n miui.mqsas.sdk.event.ScreenOnEvent r0 = new miui.mqsas.sdk.event.ScreenOnEvent\n r0.<init>()\n java.lang.String r11 = r1.mTimeoutSummary\n r0.setTimeoutSummary(r11)\n r0.setmTimeOutDetail(r9)\n java.lang.String r11 = r1.mWakeSource\n r0.setWakeSource(r11)\n long r11 = r1.mTimeStamp\n java.lang.String r11 = r1.toCalendarTime(r11)\n r0.setTimeStamp(r11)\n java.lang.String r11 = \"lt_screen_on\"\n r0.setScreenOnType(r11)\n miui.mqsas.sdk.MQSEventManagerDelegate r11 = miui.mqsas.sdk.MQSEventManagerDelegate.getInstance()\n r11.reportScreenOnEvent(r0)\n L_0x007b:\n r0 = 0\n r1.mTimeoutSummary = r0\n L_0x007e:\n if (r2 == 0) goto L_0x053a\n long r11 = r1.mStopTime\n long r13 = r1.mStartTime\n long r11 = r11 - r13\n r13 = 1000(0x3e8, double:4.94E-321)\n int r0 = (r11 > r13 ? 1 : (r11 == r13 ? 0 : -1))\n if (r0 >= 0) goto L_0x053a\n java.lang.String r0 = android.os.Build.VERSION.INCREMENTAL\n java.lang.String r11 = r1.mUploadVersion\n boolean r0 = r0.equals(r11)\n if (r0 != 0) goto L_0x0532\n long r11 = r1.mStopTime\n long r13 = r1.mStartTime\n long r11 = r11 - r13\n long r13 = r1.mSetDisplayStateEnd\n long r7 = r1.mSetDisplayStateBegin\n long r13 = r13 - r7\n long r7 = r1.mBlockScreenOnEnd\n r19 = r3\n long r2 = r1.mBlockScreenOnBegin\n long r7 = r7 - r2\n boolean[] r0 = r1.mNeedRecord\n r2 = 0\n boolean r0 = r0[r2]\n if (r0 == 0) goto L_0x00ca\n int[] r0 = r1.mAvgCount\n r3 = r0[r2]\n int r3 = r3 + 1\n r0[r2] = r3\n long[] r0 = r1.mTotalScreenOnTime\n r3 = r0[r2]\n long r3 = r3 + r11\n r0[r2] = r3\n long[] r0 = r1.mTotalSetDisplayTime\n r3 = r0[r2]\n long r3 = r3 + r13\n r0[r2] = r3\n long[] r0 = r1.mTotalBlockScreenOnTime\n r3 = r0[r2]\n long r3 = r3 + r7\n r0[r2] = r3\n L_0x00ca:\n int[] r0 = r1.mAvgCount\n r0 = r0[r2]\n long r3 = (long) r0\n r21 = 50\n int r0 = (r3 > r21 ? 1 : (r3 == r21 ? 0 : -1))\n java.lang.String r4 = \",\"\n if (r0 != 0) goto L_0x0155\n miui.mqsas.sdk.event.ScreenOnEvent r0 = new miui.mqsas.sdk.event.ScreenOnEvent\n r0.<init>()\n long[] r15 = r1.mTotalScreenOnTime\n r15 = r15[r2]\n int[] r3 = r1.mAvgCount\n r3 = r3[r2]\n long r2 = (long) r3\n long r2 = r15 / r2\n r0.setTotalTime(r2)\n long[] r2 = r1.mTotalSetDisplayTime\n r3 = 0\n r15 = r2[r3]\n int[] r2 = r1.mAvgCount\n r2 = r2[r3]\n r25 = r4\n long r3 = (long) r2\n long r2 = r15 / r3\n r0.setSetDisplayTime(r2)\n long[] r2 = r1.mTotalBlockScreenOnTime\n r3 = 0\n r15 = r2[r3]\n int[] r2 = r1.mAvgCount\n r2 = r2[r3]\n long r2 = (long) r2\n long r2 = r15 / r2\n r0.setBlockScreenTime(r2)\n java.lang.String r2 = \"avg_screen_on\"\n r0.setScreenOnType(r2)\n miui.mqsas.sdk.MQSEventManagerDelegate r2 = miui.mqsas.sdk.MQSEventManagerDelegate.getInstance()\n r2.reportScreenOnEvent(r0)\n long[] r2 = r1.mTotalScreenOnTime\n r3 = 0\n r15 = 0\n r2[r3] = r15\n long[] r2 = r1.mTotalSetDisplayTime\n r2[r3] = r15\n long[] r2 = r1.mTotalBlockScreenOnTime\n r2[r3] = r15\n int[] r2 = r1.mAvgCount\n r2[r3] = r3\n boolean[] r2 = r1.mNeedRecord\n r2[r3] = r3\n java.lang.StringBuilder r2 = r1.mTypeNeedRecordSb\n r4 = 49\n r2.setCharAt(r3, r4)\n java.lang.String r2 = PROPERTY_SCREEN_ON_UPLOAD\n java.lang.StringBuilder r3 = new java.lang.StringBuilder\n r3.<init>()\n java.lang.StringBuilder r4 = r1.mTypeNeedRecordSb\n java.lang.String r4 = r4.toString()\n r3.append(r4)\n r4 = r25\n r3.append(r4)\n java.lang.String r15 = r1.mUploadVersion\n r3.append(r15)\n java.lang.String r3 = r3.toString()\n android.os.SystemProperties.set(r2, r3)\n L_0x0155:\n java.lang.String r0 = r1.mWakeSource\n int r2 = r1.getWakeupSrcIndex(r0)\n r0 = 4\n if (r2 != r0) goto L_0x043e\n r15 = r11\n long r11 = r1.mFingerSuccess\n r17 = 0\n int r0 = (r11 > r17 ? 1 : (r11 == r17 ? 0 : -1))\n if (r0 == 0) goto L_0x042e\n r25 = r11\n long r11 = r1.mFingerDown\n int r0 = (r11 > r17 ? 1 : (r11 == r17 ? 0 : -1))\n if (r0 <= 0) goto L_0x0170\n goto L_0x0172\n L_0x0170:\n r11 = r25\n L_0x0172:\n r1.mFingerDown = r11\n long r11 = r1.mKeyGoingAway\n int r0 = (r11 > r17 ? 1 : (r11 == r17 ? 0 : -1))\n if (r0 <= 0) goto L_0x017b\n goto L_0x017d\n L_0x017b:\n r11 = r19\n L_0x017d:\n r1.mKeyGoingAway = r11\n long r11 = r1.mKeyExitAnim\n int r0 = (r11 > r17 ? 1 : (r11 == r17 ? 0 : -1))\n if (r0 <= 0) goto L_0x0186\n goto L_0x0188\n L_0x0186:\n r11 = r19\n L_0x0188:\n r1.mKeyExitAnim = r11\n long r11 = r1.mFingerSuccess\n r25 = r2\n long r2 = r1.mFingerDown\n r26 = r5\n long r5 = r11 - r2\n r28 = r9\n r0 = r10\n long r9 = r1.mStartTime\n long r11 = r9 - r11\n r29 = r13\n long r13 = r1.mBlockScreenOnBegin\n long r13 = r13 - r9\n r31 = r7\n long r7 = r1.mStopTime\n long r7 = r7 - r2\n long r2 = r1.mKeyGoingAway\n r33 = r7\n long r7 = r2 - r9\n r35 = r7\n long r7 = r1.mKeyExitAnim\n r37 = r13\n long r13 = r7 - r2\n r39 = r13\n long r13 = r1.mKeyguardDrawn\n r41 = r11\n long r11 = r13 - r7\n r43 = r11\n long r11 = r1.mBlockScreenOnEnd\n long r13 = r11 - r13\n r45 = r13\n long r13 = r1.mSetDisplayStateBegin\n long r13 = r13 - r9\n long r9 = r1.mSetDisplayStateEnd\n r47 = r13\n long r13 = r7 - r9\n long r11 = r11 - r7\n long r7 = r9 - r2\n java.lang.StringBuilder r2 = new java.lang.StringBuilder\n r2.<init>()\n java.lang.String r3 = \"fingerDown2suc2wake=\"\n r2.append(r3)\n r2.append(r5)\n r2.append(r4)\n r9 = r41\n r2.append(r9)\n java.lang.String r3 = \"; wake2block2un=\"\n r2.append(r3)\n r9 = r37\n r2.append(r9)\n r2.append(r4)\n r9 = r31\n r2.append(r9)\n java.lang.String r3 = \"; wake2away2exit2drawn2un=\"\n r2.append(r3)\n r9 = r35\n r2.append(r9)\n r2.append(r4)\n r9 = r39\n r2.append(r9)\n r2.append(r4)\n r9 = r43\n r2.append(r9)\n r2.append(r4)\n r9 = r45\n r2.append(r9)\n java.lang.String r3 = \"; wake2disp2on2exit2un=\"\n r2.append(r3)\n r9 = r47\n r2.append(r9)\n r2.append(r4)\n r9 = r29\n r2.append(r9)\n r2.append(r4)\n r2.append(r13)\n r2.append(r4)\n r2.append(r11)\n java.lang.String r3 = \"; away2on:\"\n r2.append(r3)\n r2.append(r7)\n java.lang.String r3 = \" all=\"\n r2.append(r3)\n r29 = r11\n r11 = r33\n r2.append(r11)\n java.lang.String r2 = r2.toString()\n android.util.Slog.d(r0, r2)\n r17 = 0\n int r0 = (r5 > r17 ? 1 : (r5 == r17 ? 0 : -1))\n if (r0 <= 0) goto L_0x025a\n r23 = r5\n goto L_0x025c\n L_0x025a:\n r23 = 1000(0x3e8, double:4.94E-321)\n L_0x025c:\n r2 = r23\n int r0 = (r7 > r17 ? 1 : (r7 == r17 ? 0 : -1))\n if (r0 <= 0) goto L_0x0264\n r5 = r7\n goto L_0x0266\n L_0x0264:\n r5 = r17\n L_0x0266:\n int r0 = (r41 > r17 ? 1 : (r41 == r17 ? 0 : -1))\n if (r0 <= 0) goto L_0x02ba\n int r0 = (r31 > r17 ? 1 : (r31 == r17 ? 0 : -1))\n if (r0 <= 0) goto L_0x02ba\n int r0 = (r35 > r17 ? 1 : (r35 == r17 ? 0 : -1))\n if (r0 <= 0) goto L_0x02ba\n int r0 = (r39 > r17 ? 1 : (r39 == r17 ? 0 : -1))\n if (r0 <= 0) goto L_0x02ba\n int r0 = r1.mTotalFingerAvgCount\n int r0 = r0 + 1\n r1.mTotalFingerAvgCount = r0\n long r7 = r1.mTotalFingerDown2SuccessTime\n long r7 = r7 + r2\n r1.mTotalFingerDown2SuccessTime = r7\n long r7 = r1.mTotalFingerSuccess2WakeTime\n long r7 = r7 + r41\n r1.mTotalFingerSuccess2WakeTime = r7\n long r7 = r1.mTotalFingerWake2BlockTime\n long r7 = r7 + r37\n r1.mTotalFingerWake2BlockTime = r7\n long r7 = r1.mTotalFingerBlockScreenOnTime\n long r7 = r7 + r31\n r1.mTotalFingerBlockScreenOnTime = r7\n long r7 = r1.mTotalFingerDisplayOnTime\n long r7 = r7 + r9\n r1.mTotalFingerDisplayOnTime = r7\n long r7 = r1.mTotalFingerAllTime\n long r7 = r7 + r11\n r1.mTotalFingerAllTime = r7\n long r7 = r1.mTotalFingerBlock2KeyDrawn\n long r7 = r7 + r26\n r1.mTotalFingerBlock2KeyDrawn = r7\n long r7 = r1.mTotalFingerWake2Away\n long r7 = r7 + r35\n r1.mTotalFingerWake2Away = r7\n long r7 = r1.mTotalFingerAway2Exit\n long r7 = r7 + r39\n r1.mTotalFingerAway2Exit = r7\n long r7 = r1.mTotalFingerExit2Draw\n long r7 = r7 + r43\n r1.mTotalFingerExit2Draw = r7\n long r7 = r1.mTotalFingerAway2On\n long r7 = r7 + r5\n r1.mTotalFingerAway2On = r7\n L_0x02ba:\n int r0 = r1.mTotalFingerAvgCount\n long r7 = (long) r0\n int r0 = (r7 > r21 ? 1 : (r7 == r21 ? 0 : -1))\n if (r0 != 0) goto L_0x041e\n org.json.JSONObject r0 = new org.json.JSONObject\n r0.<init>()\n r7 = r0\n r23 = r2\n long r2 = r1.mTotalFingerDown2SuccessTime // Catch:{ JSONException -> 0x040c }\n int r0 = r1.mTotalFingerAvgCount // Catch:{ JSONException -> 0x040c }\n r33 = r5\n long r5 = (long) r0\n long r2 = r2 / r5\n long r5 = r1.mTotalFingerSuccess2WakeTime // Catch:{ JSONException -> 0x03ff }\n int r0 = r1.mTotalFingerAvgCount // Catch:{ JSONException -> 0x03ff }\n r49 = r11\n long r11 = (long) r0\n long r5 = r5 / r11\n long r11 = r1.mTotalFingerWake2BlockTime // Catch:{ JSONException -> 0x03f4 }\n int r0 = r1.mTotalFingerAvgCount // Catch:{ JSONException -> 0x03f4 }\n r51 = r13\n long r13 = (long) r0\n long r11 = r11 / r13\n long r13 = r1.mTotalFingerBlockScreenOnTime // Catch:{ JSONException -> 0x03eb }\n int r0 = r1.mTotalFingerAvgCount // Catch:{ JSONException -> 0x03eb }\n r53 = r9\n long r8 = (long) r0\n long r13 = r13 / r8\n r8 = r13\n long r13 = r1.mTotalFingerDisplayOnTime // Catch:{ JSONException -> 0x03e4 }\n int r0 = r1.mTotalFingerAvgCount // Catch:{ JSONException -> 0x03e4 }\n r55 = r8\n long r8 = (long) r0 // Catch:{ JSONException -> 0x03e4 }\n long r13 = r13 / r8\n r8 = r13\n long r13 = r1.mTotalFingerAllTime // Catch:{ JSONException -> 0x03e4 }\n int r0 = r1.mTotalFingerAvgCount // Catch:{ JSONException -> 0x03e4 }\n r57 = r8\n long r8 = (long) r0 // Catch:{ JSONException -> 0x03e4 }\n long r13 = r13 / r8\n r8 = r13\n long r13 = r1.mTotalFingerBlock2KeyDrawn // Catch:{ JSONException -> 0x03e4 }\n int r0 = r1.mTotalFingerAvgCount // Catch:{ JSONException -> 0x03e4 }\n r59 = r8\n long r8 = (long) r0 // Catch:{ JSONException -> 0x03e4 }\n long r13 = r13 / r8\n r8 = r13\n long r13 = r1.mTotalFingerWake2Away // Catch:{ JSONException -> 0x03e4 }\n int r0 = r1.mTotalFingerAvgCount // Catch:{ JSONException -> 0x03e4 }\n r61 = r8\n long r8 = (long) r0 // Catch:{ JSONException -> 0x03e4 }\n long r13 = r13 / r8\n r8 = r13\n long r13 = r1.mTotalFingerAway2Exit // Catch:{ JSONException -> 0x03e4 }\n int r0 = r1.mTotalFingerAvgCount // Catch:{ JSONException -> 0x03e4 }\n r63 = r11\n long r10 = (long) r0 // Catch:{ JSONException -> 0x03e4 }\n long r13 = r13 / r10\n r10 = r13\n long r12 = r1.mTotalFingerExit2Draw // Catch:{ JSONException -> 0x03e4 }\n int r0 = r1.mTotalFingerAvgCount // Catch:{ JSONException -> 0x03e4 }\n r65 = r15\n long r14 = (long) r0\n long r12 = r12 / r14\n long r14 = r1.mTotalFingerAway2On // Catch:{ JSONException -> 0x03df }\n int r0 = r1.mTotalFingerAvgCount // Catch:{ JSONException -> 0x03df }\n long r0 = (long) r0\n long r14 = r14 / r0\n r0 = r14\n java.lang.String r14 = \"authenticatedTime\"\n java.lang.StringBuilder r15 = new java.lang.StringBuilder // Catch:{ JSONException -> 0x03d9 }\n r15.<init>() // Catch:{ JSONException -> 0x03d9 }\n r16 = r4\n java.lang.String r4 = \"##w2a:\"\n r15.append(r4) // Catch:{ JSONException -> 0x03d7 }\n r15.append(r8) // Catch:{ JSONException -> 0x03d7 }\n java.lang.String r4 = \"##a2e:\"\n r15.append(r4) // Catch:{ JSONException -> 0x03d7 }\n r15.append(r10) // Catch:{ JSONException -> 0x03d7 }\n java.lang.String r4 = \"##e2d\"\n r15.append(r4) // Catch:{ JSONException -> 0x03d7 }\n r15.append(r12) // Catch:{ JSONException -> 0x03d7 }\n java.lang.String r4 = r15.toString() // Catch:{ JSONException -> 0x03d7 }\n r7.put(r14, r4) // Catch:{ JSONException -> 0x03d7 }\n java.lang.String r4 = \"wakeupTime\"\n java.lang.StringBuilder r14 = new java.lang.StringBuilder // Catch:{ JSONException -> 0x03d7 }\n r14.<init>() // Catch:{ JSONException -> 0x03d7 }\n java.lang.String r15 = \"authen:\"\n r14.append(r15) // Catch:{ JSONException -> 0x03d7 }\n r14.append(r2) // Catch:{ JSONException -> 0x03d7 }\n java.lang.String r15 = \"##suc2wake:\"\n r14.append(r15) // Catch:{ JSONException -> 0x03d7 }\n r14.append(r5) // Catch:{ JSONException -> 0x03d7 }\n java.lang.String r15 = \"##w2b:\"\n r14.append(r15) // Catch:{ JSONException -> 0x03d7 }\n r67 = r2\n r2 = r63\n r14.append(r2) // Catch:{ JSONException -> 0x03d7 }\n java.lang.String r15 = \"##blockScr:\"\n r14.append(r15) // Catch:{ JSONException -> 0x03d7 }\n r63 = r2\n r2 = r55\n r14.append(r2) // Catch:{ JSONException -> 0x03d7 }\n java.lang.String r14 = r14.toString() // Catch:{ JSONException -> 0x03d7 }\n r7.put(r4, r14) // Catch:{ JSONException -> 0x03d7 }\n java.lang.String r4 = \"ext\"\n java.lang.StringBuilder r14 = new java.lang.StringBuilder // Catch:{ JSONException -> 0x03d7 }\n r14.<init>() // Catch:{ JSONException -> 0x03d7 }\n java.lang.String r15 = \"all:\"\n r14.append(r15) // Catch:{ JSONException -> 0x03d7 }\n r55 = r2\n r2 = r59\n r14.append(r2) // Catch:{ JSONException -> 0x03d7 }\n java.lang.String r15 = \"##setDisp:\"\n r14.append(r15) // Catch:{ JSONException -> 0x03d7 }\n r59 = r2\n r2 = r57\n r14.append(r2) // Catch:{ JSONException -> 0x03d7 }\n java.lang.String r15 = \"##keyDrawn:\"\n r14.append(r15) // Catch:{ JSONException -> 0x03d7 }\n r57 = r2\n r2 = r61\n r14.append(r2) // Catch:{ JSONException -> 0x03d7 }\n java.lang.String r15 = \"##a2e\"\n r14.append(r15) // Catch:{ JSONException -> 0x03d7 }\n r14.append(r0) // Catch:{ JSONException -> 0x03d7 }\n java.lang.String r14 = r14.toString() // Catch:{ JSONException -> 0x03d7 }\n r7.put(r4, r14) // Catch:{ JSONException -> 0x03d7 }\n miui.mqsas.sdk.MQSEventManagerDelegate r4 = miui.mqsas.sdk.MQSEventManagerDelegate.getInstance() // Catch:{ JSONException -> 0x03d7 }\n java.lang.String r14 = \"fingerprintScreenOn\"\n java.lang.String r15 = r7.toString() // Catch:{ JSONException -> 0x03d7 }\n r61 = r0\n r1 = 0\n r4.reportEvent(r14, r15, r1) // Catch:{ JSONException -> 0x03d7 }\n r4 = r69\n r4.mTotalFingerAvgCount = r1 // Catch:{ JSONException -> 0x03d5 }\n goto L_0x044d\n L_0x03d5:\n r0 = move-exception\n goto L_0x041a\n L_0x03d7:\n r0 = move-exception\n goto L_0x03dc\n L_0x03d9:\n r0 = move-exception\n r16 = r4\n L_0x03dc:\n r4 = r69\n goto L_0x041a\n L_0x03df:\n r0 = move-exception\n r16 = r4\n r4 = r1\n goto L_0x041a\n L_0x03e4:\n r0 = move-exception\n r65 = r15\n r16 = r4\n r4 = r1\n goto L_0x041a\n L_0x03eb:\n r0 = move-exception\n r53 = r9\n r65 = r15\n r16 = r4\n r4 = r1\n goto L_0x041a\n L_0x03f4:\n r0 = move-exception\n r53 = r9\n r51 = r13\n r65 = r15\n r16 = r4\n r4 = r1\n goto L_0x041a\n L_0x03ff:\n r0 = move-exception\n r53 = r9\n r49 = r11\n r51 = r13\n r65 = r15\n r16 = r4\n r4 = r1\n goto L_0x041a\n L_0x040c:\n r0 = move-exception\n r33 = r5\n r53 = r9\n r49 = r11\n r51 = r13\n r65 = r15\n r16 = r4\n r4 = r1\n L_0x041a:\n r0.printStackTrace()\n goto L_0x044d\n L_0x041e:\n r23 = r2\n r33 = r5\n r53 = r9\n r49 = r11\n r51 = r13\n r65 = r15\n r16 = r4\n r4 = r1\n goto L_0x044d\n L_0x042e:\n r25 = r2\n r26 = r5\n r31 = r7\n r28 = r9\n r53 = r13\n r65 = r15\n r16 = r4\n r4 = r1\n goto L_0x044d\n L_0x043e:\n r25 = r2\n r16 = r4\n r26 = r5\n r31 = r7\n r28 = r9\n r65 = r11\n r53 = r13\n r4 = r1\n L_0x044d:\n r1 = 0\n r4.mFingerDown = r1\n r4.mFingerSuccess = r1\n r4.mKeyGoingAway = r1\n r4.mKeyExitAnim = r1\n r4.mKeyguardDrawn = r1\n r0 = -1\n r1 = r25\n if (r1 != r0) goto L_0x045f\n return\n L_0x045f:\n boolean[] r0 = r4.mNeedRecord\n boolean r0 = r0[r1]\n if (r0 == 0) goto L_0x0485\n int[] r0 = r4.mAvgCount\n r2 = r0[r1]\n int r2 = r2 + 1\n r0[r1] = r2\n long[] r0 = r4.mTotalScreenOnTime\n r2 = r0[r1]\n long r2 = r2 + r65\n r0[r1] = r2\n long[] r0 = r4.mTotalSetDisplayTime\n r2 = r0[r1]\n long r2 = r2 + r53\n r0[r1] = r2\n long[] r0 = r4.mTotalBlockScreenOnTime\n r2 = r0[r1]\n long r2 = r2 + r31\n r0[r1] = r2\n L_0x0485:\n int[] r0 = r4.mAvgCount\n r0 = r0[r1]\n long r2 = (long) r0\n int r0 = (r2 > r21 ? 1 : (r2 == r21 ? 0 : -1))\n if (r0 != 0) goto L_0x0541\n miui.mqsas.sdk.event.ScreenOnEvent r0 = new miui.mqsas.sdk.event.ScreenOnEvent\n r0.<init>()\n long[] r2 = r4.mTotalScreenOnTime\n r2 = r2[r1]\n int[] r5 = r4.mAvgCount\n r5 = r5[r1]\n long r5 = (long) r5\n long r2 = r2 / r5\n r0.setTotalTime(r2)\n long[] r2 = r4.mTotalSetDisplayTime\n r2 = r2[r1]\n int[] r5 = r4.mAvgCount\n r5 = r5[r1]\n long r5 = (long) r5\n long r2 = r2 / r5\n r0.setSetDisplayTime(r2)\n long[] r2 = r4.mTotalBlockScreenOnTime\n r2 = r2[r1]\n int[] r5 = r4.mAvgCount\n r5 = r5[r1]\n long r5 = (long) r5\n long r2 = r2 / r5\n r0.setBlockScreenTime(r2)\n java.lang.String[] r2 = miui.mqsas.sdk.event.ScreenOnEvent.TYPE_SCREEN_ON\n r2 = r2[r1]\n r0.setScreenOnType(r2)\n java.lang.String r2 = r4.mWakeSource\n r0.setWakeSource(r2)\n miui.mqsas.sdk.MQSEventManagerDelegate r2 = miui.mqsas.sdk.MQSEventManagerDelegate.getInstance()\n r2.reportScreenOnEvent(r0)\n long[] r2 = r4.mTotalScreenOnTime\n r5 = 0\n r2[r1] = r5\n long[] r2 = r4.mTotalSetDisplayTime\n r2[r1] = r5\n long[] r2 = r4.mTotalBlockScreenOnTime\n r2[r1] = r5\n int[] r2 = r4.mAvgCount\n r3 = 0\n r2[r1] = r3\n boolean[] r2 = r4.mNeedRecord\n r2[r1] = r3\n java.lang.StringBuilder r2 = r4.mTypeNeedRecordSb\n r3 = 49\n r2.setCharAt(r1, r3)\n java.lang.String r2 = PROPERTY_SCREEN_ON_UPLOAD\n java.lang.StringBuilder r3 = new java.lang.StringBuilder\n r3.<init>()\n java.lang.StringBuilder r5 = r4.mTypeNeedRecordSb\n java.lang.String r5 = r5.toString()\n r3.append(r5)\n r5 = r16\n r3.append(r5)\n java.lang.String r6 = r4.mUploadVersion\n r3.append(r6)\n java.lang.String r3 = r3.toString()\n android.os.SystemProperties.set(r2, r3)\n boolean r2 = r69.needRecordScreenOn()\n if (r2 != 0) goto L_0x0541\n java.lang.String r2 = PROPERTY_SCREEN_ON_UPLOAD\n java.lang.StringBuilder r3 = new java.lang.StringBuilder\n r3.<init>()\n java.lang.StringBuilder r6 = r4.mTypeNeedRecordSb\n java.lang.String r6 = r6.toString()\n r3.append(r6)\n r3.append(r5)\n java.lang.String r5 = android.os.Build.VERSION.INCREMENTAL\n r3.append(r5)\n java.lang.String r3 = r3.toString()\n android.os.SystemProperties.set(r2, r3)\n goto L_0x0541\n L_0x0532:\n r19 = r3\n r26 = r5\n r28 = r9\n r4 = r1\n goto L_0x0541\n L_0x053a:\n r19 = r3\n r26 = r5\n r28 = r9\n r4 = r1\n L_0x0541:\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.server.ScreenOnMonitor.handleReport(boolean):void\");\n }", "public void run() {\n /*\n r8 = this;\n r1 = com.umeng.commonsdk.proguard.b.b;\t Catch:{ Throwable -> 0x00c9 }\n monitor-enter(r1);\t Catch:{ Throwable -> 0x00c9 }\n r0 = r8.a;\t Catch:{ all -> 0x00c6 }\n if (r0 == 0) goto L_0x00c4;\n L_0x0009:\n r0 = r8.b;\t Catch:{ all -> 0x00c6 }\n if (r0 == 0) goto L_0x00c4;\n L_0x000d:\n r0 = com.umeng.commonsdk.proguard.b.a;\t Catch:{ all -> 0x00c6 }\n if (r0 != 0) goto L_0x00c4;\n L_0x0013:\n r0 = 1;\n com.umeng.commonsdk.proguard.b.a = r0;\t Catch:{ all -> 0x00c6 }\n r0 = \"walle-crash\";\n r2 = 1;\n r2 = new java.lang.Object[r2];\t Catch:{ all -> 0x00c6 }\n r3 = 0;\n r4 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00c6 }\n r4.<init>();\t Catch:{ all -> 0x00c6 }\n r5 = \"report thread is \";\n r4 = r4.append(r5);\t Catch:{ all -> 0x00c6 }\n r5 = com.umeng.commonsdk.proguard.b.a;\t Catch:{ all -> 0x00c6 }\n r4 = r4.append(r5);\t Catch:{ all -> 0x00c6 }\n r4 = r4.toString();\t Catch:{ all -> 0x00c6 }\n r2[r3] = r4;\t Catch:{ all -> 0x00c6 }\n com.umeng.commonsdk.statistics.common.e.a(r0, r2);\t Catch:{ all -> 0x00c6 }\n r0 = r8.b;\t Catch:{ all -> 0x00c6 }\n r0 = com.umeng.commonsdk.proguard.c.a(r0);\t Catch:{ all -> 0x00c6 }\n r2 = android.text.TextUtils.isEmpty(r0);\t Catch:{ all -> 0x00c6 }\n if (r2 != 0) goto L_0x00c4;\n L_0x0045:\n r2 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00c6 }\n r2.<init>();\t Catch:{ all -> 0x00c6 }\n r3 = r8.a;\t Catch:{ all -> 0x00c6 }\n r3 = r3.getFilesDir();\t Catch:{ all -> 0x00c6 }\n r2 = r2.append(r3);\t Catch:{ all -> 0x00c6 }\n r3 = \"/\";\n r2 = r2.append(r3);\t Catch:{ all -> 0x00c6 }\n r3 = \"stateless\";\n r2 = r2.append(r3);\t Catch:{ all -> 0x00c6 }\n r3 = \"/\";\n r2 = r2.append(r3);\t Catch:{ all -> 0x00c6 }\n r3 = \"umpx_internal\";\n r3 = r3.getBytes();\t Catch:{ all -> 0x00c6 }\n r4 = 0;\n r3 = android.util.Base64.encodeToString(r3, r4);\t Catch:{ all -> 0x00c6 }\n r2 = r2.append(r3);\t Catch:{ all -> 0x00c6 }\n r2 = r2.toString();\t Catch:{ all -> 0x00c6 }\n r3 = r8.a;\t Catch:{ all -> 0x00c6 }\n r4 = 10;\n com.umeng.commonsdk.stateless.f.a(r3, r2, r4);\t Catch:{ all -> 0x00c6 }\n r2 = new com.umeng.commonsdk.stateless.UMSLEnvelopeBuild;\t Catch:{ all -> 0x00c6 }\n r2.<init>();\t Catch:{ all -> 0x00c6 }\n r3 = r8.a;\t Catch:{ all -> 0x00c6 }\n r3 = r2.buildSLBaseHeader(r3);\t Catch:{ all -> 0x00c6 }\n r4 = new org.json.JSONObject;\t Catch:{ JSONException -> 0x00cb }\n r4.<init>();\t Catch:{ JSONException -> 0x00cb }\n r5 = \"content\";\n r4.put(r5, r0);\t Catch:{ JSONException -> 0x00cb }\n r0 = \"ts\";\n r6 = java.lang.System.currentTimeMillis();\t Catch:{ JSONException -> 0x00cb }\n r4.put(r0, r6);\t Catch:{ JSONException -> 0x00cb }\n r0 = new org.json.JSONObject;\t Catch:{ JSONException -> 0x00cb }\n r0.<init>();\t Catch:{ JSONException -> 0x00cb }\n r5 = \"crash\";\n r0.put(r5, r4);\t Catch:{ JSONException -> 0x00cb }\n r4 = new org.json.JSONObject;\t Catch:{ JSONException -> 0x00cb }\n r4.<init>();\t Catch:{ JSONException -> 0x00cb }\n r5 = \"tp\";\n r4.put(r5, r0);\t Catch:{ JSONException -> 0x00cb }\n r0 = r8.a;\t Catch:{ JSONException -> 0x00cb }\n r5 = \"umpx_internal\";\n r0 = r2.buildSLEnvelope(r0, r3, r4, r5);\t Catch:{ JSONException -> 0x00cb }\n if (r0 == 0) goto L_0x00c4;\n L_0x00bc:\n r2 = \"exception\";\n r0 = r0.has(r2);\t Catch:{ JSONException -> 0x00cb }\n if (r0 != 0) goto L_0x00c4;\n L_0x00c4:\n monitor-exit(r1);\t Catch:{ all -> 0x00c6 }\n L_0x00c5:\n return;\n L_0x00c6:\n r0 = move-exception;\n monitor-exit(r1);\t Catch:{ all -> 0x00c6 }\n throw r0;\t Catch:{ Throwable -> 0x00c9 }\n L_0x00c9:\n r0 = move-exception;\n goto L_0x00c5;\n L_0x00cb:\n r0 = move-exception;\n goto L_0x00c4;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.umeng.commonsdk.proguard.bb.run():void\");\n }", "public void broadcast(android.os.Message r11) {\n /*\n r10 = this;\n monitor-enter(r10);\n r9 = r10.mReg;\t Catch:{ all -> 0x0036 }\n if (r9 != 0) goto L_0x0007;\n L_0x0005:\n monitor-exit(r10);\t Catch:{ all -> 0x0036 }\n L_0x0006:\n return;\n L_0x0007:\n r4 = r11.what;\t Catch:{ all -> 0x0036 }\n r5 = r10.mReg;\t Catch:{ all -> 0x0036 }\n r3 = r5;\n L_0x000c:\n r9 = r3.senderWhat;\t Catch:{ all -> 0x0036 }\n if (r9 < r4) goto L_0x002f;\n L_0x0010:\n r9 = r3.senderWhat;\t Catch:{ all -> 0x0036 }\n if (r9 != r4) goto L_0x0034;\n L_0x0014:\n r7 = r3.targets;\t Catch:{ all -> 0x0036 }\n r8 = r3.targetWhats;\t Catch:{ all -> 0x0036 }\n r2 = r7.length;\t Catch:{ all -> 0x0036 }\n r0 = 0;\n L_0x001a:\n if (r0 >= r2) goto L_0x0034;\n L_0x001c:\n r6 = r7[r0];\t Catch:{ all -> 0x0036 }\n r1 = android.os.Message.obtain();\t Catch:{ all -> 0x0036 }\n r1.copyFrom(r11);\t Catch:{ all -> 0x0036 }\n r9 = r8[r0];\t Catch:{ all -> 0x0036 }\n r1.what = r9;\t Catch:{ all -> 0x0036 }\n r6.sendMessage(r1);\t Catch:{ all -> 0x0036 }\n r0 = r0 + 1;\n goto L_0x001a;\n L_0x002f:\n r3 = r3.next;\t Catch:{ all -> 0x0036 }\n if (r3 != r5) goto L_0x000c;\n L_0x0033:\n goto L_0x0010;\n L_0x0034:\n monitor-exit(r10);\t Catch:{ all -> 0x0036 }\n goto L_0x0006;\n L_0x0036:\n r9 = move-exception;\n monitor-exit(r10);\t Catch:{ all -> 0x0036 }\n throw r9;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.os.Broadcaster.broadcast(android.os.Message):void\");\n }", "public final synchronized void mo5320b() {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n*/\n /*\n r6 = this;\n monitor-enter(r6);\n r0 = r6.f24853c;\t Catch:{ all -> 0x004c }\n r1 = 0;\t Catch:{ all -> 0x004c }\n r2 = 0;\t Catch:{ all -> 0x004c }\n if (r0 == 0) goto L_0x0046;\t Catch:{ all -> 0x004c }\n L_0x0007:\n r0 = r6.f24851a;\t Catch:{ all -> 0x004c }\n if (r0 != 0) goto L_0x0013;\t Catch:{ all -> 0x004c }\n L_0x000b:\n r0 = r6.f24854d;\t Catch:{ all -> 0x004c }\n r3 = r6.f24853c;\t Catch:{ all -> 0x004c }\n r0.deleteFile(r3);\t Catch:{ all -> 0x004c }\n goto L_0x0046;\t Catch:{ all -> 0x004c }\n L_0x0013:\n r0 = com.google.android.m4b.maps.cg.bx.m23058b();\t Catch:{ all -> 0x004c }\n r3 = r6.f24854d;\t Catch:{ IOException -> 0x0032, all -> 0x002f }\n r4 = r6.f24853c;\t Catch:{ IOException -> 0x0032, all -> 0x002f }\n r3 = r3.openFileOutput(r4, r1);\t Catch:{ IOException -> 0x0032, all -> 0x002f }\n r4 = r6.f24851a;\t Catch:{ IOException -> 0x0033 }\n r4 = r4.m20837d();\t Catch:{ IOException -> 0x0033 }\n r3.write(r4);\t Catch:{ IOException -> 0x0033 }\n com.google.android.m4b.maps.cg.bx.m23057a(r0);\t Catch:{ all -> 0x004c }\n L_0x002b:\n com.google.android.m4b.maps.ap.C4655c.m20770a(r3);\t Catch:{ all -> 0x004c }\n goto L_0x0046;\n L_0x002f:\n r1 = move-exception;\n r3 = r2;\n goto L_0x003f;\n L_0x0032:\n r3 = r2;\n L_0x0033:\n r4 = r6.f24854d;\t Catch:{ all -> 0x003e }\n r5 = r6.f24853c;\t Catch:{ all -> 0x003e }\n r4.deleteFile(r5);\t Catch:{ all -> 0x003e }\n com.google.android.m4b.maps.cg.bx.m23057a(r0);\t Catch:{ all -> 0x004c }\n goto L_0x002b;\t Catch:{ all -> 0x004c }\n L_0x003e:\n r1 = move-exception;\t Catch:{ all -> 0x004c }\n L_0x003f:\n com.google.android.m4b.maps.cg.bx.m23057a(r0);\t Catch:{ all -> 0x004c }\n com.google.android.m4b.maps.ap.C4655c.m20770a(r3);\t Catch:{ all -> 0x004c }\n throw r1;\t Catch:{ all -> 0x004c }\n L_0x0046:\n r6.f24851a = r2;\t Catch:{ all -> 0x004c }\n r6.f24852b = r1;\t Catch:{ all -> 0x004c }\n monitor-exit(r6);\n return;\n L_0x004c:\n r0 = move-exception;\n monitor-exit(r6);\n throw r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.m4b.maps.cg.q.b():void\");\n }", "private void m25427g() {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n*/\n /*\n r2 = this;\n r0 = r2.f19111m;\n if (r0 == 0) goto L_0x000f;\n L_0x0004:\n r0 = r2.f19104f;\t Catch:{ Exception -> 0x000f }\n r0 = android.support.v4.content.C0396d.m1465a(r0);\t Catch:{ Exception -> 0x000f }\n r1 = r2.f19111m;\t Catch:{ Exception -> 0x000f }\n r0.m1468a(r1);\t Catch:{ Exception -> 0x000f }\n L_0x000f:\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.facebook.ads.internal.adapters.w.g():void\");\n }", "public void onEmergencyAnnouncement(boolean r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 0073 in method: android.hardware.radio.RadioTuner.Callback.onEmergencyAnnouncement(boolean):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.hardware.radio.RadioTuner.Callback.onEmergencyAnnouncement(boolean):void\");\n }", "public void m2108c() {\n /*\n r3 = this;\n r0 = \"Calling this from your main thread can lead to deadlock\";\n com.google.android.gms.common.internal.C1305x.m6628c(r0);\n monitor-enter(r3);\n r0 = r3.f1274g;\t Catch:{ all -> 0x002a }\n if (r0 == 0) goto L_0x000e;\n L_0x000a:\n r0 = r3.f1268a;\t Catch:{ all -> 0x002a }\n if (r0 != 0) goto L_0x0010;\n L_0x000e:\n monitor-exit(r3);\t Catch:{ all -> 0x002a }\n L_0x000f:\n return;\n L_0x0010:\n r0 = r3.f1270c;\t Catch:{ IllegalArgumentException -> 0x002d }\n if (r0 == 0) goto L_0x001f;\n L_0x0014:\n r0 = com.google.android.gms.common.stats.C1530b.m6956a();\t Catch:{ IllegalArgumentException -> 0x002d }\n r1 = r3.f1274g;\t Catch:{ IllegalArgumentException -> 0x002d }\n r2 = r3.f1268a;\t Catch:{ IllegalArgumentException -> 0x002d }\n r0.m6963a(r1, r2);\t Catch:{ IllegalArgumentException -> 0x002d }\n L_0x001f:\n r0 = 0;\n r3.f1270c = r0;\t Catch:{ all -> 0x002a }\n r0 = 0;\n r3.f1269b = r0;\t Catch:{ all -> 0x002a }\n r0 = 0;\n r3.f1268a = r0;\t Catch:{ all -> 0x002a }\n monitor-exit(r3);\t Catch:{ all -> 0x002a }\n goto L_0x000f;\n L_0x002a:\n r0 = move-exception;\n monitor-exit(r3);\t Catch:{ all -> 0x002a }\n throw r0;\n L_0x002d:\n r0 = move-exception;\n r1 = \"AdvertisingIdClient\";\n r2 = \"AdvertisingIdClient unbindService failed.\";\n android.util.Log.i(r1, r2, r0);\t Catch:{ all -> 0x002a }\n goto L_0x001f;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.ads.c.a.c():void\");\n }", "public void onReceive(android.content.Context r9, android.content.Intent r10) {\n /*\n r8 = this;\n java.lang.String r0 = r10.getAction()\n int r1 = r0.hashCode()\n r2 = 4\n r3 = 3\n r4 = 2\n r5 = 1\n r6 = 0\n switch(r1) {\n case -1897205914: goto L_0x0039;\n case -1727841388: goto L_0x002f;\n case -837322541: goto L_0x0025;\n case -615389090: goto L_0x001b;\n case 798292259: goto L_0x0011;\n default: goto L_0x0010;\n }\n L_0x0010:\n goto L_0x0043\n L_0x0011:\n java.lang.String r1 = \"android.intent.action.BOOT_COMPLETED\"\n boolean r1 = r0.equals(r1)\n if (r1 == 0) goto L_0x0010\n r1 = r2\n goto L_0x0044\n L_0x001b:\n java.lang.String r1 = \"com.samsung.android.SwitchBoard.STOP\"\n boolean r1 = r0.equals(r1)\n if (r1 == 0) goto L_0x0010\n r1 = r5\n goto L_0x0044\n L_0x0025:\n java.lang.String r1 = \"com.samsung.android.SwitchBoard.ENABLE_DEBUG\"\n boolean r1 = r0.equals(r1)\n if (r1 == 0) goto L_0x0010\n r1 = r4\n goto L_0x0044\n L_0x002f:\n java.lang.String r1 = \"com.samsung.android.SwitchBoard.SWITCH_INTERVAL\"\n boolean r1 = r0.equals(r1)\n if (r1 == 0) goto L_0x0010\n r1 = r3\n goto L_0x0044\n L_0x0039:\n java.lang.String r1 = \"com.samsung.android.SwitchBoard.START\"\n boolean r1 = r0.equals(r1)\n if (r1 == 0) goto L_0x0010\n r1 = r6\n goto L_0x0044\n L_0x0043:\n r1 = -1\n L_0x0044:\n java.lang.String r7 = \"SwitchBoardReceiver.onReceive: action=\"\n if (r1 == 0) goto L_0x011d\n if (r1 == r5) goto L_0x00f3\n if (r1 == r4) goto L_0x00d5\n if (r1 == r3) goto L_0x008d\n if (r1 == r2) goto L_0x0066\n java.lang.StringBuilder r1 = new java.lang.StringBuilder\n r1.<init>()\n java.lang.String r2 = \"SwitchBoardReceiver.onReceive: undefined case: action=\"\n r1.append(r2)\n r1.append(r0)\n java.lang.String r1 = r1.toString()\n com.samsung.android.server.wifi.SwitchBoardService.logd(r1)\n goto L_0x015c\n L_0x0066:\n java.lang.StringBuilder r1 = new java.lang.StringBuilder\n r1.<init>()\n r1.append(r7)\n r1.append(r0)\n java.lang.String r1 = r1.toString()\n com.samsung.android.server.wifi.SwitchBoardService.logv(r1)\n com.samsung.android.server.wifi.SwitchBoardService r1 = com.samsung.android.server.wifi.SwitchBoardService.this\n com.samsung.android.server.wifi.SwitchBoardService$SwitchBoardHandler r1 = r1.mHandler\n com.samsung.android.server.wifi.SwitchBoardService r2 = com.samsung.android.server.wifi.SwitchBoardService.this\n com.samsung.android.server.wifi.SwitchBoardService$SwitchBoardHandler r2 = r2.mHandler\n android.os.Message r2 = r2.obtainMessage(r3)\n r1.sendMessage(r2)\n goto L_0x015c\n L_0x008d:\n com.samsung.android.server.wifi.SwitchBoardService r1 = com.samsung.android.server.wifi.SwitchBoardService.this\n java.lang.String r2 = \"WifiToLteDelayMs\"\n int r2 = r10.getIntExtra(r2, r6)\n int unused = r1.mWifiToLteDelayMs = r2\n com.samsung.android.server.wifi.SwitchBoardService r1 = com.samsung.android.server.wifi.SwitchBoardService.this\n r2 = 5000(0x1388, float:7.006E-42)\n java.lang.String r3 = \"LteToWifiDelayMs\"\n int r2 = r10.getIntExtra(r3, r2)\n int unused = r1.mLteToWifiDelayMs = r2\n java.lang.StringBuilder r1 = new java.lang.StringBuilder\n r1.<init>()\n r1.append(r7)\n r1.append(r0)\n java.lang.String r2 = \", mWifiToLteDelayMs: \"\n r1.append(r2)\n com.samsung.android.server.wifi.SwitchBoardService r2 = com.samsung.android.server.wifi.SwitchBoardService.this\n int r2 = r2.mWifiToLteDelayMs\n r1.append(r2)\n java.lang.String r2 = \", mLteToWifiDelayMs: \"\n r1.append(r2)\n com.samsung.android.server.wifi.SwitchBoardService r2 = com.samsung.android.server.wifi.SwitchBoardService.this\n int r2 = r2.mLteToWifiDelayMs\n r1.append(r2)\n java.lang.String r1 = r1.toString()\n com.samsung.android.server.wifi.SwitchBoardService.logd(r1)\n goto L_0x015c\n L_0x00d5:\n com.samsung.android.server.wifi.SwitchBoardService r1 = com.samsung.android.server.wifi.SwitchBoardService.this\n com.samsung.android.server.wifi.SwitchBoardService$SwitchBoardHandler r1 = r1.mHandler\n com.samsung.android.server.wifi.SwitchBoardService r2 = com.samsung.android.server.wifi.SwitchBoardService.this\n com.samsung.android.server.wifi.SwitchBoardService$SwitchBoardHandler r2 = r2.mHandler\n java.lang.String r3 = \"DEBUG\"\n boolean r3 = r10.getBooleanExtra(r3, r6)\n java.lang.Boolean r3 = java.lang.Boolean.valueOf(r3)\n android.os.Message r2 = r2.obtainMessage(r4, r3)\n r1.sendMessage(r2)\n goto L_0x015c\n L_0x00f3:\n java.lang.StringBuilder r1 = new java.lang.StringBuilder\n r1.<init>()\n r1.append(r7)\n r1.append(r0)\n java.lang.String r1 = r1.toString()\n com.samsung.android.server.wifi.SwitchBoardService.logd(r1)\n com.samsung.android.server.wifi.SwitchBoardService r1 = com.samsung.android.server.wifi.SwitchBoardService.this\n com.samsung.android.server.wifi.SwitchBoardService$SwitchBoardHandler r1 = r1.mHandler\n com.samsung.android.server.wifi.SwitchBoardService r2 = com.samsung.android.server.wifi.SwitchBoardService.this\n com.samsung.android.server.wifi.SwitchBoardService$SwitchBoardHandler r2 = r2.mHandler\n java.lang.Boolean r3 = java.lang.Boolean.valueOf(r6)\n android.os.Message r2 = r2.obtainMessage(r5, r3)\n r1.sendMessage(r2)\n goto L_0x015c\n L_0x011d:\n java.lang.StringBuilder r1 = new java.lang.StringBuilder\n r1.<init>()\n r1.append(r7)\n r1.append(r0)\n java.lang.String r2 = \"AlwaysPolling\"\n r1.append(r2)\n boolean r3 = r10.getBooleanExtra(r2, r6)\n r1.append(r3)\n java.lang.String r1 = r1.toString()\n com.samsung.android.server.wifi.SwitchBoardService.logd(r1)\n com.samsung.android.server.wifi.SwitchBoardService r1 = com.samsung.android.server.wifi.SwitchBoardService.this\n boolean r2 = r10.getBooleanExtra(r2, r6)\n boolean unused = r1.mWifiInfoPollingEnabledAlways = r2\n com.samsung.android.server.wifi.SwitchBoardService r1 = com.samsung.android.server.wifi.SwitchBoardService.this\n com.samsung.android.server.wifi.SwitchBoardService$SwitchBoardHandler r1 = r1.mHandler\n com.samsung.android.server.wifi.SwitchBoardService r2 = com.samsung.android.server.wifi.SwitchBoardService.this\n com.samsung.android.server.wifi.SwitchBoardService$SwitchBoardHandler r2 = r2.mHandler\n java.lang.Boolean r3 = java.lang.Boolean.valueOf(r5)\n android.os.Message r2 = r2.obtainMessage(r5, r3)\n r1.sendMessage(r2)\n L_0x015c:\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.samsung.android.server.wifi.SwitchBoardService.SwitchBoardReceiver.onReceive(android.content.Context, android.content.Intent):void\");\n }", "public void m6606W() {\n /*\n r17 = this;\n r0 = r17\n com.android.service.RecordService$b r1 = r0.f5401U\n if (r1 != 0) goto L_0x0007\n return\n L_0x0007:\n java.lang.StringBuilder r1 = new java.lang.StringBuilder\n r1.<init>()\n java.lang.String r2 = \"<updateTimerView>,mState = \"\n r1.append(r2)\n int r2 = r0.f5435p\n r1.append(r2)\n java.lang.String r1 = r1.toString()\n java.lang.String r2 = \"SR/SoundRecorder\"\n p050c.p051a.p058e.p059a.C0938a.m5002a(r2, r1)\n com.android.service.RecordService$b r1 = r0.f5401U\n long r3 = r1.mo6348i()\n r5 = 1000(0x3e8, double:4.94E-321)\n long r7 = r3 / r5\n r0.f5420ha = r7\n com.android.service.RecordService$b r1 = r0.f5401U\n long r9 = r1.mo6346g()\n int r1 = r0.f5435p\n r11 = 3\n r12 = 4\n r13 = 1\n r14 = 2\n r5 = 0\n if (r1 == 0) goto L_0x009a\n if (r1 == r13) goto L_0x0043\n if (r1 == r14) goto L_0x0055\n if (r1 == r11) goto L_0x0045\n if (r1 == r12) goto L_0x00a1\n L_0x0043:\n r7 = r5\n goto L_0x00a1\n L_0x0045:\n int r1 = (r9 > r5 ? 1 : (r9 == r5 ? 0 : -1))\n if (r1 > 0) goto L_0x004b\n r7 = r5\n goto L_0x004d\n L_0x004b:\n r0.f5451x = r5\n L_0x004d:\n android.os.Handler r1 = r0.f5394N\n java.lang.Runnable r3 = r0.f5446ua\n r1.removeCallbacks(r3)\n goto L_0x00a1\n L_0x0055:\n r0.f5449w = r3\n int r1 = r0.f5439r\n if (r1 != r12) goto L_0x006b\n android.os.Handler r1 = r0.f5394N\n java.lang.Runnable r3 = r0.f5446ua\n long r7 = r0.f5451x\n r15 = 1000(0x3e8, double:4.94E-321)\n long r7 = r7 * r15\n long r12 = r0.f5449w\n long r7 = r7 - r12\n r1.postDelayed(r3, r7)\n goto L_0x007f\n L_0x006b:\n r15 = 1000(0x3e8, double:4.94E-321)\n android.os.Handler r1 = r0.f5394N\n java.lang.Runnable r3 = r0.f5446ua\n long r7 = r0.f5451x\n r12 = 1\n long r7 = r7 + r12\n r0.f5451x = r7\n long r7 = r7 * r15\n long r12 = r0.f5449w\n long r7 = r7 - r12\n r1.postDelayed(r3, r7)\n L_0x007f:\n long r7 = r0.f5449w\n r12 = 500(0x1f4, double:2.47E-321)\n long r7 = r7 + r12\n long r7 = r7 / r15\n java.lang.StringBuilder r1 = new java.lang.StringBuilder\n r1.<init>()\n java.lang.String r3 = \"<updateTimerView>,currentTime = \"\n r1.append(r3)\n r1.append(r7)\n java.lang.String r1 = r1.toString()\n p050c.p051a.p058e.p059a.C0938a.m5002a(r2, r1)\n goto L_0x00a1\n L_0x009a:\n r0.f5451x = r5\n r7 = -1000(0xfffffffffffffc18, double:NaN)\n r0.f5449w = r7\n goto L_0x0043\n L_0x00a1:\n java.lang.Object[] r1 = new java.lang.Object[r11]\n r3 = 0\n r11 = 3600(0xe10, double:1.7786E-320)\n long r15 = r7 / r11\n java.lang.Long r13 = java.lang.Long.valueOf(r15)\n r1[r3] = r13\n long r11 = r7 % r11\n r15 = 60\n long r11 = r11 / r15\n java.lang.Long r3 = java.lang.Long.valueOf(r11)\n r11 = 1\n r1[r11] = r3\n long r11 = r7 % r15\n java.lang.Long r3 = java.lang.Long.valueOf(r11)\n r1[r14] = r3\n java.lang.String r3 = \"%02d:%02d:%02d\"\n java.lang.String r1 = java.lang.String.format(r3, r1)\n r0.f5413e = r1\n int r1 = r0.f5435p\n if (r1 == r14) goto L_0x00d1\n r3 = 4\n if (r1 != r3) goto L_0x00d6\n L_0x00d1:\n com.android.view.timeview.TimeView r1 = r0.f5387G\n r1.setCurrentTime(r7)\n L_0x00d6:\n int r1 = r0.f5435p\n r0.f5439r = r1\n com.android.service.RecordService$b r1 = r0.f5401U\n if (r1 == 0) goto L_0x012f\n boolean r1 = r0.f5425k\n if (r1 != 0) goto L_0x012f\n boolean r1 = r0.f5421i\n if (r1 == 0) goto L_0x012f\n int r1 = (r9 > r5 ? 1 : (r9 == r5 ? 0 : -1))\n if (r1 > 0) goto L_0x012f\n java.lang.StringBuilder r1 = new java.lang.StringBuilder\n r1.<init>()\n java.lang.String r3 = \"<updateTimerView>,mHasFileSizeLimitation : \"\n r1.append(r3)\n boolean r3 = r0.f5421i\n r1.append(r3)\n java.lang.String r3 = \",mRecorder.getRemainingTime(): \"\n r1.append(r3)\n r1.append(r9)\n java.lang.String r1 = r1.toString()\n p050c.p051a.p058e.p059a.C0938a.m5002a(r2, r1)\n android.os.Handler r1 = r0.f5394N\n java.lang.Runnable r3 = r0.f5446ua\n r1.removeCallbacks(r3)\n r1 = 1\n r0.f5425k = r1\n java.lang.StringBuilder r1 = new java.lang.StringBuilder\n r1.<init>()\n java.lang.String r3 = \"<updateTimerView>, mState = \"\n r1.append(r3)\n int r3 = r0.f5435p\n r1.append(r3)\n java.lang.String r1 = r1.toString()\n p050c.p051a.p058e.p059a.C0938a.m5002a(r2, r1)\n int r1 = r0.f5435p\n if (r1 != r14) goto L_0x012f\n r17.m6604U()\n L_0x012f:\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.activity.SoundRecorder.m6606W():void\");\n }", "private synchronized void m29549c() {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n*/\n /*\n r6 = this;\n monitor-enter(r6);\n r0 = r6.f24853c;\t Catch:{ all -> 0x0050 }\n if (r0 == 0) goto L_0x004b;\t Catch:{ all -> 0x0050 }\n L_0x0005:\n r0 = com.google.android.m4b.maps.cg.bx.m23056a();\t Catch:{ all -> 0x0050 }\n r1 = 0;\n r2 = r6.f24854d;\t Catch:{ IOException -> 0x0035, all -> 0x0030 }\n r3 = r6.f24853c;\t Catch:{ IOException -> 0x0035, all -> 0x0030 }\n r2 = r2.openFileInput(r3);\t Catch:{ IOException -> 0x0035, all -> 0x0030 }\n if (r2 == 0) goto L_0x0027;\n L_0x0014:\n r3 = new com.google.android.m4b.maps.ar.a;\t Catch:{ IOException -> 0x0036 }\n r4 = com.google.android.m4b.maps.de.af.f19891a;\t Catch:{ IOException -> 0x0036 }\n r3.<init>(r4);\t Catch:{ IOException -> 0x0036 }\n r6.f24851a = r3;\t Catch:{ IOException -> 0x0036 }\n r3 = r6.f24851a;\t Catch:{ IOException -> 0x0036 }\n r4 = com.google.android.m4b.maps.ap.C4655c.m20771a(r2);\t Catch:{ IOException -> 0x0036 }\n r3.m20819a(r4);\t Catch:{ IOException -> 0x0036 }\n goto L_0x0029;\t Catch:{ IOException -> 0x0036 }\n L_0x0027:\n r6.f24851a = r1;\t Catch:{ IOException -> 0x0036 }\n L_0x0029:\n com.google.android.m4b.maps.cg.bx.m23057a(r0);\t Catch:{ all -> 0x0050 }\n L_0x002c:\n com.google.android.m4b.maps.ap.C4655c.m20773b(r2);\t Catch:{ all -> 0x0050 }\n goto L_0x004b;\n L_0x0030:\n r2 = move-exception;\n r5 = r2;\n r2 = r1;\n r1 = r5;\n goto L_0x0044;\n L_0x0035:\n r2 = r1;\n L_0x0036:\n r6.f24851a = r1;\t Catch:{ all -> 0x0043 }\n r1 = r6.f24854d;\t Catch:{ all -> 0x0043 }\n r3 = r6.f24853c;\t Catch:{ all -> 0x0043 }\n r1.deleteFile(r3);\t Catch:{ all -> 0x0043 }\n com.google.android.m4b.maps.cg.bx.m23057a(r0);\t Catch:{ all -> 0x0050 }\n goto L_0x002c;\t Catch:{ all -> 0x0050 }\n L_0x0043:\n r1 = move-exception;\t Catch:{ all -> 0x0050 }\n L_0x0044:\n com.google.android.m4b.maps.cg.bx.m23057a(r0);\t Catch:{ all -> 0x0050 }\n com.google.android.m4b.maps.ap.C4655c.m20773b(r2);\t Catch:{ all -> 0x0050 }\n throw r1;\t Catch:{ all -> 0x0050 }\n L_0x004b:\n r0 = 1;\t Catch:{ all -> 0x0050 }\n r6.f24852b = r0;\t Catch:{ all -> 0x0050 }\n monitor-exit(r6);\n return;\n L_0x0050:\n r0 = move-exception;\n monitor-exit(r6);\n throw r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.m4b.maps.cg.q.c():void\");\n }", "public final void mo31292d() {\n /*\n r7 = this;\n com.tapjoy.internal.gb r0 = com.tapjoy.internal.C5108gb.this\n com.tapjoy.internal.gb$a r0 = r0.mo31282a()\n android.content.Context r0 = r0.f13987a\n r7.f13994d = r0\n android.content.IntentFilter r0 = new android.content.IntentFilter\n java.lang.String r1 = \"android.net.conn.CONNECTIVITY_CHANGE\"\n r0.<init>(r1)\n android.content.Context r1 = r7.f13994d\n android.content.BroadcastReceiver r2 = r7.f13995e\n r1.registerReceiver(r2, r0)\n L_0x0018:\n boolean r0 = r7.f13992b // Catch:{ all -> 0x008b }\n if (r0 != 0) goto L_0x0087\n java.util.concurrent.CountDownLatch r0 = new java.util.concurrent.CountDownLatch // Catch:{ all -> 0x008b }\n r1 = 1\n r0.<init>(r1) // Catch:{ all -> 0x008b }\n com.tapjoy.internal.fs$a r2 = com.tapjoy.internal.C5096fs.f13949b // Catch:{ all -> 0x008b }\n com.tapjoy.internal.gb$b$1 r3 = new com.tapjoy.internal.gb$b$1 // Catch:{ all -> 0x008b }\n r3.<init>(r0) // Catch:{ all -> 0x008b }\n r2.addObserver(r3) // Catch:{ all -> 0x008b }\n com.tapjoy.internal.gb r2 = com.tapjoy.internal.C5108gb.this // Catch:{ all -> 0x008b }\n com.tapjoy.internal.gb$a r2 = r2.mo31282a() // Catch:{ all -> 0x008b }\n com.tapjoy.internal.gb r3 = com.tapjoy.internal.C5108gb.this // Catch:{ all -> 0x008b }\n android.content.Context r4 = r2.f13987a // Catch:{ all -> 0x008b }\n java.lang.String r5 = r2.f13988b // Catch:{ all -> 0x008b }\n java.util.Hashtable r2 = r2.f13989c // Catch:{ all -> 0x008b }\n r6 = 0\n boolean r2 = r3.mo31194a(r4, r5, r2, r6) // Catch:{ all -> 0x008b }\n r3 = 0\n if (r2 != 0) goto L_0x004b\n com.tapjoy.internal.gb r0 = com.tapjoy.internal.C5108gb.this // Catch:{ all -> 0x008b }\n r0.mo31284a((boolean) r3) // Catch:{ all -> 0x008b }\n r7.m17251h()\n return\n L_0x004b:\n r0.await() // Catch:{ InterruptedException -> 0x004e }\n L_0x004e:\n boolean r0 = r7.f13993c // Catch:{ all -> 0x008b }\n if (r0 == 0) goto L_0x0064\n com.tapjoy.internal.gb r0 = com.tapjoy.internal.C5108gb.this // Catch:{ all -> 0x008b }\n int r2 = com.tapjoy.internal.C5108gb.C5116c.f14003e // Catch:{ all -> 0x008b }\n int r3 = com.tapjoy.internal.C5108gb.C5116c.f14001c // Catch:{ all -> 0x008b }\n r0.mo31283a((int) r2) // Catch:{ all -> 0x008b }\n com.tapjoy.internal.gb r0 = com.tapjoy.internal.C5108gb.this // Catch:{ all -> 0x008b }\n r0.mo31284a((boolean) r1) // Catch:{ all -> 0x008b }\n r7.m17251h()\n return\n L_0x0064:\n com.tapjoy.internal.gb r0 = com.tapjoy.internal.C5108gb.this // Catch:{ all -> 0x008b }\n r0.mo31284a((boolean) r3) // Catch:{ all -> 0x008b }\n com.tapjoy.internal.gb r0 = com.tapjoy.internal.C5108gb.this // Catch:{ all -> 0x008b }\n long r0 = r0.f13979d // Catch:{ all -> 0x008b }\n r2 = 1000(0x3e8, double:4.94E-321)\n long r0 = java.lang.Math.max(r0, r2) // Catch:{ all -> 0x008b }\n com.tapjoy.internal.gb r2 = com.tapjoy.internal.C5108gb.this // Catch:{ all -> 0x008b }\n r3 = 2\n long r3 = r0 << r3\n r5 = 3600000(0x36ee80, double:1.7786363E-317)\n long r3 = java.lang.Math.min(r3, r5) // Catch:{ all -> 0x008b }\n r2.f13979d = r3 // Catch:{ all -> 0x008b }\n com.tapjoy.internal.gb r2 = com.tapjoy.internal.C5108gb.this // Catch:{ all -> 0x008b }\n r2.mo31285a((long) r0) // Catch:{ all -> 0x008b }\n goto L_0x0018\n L_0x0087:\n r7.m17251h()\n return\n L_0x008b:\n r0 = move-exception\n r7.m17251h()\n goto L_0x0091\n L_0x0090:\n throw r0\n L_0x0091:\n goto L_0x0090\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.tapjoy.internal.C5108gb.C5113b.mo31292d():void\");\n }", "public final void mo5393bz(boolean z) {\n AppMethodBeat.m2504i(18993);\n C9638aw.m17190ZK();\n C7580z Ry = C18628c.m29072Ry();\n SQLiteDatabase dvx = C18628c.m29069Ru().dvx();\n this.kIv = Ry.mo16813Mm(237569);\n this.kIw = Ry.getInt(237570, 10);\n this.kIx = Ry.getInt(237571, 0) != 0;\n Context context = C4996ah.getContext();\n Intent registerReceiver = context.registerReceiver(null, new IntentFilter(\"android.intent.action.BATTERY_CHANGED\"));\n if (registerReceiver != null) {\n boolean z2;\n int intExtra = registerReceiver.getIntExtra(\"status\", -1);\n if (intExtra == 2 || intExtra == 5) {\n z2 = true;\n } else {\n z2 = false;\n }\n this.jZS = z2;\n } else {\n this.jZS = false;\n }\n this.jZT = ((PowerManager) context.getSystemService(\"power\")).isScreenOn();\n this.kIz = new C114927();\n C18624c.abi().mo10116c(this.kIz);\n C11486d.bhQ();\n this.kIA = new C114978();\n C4879a.xxA.mo10052c(this.kIA);\n this.jZU = new C114939();\n IntentFilter intentFilter = new IntentFilter();\n intentFilter.addAction(\"android.intent.action.SCREEN_ON\");\n intentFilter.addAction(\"android.intent.action.SCREEN_OFF\");\n intentFilter.addAction(\"android.intent.action.ACTION_POWER_CONNECTED\");\n intentFilter.addAction(\"android.intent.action.ACTION_POWER_DISCONNECTED\");\n context.registerReceiver(this.jZU, intentFilter);\n C44042b.m79163a(new C11477c(this), \"//recover-old\", \"//recover\", \"//post-recover\", \"//backupdb\", \"//recoverdb\", \"//repairdb\", \"//corruptdb\", \"//iotracedb\", \"//recover-status\", \"//dbbusy\");\n String str = \"MicroMsg.SubCoreDBBackup\";\n String str2 = \"Auto database backup %s. Device status:%s interactive,%s charging.\";\n Object[] objArr = new Object[3];\n objArr[0] = this.kIs ? \"enabled\" : \"disabled\";\n objArr[1] = this.jZT ? \"\" : \" not\";\n objArr[2] = this.jZS ? \"\" : \" not\";\n C4990ab.m7417i(str, str2, objArr);\n C11486d.m19265b(dvx);\n C27700b.m44016Ii(C1427q.m3026LK());\n C5730e.deleteFile(C1720g.m3536RP().eJM + \"dbback/EnMicroMsg.db.bak\");\n C5730e.deleteFile(C1720g.m3536RP().eJM + \"dbback/corrupted/EnMicroMsg.db.bak\");\n C5730e.deleteFile(C1720g.m3536RP().cachePath + \"EnMicroMsg.db.bak\");\n C5730e.deleteFile(C1720g.m3536RP().cachePath + \"corrupted/EnMicroMsg.db.bak\");\n final String Rt = C18628c.m29068Rt();\n C9638aw.m17180RS().mo10310m(new Runnable() {\n public final void run() {\n AppMethodBeat.m2504i(18975);\n if (C5730e.m8628ct((Rt + \"corrupted/EnMicroMsg.db\") + \".corrupt\")) {\n AppMethodBeat.m2505o(18975);\n return;\n }\n long currentTimeMillis = System.currentTimeMillis();\n C5728b c5728b = new C5728b(Rt + \"corrupted\");\n if (c5728b.isDirectory()) {\n for (C5728b lastModified : c5728b.dMF()) {\n if (currentTimeMillis - lastModified.lastModified() < 7776000000L) {\n AppMethodBeat.m2505o(18975);\n return;\n }\n }\n if (C5730e.m8618N(C5736j.m8649w(c5728b.mUri), true)) {\n C4990ab.m7416i(\"MicroMsg.SubCoreDBBackup\", \"Corrupted databases removed.\");\n }\n AppMethodBeat.m2505o(18975);\n return;\n }\n AppMethodBeat.m2505o(18975);\n }\n }, 60000);\n AppMethodBeat.m2505o(18993);\n }", "public void mo33398h() {\n String str = \"com.tencent.android.tpush.service.channel.heartbeatIntent.pullup\";\n String str2 = \"TpnsChannel\";\n try {\n if (this.f23285A == null) {\n IntentFilter intentFilter = new IntentFilter();\n intentFilter.addAction(\"android.intent.action.SCREEN_ON\");\n intentFilter.addAction(\"android.intent.action.SCREEN_OFF\");\n intentFilter.addAction(\"android.intent.action.USER_PRESENT\");\n intentFilter.addAction(str);\n C6973b.m29776f().registerReceiver(this.f23292L, intentFilter);\n this.f23285A = PendingIntent.getBroadcast(C6973b.m29776f(), 0, new Intent(str), 134217728);\n }\n long currentTimeMillis = System.currentTimeMillis();\n if (f23282q > f23278m) {\n f23282q = f23278m;\n }\n if (XGPushConfig.isForeignWeakAlarmMode(C6973b.m29776f())) {\n StringBuilder sb = new StringBuilder();\n sb.append(\"schedulePullUpHeartbeat WaekAlarmMode heartbeatinterval: \");\n sb.append(f23280o);\n sb.append(\" ms\");\n C6864a.m29305f(str2, sb.toString());\n f23282q = f23280o;\n }\n f23282q = C7055h.m30166a(C6973b.m29776f(), \"com.tencent.android.xg.wx.HeartbeatIntervalMs\", f23282q);\n long j = currentTimeMillis + ((long) f23282q);\n mo33391b(true);\n C7045d.m30117a().mo34149a(0, j, this.f23285A);\n } catch (Throwable th) {\n C6864a.m29302d(str2, \"scheduleHeartbeat error\", th);\n }\n }", "private void m1866c() {\n /*\n r10 = this;\n r2 = 0;\n r1 = 1;\n r0 = \"DCVpnService\";\n r3 = \"startVPN\";\n com.ppu.fba.p009d.Log1.LogF1(r0, r3);\n monitor-enter(r10);\n r0 = r10.f1317a;\t Catch:{ all -> 0x0065 }\n if (r0 == 0) goto L_0x0017;\n L_0x000e:\n r0 = \"DCVpnService\";\n r1 = \"startVPN: already started\";\n com.ppu.fba.p009d.Log1.LogF1(r0, r1);\t Catch:{ all -> 0x0065 }\n monitor-exit(r10);\t Catch:{ all -> 0x0065 }\n L_0x0016:\n return;\n L_0x0017:\n r0 = 1;\n r10.f1317a = r0;\t Catch:{ all -> 0x0065 }\n monitor-exit(r10);\t Catch:{ all -> 0x0065 }\n r0 = \"DCVpnService\";\n r3 = \"startVPN: about to build\";\n com.ppu.fba.p009d.Log1.LogF1(r0, r3);\n r0 = com.ppu.fba.FirewallApplication.m1851a();\n r0 = android.preference.PreferenceManager.getDefaultSharedPreferences(r0);\n r3 = \"data_caching_on\";\n r3 = r0.getBoolean(r3, r2);\n r4 = \"ad_blocking_on\";\n r4 = r0.getBoolean(r4, r1);\n r5 = \"malware_shield_on\";\n r6 = r0.getBoolean(r5, r2);\n if (r3 == 0) goto L_0x0068;\n L_0x003e:\n r5 = r1;\n L_0x003f:\n if (r4 == 0) goto L_0x006a;\n L_0x0041:\n r4 = r1;\n L_0x0042:\n if (r6 == 0) goto L_0x006c;\n L_0x0044:\n r0 = r1;\n L_0x0045:\n r3 = r10.f1322g;\n if (r3 != 0) goto L_0x0054;\n L_0x0049:\n r3 = new com.ppu.fba.g;\n r3.<init>(r10, r6);\n r3 = r3.establish();\t Catch:{ Exception -> 0x006e }\n r10.f1322g = r3;\t Catch:{ Exception -> 0x006e }\n L_0x0054:\n r3 = r10.f1322g;\n if (r3 != 0) goto L_0x00b6;\n L_0x0058:\n r10.f1317a = r2;\n r0 = \"DCVpnService\";\n r1 = \"builder failed: stopSelf() now\";\n com.ppu.fba.p009d.Log1.LogF1(r0, r1);\n r10.stopSelf();\n goto L_0x0016;\n L_0x0065:\n r0 = move-exception;\n monitor-exit(r10);\t Catch:{ all -> 0x0065 }\n throw r0;\n L_0x0068:\n r5 = r2;\n goto L_0x003f;\n L_0x006a:\n r4 = r2;\n goto L_0x0042;\n L_0x006c:\n r0 = r2;\n goto L_0x0045;\n L_0x006e:\n r3 = move-exception;\n r3 = new com.ppu.fba.q;\n r3.<init>(r10, r6);\n r3 = r3.establish();\t Catch:{ Exception -> 0x007b }\n r10.f1322g = r3;\t Catch:{ Exception -> 0x007b }\n goto L_0x0054;\n L_0x007b:\n r3 = move-exception;\n r6 = \"state\";\n r7 = \"vpnFail\";\n r8 = new java.lang.StringBuilder;\n r8.<init>();\n r9 = \"excEst: \";\n r8 = r8.append(r9);\n r9 = r3.getMessage();\n if (r9 != 0) goto L_0x00b1;\n L_0x0091:\n r3 = \"null\";\n L_0x0093:\n r3 = r8.append(r3);\n r3 = r3.toString();\n r8 = 0;\n r3 = com.google.analytics.tracking.android.MapBuilder.createEvent(r6, r7, r3, r8);\n r3 = r3.build();\n com.ppu.fba.p009d.Log1.LogAction(r3);\n r3 = com.ppu.fba.R.string.error_vpn_establish;\n r3 = android.widget.Toast.makeText(r10, r3, r1);\n r3.show();\n goto L_0x0054;\n L_0x00b1:\n r3 = r3.getMessage();\n goto L_0x0093;\n L_0x00b6:\n r3 = r10.m1868e();\n r10.startForeground(r1, r3);\n r3 = \"DCVpnService\";\n r6 = \"init\";\n com.ppu.fba.p009d.Log1.LogF1(r3, r6);\n r3 = r10.f1322g;\n r3 = r3.getFd();\n r6 = r10.getFilesDir();\n r6 = r6.getAbsolutePath();\n r0 = com.ppu.fba.NativeWrapper.jni_dicki(r3, r6, r5, r4, r0);\n if (r0 == 0) goto L_0x00e4;\n L_0x00d8:\n r0 = \"DCVpnService\";\n r2 = \"account_init failed!!!!!\";\n com.ppu.fba.p009d.Log1.LogF1(r0, r2);\n r10.stopForeground(r1);\n goto L_0x0016;\n L_0x00e4:\n r10.f1321f = r2;\n r0 = new com.ppu.fba.c;\n r1 = new com.ppu.fba.d;\n r1.<init>(r10);\n r2 = \"t4\";\n r0.<init>(r1, r2);\n r10.f1324i = r0;\n r0 = r10.f1324i;\n r0.start();\n r0 = new com.ppu.fba.c;\n r1 = new com.ppu.fba.e;\n r1.<init>(r10);\n r2 = \"t0\";\n r0.<init>(r1, r2);\n r10.f1323h = r0;\n r0 = r10.f1323h;\n r0.start();\n r0 = new com.ppu.fba.c;\n r1 = new com.ppu.fba.f;\n r1.<init>(r10);\n r2 = \"t1\";\n r0.<init>(r1, r2);\n r10.f1319d = r0;\n r0 = new com.ppu.fba.c;\n r1 = new com.ppu.fba.o;\n r1.<init>(r10);\n r2 = \"t2\";\n r0.<init>(r1, r2);\n r10.f1320e = r0;\n r0 = new com.ppu.fba.c;\n r1 = new com.ppu.fba.p;\n r1.<init>(r10);\n r2 = \"t3\";\n r0.<init>(r1, r2);\n r10.f1318c = r0;\n r0 = r10.f1319d;\n r0.start();\n r0 = r10.f1320e;\n r0.start();\n r0 = r10.f1318c;\n r0.start();\n goto L_0x0016;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.ppu.fba.FirewallVpnService.c():void\");\n }", "public void mo55177a() {\n if (!C3815z4.m2010d().mo55979a(C3815z4.C3816a.SDK_STOPPED, false)) {\n C3490e3.m665e(\"SDK is not stopped\");\n return;\n }\n if (C3615m3.this.f1449h != null) {\n C3615m3.this.f1449h.register();\n }\n C3490e3.m665e(\"SDK stop is reverting\");\n C3815z4.m2010d().mo55985b(C3815z4.C3816a.SDK_STOPPED, false);\n C3754u5.m1743f().mo55866c(false);\n C3496e5.m699h().mo55349a(false);\n AnalyticsBridge.getInstance().reportRevertStopSdkEvent();\n C3815z4.m2010d().mo55984b(C3815z4.C3816a.MISSING_EVENTS, AnalyticsBridge.getInstance().exportPendingEventsToJson());\n C3815z4.m2010d().mo55984b(C3815z4.C3816a.MISSING_EVENTS_V2, AnalyticsBridge.getInstance().exportPendingV2EventsToJson());\n }", "@java.lang.Deprecated\n /* renamed from: a */\n /* Code decompiled incorrectly, please refer to instructions dump. */\n public static synchronized void m13804a(android.content.Context r3, com.facebook.C6787r.C6788a r4) {\n /*\n java.lang.Class<com.facebook.r> r0 = com.facebook.C6787r.class\n monitor-enter(r0)\n java.lang.Boolean r1 = f12487s // Catch:{ all -> 0x0088 }\n boolean r1 = r1.booleanValue() // Catch:{ all -> 0x0088 }\n if (r1 == 0) goto L_0x0012\n if (r4 == 0) goto L_0x0010\n r4.mo20141a() // Catch:{ all -> 0x0088 }\n L_0x0010:\n monitor-exit(r0)\n return\n L_0x0012:\n java.lang.String r1 = \"applicationContext\"\n com.facebook.internal.C6697T.m13461a(r3, r1) // Catch:{ all -> 0x0088 }\n r1 = 0\n com.facebook.internal.C6697T.m13460a(r3, r1) // Catch:{ all -> 0x0088 }\n com.facebook.internal.C6697T.m13466b(r3, r1) // Catch:{ all -> 0x0088 }\n android.content.Context r1 = r3.getApplicationContext() // Catch:{ all -> 0x0088 }\n f12481m = r1 // Catch:{ all -> 0x0088 }\n android.content.Context r1 = f12481m // Catch:{ all -> 0x0088 }\n m13810b(r1) // Catch:{ all -> 0x0088 }\n java.lang.String r1 = f12472d // Catch:{ all -> 0x0088 }\n boolean r1 = com.facebook.internal.C6694S.m13436b(r1) // Catch:{ all -> 0x0088 }\n if (r1 != 0) goto L_0x0080\n r1 = 1\n java.lang.Boolean r1 = java.lang.Boolean.valueOf(r1) // Catch:{ all -> 0x0088 }\n f12487s = r1 // Catch:{ all -> 0x0088 }\n boolean r1 = m13817g() // Catch:{ all -> 0x0088 }\n if (r1 == 0) goto L_0x0041\n m13812c() // Catch:{ all -> 0x0088 }\n L_0x0041:\n android.content.Context r1 = f12481m // Catch:{ all -> 0x0088 }\n boolean r1 = r1 instanceof android.app.Application // Catch:{ all -> 0x0088 }\n if (r1 == 0) goto L_0x0056\n boolean r1 = com.facebook.C6557O.m12974e() // Catch:{ all -> 0x0088 }\n if (r1 == 0) goto L_0x0056\n android.content.Context r1 = f12481m // Catch:{ all -> 0x0088 }\n android.app.Application r1 = (android.app.Application) r1 // Catch:{ all -> 0x0088 }\n java.lang.String r2 = f12472d // Catch:{ all -> 0x0088 }\n com.facebook.p127a.p130b.C6602h.m13083a(r1, r2) // Catch:{ all -> 0x0088 }\n L_0x0056:\n com.facebook.internal.C6670D.m13313f() // Catch:{ all -> 0x0088 }\n com.facebook.internal.C6678J.m13355d() // Catch:{ all -> 0x0088 }\n android.content.Context r1 = f12481m // Catch:{ all -> 0x0088 }\n com.facebook.internal.C6712c.m13522a(r1) // Catch:{ all -> 0x0088 }\n com.facebook.internal.G r1 = new com.facebook.internal.G // Catch:{ all -> 0x0088 }\n com.facebook.o r2 = new com.facebook.o // Catch:{ all -> 0x0088 }\n r2.<init>() // Catch:{ all -> 0x0088 }\n r1.<init>(r2) // Catch:{ all -> 0x0088 }\n f12480l = r1 // Catch:{ all -> 0x0088 }\n java.util.concurrent.FutureTask r1 = new java.util.concurrent.FutureTask // Catch:{ all -> 0x0088 }\n com.facebook.p r2 = new com.facebook.p // Catch:{ all -> 0x0088 }\n r2.<init>(r4, r3) // Catch:{ all -> 0x0088 }\n r1.<init>(r2) // Catch:{ all -> 0x0088 }\n java.util.concurrent.Executor r2 = m13822l() // Catch:{ all -> 0x0088 }\n r2.execute(r1) // Catch:{ all -> 0x0088 }\n monitor-exit(r0)\n return\n L_0x0080:\n com.facebook.FacebookException r1 = new com.facebook.FacebookException // Catch:{ all -> 0x0088 }\n java.lang.String r2 = \"A valid Facebook app id must be set in the AndroidManifest.xml or set by calling FacebookSdk.setApplicationId before initializing the sdk.\"\n r1.<init>(r2) // Catch:{ all -> 0x0088 }\n throw r1 // Catch:{ all -> 0x0088 }\n L_0x0088:\n r3 = move-exception\n monitor-exit(r0)\n throw r3\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.facebook.C6787r.m13804a(android.content.Context, com.facebook.r$a):void\");\n }", "public synchronized void a(com.umeng.commonsdk.proguard.f r9) {\n /*\n r8 = this;\n monitor-enter(r8);\n r0 = \"UMSysLocation\";\n r1 = 1;\n r2 = new java.lang.Object[r1];\t Catch:{ all -> 0x00c8 }\n r3 = \"getSystemLocation\";\n r4 = 0;\n r2[r4] = r3;\t Catch:{ all -> 0x00c8 }\n com.umeng.commonsdk.statistics.common.e.a(r0, r2);\t Catch:{ all -> 0x00c8 }\n if (r9 == 0) goto L_0x00c6;\n L_0x0010:\n r0 = r8.d;\t Catch:{ all -> 0x00c8 }\n if (r0 != 0) goto L_0x0016;\n L_0x0014:\n goto L_0x00c6;\n L_0x0016:\n r8.e = r9;\t Catch:{ all -> 0x00c8 }\n r0 = r8.d;\t Catch:{ all -> 0x00c8 }\n r2 = \"android.permission.ACCESS_COARSE_LOCATION\";\n r0 = com.umeng.commonsdk.utils.UMUtils.checkPermission(r0, r2);\t Catch:{ all -> 0x00c8 }\n r2 = r8.d;\t Catch:{ all -> 0x00c8 }\n r3 = \"android.permission.ACCESS_FINE_LOCATION\";\n r2 = com.umeng.commonsdk.utils.UMUtils.checkPermission(r2, r3);\t Catch:{ all -> 0x00c8 }\n r3 = 0;\n if (r0 != 0) goto L_0x0039;\n L_0x002b:\n if (r2 == 0) goto L_0x002e;\n L_0x002d:\n goto L_0x0039;\n L_0x002e:\n r9 = r8.e;\t Catch:{ all -> 0x00c8 }\n if (r9 == 0) goto L_0x0037;\n L_0x0032:\n r9 = r8.e;\t Catch:{ all -> 0x00c8 }\n r9.a(r3);\t Catch:{ all -> 0x00c8 }\n L_0x0037:\n monitor-exit(r8);\n return;\n L_0x0039:\n r5 = r8.b;\t Catch:{ Throwable -> 0x0098 }\n if (r5 == 0) goto L_0x00c4;\n L_0x003d:\n r5 = android.os.Build.VERSION.SDK_INT;\t Catch:{ Throwable -> 0x0098 }\n r6 = 21;\n if (r5 < r6) goto L_0x0054;\n L_0x0043:\n r5 = r8.b;\t Catch:{ Throwable -> 0x0098 }\n r6 = \"gps\";\n r5 = r5.isProviderEnabled(r6);\t Catch:{ Throwable -> 0x0098 }\n r6 = r8.b;\t Catch:{ Throwable -> 0x0098 }\n r7 = \"network\";\n r6 = r6.isProviderEnabled(r7);\t Catch:{ Throwable -> 0x0098 }\n goto L_0x006c;\n L_0x0054:\n if (r2 == 0) goto L_0x005f;\n L_0x0056:\n r5 = r8.b;\t Catch:{ Throwable -> 0x0098 }\n r6 = \"gps\";\n r5 = r5.isProviderEnabled(r6);\t Catch:{ Throwable -> 0x0098 }\n goto L_0x0060;\n L_0x005f:\n r5 = 0;\n L_0x0060:\n if (r0 == 0) goto L_0x006b;\n L_0x0062:\n r6 = r8.b;\t Catch:{ Throwable -> 0x0098 }\n r7 = \"network\";\n r6 = r6.isProviderEnabled(r7);\t Catch:{ Throwable -> 0x0098 }\n goto L_0x006c;\n L_0x006b:\n r6 = 0;\n L_0x006c:\n if (r5 != 0) goto L_0x0070;\n L_0x006e:\n if (r6 == 0) goto L_0x0091;\n L_0x0070:\n r5 = \"UMSysLocation\";\n r6 = new java.lang.Object[r1];\t Catch:{ Throwable -> 0x0098 }\n r7 = \"getLastKnownLocation(LocationManager.PASSIVE_PROVIDER)\";\n r6[r4] = r7;\t Catch:{ Throwable -> 0x0098 }\n com.umeng.commonsdk.statistics.common.e.a(r5, r6);\t Catch:{ Throwable -> 0x0098 }\n if (r2 == 0) goto L_0x0086;\n L_0x007d:\n r0 = r8.b;\t Catch:{ Throwable -> 0x0098 }\n r2 = \"passive\";\n r0 = r0.getLastKnownLocation(r2);\t Catch:{ Throwable -> 0x0098 }\n goto L_0x0092;\n L_0x0086:\n if (r0 == 0) goto L_0x0091;\n L_0x0088:\n r0 = r8.b;\t Catch:{ Throwable -> 0x0098 }\n r2 = \"network\";\n r0 = r0.getLastKnownLocation(r2);\t Catch:{ Throwable -> 0x0098 }\n goto L_0x0092;\n L_0x0091:\n r0 = r3;\n L_0x0092:\n r2 = r8.e;\t Catch:{ Throwable -> 0x0098 }\n r2.a(r0);\t Catch:{ Throwable -> 0x0098 }\n goto L_0x00c4;\n L_0x0098:\n r0 = move-exception;\n r2 = \"UMSysLocation\";\n r1 = new java.lang.Object[r1];\t Catch:{ all -> 0x00c8 }\n r5 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00c8 }\n r5.<init>();\t Catch:{ all -> 0x00c8 }\n r6 = \"e is \";\n r5.append(r6);\t Catch:{ all -> 0x00c8 }\n r5.append(r0);\t Catch:{ all -> 0x00c8 }\n r5 = r5.toString();\t Catch:{ all -> 0x00c8 }\n r1[r4] = r5;\t Catch:{ all -> 0x00c8 }\n com.umeng.commonsdk.statistics.common.e.a(r2, r1);\t Catch:{ all -> 0x00c8 }\n if (r9 == 0) goto L_0x00bf;\n L_0x00b5:\n r9.a(r3);\t Catch:{ Throwable -> 0x00b9 }\n goto L_0x00bf;\n L_0x00b9:\n r9 = move-exception;\n r1 = r8.d;\t Catch:{ all -> 0x00c8 }\n com.umeng.commonsdk.proguard.b.a(r1, r9);\t Catch:{ all -> 0x00c8 }\n L_0x00bf:\n r9 = r8.d;\t Catch:{ all -> 0x00c8 }\n com.umeng.commonsdk.proguard.b.a(r9, r0);\t Catch:{ all -> 0x00c8 }\n L_0x00c4:\n monitor-exit(r8);\n return;\n L_0x00c6:\n monitor-exit(r8);\n return;\n L_0x00c8:\n r9 = move-exception;\n monitor-exit(r8);\n throw r9;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.umeng.commonsdk.proguard.d.a(com.umeng.commonsdk.proguard.f):void\");\n }", "private void m5930a(@javax.annotation.Nullable android.graphics.Bitmap r15) {\n /*\n r14 = this;\n r7 = 0;\n r0 = r14.f6211d;\n r1 = r14.f6208a;\n r1 = r1.i;\n r2 = r14.f6209b;\n r4 = r14.f6208a;\n r4 = r4.d;\n r6 = r14.f6208a;\n r6 = r6.b;\n r1 = r0.a(r1, r2, r4, r6);\n r0 = r14.f6211d;\n r2 = r14.f6209b;\n r4 = r14.f6208a;\n r4 = r4.f;\n r2 = r0.a(r2, r4);\n r0 = r14.f6208a;\n r3 = r0.a;\n r0 = r14.f6208a;\n r4 = r0.b;\n r0 = r14.f6208a;\n r0 = r0.h;\n r5 = com.facebook.messaging.notify.MissedCallNotification.MissCallType.CONFERENCE_ON_GOING;\n if (r0 != r5) goto L_0x0143;\n L_0x0031:\n r0 = r14.f6211d;\n r5 = r14.f6208a;\n r5 = r5.i;\n r6 = r14.f6208a;\n r6 = r6.f;\n r8 = r0.H;\n r9 = \"RTC_JOIN_CONFERENCE_CALL_ACTION\";\n r8 = r8.a(r9);\n r9 = new android.content.Intent;\n r9.<init>(r8);\n r8 = r0.r;\n r8 = r8.a(r5);\n if (r8 != 0) goto L_0x0146;\n L_0x0050:\n r8 = \"DefaultMessagingNotificationHandler\";\n r9 = \"createPendingIntentForJoinConferenceCall cannot fetch threadSummary\";\n com.facebook.debug.log.BLog.a(r8, r9);\n r8 = 0;\n L_0x0058:\n r0 = r8;\n if (r0 == 0) goto L_0x0143;\n L_0x005b:\n r5 = new android.support.v4.app.NotificationCompat$Builder;\n r6 = r14.f6211d;\n r6 = r6.b;\n r5.<init>(r6);\n r3 = r5.a(r3);\n r3 = r3.b(r4);\n r4 = r14.f6210c;\n r3 = r3.a(r4);\n r3.d = r0;\n r3 = r3;\n r2 = r3.b(r2);\n r3 = 2;\n r2.j = r3;\n r2 = r2;\n r3 = r14.f6208a;\n r4 = r3.d;\n r2 = r2.a(r4);\n r3 = r14.f6211d;\n r3 = r3.b;\n r3 = r3.getResources();\n r4 = 2131362510; // 0x7f0a02ce float:1.8344803E38 double:1.053032995E-314;\n r3 = r3.getColor(r4);\n r2.y = r3;\n r2 = r2;\n r3 = 1;\n r2 = r2.c(r3);\n if (r15 == 0) goto L_0x00a0;\n L_0x009e:\n r2.g = r15;\n L_0x00a0:\n r3 = r14.f6208a;\n r3 = r3.e;\n r3 = r3.booleanValue();\n if (r3 == 0) goto L_0x00e1;\n L_0x00aa:\n r3 = r14.f6211d;\n r3 = r3.B;\n r3 = r3.h();\n r4 = com.facebook.config.application.Product.MESSENGER;\n if (r3 != r4) goto L_0x00e1;\n L_0x00b6:\n r3 = com.facebook.messaging.appspecific.AppGlyphResolver.a();\n r4 = r14.f6211d;\n r4 = r4.b;\n r5 = 2131232101; // 0x7f080565 float:1.8080302E38 double:1.0529685644E-314;\n r4 = r4.getString(r5);\n r2.a(r3, r4, r1);\n r1 = r14.f6208a;\n r1 = r1.h;\n r3 = com.facebook.messaging.notify.MissedCallNotification.MissCallType.CONFERENCE_ON_GOING;\n if (r1 != r3) goto L_0x0110;\n L_0x00d0:\n r1 = 2130843998; // 0x7f02195e float:1.7293135E38 double:1.052776816E-314;\n r3 = r14.f6211d;\n r3 = r3.b;\n r4 = 2131231995; // 0x7f0804fb float:1.8080087E38 double:1.052968512E-314;\n r3 = r3.getString(r4);\n r2.a(r1, r3, r0);\n L_0x00e1:\n r0 = r14.f6211d;\n r0 = r0.f;\n r1 = r14.f6208a;\n r1 = r1.g;\n r3 = 0;\n r4 = r14.f6208a;\n r4 = r4.i;\n r0.a(r2, r1, r3, r4);\n r0 = r14.f6211d;\n r1 = r0.d;\n r0 = r14.f6208a;\n r0 = r0.h;\n r3 = com.facebook.messaging.notify.MissedCallNotification.MissCallType.P2P;\n if (r0 != r3) goto L_0x0136;\n L_0x00fd:\n r0 = r14.f6208a;\n r0 = r0.c;\n L_0x0101:\n r3 = 10010; // 0x271a float:1.4027E-41 double:4.9456E-320;\n r2 = r2.c();\n r1.a(r0, r3, r2);\n r0 = r14.f6208a;\n r0.i();\n return;\n L_0x0110:\n r0 = r14.f6208a;\n r0 = r0.a();\n if (r0 != 0) goto L_0x00e1;\n L_0x0118:\n r0 = r14.f6211d;\n r4 = r14.f6209b;\n r1 = r14.f6208a;\n r1 = r1.f;\n r0 = r0.a(r4, r7, r1);\n r1 = 2130843998; // 0x7f02195e float:1.7293135E38 double:1.052776816E-314;\n r3 = r14.f6211d;\n r3 = r3.b;\n r4 = 2131232032; // 0x7f080520 float:1.8080162E38 double:1.0529685303E-314;\n r3 = r3.getString(r4);\n r2.a(r1, r3, r0);\n goto L_0x00e1;\n L_0x0136:\n r0 = r14.f6208a;\n r0 = r0.i;\n r4 = r0.i();\n r0 = java.lang.Long.toString(r4);\n goto L_0x0101;\n L_0x0143:\n r0 = r1;\n goto L_0x005b;\n L_0x0146:\n r10 = \"THREAD_SUMMARY\";\n r8 = r9.putExtra(r10, r8);\n r10 = \"IS_CONFERENCE_CALL\";\n r11 = 1;\n r8 = r8.putExtra(r10, r11);\n r10 = \"IS_VIDEO_CALL\";\n r8 = r8.putExtra(r10, r7);\n r10 = \"CALLBACK_NOTIF_TIME\";\n r11 = r0.w;\n r12 = r11.a();\n r8 = r8.putExtra(r10, r12);\n r10 = \"trigger\";\n r8.putExtra(r10, r6);\n r8 = r0.l;\n r8 = r8.nextInt();\n r10 = r0.b;\n r11 = 268435456; // 0x10000000 float:2.5243549E-29 double:1.32624737E-315;\n r8 = com.facebook.content.SecurePendingIntent.b(r10, r8, r9, r11);\n goto L_0x0058;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.facebook.orca.notify.DefaultMessagingNotificationHandler$5.a(android.graphics.Bitmap):void\");\n }", "private void executePendingBroadcasts() {\n /*\n r9 = this;\n L_0x0000:\n r0 = r9.mReceivers;\n monitor-enter(r0);\n r1 = r9.mPendingBroadcasts;\t Catch:{ all -> 0x0045 }\n r1 = r1.size();\t Catch:{ all -> 0x0045 }\n if (r1 > 0) goto L_0x000d;\n L_0x000b:\n monitor-exit(r0);\t Catch:{ all -> 0x0045 }\n return;\n L_0x000d:\n r1 = new android.support.v4.content.LocalBroadcastManager.BroadcastRecord[r1];\t Catch:{ all -> 0x0045 }\n r2 = r9.mPendingBroadcasts;\t Catch:{ all -> 0x0045 }\n r2.toArray(r1);\t Catch:{ all -> 0x0045 }\n r2 = r9.mPendingBroadcasts;\t Catch:{ all -> 0x0045 }\n r2.clear();\t Catch:{ all -> 0x0045 }\n monitor-exit(r0);\t Catch:{ all -> 0x0045 }\n r0 = 0;\n r2 = r0;\n L_0x001c:\n r3 = r1.length;\n if (r2 >= r3) goto L_0x0000;\n L_0x001f:\n r3 = r1[r2];\n r4 = r3.receivers;\n r4 = r4.size();\n r5 = r0;\n L_0x0028:\n if (r5 >= r4) goto L_0x0042;\n L_0x002a:\n r6 = r3.receivers;\n r6 = r6.get(r5);\n r6 = (android.support.v4.content.LocalBroadcastManager.ReceiverRecord) r6;\n r7 = r6.dead;\n if (r7 != 0) goto L_0x003f;\n L_0x0036:\n r6 = r6.receiver;\n r7 = r9.mAppContext;\n r8 = r3.intent;\n r6.onReceive(r7, r8);\n L_0x003f:\n r5 = r5 + 1;\n goto L_0x0028;\n L_0x0042:\n r2 = r2 + 1;\n goto L_0x001c;\n L_0x0045:\n r1 = move-exception;\n monitor-exit(r0);\t Catch:{ all -> 0x0045 }\n throw r1;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.support.v4.content.LocalBroadcastManager.executePendingBroadcasts():void\");\n }", "private final void m699a(boolean r24, boolean r25, boolean r26, boolean r27, boolean r28) {\n /*\n r23 = this;\n r1 = r23\n bkp r0 = r1.f516a\n r0.mo2044a()\n r2 = 0\n r1.f538w = r2\n ajf r0 = r1.f528m\n r0.mo377a()\n r3 = 0\n r1.f513D = r3\n akx[] r3 = r1.f535t\n int r4 = r3.length\n r5 = 0\n L_0x0017:\n java.lang.String r6 = \"ExoPlayerImplInternal\"\n if (r5 >= r4) goto L_0x002c\n r0 = r3[r5]\n r1.m695a(r0) // Catch:{ ajh -> 0x0023, RuntimeException -> 0x0021 }\n goto L_0x0029\n L_0x0021:\n r0 = move-exception\n goto L_0x0024\n L_0x0023:\n r0 = move-exception\n L_0x0024:\n java.lang.String r7 = \"Disable failed.\"\n android.util.Log.e(r6, r7, r0)\n L_0x0029:\n int r5 = r5 + 1\n goto L_0x0017\n L_0x002c:\n if (r24 == 0) goto L_0x0045\n akx[] r3 = r1.f518c\n int r4 = r3.length\n r5 = 0\n L_0x0032:\n if (r5 < r4) goto L_0x0035\n goto L_0x0045\n L_0x0035:\n r0 = r3[r5]\n r0.mo366n() // Catch:{ RuntimeException -> 0x003b }\n goto L_0x0042\n L_0x003b:\n r0 = move-exception\n r7 = r0\n java.lang.String r0 = \"Reset failed.\"\n android.util.Log.e(r6, r0, r7)\n L_0x0042:\n int r5 = r5 + 1\n goto L_0x0032\n L_0x0045:\n akx[] r0 = new p000.akx[r2]\n r1.f535t = r0\n r0 = 0\n r3 = 1\n if (r26 == 0) goto L_0x0050\n r1.f512C = r0\n goto L_0x0084\n L_0x0050:\n if (r27 == 0) goto L_0x0083\n akd r4 = r1.f512C\n if (r4 != 0) goto L_0x0082\n akp r4 = r1.f533r\n alh r4 = r4.f611a\n boolean r4 = r4.mo552c()\n if (r4 != 0) goto L_0x0081\n akp r4 = r1.f533r\n alh r5 = r4.f611a\n awt r4 = r4.f612b\n java.lang.Object r4 = r4.f2566a\n alf r6 = r1.f526k\n r5.mo547a(r4, r6)\n akp r4 = r1.f533r\n long r4 = r4.f623m\n alf r6 = r1.f526k\n long r6 = r6.f669c\n akd r8 = new akd\n alh r9 = p000.alh.f685a\n long r4 = r4 + r6\n r8.<init>(r9, r2, r4)\n r1.f512C = r8\n goto L_0x0086\n L_0x0081:\n L_0x0082:\n goto L_0x0086\n L_0x0083:\n L_0x0084:\n r3 = r26\n L_0x0086:\n akn r4 = r1.f531p\n r5 = r27 ^ 1\n r4.mo454a(r5)\n r1.f539x = r2\n if (r27 == 0) goto L_0x00ae\n akn r4 = r1.f531p\n alh r5 = p000.alh.f685a\n r4.f598a = r5\n java.util.ArrayList r4 = r1.f530o\n int r5 = r4.size()\n if (r5 > 0) goto L_0x00a7\n java.util.ArrayList r4 = r1.f530o\n r4.clear()\n r1.f514E = r2\n goto L_0x00ae\n L_0x00a7:\n java.lang.Object r2 = r4.get(r2)\n akb r2 = (p000.akb) r2\n throw r0\n L_0x00ae:\n if (r3 == 0) goto L_0x00bd\n akp r2 = r1.f533r\n alg r4 = r1.f525j\n alf r5 = r1.f526k\n awt r2 = r2.mo461a(r4, r5)\n r16 = r2\n goto L_0x00c3\n L_0x00bd:\n akp r2 = r1.f533r\n awt r2 = r2.f612b\n r16 = r2\n L_0x00c3:\n r4 = -9223372036854775807(0x8000000000000001, double:-4.9E-324)\n if (r3 != 0) goto L_0x00d1\n akp r2 = r1.f533r\n long r6 = r2.f623m\n r21 = r6\n goto L_0x00d4\n L_0x00d1:\n r21 = r4\n L_0x00d4:\n if (r3 != 0) goto L_0x00dc\n akp r2 = r1.f533r\n long r2 = r2.f614d\n r9 = r2\n goto L_0x00de\n L_0x00dc:\n r9 = r4\n L_0x00de:\n akp r2 = new akp\n if (r27 != 0) goto L_0x00e8\n akp r3 = r1.f533r\n alh r3 = r3.f611a\n r5 = r3\n goto L_0x00eb\n L_0x00e8:\n alh r3 = p000.alh.f685a\n r5 = r3\n L_0x00eb:\n akp r3 = r1.f533r\n int r11 = r3.f615e\n if (r28 != 0) goto L_0x00f5\n ajh r4 = r3.f616f\n r12 = r4\n goto L_0x00f7\n L_0x00f5:\n r12 = r0\n L_0x00f7:\n if (r27 != 0) goto L_0x00fd\n aye r3 = r3.f618h\n r14 = r3\n goto L_0x0100\n L_0x00fd:\n aye r3 = p000.aye.f2750a\n r14 = r3\n L_0x0100:\n if (r27 != 0) goto L_0x0108\n akp r3 = r1.f533r\n bgr r3 = r3.f619i\n r15 = r3\n goto L_0x010b\n L_0x0108:\n bgr r3 = r1.f521f\n r15 = r3\n L_0x010b:\n r13 = 0\n r19 = 0\n r4 = r2\n r6 = r16\n r7 = r21\n r17 = r21\n r4.<init>(r5, r6, r7, r9, r11, r12, r13, r14, r15, r16, r17, r19, r21)\n r1.f533r = r2\n if (r25 == 0) goto L_0x0125\n awv r2 = r1.f534s\n if (r2 == 0) goto L_0x0125\n r2.mo1475c(r1)\n r1.f534s = r0\n L_0x0125:\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p000.ake.m699a(boolean, boolean, boolean, boolean, boolean):void\");\n }", "public void m1870b() {\n /*\n r3 = this;\n r2 = 1;\n r0 = \"DCVpnService\";\n r1 = \"stopVPN\";\n com.ppu.fba.p009d.Log1.LogF1(r0, r1);\n monitor-enter(r3);\n r0 = r3.f1317a;\t Catch:{ all -> 0x0045 }\n if (r0 != 0) goto L_0x0016;\n L_0x000d:\n r0 = \"DCVpnService\";\n r1 = \"stopVPN: already stopped\";\n com.ppu.fba.p009d.Log1.LogF1(r0, r1);\t Catch:{ all -> 0x0045 }\n monitor-exit(r3);\t Catch:{ all -> 0x0045 }\n L_0x0015:\n return;\n L_0x0016:\n r0 = 0;\n r3.f1317a = r0;\t Catch:{ all -> 0x0045 }\n monitor-exit(r3);\t Catch:{ all -> 0x0045 }\n r0 = r3.f1318c;\n if (r0 != 0) goto L_0x0026;\n L_0x001e:\n r0 = r3.f1319d;\n if (r0 != 0) goto L_0x0026;\n L_0x0022:\n r0 = r3.f1320e;\n if (r0 == 0) goto L_0x0035;\n L_0x0026:\n r3.f1321f = r2;\n r0 = \"DCVpnService\";\n r1 = \"fini\";\n com.ppu.fba.p009d.Log1.LogF1(r0, r1);\n com.ppu.fba.NativeWrapper.jni_dickj();\n r3.m1867d();\n L_0x0035:\n r0 = r3.f1322g;\n if (r0 == 0) goto L_0x0041;\n L_0x0039:\n r0 = r3.f1322g;\t Catch:{ Exception -> 0x0048 }\n r0.close();\t Catch:{ Exception -> 0x0048 }\n L_0x003e:\n r0 = 0;\n r3.f1322g = r0;\n L_0x0041:\n r3.stopForeground(r2);\n goto L_0x0015;\n L_0x0045:\n r0 = move-exception;\n monitor-exit(r3);\t Catch:{ all -> 0x0045 }\n throw r0;\n L_0x0048:\n r0 = move-exception;\n goto L_0x003e;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.ppu.fba.FirewallVpnService.b():void\");\n }", "public final void run() {\n /*\n r6 = this;\n r1 = r6.zzapo;\n monitor-enter(r1);\n r0 = r6.zzapn;\t Catch:{ RemoteException -> 0x006b }\n r0 = r0.zzaph;\t Catch:{ RemoteException -> 0x006b }\n if (r0 != 0) goto L_0x0035;\n L_0x000b:\n r0 = r6.zzapn;\t Catch:{ RemoteException -> 0x006b }\n r0 = r0.zzgf();\t Catch:{ RemoteException -> 0x006b }\n r0 = r0.zzis();\t Catch:{ RemoteException -> 0x006b }\n r2 = \"Failed to get conditional properties\";\n r3 = r6.zzant;\t Catch:{ RemoteException -> 0x006b }\n r3 = com.google.android.gms.internal.measurement.zzfh.zzbl(r3);\t Catch:{ RemoteException -> 0x006b }\n r4 = r6.zzanr;\t Catch:{ RemoteException -> 0x006b }\n r5 = r6.zzans;\t Catch:{ RemoteException -> 0x006b }\n r0.zzd(r2, r3, r4, r5);\t Catch:{ RemoteException -> 0x006b }\n r0 = r6.zzapo;\t Catch:{ RemoteException -> 0x006b }\n r2 = java.util.Collections.emptyList();\t Catch:{ RemoteException -> 0x006b }\n r0.set(r2);\t Catch:{ RemoteException -> 0x006b }\n r0 = r6.zzapo;\t Catch:{ all -> 0x0058 }\n r0.notify();\t Catch:{ all -> 0x0058 }\n monitor-exit(r1);\t Catch:{ all -> 0x0058 }\n L_0x0034:\n return;\n L_0x0035:\n r2 = r6.zzant;\t Catch:{ RemoteException -> 0x006b }\n r2 = android.text.TextUtils.isEmpty(r2);\t Catch:{ RemoteException -> 0x006b }\n if (r2 == 0) goto L_0x005b;\n L_0x003d:\n r2 = r6.zzapo;\t Catch:{ RemoteException -> 0x006b }\n r3 = r6.zzanr;\t Catch:{ RemoteException -> 0x006b }\n r4 = r6.zzans;\t Catch:{ RemoteException -> 0x006b }\n r5 = r6.zzano;\t Catch:{ RemoteException -> 0x006b }\n r0 = r0.zza(r3, r4, r5);\t Catch:{ RemoteException -> 0x006b }\n r2.set(r0);\t Catch:{ RemoteException -> 0x006b }\n L_0x004c:\n r0 = r6.zzapn;\t Catch:{ RemoteException -> 0x006b }\n r0.zzcu();\t Catch:{ RemoteException -> 0x006b }\n r0 = r6.zzapo;\t Catch:{ all -> 0x0058 }\n r0.notify();\t Catch:{ all -> 0x0058 }\n L_0x0056:\n monitor-exit(r1);\t Catch:{ all -> 0x0058 }\n goto L_0x0034;\n L_0x0058:\n r0 = move-exception;\n monitor-exit(r1);\t Catch:{ all -> 0x0058 }\n throw r0;\n L_0x005b:\n r2 = r6.zzapo;\t Catch:{ RemoteException -> 0x006b }\n r3 = r6.zzant;\t Catch:{ RemoteException -> 0x006b }\n r4 = r6.zzanr;\t Catch:{ RemoteException -> 0x006b }\n r5 = r6.zzans;\t Catch:{ RemoteException -> 0x006b }\n r0 = r0.zze(r3, r4, r5);\t Catch:{ RemoteException -> 0x006b }\n r2.set(r0);\t Catch:{ RemoteException -> 0x006b }\n goto L_0x004c;\n L_0x006b:\n r0 = move-exception;\n r2 = r6.zzapn;\t Catch:{ all -> 0x0093 }\n r2 = r2.zzgf();\t Catch:{ all -> 0x0093 }\n r2 = r2.zzis();\t Catch:{ all -> 0x0093 }\n r3 = \"Failed to get conditional properties\";\n r4 = r6.zzant;\t Catch:{ all -> 0x0093 }\n r4 = com.google.android.gms.internal.measurement.zzfh.zzbl(r4);\t Catch:{ all -> 0x0093 }\n r5 = r6.zzanr;\t Catch:{ all -> 0x0093 }\n r2.zzd(r3, r4, r5, r0);\t Catch:{ all -> 0x0093 }\n r0 = r6.zzapo;\t Catch:{ all -> 0x0093 }\n r2 = java.util.Collections.emptyList();\t Catch:{ all -> 0x0093 }\n r0.set(r2);\t Catch:{ all -> 0x0093 }\n r0 = r6.zzapo;\t Catch:{ all -> 0x0058 }\n r0.notify();\t Catch:{ all -> 0x0058 }\n goto L_0x0056;\n L_0x0093:\n r0 = move-exception;\n r2 = r6.zzapo;\t Catch:{ all -> 0x0058 }\n r2.notify();\t Catch:{ all -> 0x0058 }\n throw r0;\t Catch:{ all -> 0x0058 }\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.internal.measurement.zzit.run():void\");\n }", "private void handleRegistrationSuspend(android.os.AsyncResult r1, int r2) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.handleRegistrationSuspend(android.os.AsyncResult, int):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.handleRegistrationSuspend(android.os.AsyncResult, int):void\");\n }", "public boolean sendBroadcast(android.content.Intent r24) {\n /*\n r23 = this;\n r1 = r23;\n r2 = r24;\n r3 = r1.mReceivers;\n monitor-enter(r3);\n r11 = r24.getAction();\t Catch:{ all -> 0x0173 }\n r4 = r1.mAppContext;\t Catch:{ all -> 0x0173 }\n r4 = r4.getContentResolver();\t Catch:{ all -> 0x0173 }\n r12 = r2.resolveTypeIfNeeded(r4);\t Catch:{ all -> 0x0173 }\n r13 = r24.getData();\t Catch:{ all -> 0x0173 }\n r14 = r24.getScheme();\t Catch:{ all -> 0x0173 }\n r15 = r24.getCategories();\t Catch:{ all -> 0x0173 }\n r4 = r24.getFlags();\t Catch:{ all -> 0x0173 }\n r4 = r4 & 8;\n if (r4 == 0) goto L_0x002c;\n L_0x0029:\n r16 = 1;\n goto L_0x002e;\n L_0x002c:\n r16 = 0;\n L_0x002e:\n if (r16 == 0) goto L_0x0056;\n L_0x0030:\n r4 = \"LocalBroadcastManager\";\n r5 = new java.lang.StringBuilder;\t Catch:{ all -> 0x0173 }\n r5.<init>();\t Catch:{ all -> 0x0173 }\n r6 = \"Resolving type \";\n r5.append(r6);\t Catch:{ all -> 0x0173 }\n r5.append(r12);\t Catch:{ all -> 0x0173 }\n r6 = \" scheme \";\n r5.append(r6);\t Catch:{ all -> 0x0173 }\n r5.append(r14);\t Catch:{ all -> 0x0173 }\n r6 = \" of intent \";\n r5.append(r6);\t Catch:{ all -> 0x0173 }\n r5.append(r2);\t Catch:{ all -> 0x0173 }\n r5 = r5.toString();\t Catch:{ all -> 0x0173 }\n android.util.Log.v(r4, r5);\t Catch:{ all -> 0x0173 }\n L_0x0056:\n r4 = r1.mActions;\t Catch:{ all -> 0x0173 }\n r5 = r24.getAction();\t Catch:{ all -> 0x0173 }\n r4 = r4.get(r5);\t Catch:{ all -> 0x0173 }\n r8 = r4;\n r8 = (java.util.ArrayList) r8;\t Catch:{ all -> 0x0173 }\n if (r8 == 0) goto L_0x0170;\n L_0x0065:\n if (r16 == 0) goto L_0x007d;\n L_0x0067:\n r4 = \"LocalBroadcastManager\";\n r5 = new java.lang.StringBuilder;\t Catch:{ all -> 0x0173 }\n r5.<init>();\t Catch:{ all -> 0x0173 }\n r6 = \"Action list: \";\n r5.append(r6);\t Catch:{ all -> 0x0173 }\n r5.append(r8);\t Catch:{ all -> 0x0173 }\n r5 = r5.toString();\t Catch:{ all -> 0x0173 }\n android.util.Log.v(r4, r5);\t Catch:{ all -> 0x0173 }\n L_0x007d:\n r4 = 0;\n r6 = r4;\n r7 = 0;\n L_0x0080:\n r4 = r8.size();\t Catch:{ all -> 0x0173 }\n if (r7 >= r4) goto L_0x0140;\n L_0x0086:\n r4 = r8.get(r7);\t Catch:{ all -> 0x0173 }\n r5 = r4;\n r5 = (android.support.v4.content.LocalBroadcastManager.ReceiverRecord) r5;\t Catch:{ all -> 0x0173 }\n if (r16 == 0) goto L_0x00a7;\n L_0x008f:\n r4 = \"LocalBroadcastManager\";\n r9 = new java.lang.StringBuilder;\t Catch:{ all -> 0x0173 }\n r9.<init>();\t Catch:{ all -> 0x0173 }\n r10 = \"Matching against filter \";\n r9.append(r10);\t Catch:{ all -> 0x0173 }\n r10 = r5.filter;\t Catch:{ all -> 0x0173 }\n r9.append(r10);\t Catch:{ all -> 0x0173 }\n r9 = r9.toString();\t Catch:{ all -> 0x0173 }\n android.util.Log.v(r4, r9);\t Catch:{ all -> 0x0173 }\n L_0x00a7:\n r4 = r5.broadcasting;\t Catch:{ all -> 0x0173 }\n if (r4 == 0) goto L_0x00c2;\n L_0x00ab:\n if (r16 == 0) goto L_0x00b4;\n L_0x00ad:\n r4 = \"LocalBroadcastManager\";\n r5 = \" Filter's target already added\";\n android.util.Log.v(r4, r5);\t Catch:{ all -> 0x0173 }\n L_0x00b4:\n r18 = r7;\n r19 = r8;\n r17 = r11;\n r20 = r12;\n r21 = r13;\n r13 = 1;\n r11 = r6;\n goto L_0x0133;\n L_0x00c2:\n r4 = r5.filter;\t Catch:{ all -> 0x0173 }\n r10 = \"LocalBroadcastManager\";\n r9 = r5;\n r5 = r11;\n r17 = r11;\n r11 = r6;\n r6 = r12;\n r18 = r7;\n r7 = r14;\n r19 = r8;\n r8 = r13;\n r20 = r12;\n r21 = r13;\n r13 = 1;\n r12 = r9;\n r9 = r15;\n r4 = r4.match(r5, r6, r7, r8, r9, r10);\t Catch:{ all -> 0x0173 }\n if (r4 < 0) goto L_0x010a;\n L_0x00df:\n if (r16 == 0) goto L_0x00fb;\n L_0x00e1:\n r5 = \"LocalBroadcastManager\";\n r6 = new java.lang.StringBuilder;\t Catch:{ all -> 0x0173 }\n r6.<init>();\t Catch:{ all -> 0x0173 }\n r7 = \" Filter matched! match=0x\";\n r6.append(r7);\t Catch:{ all -> 0x0173 }\n r4 = java.lang.Integer.toHexString(r4);\t Catch:{ all -> 0x0173 }\n r6.append(r4);\t Catch:{ all -> 0x0173 }\n r4 = r6.toString();\t Catch:{ all -> 0x0173 }\n android.util.Log.v(r5, r4);\t Catch:{ all -> 0x0173 }\n L_0x00fb:\n if (r11 != 0) goto L_0x0103;\n L_0x00fd:\n r6 = new java.util.ArrayList;\t Catch:{ all -> 0x0173 }\n r6.<init>();\t Catch:{ all -> 0x0173 }\n goto L_0x0104;\n L_0x0103:\n r6 = r11;\n L_0x0104:\n r6.add(r12);\t Catch:{ all -> 0x0173 }\n r12.broadcasting = r13;\t Catch:{ all -> 0x0173 }\n goto L_0x0134;\n L_0x010a:\n if (r16 == 0) goto L_0x0133;\n L_0x010c:\n switch(r4) {\n case -4: goto L_0x011b;\n case -3: goto L_0x0118;\n case -2: goto L_0x0115;\n case -1: goto L_0x0112;\n default: goto L_0x010f;\n };\t Catch:{ all -> 0x0173 }\n L_0x010f:\n r4 = \"unknown reason\";\n goto L_0x011d;\n L_0x0112:\n r4 = \"type\";\n goto L_0x011d;\n L_0x0115:\n r4 = \"data\";\n goto L_0x011d;\n L_0x0118:\n r4 = \"action\";\n goto L_0x011d;\n L_0x011b:\n r4 = \"category\";\n L_0x011d:\n r5 = \"LocalBroadcastManager\";\n r6 = new java.lang.StringBuilder;\t Catch:{ all -> 0x0173 }\n r6.<init>();\t Catch:{ all -> 0x0173 }\n r7 = \" Filter did not match: \";\n r6.append(r7);\t Catch:{ all -> 0x0173 }\n r6.append(r4);\t Catch:{ all -> 0x0173 }\n r4 = r6.toString();\t Catch:{ all -> 0x0173 }\n android.util.Log.v(r5, r4);\t Catch:{ all -> 0x0173 }\n L_0x0133:\n r6 = r11;\n L_0x0134:\n r7 = r18 + 1;\n r11 = r17;\n r8 = r19;\n r12 = r20;\n r13 = r21;\n goto L_0x0080;\n L_0x0140:\n r11 = r6;\n r13 = 1;\n if (r11 == 0) goto L_0x0170;\n L_0x0144:\n r4 = 0;\n L_0x0145:\n r5 = r11.size();\t Catch:{ all -> 0x0173 }\n if (r4 >= r5) goto L_0x0157;\n L_0x014b:\n r5 = r11.get(r4);\t Catch:{ all -> 0x0173 }\n r5 = (android.support.v4.content.LocalBroadcastManager.ReceiverRecord) r5;\t Catch:{ all -> 0x0173 }\n r6 = 0;\n r5.broadcasting = r6;\t Catch:{ all -> 0x0173 }\n r4 = r4 + 1;\n goto L_0x0145;\n L_0x0157:\n r4 = r1.mPendingBroadcasts;\t Catch:{ all -> 0x0173 }\n r5 = new android.support.v4.content.LocalBroadcastManager$BroadcastRecord;\t Catch:{ all -> 0x0173 }\n r5.<init>(r2, r11);\t Catch:{ all -> 0x0173 }\n r4.add(r5);\t Catch:{ all -> 0x0173 }\n r2 = r1.mHandler;\t Catch:{ all -> 0x0173 }\n r2 = r2.hasMessages(r13);\t Catch:{ all -> 0x0173 }\n if (r2 != 0) goto L_0x016e;\n L_0x0169:\n r2 = r1.mHandler;\t Catch:{ all -> 0x0173 }\n r2.sendEmptyMessage(r13);\t Catch:{ all -> 0x0173 }\n L_0x016e:\n monitor-exit(r3);\t Catch:{ all -> 0x0173 }\n return r13;\n L_0x0170:\n r6 = 0;\n monitor-exit(r3);\t Catch:{ all -> 0x0173 }\n return r6;\n L_0x0173:\n r0 = move-exception;\n r2 = r0;\n monitor-exit(r3);\t Catch:{ all -> 0x0173 }\n throw r2;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.support.v4.content.LocalBroadcastManager.sendBroadcast(android.content.Intent):boolean\");\n }", "private void handleInvalidSimNotify(int r1, android.os.AsyncResult r2) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.handleInvalidSimNotify(int, android.os.AsyncResult):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.handleInvalidSimNotify(int, android.os.AsyncResult):void\");\n }", "private void wake() {\n /*\n r1 = this;\n boolean r0 = r1.blocked\n if (r0 != 0) goto L_0x0005\n return\n L_0x0005:\n monitor-enter(r1)\n r1.notifyAll() // Catch:{ Exception -> 0x000c }\n goto L_0x000c\n L_0x000a:\n r0 = move-exception\n goto L_0x000e\n L_0x000c:\n monitor-exit(r1) // Catch:{ all -> 0x000a }\n return\n L_0x000e:\n monitor-exit(r1) // Catch:{ all -> 0x000a }\n throw r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.androidquery.callback.AbstractAjaxCallback.wake():void\");\n }", "public final void run() {\n /*\n r7 = this;\n r1 = r7.zzasj;\n monitor-enter(r1);\n r0 = r7.zzasi;\t Catch:{ RemoteException -> 0x006e }\n r0 = r0.zzasc;\t Catch:{ RemoteException -> 0x006e }\n if (r0 != 0) goto L_0x0034;\n L_0x000b:\n r0 = r7.zzasi;\t Catch:{ RemoteException -> 0x006e }\n r0 = r0.zzgt();\t Catch:{ RemoteException -> 0x006e }\n r0 = r0.zzjg();\t Catch:{ RemoteException -> 0x006e }\n r2 = \"Failed to get user properties\";\n r3 = r7.zzagj;\t Catch:{ RemoteException -> 0x006e }\n r3 = com.google.android.gms.measurement.internal.zzas.zzbw(r3);\t Catch:{ RemoteException -> 0x006e }\n r4 = r7.zzads;\t Catch:{ RemoteException -> 0x006e }\n r5 = r7.zzadz;\t Catch:{ RemoteException -> 0x006e }\n r0.zzd(r2, r3, r4, r5);\t Catch:{ RemoteException -> 0x006e }\n r0 = r7.zzasj;\t Catch:{ RemoteException -> 0x006e }\n r2 = java.util.Collections.emptyList();\t Catch:{ RemoteException -> 0x006e }\n r0.set(r2);\t Catch:{ RemoteException -> 0x006e }\n r0 = r7.zzasj;\t Catch:{ all -> 0x0059 }\n r0.notify();\t Catch:{ all -> 0x0059 }\n monitor-exit(r1);\t Catch:{ all -> 0x0059 }\n L_0x0033:\n return;\n L_0x0034:\n r2 = r7.zzagj;\t Catch:{ RemoteException -> 0x006e }\n r2 = android.text.TextUtils.isEmpty(r2);\t Catch:{ RemoteException -> 0x006e }\n if (r2 == 0) goto L_0x005c;\n L_0x003c:\n r2 = r7.zzasj;\t Catch:{ RemoteException -> 0x006e }\n r3 = r7.zzads;\t Catch:{ RemoteException -> 0x006e }\n r4 = r7.zzadz;\t Catch:{ RemoteException -> 0x006e }\n r5 = r7.zzaeg;\t Catch:{ RemoteException -> 0x006e }\n r6 = r7.zzaqk;\t Catch:{ RemoteException -> 0x006e }\n r0 = r0.zza(r3, r4, r5, r6);\t Catch:{ RemoteException -> 0x006e }\n r2.set(r0);\t Catch:{ RemoteException -> 0x006e }\n L_0x004d:\n r0 = r7.zzasi;\t Catch:{ RemoteException -> 0x006e }\n r0.zzcy();\t Catch:{ RemoteException -> 0x006e }\n r0 = r7.zzasj;\t Catch:{ all -> 0x0059 }\n r0.notify();\t Catch:{ all -> 0x0059 }\n L_0x0057:\n monitor-exit(r1);\t Catch:{ all -> 0x0059 }\n goto L_0x0033;\n L_0x0059:\n r0 = move-exception;\n monitor-exit(r1);\t Catch:{ all -> 0x0059 }\n throw r0;\n L_0x005c:\n r2 = r7.zzasj;\t Catch:{ RemoteException -> 0x006e }\n r3 = r7.zzagj;\t Catch:{ RemoteException -> 0x006e }\n r4 = r7.zzads;\t Catch:{ RemoteException -> 0x006e }\n r5 = r7.zzadz;\t Catch:{ RemoteException -> 0x006e }\n r6 = r7.zzaeg;\t Catch:{ RemoteException -> 0x006e }\n r0 = r0.zza(r3, r4, r5, r6);\t Catch:{ RemoteException -> 0x006e }\n r2.set(r0);\t Catch:{ RemoteException -> 0x006e }\n goto L_0x004d;\n L_0x006e:\n r0 = move-exception;\n r2 = r7.zzasi;\t Catch:{ all -> 0x0095 }\n r2 = r2.zzgt();\t Catch:{ all -> 0x0095 }\n r2 = r2.zzjg();\t Catch:{ all -> 0x0095 }\n r3 = \"Failed to get user properties\";\n r4 = r7.zzagj;\t Catch:{ all -> 0x0095 }\n r4 = com.google.android.gms.measurement.internal.zzas.zzbw(r4);\t Catch:{ all -> 0x0095 }\n r5 = r7.zzads;\t Catch:{ all -> 0x0095 }\n r2.zzd(r3, r4, r5, r0);\t Catch:{ all -> 0x0095 }\n r0 = r7.zzasj;\t Catch:{ all -> 0x0095 }\n r2 = java.util.Collections.emptyList();\t Catch:{ all -> 0x0095 }\n r0.set(r2);\t Catch:{ all -> 0x0095 }\n r0 = r7.zzasj;\t Catch:{ all -> 0x0059 }\n r0.notify();\t Catch:{ all -> 0x0059 }\n goto L_0x0057;\n L_0x0095:\n r0 = move-exception;\n r2 = r7.zzasj;\t Catch:{ all -> 0x0059 }\n r2.notify();\t Catch:{ all -> 0x0059 }\n throw r0;\t Catch:{ all -> 0x0059 }\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.measurement.internal.zzep.run():void\");\n }", "static /* synthetic */ void m79214c(PermissionActivity permissionActivity) {\n AppMethodBeat.m2504i(79436);\n C4990ab.m7416i(\"MicroMsg.PermissionActivity\", \"goIgnoreBatteryOptimizations()\");\n try {\n permissionActivity.startActivityForResult(new Intent(\"android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS\").setData(Uri.parse(\"package:\" + permissionActivity.getPackageName())), 1);\n if (C5018as.amF(\"service_launch_way\").getBoolean(\"954_93_first\", true)) {\n C7053e.pXa.mo8378a(954, 93, 1, false);\n C5018as.amF(\"service_launch_way\").edit().putBoolean(\"954_93_first\", false);\n }\n C7053e.pXa.mo8378a(954, 94, 1, false);\n AppMethodBeat.m2505o(79436);\n } catch (Exception e) {\n C4990ab.m7413e(\"MicroMsg.PermissionActivity\", \"onResume scene = %d startActivityForResult() Exception = %s \", Integer.valueOf(permissionActivity.scene), e.getMessage());\n AppMethodBeat.m2505o(79436);\n }\n }", "public final boolean mo3330c(android.content.Intent r3) {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:39)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/509891820.run(Unknown Source)\n*/\n /*\n r2 = this;\n r0 = \"com.google.firebase.messaging.NOTIFICATION_OPEN\";\n r1 = r3.getAction();\n r0 = r0.equals(r1);\n if (r0 == 0) goto L_0x002c;\n L_0x000c:\n r0 = \"pending_intent\";\n r0 = r3.getParcelableExtra(r0);\n r0 = (android.app.PendingIntent) r0;\n if (r0 == 0) goto L_0x0021;\n L_0x0016:\n r0.send();\t Catch:{ CanceledException -> 0x001a }\n goto L_0x0021;\n L_0x001a:\n r0 = \"FirebaseMessaging\";\n r1 = \"Notification pending intent canceled\";\n android.util.Log.e(r0, r1);\n L_0x0021:\n r0 = com.google.firebase.messaging.C2609b.m12812e(r3);\n if (r0 == 0) goto L_0x002a;\n L_0x0027:\n com.google.firebase.messaging.C2609b.m12809b(r3);\n L_0x002a:\n r3 = 1;\n return r3;\n L_0x002c:\n r3 = 0;\n return r3;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.firebase.messaging.FirebaseMessagingService.c(android.content.Intent):boolean\");\n }", "private synchronized void m16565c() {\n if (!(this.f14719b || this.f14723f.hasMessages(this.f14724g))) {\n this.f14723f.sendMessageDelayed(this.f14723f.obtainMessage(this.f14724g), 2000);\n }\n }", "public final void mo14764a() {\n /*\n r9 = this;\n com.google.android.gms.common.util.Clock r0 = com.google.android.gms.ads.internal.zzp.zzkx()\n long r0 = r0.currentTimeMillis()\n java.lang.Object r2 = r9.f10846a\n monitor-enter(r2)\n int r3 = r9.f10847b // Catch:{ all -> 0x004d }\n int r4 = com.google.android.gms.internal.ads.C2349r5.f10765b // Catch:{ all -> 0x004d }\n if (r3 != r4) goto L_0x002c\n long r5 = r9.f10848c // Catch:{ all -> 0x004d }\n com.google.android.gms.internal.ads.zzaaq<java.lang.Long> r3 = com.google.android.gms.internal.ads.zzabf.zzcwh // Catch:{ all -> 0x004d }\n com.google.android.gms.internal.ads.zzabb r7 = com.google.android.gms.internal.ads.zzwq.zzqe() // Catch:{ all -> 0x004d }\n java.lang.Object r3 = r7.zzd(r3) // Catch:{ all -> 0x004d }\n java.lang.Long r3 = (java.lang.Long) r3 // Catch:{ all -> 0x004d }\n long r7 = r3.longValue() // Catch:{ all -> 0x004d }\n long r5 = r5 + r7\n int r3 = (r5 > r0 ? 1 : (r5 == r0 ? 0 : -1))\n if (r3 > 0) goto L_0x002c\n int r0 = com.google.android.gms.internal.ads.C2349r5.f10764a // Catch:{ all -> 0x004d }\n r9.f10847b = r0 // Catch:{ all -> 0x004d }\n L_0x002c:\n monitor-exit(r2) // Catch:{ all -> 0x004d }\n com.google.android.gms.common.util.Clock r0 = com.google.android.gms.ads.internal.zzp.zzkx()\n long r0 = r0.currentTimeMillis()\n java.lang.Object r3 = r9.f10846a\n monitor-enter(r3)\n int r2 = r9.f10847b // Catch:{ all -> 0x004a }\n r5 = 2\n if (r2 == r5) goto L_0x003f\n monitor-exit(r3) // Catch:{ all -> 0x004a }\n return\n L_0x003f:\n r2 = 3\n r9.f10847b = r2 // Catch:{ all -> 0x004a }\n int r2 = r9.f10847b // Catch:{ all -> 0x004a }\n if (r2 != r4) goto L_0x0048\n r9.f10848c = r0 // Catch:{ all -> 0x004a }\n L_0x0048:\n monitor-exit(r3) // Catch:{ all -> 0x004a }\n return\n L_0x004a:\n r0 = move-exception\n monitor-exit(r3) // Catch:{ all -> 0x004a }\n throw r0\n L_0x004d:\n r0 = move-exception\n monitor-exit(r2) // Catch:{ all -> 0x004d }\n throw r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.internal.ads.C2386s5.mo14764a():void\");\n }", "public final void mo5202SH() {\n AppMethodBeat.m2504i(129934);\n IntentFilter intentFilter = new IntentFilter();\n intentFilter.addAction(\"com.tencent.mm.appbrand.debugger\");\n C4996ah.getContext().registerReceiver(this, intentFilter);\n for (C38172a c38172a : C10186a.hjb) {\n if (!(c38172a == null || C5046bo.isNullOrNil(c38172a.name()))) {\n this.hjc.put(c38172a.name(), c38172a);\n }\n }\n AppMethodBeat.m2505o(129934);\n }", "private void m1174c(boolean z) {\n try {\n File file = new File(C3785x1.m1897d(\".crashes/crash.txt\"));\n String e = C3785x1.m1900e(file);\n if (e != null) {\n if (e.indexOf(\"com.medallia.digital.mobilesdk\") != -1) {\n JSONObject jSONObject = new JSONObject(e);\n long j = jSONObject.getLong(\"timestamp\");\n String string = jSONObject.getString(\"stacktrace\");\n Long valueOf = Long.valueOf(C3815z4.m2010d().mo55974a(C3815z4.C3816a.PROPERTY_ID, -1));\n String a = C3815z4.m2010d().mo55975a(C3815z4.C3816a.SESSION_ID, (String) null);\n boolean reportMedalliaCrashEventImmediate = AnalyticsBridge.getInstance().reportMedalliaCrashEventImmediate(string, j, C3815z4.m2010d().mo55975a(C3815z4.C3816a.SESSION_ID, UUID.randomUUID().toString()), valueOf);\n if ((!z && (!C3802y5.m1954a() || a == null)) || !reportMedalliaCrashEventImmediate) {\n return;\n }\n }\n m1159a(file);\n }\n } catch (Exception e2) {\n C3490e3.m663c(e2.getMessage());\n }\n }", "static synchronized void a(android.content.Context r18) {\n /*\n java.lang.Class<com.ss.android.common.applog.n> r1 = com.ss.android.common.applog.n.class\n monitor-enter(r1)\n r2 = 1\n java.lang.Object[] r3 = new java.lang.Object[r2] // Catch:{ all -> 0x0085 }\n r10 = 0\n r3[r10] = r18 // Catch:{ all -> 0x0085 }\n r4 = 0\n com.meituan.robust.ChangeQuickRedirect r5 = f28180a // Catch:{ all -> 0x0085 }\n r6 = 1\n r7 = 15558(0x3cc6, float:2.1801E-41)\n java.lang.Class[] r8 = new java.lang.Class[r2] // Catch:{ all -> 0x0085 }\n java.lang.Class<android.content.Context> r9 = android.content.Context.class\n r8[r10] = r9 // Catch:{ all -> 0x0085 }\n java.lang.Class r9 = java.lang.Void.TYPE // Catch:{ all -> 0x0085 }\n boolean r3 = com.meituan.robust.PatchProxy.isSupport(r3, r4, r5, r6, r7, r8, r9) // Catch:{ all -> 0x0085 }\n if (r3 == 0) goto L_0x0036\n java.lang.Object[] r11 = new java.lang.Object[r2] // Catch:{ all -> 0x0085 }\n r11[r10] = r18 // Catch:{ all -> 0x0085 }\n r12 = 0\n com.meituan.robust.ChangeQuickRedirect r13 = f28180a // Catch:{ all -> 0x0085 }\n r14 = 1\n r15 = 15558(0x3cc6, float:2.1801E-41)\n java.lang.Class[] r0 = new java.lang.Class[r2] // Catch:{ all -> 0x0085 }\n java.lang.Class<android.content.Context> r2 = android.content.Context.class\n r0[r10] = r2 // Catch:{ all -> 0x0085 }\n java.lang.Class r17 = java.lang.Void.TYPE // Catch:{ all -> 0x0085 }\n r16 = r0\n com.meituan.robust.PatchProxy.accessDispatch(r11, r12, r13, r14, r15, r16, r17) // Catch:{ all -> 0x0085 }\n monitor-exit(r1)\n return\n L_0x0036:\n int r3 = f28181b // Catch:{ Throwable -> 0x0083 }\n if (r3 >= 0) goto L_0x003d\n b(r18) // Catch:{ Throwable -> 0x0083 }\n L_0x003d:\n int r3 = f28181b // Catch:{ Throwable -> 0x0083 }\n r4 = 500(0x1f4, float:7.0E-43)\n if (r3 >= r4) goto L_0x0045\n monitor-exit(r1)\n return\n L_0x0045:\n java.util.LinkedList<java.io.File> r3 = f28182c // Catch:{ Throwable -> 0x0083 }\n if (r3 != 0) goto L_0x004c\n b(r18) // Catch:{ Throwable -> 0x0083 }\n L_0x004c:\n java.util.LinkedList<java.io.File> r0 = f28182c // Catch:{ Throwable -> 0x0083 }\n if (r0 != 0) goto L_0x0052\n monitor-exit(r1)\n return\n L_0x0052:\n int r0 = f28181b // Catch:{ Throwable -> 0x0083 }\n if (r0 <= r4) goto L_0x006f\n java.util.LinkedList<java.io.File> r0 = f28182c // Catch:{ Throwable -> 0x0083 }\n int r0 = r0.size() // Catch:{ Throwable -> 0x0083 }\n if (r0 <= 0) goto L_0x006f\n java.util.LinkedList<java.io.File> r0 = f28182c // Catch:{ Throwable -> 0x0083 }\n java.lang.Object r0 = r0.removeFirst() // Catch:{ Throwable -> 0x0083 }\n java.io.File r0 = (java.io.File) r0 // Catch:{ Throwable -> 0x0083 }\n r0.delete() // Catch:{ Throwable -> 0x0083 }\n int r0 = f28181b // Catch:{ Throwable -> 0x0083 }\n int r0 = r0 - r2\n f28181b = r0 // Catch:{ Throwable -> 0x0083 }\n goto L_0x0052\n L_0x006f:\n int r0 = f28181b // Catch:{ Throwable -> 0x0083 }\n if (r0 >= 0) goto L_0x0076\n r0 = -1\n f28181b = r0 // Catch:{ Throwable -> 0x0083 }\n L_0x0076:\n java.util.LinkedList<java.io.File> r0 = f28182c // Catch:{ Throwable -> 0x0083 }\n boolean r0 = r0.isEmpty() // Catch:{ Throwable -> 0x0083 }\n if (r0 == 0) goto L_0x0081\n r0 = 0\n f28182c = r0 // Catch:{ Throwable -> 0x0083 }\n L_0x0081:\n monitor-exit(r1)\n return\n L_0x0083:\n monitor-exit(r1)\n return\n L_0x0085:\n r0 = move-exception\n monitor-exit(r1)\n throw r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.ss.android.common.applog.n.a(android.content.Context):void\");\n }", "public static void m93930a(Context context, Throwable th, String str) {\n try {\n if ((svr.m36484b(context).mo26172a(context.getPackageName(), 0).flags & 2) == 0) {\n StringWriter stringWriter = new StringWriter();\n bqye.m113760a(th, new PrintWriter(stringWriter));\n C1675a aVar = new C1675a(stringWriter.toString(), str, Runtime.getRuntime().freeMemory(), Runtime.getRuntime().totalMemory());\n String valueOf = String.valueOf(Base64.encodeToString(aVar.f110132b.getBytes(C1675a.f110131a), 10));\n String str2 = valueOf.length() == 0 ? new String(\"UTF8-BASE64-TRACE:\") : \"UTF8-BASE64-TRACE:\".concat(valueOf);\n StringBuilder sb = new StringBuilder();\n sb.append(str2);\n sb.append(\"/\");\n sb.append(aVar.f110134d);\n sb.append(\"/\");\n sb.append(aVar.f110135e);\n sb.append(\"/\");\n if (!TextUtils.isEmpty(aVar.f110133c)) {\n sb.append(aVar.f110133c);\n }\n sb.append(\"/\\n\");\n context.sendBroadcast(new Intent().setClassName(\"com.google.android.gms\", \"com.google.android.gms.chimera.GmsIntentOperationService$GmsExternalReceiver\").setAction(\"com.google.android.gms.wallet.REPORT_CRASH\").putExtra(\"com.google.android.gms.wallet.CRASH_LOG\", sb.toString()));\n return;\n }\n } catch (PackageManager.NameNotFoundException e) {\n }\n Log.e(\"WalletCrash\", \"Uncaught exception\", th);\n }", "private synchronized void m3985g() {\n /*\n r8 = this;\n monitor-enter(r8);\n r2 = java.lang.Thread.currentThread();\t Catch:{ all -> 0x0063 }\n r3 = r8.f2114f;\t Catch:{ all -> 0x0063 }\n r3 = r3.mo1186c();\t Catch:{ all -> 0x0063 }\n r2 = r2.equals(r3);\t Catch:{ all -> 0x0063 }\n if (r2 != 0) goto L_0x0021;\n L_0x0011:\n r2 = r8.f2114f;\t Catch:{ all -> 0x0063 }\n r2 = r2.mo1185b();\t Catch:{ all -> 0x0063 }\n r3 = new com.google.analytics.tracking.android.aa;\t Catch:{ all -> 0x0063 }\n r3.<init>(r8);\t Catch:{ all -> 0x0063 }\n r2.add(r3);\t Catch:{ all -> 0x0063 }\n L_0x001f:\n monitor-exit(r8);\n return;\n L_0x0021:\n r2 = r8.f2122n;\t Catch:{ all -> 0x0063 }\n if (r2 == 0) goto L_0x0028;\n L_0x0025:\n r8.m3999d();\t Catch:{ all -> 0x0063 }\n L_0x0028:\n r2 = com.google.analytics.tracking.android.ab.f1966a;\t Catch:{ all -> 0x0063 }\n r3 = r8.f2110b;\t Catch:{ all -> 0x0063 }\n r3 = r3.ordinal();\t Catch:{ all -> 0x0063 }\n r2 = r2[r3];\t Catch:{ all -> 0x0063 }\n switch(r2) {\n case 1: goto L_0x0036;\n case 2: goto L_0x006e;\n case 3: goto L_0x00aa;\n default: goto L_0x0035;\n };\t Catch:{ all -> 0x0063 }\n L_0x0035:\n goto L_0x001f;\n L_0x0036:\n r2 = r8.f2116h;\t Catch:{ all -> 0x0063 }\n r2 = r2.isEmpty();\t Catch:{ all -> 0x0063 }\n if (r2 != 0) goto L_0x0066;\n L_0x003e:\n r2 = r8.f2116h;\t Catch:{ all -> 0x0063 }\n r2 = r2.poll();\t Catch:{ all -> 0x0063 }\n r0 = r2;\n r0 = (com.google.analytics.tracking.android.af) r0;\t Catch:{ all -> 0x0063 }\n r7 = r0;\n r2 = \"Sending hit to store\";\n com.google.analytics.tracking.android.av.m3818e(r2);\t Catch:{ all -> 0x0063 }\n r2 = r8.f2112d;\t Catch:{ all -> 0x0063 }\n r3 = r7.m3743a();\t Catch:{ all -> 0x0063 }\n r4 = r7.m3744b();\t Catch:{ all -> 0x0063 }\n r6 = r7.m3745c();\t Catch:{ all -> 0x0063 }\n r7 = r7.m3746d();\t Catch:{ all -> 0x0063 }\n r2.mo1197a(r3, r4, r6, r7);\t Catch:{ all -> 0x0063 }\n goto L_0x0036;\n L_0x0063:\n r2 = move-exception;\n monitor-exit(r8);\n throw r2;\n L_0x0066:\n r2 = r8.f2121m;\t Catch:{ all -> 0x0063 }\n if (r2 == 0) goto L_0x001f;\n L_0x006a:\n r8.m3987h();\t Catch:{ all -> 0x0063 }\n goto L_0x001f;\n L_0x006e:\n r2 = r8.f2116h;\t Catch:{ all -> 0x0063 }\n r2 = r2.isEmpty();\t Catch:{ all -> 0x0063 }\n if (r2 != 0) goto L_0x00a0;\n L_0x0076:\n r2 = r8.f2116h;\t Catch:{ all -> 0x0063 }\n r2 = r2.peek();\t Catch:{ all -> 0x0063 }\n r0 = r2;\n r0 = (com.google.analytics.tracking.android.af) r0;\t Catch:{ all -> 0x0063 }\n r7 = r0;\n r2 = \"Sending hit to service\";\n com.google.analytics.tracking.android.av.m3818e(r2);\t Catch:{ all -> 0x0063 }\n r2 = r8.f2111c;\t Catch:{ all -> 0x0063 }\n r3 = r7.m3743a();\t Catch:{ all -> 0x0063 }\n r4 = r7.m3744b();\t Catch:{ all -> 0x0063 }\n r6 = r7.m3745c();\t Catch:{ all -> 0x0063 }\n r7 = r7.m3746d();\t Catch:{ all -> 0x0063 }\n r2.mo1204a(r3, r4, r6, r7);\t Catch:{ all -> 0x0063 }\n r2 = r8.f2116h;\t Catch:{ all -> 0x0063 }\n r2.poll();\t Catch:{ all -> 0x0063 }\n goto L_0x006e;\n L_0x00a0:\n r2 = r8.f2123o;\t Catch:{ all -> 0x0063 }\n r2 = r2.mo1198a();\t Catch:{ all -> 0x0063 }\n r8.f2109a = r2;\t Catch:{ all -> 0x0063 }\n goto L_0x001f;\n L_0x00aa:\n r2 = \"Need to reconnect\";\n com.google.analytics.tracking.android.av.m3818e(r2);\t Catch:{ all -> 0x0063 }\n r2 = r8.f2116h;\t Catch:{ all -> 0x0063 }\n r2 = r2.isEmpty();\t Catch:{ all -> 0x0063 }\n if (r2 != 0) goto L_0x001f;\n L_0x00b7:\n r8.m3991j();\t Catch:{ all -> 0x0063 }\n goto L_0x001f;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.analytics.tracking.android.y.g():void\");\n }", "public static void m72639a(com.p280ss.android.ugc.aweme.feed.model.Aweme r3, java.lang.String r4, int r5) {\n /*\n if (r3 == 0) goto L_0x006d\n boolean r0 = r3.isFamiliar()\n r1 = 1\n if (r0 != r1) goto L_0x006c\n boolean r0 = com.p280ss.android.ugc.aweme.utils.C43122ff.m136762a(r3)\n if (r0 == 0) goto L_0x0010\n goto L_0x006c\n L_0x0010:\n com.ss.android.ugc.aweme.app.g.d r0 = com.p280ss.android.ugc.aweme.app.p305g.C22984d.m75611a()\n java.lang.String r1 = \"enter_from\"\n java.lang.String r2 = \"homepage_hot\"\n com.ss.android.ugc.aweme.app.g.d r0 = r0.mo59973a(r1, r2)\n java.lang.String r1 = \"event_type\"\n com.ss.android.ugc.aweme.app.g.d r4 = r0.mo59973a(r1, r4)\n java.lang.String r0 = \"rec_uid\"\n java.lang.String r1 = com.p280ss.android.ugc.aweme.metrics.C33230ac.m107205a(r3)\n com.ss.android.ugc.aweme.app.g.d r4 = r4.mo59973a(r0, r1)\n java.lang.String r0 = \"req_id\"\n java.lang.String r1 = r3.getRequestId()\n com.ss.android.ugc.aweme.app.g.d r4 = r4.mo59973a(r0, r1)\n java.lang.String r0 = \"rec_reason\"\n com.ss.android.ugc.aweme.feed.model.RelationDynamicLabel r1 = r3.getRelationLabel()\n if (r1 == 0) goto L_0x0044\n java.lang.String r1 = r1.getLabelInfo()\n if (r1 != 0) goto L_0x0046\n L_0x0044:\n java.lang.String r1 = \"\"\n L_0x0046:\n com.ss.android.ugc.aweme.app.g.d r4 = r4.mo59973a(r0, r1)\n java.lang.String r0 = \"card_type\"\n java.lang.String r1 = \"item\"\n com.ss.android.ugc.aweme.app.g.d r4 = r4.mo59973a(r0, r1)\n java.lang.String r0 = \"group_id\"\n java.lang.String r3 = r3.getAid()\n com.ss.android.ugc.aweme.app.g.d r3 = r4.mo59973a(r0, r3)\n r4 = -1\n if (r5 == r4) goto L_0x0064\n java.lang.String r4 = \"feed_order\"\n r3.mo59970a(r4, r5)\n L_0x0064:\n java.lang.String r4 = \"follow_card\"\n java.util.Map<java.lang.String, java.lang.String> r3 = r3.f60753a\n com.p280ss.android.ugc.aweme.common.C6907h.m21524a(r4, r3)\n return\n L_0x006c:\n return\n L_0x006d:\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.p280ss.android.ugc.aweme.familiar.p966b.C21718a.m72639a(com.ss.android.ugc.aweme.feed.model.Aweme, java.lang.String, int):void\");\n }", "static java.lang.String d(android.content.Context r7) {\n /*\n r1 = 0\n java.lang.String r0 = \"android.permission.ACCESS_WIFI_STATE\"\n boolean r0 = c(r7, r0) // Catch:{ Exception -> 0x0051 }\n if (r0 == 0) goto L_0x0046\n java.lang.String r0 = \"wifi\"\n java.lang.Object r0 = r7.getSystemService(r0) // Catch:{ Exception -> 0x0051 }\n android.net.wifi.WifiManager r0 = (android.net.wifi.WifiManager) r0 // Catch:{ Exception -> 0x0051 }\n android.net.wifi.WifiInfo r2 = r0.getConnectionInfo() // Catch:{ Exception -> 0x0051 }\n java.lang.String r0 = r2.getMacAddress() // Catch:{ Exception -> 0x0051 }\n boolean r1 = android.text.TextUtils.isEmpty(r0) // Catch:{ Exception -> 0x0061 }\n if (r1 != 0) goto L_0x0027\n byte[] r1 = r0.getBytes() // Catch:{ Exception -> 0x0061 }\n r3 = 0\n android.util.Base64.encode(r1, r3) // Catch:{ Exception -> 0x0061 }\n L_0x0027:\n boolean r1 = com.baidu.b.a.d.a // Catch:{ Exception -> 0x0061 }\n if (r1 == 0) goto L_0x0045\n java.lang.String r1 = \"ssid=%s mac=%s\"\n r3 = 2\n java.lang.Object[] r3 = new java.lang.Object[r3] // Catch:{ Exception -> 0x0061 }\n r4 = 0\n java.lang.String r5 = r2.getSSID() // Catch:{ Exception -> 0x0061 }\n r3[r4] = r5 // Catch:{ Exception -> 0x0061 }\n r4 = 1\n java.lang.String r2 = r2.getMacAddress() // Catch:{ Exception -> 0x0061 }\n r3[r4] = r2 // Catch:{ Exception -> 0x0061 }\n java.lang.String r1 = java.lang.String.format(r1, r3) // Catch:{ Exception -> 0x0061 }\n com.baidu.b.a.d.a(r1) // Catch:{ Exception -> 0x0061 }\n L_0x0045:\n return r0\n L_0x0046:\n boolean r0 = com.baidu.b.a.d.a // Catch:{ Exception -> 0x0051 }\n if (r0 == 0) goto L_0x004f\n java.lang.String r0 = \"You need the android.Manifest.permission.ACCESS_WIFI_STATE permission. Open AndroidManifest.xml and just before the final </manifest> tag add:android.permission.ACCESS_WIFI_STATE\"\n com.baidu.b.a.d.a(r0) // Catch:{ Exception -> 0x0051 }\n L_0x004f:\n r0 = r1\n goto L_0x0045\n L_0x0051:\n r0 = move-exception\n r6 = r0\n r0 = r1\n r1 = r6\n L_0x0055:\n boolean r2 = com.baidu.b.a.d.a\n if (r2 == 0) goto L_0x0045\n java.lang.String r1 = r1.toString()\n com.baidu.b.a.d.a(r1)\n goto L_0x0045\n L_0x0061:\n r1 = move-exception\n goto L_0x0055\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.baidu.b.a.e.d(android.content.Context):java.lang.String\");\n }", "public static void m29697g() {\n if (f27244b) {\n try {\n doStartAnrMonitor(VERSION.SDK_INT);\n } catch (Throwable unused) {\n }\n }\n }", "@com.android.internal.annotations.VisibleForTesting\n /* Code decompiled incorrectly, please refer to instructions dump. */\n public void handleSimStateChange(int r7, int r8, int r9) {\n /*\n // Method dump skipped, instructions count: 183\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.keyguard.KeyguardUpdateMonitor.handleSimStateChange(int, int, int):void\");\n }", "public void mo1402b() {\n if (CarlifeConfig.m4065a()) {\n LogUtil.d(f2837a, \"onStop: Internal screen capture not send background msg. \");\n return;\n }\n LogUtil.d(f2837a, \"onStop: full screen capture send background msg.\");\n BtHfpProtocolHelper.m3442a(false, false);\n }", "public static int m22557b(java.lang.String r1) {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:39)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/509891820.run(Unknown Source)\n*/\n /*\n r0 = com.google.android.gms.internal.measurement.dr.m11788a(r1);\t Catch:{ zzyn -> 0x0005 }\n goto L_0x000c;\n L_0x0005:\n r0 = com.google.android.gms.internal.measurement.zzvo.f10281a;\n r1 = r1.getBytes(r0);\n r0 = r1.length;\n L_0x000c:\n r1 = m22576g(r0);\n r1 = r1 + r0;\n return r1;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.internal.measurement.zzut.b(java.lang.String):int\");\n }", "public static void m2713y(android.content.Context r6, p000.C1129so r7) {\n /*\n oo r0 = new oo\n r0.<init>(r6)\n boolean r1 = p000.C0697ju.m2179b(r6)\n if (r1 == 0) goto L_0x0089\n ko r1 = r0.f3511b\n r1.getClass()\n r1 = 0\n android.bluetooth.BluetoothAdapter r2 = android.bluetooth.BluetoothAdapter.getDefaultAdapter() // Catch:{ Exception -> 0x0040 }\n java.util.Set r2 = r2.getBondedDevices() // Catch:{ Exception -> 0x0040 }\n java.util.Iterator r2 = r2.iterator() // Catch:{ Exception -> 0x0040 }\n L_0x001d:\n boolean r3 = r2.hasNext() // Catch:{ Exception -> 0x0040 }\n if (r3 == 0) goto L_0x0059\n java.lang.Object r3 = r2.next() // Catch:{ Exception -> 0x0040 }\n android.bluetooth.BluetoothDevice r3 = (android.bluetooth.BluetoothDevice) r3 // Catch:{ Exception -> 0x0040 }\n int r4 = r3.getBondState() // Catch:{ Exception -> 0x0040 }\n r5 = 12\n if (r4 != r5) goto L_0x001d\n android.bluetooth.BluetoothClass r4 = r3.getBluetoothClass() // Catch:{ Exception -> 0x0040 }\n int r4 = r4.getMajorDeviceClass() // Catch:{ Exception -> 0x0040 }\n r5 = 1024(0x400, float:1.435E-42)\n r4 = r4 & r5\n if (r4 != r5) goto L_0x001d\n r1 = r3\n goto L_0x0059\n L_0x0040:\n r2 = move-exception\n r3 = -25751307244716(0xffffe8944e7aab54, double:NaN)\n java.lang.String r3 = p000.C0200av.m970a(r3)\n r4 = -25781372015788(0xffffe88d4e7aab54, double:NaN)\n java.lang.String r4 = p000.C0200av.m970a(r4)\n p000.C0550gu.m1819a(r3, r4)\n r2.printStackTrace()\n L_0x0059:\n if (r1 == 0) goto L_0x005d\n r1 = 1\n goto L_0x005e\n L_0x005d:\n r1 = 0\n L_0x005e:\n r2 = -24218003920044(0xffffe9f94e7aab54, double:NaN)\n java.lang.String r2 = p000.C0200av.m970a(r2)\n java.lang.StringBuilder r3 = new java.lang.StringBuilder\n r3.<init>()\n r4 = -24248068691116(0xffffe9f24e7aab54, double:NaN)\n java.lang.String r4 = p000.C0200av.m970a(r4)\n r3.append(r4)\n r3.append(r1)\n java.lang.String r3 = r3.toString()\n p000.C0550gu.m1820b(r2, r3)\n if (r1 == 0) goto L_0x0089\n so r1 = p000.C1129so.BLUETOOTH\n if (r7 == r1) goto L_0x0089\n goto L_0x00ab\n L_0x0089:\n yp r6 = p000.C1426yp.m3890b(r6)\n so r1 = p000.C1129so.USB\n if (r7 == r1) goto L_0x009b\n ko$b r2 = r6.mo5218a(r1)\n int r2 = r2.ordinal()\n if (r2 == 0) goto L_0x00ab\n L_0x009b:\n so r1 = p000.C1129so.HEADPHONES\n if (r7 == r1) goto L_0x00a9\n ko$b r6 = r6.mo5218a(r1)\n int r6 = r6.ordinal()\n if (r6 == 0) goto L_0x00ab\n L_0x00a9:\n so r1 = p000.C1129so.SPEAKER\n L_0x00ab:\n to r6 = new to\n r6.<init>(r1)\n r0.mo3866u(r6)\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p000.C0936oo.m2713y(android.content.Context, so):void\");\n }", "public void mo5833c(android.content.Context r7) {\n /*\n r6 = this;\n r0 = 2\n java.lang.String r1 = m3302v() // Catch:{ a -> 0x0097, IOException -> 0x008a }\n r6.mo5830a(r0, r1) // Catch:{ a -> 0x0097, IOException -> 0x008a }\n L_0x0008:\n r0 = 1\n java.lang.String r1 = m3304x() // Catch:{ a -> 0x0094, IOException -> 0x008a }\n r6.mo5830a(r0, r1) // Catch:{ a -> 0x0094, IOException -> 0x008a }\n L_0x0010:\n java.lang.Long r0 = m3303w() // Catch:{ a -> 0x0092, IOException -> 0x008a }\n long r0 = r0.longValue() // Catch:{ a -> 0x0092, IOException -> 0x008a }\n r2 = 25\n r6.mo5829a(r2, r0) // Catch:{ a -> 0x0092, IOException -> 0x008a }\n long r2 = startTime // Catch:{ a -> 0x0092, IOException -> 0x008a }\n r4 = 0\n int r2 = (r2 > r4 ? 1 : (r2 == r4 ? 0 : -1))\n if (r2 == 0) goto L_0x0034\n r2 = 17\n long r3 = startTime // Catch:{ a -> 0x0092, IOException -> 0x008a }\n long r0 = r0 - r3\n r6.mo5829a(r2, r0) // Catch:{ a -> 0x0092, IOException -> 0x008a }\n r0 = 23\n long r1 = startTime // Catch:{ a -> 0x0092, IOException -> 0x008a }\n r6.mo5829a(r0, r1) // Catch:{ a -> 0x0092, IOException -> 0x008a }\n L_0x0034:\n android.view.MotionEvent r0 = r6.f2852jY // Catch:{ a -> 0x0090, IOException -> 0x008a }\n android.util.DisplayMetrics r1 = r6.f2853jZ // Catch:{ a -> 0x0090, IOException -> 0x008a }\n java.util.ArrayList r1 = m3296a(r0, r1) // Catch:{ a -> 0x0090, IOException -> 0x008a }\n r2 = 14\n r0 = 0\n java.lang.Object r0 = r1.get(r0) // Catch:{ a -> 0x0090, IOException -> 0x008a }\n java.lang.Long r0 = (java.lang.Long) r0 // Catch:{ a -> 0x0090, IOException -> 0x008a }\n long r3 = r0.longValue() // Catch:{ a -> 0x0090, IOException -> 0x008a }\n r6.mo5829a(r2, r3) // Catch:{ a -> 0x0090, IOException -> 0x008a }\n r2 = 15\n r0 = 1\n java.lang.Object r0 = r1.get(r0) // Catch:{ a -> 0x0090, IOException -> 0x008a }\n java.lang.Long r0 = (java.lang.Long) r0 // Catch:{ a -> 0x0090, IOException -> 0x008a }\n long r3 = r0.longValue() // Catch:{ a -> 0x0090, IOException -> 0x008a }\n r6.mo5829a(r2, r3) // Catch:{ a -> 0x0090, IOException -> 0x008a }\n int r0 = r1.size() // Catch:{ a -> 0x0090, IOException -> 0x008a }\n r2 = 3\n if (r0 < r2) goto L_0x0073\n r2 = 16\n r0 = 2\n java.lang.Object r0 = r1.get(r0) // Catch:{ a -> 0x0090, IOException -> 0x008a }\n java.lang.Long r0 = (java.lang.Long) r0 // Catch:{ a -> 0x0090, IOException -> 0x008a }\n long r0 = r0.longValue() // Catch:{ a -> 0x0090, IOException -> 0x008a }\n r6.mo5829a(r2, r0) // Catch:{ a -> 0x0090, IOException -> 0x008a }\n L_0x0073:\n r0 = 27\n com.google.android.gms.internal.n r1 = r6.f2854ka // Catch:{ a -> 0x008e, IOException -> 0x008a }\n java.lang.String r1 = m3295a(r7, r1) // Catch:{ a -> 0x008e, IOException -> 0x008a }\n r6.mo5830a(r0, r1) // Catch:{ a -> 0x008e, IOException -> 0x008a }\n L_0x007e:\n r0 = 29\n com.google.android.gms.internal.n r1 = r6.f2854ka // Catch:{ a -> 0x008c, IOException -> 0x008a }\n java.lang.String r1 = m3298b(r7, r1) // Catch:{ a -> 0x008c, IOException -> 0x008a }\n r6.mo5830a(r0, r1) // Catch:{ a -> 0x008c, IOException -> 0x008a }\n L_0x0089:\n return\n L_0x008a:\n r0 = move-exception\n goto L_0x0089\n L_0x008c:\n r0 = move-exception\n goto L_0x0089\n L_0x008e:\n r0 = move-exception\n goto L_0x007e\n L_0x0090:\n r0 = move-exception\n goto L_0x0073\n L_0x0092:\n r0 = move-exception\n goto L_0x0034\n L_0x0094:\n r0 = move-exception\n goto L_0x0010\n L_0x0097:\n r0 = move-exception\n goto L_0x0008\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.internal.C1107j.mo5833c(android.content.Context):void\");\n }", "private final com.google.wireless.android.finsky.dfe.p515h.p516a.ae m35733b(com.google.protobuf.nano.C7213a r7) {\n /*\n r6 = this;\n L_0x0000:\n r0 = r7.m33550a();\n switch(r0) {\n case 0: goto L_0x000d;\n case 10: goto L_0x000e;\n case 18: goto L_0x001f;\n case 26: goto L_0x002c;\n case 34: goto L_0x0039;\n case 42: goto L_0x004a;\n case 50: goto L_0x0057;\n case 56: goto L_0x0064;\n case 64: goto L_0x00a3;\n case 72: goto L_0x00b1;\n case 82: goto L_0x00bf;\n default: goto L_0x0007;\n };\n L_0x0007:\n r0 = super.a(r7, r0);\n if (r0 != 0) goto L_0x0000;\n L_0x000d:\n return r6;\n L_0x000e:\n r0 = r6.f38026c;\n if (r0 != 0) goto L_0x0019;\n L_0x0012:\n r0 = new com.google.android.finsky.cv.a.bd;\n r0.<init>();\n r6.f38026c = r0;\n L_0x0019:\n r0 = r6.f38026c;\n r7.m33552a(r0);\n goto L_0x0000;\n L_0x001f:\n r0 = r7.m33564f();\n r6.f38027d = r0;\n r0 = r6.f38025b;\n r0 = r0 | 1;\n r6.f38025b = r0;\n goto L_0x0000;\n L_0x002c:\n r0 = r7.m33564f();\n r6.f38028e = r0;\n r0 = r6.f38025b;\n r0 = r0 | 2;\n r6.f38025b = r0;\n goto L_0x0000;\n L_0x0039:\n r0 = r6.f38029f;\n if (r0 != 0) goto L_0x0044;\n L_0x003d:\n r0 = new com.google.android.finsky.cv.a.ax;\n r0.<init>();\n r6.f38029f = r0;\n L_0x0044:\n r0 = r6.f38029f;\n r7.m33552a(r0);\n goto L_0x0000;\n L_0x004a:\n r0 = r7.m33564f();\n r6.f38030g = r0;\n r0 = r6.f38025b;\n r0 = r0 | 4;\n r6.f38025b = r0;\n goto L_0x0000;\n L_0x0057:\n r0 = r7.m33564f();\n r6.f38031h = r0;\n r0 = r6.f38025b;\n r0 = r0 | 8;\n r6.f38025b = r0;\n goto L_0x0000;\n L_0x0064:\n r1 = r6.f38025b;\n r1 = r1 | 16;\n r6.f38025b = r1;\n r1 = r7.m33573o();\n r2 = r7.m33567i();\t Catch:{ IllegalArgumentException -> 0x0090 }\n switch(r2) {\n case 0: goto L_0x0099;\n case 1: goto L_0x0099;\n case 2: goto L_0x0099;\n case 3: goto L_0x0099;\n case 4: goto L_0x0099;\n default: goto L_0x0075;\n };\t Catch:{ IllegalArgumentException -> 0x0090 }\n L_0x0075:\n r3 = new java.lang.IllegalArgumentException;\t Catch:{ IllegalArgumentException -> 0x0090 }\n r4 = 36;\n r5 = new java.lang.StringBuilder;\t Catch:{ IllegalArgumentException -> 0x0090 }\n r5.<init>(r4);\t Catch:{ IllegalArgumentException -> 0x0090 }\n r2 = r5.append(r2);\t Catch:{ IllegalArgumentException -> 0x0090 }\n r4 = \" is not a valid enum Type\";\n r2 = r2.append(r4);\t Catch:{ IllegalArgumentException -> 0x0090 }\n r2 = r2.toString();\t Catch:{ IllegalArgumentException -> 0x0090 }\n r3.<init>(r2);\t Catch:{ IllegalArgumentException -> 0x0090 }\n throw r3;\t Catch:{ IllegalArgumentException -> 0x0090 }\n L_0x0090:\n r2 = move-exception;\n r7.m33562e(r1);\n r6.a(r7, r0);\n goto L_0x0000;\n L_0x0099:\n r6.f38032i = r2;\t Catch:{ IllegalArgumentException -> 0x0090 }\n r2 = r6.f38025b;\t Catch:{ IllegalArgumentException -> 0x0090 }\n r2 = r2 | 16;\n r6.f38025b = r2;\t Catch:{ IllegalArgumentException -> 0x0090 }\n goto L_0x0000;\n L_0x00a3:\n r0 = r7.m33563e();\n r6.f38033j = r0;\n r0 = r6.f38025b;\n r0 = r0 | 32;\n r6.f38025b = r0;\n goto L_0x0000;\n L_0x00b1:\n r0 = r7.m33563e();\n r6.f38034k = r0;\n r0 = r6.f38025b;\n r0 = r0 | 64;\n r6.f38025b = r0;\n goto L_0x0000;\n L_0x00bf:\n r0 = r6.f38035l;\n if (r0 != 0) goto L_0x00ca;\n L_0x00c3:\n r0 = new com.google.android.finsky.cv.a.cv;\n r0.<init>();\n r6.f38035l = r0;\n L_0x00ca:\n r0 = r6.f38035l;\n r7.m33552a(r0);\n goto L_0x0000;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.wireless.android.finsky.dfe.h.a.ae.b(com.google.protobuf.nano.a):com.google.wireless.android.finsky.dfe.h.a.ae\");\n }", "private void m6664w() {\n C0938a.m5002a(\"SR/SoundRecorder\", \"<onStop>,messageAddRecorder = \" + this.f5427l);\n if (this.f5427l) {\n C0938a.m5002a(\"SR/SoundRecorder\", \"<onStop>,mState = \" + this.f5435p);\n if (this.f5435p != 0) {\n m6604U();\n }\n }\n }", "public void onReceive(android.content.Context r1, android.content.Intent r2) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.1.onReceive(android.content.Context, android.content.Intent):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.1.onReceive(android.content.Context, android.content.Intent):void\");\n }", "private void m6597N() {\n C0938a.m5002a(\"SR/SoundRecorder\", \"<popClearDialogBox>\");\n String lowerCase = this.f5399S.mo6173f().getAbsolutePath().toLowerCase();\n if (this.f5419h) {\n C1492b.m7431a((Context) this, (CharSequence) getResources().getString(R.string.phone_mtp_space_expired_smartkey), 1).show();\n this.f5419h = false;\n }\n Intent intent = new Intent(\"com.iqoo.secure.LOW_MEMORY_WARNING\");\n intent.addFlags(268435456);\n intent.putExtra(\"require_size\", 5242880);\n intent.putExtra(\"pkg_name\", getPackageName());\n intent.putExtra(\"extra_loc\", 1);\n intent.putExtra(\"tips_title\", getResources().getString(R.string.manager_title));\n intent.putExtra(\"tips_title_all\", getResources().getString(R.string.unable_to_record));\n try {\n startActivity(intent);\n } catch (Exception unused) {\n Intent intent2 = new Intent();\n intent2.putExtra(\"BBKPhoneCardName\", lowerCase);\n intent2.setComponent(new ComponentName(\"com.android.filemanager\", \"com.android.filemanager.FileManagerActivity\"));\n startActivity(intent2);\n }\n }", "public final synchronized void zzdw(int r7) {\n /*\n r6 = this;\n monitor-enter(r6)\n if (r7 > 0) goto L_0x0005\n monitor-exit(r6)\n return\n L_0x0005:\n java.util.concurrent.TimeUnit r0 = java.util.concurrent.TimeUnit.SECONDS // Catch:{ all -> 0x0043 }\n long r1 = (long) r7 // Catch:{ all -> 0x0043 }\n long r0 = r0.toMillis(r1) // Catch:{ all -> 0x0043 }\n boolean r7 = r6.zzfol // Catch:{ all -> 0x0043 }\n if (r7 == 0) goto L_0x0025\n long r2 = r6.zzfpc // Catch:{ all -> 0x0043 }\n r4 = 0\n int r7 = (r2 > r4 ? 1 : (r2 == r4 ? 0 : -1))\n if (r7 <= 0) goto L_0x001f\n long r2 = r6.zzfpc // Catch:{ all -> 0x0043 }\n int r7 = (r0 > r2 ? 1 : (r0 == r2 ? 0 : -1))\n if (r7 >= 0) goto L_0x001f\n goto L_0x0021\n L_0x001f:\n long r0 = r6.zzfpc // Catch:{ all -> 0x0043 }\n L_0x0021:\n r6.zzfpc = r0 // Catch:{ all -> 0x0043 }\n monitor-exit(r6)\n return\n L_0x0025:\n com.google.android.gms.common.util.Clock r7 = r6.zzbqa // Catch:{ all -> 0x0043 }\n long r2 = r7.elapsedRealtime() // Catch:{ all -> 0x0043 }\n long r4 = r6.zzfpb // Catch:{ all -> 0x0043 }\n int r7 = (r2 > r4 ? 1 : (r2 == r4 ? 0 : -1))\n if (r7 > 0) goto L_0x003e\n long r2 = r6.zzfpb // Catch:{ all -> 0x0043 }\n com.google.android.gms.common.util.Clock r7 = r6.zzbqa // Catch:{ all -> 0x0043 }\n long r4 = r7.elapsedRealtime() // Catch:{ all -> 0x0043 }\n long r2 = r2 - r4\n int r7 = (r2 > r0 ? 1 : (r2 == r0 ? 0 : -1))\n if (r7 <= 0) goto L_0x0041\n L_0x003e:\n r6.zzfe(r0) // Catch:{ all -> 0x0043 }\n L_0x0041:\n monitor-exit(r6)\n return\n L_0x0043:\n r7 = move-exception\n monitor-exit(r6)\n throw r7\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.internal.ads.zzbwk.zzdw(int):void\");\n }", "public void m7211c() {\n /*\n r34 = this;\n r16 = 0;\n r15 = 0;\n r5 = 0;\n r0 = r34;\n r2 = r0.f4762f;\n r3 = \"MINOR_TYPE\";\n r2 = r2.get(r3);\n r2 = (java.lang.String) r2;\n r3 = -1;\n r4 = r2.hashCode();\n switch(r4) {\n case -1172269795: goto L_0x002e;\n case 2157948: goto L_0x0038;\n case 2571565: goto L_0x0024;\n default: goto L_0x0018;\n };\n L_0x0018:\n r2 = r3;\n L_0x0019:\n switch(r2) {\n case 0: goto L_0x0042;\n case 1: goto L_0x0162;\n case 2: goto L_0x01a9;\n default: goto L_0x001c;\n };\n L_0x001c:\n r2 = \"Undefined type\";\n r0 = r34;\n mobi.mmdt.componentsutils.p079a.p080a.C1104b.m6366b(r0, r2);\n L_0x0023:\n return;\n L_0x0024:\n r4 = \"TEXT\";\n r2 = r2.equals(r4);\n if (r2 == 0) goto L_0x0018;\n L_0x002c:\n r2 = 0;\n goto L_0x0019;\n L_0x002e:\n r4 = \"STICKER\";\n r2 = r2.equals(r4);\n if (r2 == 0) goto L_0x0018;\n L_0x0036:\n r2 = 1;\n goto L_0x0019;\n L_0x0038:\n r4 = \"FILE\";\n r2 = r2.equals(r4);\n if (r2 == 0) goto L_0x0018;\n L_0x0040:\n r2 = 2;\n goto L_0x0019;\n L_0x0042:\n r4 = mobi.mmdt.ott.provider.p169c.C1594n.TEXT;\n r33 = r5;\n L_0x0046:\n r8 = mobi.mmdt.componentsutils.p079a.p084e.C1113a.m6421a();\n r10 = mobi.mmdt.ott.provider.p169c.C1592l.IN;\n r0 = r34;\n r2 = r0.f4758b;\n r0 = r34;\n r3 = r0.f4757a;\n r3 = mobi.mmdt.ott.p109d.p111b.C1309a.m6934a(r3);\n r3 = r3.m6942b();\n r2 = r2.equals(r3);\n if (r2 == 0) goto L_0x0064;\n L_0x0062:\n r10 = mobi.mmdt.ott.provider.p169c.C1592l.OUT;\n L_0x0064:\n r0 = r34;\n r2 = r0.f4757a;\n r0 = r34;\n r3 = r0.f4761e;\n r2 = mobi.mmdt.ott.provider.p169c.C1583c.m7972a(r2, r3, r10);\n if (r2 != 0) goto L_0x0023;\n L_0x0072:\n r2 = mobi.mmdt.ott.MyApplication.m6445a();\n r2 = r2.f4177h;\n if (r2 == 0) goto L_0x008a;\n L_0x007a:\n r2 = mobi.mmdt.ott.MyApplication.m6445a();\n r2 = r2.f4177h;\n r0 = r34;\n r3 = r0.f4759c;\n r2 = r2.equals(r3);\n if (r2 != 0) goto L_0x024e;\n L_0x008a:\n r17 = 0;\n r0 = r34;\n r2 = r0.f4762f;\n r3 = \"REPLY_ON_MESSAGE_ID\";\n r2 = r2.get(r3);\n if (r2 == 0) goto L_0x00b8;\n L_0x0098:\n r0 = r34;\n r2 = r0.f4762f;\n r3 = \"REPLY_ON_MESSAGE_ID\";\n r2 = r2.get(r3);\n r2 = (java.lang.String) r2;\n r2 = r2.isEmpty();\n if (r2 != 0) goto L_0x00b8;\n L_0x00aa:\n r0 = r34;\n r2 = r0.f4762f;\n r3 = \"REPLY_ON_MESSAGE_ID\";\n r2 = r2.get(r3);\n r2 = (java.lang.String) r2;\n r17 = r2;\n L_0x00b8:\n r2 = new mobi.mmdt.ott.d.a.b;\n r0 = r34;\n r3 = r0.f4761e;\n r0 = r34;\n r5 = r0.f4760d;\n r0 = r34;\n r6 = r0.f4762f;\n r7 = \"SEND_TIME_IN_GMT\";\n r6 = r6.get(r7);\n r6 = (java.lang.String) r6;\n r6 = java.lang.Long.parseLong(r6);\n r11 = mobi.mmdt.ott.provider.p169c.C1593m.NOT_READ;\n r0 = r34;\n r12 = r0.f4759c;\n r13 = mobi.mmdt.ott.provider.p169c.C1595o.GROUP;\n r0 = r34;\n r14 = r0.f4758b;\n r2.<init>(r3, r4, r5, r6, r8, r10, r11, r12, r13, r14, r15, r16, r17);\n r0 = r34;\n r3 = r0.f4757a;\n r3 = mobi.mmdt.ott.logic.p157e.C1509a.m7621a(r3);\n r0 = r34;\n r4 = r0.f4762f;\n r0 = r33;\n r3.m7626a(r2, r0, r4);\n L_0x00f2:\n r0 = r34;\n r2 = r0.f4762f;\n r3 = \"REPLY_ON_MESSAGE_ID\";\n r2 = r2.get(r3);\n if (r2 == 0) goto L_0x013c;\n L_0x00fe:\n r0 = r34;\n r2 = r0.f4762f;\n r3 = \"REPLY_ON_MESSAGE_ID\";\n r2 = r2.get(r3);\n r2 = (java.lang.String) r2;\n r2 = r2.isEmpty();\n if (r2 != 0) goto L_0x013c;\n L_0x0110:\n r0 = r34;\n r2 = r0.f4762f;\n r3 = \"REPLY_ON_MESSAGE_ID\";\n r2 = r2.get(r3);\n r2 = (java.lang.String) r2;\n r0 = r34;\n r3 = r0.f4757a;\n r0 = r34;\n r4 = r0.f4761e;\n mobi.mmdt.ott.provider.p169c.C1583c.m7976b(r3, r4, r2);\n r0 = r34;\n r3 = r0.f4757a;\n r2 = mobi.mmdt.ott.provider.p169c.C1583c.m8003n(r3, r2);\n r0 = r34;\n r3 = r0.f4757a;\n r0 = r34;\n r4 = r0.f4761e;\n r5 = mobi.mmdt.ott.provider.p169c.C1595o.SINGLE;\n mobi.mmdt.ott.logic.p112a.p120c.p121a.p123b.C1387u.m7218a(r3, r4, r2, r5);\n L_0x013c:\n r0 = r34;\n r2 = r0.f4762f;\n r3 = \"MINOR_TYPE\";\n r2 = r2.get(r3);\n r2 = (java.lang.String) r2;\n r3 = \"TEXT\";\n r2 = r2.equals(r3);\n if (r2 != 0) goto L_0x0023;\n L_0x0150:\n r2 = new mobi.mmdt.ott.logic.a.c.a.b.b;\n r0 = r34;\n r3 = r0.f4757a;\n r0 = r34;\n r4 = r0.f4762f;\n r2.<init>(r3, r15, r4);\n mobi.mmdt.ott.logic.C1494c.m7541c(r2);\n goto L_0x0023;\n L_0x0162:\n r6 = mobi.mmdt.ott.provider.p169c.C1594n.STICKER;\n r0 = r34;\n r2 = r0.f4762f;\n r3 = \"STICKER_ID\";\n r2 = r2.get(r3);\n r2 = (java.lang.String) r2;\n r0 = r34;\n r3 = r0.f4762f;\n r4 = \"STICKER_PACKAGE_ID\";\n r3 = r3.get(r4);\n r3 = (java.lang.String) r3;\n r0 = r34;\n r4 = r0.f4762f;\n r7 = \"STICKER_VERSION\";\n r4 = r4.get(r7);\n r4 = (java.lang.String) r4;\n if (r4 == 0) goto L_0x02c9;\n L_0x018a:\n if (r2 == 0) goto L_0x02c9;\n L_0x018c:\n if (r3 == 0) goto L_0x02c9;\n L_0x018e:\n r7 = r4.isEmpty();\n if (r7 != 0) goto L_0x02c9;\n L_0x0194:\n r7 = r2.isEmpty();\n if (r7 != 0) goto L_0x02c9;\n L_0x019a:\n r7 = r3.isEmpty();\n if (r7 != 0) goto L_0x02c9;\n L_0x01a0:\n r16 = mobi.mmdt.ott.provider.p174h.C1629b.m8295a(r4, r3, r2);\n r33 = r5;\n r4 = r6;\n goto L_0x0046;\n L_0x01a9:\n r0 = r34;\n r2 = r0.f4762f;\n r3 = \"FILE_TYPE\";\n r2 = r2.get(r3);\n r2 = (java.lang.String) r2;\n r3 = -1;\n r4 = r2.hashCode();\n switch(r4) {\n case 327328941: goto L_0x01de;\n case 796404377: goto L_0x01ca;\n case 802160718: goto L_0x01e8;\n case 808293817: goto L_0x01d4;\n default: goto L_0x01bd;\n };\n L_0x01bd:\n r2 = r3;\n L_0x01be:\n switch(r2) {\n case 0: goto L_0x01f2;\n case 1: goto L_0x020c;\n case 2: goto L_0x0222;\n case 3: goto L_0x0238;\n default: goto L_0x01c1;\n };\n L_0x01c1:\n r2 = \"Undefined file type\";\n r0 = r34;\n mobi.mmdt.componentsutils.p079a.p080a.C1104b.m6366b(r0, r2);\n goto L_0x0023;\n L_0x01ca:\n r4 = \"FILE_TYPE_IMAGE\";\n r2 = r2.equals(r4);\n if (r2 == 0) goto L_0x01bd;\n L_0x01d2:\n r2 = 0;\n goto L_0x01be;\n L_0x01d4:\n r4 = \"FILE_TYPE_VIDEO\";\n r2 = r2.equals(r4);\n if (r2 == 0) goto L_0x01bd;\n L_0x01dc:\n r2 = 1;\n goto L_0x01be;\n L_0x01de:\n r4 = \"FILE_TYPE_PUSH_TO_TALK\";\n r2 = r2.equals(r4);\n if (r2 == 0) goto L_0x01bd;\n L_0x01e6:\n r2 = 2;\n goto L_0x01be;\n L_0x01e8:\n r4 = \"FILE_TYPE_OTHER\";\n r2 = r2.equals(r4);\n if (r2 == 0) goto L_0x01bd;\n L_0x01f0:\n r2 = 3;\n goto L_0x01be;\n L_0x01f2:\n r3 = mobi.mmdt.ott.provider.p169c.C1594n.IMAGE;\n r2 = new mobi.mmdt.ott.logic.a.c.a.b.h;\n r0 = r34;\n r4 = r0.f4757a;\n r0 = r34;\n r5 = r0.f4762f;\n r6 = mobi.mmdt.ott.provider.p170d.C1605j.IMAGE;\n r2.<init>(r4, r5, r6);\n r2 = r2.m7152a();\n L_0x0207:\n r33 = r2;\n r4 = r3;\n goto L_0x0046;\n L_0x020c:\n r3 = mobi.mmdt.ott.provider.p169c.C1594n.VIDEO;\n r2 = new mobi.mmdt.ott.logic.a.c.a.b.h;\n r0 = r34;\n r4 = r0.f4757a;\n r0 = r34;\n r5 = r0.f4762f;\n r6 = mobi.mmdt.ott.provider.p170d.C1605j.VIDEO;\n r2.<init>(r4, r5, r6);\n r2 = r2.m7152a();\n goto L_0x0207;\n L_0x0222:\n r3 = mobi.mmdt.ott.provider.p169c.C1594n.PUSH_TO_TALK;\n r2 = new mobi.mmdt.ott.logic.a.c.a.b.h;\n r0 = r34;\n r4 = r0.f4757a;\n r0 = r34;\n r5 = r0.f4762f;\n r6 = mobi.mmdt.ott.provider.p170d.C1605j.PUSH_TO_TALK;\n r2.<init>(r4, r5, r6);\n r2 = r2.m7152a();\n goto L_0x0207;\n L_0x0238:\n r3 = mobi.mmdt.ott.provider.p169c.C1594n.FILE;\n r2 = new mobi.mmdt.ott.logic.a.c.a.b.h;\n r0 = r34;\n r4 = r0.f4757a;\n r0 = r34;\n r5 = r0.f4762f;\n r6 = mobi.mmdt.ott.provider.p170d.C1605j.OTHER;\n r2.<init>(r4, r5, r6);\n r2 = r2.m7152a();\n goto L_0x0207;\n L_0x024e:\n if (r33 == 0) goto L_0x029c;\n L_0x0250:\n r0 = r34;\n r0 = r0.f4757a;\n r18 = r0;\n r19 = r33.m8082n();\n r20 = r33.m8069a();\n r21 = r33.m8079k();\n r22 = r33.m8073e();\n r23 = r33.m8078j();\n r24 = r33.m8077i();\n r26 = 0;\n r27 = r33.m8081m();\n r28 = r33.m8080l();\n r29 = r33.m8075g();\n r30 = r33.m8071c();\n r31 = r33.m8072d();\n r32 = r33.m8070b();\n r33 = r33.m8074f();\n r2 = mobi.mmdt.ott.provider.p170d.C1598c.m8100a(r18, r19, r20, r21, r22, r23, r24, r26, r27, r28, r29, r30, r31, r32, r33);\n r2 = r2.getLastPathSegment();\n r2 = java.lang.Long.parseLong(r2);\n r15 = java.lang.Long.valueOf(r2);\n L_0x029c:\n r0 = r34;\n r2 = r0.f4757a;\n r0 = r34;\n r3 = r0.f4761e;\n r0 = r34;\n r5 = r0.f4760d;\n r0 = r34;\n r6 = r0.f4762f;\n r7 = \"SEND_TIME_IN_GMT\";\n r6 = r6.get(r7);\n r6 = (java.lang.String) r6;\n r6 = java.lang.Long.parseLong(r6);\n r11 = mobi.mmdt.ott.provider.p169c.C1593m.READ;\n r0 = r34;\n r12 = r0.f4759c;\n r13 = mobi.mmdt.ott.provider.p169c.C1595o.GROUP;\n r0 = r34;\n r14 = r0.f4758b;\n mobi.mmdt.ott.provider.p169c.C1583c.m7966a(r2, r3, r4, r5, r6, r8, r10, r11, r12, r13, r14, r15, r16);\n goto L_0x00f2;\n L_0x02c9:\n r33 = r5;\n r4 = r6;\n goto L_0x0046;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: mobi.mmdt.ott.logic.a.c.a.b.s.c():void\");\n }", "public final synchronized void d() {\n /*\n r10 = this;\n monitor-enter(r10)\n android.content.Context r0 = r10.f // Catch:{ all -> 0x0053 }\n r1 = 0\n if (r0 != 0) goto L_0x0008\n r0 = 0\n goto L_0x000e\n L_0x0008:\n android.content.Context r0 = r10.f // Catch:{ all -> 0x0053 }\n int r0 = com.google.ads.interactivemedia.v3.internal.vf.a(r0) // Catch:{ all -> 0x0053 }\n L_0x000e:\n int r2 = r10.n // Catch:{ all -> 0x0053 }\n if (r2 != r0) goto L_0x0014\n monitor-exit(r10)\n return\n L_0x0014:\n r10.n = r0 // Catch:{ all -> 0x0053 }\n r2 = 1\n if (r0 == r2) goto L_0x0051\n if (r0 == 0) goto L_0x0051\n r2 = 8\n if (r0 != r2) goto L_0x0020\n goto L_0x0051\n L_0x0020:\n long r2 = r10.a(r0) // Catch:{ all -> 0x0053 }\n r10.q = r2 // Catch:{ all -> 0x0053 }\n com.google.ads.interactivemedia.v3.internal.ua r0 = r10.j // Catch:{ all -> 0x0053 }\n long r2 = r0.a() // Catch:{ all -> 0x0053 }\n int r0 = r10.k // Catch:{ all -> 0x0053 }\n if (r0 <= 0) goto L_0x0037\n long r0 = r10.l // Catch:{ all -> 0x0053 }\n long r0 = r2 - r0\n int r1 = (int) r0 // Catch:{ all -> 0x0053 }\n r5 = r1\n goto L_0x0038\n L_0x0037:\n r5 = 0\n L_0x0038:\n long r6 = r10.m // Catch:{ all -> 0x0053 }\n long r8 = r10.q // Catch:{ all -> 0x0053 }\n r4 = r10\n r4.a(r5, r6, r8) // Catch:{ all -> 0x0053 }\n r10.l = r2 // Catch:{ all -> 0x0053 }\n r0 = 0\n r10.m = r0 // Catch:{ all -> 0x0053 }\n r10.p = r0 // Catch:{ all -> 0x0053 }\n r10.o = r0 // Catch:{ all -> 0x0053 }\n com.google.ads.interactivemedia.v3.internal.ux r0 = r10.i // Catch:{ all -> 0x0053 }\n r0.a() // Catch:{ all -> 0x0053 }\n monitor-exit(r10)\n return\n L_0x0051:\n monitor-exit(r10)\n return\n L_0x0053:\n r0 = move-exception\n monitor-exit(r10)\n throw r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.ads.interactivemedia.v3.internal.ss.d():void\");\n }", "private final com.google.android.p306h.p307a.p308a.C5685v m26927b(com.google.protobuf.nano.a r7) {\n /*\n r6 = this;\n L_0x0000:\n r0 = r7.a();\n switch(r0) {\n case 0: goto L_0x000d;\n case 8: goto L_0x000e;\n case 18: goto L_0x0043;\n case 24: goto L_0x0054;\n case 32: goto L_0x005f;\n case 42: goto L_0x006a;\n default: goto L_0x0007;\n };\n L_0x0007:\n r0 = super.m4918a(r7, r0);\n if (r0 != 0) goto L_0x0000;\n L_0x000d:\n return r6;\n L_0x000e:\n r1 = r7.o();\n r2 = r7.i();\t Catch:{ IllegalArgumentException -> 0x0034 }\n switch(r2) {\n case 0: goto L_0x003c;\n case 1: goto L_0x003c;\n case 2: goto L_0x003c;\n case 3: goto L_0x003c;\n case 4: goto L_0x003c;\n case 5: goto L_0x003c;\n case 101: goto L_0x003c;\n case 102: goto L_0x003c;\n case 103: goto L_0x003c;\n case 104: goto L_0x003c;\n case 105: goto L_0x003c;\n case 106: goto L_0x003c;\n case 107: goto L_0x003c;\n case 108: goto L_0x003c;\n case 201: goto L_0x003c;\n case 202: goto L_0x003c;\n case 203: goto L_0x003c;\n case 204: goto L_0x003c;\n case 205: goto L_0x003c;\n case 206: goto L_0x003c;\n case 207: goto L_0x003c;\n case 208: goto L_0x003c;\n case 209: goto L_0x003c;\n case 301: goto L_0x003c;\n case 302: goto L_0x003c;\n case 303: goto L_0x003c;\n case 304: goto L_0x003c;\n case 305: goto L_0x003c;\n case 306: goto L_0x003c;\n case 307: goto L_0x003c;\n case 401: goto L_0x003c;\n case 402: goto L_0x003c;\n case 403: goto L_0x003c;\n case 404: goto L_0x003c;\n case 501: goto L_0x003c;\n case 502: goto L_0x003c;\n case 503: goto L_0x003c;\n case 504: goto L_0x003c;\n case 601: goto L_0x003c;\n case 602: goto L_0x003c;\n case 603: goto L_0x003c;\n case 604: goto L_0x003c;\n case 605: goto L_0x003c;\n case 606: goto L_0x003c;\n case 607: goto L_0x003c;\n case 608: goto L_0x003c;\n case 609: goto L_0x003c;\n case 610: goto L_0x003c;\n case 611: goto L_0x003c;\n case 612: goto L_0x003c;\n case 613: goto L_0x003c;\n case 614: goto L_0x003c;\n case 615: goto L_0x003c;\n case 616: goto L_0x003c;\n case 617: goto L_0x003c;\n case 618: goto L_0x003c;\n case 619: goto L_0x003c;\n case 620: goto L_0x003c;\n case 621: goto L_0x003c;\n case 622: goto L_0x003c;\n case 623: goto L_0x003c;\n case 624: goto L_0x003c;\n case 625: goto L_0x003c;\n case 626: goto L_0x003c;\n case 627: goto L_0x003c;\n case 628: goto L_0x003c;\n case 629: goto L_0x003c;\n case 630: goto L_0x003c;\n case 631: goto L_0x003c;\n case 632: goto L_0x003c;\n case 633: goto L_0x003c;\n case 634: goto L_0x003c;\n case 635: goto L_0x003c;\n case 636: goto L_0x003c;\n case 637: goto L_0x003c;\n case 638: goto L_0x003c;\n case 639: goto L_0x003c;\n case 640: goto L_0x003c;\n case 641: goto L_0x003c;\n case 701: goto L_0x003c;\n case 702: goto L_0x003c;\n case 703: goto L_0x003c;\n case 704: goto L_0x003c;\n case 705: goto L_0x003c;\n case 706: goto L_0x003c;\n case 707: goto L_0x003c;\n case 708: goto L_0x003c;\n case 709: goto L_0x003c;\n case 710: goto L_0x003c;\n case 711: goto L_0x003c;\n case 712: goto L_0x003c;\n case 713: goto L_0x003c;\n case 714: goto L_0x003c;\n case 715: goto L_0x003c;\n case 716: goto L_0x003c;\n case 717: goto L_0x003c;\n case 718: goto L_0x003c;\n case 719: goto L_0x003c;\n case 720: goto L_0x003c;\n case 721: goto L_0x003c;\n case 722: goto L_0x003c;\n case 801: goto L_0x003c;\n case 802: goto L_0x003c;\n case 803: goto L_0x003c;\n case 901: goto L_0x003c;\n case 902: goto L_0x003c;\n case 903: goto L_0x003c;\n case 904: goto L_0x003c;\n case 905: goto L_0x003c;\n case 906: goto L_0x003c;\n case 907: goto L_0x003c;\n case 908: goto L_0x003c;\n case 909: goto L_0x003c;\n case 910: goto L_0x003c;\n case 911: goto L_0x003c;\n case 912: goto L_0x003c;\n case 1001: goto L_0x003c;\n case 1002: goto L_0x003c;\n case 1003: goto L_0x003c;\n case 1004: goto L_0x003c;\n case 1005: goto L_0x003c;\n case 1006: goto L_0x003c;\n case 1101: goto L_0x003c;\n case 1102: goto L_0x003c;\n case 1201: goto L_0x003c;\n case 1301: goto L_0x003c;\n case 1302: goto L_0x003c;\n case 1303: goto L_0x003c;\n case 1304: goto L_0x003c;\n case 1305: goto L_0x003c;\n case 1306: goto L_0x003c;\n case 1307: goto L_0x003c;\n case 1308: goto L_0x003c;\n case 1309: goto L_0x003c;\n case 1310: goto L_0x003c;\n case 1311: goto L_0x003c;\n case 1312: goto L_0x003c;\n case 1313: goto L_0x003c;\n case 1314: goto L_0x003c;\n case 1315: goto L_0x003c;\n case 1316: goto L_0x003c;\n case 1317: goto L_0x003c;\n case 1318: goto L_0x003c;\n case 1319: goto L_0x003c;\n case 1320: goto L_0x003c;\n case 1321: goto L_0x003c;\n case 1322: goto L_0x003c;\n case 1323: goto L_0x003c;\n case 1324: goto L_0x003c;\n case 1325: goto L_0x003c;\n case 1326: goto L_0x003c;\n case 1327: goto L_0x003c;\n case 1328: goto L_0x003c;\n case 1329: goto L_0x003c;\n case 1330: goto L_0x003c;\n case 1331: goto L_0x003c;\n case 1332: goto L_0x003c;\n case 1333: goto L_0x003c;\n case 1334: goto L_0x003c;\n case 1335: goto L_0x003c;\n case 1336: goto L_0x003c;\n case 1337: goto L_0x003c;\n case 1338: goto L_0x003c;\n case 1339: goto L_0x003c;\n case 1340: goto L_0x003c;\n case 1341: goto L_0x003c;\n case 1342: goto L_0x003c;\n case 1343: goto L_0x003c;\n case 1344: goto L_0x003c;\n case 1345: goto L_0x003c;\n case 1346: goto L_0x003c;\n case 1347: goto L_0x003c;\n case 1401: goto L_0x003c;\n case 1402: goto L_0x003c;\n case 1403: goto L_0x003c;\n case 1404: goto L_0x003c;\n case 1405: goto L_0x003c;\n case 1406: goto L_0x003c;\n case 1407: goto L_0x003c;\n case 1408: goto L_0x003c;\n case 1409: goto L_0x003c;\n case 1410: goto L_0x003c;\n case 1411: goto L_0x003c;\n case 1412: goto L_0x003c;\n case 1413: goto L_0x003c;\n case 1414: goto L_0x003c;\n case 1415: goto L_0x003c;\n case 1416: goto L_0x003c;\n case 1417: goto L_0x003c;\n case 1418: goto L_0x003c;\n case 1419: goto L_0x003c;\n case 1420: goto L_0x003c;\n case 1421: goto L_0x003c;\n case 1422: goto L_0x003c;\n case 1423: goto L_0x003c;\n case 1424: goto L_0x003c;\n case 1425: goto L_0x003c;\n case 1426: goto L_0x003c;\n case 1427: goto L_0x003c;\n case 1601: goto L_0x003c;\n case 1602: goto L_0x003c;\n case 1603: goto L_0x003c;\n case 1604: goto L_0x003c;\n case 1605: goto L_0x003c;\n case 1606: goto L_0x003c;\n case 1607: goto L_0x003c;\n case 1608: goto L_0x003c;\n case 1609: goto L_0x003c;\n case 1610: goto L_0x003c;\n case 1611: goto L_0x003c;\n case 1612: goto L_0x003c;\n case 1613: goto L_0x003c;\n case 1614: goto L_0x003c;\n case 1615: goto L_0x003c;\n case 1616: goto L_0x003c;\n case 1617: goto L_0x003c;\n case 1618: goto L_0x003c;\n case 1619: goto L_0x003c;\n case 1620: goto L_0x003c;\n case 1621: goto L_0x003c;\n case 1622: goto L_0x003c;\n case 1623: goto L_0x003c;\n case 1624: goto L_0x003c;\n case 1625: goto L_0x003c;\n case 1626: goto L_0x003c;\n case 1627: goto L_0x003c;\n case 1628: goto L_0x003c;\n case 1629: goto L_0x003c;\n case 1630: goto L_0x003c;\n case 1631: goto L_0x003c;\n case 1632: goto L_0x003c;\n case 1633: goto L_0x003c;\n case 1634: goto L_0x003c;\n case 1635: goto L_0x003c;\n case 1636: goto L_0x003c;\n case 1637: goto L_0x003c;\n case 1638: goto L_0x003c;\n case 1639: goto L_0x003c;\n case 1640: goto L_0x003c;\n case 1641: goto L_0x003c;\n case 1642: goto L_0x003c;\n case 1643: goto L_0x003c;\n case 1644: goto L_0x003c;\n case 1645: goto L_0x003c;\n case 1646: goto L_0x003c;\n case 1647: goto L_0x003c;\n case 1648: goto L_0x003c;\n case 1649: goto L_0x003c;\n case 1650: goto L_0x003c;\n case 1651: goto L_0x003c;\n case 1652: goto L_0x003c;\n case 1653: goto L_0x003c;\n case 1654: goto L_0x003c;\n case 1655: goto L_0x003c;\n case 1656: goto L_0x003c;\n case 1657: goto L_0x003c;\n case 1658: goto L_0x003c;\n case 1659: goto L_0x003c;\n case 1660: goto L_0x003c;\n case 1801: goto L_0x003c;\n case 1802: goto L_0x003c;\n case 1803: goto L_0x003c;\n case 1804: goto L_0x003c;\n case 1805: goto L_0x003c;\n case 1806: goto L_0x003c;\n case 1807: goto L_0x003c;\n case 1808: goto L_0x003c;\n case 1809: goto L_0x003c;\n case 1810: goto L_0x003c;\n case 1811: goto L_0x003c;\n case 1812: goto L_0x003c;\n case 1813: goto L_0x003c;\n case 1814: goto L_0x003c;\n case 1815: goto L_0x003c;\n case 1816: goto L_0x003c;\n case 1817: goto L_0x003c;\n case 1901: goto L_0x003c;\n case 1902: goto L_0x003c;\n case 1903: goto L_0x003c;\n case 1904: goto L_0x003c;\n case 1905: goto L_0x003c;\n case 1906: goto L_0x003c;\n case 1907: goto L_0x003c;\n case 1908: goto L_0x003c;\n case 1909: goto L_0x003c;\n case 2001: goto L_0x003c;\n case 2101: goto L_0x003c;\n case 2102: goto L_0x003c;\n case 2103: goto L_0x003c;\n case 2104: goto L_0x003c;\n case 2105: goto L_0x003c;\n case 2106: goto L_0x003c;\n case 2107: goto L_0x003c;\n case 2108: goto L_0x003c;\n case 2109: goto L_0x003c;\n case 2110: goto L_0x003c;\n case 2111: goto L_0x003c;\n case 2112: goto L_0x003c;\n case 2113: goto L_0x003c;\n case 2114: goto L_0x003c;\n case 2115: goto L_0x003c;\n case 2116: goto L_0x003c;\n case 2117: goto L_0x003c;\n case 2118: goto L_0x003c;\n case 2119: goto L_0x003c;\n case 2120: goto L_0x003c;\n case 2121: goto L_0x003c;\n case 2122: goto L_0x003c;\n case 2123: goto L_0x003c;\n case 2124: goto L_0x003c;\n case 2201: goto L_0x003c;\n case 2202: goto L_0x003c;\n case 2203: goto L_0x003c;\n case 2204: goto L_0x003c;\n case 2205: goto L_0x003c;\n case 2206: goto L_0x003c;\n case 2207: goto L_0x003c;\n case 2208: goto L_0x003c;\n case 2209: goto L_0x003c;\n case 2210: goto L_0x003c;\n case 2211: goto L_0x003c;\n case 2212: goto L_0x003c;\n case 2213: goto L_0x003c;\n case 2214: goto L_0x003c;\n case 2215: goto L_0x003c;\n case 2301: goto L_0x003c;\n case 2302: goto L_0x003c;\n case 2303: goto L_0x003c;\n case 2304: goto L_0x003c;\n case 2401: goto L_0x003c;\n case 2402: goto L_0x003c;\n case 2501: goto L_0x003c;\n case 2502: goto L_0x003c;\n case 2503: goto L_0x003c;\n case 2504: goto L_0x003c;\n case 2505: goto L_0x003c;\n case 2506: goto L_0x003c;\n case 2507: goto L_0x003c;\n case 2508: goto L_0x003c;\n case 2509: goto L_0x003c;\n case 2510: goto L_0x003c;\n case 2511: goto L_0x003c;\n case 2512: goto L_0x003c;\n case 2513: goto L_0x003c;\n case 2514: goto L_0x003c;\n case 2515: goto L_0x003c;\n case 2516: goto L_0x003c;\n case 2517: goto L_0x003c;\n case 2518: goto L_0x003c;\n case 2519: goto L_0x003c;\n case 2601: goto L_0x003c;\n case 2602: goto L_0x003c;\n case 2701: goto L_0x003c;\n case 2702: goto L_0x003c;\n case 2703: goto L_0x003c;\n case 2704: goto L_0x003c;\n case 2705: goto L_0x003c;\n case 2706: goto L_0x003c;\n case 2707: goto L_0x003c;\n case 2801: goto L_0x003c;\n case 2802: goto L_0x003c;\n case 2803: goto L_0x003c;\n case 2804: goto L_0x003c;\n case 2805: goto L_0x003c;\n case 2806: goto L_0x003c;\n case 2807: goto L_0x003c;\n case 2808: goto L_0x003c;\n case 2809: goto L_0x003c;\n case 2810: goto L_0x003c;\n case 2811: goto L_0x003c;\n case 2812: goto L_0x003c;\n case 2813: goto L_0x003c;\n case 2814: goto L_0x003c;\n case 2815: goto L_0x003c;\n case 2816: goto L_0x003c;\n case 2817: goto L_0x003c;\n case 2818: goto L_0x003c;\n case 2819: goto L_0x003c;\n case 2820: goto L_0x003c;\n case 2821: goto L_0x003c;\n case 2822: goto L_0x003c;\n case 2823: goto L_0x003c;\n case 2824: goto L_0x003c;\n case 2825: goto L_0x003c;\n case 2826: goto L_0x003c;\n case 2901: goto L_0x003c;\n case 2902: goto L_0x003c;\n case 2903: goto L_0x003c;\n case 2904: goto L_0x003c;\n case 2905: goto L_0x003c;\n case 2906: goto L_0x003c;\n case 2907: goto L_0x003c;\n case 3001: goto L_0x003c;\n case 3002: goto L_0x003c;\n case 3003: goto L_0x003c;\n case 3004: goto L_0x003c;\n case 3005: goto L_0x003c;\n default: goto L_0x0019;\n };\t Catch:{ IllegalArgumentException -> 0x0034 }\n L_0x0019:\n r3 = new java.lang.IllegalArgumentException;\t Catch:{ IllegalArgumentException -> 0x0034 }\n r4 = 41;\n r5 = new java.lang.StringBuilder;\t Catch:{ IllegalArgumentException -> 0x0034 }\n r5.<init>(r4);\t Catch:{ IllegalArgumentException -> 0x0034 }\n r2 = r5.append(r2);\t Catch:{ IllegalArgumentException -> 0x0034 }\n r4 = \" is not a valid enum EventType\";\n r2 = r2.append(r4);\t Catch:{ IllegalArgumentException -> 0x0034 }\n r2 = r2.toString();\t Catch:{ IllegalArgumentException -> 0x0034 }\n r3.<init>(r2);\t Catch:{ IllegalArgumentException -> 0x0034 }\n throw r3;\t Catch:{ IllegalArgumentException -> 0x0034 }\n L_0x0034:\n r2 = move-exception;\n r7.e(r1);\n r6.m4918a(r7, r0);\n goto L_0x0000;\n L_0x003c:\n r2 = java.lang.Integer.valueOf(r2);\t Catch:{ IllegalArgumentException -> 0x0034 }\n r6.f28837a = r2;\t Catch:{ IllegalArgumentException -> 0x0034 }\n goto L_0x0000;\n L_0x0043:\n r0 = r6.f28838b;\n if (r0 != 0) goto L_0x004e;\n L_0x0047:\n r0 = new com.google.android.h.a.a.u;\n r0.<init>();\n r6.f28838b = r0;\n L_0x004e:\n r0 = r6.f28838b;\n r7.a(r0);\n goto L_0x0000;\n L_0x0054:\n r0 = r7.j();\n r0 = java.lang.Long.valueOf(r0);\n r6.f28839c = r0;\n goto L_0x0000;\n L_0x005f:\n r0 = r7.j();\n r0 = java.lang.Long.valueOf(r0);\n r6.f28840d = r0;\n goto L_0x0000;\n L_0x006a:\n r0 = r6.f28841e;\n if (r0 != 0) goto L_0x0075;\n L_0x006e:\n r0 = new com.google.android.h.a.a.o;\n r0.<init>();\n r6.f28841e = r0;\n L_0x0075:\n r0 = r6.f28841e;\n r7.a(r0);\n goto L_0x0000;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.h.a.a.v.b(com.google.protobuf.nano.a):com.google.android.h.a.a.v\");\n }", "private void m29985m() {\n String str = \"com.tencent.android.tpush.service.channel.heartbeatIntent\";\n String str2 = \"TpnsChannel\";\n try {\n if (this.f23299z == null) {\n C6973b.m29776f().registerReceiver(new BroadcastReceiver() {\n public void onReceive(Context context, Intent intent) {\n C7005b.m29964a().m29983k();\n }\n }, new IntentFilter(str));\n this.f23299z = PendingIntent.getBroadcast(C6973b.m29776f(), 0, new Intent(str), 134217728);\n }\n long currentTimeMillis = System.currentTimeMillis();\n if (f23279n > f23278m) {\n f23279n = f23278m;\n }\n if (XGPushConfig.isForeignWeakAlarmMode(C6973b.m29776f())) {\n StringBuilder sb = new StringBuilder();\n sb.append(\"scheduleHeartbeat WaekAlarmMode heartbeatinterval: \");\n sb.append(f23280o);\n sb.append(\" ms\");\n C6864a.m29305f(str2, sb.toString());\n f23279n = f23280o;\n }\n f23279n = C7055h.m30166a(C6973b.m29776f(), \"com.tencent.android.xg.wx.HeartbeatIntervalMs\", f23279n);\n C7045d.m30117a().mo34149a(0, currentTimeMillis + ((long) f23279n), this.f23299z);\n } catch (Throwable th) {\n C6864a.m29302d(str2, \"scheduleHeartbeat error\", th);\n }\n }", "@Override\n public void onMachineBroken()\n {\n \n }", "private void m11061a(com.bigroad.ttb.android.vehicle.C2338a r7, long r8, java.util.ArrayList<com.bigroad.ttb.android.status.C2265b> r10) {\n /*\n r6 = this;\n r4 = 10000; // 0x2710 float:1.4013E-41 double:4.9407E-320;\n if (r7 == 0) goto L_0x000c;\n L_0x0004:\n r0 = com.bigroad.shared.eobr.ConnectionSetupFlag.REQUIRED;\n r0 = r7.m11451a(r0);\n if (r0 != 0) goto L_0x000d;\n L_0x000c:\n return;\n L_0x000d:\n r0 = com.bigroad.shared.eobr.ConnectionSetupFlag.CORRUPTED;\n r0 = r7.m11451a(r0);\n if (r0 == 0) goto L_0x002d;\n L_0x0015:\n r0 = com.bigroad.shared.eobr.ConnectionSetupFlag.CORRUPTED;\n r0 = r7.m11454b(r0);\n if (r0 == 0) goto L_0x0124;\n L_0x001d:\n r0 = r0.longValue();\n r2 = 20000; // 0x4e20 float:2.8026E-41 double:9.8813E-320;\n r0 = r0 + r2;\n r2 = (r0 > r8 ? 1 : (r0 == r8 ? 0 : -1));\n if (r2 <= 0) goto L_0x0124;\n L_0x0028:\n r2 = com.bigroad.ttb.android.status.messages.DashLinkStatusMessages.VAR_DATA_CORRUPTED;\n r6.m11060a(r2, r0, r10);\n L_0x002d:\n r0 = com.bigroad.shared.eobr.ConnectionFlag.CONNECTED;\n r0 = r7.m11450a(r0);\n if (r0 == 0) goto L_0x00e5;\n L_0x0035:\n r0 = com.bigroad.shared.eobr.ConnectionSetupFlag.TURBO_FIRMWARE_UPDATING;\n r0 = r7.m11451a(r0);\n if (r0 == 0) goto L_0x0042;\n L_0x003d:\n r0 = com.bigroad.ttb.android.status.messages.DashLinkStatusMessages.TURBO_FIRMWARE_UPDATING;\n r6.m11060a(r0, r8, r10);\n L_0x0042:\n r0 = com.bigroad.shared.eobr.ConnectionSetupFlag.FIRMWARE_INCOMPATIBLE;\n r0 = r7.m11451a(r0);\n if (r0 == 0) goto L_0x004f;\n L_0x004a:\n r0 = com.bigroad.ttb.android.status.messages.DashLinkStatusMessages.FIRMWARE_NOT_COMPATIBLE;\n r6.m11060a(r0, r8, r10);\n L_0x004f:\n r0 = com.bigroad.shared.eobr.ConnectionSetupFlag.FIRMWARE_DETECTING;\n r0 = r7.m11451a(r0);\n if (r0 == 0) goto L_0x006d;\n L_0x0057:\n r0 = com.bigroad.shared.eobr.ConnectionSetupFlag.FIRMWARE_DETECTING;\n r0 = r7.m11454b(r0);\n if (r0 == 0) goto L_0x0121;\n L_0x005f:\n r0 = r0.longValue();\n r0 = r0 + r4;\n r2 = (r0 > r8 ? 1 : (r0 == r8 ? 0 : -1));\n if (r2 <= 0) goto L_0x0121;\n L_0x0068:\n r2 = com.bigroad.ttb.android.status.messages.DashLinkStatusMessages.FIRMWARE_DETECTING;\n r6.m11060a(r2, r0, r10);\n L_0x006d:\n r0 = com.bigroad.shared.eobr.ConnectionFlag.CURRENT;\n r0 = r7.m11450a(r0);\n if (r0 == 0) goto L_0x00d2;\n L_0x0075:\n r0 = com.bigroad.shared.eobr.ConnectionFlag.EOBR_TYPE_MATCH;\n r0 = r7.m11450a(r0);\n if (r0 != 0) goto L_0x0082;\n L_0x007d:\n r0 = com.bigroad.ttb.android.status.messages.DashLinkStatusMessages.WRONG_EOBR_TYPE;\n r6.m11060a(r0, r8, r10);\n L_0x0082:\n r0 = com.bigroad.shared.eobr.ConnectionFlag.ODOMETER_READINGS_VALID;\n r0 = r7.m11450a(r0);\n if (r0 != 0) goto L_0x008f;\n L_0x008a:\n r0 = com.bigroad.ttb.android.status.messages.DashLinkStatusMessages.NO_ODOMETER;\n r6.m11060a(r0, r8, r10);\n L_0x008f:\n r0 = com.bigroad.shared.eobr.ConnectionFlag.ODOMETER_CALIBRATED;\n r0 = r7.m11450a(r0);\n if (r0 != 0) goto L_0x009c;\n L_0x0097:\n r0 = com.bigroad.ttb.android.status.messages.DashLinkStatusMessages.UNCALIBRATED_ODOMETER;\n r6.m11060a(r0, r8, r10);\n L_0x009c:\n r0 = com.bigroad.shared.eobr.ConnectionFlag.ABSOLUTE_TIMESTAMP;\n r0 = r7.m11450a(r0);\n if (r0 != 0) goto L_0x00b7;\n L_0x00a4:\n r0 = r6.f7779m;\n if (r0 == 0) goto L_0x00b7;\n L_0x00a8:\n r0 = r6.f7779m;\n r0 = r0.mo1121o();\n r1 = com.bigroad.shared.eobr.EobrType.TURBO;\n if (r0 != r1) goto L_0x00b7;\n L_0x00b2:\n r0 = com.bigroad.ttb.android.status.messages.DashLinkStatusMessages.WAITING_FOR_TURBO_GPS;\n r6.m11060a(r0, r8, r10);\n L_0x00b7:\n r0 = r7.m11449a();\n if (r0 == 0) goto L_0x00c2;\n L_0x00bd:\n r0 = com.bigroad.ttb.android.status.messages.DashLinkStatusMessages.RECONNECTING;\n r6.m11060a(r0, r8, r10);\n L_0x00c2:\n r0 = r6.f7780n;\n if (r0 != 0) goto L_0x00cb;\n L_0x00c6:\n r0 = com.bigroad.ttb.android.status.messages.DashLinkStatusMessages.CONNECTED_NOT_PLUGGED_IN;\n r6.m11060a(r0, r8, r10);\n L_0x00cb:\n r0 = com.bigroad.ttb.android.status.messages.DashLinkStatusMessages.CONNECTED;\n r6.m11060a(r0, r8, r10);\n goto L_0x000c;\n L_0x00d2:\n r0 = com.bigroad.shared.eobr.ConnectionFlag.CONNECTED;\n r0 = r7.m11453b(r0);\n if (r0 == 0) goto L_0x00b7;\n L_0x00da:\n r0 = r0.longValue();\n r0 = r0 + r4;\n r2 = com.bigroad.ttb.android.status.messages.DashLinkStatusMessages.NOT_CURRENT;\n r6.m11060a(r2, r0, r10);\n goto L_0x00b7;\n L_0x00e5:\n r0 = com.bigroad.shared.eobr.ConnectionSetupFlag.SEARCHING;\n r0 = r7.m11451a(r0);\n if (r0 == 0) goto L_0x00f2;\n L_0x00ed:\n r0 = com.bigroad.ttb.android.status.messages.DashLinkStatusMessages.SEARCHING;\n r6.m11060a(r0, r8, r10);\n L_0x00f2:\n r0 = com.bigroad.ttb.android.status.p031a.C2242a.C22408.f7760b;\n r1 = r7.m11455c();\n r1 = r1.ordinal();\n r0 = r0[r1];\n switch(r0) {\n case 1: goto L_0x0103;\n case 2: goto L_0x010a;\n case 3: goto L_0x0113;\n case 4: goto L_0x011a;\n default: goto L_0x0101;\n };\n L_0x0101:\n goto L_0x000c;\n L_0x0103:\n r0 = com.bigroad.ttb.android.status.messages.DashLinkStatusMessages.NO_VIN_SPECIFIED;\n r6.m11060a(r0, r8, r10);\n goto L_0x000c;\n L_0x010a:\n r0 = com.bigroad.ttb.android.status.messages.DashLinkStatusMessages.BLUETOOTH_DISABLED;\n r2 = 0;\n r6.m11060a(r0, r2, r10);\n goto L_0x000c;\n L_0x0113:\n r0 = com.bigroad.ttb.android.status.messages.DashLinkStatusMessages.BLUETOOTH_UNSUPPORTED;\n r6.m11060a(r0, r8, r10);\n goto L_0x000c;\n L_0x011a:\n r0 = com.bigroad.ttb.android.status.messages.DashLinkStatusMessages.DISCONNECTED;\n r6.m11060a(r0, r8, r10);\n goto L_0x000c;\n L_0x0121:\n r0 = r8;\n goto L_0x0068;\n L_0x0124:\n r0 = r8;\n goto L_0x0028;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.bigroad.ttb.android.status.a.a.a(com.bigroad.ttb.android.vehicle.a, long, java.util.ArrayList):void\");\n }", "public static void m9742a(Context context) {\n if (zzaoe.m9985a(context) && !zzaoe.m9989b()) {\n zzapi zzapi = (zzapi) new cy(context).mo2219c();\n zzaok.m10005d(\"Updating ad debug logging enablement.\");\n zzaov.m10017a(zzapi, \"AdDebugLogUpdater.updateEnablement\");\n }\n }", "public static boolean a(android.content.Context r4, byte[] r5) {\n /*\n r1 = d;\n r0 = 0;\n L_0x0003:\n r2 = c();\t Catch:{ Exception -> 0x003a }\n if (r2 != 0) goto L_0x0010;\n L_0x0009:\n r2 = e;\t Catch:{ Exception -> 0x003a }\n r2.block();\t Catch:{ Exception -> 0x003a }\n if (r1 == 0) goto L_0x0003;\n L_0x0010:\n r1 = z;\t Catch:{ Exception -> 0x003a }\n r2 = 22;\n r1 = r1[r2];\t Catch:{ Exception -> 0x003a }\n com.whatsapp.util.Log.i(r1);\t Catch:{ Exception -> 0x003a }\n r1 = com.whatsapp.contact.o.NOTIFICATION_DELTA;\t Catch:{ Exception -> 0x003a }\n r0 = a(r4, r1, r5);\t Catch:{ Exception -> 0x003a }\n r1 = b();\t Catch:{ Exception -> 0x0038 }\n if (r1 != 0) goto L_0x002e;\n L_0x0025:\n r1 = z;\t Catch:{ Exception -> 0x0038 }\n r2 = 16;\n r1 = r1[r2];\t Catch:{ Exception -> 0x0038 }\n com.whatsapp.util.Log.e(r1);\t Catch:{ Exception -> 0x0038 }\n L_0x002e:\n r1 = z;\n r2 = 18;\n r1 = r1[r2];\n com.whatsapp.util.Log.i(r1);\n L_0x0037:\n return r0;\n L_0x0038:\n r0 = move-exception;\n throw r0;\n L_0x003a:\n r1 = move-exception;\n r2 = z;\t Catch:{ all -> 0x005d }\n r3 = 20;\n r2 = r2[r3];\t Catch:{ all -> 0x005d }\n com.whatsapp.util.Log.b(r2, r1);\t Catch:{ all -> 0x005d }\n r1 = b();\n if (r1 != 0) goto L_0x0053;\n L_0x004a:\n r1 = z;\n r2 = 19;\n r1 = r1[r2];\n com.whatsapp.util.Log.e(r1);\n L_0x0053:\n r1 = z;\n r2 = 23;\n r1 = r1[r2];\n com.whatsapp.util.Log.i(r1);\n goto L_0x0037;\n L_0x005d:\n r0 = move-exception;\n r1 = b();\t Catch:{ Exception -> 0x0077 }\n if (r1 != 0) goto L_0x006d;\n L_0x0064:\n r1 = z;\t Catch:{ Exception -> 0x0077 }\n r2 = 21;\n r1 = r1[r2];\t Catch:{ Exception -> 0x0077 }\n com.whatsapp.util.Log.e(r1);\t Catch:{ Exception -> 0x0077 }\n L_0x006d:\n r1 = z;\n r2 = 17;\n r1 = r1[r2];\n com.whatsapp.util.Log.i(r1);\n throw r0;\n L_0x0077:\n r0 = move-exception;\n throw r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.whatsapp.contact.i.a(android.content.Context, byte[]):boolean\");\n }", "@Override\n public void onFailure(int code, String msg) {\n Log.i(\"bmob\",\"设备信息更新失败:\"+msg);\n }", "public void uncaughtException(java.lang.Thread r11, java.lang.Throwable r12) {\n /*\n r10 = this;\n setJavaThreadCrashed()\n boolean r0 = com.zipow.videobox.mainboard.Mainboard.isNativeCrashed()\n if (r0 == 0) goto L_0x0011\n java.lang.Thread$UncaughtExceptionHandler r0 = r10.mNextHandler\n if (r0 == 0) goto L_0x0010\n r0.uncaughtException(r11, r12)\n L_0x0010:\n return\n L_0x0011:\n boolean r0 = r12 instanceof java.lang.UnsatisfiedLinkError\n if (r0 != 0) goto L_0x028e\n boolean r0 = r12 instanceof android.database.sqlite.SQLiteDiskIOException\n if (r0 == 0) goto L_0x001b\n goto L_0x028e\n L_0x001b:\n com.zipow.videobox.VideoBoxApplication r0 = com.zipow.videobox.VideoBoxApplication.getInstance()\n boolean r0 = r0.isConfApp()\n if (r0 == 0) goto L_0x0052\n us.zoom.androidlib.app.ZMActivity r0 = p021us.zoom.androidlib.app.ZMActivity.getFrontActivity()\n com.zipow.videobox.confapp.ConfUI r1 = com.zipow.videobox.confapp.ConfUI.getInstance()\n boolean r1 = r1.isLeaveComplete()\n if (r1 != 0) goto L_0x0043\n boolean r1 = r0 instanceof com.zipow.videobox.ConfActivity\n if (r1 == 0) goto L_0x0052\n boolean r1 = r0.isFinishing()\n if (r1 != 0) goto L_0x0043\n boolean r0 = p021us.zoom.androidlib.app.ZMActivity.isActivityDestroyed(r0)\n if (r0 == 0) goto L_0x0052\n L_0x0043:\n java.lang.String r11 = TAG\n java.lang.String r0 = \"\"\n android.util.Log.e(r11, r0, r12)\n com.zipow.videobox.VideoBoxApplication r11 = com.zipow.videobox.VideoBoxApplication.getInstance()\n r11.stopConfService()\n return\n L_0x0052:\n int r0 = android.os.Process.myPid()\n com.zipow.videobox.VideoBoxApplication r1 = com.zipow.videobox.VideoBoxApplication.getInstance()\n boolean r1 = r1.isConfApp()\n if (r1 == 0) goto L_0x0063\n java.lang.String r1 = \"zVideoApp\"\n goto L_0x0065\n L_0x0063:\n java.lang.String r1 = \"zChatApp\"\n L_0x0065:\n com.zipow.videobox.VideoBoxApplication r2 = com.zipow.videobox.VideoBoxApplication.getInstance()\n boolean r2 = com.zipow.videobox.util.ZMUtils.isItuneApp(r2)\n if (r2 == 0) goto L_0x0080\n java.lang.StringBuilder r2 = new java.lang.StringBuilder\n r2.<init>()\n r2.append(r1)\n java.lang.String r1 = \"-intune\"\n r2.append(r1)\n java.lang.String r1 = r2.toString()\n L_0x0080:\n java.lang.String r2 = \"java-\"\n boolean r3 = r12 instanceof com.zipow.videobox.stabilility.NativeCrashException\n if (r3 == 0) goto L_0x0088\n java.lang.String r2 = \"native-zmdump-\"\n L_0x0088:\n java.lang.StringBuilder r4 = new java.lang.StringBuilder\n r4.<init>()\n java.lang.String r5 = \"crash-\"\n r4.append(r5)\n r4.append(r2)\n java.lang.String r4 = r4.toString()\n java.lang.StringBuilder r5 = new java.lang.StringBuilder\n r5.<init>()\n java.lang.String r6 = \"-\"\n r5.append(r6)\n r5.append(r1)\n java.lang.String r1 = \"-\"\n r5.append(r1)\n r5.append(r0)\n java.lang.String r0 = \".log\"\n r5.append(r0)\n java.lang.String r0 = r5.toString()\n r1 = 5\n long r5 = java.lang.System.currentTimeMillis()\n java.io.File r0 = com.zipow.videobox.util.LogUtil.getNewLogFile(r4, r0, r1, r5)\n if (r0 != 0) goto L_0x00ca\n java.lang.Thread$UncaughtExceptionHandler r0 = r10.mNextHandler\n if (r0 == 0) goto L_0x00c9\n r0.uncaughtException(r11, r12)\n L_0x00c9:\n return\n L_0x00ca:\n r1 = 0\n boolean r4 = com.zipow.cmmlib.AppContext.BAASecurity_IsEnabled() // Catch:{ Exception -> 0x0192, all -> 0x018e }\n com.zipow.videobox.VideoBoxApplication r5 = com.zipow.videobox.VideoBoxApplication.getInstance() // Catch:{ Exception -> 0x0192, all -> 0x018e }\n boolean r5 = r5.isConfApp() // Catch:{ Exception -> 0x0192, all -> 0x018e }\n if (r5 == 0) goto L_0x00de\n com.zipow.videobox.stabilility.JavaCrashHandler$1 r5 = new com.zipow.videobox.stabilility.JavaCrashHandler$1 // Catch:{ Exception -> 0x0192, all -> 0x018e }\n r5.<init>() // Catch:{ Exception -> 0x0192, all -> 0x018e }\n L_0x00de:\n java.io.PrintStream r5 = new java.io.PrintStream // Catch:{ Exception -> 0x0192, all -> 0x018e }\n r5.<init>(r0) // Catch:{ Exception -> 0x0192, all -> 0x018e }\n java.lang.StringBuilder r6 = new java.lang.StringBuilder // Catch:{ Exception -> 0x0193 }\n r6.<init>() // Catch:{ Exception -> 0x0193 }\n java.lang.String r7 = \"version: \"\n r6.append(r7) // Catch:{ Exception -> 0x0193 }\n com.zipow.videobox.VideoBoxApplication r7 = com.zipow.videobox.VideoBoxApplication.getInstance() // Catch:{ Exception -> 0x0193 }\n java.lang.String r7 = r7.getVersionName() // Catch:{ Exception -> 0x0193 }\n r6.append(r7) // Catch:{ Exception -> 0x0193 }\n java.lang.String r6 = r6.toString() // Catch:{ Exception -> 0x0193 }\n r5.println(r6) // Catch:{ Exception -> 0x0193 }\n java.lang.StringBuilder r6 = new java.lang.StringBuilder // Catch:{ Exception -> 0x0193 }\n r6.<init>() // Catch:{ Exception -> 0x0193 }\n java.lang.String r7 = \"Kernel Version: \"\n r6.append(r7) // Catch:{ Exception -> 0x0193 }\n com.zipow.videobox.VideoBoxApplication r7 = com.zipow.videobox.VideoBoxApplication.getInstance() // Catch:{ Exception -> 0x0193 }\n java.lang.String r7 = r7.getKernelVersion() // Catch:{ Exception -> 0x0193 }\n r6.append(r7) // Catch:{ Exception -> 0x0193 }\n java.lang.String r6 = r6.toString() // Catch:{ Exception -> 0x0193 }\n r5.println(r6) // Catch:{ Exception -> 0x0193 }\n java.lang.StringBuilder r6 = new java.lang.StringBuilder // Catch:{ Exception -> 0x0193 }\n r6.<init>() // Catch:{ Exception -> 0x0193 }\n java.lang.String r7 = \"OS: \"\n r6.append(r7) // Catch:{ Exception -> 0x0193 }\n java.lang.String r7 = com.zipow.videobox.ptapp.SystemInfoHelper.getOSInfo() // Catch:{ Exception -> 0x0193 }\n r6.append(r7) // Catch:{ Exception -> 0x0193 }\n java.lang.String r6 = r6.toString() // Catch:{ Exception -> 0x0193 }\n r5.println(r6) // Catch:{ Exception -> 0x0193 }\n if (r4 != 0) goto L_0x014d\n java.lang.StringBuilder r4 = new java.lang.StringBuilder // Catch:{ Exception -> 0x0193 }\n r4.<init>() // Catch:{ Exception -> 0x0193 }\n java.lang.String r6 = \"Hardware: \"\n r4.append(r6) // Catch:{ Exception -> 0x0193 }\n java.lang.String r6 = com.zipow.videobox.ptapp.SystemInfoHelper.getHardwareInfo() // Catch:{ Exception -> 0x0193 }\n r4.append(r6) // Catch:{ Exception -> 0x0193 }\n java.lang.String r4 = r4.toString() // Catch:{ Exception -> 0x0193 }\n r5.println(r4) // Catch:{ Exception -> 0x0193 }\n L_0x014d:\n java.lang.StringBuilder r4 = new java.lang.StringBuilder // Catch:{ Exception -> 0x0193 }\n r4.<init>() // Catch:{ Exception -> 0x0193 }\n java.lang.String r6 = \"IsProcessAtFront: \"\n r4.append(r6) // Catch:{ Exception -> 0x0193 }\n com.zipow.videobox.VideoBoxApplication r6 = com.zipow.videobox.VideoBoxApplication.getInstance() // Catch:{ Exception -> 0x0193 }\n boolean r6 = r6.isAtFront() // Catch:{ Exception -> 0x0193 }\n r4.append(r6) // Catch:{ Exception -> 0x0193 }\n java.lang.String r4 = r4.toString() // Catch:{ Exception -> 0x0193 }\n r5.println(r4) // Catch:{ Exception -> 0x0193 }\n java.lang.StringBuilder r4 = new java.lang.StringBuilder // Catch:{ Exception -> 0x0193 }\n r4.<init>() // Catch:{ Exception -> 0x0193 }\n java.lang.String r6 = \"IsRooted: \"\n r4.append(r6) // Catch:{ Exception -> 0x0193 }\n boolean r6 = p021us.zoom.androidlib.util.RootCheckUtils.isRooted() // Catch:{ Exception -> 0x0193 }\n r4.append(r6) // Catch:{ Exception -> 0x0193 }\n java.lang.String r4 = r4.toString() // Catch:{ Exception -> 0x0193 }\n r5.println(r4) // Catch:{ Exception -> 0x0193 }\n r5.println() // Catch:{ Exception -> 0x0193 }\n r12.printStackTrace(r5) // Catch:{ Exception -> 0x0193 }\n r5.flush() // Catch:{ Exception -> 0x019f }\n r5.close() // Catch:{ Exception -> 0x019f }\n goto L_0x019f\n L_0x018e:\n r11 = move-exception\n r5 = r1\n goto L_0x0285\n L_0x0192:\n r5 = r1\n L_0x0193:\n r0.delete() // Catch:{ all -> 0x0284 }\n if (r5 == 0) goto L_0x019e\n r5.flush() // Catch:{ Exception -> 0x019e }\n r5.close() // Catch:{ Exception -> 0x019e }\n L_0x019e:\n r0 = r1\n L_0x019f:\n if (r3 != 0) goto L_0x0227\n us.zoom.androidlib.app.ZMActivity r4 = p021us.zoom.androidlib.app.ZMActivity.getFrontActivity()\n if (r4 == 0) goto L_0x0227\n java.lang.String r5 = \"Fragment\"\n java.lang.String[] r5 = new java.lang.String[]{r5}\n if (r0 == 0) goto L_0x0212\n java.io.FileWriter r6 = new java.io.FileWriter // Catch:{ IOException -> 0x01fe, all -> 0x01e6 }\n r7 = 1\n r6.<init>(r0, r7) // Catch:{ IOException -> 0x01fe, all -> 0x01e6 }\n java.io.BufferedWriter r7 = new java.io.BufferedWriter // Catch:{ IOException -> 0x01e4, all -> 0x01e1 }\n r7.<init>(r6) // Catch:{ IOException -> 0x01e4, all -> 0x01e1 }\n java.io.PrintWriter r8 = new java.io.PrintWriter // Catch:{ IOException -> 0x01df, all -> 0x01dc }\n r8.<init>(r7) // Catch:{ IOException -> 0x01df, all -> 0x01dc }\n r8.println() // Catch:{ IOException -> 0x01da, all -> 0x01d8 }\n androidx.fragment.app.FragmentManager r1 = r4.getSupportFragmentManager() // Catch:{ IOException -> 0x01da, all -> 0x01d8 }\n if (r1 == 0) goto L_0x01d6\n androidx.fragment.app.FragmentManager r1 = r4.getSupportFragmentManager() // Catch:{ IOException -> 0x01da, all -> 0x01d8 }\n java.lang.String r4 = \"\"\n java.io.FileDescriptor r9 = new java.io.FileDescriptor // Catch:{ IOException -> 0x01da, all -> 0x01d8 }\n r9.<init>() // Catch:{ IOException -> 0x01da, all -> 0x01d8 }\n r1.dump(r4, r9, r8, r5) // Catch:{ IOException -> 0x01da, all -> 0x01d8 }\n L_0x01d6:\n r1 = r6\n goto L_0x0214\n L_0x01d8:\n r11 = move-exception\n goto L_0x01ea\n L_0x01da:\n goto L_0x0201\n L_0x01dc:\n r11 = move-exception\n r8 = r1\n goto L_0x01ea\n L_0x01df:\n r8 = r1\n goto L_0x0201\n L_0x01e1:\n r11 = move-exception\n r7 = r1\n goto L_0x01e9\n L_0x01e4:\n r7 = r1\n goto L_0x0200\n L_0x01e6:\n r11 = move-exception\n r6 = r1\n r7 = r6\n L_0x01e9:\n r8 = r7\n L_0x01ea:\n if (r6 == 0) goto L_0x01f1\n r6.close() // Catch:{ IOException -> 0x01f0 }\n goto L_0x01f1\n L_0x01f0:\n L_0x01f1:\n if (r7 == 0) goto L_0x01f8\n r7.close() // Catch:{ IOException -> 0x01f7 }\n goto L_0x01f8\n L_0x01f7:\n L_0x01f8:\n if (r8 == 0) goto L_0x01fd\n r8.close()\n L_0x01fd:\n throw r11\n L_0x01fe:\n r6 = r1\n r7 = r6\n L_0x0200:\n r8 = r7\n L_0x0201:\n if (r6 == 0) goto L_0x0208\n r6.close() // Catch:{ IOException -> 0x0207 }\n goto L_0x0208\n L_0x0207:\n L_0x0208:\n if (r7 == 0) goto L_0x020f\n r7.close() // Catch:{ IOException -> 0x020e }\n goto L_0x020f\n L_0x020e:\n L_0x020f:\n if (r8 == 0) goto L_0x0227\n goto L_0x0224\n L_0x0212:\n r7 = r1\n r8 = r7\n L_0x0214:\n if (r1 == 0) goto L_0x021b\n r1.close() // Catch:{ IOException -> 0x021a }\n goto L_0x021b\n L_0x021a:\n L_0x021b:\n if (r7 == 0) goto L_0x0222\n r7.close() // Catch:{ IOException -> 0x0221 }\n goto L_0x0222\n L_0x0221:\n L_0x0222:\n if (r8 == 0) goto L_0x0227\n L_0x0224:\n r8.close()\n L_0x0227:\n if (r0 == 0) goto L_0x0272\n java.lang.StringBuilder r1 = new java.lang.StringBuilder\n r1.<init>()\n java.lang.String r4 = com.zipow.cmmlib.AppUtil.getLogParentPath()\n r1.append(r4)\n java.lang.String r4 = \"/logs\"\n r1.append(r4)\n java.lang.String r1 = r1.toString()\n java.lang.StringBuilder r4 = new java.lang.StringBuilder\n r4.<init>()\n java.lang.String r5 = \"crash-\"\n r4.append(r5)\n r4.append(r2)\n java.lang.String r2 = r4.toString()\n boolean r1 = com.zipow.videobox.util.LogUtil.isSameCrashReported(r1, r0, r2)\n if (r1 == 0) goto L_0x0272\n java.io.File r1 = new java.io.File\n java.lang.StringBuilder r2 = new java.lang.StringBuilder\n r2.<init>()\n java.lang.String r4 = r0.getAbsolutePath()\n r2.append(r4)\n java.lang.String r4 = \".sent\"\n r2.append(r4)\n java.lang.String r2 = r2.toString()\n r1.<init>(r2)\n r0.renameTo(r1)\n L_0x0272:\n if (r3 == 0) goto L_0x027c\n com.zipow.videobox.VideoBoxApplication r11 = com.zipow.videobox.VideoBoxApplication.getInstance()\n r11.killCurrentProcess()\n goto L_0x0283\n L_0x027c:\n java.lang.Thread$UncaughtExceptionHandler r0 = r10.mNextHandler\n if (r0 == 0) goto L_0x0283\n r0.uncaughtException(r11, r12)\n L_0x0283:\n return\n L_0x0284:\n r11 = move-exception\n L_0x0285:\n if (r5 == 0) goto L_0x028d\n r5.flush() // Catch:{ Exception -> 0x028d }\n r5.close() // Catch:{ Exception -> 0x028d }\n L_0x028d:\n throw r11\n L_0x028e:\n java.lang.Thread$UncaughtExceptionHandler r0 = r10.mNextHandler\n if (r0 == 0) goto L_0x0295\n r0.uncaughtException(r11, r12)\n L_0x0295:\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.zipow.videobox.stabilility.JavaCrashHandler.uncaughtException(java.lang.Thread, java.lang.Throwable):void\");\n }", "public final synchronized com.google.android.m4b.maps.bu.C4910a m21843a(java.lang.String r10) {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/79094208.run(Unknown Source)\n*/\n /*\n r9 = this;\n monitor-enter(r9);\n r0 = r9.f17909e;\t Catch:{ all -> 0x0056 }\n r1 = 0;\n if (r0 != 0) goto L_0x0008;\n L_0x0006:\n monitor-exit(r9);\n return r1;\n L_0x0008:\n r0 = r9.f17907c;\t Catch:{ all -> 0x0056 }\n r2 = com.google.android.m4b.maps.az.C4733b.m21060a(r10);\t Catch:{ all -> 0x0056 }\n r0 = r0.m21933a(r2, r1);\t Catch:{ all -> 0x0056 }\n if (r0 == 0) goto L_0x0054;\t Catch:{ all -> 0x0056 }\n L_0x0014:\n r2 = r0.length;\t Catch:{ all -> 0x0056 }\n r3 = 9;\t Catch:{ all -> 0x0056 }\n if (r2 <= r3) goto L_0x0054;\t Catch:{ all -> 0x0056 }\n L_0x0019:\n r2 = 0;\t Catch:{ all -> 0x0056 }\n r2 = r0[r2];\t Catch:{ all -> 0x0056 }\n r4 = 1;\t Catch:{ all -> 0x0056 }\n if (r2 == r4) goto L_0x0020;\t Catch:{ all -> 0x0056 }\n L_0x001f:\n goto L_0x0054;\t Catch:{ all -> 0x0056 }\n L_0x0020:\n r5 = com.google.android.m4b.maps.bs.C4891e.m21914c(r0, r4);\t Catch:{ all -> 0x0056 }\n r2 = new com.google.android.m4b.maps.ar.a;\t Catch:{ all -> 0x0056 }\n r7 = com.google.android.m4b.maps.de.C5350x.f20104b;\t Catch:{ all -> 0x0056 }\n r2.<init>(r7);\t Catch:{ all -> 0x0056 }\n r7 = new java.io.ByteArrayInputStream;\t Catch:{ IOException -> 0x0052 }\n r8 = r0.length;\t Catch:{ IOException -> 0x0052 }\n r8 = r8 - r3;\t Catch:{ IOException -> 0x0052 }\n r7.<init>(r0, r3, r8);\t Catch:{ IOException -> 0x0052 }\n r2.m20818a(r7);\t Catch:{ IOException -> 0x0052 }\n r0 = 2;\n r0 = r2.m20843h(r0);\t Catch:{ all -> 0x0056 }\n r10 = r10.equals(r0);\t Catch:{ all -> 0x0056 }\n if (r10 != 0) goto L_0x0042;\n L_0x0040:\n monitor-exit(r9);\n return r1;\n L_0x0042:\n r10 = new com.google.android.m4b.maps.bu.a;\t Catch:{ all -> 0x0056 }\n r10.<init>();\t Catch:{ all -> 0x0056 }\n r10.m22018a(r4);\t Catch:{ all -> 0x0056 }\n r10.m22020a(r2);\t Catch:{ all -> 0x0056 }\n r10.m22016a(r5);\t Catch:{ all -> 0x0056 }\n monitor-exit(r9);\n return r10;\n L_0x0052:\n monitor-exit(r9);\n return r1;\n L_0x0054:\n monitor-exit(r9);\n return r1;\n L_0x0056:\n r10 = move-exception;\n monitor-exit(r9);\n throw r10;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.m4b.maps.bs.b.a(java.lang.String):com.google.android.m4b.maps.bu.a\");\n }", "public static final void warn(@org.jetbrains.annotations.NotNull org.jetbrains.anko.AnkoLogger r4, @org.jetbrains.annotations.Nullable java.lang.Object r5, @org.jetbrains.annotations.Nullable java.lang.Throwable r6) {\n /*\n r3 = \"$receiver\";\n kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull(r4, r3);\n r0 = 5;\n r2 = r4.getLoggerTag();\n r3 = android.util.Log.isLoggable(r2, r0);\n if (r3 == 0) goto L_0x0025;\n L_0x0011:\n if (r6 == 0) goto L_0x002a;\n L_0x0013:\n if (r5 == 0) goto L_0x0026;\n L_0x0015:\n r3 = r5.toString();\n if (r3 == 0) goto L_0x0026;\n L_0x001b:\n r6 = (java.lang.Throwable) r6;\n r3 = (java.lang.String) r3;\n r1 = r2;\n r1 = (java.lang.String) r1;\n android.util.Log.w(r1, r3, r6);\n L_0x0025:\n return;\n L_0x0026:\n r3 = \"null\";\n goto L_0x001b;\n L_0x002a:\n if (r5 == 0) goto L_0x003b;\n L_0x002c:\n r3 = r5.toString();\n if (r3 == 0) goto L_0x003b;\n L_0x0032:\n r3 = (java.lang.String) r3;\n r1 = r2;\n r1 = (java.lang.String) r1;\n android.util.Log.w(r1, r3);\n goto L_0x0025;\n L_0x003b:\n r3 = \"null\";\n goto L_0x0032;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: org.jetbrains.anko.Logging.warn(org.jetbrains.anko.AnkoLogger, java.lang.Object, java.lang.Throwable):void\");\n }", "@android.support.annotation.RequiresApi(api = 23)\n /* Code decompiled incorrectly, please refer to instructions dump. */\n public final synchronized void c(int r11) {\n /*\n r10 = this;\n monitor-enter(r10)\n r8 = 1\n java.lang.Object[] r1 = new java.lang.Object[r8] // Catch:{ all -> 0x004b }\n java.lang.Integer r2 = java.lang.Integer.valueOf(r11) // Catch:{ all -> 0x004b }\n r9 = 0\n r1[r9] = r2 // Catch:{ all -> 0x004b }\n com.meituan.robust.ChangeQuickRedirect r3 = f29525a // Catch:{ all -> 0x004b }\n r4 = 0\n r5 = 16805(0x41a5, float:2.3549E-41)\n java.lang.Class[] r6 = new java.lang.Class[r8] // Catch:{ all -> 0x004b }\n java.lang.Class r2 = java.lang.Integer.TYPE // Catch:{ all -> 0x004b }\n r6[r9] = r2 // Catch:{ all -> 0x004b }\n java.lang.Class r7 = java.lang.Void.TYPE // Catch:{ all -> 0x004b }\n r2 = r10\n boolean r1 = com.meituan.robust.PatchProxy.isSupport(r1, r2, r3, r4, r5, r6, r7) // Catch:{ all -> 0x004b }\n if (r1 == 0) goto L_0x003a\n java.lang.Object[] r1 = new java.lang.Object[r8] // Catch:{ all -> 0x004b }\n java.lang.Integer r0 = java.lang.Integer.valueOf(r11) // Catch:{ all -> 0x004b }\n r1[r9] = r0 // Catch:{ all -> 0x004b }\n com.meituan.robust.ChangeQuickRedirect r3 = f29525a // Catch:{ all -> 0x004b }\n r4 = 0\n r5 = 16805(0x41a5, float:2.3549E-41)\n java.lang.Class[] r6 = new java.lang.Class[r8] // Catch:{ all -> 0x004b }\n java.lang.Class r0 = java.lang.Integer.TYPE // Catch:{ all -> 0x004b }\n r6[r9] = r0 // Catch:{ all -> 0x004b }\n java.lang.Class r7 = java.lang.Void.TYPE // Catch:{ all -> 0x004b }\n r2 = r10\n com.meituan.robust.PatchProxy.accessDispatch(r1, r2, r3, r4, r5, r6, r7) // Catch:{ all -> 0x004b }\n monitor-exit(r10)\n return\n L_0x003a:\n com.ss.android.medialib.camera.IESCameraInterface r1 = r10.f29527c // Catch:{ all -> 0x004b }\n boolean r1 = r1 instanceof com.ss.android.medialib.camera.IESHwCamera // Catch:{ all -> 0x004b }\n if (r1 == 0) goto L_0x0049\n com.ss.android.medialib.camera.IESCameraInterface r1 = r10.f29527c // Catch:{ all -> 0x004b }\n com.ss.android.medialib.camera.IESHwCamera r1 = (com.ss.android.medialib.camera.IESHwCamera) r1 // Catch:{ all -> 0x004b }\n r1.c((int) r11) // Catch:{ all -> 0x004b }\n r10.o = r11 // Catch:{ all -> 0x004b }\n L_0x0049:\n monitor-exit(r10)\n return\n L_0x004b:\n r0 = move-exception\n monitor-exit(r10)\n throw r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.ss.android.medialib.camera.g.c(int):void\");\n }", "static /* synthetic */ void m201-wrap5(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01 r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 0073 in method: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.-wrap5(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.-wrap5(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01):void\");\n }", "public void m1177d(boolean z) {\n C3815z4.m2010d().mo55985b(C3815z4.C3816a.SDK_STOPPED, true);\n C3490e3.m665e(\"SDK is stopped\");\n C3496e5.m699h().mo55349a(true);\n MedalliaExceptionHandler medalliaExceptionHandler = this.f1449h;\n if (medalliaExceptionHandler != null) {\n medalliaExceptionHandler.unregister();\n }\n if (z) {\n C3754u5.m1743f().mo55866c(true);\n C3754u5.m1743f().mo55860a(Lifetime.Forever);\n C3767w0.m1812b().mo55893a();\n C3782x0.m1872d().mo55907a(C3792y.C3793a.Feedback, Long.valueOf(System.currentTimeMillis()));\n m1159a(new File(C3785x1.m1897d(\".crashes/crash.txt\")));\n }\n C3702r2.m1571c().mo55769a(C3717s2.C3720c.stopApi);\n }", "public void mo29430b() {\n Log.w(\"MessageCenter\", \"unregistering MessageCenter's Broadcast Receiver\");\n C1049a.m3996a(this.f9292a).mo4058a((BroadcastReceiver) this.f9298g);\n }", "static /* synthetic */ void m204-wrap8(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01 r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 0073 in method: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.-wrap8(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.-wrap8(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01):void\");\n }", "private synchronized void a(com.whatsapp.util.x r11, boolean r12) {\n /*\n r10 = this;\n r0 = 0;\n monitor-enter(r10);\n r2 = com.whatsapp.util.Log.h;\t Catch:{ all -> 0x0016 }\n r3 = com.whatsapp.util.x.a(r11);\t Catch:{ all -> 0x0016 }\n r1 = com.whatsapp.util.bl.b(r3);\t Catch:{ IllegalArgumentException -> 0x0014 }\n if (r1 == r11) goto L_0x0019;\n L_0x000e:\n r0 = new java.lang.IllegalStateException;\t Catch:{ IllegalArgumentException -> 0x0014 }\n r0.<init>();\t Catch:{ IllegalArgumentException -> 0x0014 }\n throw r0;\t Catch:{ IllegalArgumentException -> 0x0014 }\n L_0x0014:\n r0 = move-exception;\n throw r0;\t Catch:{ all -> 0x0016 }\n L_0x0016:\n r0 = move-exception;\n monitor-exit(r10);\n throw r0;\n L_0x0019:\n if (r12 == 0) goto L_0x0058;\n L_0x001b:\n r1 = com.whatsapp.util.bl.d(r3);\t Catch:{ IllegalArgumentException -> 0x0052 }\n if (r1 != 0) goto L_0x0058;\n L_0x0021:\n r1 = r0;\n L_0x0022:\n r4 = r10.b;\t Catch:{ all -> 0x0016 }\n if (r1 >= r4) goto L_0x0058;\n L_0x0026:\n r4 = r3.b(r1);\t Catch:{ IllegalArgumentException -> 0x0050 }\n r4 = r4.exists();\t Catch:{ IllegalArgumentException -> 0x0050 }\n if (r4 != 0) goto L_0x0054;\n L_0x0030:\n r11.b();\t Catch:{ IllegalArgumentException -> 0x0050 }\n r0 = new java.lang.IllegalStateException;\t Catch:{ IllegalArgumentException -> 0x0050 }\n r2 = new java.lang.StringBuilder;\t Catch:{ IllegalArgumentException -> 0x0050 }\n r2.<init>();\t Catch:{ IllegalArgumentException -> 0x0050 }\n r3 = z;\t Catch:{ IllegalArgumentException -> 0x0050 }\n r4 = 24;\n r3 = r3[r4];\t Catch:{ IllegalArgumentException -> 0x0050 }\n r2 = r2.append(r3);\t Catch:{ IllegalArgumentException -> 0x0050 }\n r1 = r2.append(r1);\t Catch:{ IllegalArgumentException -> 0x0050 }\n r1 = r1.toString();\t Catch:{ IllegalArgumentException -> 0x0050 }\n r0.<init>(r1);\t Catch:{ IllegalArgumentException -> 0x0050 }\n throw r0;\t Catch:{ IllegalArgumentException -> 0x0050 }\n L_0x0050:\n r0 = move-exception;\n throw r0;\t Catch:{ all -> 0x0016 }\n L_0x0052:\n r0 = move-exception;\n throw r0;\t Catch:{ all -> 0x0016 }\n L_0x0054:\n r1 = r1 + 1;\n if (r2 == 0) goto L_0x0022;\n L_0x0058:\n r1 = r10.b;\t Catch:{ all -> 0x0016 }\n if (r0 >= r1) goto L_0x008f;\n L_0x005c:\n r1 = r3.b(r0);\t Catch:{ all -> 0x0016 }\n if (r12 == 0) goto L_0x0088;\n L_0x0062:\n r4 = r1.exists();\t Catch:{ IllegalArgumentException -> 0x0126 }\n if (r4 == 0) goto L_0x008b;\n L_0x0068:\n r4 = r3.a(r0);\t Catch:{ all -> 0x0016 }\n r1.renameTo(r4);\t Catch:{ all -> 0x0016 }\n r5 = com.whatsapp.util.bl.e(r3);\t Catch:{ all -> 0x0016 }\n r6 = r5[r0];\t Catch:{ all -> 0x0016 }\n r4 = r4.length();\t Catch:{ all -> 0x0016 }\n r8 = com.whatsapp.util.bl.e(r3);\t Catch:{ IllegalArgumentException -> 0x0128 }\n r8[r0] = r4;\t Catch:{ IllegalArgumentException -> 0x0128 }\n r8 = r10.i;\t Catch:{ IllegalArgumentException -> 0x0128 }\n r6 = r8 - r6;\n r4 = r4 + r6;\n r10.i = r4;\t Catch:{ IllegalArgumentException -> 0x0128 }\n if (r2 == 0) goto L_0x008b;\n L_0x0088:\n a(r1);\t Catch:{ IllegalArgumentException -> 0x0128 }\n L_0x008b:\n r0 = r0 + 1;\n if (r2 == 0) goto L_0x0058;\n L_0x008f:\n r0 = r10.e;\t Catch:{ IllegalArgumentException -> 0x012a }\n r0 = r0 + 1;\n r10.e = r0;\t Catch:{ IllegalArgumentException -> 0x012a }\n r0 = 0;\n com.whatsapp.util.bl.a(r3, r0);\t Catch:{ IllegalArgumentException -> 0x012a }\n r0 = com.whatsapp.util.bl.d(r3);\t Catch:{ IllegalArgumentException -> 0x012a }\n r0 = r0 | r12;\n if (r0 == 0) goto L_0x00e0;\n L_0x00a0:\n r0 = 1;\n com.whatsapp.util.bl.a(r3, r0);\t Catch:{ IllegalArgumentException -> 0x012c }\n r0 = r10.m;\t Catch:{ IllegalArgumentException -> 0x012c }\n r1 = new java.lang.StringBuilder;\t Catch:{ IllegalArgumentException -> 0x012c }\n r1.<init>();\t Catch:{ IllegalArgumentException -> 0x012c }\n r4 = z;\t Catch:{ IllegalArgumentException -> 0x012c }\n r5 = 26;\n r4 = r4[r5];\t Catch:{ IllegalArgumentException -> 0x012c }\n r1 = r1.append(r4);\t Catch:{ IllegalArgumentException -> 0x012c }\n r4 = com.whatsapp.util.bl.a(r3);\t Catch:{ IllegalArgumentException -> 0x012c }\n r1 = r1.append(r4);\t Catch:{ IllegalArgumentException -> 0x012c }\n r4 = r3.a();\t Catch:{ IllegalArgumentException -> 0x012c }\n r1 = r1.append(r4);\t Catch:{ IllegalArgumentException -> 0x012c }\n r4 = 10;\n r1 = r1.append(r4);\t Catch:{ IllegalArgumentException -> 0x012c }\n r1 = r1.toString();\t Catch:{ IllegalArgumentException -> 0x012c }\n r0.write(r1);\t Catch:{ IllegalArgumentException -> 0x012c }\n if (r12 == 0) goto L_0x010f;\n L_0x00d4:\n r0 = r10.n;\t Catch:{ IllegalArgumentException -> 0x012e }\n r4 = 1;\n r4 = r4 + r0;\n r10.n = r4;\t Catch:{ IllegalArgumentException -> 0x012e }\n com.whatsapp.util.bl.a(r3, r0);\t Catch:{ IllegalArgumentException -> 0x012e }\n if (r2 == 0) goto L_0x010f;\n L_0x00e0:\n r0 = r10.k;\t Catch:{ IllegalArgumentException -> 0x012e }\n r1 = com.whatsapp.util.bl.a(r3);\t Catch:{ IllegalArgumentException -> 0x012e }\n r0.remove(r1);\t Catch:{ IllegalArgumentException -> 0x012e }\n r0 = r10.m;\t Catch:{ IllegalArgumentException -> 0x012e }\n r1 = new java.lang.StringBuilder;\t Catch:{ IllegalArgumentException -> 0x012e }\n r1.<init>();\t Catch:{ IllegalArgumentException -> 0x012e }\n r2 = z;\t Catch:{ IllegalArgumentException -> 0x012e }\n r4 = 25;\n r2 = r2[r4];\t Catch:{ IllegalArgumentException -> 0x012e }\n r1 = r1.append(r2);\t Catch:{ IllegalArgumentException -> 0x012e }\n r2 = com.whatsapp.util.bl.a(r3);\t Catch:{ IllegalArgumentException -> 0x012e }\n r1 = r1.append(r2);\t Catch:{ IllegalArgumentException -> 0x012e }\n r2 = 10;\n r1 = r1.append(r2);\t Catch:{ IllegalArgumentException -> 0x012e }\n r1 = r1.toString();\t Catch:{ IllegalArgumentException -> 0x012e }\n r0.write(r1);\t Catch:{ IllegalArgumentException -> 0x012e }\n L_0x010f:\n r0 = r10.i;\t Catch:{ IllegalArgumentException -> 0x0130 }\n r2 = r10.c;\t Catch:{ IllegalArgumentException -> 0x0130 }\n r0 = (r0 > r2 ? 1 : (r0 == r2 ? 0 : -1));\n if (r0 > 0) goto L_0x011d;\n L_0x0117:\n r0 = r10.f();\t Catch:{ IllegalArgumentException -> 0x0132 }\n if (r0 == 0) goto L_0x0124;\n L_0x011d:\n r0 = r10.d;\t Catch:{ IllegalArgumentException -> 0x0132 }\n r1 = r10.j;\t Catch:{ IllegalArgumentException -> 0x0132 }\n r0.submit(r1);\t Catch:{ IllegalArgumentException -> 0x0132 }\n L_0x0124:\n monitor-exit(r10);\n return;\n L_0x0126:\n r0 = move-exception;\n throw r0;\t Catch:{ all -> 0x0016 }\n L_0x0128:\n r0 = move-exception;\n throw r0;\t Catch:{ all -> 0x0016 }\n L_0x012a:\n r0 = move-exception;\n throw r0;\t Catch:{ IllegalArgumentException -> 0x012c }\n L_0x012c:\n r0 = move-exception;\n throw r0;\t Catch:{ IllegalArgumentException -> 0x012e }\n L_0x012e:\n r0 = move-exception;\n throw r0;\t Catch:{ all -> 0x0016 }\n L_0x0130:\n r0 = move-exception;\n throw r0;\t Catch:{ IllegalArgumentException -> 0x0132 }\n L_0x0132:\n r0 = move-exception;\n throw r0;\t Catch:{ all -> 0x0016 }\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.whatsapp.util.b6.a(com.whatsapp.util.x, boolean):void\");\n }", "private final com.google.wireless.android.finsky.dfe.p505c.p506a.ec m35437b(com.google.protobuf.nano.C7213a r8) {\n /*\n r7 = this;\n r1 = 0;\n L_0x0001:\n r0 = r8.m33550a();\n switch(r0) {\n case 0: goto L_0x000e;\n case 8: goto L_0x000f;\n case 16: goto L_0x004c;\n case 26: goto L_0x006f;\n case 34: goto L_0x007c;\n default: goto L_0x0008;\n };\n L_0x0008:\n r0 = super.a(r8, r0);\n if (r0 != 0) goto L_0x0001;\n L_0x000e:\n return r7;\n L_0x000f:\n r2 = r7.f37533a;\n r2 = r2 | 1;\n r7.f37533a = r2;\n r2 = r8.m33573o();\n r3 = r8.m33567i();\t Catch:{ IllegalArgumentException -> 0x003b }\n switch(r3) {\n case 0: goto L_0x0043;\n case 1: goto L_0x0043;\n default: goto L_0x0020;\n };\t Catch:{ IllegalArgumentException -> 0x003b }\n L_0x0020:\n r4 = new java.lang.IllegalArgumentException;\t Catch:{ IllegalArgumentException -> 0x003b }\n r5 = 42;\n r6 = new java.lang.StringBuilder;\t Catch:{ IllegalArgumentException -> 0x003b }\n r6.<init>(r5);\t Catch:{ IllegalArgumentException -> 0x003b }\n r3 = r6.append(r3);\t Catch:{ IllegalArgumentException -> 0x003b }\n r5 = \" is not a valid enum ResultCode\";\n r3 = r3.append(r5);\t Catch:{ IllegalArgumentException -> 0x003b }\n r3 = r3.toString();\t Catch:{ IllegalArgumentException -> 0x003b }\n r4.<init>(r3);\t Catch:{ IllegalArgumentException -> 0x003b }\n throw r4;\t Catch:{ IllegalArgumentException -> 0x003b }\n L_0x003b:\n r3 = move-exception;\n r8.m33562e(r2);\n r7.a(r8, r0);\n goto L_0x0001;\n L_0x0043:\n r7.f37534b = r3;\t Catch:{ IllegalArgumentException -> 0x003b }\n r3 = r7.f37533a;\t Catch:{ IllegalArgumentException -> 0x003b }\n r3 = r3 | 1;\n r7.f37533a = r3;\t Catch:{ IllegalArgumentException -> 0x003b }\n goto L_0x0001;\n L_0x004c:\n r2 = r7.f37533a;\n r2 = r2 | 2;\n r7.f37533a = r2;\n r2 = r8.m33573o();\n r3 = r8.m33560d();\t Catch:{ IllegalArgumentException -> 0x0067 }\n r3 = com.google.wireless.android.finsky.dfe.p505c.p506a.dp.m35391a(r3);\t Catch:{ IllegalArgumentException -> 0x0067 }\n r7.f37535c = r3;\t Catch:{ IllegalArgumentException -> 0x0067 }\n r3 = r7.f37533a;\t Catch:{ IllegalArgumentException -> 0x0067 }\n r3 = r3 | 2;\n r7.f37533a = r3;\t Catch:{ IllegalArgumentException -> 0x0067 }\n goto L_0x0001;\n L_0x0067:\n r3 = move-exception;\n r8.m33562e(r2);\n r7.a(r8, r0);\n goto L_0x0001;\n L_0x006f:\n r0 = r8.m33565g();\n r7.f37536d = r0;\n r0 = r7.f37533a;\n r0 = r0 | 4;\n r7.f37533a = r0;\n goto L_0x0001;\n L_0x007c:\n r0 = 34;\n r2 = com.google.protobuf.nano.C7222l.m33624a(r8, r0);\n r0 = r7.f37537e;\n if (r0 != 0) goto L_0x00a8;\n L_0x0086:\n r0 = r1;\n L_0x0087:\n r2 = r2 + r0;\n r2 = new com.google.wireless.android.finsky.dfe.p505c.p506a.ed[r2];\n if (r0 == 0) goto L_0x0091;\n L_0x008c:\n r3 = r7.f37537e;\n java.lang.System.arraycopy(r3, r1, r2, r1, r0);\n L_0x0091:\n r3 = r2.length;\n r3 = r3 + -1;\n if (r0 >= r3) goto L_0x00ac;\n L_0x0096:\n r3 = new com.google.wireless.android.finsky.dfe.c.a.ed;\n r3.<init>();\n r2[r0] = r3;\n r3 = r2[r0];\n r8.m33552a(r3);\n r8.m33550a();\n r0 = r0 + 1;\n goto L_0x0091;\n L_0x00a8:\n r0 = r7.f37537e;\n r0 = r0.length;\n goto L_0x0087;\n L_0x00ac:\n r3 = new com.google.wireless.android.finsky.dfe.c.a.ed;\n r3.<init>();\n r2[r0] = r3;\n r0 = r2[r0];\n r8.m33552a(r0);\n r7.f37537e = r2;\n goto L_0x0001;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.wireless.android.finsky.dfe.c.a.ec.b(com.google.protobuf.nano.a):com.google.wireless.android.finsky.dfe.c.a.ec\");\n }", "public void handleMessage(android.os.Message r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.handleMessage(android.os.Message):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.handleMessage(android.os.Message):void\");\n }", "public void onReceive(android.content.Context r7, android.content.Intent r8) {\n /*\n r6 = this;\n java.lang.String r7 = r8.getAction()\n int r0 = r7.hashCode()\n r1 = 672715421(0x2818d29d, float:8.4833645E-15)\n r2 = 2\n r3 = 0\n r4 = -1\n r5 = 1\n if (r0 == r1) goto L_0x0030\n r1 = 1178001221(0x4636df45, float:11703.817)\n if (r0 == r1) goto L_0x0026\n r1 = 1478749832(0x5823ee88, float:7.2097952E14)\n if (r0 == r1) goto L_0x001c\n goto L_0x003a\n L_0x001c:\n java.lang.String r0 = \"chatMessageSendqueueBackground\"\n boolean r7 = r7.equals(r0)\n if (r7 == 0) goto L_0x003a\n r7 = 0\n goto L_0x003b\n L_0x0026:\n java.lang.String r0 = \"chatMessageBroadcastSendqueueBackground\"\n boolean r7 = r7.equals(r0)\n if (r7 == 0) goto L_0x003a\n r7 = 1\n goto L_0x003b\n L_0x0030:\n java.lang.String r0 = \"chatMessageBroadcastChangequeueBackground\"\n boolean r7 = r7.equals(r0)\n if (r7 == 0) goto L_0x003a\n r7 = 2\n goto L_0x003b\n L_0x003a:\n r7 = -1\n L_0x003b:\n switch(r7) {\n case 0: goto L_0x00a1;\n case 1: goto L_0x0077;\n case 2: goto L_0x0040;\n default: goto L_0x003e;\n }\n L_0x003e:\n goto L_0x0181\n L_0x0040:\n java.lang.String r7 = \"broadcastClosed\"\n boolean r7 = r8.getBooleanExtra(r7, r3)\n me.bridgefy.entities.transport.AppEntityBroadcast r7 = p140me.bridgefy.entities.transport.AppEntityBroadcast.getAppEntityBroadcastChange(r7)\n me.bridgefy.service.a.a r8 = p140me.bridgefy.service.p144a.C3615a.m10678a()\n java.util.List r8 = r8.mo29652b()\n java.util.Iterator r8 = r8.iterator()\n L_0x0056:\n boolean r0 = r8.hasNext()\n if (r0 == 0) goto L_0x0181\n java.lang.Object r0 = r8.next()\n me.bridgefy.entities.BridgefyPeer r0 = (p140me.bridgefy.entities.BridgefyPeer) r0\n java.lang.String r0 = r0.getId()\n com.bridgefy.sdk.client.Device r0 = com.bridgefy.sdk.framework.controller.DeviceManager.getDeviceByUserId(r0)\n java.util.HashMap r1 = r7.toHashMap() // Catch:{ Exception -> 0x0072 }\n r0.sendMessage(r1) // Catch:{ Exception -> 0x0072 }\n goto L_0x0056\n L_0x0072:\n r0 = move-exception\n r0.printStackTrace()\n goto L_0x0056\n L_0x0077:\n java.lang.String r7 = \"bridgefyMessage\"\n java.lang.String r7 = r8.getStringExtra(r7) // Catch:{ Exception -> 0x009b }\n me.bridgefy.entities.Message r7 = p140me.bridgefy.entities.Message.create(r7) // Catch:{ Exception -> 0x009b }\n me.bridgefy.entities.transport.AppEntityMessage r8 = new me.bridgefy.entities.transport.AppEntityMessage // Catch:{ Exception -> 0x009b }\n r8.<init>(r7, r2) // Catch:{ Exception -> 0x009b }\n boolean r7 = p140me.bridgefy.main.C3608c.m10650c() // Catch:{ Exception -> 0x009b }\n r7 = r7 ^ r5\n r8.setKu(r7) // Catch:{ Exception -> 0x009b }\n java.util.HashMap r7 = r8.toHashMap() // Catch:{ Exception -> 0x009b }\n com.bridgefy.sdk.client.Message r7 = com.bridgefy.sdk.client.Bridgefy.createMessage(r7) // Catch:{ Exception -> 0x009b }\n com.bridgefy.sdk.client.Bridgefy.sendBroadcastMessage(r7) // Catch:{ Exception -> 0x009b }\n goto L_0x0181\n L_0x009b:\n r7 = move-exception\n r7.printStackTrace()\n goto L_0x0181\n L_0x00a1:\n android.os.Bundle r7 = r8.getExtras()\n java.lang.String r0 = \"userId\"\n r1 = 0\n java.lang.String r7 = r7.getString(r0, r1)\n if (r7 == 0) goto L_0x0181\n me.bridgefy.integration.b r0 = p140me.bridgefy.integration.C3549b.this\n me.bridgefy.a.d r0 = r0.f9294c\n java.util.ArrayList r0 = r0.mo28344c(r7)\n java.util.ArrayList r1 = new java.util.ArrayList\n r1.<init>()\n java.lang.String r2 = \"bridgefyMessage\"\n java.lang.String r8 = r8.getStringExtra(r2)\n if (r8 == 0) goto L_0x00fe\n me.bridgefy.entities.Message r8 = p140me.bridgefy.entities.Message.create(r8) // Catch:{ JsonSyntaxException -> 0x00f7 }\n java.lang.String r2 = r8.getMessageId() // Catch:{ JsonSyntaxException -> 0x00f7 }\n java.lang.String r3 = java.lang.String.valueOf(r4) // Catch:{ JsonSyntaxException -> 0x00f7 }\n boolean r2 = r2.equals(r3) // Catch:{ JsonSyntaxException -> 0x00f7 }\n if (r2 == 0) goto L_0x00e9\n java.util.UUID r2 = java.util.UUID.randomUUID() // Catch:{ JsonSyntaxException -> 0x00f7 }\n java.lang.String r2 = r2.toString() // Catch:{ JsonSyntaxException -> 0x00f7 }\n r8.setMessageId(r2) // Catch:{ JsonSyntaxException -> 0x00f7 }\n java.lang.String r2 = r8.getMessageId() // Catch:{ JsonSyntaxException -> 0x00f7 }\n r8.setOfflineId(r2) // Catch:{ JsonSyntaxException -> 0x00f7 }\n L_0x00e9:\n int r2 = r8.getType() // Catch:{ JsonSyntaxException -> 0x00f7 }\n if (r2 != r5) goto L_0x00f3\n r1.add(r8) // Catch:{ JsonSyntaxException -> 0x00f7 }\n goto L_0x00fe\n L_0x00f3:\n r0.add(r8) // Catch:{ JsonSyntaxException -> 0x00f7 }\n goto L_0x00fe\n L_0x00f7:\n java.lang.String r8 = \"MessageCenter\"\n java.lang.String r2 = \"Sending queue without any new message at the top.\"\n android.util.Log.w(r8, r2)\n L_0x00fe:\n java.util.Iterator r8 = r0.iterator()\n L_0x0102:\n boolean r2 = r8.hasNext()\n if (r2 == 0) goto L_0x0118\n java.lang.Object r2 = r8.next()\n me.bridgefy.entities.Message r2 = (p140me.bridgefy.entities.Message) r2\n int r3 = r2.getType()\n if (r3 != r5) goto L_0x0102\n r1.add(r2)\n goto L_0x0102\n L_0x0118:\n r0.remove(r1)\n int r8 = r1.size()\n if (r8 <= 0) goto L_0x0161\n me.bridgefy.service.a.a r8 = p140me.bridgefy.service.p144a.C3615a.m10678a()\n boolean r8 = r8.mo29651a(r7)\n if (r8 == 0) goto L_0x0146\n me.bridgefy.integration.b r8 = p140me.bridgefy.integration.C3549b.this\n android.content.Context r8 = r8.mo29428a()\n me.bridgefy.integration.b r2 = p140me.bridgefy.integration.C3549b.this\n me.bridgefy.ormlite.DatabaseHelper r2 = r2.f9297f\n me.bridgefy.service.d.b r8 = p140me.bridgefy.service.p147d.C3622b.m10715a(r8, r2)\n boolean r8 = r8.mo29663b()\n if (r8 != 0) goto L_0x0146\n me.bridgefy.integration.b r8 = p140me.bridgefy.integration.C3549b.this\n r8.m10414a(r1)\n L_0x0146:\n me.bridgefy.integration.b r8 = p140me.bridgefy.integration.C3549b.this\n android.content.Context r8 = r8.mo29428a()\n me.bridgefy.integration.b r2 = p140me.bridgefy.integration.C3549b.this\n me.bridgefy.ormlite.DatabaseHelper r2 = r2.f9297f\n me.bridgefy.service.d.b r8 = p140me.bridgefy.service.p147d.C3622b.m10715a(r8, r2)\n boolean r8 = r8.mo29663b()\n if (r8 == 0) goto L_0x0161\n me.bridgefy.integration.b r8 = p140me.bridgefy.integration.C3549b.this\n r8.m10415a(r1, r7)\n L_0x0161:\n int r8 = r0.size()\n if (r8 <= 0) goto L_0x0181\n me.bridgefy.service.a.a r8 = p140me.bridgefy.service.p144a.C3615a.m10678a()\n boolean r8 = r8.mo29651a(r7)\n if (r8 == 0) goto L_0x0177\n me.bridgefy.integration.b r7 = p140me.bridgefy.integration.C3549b.this\n r7.m10414a(r0)\n goto L_0x0181\n L_0x0177:\n me.bridgefy.integration.b r8 = p140me.bridgefy.integration.C3549b.this\n r8.m10414a(r0)\n me.bridgefy.integration.b r8 = p140me.bridgefy.integration.C3549b.this\n r8.m10415a(r0, r7)\n L_0x0181:\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p140me.bridgefy.integration.C3549b.C3551a.onReceive(android.content.Context, android.content.Intent):void\");\n }", "public final void h(int r13) {\n /*\n r12 = this;\n android.content.Intent r0 = new android.content.Intent\n java.lang.String r1 = \"com.cuatroochenta.miniland.PLAYER_ACTION\"\n r0.<init>(r1)\n java.lang.String r1 = \"EXTRA_KEY_PLAYER_STATUS_CODE\"\n r0.putExtra(r1, r13)\n java.lang.String r1 = r12.h\n java.lang.String r2 = \"EXTRA_KEY_PLAYLIST_TYPE\"\n r0.putExtra(r2, r1)\n boolean r1 = r12.f\n java.lang.String r2 = \"EXTRA_KEY_INFO_CURRENT_TRACK\"\n if (r1 == 0) goto L_0x0036\n int r1 = r12.f3936d\n if (r1 < 0) goto L_0x0036\n java.util.ArrayList<com.cuatroochenta.miniland.model.Song> r3 = r12.f3935c\n int r3 = r3.size()\n if (r1 >= r3) goto L_0x0036\n java.util.ArrayList<com.cuatroochenta.miniland.model.Song> r1 = r12.f3935c\n int r3 = r12.f3936d\n java.lang.Object r1 = r1.get(r3)\n com.cuatroochenta.miniland.model.Song r1 = (com.cuatroochenta.miniland.model.Song) r1\n java.util.ArrayList<com.cuatroochenta.miniland.model.Song> r3 = r12.f3934b\n int r1 = r3.indexOf(r1)\n goto L_0x0038\n L_0x0036:\n int r1 = r12.f3936d\n L_0x0038:\n r0.putExtra(r2, r1)\n boolean r1 = r12.f\n java.lang.String r2 = \"EXTRA_KEY_INFO_SHUFFLE_MODE\"\n r0.putExtra(r2, r1)\n boolean r1 = r12.f3937e\n java.lang.String r2 = \"EXTRA_KEY_INFO_IS_LOOP_MODE\"\n r0.putExtra(r2, r1)\n java.lang.String r1 = r12.c()\n java.lang.String r2 = \"EXTRA_KEY_INFO_CURRENT_SONG_NAME\"\n r0.putExtra(r2, r1)\n android.media.MediaPlayer r1 = r12.f3933a\n if (r1 == 0) goto L_0x0079\n int r1 = r1.getCurrentPosition()\n int r1 = r1 / 1000\n java.lang.String r2 = \"EXTRA_KEY_INFO_CURRENT_POSITION\"\n r0.putExtra(r2, r1)\n android.media.MediaPlayer r1 = r12.f3933a\n boolean r1 = r1.isPlaying()\n java.lang.String r2 = \"EXTRA_KEY_INFO_IS_PLAYING\"\n r0.putExtra(r2, r1)\n android.media.MediaPlayer r1 = r12.f3933a\n int r1 = r1.getDuration()\n int r1 = r1 / 1000\n java.lang.String r2 = \"EXTRA_KEY_INFO_TRACK_DURATION\"\n r0.putExtra(r2, r1)\n L_0x0079:\n android.os.CountDownTimer r1 = r12.i\n r2 = 0\n r3 = 1000(0x3e8, double:4.94E-321)\n java.lang.String r5 = \"EXTRA_KEY_INFO_COUNTDOWN_TIMEFINISH\"\n r6 = 1\n r7 = 0\n java.lang.String r9 = \"EXTRA_KEY_INFO_COUNTDOWN_STATUS\"\n if (r1 == 0) goto L_0x0098\n long r10 = r12.j\n int r1 = (r10 > r7 ? 1 : (r10 == r7 ? 0 : -1))\n if (r1 <= 0) goto L_0x0098\n r0.putExtra(r9, r2)\n long r7 = r12.j\n long r9 = java.lang.System.currentTimeMillis()\n long r7 = r7 - r9\n goto L_0x00a3\n L_0x0098:\n long r10 = r12.k\n int r1 = (r10 > r7 ? 1 : (r10 == r7 ? 0 : -1))\n if (r1 <= 0) goto L_0x00a9\n r0.putExtra(r9, r6)\n long r7 = r12.k\n L_0x00a3:\n long r7 = r7 / r3\n int r1 = (int) r7\n r0.putExtra(r5, r1)\n goto L_0x00ad\n L_0x00a9:\n r1 = 2\n r0.putExtra(r9, r1)\n L_0x00ad:\n com.sozpic.miniland.AppMiniland r1 = com.sozpic.miniland.AppMiniland.f()\n boolean r1 = r1.n()\n if (r1 == 0) goto L_0x00cf\n java.lang.Object[] r1 = new java.lang.Object[r6]\n java.lang.Integer r13 = java.lang.Integer.valueOf(r13)\n r1[r2] = r13\n java.lang.String r13 = \"PlayerService -> Send status %d to LocalBroadcast\"\n java.lang.String r13 = java.lang.String.format(r13, r1)\n a.c.a.f.e.b(r13)\n androidx.localbroadcastmanager.content.LocalBroadcastManager r13 = androidx.localbroadcastmanager.content.LocalBroadcastManager.getInstance(r12)\n r13.sendBroadcast(r0)\n L_0x00cf:\n r12.sendBroadcast(r0)\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.cuatroochenta.miniland.player.PlayerService.h(int):void\");\n }", "@Override\n public void onWarning(String debugMessage) {\n }", "private void m22002a() {\n if (!this.f23836h) {\n this.f23835g = mo24758a(this.f23833e);\n try {\n this.f23833e.registerReceiver(this.f23837i, new IntentFilter(\"android.net.conn.CONNECTIVITY_CHANGE\"));\n this.f23836h = true;\n } catch (SecurityException e) {\n String str = \"ConnectivityMonitor\";\n if (Log.isLoggable(str, 5)) {\n Log.w(str, \"Failed to register\", e);\n }\n }\n }\n }", "private android.view.MotionEvent m145494e(android.view.MotionEvent r26) {\n /*\n r25 = this;\n r0 = r25\n r1 = r26\n boolean r2 = r25.m145493d(r26)\n if (r2 != 0) goto L_0x000b\n return r1\n L_0x000b:\n int r2 = r26.getActionMasked()\n r3 = 2\n r4 = 5\n r5 = 0\n r6 = -1\n r7 = 1\n if (r2 == 0) goto L_0x0036\n if (r2 != r4) goto L_0x0019\n goto L_0x0036\n L_0x0019:\n r4 = 6\n if (r2 == r7) goto L_0x0022\n if (r2 != r4) goto L_0x001f\n goto L_0x0022\n L_0x001f:\n r3 = r2\n r2 = -1\n goto L_0x004a\n L_0x0022:\n int r2 = r26.getActionIndex()\n int r8 = r1.getPointerId(r2)\n int[] r9 = r0.f119297q\n r8 = r9[r8]\n if (r8 == r6) goto L_0x004a\n int r3 = r0.f119298r\n if (r3 != r7) goto L_0x0049\n r4 = 1\n goto L_0x0049\n L_0x0036:\n int r2 = r26.getActionIndex()\n int r8 = r1.getPointerId(r2)\n int[] r9 = r0.f119297q\n r8 = r9[r8]\n if (r8 == r6) goto L_0x004a\n int r3 = r0.f119298r\n if (r3 != r7) goto L_0x0049\n r4 = 0\n L_0x0049:\n r3 = r4\n L_0x004a:\n int r4 = r0.f119298r\n mo115234c(r4)\n float r4 = r26.getX()\n float r7 = r26.getY()\n float r8 = r26.getRawX()\n float r9 = r26.getRawY()\n r1.setLocation(r8, r9)\n int r8 = r26.getPointerCount()\n r13 = r3\n r14 = 0\n L_0x0068:\n if (r5 >= r8) goto L_0x0096\n int r3 = r1.getPointerId(r5)\n int[] r9 = r0.f119297q\n r9 = r9[r3]\n if (r9 == r6) goto L_0x0093\n android.view.MotionEvent$PointerProperties[] r9 = f119282b\n r9 = r9[r14]\n r1.getPointerProperties(r5, r9)\n android.view.MotionEvent$PointerProperties[] r9 = f119282b\n r9 = r9[r14]\n int[] r10 = r0.f119297q\n r3 = r10[r3]\n r9.id = r3\n android.view.MotionEvent$PointerCoords[] r3 = f119283p\n r3 = r3[r14]\n r1.getPointerCoords(r5, r3)\n if (r5 != r2) goto L_0x0091\n int r3 = r14 << 8\n r13 = r13 | r3\n L_0x0091:\n int r14 = r14 + 1\n L_0x0093:\n int r5 = r5 + 1\n goto L_0x0068\n L_0x0096:\n long r9 = r26.getDownTime()\n long r11 = r26.getEventTime()\n android.view.MotionEvent$PointerProperties[] r15 = f119282b\n android.view.MotionEvent$PointerCoords[] r16 = f119283p\n int r17 = r26.getMetaState()\n int r18 = r26.getButtonState()\n float r19 = r26.getXPrecision()\n float r20 = r26.getYPrecision()\n int r21 = r26.getDeviceId()\n int r22 = r26.getEdgeFlags()\n int r23 = r26.getSource()\n int r24 = r26.getFlags()\n android.view.MotionEvent r2 = android.view.MotionEvent.obtain(r9, r11, r13, r14, r15, r16, r17, r18, r19, r20, r21, r22, r23, r24)\n r1.setLocation(r4, r7)\n r2.setLocation(r4, r7)\n return r2\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.swmansion.gesturehandler.C46347b.m145494e(android.view.MotionEvent):android.view.MotionEvent\");\n }", "private static boolean a(android.content.Context r13, com.whatsapp.contact.o r14) {\n /*\n r7 = 1;\n r6 = 0;\n r8 = d;\n r10 = java.lang.System.currentTimeMillis();\n r0 = z;\t Catch:{ Exception -> 0x0053 }\n r1 = 49;\n r0 = r0[r1];\t Catch:{ Exception -> 0x0053 }\n com.whatsapp.util.Log.i(r0);\t Catch:{ Exception -> 0x0053 }\n r0 = z;\t Catch:{ Exception -> 0x0053 }\n r1 = 44;\n r0 = r0[r1];\t Catch:{ Exception -> 0x0053 }\n r1 = 0;\n r9 = a(r13, r0, r1);\t Catch:{ Exception -> 0x0053 }\n r0 = z;\t Catch:{ Exception -> 0x0053 }\n r1 = 41;\n r0 = r0[r1];\t Catch:{ Exception -> 0x0053 }\n com.whatsapp.util.Log.i(r0);\t Catch:{ Exception -> 0x0053 }\n r0 = g;\t Catch:{ Exception -> 0x0053 }\n r0.close();\t Catch:{ Exception -> 0x0053 }\n r0 = z;\t Catch:{ Exception -> 0x0053 }\n r1 = 42;\n r0 = r0[r1];\t Catch:{ Exception -> 0x0053 }\n r1 = b(r0);\t Catch:{ Exception -> 0x0053 }\n r2 = 0;\n r3 = 1;\n r4 = r9.a();\t Catch:{ Exception -> 0x0053 }\n r5 = 0;\n r0 = r14;\n r0 = com.whatsapp.App.a(r0, r1, r2, r3, r4, r5);\t Catch:{ Exception -> 0x0053 }\n if (r0 != 0) goto L_0x0088;\n L_0x0042:\n r1 = com.whatsapp.App.aQ;\t Catch:{ Exception -> 0x0053 }\n monitor-enter(r1);\t Catch:{ Exception -> 0x0053 }\n r0 = com.whatsapp.App.aa;\t Catch:{ all -> 0x0050 }\n r0 = com.whatsapp.contact.o.combine(r0, r14);\t Catch:{ all -> 0x0050 }\n com.whatsapp.App.aa = r0;\t Catch:{ all -> 0x0050 }\n monitor-exit(r1);\t Catch:{ all -> 0x0050 }\n r0 = r6;\n L_0x004f:\n return r0;\n L_0x0050:\n r0 = move-exception;\n monitor-exit(r1);\t Catch:{ all -> 0x0050 }\n throw r0;\t Catch:{ Exception -> 0x0053 }\n L_0x0053:\n r0 = move-exception;\n r1 = z;\n r2 = 47;\n r1 = r1[r2];\n com.whatsapp.util.Log.b(r1, r0);\n r0 = new java.lang.StringBuilder;\n r0.<init>();\n r1 = z;\n r2 = 45;\n r1 = r1[r2];\n r0 = r0.append(r1);\n r2 = java.lang.System.currentTimeMillis();\n r2 = r2 - r10;\n r0 = r0.append(r2);\n r1 = z;\n r2 = 52;\n r1 = r1[r2];\n r0 = r0.append(r1);\n r0 = r0.toString();\n com.whatsapp.util.Log.i(r0);\n r0 = r6;\n goto L_0x004f;\n L_0x0088:\n r0 = g;\t Catch:{ Exception -> 0x0053 }\n r2 = 64000; // 0xfa00 float:8.9683E-41 double:3.162E-319;\n r0 = r0.block(r2);\t Catch:{ Exception -> 0x0053 }\n if (r0 != 0) goto L_0x009e;\n L_0x0093:\n r0 = z;\t Catch:{ Exception -> 0x0053 }\n r1 = 54;\n r0 = r0[r1];\t Catch:{ Exception -> 0x0053 }\n com.whatsapp.util.Log.w(r0);\t Catch:{ Exception -> 0x0053 }\n r0 = r6;\n goto L_0x004f;\n L_0x009e:\n r0 = r9.b();\t Catch:{ Exception -> 0x0053 }\n r1 = 0;\n b(r0, r1);\t Catch:{ Exception -> 0x0053 }\n r0 = r9.j();\t Catch:{ Exception -> 0x0053 }\n r1 = 0;\n b(r0, r1);\t Catch:{ Exception -> 0x0053 }\n r1 = new java.util.ArrayList;\t Catch:{ Exception -> 0x0053 }\n r1.<init>();\t Catch:{ Exception -> 0x0053 }\n r0 = r9.e();\t Catch:{ Exception -> 0x0053 }\n b(r0, r1);\t Catch:{ Exception -> 0x0053 }\n r0 = i;\t Catch:{ Exception -> 0x0053 }\n r0.close();\t Catch:{ Exception -> 0x0053 }\n r2 = r9.k();\t Catch:{ Exception -> 0x0053 }\n r0 = r2.length;\t Catch:{ Exception -> 0x00db }\n if (r0 <= 0) goto L_0x014d;\n L_0x00c6:\n r0 = com.whatsapp.App.a(r2);\t Catch:{ Exception -> 0x00db }\n if (r0 != 0) goto L_0x00e0;\n L_0x00cc:\n r1 = com.whatsapp.App.aQ;\t Catch:{ Exception -> 0x0053 }\n monitor-enter(r1);\t Catch:{ Exception -> 0x0053 }\n r0 = com.whatsapp.App.aa;\t Catch:{ all -> 0x00dd }\n r0 = com.whatsapp.contact.o.combine(r0, r14);\t Catch:{ all -> 0x00dd }\n com.whatsapp.App.aa = r0;\t Catch:{ all -> 0x00dd }\n monitor-exit(r1);\t Catch:{ all -> 0x00dd }\n r0 = r6;\n goto L_0x004f;\n L_0x00db:\n r0 = move-exception;\n throw r0;\t Catch:{ Exception -> 0x0053 }\n L_0x00dd:\n r0 = move-exception;\n monitor-exit(r1);\t Catch:{ all -> 0x00dd }\n throw r0;\t Catch:{ Exception -> 0x0053 }\n L_0x00e0:\n r3 = new java.util.HashSet;\t Catch:{ Exception -> 0x0053 }\n r3.<init>();\t Catch:{ Exception -> 0x0053 }\n r0 = com.whatsapp.App.as;\t Catch:{ Exception -> 0x0053 }\n r0 = r0.h();\t Catch:{ Exception -> 0x0053 }\n r4 = r0.iterator();\t Catch:{ Exception -> 0x0053 }\n L_0x00ef:\n r0 = r4.hasNext();\t Catch:{ Exception -> 0x0053 }\n if (r0 == 0) goto L_0x010a;\n L_0x00f5:\n r0 = r4.next();\t Catch:{ Exception -> 0x0053 }\n r0 = (com.whatsapp.l5) r0;\t Catch:{ Exception -> 0x0053 }\n r5 = r0.p;\t Catch:{ Exception -> 0x0147 }\n r5 = android.text.TextUtils.isEmpty(r5);\t Catch:{ Exception -> 0x0147 }\n if (r5 != 0) goto L_0x0108;\n L_0x0103:\n r0 = r0.p;\t Catch:{ Exception -> 0x0147 }\n r3.add(r0);\t Catch:{ Exception -> 0x0147 }\n L_0x0108:\n if (r8 == 0) goto L_0x00ef;\n L_0x010a:\n r4 = r2.length;\t Catch:{ Exception -> 0x0053 }\n r0 = r6;\n L_0x010c:\n if (r0 >= r4) goto L_0x0121;\n L_0x010e:\n r5 = r2[r0];\t Catch:{ Exception -> 0x0053 }\n r12 = r5.p;\t Catch:{ Exception -> 0x0149 }\n r12 = android.text.TextUtils.isEmpty(r12);\t Catch:{ Exception -> 0x0149 }\n if (r12 != 0) goto L_0x011d;\n L_0x0118:\n r5 = r5.p;\t Catch:{ Exception -> 0x0149 }\n r3.add(r5);\t Catch:{ Exception -> 0x0149 }\n L_0x011d:\n r0 = r0 + 1;\n if (r8 == 0) goto L_0x010c;\n L_0x0121:\n r0 = r3.size();\t Catch:{ Exception -> 0x0053 }\n r0 = new java.lang.String[r0];\t Catch:{ Exception -> 0x0053 }\n r0 = r3.toArray(r0);\t Catch:{ Exception -> 0x0053 }\n r0 = (java.lang.String[]) r0;\t Catch:{ Exception -> 0x0053 }\n com.whatsapp.App.a(r0);\t Catch:{ Exception -> 0x0053 }\n r0 = i;\t Catch:{ Exception -> 0x0053 }\n r2 = 64000; // 0xfa00 float:8.9683E-41 double:3.162E-319;\n r0 = r0.block(r2);\t Catch:{ Exception -> 0x0053 }\n if (r0 != 0) goto L_0x014b;\n L_0x013b:\n r0 = z;\t Catch:{ Exception -> 0x0053 }\n r1 = 53;\n r0 = r0[r1];\t Catch:{ Exception -> 0x0053 }\n com.whatsapp.util.Log.w(r0);\t Catch:{ Exception -> 0x0053 }\n r0 = r6;\n goto L_0x004f;\n L_0x0147:\n r0 = move-exception;\n throw r0;\t Catch:{ Exception -> 0x0053 }\n L_0x0149:\n r0 = move-exception;\n throw r0;\t Catch:{ Exception -> 0x0053 }\n L_0x014b:\n if (r8 == 0) goto L_0x0186;\n L_0x014d:\n r2 = new java.util.HashSet;\t Catch:{ Exception -> 0x0053 }\n r2.<init>();\t Catch:{ Exception -> 0x0053 }\n r0 = com.whatsapp.App.as;\t Catch:{ Exception -> 0x0053 }\n r0 = r0.h();\t Catch:{ Exception -> 0x0053 }\n r3 = r0.iterator();\t Catch:{ Exception -> 0x0053 }\n L_0x015c:\n r0 = r3.hasNext();\t Catch:{ Exception -> 0x0053 }\n if (r0 == 0) goto L_0x0177;\n L_0x0162:\n r0 = r3.next();\t Catch:{ Exception -> 0x0053 }\n r0 = (com.whatsapp.l5) r0;\t Catch:{ Exception -> 0x0053 }\n r4 = r0.p;\t Catch:{ Exception -> 0x0258 }\n r4 = android.text.TextUtils.isEmpty(r4);\t Catch:{ Exception -> 0x0258 }\n if (r4 != 0) goto L_0x0175;\n L_0x0170:\n r0 = r0.p;\t Catch:{ Exception -> 0x0258 }\n r2.add(r0);\t Catch:{ Exception -> 0x0258 }\n L_0x0175:\n if (r8 == 0) goto L_0x015c;\n L_0x0177:\n r0 = r2.size();\t Catch:{ Exception -> 0x0053 }\n r0 = new java.lang.String[r0];\t Catch:{ Exception -> 0x0053 }\n r0 = r2.toArray(r0);\t Catch:{ Exception -> 0x0053 }\n r0 = (java.lang.String[]) r0;\t Catch:{ Exception -> 0x0053 }\n com.whatsapp.App.a(r0);\t Catch:{ Exception -> 0x0053 }\n L_0x0186:\n r0 = r9.b();\t Catch:{ Exception -> 0x0053 }\n r2 = 0;\n a(r0, r2);\t Catch:{ Exception -> 0x0053 }\n r0 = r9.j();\t Catch:{ Exception -> 0x0053 }\n r2 = 0;\n a(r0, r2);\t Catch:{ Exception -> 0x0053 }\n r0 = new java.util.ArrayList;\t Catch:{ Exception -> 0x0053 }\n r0.<init>();\t Catch:{ Exception -> 0x0053 }\n r2 = r9.e();\t Catch:{ Exception -> 0x025a }\n a(r2, r0);\t Catch:{ Exception -> 0x025a }\n r2 = z;\t Catch:{ Exception -> 0x025a }\n r3 = 46;\n r2 = r2[r3];\t Catch:{ Exception -> 0x025a }\n com.whatsapp.util.Log.i(r2);\t Catch:{ Exception -> 0x025a }\n r2 = r9.b();\t Catch:{ Exception -> 0x025a }\n r2 = r2.isEmpty();\t Catch:{ Exception -> 0x025a }\n if (r2 != 0) goto L_0x01be;\n L_0x01b5:\n r2 = com.whatsapp.App.as;\t Catch:{ Exception -> 0x025a }\n r3 = r9.b();\t Catch:{ Exception -> 0x025a }\n r2.b(r3);\t Catch:{ Exception -> 0x025a }\n L_0x01be:\n r2 = z;\t Catch:{ Exception -> 0x025c }\n r3 = 43;\n r2 = r2[r3];\t Catch:{ Exception -> 0x025c }\n com.whatsapp.util.Log.i(r2);\t Catch:{ Exception -> 0x025c }\n r2 = r9.j();\t Catch:{ Exception -> 0x025c }\n r2 = r2.isEmpty();\t Catch:{ Exception -> 0x025c }\n if (r2 != 0) goto L_0x01da;\n L_0x01d1:\n r2 = com.whatsapp.App.as;\t Catch:{ Exception -> 0x025c }\n r3 = r9.j();\t Catch:{ Exception -> 0x025c }\n r2.d(r3);\t Catch:{ Exception -> 0x025c }\n L_0x01da:\n r2 = z;\t Catch:{ Exception -> 0x025e }\n r3 = 48;\n r2 = r2[r3];\t Catch:{ Exception -> 0x025e }\n com.whatsapp.util.Log.i(r2);\t Catch:{ Exception -> 0x025e }\n r2 = r1.isEmpty();\t Catch:{ Exception -> 0x025e }\n if (r2 != 0) goto L_0x01ee;\n L_0x01e9:\n r2 = com.whatsapp.App.as;\t Catch:{ Exception -> 0x025e }\n r2.d(r1);\t Catch:{ Exception -> 0x025e }\n L_0x01ee:\n r2 = z;\t Catch:{ Exception -> 0x0260 }\n r3 = 40;\n r2 = r2[r3];\t Catch:{ Exception -> 0x0260 }\n com.whatsapp.util.Log.i(r2);\t Catch:{ Exception -> 0x0260 }\n r2 = r0.isEmpty();\t Catch:{ Exception -> 0x0260 }\n if (r2 != 0) goto L_0x0202;\n L_0x01fd:\n r2 = com.whatsapp.App.as;\t Catch:{ Exception -> 0x0260 }\n r2.d(r0);\t Catch:{ Exception -> 0x0260 }\n L_0x0202:\n r0 = z;\t Catch:{ Exception -> 0x0262 }\n r2 = 51;\n r0 = r0[r2];\t Catch:{ Exception -> 0x0262 }\n com.whatsapp.util.Log.i(r0);\t Catch:{ Exception -> 0x0262 }\n r0 = r9.g();\t Catch:{ Exception -> 0x0262 }\n r0 = r0.isEmpty();\t Catch:{ Exception -> 0x0262 }\n if (r0 != 0) goto L_0x021e;\n L_0x0215:\n r0 = com.whatsapp.App.as;\t Catch:{ Exception -> 0x0262 }\n r2 = r9.g();\t Catch:{ Exception -> 0x0262 }\n r0.c(r2);\t Catch:{ Exception -> 0x0262 }\n L_0x021e:\n r0 = new java.lang.StringBuilder;\t Catch:{ Exception -> 0x0264 }\n r0.<init>();\t Catch:{ Exception -> 0x0264 }\n r2 = z;\t Catch:{ Exception -> 0x0264 }\n r3 = 50;\n r2 = r2[r3];\t Catch:{ Exception -> 0x0264 }\n r0 = r0.append(r2);\t Catch:{ Exception -> 0x0264 }\n r2 = java.lang.System.currentTimeMillis();\t Catch:{ Exception -> 0x0264 }\n r2 = r2 - r10;\n r0 = r0.append(r2);\t Catch:{ Exception -> 0x0264 }\n r0 = r0.toString();\t Catch:{ Exception -> 0x0264 }\n com.whatsapp.util.Log.i(r0);\t Catch:{ Exception -> 0x0264 }\n r0 = r9.f();\t Catch:{ Exception -> 0x0264 }\n if (r0 == 0) goto L_0x0249;\n L_0x0243:\n r0 = r1.isEmpty();\t Catch:{ Exception -> 0x0264 }\n if (r0 != 0) goto L_0x024f;\n L_0x0249:\n r0 = com.whatsapp.App.aB;\t Catch:{ Exception -> 0x0266 }\n r1 = 1;\n r0.sendEmptyMessage(r1);\t Catch:{ Exception -> 0x0266 }\n L_0x024f:\n r0 = com.whatsapp.App.i;\t Catch:{ Exception -> 0x0053 }\n r1 = 0;\n r0.sendEmptyMessage(r1);\t Catch:{ Exception -> 0x0053 }\n r0 = r7;\n goto L_0x004f;\n L_0x0258:\n r0 = move-exception;\n throw r0;\t Catch:{ Exception -> 0x0053 }\n L_0x025a:\n r0 = move-exception;\n throw r0;\t Catch:{ Exception -> 0x0053 }\n L_0x025c:\n r0 = move-exception;\n throw r0;\t Catch:{ Exception -> 0x0053 }\n L_0x025e:\n r0 = move-exception;\n throw r0;\t Catch:{ Exception -> 0x0053 }\n L_0x0260:\n r0 = move-exception;\n throw r0;\t Catch:{ Exception -> 0x0053 }\n L_0x0262:\n r0 = move-exception;\n throw r0;\t Catch:{ Exception -> 0x0053 }\n L_0x0264:\n r0 = move-exception;\n throw r0;\t Catch:{ Exception -> 0x0266 }\n L_0x0266:\n r0 = move-exception;\n throw r0;\t Catch:{ Exception -> 0x0053 }\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.whatsapp.contact.i.a(android.content.Context, com.whatsapp.contact.o):boolean\");\n }", "public void onNotifyEvent(int r8, android.os.Bundle r9) {\n /*\n r7 = this;\n r0 = r7.mListenerLock;\n monitor-enter(r0);\n r1 = r7.mNotifyListener;\t Catch:{ all -> 0x00df }\n r2 = 12001; // 0x2ee1 float:1.6817E-41 double:5.9293E-320;\n if (r1 == 0) goto L_0x00d8;\n L_0x0009:\n r1 = new android.os.Bundle;\t Catch:{ all -> 0x00df }\n r1.<init>();\t Catch:{ all -> 0x00df }\n r3 = 3005; // 0xbbd float:4.211E-42 double:1.4847E-320;\n r4 = -2301; // 0xfffffffffffff703 float:NaN double:NaN;\n r5 = 2103; // 0x837 float:2.947E-42 double:1.039E-320;\n r6 = 3002; // 0xbba float:4.207E-42 double:1.483E-320;\n if (r8 == r2) goto L_0x00a8;\n L_0x0018:\n switch(r8) {\n case 12004: goto L_0x009e;\n case 12005: goto L_0x0094;\n default: goto L_0x001b;\n };\t Catch:{ all -> 0x00df }\n L_0x001b:\n switch(r8) {\n case 12007: goto L_0x008b;\n case 12008: goto L_0x0081;\n case 12009: goto L_0x0077;\n default: goto L_0x001e;\n };\t Catch:{ all -> 0x00df }\n L_0x001e:\n switch(r8) {\n case 12011: goto L_0x006f;\n case 12012: goto L_0x0065;\n case 12013: goto L_0x005d;\n case 12014: goto L_0x0055;\n case 12015: goto L_0x004d;\n default: goto L_0x0021;\n };\t Catch:{ all -> 0x00df }\n L_0x0021:\n switch(r8) {\n case 12030: goto L_0x0043;\n case 12031: goto L_0x003b;\n default: goto L_0x0024;\n };\t Catch:{ all -> 0x00df }\n L_0x0024:\n r3 = \"EVT_MSG\";\n r4 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00df }\n r4.<init>();\t Catch:{ all -> 0x00df }\n r5 = \"UNKNOWN event = \";\n r4.append(r5);\t Catch:{ all -> 0x00df }\n r4.append(r8);\t Catch:{ all -> 0x00df }\n r4 = r4.toString();\t Catch:{ all -> 0x00df }\n r1.putString(r3, r4);\t Catch:{ all -> 0x00df }\n goto L_0x0092;\n L_0x003b:\n r3 = \"EVT_MSG\";\n r5 = \"所有拉流地址尝试失败,可以放弃治疗\";\n r1.putString(r3, r5);\t Catch:{ all -> 0x00df }\n goto L_0x006c;\n L_0x0043:\n r3 = -2302; // 0xfffffffffffff702 float:NaN double:NaN;\n r4 = \"EVT_MSG\";\n r5 = \"获取加速拉流地址失败\";\n r1.putString(r4, r5);\t Catch:{ all -> 0x00df }\n goto L_0x00b1;\n L_0x004d:\n r3 = \"EVT_MSG\";\n r4 = \"启动网络重连\";\n r1.putString(r3, r4);\t Catch:{ all -> 0x00df }\n goto L_0x007e;\n L_0x0055:\n r4 = \"EVT_MSG\";\n r5 = \"写数据错误,网络连接断开\";\n r1.putString(r4, r5);\t Catch:{ all -> 0x00df }\n goto L_0x00b1;\n L_0x005d:\n r4 = \"EVT_MSG\";\n r5 = \"读数据错误,网络连接断开\";\n r1.putString(r4, r5);\t Catch:{ all -> 0x00df }\n goto L_0x00b1;\n L_0x0065:\n r3 = \"EVT_MSG\";\n r5 = \"经多次自动重连失败,放弃连接\";\n r1.putString(r3, r5);\t Catch:{ all -> 0x00df }\n L_0x006c:\n r3 = -2301; // 0xfffffffffffff703 float:NaN double:NaN;\n goto L_0x00b1;\n L_0x006f:\n r3 = \"EVT_MSG\";\n r4 = \"连接服务器失败\";\n r1.putString(r3, r4);\t Catch:{ all -> 0x00df }\n goto L_0x00a5;\n L_0x0077:\n r3 = \"EVT_MSG\";\n r4 = \"服务器拒绝连接请求\";\n r1.putString(r3, r4);\t Catch:{ all -> 0x00df }\n L_0x007e:\n r3 = 2103; // 0x837 float:2.947E-42 double:1.039E-320;\n goto L_0x00b1;\n L_0x0081:\n r3 = 2002; // 0x7d2 float:2.805E-42 double:9.89E-321;\n r4 = \"EVT_MSG\";\n r5 = \"开始拉流\";\n r1.putString(r4, r5);\t Catch:{ all -> 0x00df }\n goto L_0x00b1;\n L_0x008b:\n r3 = \"EVT_MSG\";\n r4 = \"连接结束\";\n r1.putString(r3, r4);\t Catch:{ all -> 0x00df }\n L_0x0092:\n r3 = r8;\n goto L_0x00b1;\n L_0x0094:\n r3 = 3003; // 0xbbb float:4.208E-42 double:1.4837E-320;\n r4 = \"EVT_MSG\";\n r5 = \"RTMP服务器握手失败\";\n r1.putString(r4, r5);\t Catch:{ all -> 0x00df }\n goto L_0x00b1;\n L_0x009e:\n r3 = \"EVT_MSG\";\n r4 = \"连接服务器失败\";\n r1.putString(r3, r4);\t Catch:{ all -> 0x00df }\n L_0x00a5:\n r3 = 3002; // 0xbba float:4.207E-42 double:1.483E-320;\n goto L_0x00b1;\n L_0x00a8:\n r3 = 2001; // 0x7d1 float:2.804E-42 double:9.886E-321;\n r4 = \"EVT_MSG\";\n r5 = \"已连接服务器\";\n r1.putString(r4, r5);\t Catch:{ all -> 0x00df }\n L_0x00b1:\n r4 = \"\";\n if (r9 == 0) goto L_0x00bd;\n L_0x00b5:\n r4 = \"EVT_MSG\";\n r5 = \"\";\n r4 = r9.getString(r4, r5);\t Catch:{ all -> 0x00df }\n L_0x00bd:\n if (r4 == 0) goto L_0x00ca;\n L_0x00bf:\n r9 = r4.isEmpty();\t Catch:{ all -> 0x00df }\n if (r9 != 0) goto L_0x00ca;\n L_0x00c5:\n r9 = \"EVT_MSG\";\n r1.putString(r9, r4);\t Catch:{ all -> 0x00df }\n L_0x00ca:\n r9 = \"EVT_TIME\";\n r4 = com.tencent.liteav.basic.util.TXCTimeUtil.getTimeTick();\t Catch:{ all -> 0x00df }\n r1.putLong(r9, r4);\t Catch:{ all -> 0x00df }\n r9 = r7.mNotifyListener;\t Catch:{ all -> 0x00df }\n r9.onNotifyEvent(r3, r1);\t Catch:{ all -> 0x00df }\n L_0x00d8:\n monitor-exit(r0);\t Catch:{ all -> 0x00df }\n if (r8 != r2) goto L_0x00de;\n L_0x00db:\n r7.reportNetStatusInternal();\n L_0x00de:\n return;\n L_0x00df:\n r8 = move-exception;\n monitor-exit(r0);\t Catch:{ all -> 0x00df }\n throw r8;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.tencent.liteav.network.TXCStreamDownloader.onNotifyEvent(int, android.os.Bundle):void\");\n }", "private final com.google.android.play.p179a.p352a.C6210u m28673b(com.google.protobuf.nano.a r7) {\n /*\n r6 = this;\n L_0x0000:\n r0 = r7.a();\n switch(r0) {\n case 0: goto L_0x000d;\n case 10: goto L_0x000e;\n case 16: goto L_0x001b;\n case 26: goto L_0x0058;\n case 34: goto L_0x0065;\n case 42: goto L_0x0072;\n default: goto L_0x0007;\n };\n L_0x0007:\n r0 = super.m4918a(r7, r0);\n if (r0 != 0) goto L_0x0000;\n L_0x000d:\n return r6;\n L_0x000e:\n r0 = r7.f();\n r6.f31049b = r0;\n r0 = r6.f31048a;\n r0 = r0 | 1;\n r6.f31048a = r0;\n goto L_0x0000;\n L_0x001b:\n r1 = r6.f31048a;\n r1 = r1 | 2;\n r6.f31048a = r1;\n r1 = r7.o();\n r2 = r7.i();\t Catch:{ IllegalArgumentException -> 0x0047 }\n switch(r2) {\n case 0: goto L_0x004f;\n case 1: goto L_0x004f;\n case 2: goto L_0x004f;\n case 3: goto L_0x004f;\n case 4: goto L_0x004f;\n case 5: goto L_0x004f;\n case 6: goto L_0x004f;\n default: goto L_0x002c;\n };\t Catch:{ IllegalArgumentException -> 0x0047 }\n L_0x002c:\n r3 = new java.lang.IllegalArgumentException;\t Catch:{ IllegalArgumentException -> 0x0047 }\n r4 = 38;\n r5 = new java.lang.StringBuilder;\t Catch:{ IllegalArgumentException -> 0x0047 }\n r5.<init>(r4);\t Catch:{ IllegalArgumentException -> 0x0047 }\n r2 = r5.append(r2);\t Catch:{ IllegalArgumentException -> 0x0047 }\n r4 = \" is not a valid enum OsType\";\n r2 = r2.append(r4);\t Catch:{ IllegalArgumentException -> 0x0047 }\n r2 = r2.toString();\t Catch:{ IllegalArgumentException -> 0x0047 }\n r3.<init>(r2);\t Catch:{ IllegalArgumentException -> 0x0047 }\n throw r3;\t Catch:{ IllegalArgumentException -> 0x0047 }\n L_0x0047:\n r2 = move-exception;\n r7.e(r1);\n r6.m4918a(r7, r0);\n goto L_0x0000;\n L_0x004f:\n r6.f31050c = r2;\t Catch:{ IllegalArgumentException -> 0x0047 }\n r2 = r6.f31048a;\t Catch:{ IllegalArgumentException -> 0x0047 }\n r2 = r2 | 2;\n r6.f31048a = r2;\t Catch:{ IllegalArgumentException -> 0x0047 }\n goto L_0x0000;\n L_0x0058:\n r0 = r7.f();\n r6.f31051d = r0;\n r0 = r6.f31048a;\n r0 = r0 | 4;\n r6.f31048a = r0;\n goto L_0x0000;\n L_0x0065:\n r0 = r7.f();\n r6.f31052e = r0;\n r0 = r6.f31048a;\n r0 = r0 | 8;\n r6.f31048a = r0;\n goto L_0x0000;\n L_0x0072:\n r0 = r7.f();\n r6.f31053f = r0;\n r0 = r6.f31048a;\n r0 = r0 | 16;\n r6.f31048a = r0;\n goto L_0x0000;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.play.a.a.u.b(com.google.protobuf.nano.a):com.google.android.play.a.a.u\");\n }", "private void removeModemStandByTimer() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.removeModemStandByTimer():void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.removeModemStandByTimer():void\");\n }", "@android.support.annotation.RequiresApi(api = 23)\n /* Code decompiled incorrectly, please refer to instructions dump. */\n public final synchronized void b(boolean r11) {\n /*\n r10 = this;\n monitor-enter(r10)\n r8 = 1\n java.lang.Object[] r1 = new java.lang.Object[r8] // Catch:{ all -> 0x004b }\n java.lang.Byte r2 = java.lang.Byte.valueOf(r11) // Catch:{ all -> 0x004b }\n r9 = 0\n r1[r9] = r2 // Catch:{ all -> 0x004b }\n com.meituan.robust.ChangeQuickRedirect r3 = f29525a // Catch:{ all -> 0x004b }\n r4 = 0\n r5 = 16804(0x41a4, float:2.3547E-41)\n java.lang.Class[] r6 = new java.lang.Class[r8] // Catch:{ all -> 0x004b }\n java.lang.Class r2 = java.lang.Boolean.TYPE // Catch:{ all -> 0x004b }\n r6[r9] = r2 // Catch:{ all -> 0x004b }\n java.lang.Class r7 = java.lang.Void.TYPE // Catch:{ all -> 0x004b }\n r2 = r10\n boolean r1 = com.meituan.robust.PatchProxy.isSupport(r1, r2, r3, r4, r5, r6, r7) // Catch:{ all -> 0x004b }\n if (r1 == 0) goto L_0x003a\n java.lang.Object[] r1 = new java.lang.Object[r8] // Catch:{ all -> 0x004b }\n java.lang.Byte r0 = java.lang.Byte.valueOf(r11) // Catch:{ all -> 0x004b }\n r1[r9] = r0 // Catch:{ all -> 0x004b }\n com.meituan.robust.ChangeQuickRedirect r3 = f29525a // Catch:{ all -> 0x004b }\n r4 = 0\n r5 = 16804(0x41a4, float:2.3547E-41)\n java.lang.Class[] r6 = new java.lang.Class[r8] // Catch:{ all -> 0x004b }\n java.lang.Class r0 = java.lang.Boolean.TYPE // Catch:{ all -> 0x004b }\n r6[r9] = r0 // Catch:{ all -> 0x004b }\n java.lang.Class r7 = java.lang.Void.TYPE // Catch:{ all -> 0x004b }\n r2 = r10\n com.meituan.robust.PatchProxy.accessDispatch(r1, r2, r3, r4, r5, r6, r7) // Catch:{ all -> 0x004b }\n monitor-exit(r10)\n return\n L_0x003a:\n com.ss.android.medialib.camera.IESCameraInterface r1 = r10.f29527c // Catch:{ all -> 0x004b }\n boolean r1 = r1 instanceof com.ss.android.medialib.camera.IESHwCamera // Catch:{ all -> 0x004b }\n if (r1 == 0) goto L_0x0049\n com.ss.android.medialib.camera.IESCameraInterface r1 = r10.f29527c // Catch:{ all -> 0x004b }\n com.ss.android.medialib.camera.IESHwCamera r1 = (com.ss.android.medialib.camera.IESHwCamera) r1 // Catch:{ all -> 0x004b }\n r1.c((boolean) r11) // Catch:{ all -> 0x004b }\n r10.n = r11 // Catch:{ all -> 0x004b }\n L_0x0049:\n monitor-exit(r10)\n return\n L_0x004b:\n r0 = move-exception\n monitor-exit(r10)\n throw r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.ss.android.medialib.camera.g.b(boolean):void\");\n }", "public final void mo4755a(android.view.View r13, boolean r14) {\n /*\n r12 = this;\n wl.smartled.views.RainbowPalette r13 = r12.f2425b\n int r13 = r13.mo5192a()\n wl.smartled.c.a r0 = p021wl.smartled.p024c.C0528a.m1795a()\n java.util.List r0 = r0.mo4937c()\n r1 = 1\n r2 = 0\n r3 = 2\n if (r0 == 0) goto L_0x0041\n java.util.Iterator r4 = r0.iterator()\n L_0x0017:\n boolean r5 = r4.hasNext()\n if (r5 == 0) goto L_0x0041\n java.lang.Object r5 = r4.next()\n java.lang.String r5 = (java.lang.String) r5\n java.lang.String r6 = \"ELK_\"\n boolean r6 = r5.startsWith(r6)\n if (r6 == 0) goto L_0x0032\n java.lang.String r6 = \"^ELK_.+CT.*\"\n L_0x002d:\n java.util.regex.Pattern r6 = java.util.regex.Pattern.compile(r6, r3)\n goto L_0x0035\n L_0x0032:\n java.lang.String r6 = \"^ELK-.+CT.*\"\n goto L_0x002d\n L_0x0035:\n java.util.regex.Matcher r5 = r6.matcher(r5)\n boolean r5 = r5.find()\n if (r5 == 0) goto L_0x0017\n r4 = 1\n goto L_0x0042\n L_0x0041:\n r4 = 0\n L_0x0042:\n if (r0 == 0) goto L_0x0072\n java.util.Iterator r0 = r0.iterator()\n L_0x0048:\n boolean r5 = r0.hasNext()\n if (r5 == 0) goto L_0x0072\n java.lang.Object r5 = r0.next()\n java.lang.String r5 = (java.lang.String) r5\n java.lang.String r6 = \"ELK_\"\n boolean r6 = r5.startsWith(r6)\n if (r6 == 0) goto L_0x0063\n java.lang.String r6 = \"^ELK_.+W.*\"\n L_0x005e:\n java.util.regex.Pattern r6 = java.util.regex.Pattern.compile(r6, r3)\n goto L_0x0066\n L_0x0063:\n java.lang.String r6 = \"^ELK-.+W.*\"\n goto L_0x005e\n L_0x0066:\n java.util.regex.Matcher r5 = r6.matcher(r5)\n boolean r5 = r5.find()\n if (r5 == 0) goto L_0x0048\n r0 = 1\n goto L_0x0073\n L_0x0072:\n r0 = 0\n L_0x0073:\n int r5 = p021wl.smartled.views.RainbowPalette.f2751e\n if (r13 != r5) goto L_0x0093\n wl.smartled.c.c r13 = p021wl.smartled.p024c.C0530c.m1816a()\n r13.mo4945b(r14)\n if (r0 == 0) goto L_0x0082\n r11 = 2\n goto L_0x00d5\n L_0x0082:\n wl.smartled.c.c r13 = p021wl.smartled.p024c.C0530c.m1816a()\n r13.mo4944a(r14)\n if (r4 != 0) goto L_0x00d4\n wl.smartled.c.c r13 = p021wl.smartled.p024c.C0530c.m1816a()\n r13.mo4947c(r14)\n goto L_0x00d2\n L_0x0093:\n int r3 = p021wl.smartled.views.RainbowPalette.f2750d\n if (r13 != r3) goto L_0x00b4\n wl.smartled.c.c r13 = p021wl.smartled.p024c.C0530c.m1816a()\n r13.mo4947c(r14)\n if (r4 == 0) goto L_0x00a3\n r1 = 3\n r11 = 3\n goto L_0x00d5\n L_0x00a3:\n wl.smartled.c.c r13 = p021wl.smartled.p024c.C0530c.m1816a()\n r13.mo4944a(r14)\n if (r0 != 0) goto L_0x00d4\n wl.smartled.c.c r13 = p021wl.smartled.p024c.C0530c.m1816a()\n r13.mo4945b(r14)\n goto L_0x00d2\n L_0x00b4:\n wl.smartled.c.c r13 = p021wl.smartled.p024c.C0530c.m1816a()\n r13.mo4944a(r14)\n if (r4 != 0) goto L_0x00c4\n wl.smartled.c.c r13 = p021wl.smartled.p024c.C0530c.m1816a()\n r13.mo4947c(r14)\n L_0x00c4:\n if (r0 != 0) goto L_0x00cd\n wl.smartled.c.c r13 = p021wl.smartled.p024c.C0530c.m1816a()\n r13.mo4945b(r14)\n L_0x00cd:\n if (r4 != 0) goto L_0x00d4\n if (r0 == 0) goto L_0x00d2\n goto L_0x00d4\n L_0x00d2:\n r11 = 0\n goto L_0x00d5\n L_0x00d4:\n r11 = 1\n L_0x00d5:\n wl.smartled.f.a r5 = p021wl.smartled.p027f.C0538a.m1861a()\n android.content.Context r6 = r12.getContext()\n wl.smartled.c.a r13 = p021wl.smartled.p024c.C0528a.m1795a()\n java.util.List r7 = r13.mo4941e()\n wl.smartled.c.c r13 = p021wl.smartled.p024c.C0530c.m1816a()\n boolean r8 = r13.mo4946b()\n wl.smartled.c.c r13 = p021wl.smartled.p024c.C0530c.m1816a()\n boolean r9 = r13.mo4948c()\n wl.smartled.c.c r13 = p021wl.smartled.p024c.C0530c.m1816a()\n boolean r10 = r13.mo4949d()\n r5.mo4990a(r6, r7, r8, r9, r10, r11)\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p021wl.smartled.fragment.ColorChangeFragment.mo4755a(android.view.View, boolean):void\");\n }", "public boolean onTouchEvent(android.view.MotionEvent r14) {\n /*\n r13 = this;\n r0 = r13.tnn;\n if (r0 == 0) goto L_0x000a;\n L_0x0004:\n r0 = r13.isEnabled();\n if (r0 != 0) goto L_0x000c;\n L_0x000a:\n r0 = 0;\n L_0x000b:\n return r0;\n L_0x000c:\n r0 = r14.getAction();\n switch(r0) {\n case 0: goto L_0x0015;\n case 1: goto L_0x0060;\n case 2: goto L_0x0080;\n case 3: goto L_0x0207;\n default: goto L_0x0013;\n };\n L_0x0013:\n r0 = 0;\n goto L_0x000b;\n L_0x0015:\n r13.bOS();\n r0 = r14.getX();\n r1 = r14.getY();\n r2 = r13.G(r0, r1);\n if (r2 == 0) goto L_0x005c;\n L_0x0026:\n r3 = 1;\n r13.tnv = r3;\n r3 = com.tencent.mm.plugin.walletlock.gesture.ui.widget.PatternLockView.b.Correct;\n r13.tno = r3;\n r3 = r13.tnz;\n if (r3 == 0) goto L_0x0031;\n L_0x0031:\n if (r2 == 0) goto L_0x0056;\n L_0x0033:\n r3 = r2.tmv;\n r3 = r13.zP(r3);\n r2 = r2.tmu;\n r2 = r13.zQ(r2);\n r4 = r13.tnx;\n r5 = 1056964608; // 0x3f000000 float:0.5 double:5.222099017E-315;\n r4 = r4 * r5;\n r5 = r13.tny;\n r6 = 1056964608; // 0x3f000000 float:0.5 double:5.222099017E-315;\n r5 = r5 * r6;\n r6 = r3 - r4;\n r6 = (int) r6;\n r7 = r2 - r5;\n r7 = (int) r7;\n r3 = r3 + r4;\n r3 = (int) r3;\n r2 = r2 + r5;\n r2 = (int) r2;\n r13.invalidate(r6, r7, r3, r2);\n L_0x0056:\n r13.tnt = r0;\n r13.tnu = r1;\n r0 = 1;\n goto L_0x000b;\n L_0x005c:\n r3 = 0;\n r13.tnv = r3;\n goto L_0x0031;\n L_0x0060:\n r0 = r13.tnf;\n r0 = r0.isEmpty();\n if (r0 != 0) goto L_0x007e;\n L_0x0068:\n r0 = 0;\n r13.tnv = r0;\n r0 = r13.tnz;\n if (r0 == 0) goto L_0x007b;\n L_0x006f:\n r0 = r13.tnz;\n r1 = new java.util.ArrayList;\n r2 = r13.tnf;\n r1.<init>(r2);\n r0.a(r13, r1);\n L_0x007b:\n r13.invalidate();\n L_0x007e:\n r0 = 1;\n goto L_0x000b;\n L_0x0080:\n r0 = r13.tni;\n r7 = (float) r0;\n r8 = r14.getHistorySize();\n r0 = r13.tnd;\n r0.setEmpty();\n r2 = 0;\n r0 = 0;\n r6 = r0;\n L_0x008f:\n r0 = r8 + 1;\n if (r6 >= r0) goto L_0x0159;\n L_0x0093:\n if (r6 >= r8) goto L_0x014b;\n L_0x0095:\n r0 = r14.getHistoricalX(r6);\n r3 = r0;\n L_0x009a:\n if (r6 >= r8) goto L_0x0152;\n L_0x009c:\n r0 = r14.getHistoricalY(r6);\n r1 = r0;\n L_0x00a1:\n r9 = r13.G(r3, r1);\n r0 = r13.tnf;\n r4 = r0.size();\n if (r9 == 0) goto L_0x00b3;\n L_0x00ad:\n r0 = 1;\n if (r4 != r0) goto L_0x00b3;\n L_0x00b0:\n r0 = 1;\n r13.tnv = r0;\n L_0x00b3:\n r0 = r13.tnt;\n r0 = r3 - r0;\n r0 = java.lang.Math.abs(r0);\n r5 = r13.tnu;\n r5 = r1 - r5;\n r5 = java.lang.Math.abs(r5);\n r10 = 0;\n r0 = (r0 > r10 ? 1 : (r0 == r10 ? 0 : -1));\n if (r0 > 0) goto L_0x00cd;\n L_0x00c8:\n r0 = 0;\n r0 = (r5 > r0 ? 1 : (r5 == r0 ? 0 : -1));\n if (r0 <= 0) goto L_0x00cf;\n L_0x00cd:\n r0 = 1;\n r2 = r0;\n L_0x00cf:\n r0 = r13.tnv;\n if (r0 == 0) goto L_0x0146;\n L_0x00d3:\n if (r4 <= 0) goto L_0x0146;\n L_0x00d5:\n r0 = r13.tnf;\n r4 = r4 + -1;\n r0 = r0.get(r4);\n r0 = (com.tencent.mm.plugin.walletlock.gesture.a.f) r0;\n r4 = r0.tmv;\n r4 = r13.zP(r4);\n r0 = r0.tmu;\n r10 = r13.zQ(r0);\n r0 = java.lang.Math.min(r4, r3);\n r0 = r0 - r7;\n r3 = java.lang.Math.max(r4, r3);\n r5 = r3 + r7;\n r3 = java.lang.Math.min(r10, r1);\n r3 = r3 - r7;\n r1 = java.lang.Math.max(r10, r1);\n r4 = r1 + r7;\n if (r9 == 0) goto L_0x021d;\n L_0x0103:\n r1 = r13.tnx;\n r10 = 1056964608; // 0x3f000000 float:0.5 double:5.222099017E-315;\n r1 = r1 * r10;\n r10 = r13.tny;\n r11 = 1056964608; // 0x3f000000 float:0.5 double:5.222099017E-315;\n r10 = r10 * r11;\n r11 = r9.tmv;\n r11 = r13.zP(r11);\n r9 = r9.tmu;\n r9 = r13.zQ(r9);\n r12 = r11 - r1;\n r0 = java.lang.Math.min(r12, r0);\n r1 = r1 + r11;\n r5 = java.lang.Math.max(r1, r5);\n r1 = r9 - r10;\n r1 = java.lang.Math.min(r1, r3);\n r3 = r9 + r10;\n r3 = java.lang.Math.max(r3, r4);\n r4 = r5;\n L_0x0131:\n r5 = r13.tnd;\n r0 = java.lang.Math.round(r0);\n r1 = java.lang.Math.round(r1);\n r4 = java.lang.Math.round(r4);\n r3 = java.lang.Math.round(r3);\n r5.union(r0, r1, r4, r3);\n L_0x0146:\n r0 = r6 + 1;\n r6 = r0;\n goto L_0x008f;\n L_0x014b:\n r0 = r14.getX();\n r3 = r0;\n goto L_0x009a;\n L_0x0152:\n r0 = r14.getY();\n r1 = r0;\n goto L_0x00a1;\n L_0x0159:\n r0 = r14.getX();\n r13.tnt = r0;\n r0 = r13.tnt;\n r1 = r13.getPaddingLeft();\n r3 = r13.tni;\n r1 = r1 + r3;\n r1 = (float) r1;\n r0 = (r0 > r1 ? 1 : (r0 == r1 ? 0 : -1));\n if (r0 >= 0) goto L_0x01ad;\n L_0x016d:\n r0 = r13.getPaddingLeft();\n r1 = r13.tni;\n r0 = r0 + r1;\n r0 = (float) r0;\n r13.tnt = r0;\n L_0x0177:\n r0 = r14.getY();\n r13.tnu = r0;\n r0 = r13.tnu;\n r1 = r13.getPaddingTop();\n r3 = r13.tni;\n r1 = r1 + r3;\n r1 = (float) r1;\n r0 = (r0 > r1 ? 1 : (r0 == r1 ? 0 : -1));\n if (r0 >= 0) goto L_0x01da;\n L_0x018b:\n r0 = r13.getPaddingTop();\n r1 = r13.tni;\n r0 = r0 + r1;\n r0 = (float) r0;\n r13.tnu = r0;\n L_0x0195:\n if (r2 == 0) goto L_0x01aa;\n L_0x0197:\n r0 = r13.tne;\n r1 = r13.tnd;\n r0.union(r1);\n r0 = r13.tne;\n r13.invalidate(r0);\n r0 = r13.tne;\n r1 = r13.tnd;\n r0.set(r1);\n L_0x01aa:\n r0 = 1;\n goto L_0x000b;\n L_0x01ad:\n r0 = r13.tnt;\n r1 = r13.getPaddingLeft();\n r3 = r13.getWidth();\n r1 = r1 + r3;\n r3 = r13.getPaddingRight();\n r1 = r1 - r3;\n r3 = r13.tni;\n r1 = r1 - r3;\n r1 = (float) r1;\n r0 = (r0 > r1 ? 1 : (r0 == r1 ? 0 : -1));\n if (r0 <= 0) goto L_0x0177;\n L_0x01c5:\n r0 = r13.getPaddingLeft();\n r1 = r13.getWidth();\n r0 = r0 + r1;\n r1 = r13.getPaddingRight();\n r0 = r0 - r1;\n r1 = r13.tni;\n r0 = r0 - r1;\n r0 = (float) r0;\n r13.tnt = r0;\n goto L_0x0177;\n L_0x01da:\n r0 = r13.tnu;\n r1 = r13.getPaddingTop();\n r3 = r13.getHeight();\n r1 = r1 + r3;\n r3 = r13.getPaddingRight();\n r1 = r1 - r3;\n r3 = r13.tni;\n r1 = r1 - r3;\n r1 = (float) r1;\n r0 = (r0 > r1 ? 1 : (r0 == r1 ? 0 : -1));\n if (r0 <= 0) goto L_0x0195;\n L_0x01f2:\n r0 = r13.getPaddingTop();\n r1 = r13.getHeight();\n r0 = r0 + r1;\n r1 = r13.getPaddingBottom();\n r0 = r0 - r1;\n r1 = r13.tni;\n r0 = r0 - r1;\n r0 = (float) r0;\n r13.tnu = r0;\n goto L_0x0195;\n L_0x0207:\n r0 = r13.tnv;\n if (r0 == 0) goto L_0x021a;\n L_0x020b:\n r0 = 0;\n r13.tnv = r0;\n r13.bOS();\n r0 = r13.tnz;\n if (r0 == 0) goto L_0x021a;\n L_0x0215:\n r0 = r13.tnz;\n r0.a(r13);\n L_0x021a:\n r0 = 1;\n goto L_0x000b;\n L_0x021d:\n r1 = r3;\n r3 = r4;\n r4 = r5;\n goto L_0x0131;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.tencent.mm.plugin.walletlock.gesture.ui.widget.PatternLockView.onTouchEvent(android.view.MotionEvent):boolean\");\n }", "private void blockUntilDone(android.media.AudioTrack r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e3 in method: android.speech.tts.BlockingAudioTrack.blockUntilDone(android.media.AudioTrack):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.speech.tts.BlockingAudioTrack.blockUntilDone(android.media.AudioTrack):void\");\n }", "public void mo1404d() {\n if (CarlifeConfig.m4065a()) {\n LogUtil.d(f2837a, \"onResume: Internal screen capture not send forground msg.\");\n return;\n }\n LogUtil.d(f2837a, \"onResume: full screen capture send forground msg.\");\n BtHfpProtocolHelper.m3442a(false, true);\n }", "public static void m5825e() {\n if (f4669a != null) {\n f4669a.m12578a(\"Background_webview_fail\", null);\n }\n Answers.getInstance().logCustom(new CustomEvent(\"Background_webview_fail\"));\n }", "private void m3387b(android.view.MotionEvent r7) {\n /*\n r6 = this;\n r0 = 0;\n r6.f2686t = r0;\n r1 = r7.getAction();\n r2 = 1;\n if (r1 != r2) goto L_0x0012;\n L_0x000a:\n r1 = r6.isEnabled();\n if (r1 == 0) goto L_0x0012;\n L_0x0010:\n r1 = 1;\n goto L_0x0013;\n L_0x0012:\n r1 = 0;\n L_0x0013:\n r3 = r6.isChecked();\n if (r1 == 0) goto L_0x004a;\n L_0x0019:\n r1 = r6.f2690x;\n r4 = 1000; // 0x3e8 float:1.401E-42 double:4.94E-321;\n r1.computeCurrentVelocity(r4);\n r1 = r6.f2690x;\n r1 = r1.getXVelocity();\n r4 = java.lang.Math.abs(r1);\n r5 = r6.f2691y;\n r5 = (float) r5;\n r4 = (r4 > r5 ? 1 : (r4 == r5 ? 0 : -1));\n if (r4 <= 0) goto L_0x0045;\n L_0x0031:\n r4 = android.support.v7.widget.bg.m3615a(r6);\n r5 = 0;\n if (r4 == 0) goto L_0x003f;\n L_0x0038:\n r1 = (r1 > r5 ? 1 : (r1 == r5 ? 0 : -1));\n if (r1 >= 0) goto L_0x003d;\n L_0x003c:\n goto L_0x0043;\n L_0x003d:\n r2 = 0;\n goto L_0x0043;\n L_0x003f:\n r1 = (r1 > r5 ? 1 : (r1 == r5 ? 0 : -1));\n if (r1 <= 0) goto L_0x003d;\n L_0x0043:\n r1 = r2;\n goto L_0x004b;\n L_0x0045:\n r1 = r6.getTargetCheckedState();\n goto L_0x004b;\n L_0x004a:\n r1 = r3;\n L_0x004b:\n if (r1 == r3) goto L_0x0050;\n L_0x004d:\n r6.playSoundEffect(r0);\n L_0x0050:\n r6.setChecked(r1);\n r6.m3383a(r7);\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.support.v7.widget.SwitchCompat.b(android.view.MotionEvent):void\");\n }", "private void m7280d() {\n if (this.f5512c == null) {\n try {\n this.f5512c = new C0036q(this.f5510a);\n } catch (IOException e) {\n StringBuilder sb = new StringBuilder();\n sb.append(\"Could not open log file: \");\n sb.append(this.f5510a);\n C0135c.m449h().mo280e(\"CrashlyticsCore\", sb.toString(), e);\n }\n }\n }", "public final synchronized void cIY() {\n int i = 0;\n synchronized (this) {\n AppMethodBeat.m2504i(4443);\n C4990ab.m7417i(\"MicroMsg.Voip.VoipDeviceHandler\", \"stopDev, recorder: %s\", this.kzb);\n int i2;\n if (this.kzf == kze) {\n C46317a.Loge(\"MicroMsg.Voip.VoipDeviceHandler\", \"devcie stoped already.\");\n i2 = this.kzi;\n synchronized (i2) {\n if (this.kzb != null) {\n C4990ab.m7412e(\"MicroMsg.Voip.VoipDeviceHandler\", \"status DEV_STOP, but recorder still not null!!\");\n this.kzb.mo4590EB();\n }\n }\n } else {\n C46317a.Logi(\"MicroMsg.Voip.VoipDeviceHandler\", \"stop device..\");\n this.kzf = kze;\n if (this.sQa != null) {\n C46317a.Logd(\"MicroMsg.Voip.VoipDeviceHandler\", \"stop videodecode thread..\");\n this.sQa.sQd = true;\n C7305d.xDG.remove(this.sQa);\n this.sQa = null;\n }\n this.kzh = 1;\n this.sPR = 0;\n this.kzk = 1;\n this.sPW = 1;\n this.kzl = 0;\n this.sPX = 0;\n this.kzg = 92;\n this.sPM = 0;\n this.sPN = 0;\n this.sPO = 1;\n this.sPP = 0;\n this.kzj = 0;\n this.sNl.sPp.sUo = cIX();\n this.sNl.sPp.sUp = cIs();\n v2protocal v2protocal = this.sNl.sPp;\n if (this.kzb == null || this.sNl.sPp.sVH.sQo != (byte) 1) {\n i2 = -2;\n } else {\n i2 = this.kzb.mo4594EO();\n }\n v2protocal.sUs = i2;\n v2protocal v2protocal2 = this.sNl.sPp;\n if (this.sPL != null && this.sNl.sPp.sVH.sQo == (byte) 1) {\n i = this.sPL.cIt();\n }\n v2protocal2.sUz = (int) ((((float) C1407g.m2946KK().getStreamVolume(i)) / ((float) C1407g.m2946KK().getStreamMaxVolume(i))) * 100.0f);\n Object obj = this.kzi;\n synchronized (obj) {\n if (!(this.sPL == null || this.kzb == null)) {\n C7305d.m12298f(new C35354a(this.sPL, this.kzb), \"VoipDeviceHandler_stopDev\");\n C4990ab.m7416i(\"MicroMsg.Voip.VoipDeviceHandler\", \"do stop record\");\n }\n AppMethodBeat.m2505o(4443);\n }\n }\n AppMethodBeat.m2505o(4443);\n }\n }", "public void run() {\n /*\n r4 = this;\n r0 = r4.f5769a;\n r0 = r0.f13860b;\n r0.lock();\n r0 = java.lang.Thread.interrupted();\t Catch:{ RuntimeException -> 0x001f }\n if (r0 == 0) goto L_0x0019;\n L_0x000f:\n r0 = r4.f5769a;\n r0 = r0.f13860b;\n r0.unlock();\n return;\n L_0x0019:\n r4.mo1580a();\t Catch:{ RuntimeException -> 0x001f }\n goto L_0x000f;\n L_0x001d:\n r0 = move-exception;\n goto L_0x003c;\n L_0x001f:\n r0 = move-exception;\n r1 = r4.f5769a;\t Catch:{ all -> 0x001d }\n r1 = r1.f13859a;\t Catch:{ all -> 0x001d }\n r2 = r1.f17280e;\t Catch:{ all -> 0x001d }\n r3 = 2;\n r0 = r2.obtainMessage(r3, r0);\t Catch:{ all -> 0x001d }\n r1 = r1.f17280e;\t Catch:{ all -> 0x001d }\n r1.sendMessage(r0);\t Catch:{ all -> 0x001d }\n r0 = r4.f5769a;\n r0 = r0.f13860b;\n r0.unlock();\n return;\n L_0x003c:\n r1 = r4.f5769a;\n r1 = r1.f13860b;\n r1.unlock();\n throw r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.common.api.internal.zzay.run():void\");\n }", "public final com.google.android.gms.internal.ads.zzafx mo4170d() {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n*/\n /*\n r2 = this;\n r0 = r2.f19705f;\n monitor-enter(r0);\n r1 = r2.f19706g;\t Catch:{ IllegalStateException -> 0x000d, IllegalStateException -> 0x000d }\n r1 = r1.m26175a();\t Catch:{ IllegalStateException -> 0x000d, IllegalStateException -> 0x000d }\n monitor-exit(r0);\t Catch:{ all -> 0x000b }\n return r1;\t Catch:{ all -> 0x000b }\n L_0x000b:\n r1 = move-exception;\t Catch:{ all -> 0x000b }\n goto L_0x0010;\t Catch:{ all -> 0x000b }\n L_0x000d:\n r1 = 0;\t Catch:{ all -> 0x000b }\n monitor-exit(r0);\t Catch:{ all -> 0x000b }\n return r1;\t Catch:{ all -> 0x000b }\n L_0x0010:\n monitor-exit(r0);\t Catch:{ all -> 0x000b }\n throw r1;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.internal.ads.zzafn.d():com.google.android.gms.internal.ads.zzafx\");\n }", "@Override\r\n\t\t\tpublic void onStallWarning(StallWarning arg0) {\n\t\t\t\tSystem.out.println(\"Stalling\" + arg0.toString());\r\n\r\n\t\t\t}", "public final void b() {\n /*\n r9 = this;\n r0 = 0\n java.lang.Object[] r1 = new java.lang.Object[r0]\n com.meituan.robust.ChangeQuickRedirect r3 = f53268a\n java.lang.Class[] r6 = new java.lang.Class[r0]\n java.lang.Class r7 = java.lang.Void.TYPE\n r4 = 0\n r5 = 55519(0xd8df, float:7.7799E-41)\n r2 = r9\n boolean r1 = com.meituan.robust.PatchProxy.isSupport(r1, r2, r3, r4, r5, r6, r7)\n if (r1 == 0) goto L_0x0025\n java.lang.Object[] r2 = new java.lang.Object[r0]\n com.meituan.robust.ChangeQuickRedirect r4 = f53268a\n r5 = 0\n r6 = 55519(0xd8df, float:7.7799E-41)\n java.lang.Class[] r7 = new java.lang.Class[r0]\n java.lang.Class r8 = java.lang.Void.TYPE\n r3 = r9\n com.meituan.robust.PatchProxy.accessDispatch(r2, r3, r4, r5, r6, r7, r8)\n return\n L_0x0025:\n com.ss.android.ugc.aweme.live.alphaplayer.e$j r0 = com.ss.android.ugc.aweme.live.alphaplayer.e.g\n monitor-enter(r0)\n r1 = 1\n r9.h = r1 // Catch:{ all -> 0x0044 }\n com.ss.android.ugc.aweme.live.alphaplayer.e$j r1 = com.ss.android.ugc.aweme.live.alphaplayer.e.g // Catch:{ all -> 0x0044 }\n r1.notifyAll() // Catch:{ all -> 0x0044 }\n L_0x0030:\n boolean r1 = r9.f53269b // Catch:{ all -> 0x0044 }\n if (r1 != 0) goto L_0x0042\n com.ss.android.ugc.aweme.live.alphaplayer.e$j r1 = com.ss.android.ugc.aweme.live.alphaplayer.e.g // Catch:{ InterruptedException -> 0x003a }\n r1.wait() // Catch:{ InterruptedException -> 0x003a }\n goto L_0x0030\n L_0x003a:\n java.lang.Thread r1 = java.lang.Thread.currentThread() // Catch:{ all -> 0x0044 }\n r1.interrupt() // Catch:{ all -> 0x0044 }\n goto L_0x0030\n L_0x0042:\n monitor-exit(r0) // Catch:{ all -> 0x0044 }\n return\n L_0x0044:\n r1 = move-exception\n monitor-exit(r0) // Catch:{ all -> 0x0044 }\n throw r1\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.ss.android.ugc.aweme.live.alphaplayer.e.i.b():void\");\n }", "public static void m1526w(String msg) {\n if (isDebug) {\n Log.w(TAG, msg);\n }\n }", "private int getWakeupSrcIndex(java.lang.String r8) {\n /*\n r7 = this;\n int r0 = r8.hashCode()\n r1 = 5\n r2 = 4\n r3 = 3\n r4 = 2\n r5 = 1\n r6 = -1\n switch(r0) {\n case -952838356: goto L_0x004d;\n case -392237989: goto L_0x0043;\n case -190005216: goto L_0x0038;\n case -135250500: goto L_0x002e;\n case 692591870: goto L_0x0024;\n case 693992349: goto L_0x0019;\n case 1315079558: goto L_0x000e;\n default: goto L_0x000d;\n }\n L_0x000d:\n goto L_0x0058\n L_0x000e:\n java.lang.String r0 = \"keyguard_screenon_notification\"\n boolean r0 = r8.equals(r0)\n if (r0 == 0) goto L_0x000d\n r0 = r4\n goto L_0x0059\n L_0x0019:\n java.lang.String r0 = \"lid switch open\"\n boolean r0 = r8.equals(r0)\n if (r0 == 0) goto L_0x000d\n r0 = 6\n goto L_0x0059\n L_0x0024:\n java.lang.String r0 = \"android.policy:LID\"\n boolean r0 = r8.equals(r0)\n if (r0 == 0) goto L_0x000d\n r0 = r1\n goto L_0x0059\n L_0x002e:\n java.lang.String r0 = \"android.policy:POWER\"\n boolean r0 = r8.equals(r0)\n if (r0 == 0) goto L_0x000d\n r0 = 0\n goto L_0x0059\n L_0x0038:\n java.lang.String r0 = \"miui.policy:FINGERPRINT_DPAD_CENTER\"\n boolean r0 = r8.equals(r0)\n if (r0 == 0) goto L_0x000d\n r0 = r5\n goto L_0x0059\n L_0x0043:\n java.lang.String r0 = \"android.policy:FINGERPRINT\"\n boolean r0 = r8.equals(r0)\n if (r0 == 0) goto L_0x000d\n r0 = r2\n goto L_0x0059\n L_0x004d:\n java.lang.String r0 = \"keyguard_screenon_finger_pass\"\n boolean r0 = r8.equals(r0)\n if (r0 == 0) goto L_0x000d\n r0 = r3\n goto L_0x0059\n L_0x0058:\n r0 = r6\n L_0x0059:\n switch(r0) {\n case 0: goto L_0x0061;\n case 1: goto L_0x0060;\n case 2: goto L_0x005f;\n case 3: goto L_0x005e;\n case 4: goto L_0x005e;\n case 5: goto L_0x005d;\n case 6: goto L_0x005d;\n default: goto L_0x005c;\n }\n L_0x005c:\n return r6\n L_0x005d:\n return r1\n L_0x005e:\n return r2\n L_0x005f:\n return r3\n L_0x0060:\n return r4\n L_0x0061:\n return r5\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.server.ScreenOnMonitor.getWakeupSrcIndex(java.lang.String):int\");\n }", "private void screenOffBroadcast() {\n if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {\n mDoScreenOff = true;\n }\n // prize add v8.0 by zhaojian 20171102 end\n\n Intent intent = new Intent(\"prize.set.keyguard.state\");\n intent.putExtra(\"hide\",false);\n intent.putExtra(\"sleep\",true);\n getContext().sendBroadcast(intent);\n flags = false;\n // prize add v8.0 by zhaojian 20171102 start\n beforeIsLock = false;\n // prize add v8.0 by zhaojian 20171102 end\n\n handler.removeMessages(1);\n\n // prize add v8.0 by zhaojian 2017912 start\n if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N){\n mIsAutoEnterReceiveUi = false;\n }\n // prize add v8.0 by zhaojian 2017912 end\n Log.d(TAG,\"screen off\");\n }", "AnonymousClass1(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01 r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e8 in method: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.1.<init>(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.1.<init>(com.mediatek.internal.telephony.worldphone.WorldPhoneOp01):void\");\n }", "public void mo5832b(android.content.Context r4) {\n /*\n r3 = this;\n r0 = 1\n java.lang.String r1 = m3304x() // Catch:{ a -> 0x002f, IOException -> 0x0027 }\n r3.mo5830a(r0, r1) // Catch:{ a -> 0x002f, IOException -> 0x0027 }\n L_0x0008:\n r0 = 2\n java.lang.String r1 = m3302v() // Catch:{ a -> 0x002d, IOException -> 0x0027 }\n r3.mo5830a(r0, r1) // Catch:{ a -> 0x002d, IOException -> 0x0027 }\n L_0x0010:\n r0 = 25\n java.lang.Long r1 = m3303w() // Catch:{ a -> 0x002b, IOException -> 0x0027 }\n long r1 = r1.longValue() // Catch:{ a -> 0x002b, IOException -> 0x0027 }\n r3.mo5829a(r0, r1) // Catch:{ a -> 0x002b, IOException -> 0x0027 }\n L_0x001d:\n r0 = 24\n java.lang.String r1 = m3300d(r4) // Catch:{ a -> 0x0029, IOException -> 0x0027 }\n r3.mo5830a(r0, r1) // Catch:{ a -> 0x0029, IOException -> 0x0027 }\n L_0x0026:\n return\n L_0x0027:\n r0 = move-exception\n goto L_0x0026\n L_0x0029:\n r0 = move-exception\n goto L_0x0026\n L_0x002b:\n r0 = move-exception\n goto L_0x001d\n L_0x002d:\n r0 = move-exception\n goto L_0x0010\n L_0x002f:\n r0 = move-exception\n goto L_0x0008\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.internal.C1107j.mo5832b(android.content.Context):void\");\n }", "private void a() {\n /*\n r9 = this;\n r8 = 2131755623; // 0x7f100267 float:1.914213E38 double:1.0532272187E-314;\n r7 = 2131755379; // 0x7f100173 float:1.9141636E38 double:1.053227098E-314;\n r6 = 8;\n r5 = 0;\n r1 = com.whatsapp.DialogToastActivity.f;\n r0 = r9.C;\t Catch:{ SecurityException -> 0x0093 }\n r0 = r0.getCount();\t Catch:{ SecurityException -> 0x0093 }\n if (r0 != 0) goto L_0x0086;\n L_0x0013:\n r0 = r9.w;\t Catch:{ SecurityException -> 0x0095 }\n if (r0 != 0) goto L_0x0030;\n L_0x0017:\n r0 = 2131755379; // 0x7f100173 float:1.9141636E38 double:1.053227098E-314;\n r0 = r9.findViewById(r0);\t Catch:{ SecurityException -> 0x0097 }\n r2 = 8;\n r0.setVisibility(r2);\t Catch:{ SecurityException -> 0x0097 }\n r0 = 2131755623; // 0x7f100267 float:1.914213E38 double:1.0532272187E-314;\n r0 = r9.findViewById(r0);\t Catch:{ SecurityException -> 0x0097 }\n r2 = 0;\n r0.setVisibility(r2);\t Catch:{ SecurityException -> 0x0097 }\n if (r1 == 0) goto L_0x0079;\n L_0x0030:\n r0 = r9.y;\t Catch:{ SecurityException -> 0x0099 }\n if (r0 == 0) goto L_0x005f;\n L_0x0034:\n r0 = r9.y;\t Catch:{ SecurityException -> 0x0099 }\n r0 = r0.isEmpty();\t Catch:{ SecurityException -> 0x0099 }\n if (r0 != 0) goto L_0x005f;\n L_0x003c:\n r0 = r9.findViewById(r7);\n r0 = (android.widget.TextView) r0;\n r0.setVisibility(r5);\n r2 = 2131231851; // 0x7f08046b float:1.8079795E38 double:1.052968441E-314;\n r3 = 1;\n r3 = new java.lang.Object[r3];\n r4 = r9.x;\n r3[r5] = r4;\n r2 = r9.getString(r2, r3);\n r0.setText(r2);\n r0 = r9.findViewById(r8);\n r0.setVisibility(r6);\n if (r1 == 0) goto L_0x0079;\n L_0x005f:\n r0 = r9.findViewById(r7);\n r0 = (android.widget.TextView) r0;\n r0.setVisibility(r5);\n r2 = 2131231552; // 0x7f080340 float:1.8079188E38 double:1.052968293E-314;\n r2 = r9.getString(r2);\n r0.setText(r2);\n r0 = r9.findViewById(r8);\n r0.setVisibility(r6);\n L_0x0079:\n r0 = 16908292; // 0x1020004 float:2.387724E-38 double:8.353806E-317;\n r0 = r9.findViewById(r0);\t Catch:{ SecurityException -> 0x009b }\n r2 = 0;\n r0.setVisibility(r2);\t Catch:{ SecurityException -> 0x009b }\n if (r1 == 0) goto L_0x0092;\n L_0x0086:\n r0 = 16908292; // 0x1020004 float:2.387724E-38 double:8.353806E-317;\n r0 = r9.findViewById(r0);\t Catch:{ SecurityException -> 0x009b }\n r1 = 8;\n r0.setVisibility(r1);\t Catch:{ SecurityException -> 0x009b }\n L_0x0092:\n return;\n L_0x0093:\n r0 = move-exception;\n throw r0;\t Catch:{ SecurityException -> 0x0095 }\n L_0x0095:\n r0 = move-exception;\n throw r0;\t Catch:{ SecurityException -> 0x0097 }\n L_0x0097:\n r0 = move-exception;\n throw r0;\t Catch:{ SecurityException -> 0x0099 }\n L_0x0099:\n r0 = move-exception;\n throw r0;\n L_0x009b:\n r0 = move-exception;\n throw r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.whatsapp.DocumentPickerActivity.a():void\");\n }", "public synchronized void m29984l() {\n if (XGPushConfig.enableDebug) {\n C6864a.m29298c(\"TpnsChannel\", \"Action -> send heartbeatSlave \");\n }\n f23274i++;\n mo33398h();\n if (C6973b.m29763a().mo33291f(C6973b.m29776f())) {\n if (!C7048a.m30142d(C6973b.m29776f())) {\n C6864a.m29308i(Constants.ServiceLogTag, \"network is unreachable ,give up and go on slave service\");\n } else if (C6973b.m29776f() != null) {\n C6901c.m29459a().mo33104a((Runnable) new Runnable() {\n public void run() {\n boolean isForeiginPush = XGPushConfig.isForeiginPush(C6973b.m29776f());\n String str = Constants.ACTION_SLVAE_2_MAIN;\n String str2 = Constants.ServiceLogTag;\n if (isForeiginPush) {\n C6864a.m29308i(str2, \"isForeiginPush network is ok , switch to main service\");\n C6973b.m29767a(C6973b.m29776f(), str, 0);\n } else if (C6979b.m29795a(C6973b.m29776f()).mo33300b()) {\n C6864a.m29308i(str2, \"network is ok , switch to main service\");\n C6973b.m29767a(C6973b.m29776f(), str, 0);\n } else {\n C6864a.m29308i(str2, \"network is error , go on slave service\");\n }\n }\n });\n } else {\n C6864a.m29308i(Constants.ServiceLogTag, \"PushServiceManager.getInstance().getContext() is null\");\n }\n }\n }", "public void waitAndRelease() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.speech.tts.BlockingAudioTrack.waitAndRelease():void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.speech.tts.BlockingAudioTrack.waitAndRelease():void\");\n }" ]
[ "0.6195913", "0.61084723", "0.6033287", "0.6024902", "0.5993959", "0.59035265", "0.5849819", "0.58322066", "0.5813758", "0.58033234", "0.57915", "0.5784706", "0.566057", "0.5625721", "0.5621208", "0.56069857", "0.55671495", "0.5545102", "0.5540292", "0.55330753", "0.5517494", "0.5483126", "0.54789025", "0.54703784", "0.5443777", "0.5428908", "0.5421176", "0.53718954", "0.53694767", "0.5312591", "0.529562", "0.5288918", "0.52728623", "0.52717483", "0.52702796", "0.5268893", "0.5257926", "0.5224855", "0.521119", "0.519064", "0.5190293", "0.5188475", "0.51865137", "0.51830727", "0.51774347", "0.51760954", "0.51659495", "0.51477724", "0.5146718", "0.5144293", "0.5135714", "0.51287127", "0.5126895", "0.5126717", "0.51252294", "0.511536", "0.5102965", "0.51011544", "0.5097207", "0.5096049", "0.50828874", "0.5068626", "0.50588095", "0.50543016", "0.5050761", "0.50449014", "0.5042796", "0.5038443", "0.50371265", "0.5035148", "0.5031583", "0.5026346", "0.5025308", "0.5012969", "0.50125223", "0.50097734", "0.50089985", "0.5008906", "0.5006381", "0.5006009", "0.49980825", "0.4997834", "0.49959254", "0.4995604", "0.49938944", "0.4992702", "0.49925098", "0.4977665", "0.4972756", "0.49670234", "0.4966552", "0.49630028", "0.4959406", "0.49563903", "0.4949067", "0.49472833", "0.4946817", "0.4943897", "0.49431407", "0.49429786", "0.49397403" ]
0.0
-1
if( miscbutton.getText() == "0" ) miscbutton.setText("");
@Override public void onClick(View view) { Intent intent = new Intent(MainActivity.this, TAXActivity.class); // Intent intent = new Intent(MainActivity.this, Main3Activity.class); startActivity(intent); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void button0OnClick(View view){ display.setText(display.getText()+ \"0\");}", "private void handleButton(JButton button)\n\t{\n\t\tif(button.getText().equals(\"0\")){\n\t\t\tbutton.setText(\"\");\n\t\t\tbutton.setBackground(Color.WHITE);\n\t\t\tbutton.setOpaque(true);\n\t\t} else{\n\t\t\tbutton.setBackground(Color.lightGray);\n\t\t\tbutton.setOpaque(true);\n\t\t}\n\t}", "private void clearAll(){\n txtBox.setText(\"\");\n calc.setNum1(0);\n calc.setNum2(0);\n calc.setOperator('0');\n operatorPressed = false;\n initialised = false;\n equals = false;\n }", "public void btnC(View v) {\n\n if (!displayResult.getText().equals(\"0\")) {\n\n int widthString = displayResult.getText().length();\n\n StringBuffer buffer = new StringBuffer( displayResult.getText());\n\n buffer.delete(widthString-1, widthString);\n\n displayResult.setText(buffer.toString());\n\n if (displayResult.getText().equals(\"\")) {\n\n displayResult.setText(\"0\");\n point = false;\n\n }\n }\n }", "private void btClearActionPerformed(java.awt.event.ActionEvent evt) {\n if(tbphieuphat.isEnabled())\n txMaPM.setText(\"\");\n /*if(EditOrSearch==0){\n tf.setText(\"\");\n txSoLuongMax.setText(\"\");\n txDonGiaMax.setText(\"\");\n }*/\n txMaPM.setText(\"\");\n txTongTien.setText(\"\");\n }", "public void resetButton()\n {\n for(int row = 0; row<TicTacToe.SIDE; row++)\n for(int col= 0; col<TicTacToe.SIDE;col++)\n buttons[row][col].setText(\"\");\n }", "public void buttonClearViewOnClick(View view){\n display.setText(\"\");\n operation= \"\";\n result = 0;\n}", "private void bLimparClick() {\n tfValor1.setText(\"\");\n tfValor2.setText(\"\");\n //this.setVisible(false);\n }", "public void buttonCE (View view){\n resultView.setText(\"0\");\n result = 0;\n }", "public void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\t\t\tif( txt_showresult.getText().equals( \"0\" )){ \n\t\t\t\t\t\t\t\ttxt_showresult.setText(\"0\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// if textfield show other value , add number after the value\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\ttxt_showresult.setText( txt_showresult.getText() + \"0\");\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t}", "private void zeroJButtonActionPerformed(ActionEvent event) {\n securityCodeJPasswordField.setText(String.valueOf(\n securityCodeJPasswordField.getPassword()) + \"0\");\n\n }", "public void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\t\t\tif( txt_showresult.getText().equals( \"0\" )){ \n\t\t\t\t\t\t\t\ttxt_showresult.setText(\"8\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// if textfield show other value , add number after the value\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\ttxt_showresult.setText( txt_showresult.getText() + \"8\");\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t}", "public void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\t\t\tif( txt_showresult.getText().equals( \"0\" )){ \n\t\t\t\t\t\t\t\ttxt_showresult.setText(\"1\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// if textfield show other value , add number after the value\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\ttxt_showresult.setText( txt_showresult.getText() + \"1\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}", "public void reset() {\r\n\r\n b1.setText(\"\");\r\n b1.setEnabled(true);\r\n\r\n b2.setText(\"\");\r\n b2.setEnabled(true);\r\n\r\n b3.setText(\"\");\r\n b3.setEnabled(true);\r\n\r\n b4.setText(\"\");\r\n b4.setEnabled(true);\r\n\r\n b5.setText(\"\");\r\n b5.setEnabled(true);\r\n\r\n b6.setText(\"\");\r\n b6.setEnabled(true);\r\n\r\n b7.setText(\"\");\r\n b7.setEnabled(true);\r\n\r\n b8.setText(\"\");\r\n b8.setEnabled(true);\r\n\r\n b9.setText(\"\");\r\n b9.setEnabled(true);\r\n\r\n win = false;\r\n count = 0;\r\n }", "public void clearAnswer(){\r\n textField1.setText(\"\");\r\n }", "public void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\t\t\tif( txt_showresult.getText().equals( \"0\" )){ \n\t\t\t\t\t\t\t\ttxt_showresult.setText(\"9\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// if textfield show other value , add number after the value\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\ttxt_showresult.setText( txt_showresult.getText() + \"9\");\n\t\t\t\t\t\t\t}\t\t\n\t\t\t\t\t\t}", "public void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\t\t\tif( txt_showresult.getText().equals( \"0\" )){ \n\t\t\t\t\t\t\t\ttxt_showresult.setText(\"7\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// if textfield show other value , add number after the value\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\ttxt_showresult.setText( txt_showresult.getText() + \"7\");\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t}", "public void ClearAdd(){\n \n PID.setText(\"\");\n MN.setText(\"\");\n PN.setText(\"\");\n price.setText(\"\");\n category.setSelectedIndex(0);\n buttonGroup1.clearSelection();\n }", "private void jbtn_resetActionPerformed(ActionEvent evt) {\n\t\t\t\ttxtblank();\n\t\t\t\t\n\t\t\t}", "public void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\t\t\tif( txt_showresult.getText().equals( \"0\" )){ \n\t\t\t\t\t\t\t\ttxt_showresult.setText(\"5\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// if textfield show other value , add number after the value\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\ttxt_showresult.setText( txt_showresult.getText() + \"5\");\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t}", "public void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\t\t\tif( txt_showresult.getText().equals( \"0\" )){ \n\t\t\t\t\t\t\t\ttxt_showresult.setText(\"6\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// if textfield show other value , add number after the value\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\ttxt_showresult.setText( txt_showresult.getText() + \"6\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}", "public void buttonAC (View view){\n resultView.setText(\"0\");\n result = 0;\n expressionView.setText(\"\");\n result = 0;\n }", "public void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\t\t\tif( txt_showresult.getText().equals( \"0\" )){ \n\t\t\t\t\t\t\t\ttxt_showresult.setText(\"3\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// if textfield show other value , add number after the value\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\ttxt_showresult.setText( txt_showresult.getText() + \"3\");\n\t\t\t\t\t\t\t}\t\t\n\t\t\t\t\t\t}", "public void button0(View v) {\n\n /* Add the digit to the expression. */\n expression += \"0\";\n\n /* Update the screen. */\n TextView expressionText = (TextView) findViewById(R.id.expressionText);\n expressionText.setText(expression);\n }", "public void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\t\t\tif( txt_showresult.getText().equals( \"0\" )){ \n\t\t\t\t\t\t\t\ttxt_showresult.setText(\"2\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// if textfield show other value , add number after the value\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\ttxt_showresult.setText( txt_showresult.getText() + \"2\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}", "private void clearButton(Floor floor)\r\n\t{\r\n\t\t\tbuttonPanel[floor.getNumber()]=LiftButton.NOT_ACTIVE;\r\n\t}", "public void clear() {\n lb.setText(\"\");\n }", "public void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\t\t\tif( txt_showresult.getText().equals( \"0\" )){ \n\t\t\t\t\t\t\t\ttxt_showresult.setText(\"4\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// if textfield show other value , add number after the value\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\ttxt_showresult.setText( txt_showresult.getText() + \"4\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}", "private void btnClearActionPerformed(java.awt.event.ActionEvent evt) {\n txtSentence.setText(\"\");\n Result.setText(\"\");\n Vowel.setSelected(false);\n Notvowel.setSelected(false);\n V3.setSelected(false);\n }", "public void resetButtonAndText() {\n currentText = colorTxtArr[(int) (Math.random() * 5)];\n buttonColor = colorArr[(int) (Math.random() * 5)];\n colorText.setForeground(buttonColor);\n colorText.setText(currentText);\n }", "private void clearButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_clearButtonActionPerformed\n textArea.setText(null);\n }", "private void resetBtn1ActionPerformed(java.awt.event.ActionEvent evt) {\n resetBtnActionPerformed();\n }", "public void buttonClear(View v) {\n expression = \"\";\n\n TextView expressionText = (TextView) findViewById(R.id.expressionText);\n expressionText.setText(expression);\n\n EditText calculatorInput = (EditText) findViewById(R.id.calculatorInput);\n calculatorInput.setText(\"\");\n }", "private void clearTextBox(){\n txtBox.setText(\"\");\n }", "@Override\n public void onClick(View v) {\n tv.setText(\" \");\n positive = true;\n flag = true;\n temp = 0.0;\n }", "void switchButtons(Button currentButton){\n\n Button emptyButton = btns.get(zeroIndex);\n emptyButton.setLabel(currentButton.getLabel());\n currentButton.setLabel(\"\" + 0);\n emptyButton.setVisible(true);\n currentButton.setVisible(false);\n\n if (Integer.parseInt(btns.get(zeroIndex).getLabel()) == zeroIndex + 1){\n btnsStates.set(zeroIndex, true);\n } else {\n btnsStates.set(zeroIndex, false);\n }\n btnsStates.set(btns.indexOf(currentButton), true);\n zeroIndex = findZero();\n }", "public void clearBoard()\n {\n for (int i = 0; i < buttons.length; i++)\n {\n buttons[i].setText(\"\");\n }\n }", "private void tempBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tempBtnActionPerformed\n if (tempPress == 0) {\n tempPress = 1;\n\n jLabel9.setText(\"Current Temperature: \" + roboLogic.currentTemperature());\n\n } else {\n tempPress = 0;\n jLabel9.setText(\"\");\n }\n repaint();\n }", "public void resetBoardOnRestartClick()//when restart game\n {\n JOptionPane.showMessageDialog(view.getParent(),\"PLAYER \"+playerSymbol+\" HAS REQUESTED GAME RESET\");\n currentPlayer=1;\n playerSymbol=\"O\";\n JButton[][] board=view.getGameBoard();\n for(int i=0;i<dim;i++)\n {\n for(int j=0;j<dim;j++)\n {\n board[i][j].setText(\"\");\n }\n }\n }", "void btnClearPlanning();", "private void clearButtonActionPerformed(ActionEvent evt) {\r\n\t\tlogger.info(\"Clear button Clicked.\");\r\n\t\tinputTextField.setText(\"\");\r\n\t\toutputScoreTextArea.setText(\"\");\r\n\t}", "public void buttonMinus (View view){\n if (mIsTyping) {\n if (!resultView.getText().toString().equals(\"0\"))\n if (resultView.getText().toString().substring(0, 1).equals(\"-\"))\n resultView.setText(resultView.getText().toString().substring(1));\n else\n resultView.setText(\"-\" + resultView.getText());\n }\n }", "@Override\n public void onClick(View v) {\n resultDisplay.setText(String.valueOf(0));\n isDecimal = false;\n }", "public void actionPerformed(ActionEvent e) {\n screenTP.setText(\"\");\n\n }", "private void clearBtn1ActionPerformed(java.awt.event.ActionEvent evt) {\n modelTxt.setText(\"\");\n catCombo.setSelectedIndex(0);\n rentTxt.setText(\"\");\n }", "private void initButtonsAndTextFields(){\n delayTxt.setText(\"0\");\n delayTxt.setDisable(true);\n }", "public void clearButton(View view)\n {\n question1.clearCheck();\n question2.clearCheck();\n question33.clearCheck();\n question44.clearCheck();\n question55.clearCheck();\n score.setText(\"\");\n }", "public void b0 (View v) {\n Addtxt(\"0\");\n }", "public void gamereset() {\n Button tmp = (Button) findViewById(R.id.resetbutton);\n tmp.setVisibility(View.VISIBLE);\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tet1.setText(\"\");\n\t\t\t}", "public void clearBreakfastNutrition(){\n breakfastNutritionOne.setText(\"\");\n breakfastNutritionTwo.setText(\"\");\n }", "public void clearTotalNutrition(){\n totalNutritionOne.setText(\"\");\n totalNutritionTwo.setText(\"\");\n }", "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 }", "public void actionPerformed(ActionEvent e) {\n\t\t\t\tdisplayText.setText(displayText.getText() + \"0\");\n\t\t\t}", "private void clearxuan() {\n\t\tbtn_Fourgroup6_xuan_big.setBackgroundResource(0);\r\n\t\tbtn_Fourgroup6_xuan_little.setBackgroundResource(0);\r\n\t\tbtn_Fourgroup6_xuan_all.setBackgroundResource(0);\r\n\t\tbtn_Fourgroup6_xuan_odd.setBackgroundResource(0);\r\n\t\tbtn_Fourgroup6_xuan_even.setBackgroundResource(0);\r\n\t\tbtn_Fourgroup6_xuan_clear.setBackgroundResource(0);\r\n\t\tbtn_Fourgroup6_xuan_big.setTextColor(0xffcfcfcf);\r\n\t\tbtn_Fourgroup6_xuan_little.setTextColor(0xffcfcfcf);\r\n\t\tbtn_Fourgroup6_xuan_all.setTextColor(0xffcfcfcf);\r\n\t\tbtn_Fourgroup6_xuan_odd.setTextColor(0xffcfcfcf);\r\n\t\tbtn_Fourgroup6_xuan_even.setTextColor(0xffcfcfcf);\r\n\t\tbtn_Fourgroup6_xuan_clear.setTextColor(0xffcfcfcf);\r\n\r\n\t}", "@Override\r\n public void actionPerformed(ActionEvent e) {\n t6.setText(null);t7.setText(null);t8.setText(null);t9.setText(null);t10.setText(null);t11.setText(null);t12.setText(null);t13.setText(null);\r\n b7.setVisible(false); b10.setVisible(false);\r\n }", "private void btnResetActionPerformed(java.awt.event.ActionEvent evt) {\n reset(); \n }", "@Override\n\tpublic void onClick(View v) {\n\t\te1.setText(\"\");\n\t}", "public void buttonMod (View view){ expressionView.setText(expressionView.getText() + \"Mod\");}", "public void stringToZero(){\n\t\tif(var1.getText().toString().equals(\"\")){\n\t\t\tvar1.setText(\"0\");\n\t\t\tvarNum = 1;\n\t\t}\n\t\t\n\t\telse if(var2.getText().toString().equals(\"\")){\n\t\t\tvar2.setText(\"0\");\n\t\t\tvarNum = 2;\n\t\t}\n\t\t\n\t\telse if(var3.getText().toString().equals(\"\")){\n\t\t\tvar3.setText(\"0\");\n\t\t\tvarNum = 3;\n\t\t}\n\t\t\n\t\telse if(var4.getText().toString().equals(\"\")){\n\t\t\tvar4.setText(\"0\");\n\t\t\tvarNum = 4;\n\t\t}\n\t\telse{\n\t\t\tvarNum = 0;\n\t\t\t\n\t\t\t//Builds and displays a dialog\n\t\t\tAlertDialog.Builder builder = new AlertDialog.Builder(this);\n\t\t\tbuilder.setMessage(\"Leave your unknown variable blank\");\n\t\t builder.setTitle(\"Error\");\n\t\t \n\t\t AlertDialog dialog = builder.create();\n\t\t dialog.show();\n\t\t}\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tta1.setText(\" \");\r\n\t\t\t}", "private void clearJButtonActionPerformed(ActionEvent event) {\n securityCodeJPasswordField.setText(\"\");\n\n }", "@Override\n public void onClick(DialogInterface dialog, int which) {\n Utility.hideKeyBoard(editText, mContext);\n if (editText.getText().toString().trim().length() > 0) {\n pump_no.setText(editText.getText().toString().trim());\n } else {\n pump_no.setText(\"\");\n }\n }", "@FXML\r\n private void clearScreen() {\n if(flag==1)txtDisplay.setText(\"\");\r\n }", "public void clearText() {\n this.mBinding.text.setText(\"\");\n }", "public boolean hasNeutralButton(){\n return true;\n }", "public void onClickButton1(View view) {\n\n if (turn%2 == 0 && button1.getText()==\"·\"){\n button1.setText(\"O\");\n turn++;\n }\n else if (button1.getText()==\"·\"){\n button1.setText(\"X\");\n turn++;\n }\n\n }", "private void Button_BackSpaceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Button_BackSpaceActionPerformed\n // TODO add your handling code here:\n if(display.getText().length()!=0)\n {\n if(display.getText().charAt(display.getText().length()-1) == '.')\n {\n period = false;\n } \n \n display.setText(display.getText().substring(0, display.getText().length()-1));\n }\n if(display.getText() == null || display.getText().equals(\"\")) \n {\n display.setText(\"0\");\n }\n \n }", "private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { \n jTextArea1.setText(\"There Are No Alerts.\");\n data.clearAllAlertsForUser(user);\n }", "public void actionPerformed(ActionEvent e) {\n if (e.getSource() == btn1) {\n display.setText(display.getText() + \"1\");\n } else if (e.getSource() == btn2) {\n display.setText(display.getText() + \"2\");\n } else if (e.getSource() == btn3) {\n display.setText(display.getText() + \"3\");\n } else if (e.getSource() == btnPlus) {\n display.setText(display.getText() + \"+\");\n } else if (e.getSource() == btn4) {\n display.setText(display.getText() + \"4\");\n } else if (e.getSource() == btn5) {\n display.setText(display.getText() + \"5\");\n } else if (e.getSource() == btn6) {\n display.setText(display.getText() + \"6\");\n } else if (e.getSource() == btnMinus) {\n display.setText(display.getText() + \"-\");\n } else if (e.getSource() == btn7) {\n display.setText(display.getText() + \"7\");\n } else if (e.getSource() == btn8) {\n display.setText(display.getText() + \"8\");\n } else if (e.getSource() == btn9) {\n display.setText(display.getText() + \"9\");\n } else if (e.getSource() == btnMultiply) {\n display.setText(display.getText() + \"*\");\n } else if (e.getSource() == btn0) {\n display.setText(display.getText() + \"0\");\n } else if (e.getSource() == btnDivide) {\n display.setText(display.getText() + \"/\");\n } else if (e.getSource() == btnEqual) {\n String input = display.getText();\n String output = \"\";\n try {\n output = performCalculation(input);\n } catch (Exception ex) {\n output = \"ERROR\";\n }\n display.setText(output);\n } else if (e.getSource() == btnClear) {\n display.setText(\"\");\n }\n }", "private void opClick(java.awt.event.ActionEvent evt) {\n if (evt.getSource() instanceof JButton){\n JButton btn = (JButton) evt.getSource();\n switch(btn.getText()){\n case \"+\":\n case \"-\":\n case \"/\":\n case \"*\":\n case \"%\":\n case \"^\":\n case \".\":\n case \"!\":\n jTextField1.setText(jTextField1.getText() +btn.getText());\n break;\n default:\n if (!jTextField1.getText().equals(\"0\"))\n jTextField1.setText(jTextField1.getText() +btn.getText().toLowerCase().charAt(0));\n else\n jTextField1.setText(\"\" + btn.getText().toLowerCase().charAt(0));\n }\n }\n }", "private void clearValue(Event e)\n\t{\n\t\tif (e.getSource() == btnClear) \n\t\t{\n\t\t tfNum1.setText(\"\");\n\t\t tfNum2.setText(\"\");\n\t\t FinalAnswer.setText(\"\");\n\t\t FileMenu.setValue(\"\");\n\t\t tfNum1.requestFocus();\n\t\t return;\n\t\t}\n\t}", "@Override\n public void onClick(View v) {\n String checkBoulder = (String) completeBoulder.getText();\n // if button says \"Topped out!\"\n if (checkBoulder.equals(getResources().getString(R.string.topout_complete))){\n //do nothing\n }\n else {\n tries_title.setBackgroundColor(getResources().getColor(R.color.colorGreen));\n tries_title.setText(R.string.good_job);\n showTriesBox();\n }\n }", "@Override\npublic void actionPerformed(ActionEvent e) {\n\nJButton b1 = (JButton)(e.getSource());\n\tString text = b1.getText();\n\tSystem.out.println(\"buttn pressed \"+ text);\n\tcm.addADigit(text);\n\n\tcv.update();\n\n}", "void bsButtonHandling(){\n\n Boolean checkFlag = false;\n for(int i = 0; i < 4; ++i){\n if(operatorButtonClicked[i]){\n checkFlag = true;\n break;\n }\n }\n\n // -----------------------------------------------------\n // if an operator button was clicked then ignore BS\n if(checkFlag == false){\n numberOnDisplay = Integer.parseInt(display.getText().toString());\n numberOnDisplay = numberOnDisplay/10;\n display.setText(Integer.toString(numberOnDisplay));\n numberOnDisplay = 0;\n }\n }", "public void updateResetButton(){\n if (vertexImages.size() < 1){\n resetButton.setAlpha(0.5f);\n resetButton.setClickable(false);\n }\n else {\n resetButton.setAlpha(1f);\n resetButton.setClickable(true);\n }\n }", "@Override\n public void focusGained(FocusEvent arg0) {\n if(jtxt_balance.getText().contains(\"000\")){\n jtxt_balance.setText(\"\");\n }\n }", "@Override\n public void onClick(View v){\n setResult(RESULT_OK);\n if (textboxInitialValue.getText().length() > 0) {\n textboxInitialValue.setEnabled(false);\n buttonAddInitialValue.setEnabled(false);\n if (fieldsAreFilled()) {\n buttonSubmit.setEnabled(true);\n }\n }\n }", "@Override\n public void onClick(View arg0) {\n if (arg0 != null) {\n switch(arg0.getId()){\n case R.id.one:\n digitButtonPressed(\"1\");\n break;\n\n case R.id.two:\n digitButtonPressed(\"2\");\n break;\n\n case R.id.three:\n digitButtonPressed(\"3\");\n break;\n\n case R.id.four:\n digitButtonPressed(\"4\");\n break;\n\n case R.id.five:\n digitButtonPressed(\"5\");\n break;\n\n case R.id.six:\n digitButtonPressed(\"6\");\n break;\n\n case R.id.seven:\n digitButtonPressed(\"7\");\n break;\n\n case R.id.eight:\n digitButtonPressed(\"8\");\n break;\n\n case R.id.nine:\n digitButtonPressed(\"9\");\n break;\n\n case R.id.zero:\n digitButtonPressed(\"0\");\n break;\n\n case R.id.dot:\n digitButtonPressed(\".\");\n break;\n\n case R.id.add:\n symbolButtonPressed(\"+\");\n break;\n\n case R.id.subtract:\n symbolButtonPressed(\"-\");\n break;\n\n case R.id.multiply:\n symbolButtonPressed(\"x\");\n break;\n\n case R.id.divide:\n symbolButtonPressed(\"/\");\n break;\n\n case R.id.equal:\n pressedEqualButton();\n break;\n\n case R.id.clear:\n clear();\n break;\n\n case R.id.delete:\n pressedDeleteButton();\n break;\n\n default:\n loge(\"no support this operator, do nothing!\");\n break;\n }\n }\n }", "public void mouseClicked(MouseEvent e){\r\n \t input[num].setText(\"\");\r\n \t}", "public void clearBtn(View view){\n formula.editText(\"$$ $$\", 3);\r\n //formula.cursPosition = 3;\r\n refresh();\r\n\r\n }", "private JRadioButton getJRadioButtonButtZero() {\r\n\t\tif (buttZero == null) {\r\n\t\t\tbuttZero = new JRadioButton();\r\n\t\t\tbuttZero.setText(\"Zero\");\r\n\t\t\tbuttZero.setToolTipText(\"filling borders with zeros\");\r\n\t\t\tbuttZero.addActionListener(this);\r\n\t\t\tbuttZero.setActionCommand(\"parameter\");\r\n\t\t}\r\n\t\treturn buttZero;\r\n\t}", "@Override\n public void onClick(DialogInterface dialog, int which) {\n Utility.hideKeyBoard(editText, mContext);\n if (editText.getText().toString().trim().length() > 0) {\n rpm.setText(editText.getText().toString().trim());\n } else {\n rpm.setText(\"\");\n }\n }", "public void resetOvladani() {\n this.setEnabled(true);\n gameConnectButton.setEnabled(true);\n gameConnectButton.setText(\"Pripoj ke hre\");\n\n newGameButton.setEnabled(true);\n newGameButton.setText(\"Zaloz hru\");\n\n zalozenaHra = false;\n\n }", "public void removeWrongAnswer (char button)\n {\n if (button=='A')\n a.setEnabled(false);\n else if (button=='B')\n b.setEnabled(false);\n else if (button=='C')\n c.setEnabled(false);\n else\n d.setEnabled(false);\n feedbackLabel.setVisible(true);\n }", "public void text_clear()\n {\n C_ID.setText(\"\");\n C_Name.setText(\"\");\n C_NIC.setText(\"\");\n C_P_Id.setText(\"\");\n C_P_Name.setText(\"\");\n C_Address.setText(\"\");\n C_TelNo.setText(\"\");\n C_Age.setText(\"\");\n }", "@Override\n public void onClick(DialogInterface dialog, int which) {\n Utility.hideKeyBoard(editText, mContext);\n if (editText.getText().toString().trim().length() > 0) {\n motor_no.setText(editText.getText().toString().trim());\n } else {\n motor_no.setText(\"\");\n }\n }", "public boolean clear(boolean isNumberInLabel) {\n if (isNumberInLabel) {\n mainLabel.setText(\"0\");\n } else {\n mainLabel.setText(\"0\");\n operatorType = Operator.NON;\n numberStored[0] = 0;\n numberStored[1] = 0;\n }\n return false;\n }", "private void resetButton() {\n for(int x=0;x<buttons.size();x++) {\n if(buttons.get(x).isOpaque())\n buttons.get(x).setOpaque(false);\n }\n }", "@Override\n public void onClick(View v) {\n tv.setText(\" \");\n positive = true;\n flag = true;\n sum = 0.0;\n temp = 0.0;\n step = 1.0;\n op = -1;\n }", "@FXML\n\tprivate void onResetBtn() {\n\t\truleBox.setValue(\"Standard\");\n\t\twallBox.setValue(10);\n\t\tboardBox.setValue(\"9x9\");\n\t\ttileBox.setValue(50);\n\t\tindicateLabel.setSelected(true);\n\t\t//ghostTrail.setSelected(false);\n\t\tSettings.getSingleton().reset();\n\t}", "public void OnNumberButtonClick (View v){\n try {\n Button b = (Button) v;\n if (mIsCalculating == false)\n expressionView.setText(\"\");\n if (mIsTyping == false) {\n resultView.setText(b.getText());\n mIsTyping = true;\n } else {\n resultView.setText(resultView.getText().toString() + b.getText());\n }\n } catch (Exception e) {\n\n }\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n CheckOperation(calButtons.super.getText());\n }", "private boolean markButton( int i, String mark ) {\n\tif ( button[i].getText( ).equals( \"\" ) ) {\n\t button[i].setText( mark );\n\t button[i].setEnabled( false );\n\t return true;\n\t}\n\treturn false;\n }", "@Override\n public void onClick(View v) {\n String curStr = resultDisplay.getText().toString();\n\n // If there is only one char in string\n if (curStr.length() == 1) {\n resultDisplay.setText(String.valueOf(0));\n } else {\n // Remove the last char in string\n int lastIndex = curStr.length() - 1;\n String newStr = curStr.substring(0,lastIndex);\n\n // Set the newStr to ResultDisplay\n resultDisplay.setText(newStr);\n }\n }", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tif(e.getSource() == b) {\r\n\t\t\t\t\ttext.setText(\"8\");\r\n\t\t\t\t}\r\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\ttext.setText(ok.getText());\n\t\t\t}", "private void habilitarBtnActualizar(){\n if(this.txtCodigoPlatDia.getText().isEmpty() \n || this.txtValueModified.getText().isEmpty()\n || this.cbxTypeModified.getSelectedIndex() == 0){\n this.btnActualizar.setEnabled(false);\n }else{\n this.btnActualizar.setEnabled(true);\n }\n }", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\ttextField_1.setText(\"\");\r\n\t\t\t\ttextField.setText(\"\");\r\n\t\t\t}", "private void onOK() {\n show.setText(null);\n String s = (new ArithmeticExpressions(text.getText()).checkExpression());\n System.out.println(s);\n show.setText(s);\n }", "public void actionPerformed(ActionEvent e){\r\n\t\tObject source=e.getSource();\r\n\r\n\t\t//the code for our mini calculator\r\n if(source==btn0){\r\n\r\n\t display = textField.getText();\r\n\t\t\tif(!textField.getText().equals(\"0\"))\r\n\t\t\ttextField.setText(display + \"0\");\r\n\t\t else textField.setText(\"0\");\r\n\r\n\t\t}\r\n\t\tif (source==btn1) {\r\n\r\n\t\t\tdisplay = textField.getText();\r\n\t\t\tif(!textField.getText().equals(\"0\"))\r\n\t\t\ttextField.setText(display + \"1\");\r\n\t\t else textField.setText(\"1\");\r\n\t\t}\r\n\t\tif (source==btn2) {\r\n\r\n\t\t\tdisplay = textField.getText();\r\n\t\t\tif(!textField.getText().equals(\"0\"))\r\n\t\t\ttextField.setText(display + \"2\");\r\n\t\t else textField.setText(\"2\");\r\n\t\t\t\r\n\t\t}\r\n\t\tif (source==btn3) {\r\n\r\n\t\t\tdisplay = textField.getText();\r\n\t\t\tif(!textField.getText().equals(\"0\"))\r\n\t\t\ttextField.setText(display + \"3\");\r\n\t\t else textField.setText(\"3\");\r\n\t\t}\r\n\t\tif (source==btn4) {\r\n\r\n\t\t\tdisplay = textField.getText();\r\n\t\t\tif(!textField.getText().equals(\"0\"))\r\n\t\t\ttextField.setText(display + \"4\");\r\n\t\t else textField.setText(\"4\");\r\n\t\t}\r\n\t\tif (source==btn5) {\r\n\r\n\t\t\tdisplay = textField.getText();\r\n\t\t\tif(!textField.getText().equals(\"0\"))\r\n\t\t\ttextField.setText(display + \"5\");\r\n\t\t else textField.setText(\"5\");\r\n\t\t}\r\n\t\tif (source==btn6) {\r\n\r\n\t\t\tdisplay = textField.getText();\r\n\t\t\tif(!textField.getText().equals(\"0\"))\r\n\t\t\ttextField.setText(display + \"6\");\r\n\t\t else textField.setText(\"6\");\r\n\t\t}\r\n\t\tif (source==btn7) {\r\n\r\n\t\t\tdisplay = textField.getText();\r\n\t\t\tif(!textField.getText().equals(\"0\"))\r\n\t\t\ttextField.setText(display + \"7\");\r\n\t\t else textField.setText(\"7\");\r\n\t\t}\r\n\t\tif (source==btn8) {\r\n\r\n\t\t\tdisplay = textField.getText();\r\n\t\t\tif(!textField.getText().equals(\"0\"))\r\n\t\t\ttextField.setText(display + \"8\");\r\n\t\t else textField.setText(\"8\");\r\n\t\t}\r\n\t\tif (source==btn9) {\r\n\r\n\t\t\tdisplay = textField.getText();\r\n\t\t\tif(!textField.getText().equals(\"0\"))\r\n\t\t\ttextField.setText(display + \"9\");\r\n\t\t else textField.setText(\"9\");\r\n\t\t}\r\n\t\tif (source==btnClear) {\r\n\r\n\t\t\tString s = textField.getText().toString();\r\n s = s.substring(0, s.length() - 1);\r\n textField.setText(s);\r\n if(textField.getText().equals(\"\"))\r\n textField.setText(\"0\"); \t\r\n\t\t}\r\n\t\tif (source==btnVirgule) {\r\n\r\n\t\t\tdisplay = textField.getText();\r\n\t\t\ttextField.setText(display + \".\");\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tif(source==btnBackToMenu){\r\n\r\n\t\t\tMainFrame panel = new MainFrame();\r\n\t\t\tpanel.setSize(470,300);\r\n\t\t\tpanel.setVisible(true);\r\n\t\t\tpanel.setResizable(false);\r\n\t\t\tpanel.setLocation(400,250);\r\n\t\t\tdispose();\r\n\t\t}\r\n\r\n\t\tif(source==btnWithdraw){\r\n\t\t\t//here put the code for the Withdraw\r\n\r\n\t\t\tString conString = \"jdbc:mysql://localhost/atm\";\r\n\t\t String username = \"root\";\r\n\t\t String password = \"1234glody\";\r\n\t\t\t\r\n\t\t\tLogin log=new Login();\r\n\r\n String myUserId = log.getUserId();\r\n\t\t\tString myCardNumber=log.getCardNumber();\r\n\t\t\tString myPinNumber=log.getPinNumber();\r\n\t\t\tString myUserName=log.getUsername();\r\n\r\n\t\t\tdouble amount=Double.parseDouble(textField.getText());\r\n\r\n\t\t\tif (myUserId !=\"\") {\r\n\r\n\t\t\t\ttry{\r\n\r\n\t\t\t\t\t\tConnection con = DriverManager.getConnection(conString, username, password);\r\n\t\t\t\t\t\tStatement stmt = con.createStatement();\r\n\t\t\t\t\t\tResultSet rs = stmt.executeQuery(\"SELECT * FROM user_account WHERE id_user='\"+myUserId+\"'\");\r\n\t \r\n\t while(rs.next()){\r\n\r\n\t rsUserId=rs.getString(1);\r\n\t\t\t\t\t\trsUsername=rs.getString(2);\r\n\t\t\t\t\t\trsCardNumber=rs.getString(3);\r\n\t\t\t\t\t\trsPinNumber=rs.getString(4);\r\n\t\t\t\t\t\trsBalance = rs.getDouble(5);\r\n\t\t\t\t }\r\n\r\n\t\t\t\t if(rsUserId.equals(myUserId)){\r\n\r\n\t\t\t\t \t if(amount >=10){\r\n\r\n\t\t\t\t \t \tif (rsBalance > amount) {\r\n\r\n\t\t\t\t \t \t try{\r\n\r\n\t\t\t\t\t\t \t \tPreparedStatement pstmt = con.prepareStatement(\"INSERT INTO withdraw (amount , date_withdraw , id_user , action) VALUE (?,?,?,?)\");\r\n\r\n\t\t\t\t\t\t \t \tshort c = 0;\r\n\r\n\t\t\t\t\t\t \t \tpstmt.setDouble(++c, amount);\r\n\t\t\t\t\t\t \t \tpstmt.setString(++c, myDate);\r\n\t\t\t\t\t\t \t \tpstmt.setString(++c, rsUserId);\r\n\t\t\t\t\t\t \t \tpstmt.setString(++c, \"withdraw\");\r\n\t\t\t\t\t\t \t \t\r\n\t\t\t\t\t\t \t \tpstmt.executeUpdate();\r\n\r\n\t\t\t\t\t\t \t \tPreparedStatement pstmt2= con.prepareStatement(\"UPDATE user_account SET balance = balance-'\"+amount+\"' WHERE id_user='\"+myUserId+\"'\");\r\n\r\n\t\t\t\t\t\t \t \tpstmt2.executeUpdate();\r\n\r\n\t\t\t JOptionPane.showMessageDialog(null,\"Your withdraw was saved Successfully\",\"Success\",JOptionPane.INFORMATION_MESSAGE);\r\n\r\n\t\t\t display=\"\";\r\n\t\t\t\t\t\t \t \t}\r\n\t\t\t\t\t \t \tcatch(SQLException err2){\r\n\r\n\t\t\t\t\t \t \t System.out.println(err2.getMessage());\r\n\t\t\t\t\t\t\t System.exit(0);\t\r\n\t\t\t\t\t \t \t}\r\n\t\t\t\t \t \t\t \r\n\t\t\t\t \t \t}\r\n\t\t\t\t \t \telse{\r\n\r\n\t\t\t\t \t \tJOptionPane.showMessageDialog(null,\"Your balance is below the value of your Withdraw!! \",\"Withdraw impossible\",JOptionPane.ERROR_MESSAGE);\t\r\n\t\t\t\t \t \t}\r\n\r\n\t\t\t\t \t }\r\n\t\t\t\t \t else{\r\n\r\n\t\t\t\t \t \tJOptionPane.showMessageDialog(null,\"Please a valid amount (above 9 rwf)\",\"Error\",JOptionPane.ERROR_MESSAGE);\r\n\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\telse{\r\n\r\n\t\t\t\t\t JOptionPane.showMessageDialog(null,\"Login First please!!!\",\"Error\",JOptionPane.ERROR_MESSAGE);\t\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t stmt.close();\r\n\r\n\r\n\t\t\t\t\t}catch(SQLException err){\r\n\r\n\t\t\t\t\t\tSystem.out.println(err.getMessage());\r\n\t\t\t\t\t\tSystem.exit(0);\r\n\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\r\n\t\t\t\tJOptionPane.showMessageDialog(null,\"Login First please!!!\",\"Error\",JOptionPane.ERROR_MESSAGE);\r\n\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}" ]
[ "0.7169005", "0.7071404", "0.671296", "0.66948754", "0.66780967", "0.66746956", "0.6625894", "0.65776515", "0.6492185", "0.6470508", "0.6451642", "0.6439517", "0.6379906", "0.6374406", "0.63298315", "0.63173133", "0.63141096", "0.6304934", "0.6272488", "0.6244349", "0.6243025", "0.6230654", "0.6216721", "0.6181948", "0.61793256", "0.61472905", "0.61463344", "0.6145475", "0.6128203", "0.61133134", "0.6112398", "0.609915", "0.60942435", "0.6082643", "0.60819644", "0.60716844", "0.6057397", "0.6039909", "0.6039332", "0.60126793", "0.6007234", "0.5996489", "0.599537", "0.5989675", "0.5988964", "0.59708166", "0.5959173", "0.5955623", "0.5954095", "0.5949692", "0.5947159", "0.59376985", "0.5933538", "0.59335303", "0.5928213", "0.5927151", "0.5912735", "0.59106934", "0.5910602", "0.5908587", "0.58984476", "0.5898058", "0.58871293", "0.5885347", "0.58742845", "0.5868067", "0.5867938", "0.5866037", "0.58635026", "0.58599967", "0.5857042", "0.5856518", "0.5855203", "0.5845903", "0.58451277", "0.58449227", "0.5837755", "0.5820758", "0.58206135", "0.58163583", "0.5813517", "0.58086914", "0.5807836", "0.5807815", "0.5807456", "0.58041555", "0.5804085", "0.58021665", "0.5801319", "0.5792772", "0.5774701", "0.57743883", "0.5772196", "0.57676905", "0.57600415", "0.5759749", "0.57521445", "0.574955", "0.57431054", "0.5739953", "0.5739899" ]
0.0
-1
Sets Hibernate session factory.
public void setSessionFactory(SessionFactory sessionFactory) { template = new HibernateTemplate(sessionFactory); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Resource\n public void setSessionFactory(SessionFactory factory) {\n this.sessionFactory = factory;\n }", "public void setSessionFactory(SessionFactory sessionFactory) {\r\n this.sessionFactory = sessionFactory;\r\n }", "public void setSessionFactory(SessionFactory sessionFactory) {\n this.sessionFactory = sessionFactory;\n }", "public void setSessionFactory(SessionFactory sessionFactory) {\n this.sessionFactory = sessionFactory;\n }", "public void setSessionFactory(SessionFactory sessionFactory) {\n this.sessionFactory = sessionFactory;\n }", "public void setSessionFactory(SessionFactory sessionFactory) {\n this.sessionFactory = sessionFactory;\n }", "public void setSessionFactory(SessionFactory sessionFactory) {\r\n\t\tthis.sessionFactory = sessionFactory;\r\n\t}", "public void setSessionFactory(SessionFactory sessionFactory) {\n\t\tthis.sessionFactory = sessionFactory;\n\t}", "public void setSessionFactory(SessionFactory sessionFactory) {\n\t\tthis.sessionFactory = sessionFactory;\n\t}", "public void setSessionFactory(SessionFactory sessionFactory) {\n\t\tthis.sessionFactory = sessionFactory;\n\t}", "@Autowired\r\n public void setSessionFactory(SessionFactory sessionFactory) {\r\n this.sessionFactory = sessionFactory;\r\n }", "@Autowired\n\tpublic void setFactory(SessionFactory factory) {\n\t\tthis.factory = factory;\n\t}", "@Resource\r\n\tpublic void setHibernateSessionFactory(SessionFactory hibernateSessionFactory) {\r\n\t\tsetSessionFactory(hibernateSessionFactory);\r\n\t}", "public void setSessionFactory(SessionFactory sessionFactory) {\n template = new HibernateTemplate(sessionFactory);\n}", "public static SessionFactory getSessionFactory() {\n\t\treturn sessionFactory;\r\n\t}", "public static SessionFactory getSessionFactory() {\n \t\n \treturn sessionFactory;\n }", "public static SessionFactory getSessionFactory() {\n\t\treturn sessionFactory;\n\t}", "public SessionFactory getSessionFactory() {\r\n return sessionFactory;\r\n }", "public SessionFactory getSessionFactory()\n {\n return sessionFactory;\n }", "public SessionFactory getSessionFactory() {\n return sessionFactory;\n }", "protected SessionFactory getSessionFactory() {\n\t\treturn this.sessionFactory;\n\t}", "public SessionFactory getSessionFactory() {\r\n\t\treturn sessionFactory;\r\n\t}", "@Autowired\n public void initReference(SessionFactory sessionFactory) {\n setSessionFactory(sessionFactory);\n }", "public static SessionFactory getSessionFactory() {\n\t\tif (sessionFactory == null) {\n\t\t\tcreateSessionFactory();\n\t\t}\n\t\treturn sessionFactory;\n\t}", "@Autowired\n public CuestionarioDaoHibernate(SessionFactory sessionFactory) {\n this.setSessionFactory(sessionFactory);\n }", "public SessionFactory getSessionFactory() {\n\t\treturn sessionFactory;\n\t}", "public SessionFactory getSessionFactory() {\n\t\treturn sessionFactory;\n\t}", "public SessionFactory getHibernateSessionFactory() {\n if (_hibernateTemplate == null) {\n return null;\n }\n return _hibernateTemplate.getSessionFactory();\n }", "public static SessionFactory getSessionFactory() {\n if (sessionFactory == null) sessionFactory = buildSessionFactory();\n return sessionFactory;\n }", "@Resource\n\t@Override\n\tpublic void setSqlSessionFactory(SqlSessionFactory sqlSessionFactory) {\n\t\tsuper.setSqlSessionFactory(sqlSessionFactory);\n\t}", "@Autowired\r\n\tpublic void setSqlSessionFactory(SqlSessionFactory sqlSessionFactory) {\n\t\tsuper.setSqlSessionFactory(sqlSessionFactory);\r\n\t}", "public void setSf(SessionFactory sf) {\r\n\t\tthis.sf = sf;\r\n\t}", "@Autowired\n public UsuarioPerfilDaoHibernate(SessionFactory sessionFactory) {\n this.setSessionFactory(sessionFactory);\n }", "private static void createSessionFactory() {\n\t\ttry {\n\t\t\tif (sessionFactory == null) {\n\n\t\t\t\tProperties properties = new Properties();\n\t\t\t\tproperties.load(ClassLoader.getSystemResourceAsStream(\"hibernate.properties\"));\n\n\t\t\t\tConfiguration configuration = new Configuration();\n\t\t\t\tEntityScanner.scanPackages(\"musala.schoolapp.model\").addTo(configuration);\n\t\t\t\tconfiguration.mergeProperties(properties).configure();\n\t\t\t\tStandardServiceRegistry builder = new StandardServiceRegistryBuilder()\n\t\t\t\t\t\t.applySettings(configuration.getProperties()).build();\n\t\t\t\tsessionFactory = configuration.buildSessionFactory(builder);\n\t\t\t}\n\t\t} catch (Exception ex) {\n\t\t\tSystem.out.println(\"Failed to create session factory object.\");\n\t\t\tex.printStackTrace();\n\t\t}\n\t}", "public static SessionFactory getSessionFactory() {\n\n if(sessionFactory == null) {\n try {\n MetadataSources metadataSources = new MetadataSources(configureServiceRegistry());\n\n addEntityClasses(metadataSources);\n\n sessionFactory = metadataSources.buildMetadata()\n .getSessionFactoryBuilder()\n .build();\n\n } catch (Exception e) {\n e.printStackTrace();\n if(registry != null)\n StandardServiceRegistryBuilder.destroy(registry);\n }\n }\n\n return sessionFactory;\n }", "public SessionFactory getFactory() {\n\t\treturn factory;\n\t}", "public static SessionFactory getSessionFactory() {\n\t\tConfiguration configObj = new Configuration();\n\t\tconfigObj.addAnnotatedClass(com.training.org.User.class);\n\t\tconfigObj.configure(\"hibernate.cfg.xml\");\n\t\t\n\t\t\n\t\n\n\t\t// Since Hibernate Version 4.x, Service Registry Is Being Used\n\t\tServiceRegistry serviceRegistryObj = new StandardServiceRegistryBuilder().applySettings(configObj.getProperties()).build(); \n\n\t\t// Creating Hibernate Session Factory Instance\n\t\tSessionFactory factoryObj = configObj.buildSessionFactory(serviceRegistryObj);\t\t\n\t\treturn factoryObj;\n\t}", "private static synchronized void lazyinit()\n {\n try\n {\n if (sessionFactory == null)\n {\n System.out.println(\"Going to create SessionFactory \");\n sessionFactory = new Configuration().configure().buildSessionFactory();\n// sessionFactory.openSession();\n System.out.println(\"Hibernate could create SessionFactory\");\n }\n } catch (Throwable t)\n {\n System.out.println(\"Hibernate could not create SessionFactory\");\n t.printStackTrace();\n }\n }", "protected final SessionFactory getSessionFactory() {\n\t\tif (this.sessionFactory == null) {\n\t\t\tthrow new IllegalStateException(\"SessionFactory not initialized yet\");\n\t\t}\n\t\treturn this.sessionFactory;\n\t}", "void setFactoryBean( FactoryBean factory );", "@Autowired\n\t public FlightSeatRepositoryImpl(EntityManagerFactory factory) {\n\t\t if(factory.unwrap(SessionFactory.class) == null){\n\t\t\t throw new NullPointerException(\"factory is not a hibernate factory\");\n\t\t }\n\t\t this.sessionFactory = factory.unwrap(SessionFactory.class);\n\t }", "public synchronized static SessionFactory createSessionFactory() {\r\n\r\n if (sessionFactory == null) {\r\n LOG.debug(MODULE + \"in createSessionFactory\");\r\n sessionFactory = new Configuration().configure().buildSessionFactory();\r\n// ApplicationContext appcontext = ApplicationContextProvider.getApplicationContext();\r\n// sessionFactory = (SessionFactory) appcontext.getBean(\"sessionFactory\");\r\n LOG.debug(MODULE + \"sessionFactory created\");\r\n }\r\n\r\n return sessionFactory;\r\n }", "@Autowired\n\tpublic HibernateAccountManager(SessionFactory sessionFactory) {\n\t\tthis.sessionFactory = sessionFactory;\n\t\tthis.hibernateTemplate = new HibernateTemplate(sessionFactory);\n\t}", "@Override\n public void initSessionFactories() {\n super.initSessionFactories();\n\n sessionFactories.put(EntityCache.class, new SessionFactory() {\n\n @Override\n public Class<?> getSessionType() {\n return EntityCache.class;\n }\n @Override\n public Session openSession(CommandContext commandContext) {\n return new EntityCacheImpl();\n }\n });\n }", "public void init(SessionFactory sessFactory) throws HibException;", "public static SessionFactory getSessionFactory() {\r\n\t\t/*\r\n\t\t * Instead of a static variable, use JNDI: SessionFactory sessions =\r\n\t\t * null; try { Context ctx = new InitialContext(); String jndiName =\r\n\t\t * \"java:hibernate/HibernateFactory\"; sessions =\r\n\t\t * (SessionFactory)ctx.lookup(jndiName); } catch (NamingException ex) {\r\n\t\t * throw new InfrastructureException(ex); } return sessions;\r\n\t\t */\r\n\t\treturn sessionFactory;\r\n\t}", "private static SessionFactory buildSessionFact() {\n try {\n\n return new Configuration().configure(\"hibernate.cfg.xml\").buildSessionFactory();\n\n \n } catch (Throwable ex) {\n \n System.err.println(\"Initial SessionFactory creation failed.\" + ex);\n throw new ExceptionInInitializerError(ex);\n }\n }", "public ETLLogDAOImpl(SessionFactory factory) {\r\n this.factory = factory;\r\n }", "public static SessionFactory getSessionFactory() {\r\n\t\tConfiguration configuration = new Configuration().configure();\r\n\t\tStandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder()\r\n\t\t\t\t.applySettings(configuration.getProperties());\r\n\t\tSessionFactory sessionFactory = configuration\r\n\t\t\t\t.buildSessionFactory(builder.build());\r\n\t\treturn sessionFactory;\r\n\t}", "public PaymentDAOImpl(SessionFactory sessionfactory)\n\t{\n\tthis.sessionFactory=sessionfactory; \n\tlog.debug(\"Successfully estblished connection\");\n\t}", "public static void initialize(Configuration config) {\n // Create the SessionFactory\n \tif (sessionFactory != null) {\n \t\tthrow new IllegalStateException(\"HibernateUtil already initialized.\");\n \t}\n \tHibernateUtil.configuration = config;\n \t\n sessionFactory = config.buildSessionFactory();\n }", "public static Session createSession(SessionFactory factory){\n Session s;\n\n if((s = (Session) _sessionRef.get()) == null) {\n s = factory.openSession();\n _sessionRef.set(s);\n }\n else{\n if(!s.isConnected())s.reconnect();\n }\n\n return s; \n }", "public SqlSessionFactory get();", "public FuncaoCasoDAOImpl() {\n\t\tsetSession(HibernateUtil.getSessionFactory());\n\t}", "public void setFactoryDAO(DAOFactory factoryDAO) {\n\t\tthis.factoryDAO = factoryDAO;\n\t}", "private static SessionFactory buildSessionFactory() {\n Configuration configObj = new Configuration();\n configObj.configure(\"hibernate.cfg.xml\");\n\n ServiceRegistry serviceRegistryObj = new StandardServiceRegistryBuilder().applySettings(configObj.getProperties()).build();\n\n // Creating Hibernate SessionFactory Instance\n sessionFactoryObj = configObj.buildSessionFactory(serviceRegistryObj);\n return sessionFactoryObj;\n }", "static void initialize() {\n final StandardServiceRegistry registry = new StandardServiceRegistryBuilder()\r\n .configure() // configures settings from hibernate.cfg.xml\r\n .build();\r\n try {\r\n sessionFactory = new MetadataSources( registry ).buildMetadata().buildSessionFactory();\r\n }\r\n catch (Exception e) {\r\n StandardServiceRegistryBuilder.destroy( registry );\r\n }\r\n }", "private SessionFactoryUtil() {\r\n try {\r\n LOG.info(\"Configurando hibernate.cfg.xml\");\r\n CfgFile cfgFile = new CfgFile();\r\n Configuration configure = new Configuration().configure(new File(cfgFile.getPathFile()));\r\n cfgFile.toBuildMetaData(configure);\r\n ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder().applySettings(configure.getProperties()).build();\r\n sessionFactory = configure.buildSessionFactory(serviceRegistry);\r\n LOG.info(\"Configuracion se cargo a memoria de forma correcta\");\r\n } // try\r\n catch (Exception e) {\r\n Error.mensaje(e);\r\n } // catch\r\n }", "public void setDataSourceFactory(Factory<DataSource> dataSourceFactory) {\n this.dataSourceFactory = dataSourceFactory;\n }", "static void initialize() {\n final StandardServiceRegistry registry = new StandardServiceRegistryBuilder()\n .configure() // configures settings from hibernate.cfg.xml\n .build();\n try {\n sessionFactory = new MetadataSources( registry ).buildMetadata().buildSessionFactory();\n }\n catch (Exception e) {\n StandardServiceRegistryBuilder.destroy( registry );\n }\n }", "private static SessionFactory buildSessionFactory() {\n\t\t// Creating Configuration Instance & Passing Hibernate Configuration File\n\t\tConfiguration configObj = new Configuration();\n\t\tconfigObj.configure(\"hibernate.cfg.xml\");\n\n\t\t// Since Hibernate Version 4.x, ServiceRegistry Is Being Used\n\t\tServiceRegistry serviceRegistryObj = new StandardServiceRegistryBuilder()\n\t\t\t\t.applySettings(configObj.getProperties()).build();\n\n\t\t// Creating Hibernate SessionFactory Instance\n\t\tsessionFactoryObj = configObj.buildSessionFactory(serviceRegistryObj);\n\t\treturn sessionFactoryObj;\n\t}", "protected abstract SessionFactory buildSessionFactory() throws Exception;", "public void setFactory(JDOMFactory factory) {\n this.factory = factory;\n }", "protected\r\n JpaDaoFactory()\r\n {\r\n ISessionStrategy mySessionStrategy = new JpaSessionStrategy();\r\n ITransactionStrategy myTransactionStrategy = \r\n new JpaTransactionStrategy(mySessionStrategy);\r\n\r\n setSessionStrategy(mySessionStrategy);\r\n setTransactionStrategy(myTransactionStrategy);\r\n }", "public static Session openSession(SessionFactory sessionFactory)\r\n\t\t\tthrows HibernateException {\n\r\n\t\tSession session = sessionFactory.getCurrentSession();\r\n\t\treturn session;\r\n\t}", "public static SessionStrategyBuilder usingHibernate() {\r\n return new PersistenceServiceBuilderImpl(PersistenceFlavor.HIBERNATE, persistenceModuleVisitor);\r\n }", "private static SessionFactory buildSessionFactory() {\n\t\ttry {\n\t\t\t// Create the SessionFactory from hibernate.cfg.xml\n\t\t\tConfiguration configuration = new Configuration().configure();\n\t\t\tServiceRegistry serviceRegistry = new ServiceRegistryBuilder()\n\t\t\t\t\t.applySettings(configuration.getProperties())\n\t\t\t\t\t.buildServiceRegistry();\n\t\t\tSessionFactory sessionFactory = configuration\n\t\t\t\t\t.buildSessionFactory(serviceRegistry);\n\t\t\treturn sessionFactory;\n\t\t} catch (Throwable ex) {\n\t\t}\n\t\treturn null;\n\t}", "protected void setFactory(HttpClientFactory factory) {\n\t\tthis.factory = factory;\n\t}", "@AfterClass\n\tpublic static void closeSessionFactory() {\n sessionFactory.close();\n\t}", "public static void open() {\r\n final Session session = sessionFactory.isClosed() ? sessionFactory.openSession() : sessionFactory.getCurrentSession();\r\n session.beginTransaction();\r\n }", "@Autowired\n\t@Bean(name=\"sessionFactory\")\n\tpublic SessionFactory getSessionFactory(DataSource dataSource) {\n\t\tLocalSessionFactoryBuilder sessionBuilder = new LocalSessionFactoryBuilder(dataSource);\n\t\tsessionBuilder.addAnnotatedClasses(Korisnik.class, Rola.class, Predmet.class\n\t\t\t\t, PredmetKorisnika.class, Tema.class, Materijal.class, Komentar.class);\n\t\tsessionBuilder.addProperties(getHibernateProperties());\n\t\t\n\t\treturn sessionBuilder.buildSessionFactory();\n\t}", "private static SessionFactory buildSessionFactory() {\n\t\ttry {\r\n\t\t\tConfiguration config=new Configuration();\r\n\t\t\tconfig.addClass(Customer.class);\r\n\t\t\treturn config\r\n\t\t\t\t\t.buildSessionFactory(new StandardServiceRegistryBuilder().build());\r\n\t\t} catch(Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tthrow new RuntimeException(\"error building sessions\");\r\n\t\t}\r\n\t}", "public SingleSessionFactory(Session session) {\n\t\tthis.session = session;\n\t}", "public static void rebuildSessionFactory() {\r\n\t\t\ttry {\r\n\t\t\t\t\r\n\t\t\t\tserviceRegistry = new ServiceRegistryBuilder().applySettings(\r\n\t\t\t\t\t\tcfg.getProperties()).buildServiceRegistry();\r\n\t\t\t\tsessionFactory = cfg.buildSessionFactory(serviceRegistry);\r\n\t\t\t\t\r\n\r\n\t\t\t} catch (Throwable ex) {\r\n\t\t\t\tSystem.err.println(\"Failed to create sessionFactory object.\" + ex);\r\n\t\t\t\tthrow new ExceptionInInitializerError(ex);\r\n\t\t\t}\r\n\t\t}", "public RegionDAO(SessionFactory factory) {\r\n this.factory = factory;\r\n }", "public void setBeanFactory(BeanFactory beanFactory)\r\n/* 35: */ {\r\n/* 36: 77 */ this.beanFactory = beanFactory;\r\n/* 37: */ }", "protected static void setUp() throws Exception {\n // A SessionFactory is set up once for an application!\n final StandardServiceRegistry registry = new StandardServiceRegistryBuilder()\n .configure(\"conflict.cfg.xml\")\n .build();\n try {\n sessionFactory = new MetadataSources(registry).buildMetadata().buildSessionFactory();\n } catch (Exception e) {\n e.printStackTrace();\n StandardServiceRegistryBuilder.destroy(registry);\n }\n }", "public static void close() {\r\n if (sessionFactory != null) {\r\n sessionFactory.close();\r\n }\r\n LOG.debug(MODULE + \"SessionFactory Close\");\r\n sessionFactory = null;\r\n }", "public void setHibernateTemplate(HibernateTemplate hibernateTemplate) {\n this.hibernateTemplate = hibernateTemplate;\n }", "private void getHibernateSession() {\n try {\n session = em.unwrap(Session.class)\n .getSessionFactory().openSession();\n\n } catch(Exception ex) {\n logger.error(\"Failed to invoke the getter to obtain the hibernate session \" + ex.getMessage());\n ex.printStackTrace();\n }\n\n if(session == null) {\n logger.error(\"Failed to find hibernate session from \" + em.toString());\n }\n }", "protected SessionFactory getTransactionAwareSessionFactoryProxy(SessionFactory target) {\n\t\tClass sfInterface = SessionFactory.class;\n\t\tif (target instanceof SessionFactoryImplementor) {\n\t\t\tsfInterface = SessionFactoryImplementor.class;\n\t\t}\n\t\treturn (SessionFactory) Proxy.newProxyInstance(sfInterface.getClassLoader(),\n\t\t\t\tnew Class[] {sfInterface}, new TransactionAwareInvocationHandler(target));\n\t}", "public NationalityDAO() {\n //sessionFactory = HibernateUtil.getSessionFactory();\n session=HibernateUtil.openSession();\n }", "public void setHibernateTemplate(HibernateTemplate hibernateTemplate){\r\n\t\tthis.hibernateTemplate = hibernateTemplate;\r\n\t}", "public void setHibernateTemplate(HibernateTemplate hibernateTemplate){\r\n\t\tthis.hibernateTemplate = hibernateTemplate;\r\n\t}", "public void setHibernateTemplate(HibernateTemplate hibernateTemplate){\r\n\t\tthis.hibernateTemplate = hibernateTemplate;\r\n\t}", "public void setHibernateTemplate(HibernateTemplate hibernateTemplate){\r\n\t\tthis.hibernateTemplate = hibernateTemplate;\r\n\t}", "private static SessionFactory buildSessionFactory() {\n\t\ttry {\n\t\t\tConfiguration config = new Configuration().configure(); \n\t\t\tServiceRegistry serviceRegistry =\n\t\t\t\t\tnew StandardServiceRegistryBuilder()\n\t\t\t.applySettings(config.getProperties()).build();\n\n\t\t\tHibernatePBEEncryptorRegistry registry = HibernatePBEEncryptorRegistry.getInstance();\n\t\t\t\n\t\t\tStandardPBEStringEncryptor myEncryptor = new StandardPBEStringEncryptor();\n\t\t\t// FIXME : this is insecure and needs to be fixed\n\t\t\tmyEncryptor.setPassword(\"123\");\n\t\t\tregistry.registerPBEStringEncryptor(\"myHibernateStringEncryptor\", myEncryptor);\n\t\t\t\n\t\t\t\n\t\t\treturn config.buildSessionFactory(serviceRegistry); \n\t\t}\n\t\tcatch (Throwable ex) {\n\t\t\t// Make sure you log the exception, as it might be swallowed\n\t\t\tSystem.err.println(\"Initial SessionFactory creation failed.\" + ex);\n\t\t\tthrow new ExceptionInInitializerError(ex);\n\t\t}\n\t}", "public void setDialect(String s) {\n if (s == null) dialect = \"DEFAULT\";\n else dialect = s;\n }", "public interface SessionFactory {\n /**\n * Retrieves a new session. If the session isn't closed, second call from the same thread would\n * result in retrieving the same session\n *\n * @return\n */\n Session getSession();\n\n /**\n * Closes the current session associated with this transaction if present\n */\n void closeSession();\n\n /**\n * Returns true if we have connected the factory to redis\n *\n * @return\n */\n boolean isConnected();\n\n /**\n * Closes the session factory which disposes of the underlying redis pool\n */\n void close();\n}", "public static synchronized void destroy()\n {\n try\n {\n if (sessionFactory != null)\n {\n sessionFactory.close();\n System.out.println(\"Hibernate could destroy SessionFactory\");\n }\n } catch (Throwable t)\n {\n System.out.println(\"Hibernate could not destroy SessionFactory\");\n t.printStackTrace();\n }\n sessionFactory = null;\n }", "@SuppressWarnings({ \"deprecation\"})\r\n\tpublic static SessionFactory getSessionFactory() \r\n\t{\r\n //configuration object\r\n Configuration configuration=new Configuration();\r\n //configuring xml file\r\n \tconfiguration.configure(\"hibernate.cfg.xml\");\r\n \t//SessionFactory object\r\n \tsessionFactory=configuration.buildSessionFactory();\r\n //returning sessonFactory+\r\n return sessionFactory;\r\n }", "@Override\n\t\tpublic SessionFactoryImpl call() throws Exception {\n\t\t\tClassPathXmlApplicationContext applicationContext=new ClassPathXmlApplicationContext(\"spring-mybatis.xml\");\n\t\t\t\n\t\t\tSessionFactoryImpl sessionFactoryImpl=(SessionFactoryImpl) applicationContext.getBean(\"sessionFactory\");\n\n\t\t\treturn sessionFactoryImpl;\n\t\t}", "@Autowired()\n\tpublic PostDao(SessionFactory sessfact) {\n\t\tthis.sessfact = sessfact;\n\t}", "public interface Dao {\n\tpublic void setMySessionFactory(SessionFactory sf);\n}", "public static void close() {\r\n if (sessionFactory != null) {\r\n sessionFactory.close();\r\n }\r\n sessionFactory = null;\r\n }", "public void setPersistenceManagerFactory(PersistenceManagerFactory pmf) {\n assert(pmf!=null);\n this.pmf = pmf;\n }", "public void setEntityManagerFactory(EntityManagerFactory entityManagerFactory) {\r\n\t\tLOG.info(DOLLAR + INSIDE_METHOD + DOLLAR);\r\n\t\tthis.entityManagerFactory = entityManagerFactory;\r\n\t\tLOG.info(DOLLAR + OUTSIDE_METHOD + DOLLAR);\r\n\t}", "@Bean\r\n\tpublic HibernateTransactionManager getTransactionManager(SessionFactory sessionFactory) {\r\n\t\treturn new HibernateTransactionManager(sessionFactory);\r\n\t}", "private static SessionFactory buildSessionFactory() {\n\n try {\n Configuration configuration = new Configuration();\n\n Properties properties = new Properties();\n properties.load(AuthDao.class.getResourceAsStream(\"/db.properties\"));\n configuration.setProperties(properties);\n\n// configuration.addAnnotatedClass(Driver.class);\n// configuration.addAnnotatedClass(DriverStatusChange.class);\n// configuration.addAnnotatedClass(Freight.class);\n// configuration.addAnnotatedClass(Location.class);\n configuration.addAnnotatedClass(Manager.class);\n// configuration.addAnnotatedClass(Order.class);\n// configuration.addAnnotatedClass(OrderDriver.class);\n// configuration.addAnnotatedClass(OrderWaypoint.class);\n// configuration.addAnnotatedClass(Truck.class);\n// configuration.addAnnotatedClass(Waypoint.class);\n\n ServiceRegistry serviceRegistry =\n new StandardServiceRegistryBuilder().applySettings(configuration.getProperties()).build();\n\n return configuration.buildSessionFactory(serviceRegistry);\n\n } catch (IOException e) {\n e.printStackTrace();\n throw new ExceptionInInitializerError(e);\n }\n }", "public TeamViewerConnectionDAOImpl(SessionFactory sessionFactory){\n\t\tsuper.sessionFactory = sessionFactory;\n\t\tsuper.type = TeamViewerConnection.class;\n\t}" ]
[ "0.81920046", "0.7980532", "0.7956486", "0.7956486", "0.7956486", "0.7956486", "0.78669655", "0.7842979", "0.7842979", "0.7842979", "0.7762497", "0.7553399", "0.7140465", "0.69760823", "0.6650058", "0.6608583", "0.66082346", "0.66029376", "0.6567619", "0.65543294", "0.65253395", "0.6518974", "0.65061384", "0.64912325", "0.649089", "0.64560807", "0.64560807", "0.6447771", "0.6439484", "0.6422204", "0.6419725", "0.64156723", "0.6400628", "0.63785243", "0.63436055", "0.6327085", "0.6317523", "0.6310268", "0.62917435", "0.6264928", "0.625096", "0.6210308", "0.61973125", "0.6143771", "0.61074764", "0.60472625", "0.6039774", "0.6035212", "0.59871846", "0.59573704", "0.5920968", "0.5877793", "0.5845017", "0.5829359", "0.5828659", "0.5826186", "0.57298505", "0.57274956", "0.5686029", "0.56835836", "0.5673571", "0.56735694", "0.56693727", "0.5663646", "0.56444293", "0.5633678", "0.56295145", "0.5629435", "0.5605167", "0.5592705", "0.5592617", "0.5574266", "0.5552963", "0.5552637", "0.5551068", "0.5525743", "0.55194235", "0.5506664", "0.55056816", "0.5497024", "0.54943085", "0.5494034", "0.54935914", "0.54935914", "0.54935914", "0.54935914", "0.54721695", "0.546034", "0.54593927", "0.5457784", "0.5445747", "0.54278314", "0.5410703", "0.5402985", "0.5394338", "0.5381117", "0.5379529", "0.53478354", "0.53473127", "0.5344529" ]
0.7747173
11
Find persons by last name.
@SuppressWarnings("unchecked") public Collection<Person> findPersonsByName(String name) throws DataAccessException { return template.find("from Person p where p.lastName = ?", name); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "List<Person> findByLastName(String lastName);", "public static void findEmployeeByLastName(String lastName) {\n List<Employee> employees = null;\n try {\n employees = EmployeeRepository.findByLastName(dataSource, lastName);\n } catch (SQLException e) {\n LOGGER.error(e.getMessage());\n }\n if (employees.isEmpty()) {\n LOGGER.warn(\"The employee with the last name of \" + lastName + \" was not found in the list\");\n System.out.println(resourceBundle.getString(\"emp\") + \" \" + resourceBundle.getString(\"not.found\") + \" \" + lastName + \" \"\n + resourceBundle.getString(\"not.in.list\"));\n return;\n }\n employees.forEach(System.out::println);\n }", "@SuppressWarnings(\"unchecked\")\n public Collection<Person> findPersonsByLastName(String lastName) throws DataAccessException {\n return template.find(\"from Person p where p.lastName = ?\", lastName);\n }", "@Query(\"MATCH (p:Person) \" + \"WHERE LOWER(p.firstName) CONTAINS LOWER({0}) \"\n + \"AND LOWER(p.lastName) CONTAINS LOWER({1}) \" + \"RETURN p\")\n Iterable<Person> locateByFirstLast(String firstName, String lastName);", "public Iterable<Person> getPersonsByLastName(String lastName) {\n\t\tMap<String, Object> params = new HashMap<>();\n\t\tparams.put(\"lastName\", lastName);\n\t\t\n\t\tFilter filter = new Filter(\"lastName\", ComparisonOperator.EQUALS, lastName);\n\t\tCollection<Person> persons = session.loadAll(Person.class, filter, 2);\n\t\treturn persons;\n\t}", "java.lang.String getLastName();", "java.lang.String getLastName();", "List<AddressbookEntry> findByLastNameLike(String pattern);", "Director findByLastName(String lastName);", "Iterable<Customer> findByLastName(String lastName);", "List<Customer> findByLastName(String lastName);", "public java.lang.String getLastName();", "Owner findByLastName(String lastName);", "Owner findByLastName(String lastName);", "public List<SickPerson> getSickPersonList(String lastNameSubString) throws SQLException;", "String getLastName();", "String getLastName();", "List<Student> findAllByLastNameLike(String lastName);", "public String getLastName();", "public String searchLastNameUI() {\n console.promptForPrintPrompt(\" +++++++++++++++++++++++++++++++++++++++\");\n console.promptForPrintPrompt(\" + PLEASE ENTER LAST NAME TO SEARCH BY +\");\n console.promptForPrintPrompt(\" +++++++++++++++++++++++++++++++++++++++\");\n console.promptForString(\"\");\n String lastName = console.promptForString(\" LAST NAME: \");\n return lastName;\n }", "Student findByLastName(String lastName);", "public StringFilter getLastName() {\n\t\treturn lastName;\n\t}", "public List<com.ims.dataAccess.tables.pojos.User> fetchByLastname(String... values) {\n return fetch(User.USER.LASTNAME, values);\n }", "Optional<String> getLastname();", "public String returnPerson(String person)\n\t{\n\t\tfor(int i = 0; i < peopleList.size(); i++)\n\t\t{\n\t\t\t// getSurname is a method defined in the Person class and return a persons last name\n\t\t\t// Compares the last name you typed in with the last name of each person in the peopleList list\n\t\t\t// if the last names are equal then return the person with the appropriate toString method\n\t\t\tif(person.equalsIgnoreCase(peopleList.get(i).getSurname())) \n\t\t\t{\n\t\t\t\treturn(peopleList.get(i).toString());\n\t\t\t}\n\t\t}\n\t\t// If the person looked for is not in the \"peopleList\" list; return the string \"notFound\" that is defined above\n\t\treturn notFound;\n\t}", "Contact findByNameAndLastName(String name, String lastName);", "public static void printLongestNamedPeople(){\n ArrayList<Person> longests = query.getLongestNamed();\n if (longests.size() == 1) {\n System.out.println(\"The person with the longest name is: \");\n } else {\n System.out.println(\"The people with the longest names are: \");\n }\n for (Person p : longests) {\n System.out.println(p);\n }\n }", "public List<User> findUsersByFirstNameContainsOrLastNameContains(String firstName, String lastName);", "public VwStatsPerGame[] findWhereSecondLastnameEquals(String secondLastname) throws VwStatsPerGameDaoException\n\t{\n\t\treturn findByDynamicSelect( SQL_SELECT + \" WHERE second_lastname = ? ORDER BY second_lastname\", new Object[] { secondLastname } );\n\t}", "@View(designDocument = \"user\", viewName = \"byName\")\n List<User> findByLastname(String lastName);", "java.lang.String getSurname();", "public VwStatsPerGame[] findWhereFirstLastnameEquals(String firstLastname) throws VwStatsPerGameDaoException\n\t{\n\t\treturn findByDynamicSelect( SQL_SELECT + \" WHERE first_lastname = ? ORDER BY first_lastname\", new Object[] { firstLastname } );\n\t}", "public java.util.List<org.jooq.test.h2.generatedclasses.tables.pojos.VAuthor> fetchByLastName(java.lang.String... values) {\n\t\treturn fetch(org.jooq.test.h2.generatedclasses.tables.VAuthor.V_AUTHOR.LAST_NAME, values);\n\t}", "public void search(String LastName)\n {\n //delare variables to hold file types\n BufferedReader fIn = null;\n \n //try to open the file for reading\n try\n {\n fIn = new BufferedReader(new FileReader(filename)); \n \n }\n catch(IOException ioe)\n {\n System.out.println(\"search: Exception opening the file\");\n }\n \n //try to read each record\n //if the value of the Last_name field equals the value\n /*\n create a counter to count the number of\n matching records\n */\n int counter = 0;\n \n try\n {\n //read the first record\n String line = fIn.readLine();\n \n //while the record is not null\n //split the record into fields\n //test if the field equals the LastName parameter\n //display the record and increment the counter\n //read the next record\n while(line != null)\n {\n String[] info = line.split(\",\");\n String last = info[0];\n if(last.equals(LastName))\n {\n System.out.print(line);\n counter += 1;\n }\n else\n {\n line = fIn.readLine();\n System.out.print(line);\n counter += 1;\n }\n line = fIn.readLine();\n }\n System.out.println(\"\\nTotal matching records found: \" + counter + \"\\n\");\n \n \n }\n catch(IOException ioe)\n {\n System.out.println(\"search: Exception reading the file\");\n }\n\n // try to close the file\n try\n {\n fIn.close(); \n \n }\n catch(IOException ioe)\n {\n System.out.println(\"search: Exception closing the file\");\n }\n \n //dislay a count of the records found\n \n \n }", "public CustomerAddressQuery lastname() {\n startField(\"lastname\");\n\n return this;\n }", "public Student findStudent(String firstName, String lastName)\n\t{\n\t\tStudent foundStudent = null;\t\n\t\tfor(Student b : classRoll)\n\t\t{\n\t\t\t\n\t\t\tif (b.getStrNameFirst ( ) != null && b.getStrNameFirst().contains(firstName))\n\t\t\t{\n\t\t\t\tif(b.getStrNameLast ( ) != null && b.getStrNameLast().contains(lastName))\n\t\t\t\t{\n\t\t\t\t\tfoundStudent = b;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn foundStudent;\n\t}", "public String printByLastName() {\n StringBuilder result = new StringBuilder(\"--Printing statements by last name--\\n\\n\");\n sortByLastName();\n result.append(orderedPrint());\n return result.toString();\n }", "public java.lang.CharSequence getLastName() {\n return last_name;\n }", "public String getLastName() { return lastName; }", "public List findByLastName2(String pattern) {\n return findMany(new FindByLastName(pattern));\n }", "@Override\n\tpublic List<Owner> findByLastName(String lastName) {\n\t\treturn null;\n\t}", "Name findNameByIdPersonAndMaxDate(int idPerson, Date maxDate);", "public List<com.hexarchbootdemo.adapter.output.persistence.h2.generated_sources.jooq.tables.pojos.Voter> fetchByLastName(String... values) {\n return fetch(Voter.VOTER.LAST_NAME, values);\n }", "@Override\n\tpublic java.lang.String getLastName() {\n\t\treturn _candidate.getLastName();\n\t}", "public boolean lastName(String lastName) {\n return firstName(lastName);\n }", "Person findPerson(String name);", "@SuppressWarnings(\"unchecked\")\r\n\tpublic List<Customer> getCustomerByLastName(String lastName) {\n\t\treturn sessionFactory.getCurrentSession().createCriteria(Customer.class).add(Restrictions.eq(\"lastName\",lastName)).list();\r\n\t}", "@Override\n\tpublic List getByLastName(String lastName) throws DAOException {\n\t\treturn null;\n\t}", "public void setLast_name(java.lang.String last_name) {\n this.last_name = last_name;\n }", "public void setLast_name(java.lang.String last_name) {\n this.last_name = last_name;\n }", "List<Customer> findByNameOrSurname(String name, String surname);", "public java.lang.CharSequence getLastName() {\n return last_name;\n }", "public void setLastName(String ln)\n\t{\n\t\tlastName = ln;\n\t}", "public Address SearchContact(String firstName,String lastName) {\r\n int i = 0;\r\n while (!contact.get(i).getFirstName().equals(firstName) && !contact.get(i).getLastName().equals(lastName)){\r\n i++;\r\n }\r\n return contact.get(i);\r\n }", "public java.lang.CharSequence getLastName() {\n return lastName;\n }", "public static Employee[] getEmployeeByLastName(Connection conn, String input_last_name) {\n\n\t\tEmployee[] empArray2 = new Employee[1];\n//\t\trunning the loop with the input from the option and we are storing the last name so we ca use it below\n\t\ttry {\n\n\t\t\t// Create an SQL query that uses the procedure stored in the procedures.sql file \n\n\t\t\tString sql = \"CALL getEmployeeByLastName(\\\"\" + input_last_name + \"\\\")\"; \n\t\t\t// Create an SQL query\n\t\t\tStatement st = conn.createStatement();\n\t\t\t// generate a result \n\t\t\tResultSet rs = st.executeQuery(sql);\n\n//\t\t\trunning a similar loop from get all employees method where we are showing the details from the employee\n\t\t\t\n\t\t\tint i=0;\n\n\t\t\twhile (rs.next()) {\n\n\t\t\t\tempArray2[i] = new Employee(rs.getInt(\"emp_no\"), rs.getDate(\"birth_date\"), rs.getString(\"first_name\"),rs.getString(\"last_name\"), rs.getString(\"gender\"), rs.getDate(\"hire_date\")); \n\n\t\t\t\t//Print it out\n\n\t\t\t\tSystem.out.println(empArray2[i++].toString());\n\n\t\t\t}\n\t\t\t\n\t\t\t// close the result and the statement\t\t\t\n\t\t\trs.close();\n\t\t\t// close the statement\n\t\t\tst.close();\n\n\t\t}\n\n\t\tcatch (SQLException e) {\n\n\t\t\tSystem.out.println(\"Error in getEmployeeByLastName\");\n\n\t\t\te.printStackTrace();\n\n\t\t}\n\n\t\treturn empArray2;\n\n\t}", "public void setLast_name(String last_name) {\n this.last_name = last_name;\n }", "public void setLastName( String last )\r\n {\r\n lastName = last;\r\n }", "public void setLast_name(String last_name) {\r\n this.last_name = last_name;\r\n }", "public String searchPerson(String name){\n String string = \"\";\n ArrayList<Person> list = new ArrayList<Person>();\n \n for(Person person: getPersons().values()){\n String _name = person.getName();\n if(_name.contains(name)){\n list.add(person);\n }\n }\n list.sort(Comparator.comparing(Person::getName));\n for (int i = 0; i < list.size(); i++){\n string += list.get(i).toString();\n }\n\n return string;\n }", "public List<com.ims.dataAccess.tables.pojos.User> fetchRangeOfLastname(String lowerInclusive, String upperInclusive) {\n return fetchRange(User.USER.LASTNAME, lowerInclusive, upperInclusive);\n }", "public java.lang.CharSequence getLastName() {\n return lastName;\n }", "protected void validateLastName(){\n Boolean lastName = Pattern.matches(\"[A-Z][a-z]{2,}\",getLastName());\n System.out.println(nameResult(lastName));\n }", "public void setLastName(StringFilter lastName) {\n\t\tthis.lastName = lastName;\n\t}", "public void setLastname(String lastname) {\r\n\t\tthis.lastname = lastname;\r\n\t}", "List<User> findByFirstname(String firstName);", "public void setLastname(String lastname);", "public java.lang.String getLast_name() {\n return last_name;\n }", "public java.lang.String getLast_name() {\n return last_name;\n }", "public static String lastName(String name) {\n int i = name.lastIndexOf('.');\n if (i == -1) return name;\n else return name.substring(i + 1);\n }", "public String getLastName()\r\n {\r\n return lastName;\r\n }", "String getSurname();", "public void setLastName(String lName) {\n this.lastName = lName;\n }", "public String getLastName() {\n return lastName;\n }", "public String getLastName() {\n return lastName;\n }", "public java.lang.String getLastName() {\r\n return lastName;\r\n }", "public void setlastName(String ln)\n\t{\n\t\tlastName = ln;\n\t}", "HasValue<String> getLastName();", "@AutoEscape\n\tpublic String getLastname();", "public String getLastName()\n {\n return this.lastName;\n }", "public String getLastName(){\n return(this.lastName);\n }", "public final String getLastName() {\r\n\t\treturn lastName;\r\n\t}", "public synchronized String getLastName()\r\n {\r\n return lastName;\r\n }", "public java.lang.String getLastName() {\n return lastName;\n }", "Name findNameByPersonPrimary(int idPerson);", "public int compareLastName(Person p) {\n int lnCmp = lastName.compareTo(p.lastName);\n return lnCmp;\n }", "public String getLastname() {\n return (String) get(\"lastname\");\n }", "public String getLastname() {\n return lastname;\n }", "List<Person> findByIdAndName(int id,String name);", "@AutoEscape\n\tpublic String getLast_name();", "public String getLastName()\r\n {\r\n return lastName;\r\n }", "public String getLastName()\r\n {\r\n return lastName;\r\n }", "public String getLastName()\r\n {\r\n return lastName;\r\n }", "public String extractLastName(String fullName) throws IllegalArgumentException {\n // check to make sure there is a space in the name, if there is no space in the name\n // we don't know if there is a first and a last name\n \n if (fullName == null || fullName.isEmpty() || fullName.indexOf(\" \") < LAST_NAME_IDX) {\n throw new IllegalArgumentException(\"Name cannot be null, empty, and must contain a space.\");\n }\n //String lastName = null;\n \n int spaceIndex = fullName.lastIndexOf(\" \");\n String lastName = fullName.substring(spaceIndex, fullName.length());\n \n // alternative\n // String[] parts = fullName.split(\" \");\n \n // Your code goes here. Assign your value to lastName\n return lastName;\n }", "public void setLastName(String lastName) {\n this.lastName = lastName;\n }", "public void setLastName(String lastName) {\n this.lastName = lastName;\n }", "public void setLastName(String lastName) {\n this.lastName = lastName;\n }", "public void setLastName(String lastName) {\n this.lastName = lastName;\n }", "public void setLastName(String lastName) {\n this.lastName = lastName;\n }", "public void setLastName(String lastName) {\n this.lastName = lastName;\n }" ]
[ "0.76761436", "0.7215158", "0.72051305", "0.7081033", "0.70600665", "0.69482946", "0.69482946", "0.6864573", "0.68589", "0.68172836", "0.67858875", "0.67783356", "0.6725012", "0.6725012", "0.6709082", "0.66352534", "0.66352534", "0.65861475", "0.65834755", "0.6519328", "0.6369383", "0.63537675", "0.63483983", "0.6337976", "0.62954384", "0.6250573", "0.6244949", "0.62327695", "0.62271374", "0.62234956", "0.6135791", "0.6117366", "0.6116905", "0.61159563", "0.6068473", "0.60567856", "0.6054007", "0.6053332", "0.60519665", "0.6047554", "0.60348964", "0.6032702", "0.60251796", "0.601878", "0.6012709", "0.6007759", "0.6006475", "0.59950453", "0.5992362", "0.5992362", "0.59890145", "0.59857404", "0.5983307", "0.59830064", "0.5982628", "0.5982311", "0.5962023", "0.5944704", "0.5929253", "0.5920732", "0.5910925", "0.59059614", "0.5900062", "0.58934444", "0.5887141", "0.58818746", "0.58689827", "0.58685094", "0.58685094", "0.5853723", "0.58528787", "0.5849206", "0.5845812", "0.5832156", "0.5832156", "0.58319396", "0.5825557", "0.5825317", "0.5823585", "0.58217084", "0.58196104", "0.5807131", "0.5807092", "0.58020914", "0.57927704", "0.5789961", "0.5785529", "0.57834095", "0.57741374", "0.5773574", "0.57735646", "0.57735646", "0.57735646", "0.5773271", "0.5772556", "0.5772556", "0.5772556", "0.5772556", "0.5772556", "0.5772556" ]
0.5891271
64
Created by nichaurasia on Thursday, December/12/2019 at 9:39 PM
public interface VisitRepository extends CrudRepository<Visit, Long> { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public Date getCreated()\n {\n return null;\n }", "public abstract long getCreated();", "@Override\n public Date getCreated() {\n return created;\n }", "public Date getDateCreated(){return DATE_CREATED;}", "public Date getCreationDate() {\n\n \n return creationDate;\n\n }", "public DateTime getCreationTime() {\n return created;\n }", "public DateTime getCreationTime() { return creationTime; }", "@Override\n public String getCreationDate() {\n return creationDate;\n }", "UUID getCreatedUUID()\n {\n return conglomerateUUID;\n }", "@Override\n\tpublic long getCreationTime() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic long getCreationTime() {\n\t\treturn 0;\n\t}", "@Override\r\n\tpublic Date getCreated_date() {\n\t\treturn super.getCreated_date();\r\n\t}", "public Date getCreationTime()\n {\n return created;\n }", "String getCreated_at();", "public int getCreatedTime() {\n return createdTime_;\n }", "Long getUserCreated();", "@java.lang.Override\n public long getCreationDate() {\n return creationDate_;\n }", "CreationData creationData();", "public String getCreated() {\n return this.created;\n }", "public String getCreated() {\n return this.created;\n }", "public Date getCreateTime()\n/* */ {\n/* 177 */ return this.createTime;\n/* */ }", "public Date getCreated() {\n return created;\n }", "public Date getCreated() {\n return created;\n }", "public Timestamp getCreated();", "public Timestamp getCreated();", "public Timestamp getCreated();", "public Timestamp getCreated();", "public Timestamp getCreated();", "public Timestamp getCreated();", "public Timestamp getCreated();", "public Timestamp getCreated();", "public Timestamp getCreated();", "public Timestamp getCreated();", "public Timestamp getCreated();", "public Timestamp getCreated();", "public Timestamp getCreated();", "@java.lang.Override\n public long getCreationDate() {\n return creationDate_;\n }", "public Date getCreation() {\n return creation;\n }", "public int getCreated() {\n return created;\n }", "public long getCreationDate() {\n return creationDate_;\n }", "public DateTime getCreatedOn();", "Date getDateCreated();", "private Person()\r\n\t{\r\n\t\tsuper();\r\n\t\t//created = LocalDateTime.now();\r\n\t\tcreated = Calendar.getInstance().getTime();\r\n\t}", "@Nonnull\n @CheckReturnValue\n default OffsetDateTime creationTime() {\n return Utils.creationTimeOf(idAsLong());\n }", "public String getDateCreated(){\n return dateCreated.toString();\n }", "public Date getDateCreated();", "public DateTime getCreatedDateTime() {\n return createdDateTime;\n }", "public Date getCreated() {\r\n return created;\r\n }", "public Date getCreated() {\r\n return created;\r\n }", "public final void mo51373a() {\n }", "@Test\n public void createdAtTest() {\n // TODO: test createdAt\n }", "Instant getCreated();", "public abstract long getCreatedTime();", "@Override\n public void perish() {\n \n }", "public Date getCreated() {\n return created;\n }", "public Date getCreated() {\n return created;\n }", "public Date getCreated() {\n return created;\n }", "public Date getCreated() {\n return created;\n }", "public static void created() {\n\t\t// TODO\n\t}", "public DateTime getCreated();", "public Timestamp getCreated() {\n return created;\n }", "public Date getCreationDate()\n {\n return creationDate;\n }", "public Date getCreateDate()\r\n/* */ {\r\n/* 158 */ return this.createDate;\r\n/* */ }", "public Date getDateCreated()\n {\n return dateCreated;\n }", "public Date getCreationTime() {\n return creationTime;\n }", "public Date getCreationTime() {\n return creationTime;\n }", "public Calendar getCreationDate() throws IOException {\n/* 238 */ return getCOSObject().getDate(COSName.CREATION_DATE);\n/* */ }", "String timeCreated();", "public Date getCreated() {\r\n return createdDate;\r\n }", "public Date getCreationTime() {\n return creationTime;\n }", "private static String getStamp() {\n\t\t\t return new SimpleDateFormat(\"yyyyMMddHHmmss\").format(new Date());\r\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "public java.lang.Long getCreated() {\n return created;\n }", "long getCreatedTime();", "@Override\n\tpublic void create() {\n\t\t\n\t}", "public void mo38117a() {\n }", "public Timestamp getCreatedDate() {\n return createdDate;\n }", "@Override\n default String getTs() {\n return null;\n }", "public String getDateCreationLibelle() {\n\t\tDateTimeFormatter format = DateTimeFormatter.ofPattern(\"dd/MM/yyyy hh:mm:ss\");\n\t\treturn this.dateCreation.format(format);\n\t}", "@Override\n\tpublic void create() {\n\n\t}", "public Date getCreatedDate();", "@Override\n\tpublic void create () {\n\n\t}", "public Date getCreated() {\n return mCreated;\n }", "public String getTimestamp() \n{\n Calendar now = Calendar.getInstance();\n return String.format(\"20%1$ty-%1$tm-%1$td_%1$tHh%1$tMm%1$tSs\", now);\n}", "@SuppressWarnings(\"unused\")\n private void generateInfo()\n {\n }", "public Long getCreationTimestamp() {\n return creationTimestamp;\n }", "public long getCreationDate() {\n return creationDate_;\n }", "public void create() {\n\t\t\n\t}", "private Long createId() {\n return System.currentTimeMillis() % 1000;\n }", "public long timeOfCreation() {\n\t\treturn timeOfCreation ;\n\t}", "public DateTime getCreatedAt() {\n return this.createdAt;\n }", "public DateTime creationTime() {\n return this.creationTime;\n }", "void setUserCreated(final Long userCreated);", "private long makeTimestamp() {\n return new Date().getTime();\n }", "public java.lang.Long getCreated() {\n return created;\n }", "@Override\n protected Object[] getData() {\n return new Object[] { creator };\n }", "Date getCreatedDate();", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }" ]
[ "0.59153616", "0.5609781", "0.55556697", "0.5554549", "0.55142313", "0.55050755", "0.54906625", "0.54880536", "0.5484826", "0.5413537", "0.5413537", "0.5395969", "0.53942287", "0.53820825", "0.5370474", "0.5362791", "0.5359984", "0.531947", "0.53117144", "0.53117144", "0.5309208", "0.5305264", "0.5305264", "0.53032315", "0.53032315", "0.53032315", "0.53032315", "0.53032315", "0.53032315", "0.53032315", "0.53032315", "0.53032315", "0.53032315", "0.53032315", "0.53032315", "0.53032315", "0.52926844", "0.52729243", "0.52472675", "0.52357763", "0.5219009", "0.52090514", "0.52074915", "0.5191035", "0.5178963", "0.51752853", "0.5173466", "0.5170282", "0.5170282", "0.5158227", "0.51569194", "0.5151559", "0.5147336", "0.51371235", "0.5129293", "0.5129293", "0.5129293", "0.5129293", "0.5129004", "0.51262414", "0.5122743", "0.51215565", "0.51155585", "0.51149714", "0.5108643", "0.5108643", "0.5102402", "0.50995505", "0.50947475", "0.5094088", "0.50938797", "0.50847465", "0.50826836", "0.50815535", "0.5077732", "0.507355", "0.50700146", "0.5064753", "0.50610125", "0.50588393", "0.5056776", "0.5055608", "0.5050274", "0.5049974", "0.504974", "0.50467354", "0.5044639", "0.5044041", "0.50400704", "0.50363016", "0.5035504", "0.50340605", "0.5030578", "0.502404", "0.5022755", "0.5003747", "0.50020015", "0.49994817", "0.49994817", "0.49994817", "0.49994817" ]
0.0
-1
This method executes before each method, resets user's service mock, builds and assigns mockMVC.
@Before public void SetUp() { Mockito.reset(userServiceMock); Mockito.clearInvocations(userServiceMock); mockMvc = MockMvcBuilders.webAppContextSetup(webConfiguration).build(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Before\n public void setUp()\n {\n Mockito.reset(memberServiceMock);\n\n mockMvc = MockMvcBuilders\n .webAppContextSetup(webApplicationContext)\n .apply(springSecurity())\n .build();\n }", "@Before\n public void setup(){\n MockitoAnnotations.initMocks(this);\n\n // create a standalone MVC Context to mocking\n mockMvc = MockMvcBuilders.standaloneSetup(customerController).build();\n }", "@Before\r\n\tpublic void init() {\r\n\t\tMockitoAnnotations.initMocks(this);\r\n\t\tmockMvc = MockMvcBuilders.standaloneSetup(tokenController).build();\r\n\r\n\t\t// mockMvc = MockMvcBuilders.webAppContextSetup(context).build();\r\n\t}", "@Before\n public void setup() {\n mockMvc = MockMvcBuilders.webAppContextSetup(webContext).build();\n\n regularUser = new User();\n regularUser.setUsername(\"regularUser\");\n regularUser.setPassword(\"testPassword1!\");\n regularUser.setRole(\"USER\");\n\n adminUser = new User();\n adminUser.setUsername(\"adminUser\");\n adminUser.setPassword(\"testPassword1!\");\n adminUser.setRole(\"ADMIN\");\n\n auth = mock(Authentication.class);\n securityContext = mock(SecurityContext.class);\n SecurityContextHolder.setContext(securityContext);\n }", "@Before\r\n public void setup() {\n JacksonTester.initFields(this, new ObjectMapper());\r\n // MockMvc standalone approach\r\n mvc = MockMvcBuilders.standaloneSetup(peopleController)\r\n .build();\r\n //peopleService = Mockito.mock(PeopleServiceImpl.class);\r\n }", "@BeforeEach\n public void setup() throws Exception {\n MockitoAnnotations.openMocks(this);\n mockMvc = standaloneSetup(userController)\n .setControllerAdvice(userManagementExceptionHandler)\n .build();\n }", "@Before\r\n\tpublic void setup() {\r\n\t\tthis.mockMvc = MockMvcBuilders.standaloneSetup(brickController).build();\r\n\t}", "private void setUp() {\n final MockSettings spyStubOnly = withSettings().stubOnly()\n .defaultAnswer(CALLS_REAL_METHODS);\n final MockSettings mockStubOnly = withSettings().stubOnly();\n // Return mocked services: LocalServices.getService\n // Avoid real operation: SurfaceControl.mirrorSurface\n // Avoid leakage: DeviceConfig.addOnPropertiesChangedListener, LockGuard.installLock\n // Watchdog.getInstance/addMonitor\n mMockitoSession = mockitoSession()\n .mockStatic(LocalServices.class, spyStubOnly)\n .mockStatic(DeviceConfig.class, spyStubOnly)\n .mockStatic(SurfaceControl.class, mockStubOnly)\n .mockStatic(LockGuard.class, mockStubOnly)\n .mockStatic(Watchdog.class, mockStubOnly)\n .strictness(Strictness.LENIENT)\n .startMocking();\n\n setUpSystemCore();\n setUpLocalServices();\n setUpActivityTaskManagerService();\n setUpWindowManagerService();\n }", "@Before\n public void setUp() {\n mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).build();\n }", "@Before\n\tpublic void setup(){\n\t\taccount = mock(Account.class);\n\t\t\t\t\n\t\taccountDB = mock(AccountRepository.class);\n\t\twhen(accountDB.find(anyString())).thenReturn(account);\n\t\tservice = new LoginService(accountDB);\n\n\t}", "@Before\n public void setup(){\n\n mockUserRepo = mock(UserRepository.class);\n mockSession = mock(UserSession.class);\n mockValidator = mock(InputValidator.class);\n sut = new UserService( mockUserRepo, mockSession, mockValidator);\n\n }", "@Before\n public void setup() {\n //用于初始化@Mock注解修饰的组件\n MockitoAnnotations.initMocks(this);\n\n requestVO = new RoleRequestVO();\n requestVO.setName(\"ROLE_ADMIN\");\n\n role = new Role();\n role.setName(\"ROLE_ADMIN\");\n role.setId(new Random().nextLong());\n }", "@Before\n public void before() {\n \t// TODO 07b: make mock for CargoDao using Mockito.mock(...)\n \t// (...)\n flightControlService = new FlightControlService(mCargoDao, mMessagingService);\n \n loadDummyCargoToMap();\n }", "@PostConstruct\n public void setup() {\n this.mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).build();\n }", "public void setUp() {\n System.setProperty(\"dexmaker.dexcache\", getContext().getCacheDir().toString());\n MockitoAnnotations.initMocks(this);\n\n when(mContext.getSystemService(DEVICE_POLICY_SERVICE)).thenReturn(mDevicePolicyManager);\n\n mHelper = new UserProvisioningStateHelper(\n mContext,\n mUtils,\n mSettingsFacade,\n PRIMARY_USER_ID);\n }", "@Before\n public void setup() {\n RoboGuice.overrideApplicationInjector(RuntimeEnvironment.application, new MyTestModule());\n mainPresenter = new MainPresenter(\n RuntimeEnvironment.application.getApplicationContext(), loginViewMock);\n\n }", "@Before\r\n public void setUp() {\r\n clientAuthenticated = new MockMainServerForClient();\r\n }", "@Before\n\tpublic void setup() throws Exception {\n\t\tthis.mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).build();\n\t}", "@BeforeClass\n\tpublic static void setUp() {\n\t\tuserRepository = Mockito.mock(UserRepository.class);\n\t\tuserService = new UserService(userRepository);\n\t}", "@BeforeEach\n public void initEach() {\n sut = new ApiKeyController(apiKeyService, new ModelMapper(), apiKeyLogWriter);\n mvc = MockMvcBuilders.standaloneSetup(sut)//\n .setCustomArgumentResolvers(new PageableHandlerMethodArgumentResolver())//\n .build();\n principal = new Principal() {\n @Override\n public String getName() {\n return \"principal\";\n }\n };\n }", "@Before\n public void setupRegisterViewModel(){\n MockitoAnnotations.initMocks(this);\n\n //we create an instance of the class to be tested by passing the mocked object\n registerViewModel = new RegisterViewModel(registerScreen, new UnitTestLogger());\n\n registerViewModel.getRegisterModel().setName(dummyName);\n registerViewModel.getRegisterModel().setEmail(dummyEmail);\n registerViewModel.getRegisterModel().setPhoneNo(dummyPhone);\n registerViewModel.getRegisterModel().setAddress(dummyAddress);\n }", "@Before\n public void setUp() {\n controller = Robolectric.buildActivity(MainActivity.class);\n activity = controller.get();\n\n // Now we mock out collaborators\n mockPanelScanProvider = mock(PanelScanProvider.class);\n activity.setPanelScanProvider(mockPanelScanProvider);\n\n mockSolarOutputProvider = mock(SolarOutputProvider.class);\n activity.setSolarOutputProvider(mockSolarOutputProvider);\n }", "@Before\n public void setup() throws Exception {\n this.mvc = webAppContextSetup(webApplicationContext).build();\n userRepository.deleteAll();\n //roleRepository.deleteAll();\n User joe = new User(\"joe\", \"1234\", \"admin\");\n User andy = new User(\"andy\", \"1234\", \"admin\");\n //roleRepository.save(new Role(\"ROLE_ADMIN\"));\n //roleRepository.save(new Role(\"ROLE_USER\"));\n userRepository.save(joe);\n userRepository.save(andy);\n Mockito.when(userRepository.findByUsername(joe.getUsername())).thenReturn(joe);\n Mockito.when(userRepository.findByUsername(andy.getUsername())).thenReturn(andy);\n }", "@Before\n public void testSetUp() {\n s_limitService.resetApiLimit(null);\n }", "@Before\n\tpublic void setup() {\n\t\tMockitoAnnotations.initMocks(this);\n\t\n\t}", "@Before\n public void setupService() {\n }", "protected void mockActivate() {\r\n this.bootstrapSettings = BootstrapConfiguration.getInstance();\r\n\r\n initializeProfileDirFromBootstrapSettings();\r\n initializeConfigurablePaths();\r\n loadRootConfiguration(false);\r\n initializeGeneralSettings();\r\n }", "@Before\n public void setUp() throws Exception {\n MockitoAnnotations.initMocks(this);\n AnalyticsTracker.INSTANCE.setDryRun(true);\n }", "@Before\n public void before() {\n ErrorMessageUtil errorMessages = Mockito.mock(ErrorMessageUtil.class);\n Mockito.when(errorMessages.getMessage(ArgumentMatchers.anyString(), ArgumentMatchers.any())).thenReturn(ERROR_MESSAGE);\n\n permissions = Mockito.mock(ResourcePermissions.class);\n Mockito.when(permissions.doesUserHaveRole(ArgumentMatchers.anyList())).thenReturn(true);\n\n reviewer = new FunctionalityTestedAllowedByRoleReviewer(permissions, errorMessages, RESTRICTED_FUNCTIONALITY_TESTED_JSON);\n }", "@Before\n\tpublic void setup(){\n\t\tMockitoAnnotations.initMocks(this);\n\t}", "@Before\n public void beforeEach() {\n mockMvc = MockMvcBuilders\n .webAppContextSetup(context)\n .build();\n\n serviceMock = mock(PacketAppService.class);\n ReflectionTestUtils.setField(controller, PACKET_APP_SERVICE, serviceMock);\n\n testAppender = new TestLogAppender();\n root.addAppender(testAppender);\n root.setLevel(Level.DEBUG);\n }", "@BeforeMethod(alwaysRun = true)\n protected void setUp()\n {\n for (final MetricName metricName : Metrics.defaultRegistry().allMetrics().keySet()) {\n Metrics.defaultRegistry().removeMetric(metricName);\n }\n\n httpHeaders = Mockito.mock(HttpHeaders.class);\n request = Mockito.mock(HttpServletRequest.class);\n filterRequestHandler = Mockito.mock(EventFilterRequestHandler.class);\n deserializerFactory = Mockito.mock(EventDeserializerFactory.class);\n eventDeserializer = new MockEventDeserializer();\n\n Mockito.verifyZeroInteractions(httpHeaders, request, filterRequestHandler, deserializerFactory);\n }", "@Before\n\tpublic void setup() {\n\t\tMockitoAnnotations.initMocks(this);\n\t}", "@BeforeEach\n void setUp() {\n mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).build();\n\n objectMapper = new ObjectMapper();\n }", "@BeforeEach\n public void setUp() {\n MockitoAnnotations.openMocks(this);\n\n // build a mockMvc instance by registering one or more @Controller instances\n // and configuring mvc infrastructure programmatically\n mockMvc = MockMvcBuilders.standaloneSetup(itemController).build();\n\n // initialize testItem\n now = LocalDate.now();\n date = Date.valueOf(now);\n item = new Item(\n null, \"SomeName\", \"This is a description\",\n \"FirstOwner\", \"Joe\",\n \"A photo\", date, date,\n 1.00, 2.00, 0.00\n );\n }", "@BeforeEach\n public void testSetup() {\n request = mock(Request.class);\n response = mock(Response.class);\n session = mock(Session.class);\n when(request.session()).thenReturn(session);\n templateEngine = mock(TemplateEngine.class);\n playerLobby = new PlayerLobby(new GameCenter());\n CuT = new PostSignInRoute(templateEngine, playerLobby);\n }", "public void resetMocking() {\n mockGraphReadMethods = mock(GraphReadMethods.class);\n mockGraphWriteMethods = mock(GraphWriteMethods.class);\n mockJsonNode = mock(JsonNode.class);\n mockJsonGenerator = mock(JsonGenerator.class);\n mockCache = mock(ImmutableObjectCache.class);\n }", "@Before\r\n\tpublic void setUp() {\n\t\tfor (int i=0; i<NUM_USERS; i++) {\r\n\t\t\ttry {\r\n\t\t\t\tNewUser user = CrowdAuthUtil.getUser(userID(i));\r\n\t\t\t\tCrowdAuthUtil.deleteUser(user.getEmail());\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\t// here we are doing the best we can, so just go on to the next one\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void initializeUserControllers() {\n trUpdateUserImage = UserControllersFactory.createTrUpdateUserImage();\n trDeleteUser = UserControllersFactory.createTrDeleteUser();\n trObtainUser = UserControllersFactory.createTrObtainUser();\n trChangePassword = UserControllersFactory.createTrChangePassword();\n trChangeMail = UserControllersFactory.createTrChangeMail();\n trChangeUsername = UserControllersFactory.createTrChangeUsername();\n trExistsUsername = UserControllersFactory.createTrExistsUsername();\n trObtainUserImage = UserControllersFactory.createTrObtainUserImage();\n trSendFirebaseMessagingToken = UserControllersFactory.createTrSendFirebaseMessagingToken();\n }", "@Before\n public void setUp() {\n setThreadAssertsDisabledForTesting(true);\n MockitoAnnotations.initMocks(this);\n mDispatcherBridge =\n new PasswordSettingsUpdaterDispatcherBridge(mReceiverBridgeMock, mAccessorMock);\n }", "@Before\n public void setup() {\n PowerMockito.mockStatic(FacesContext.class);\n when(FacesContext.getCurrentInstance()).thenReturn(fc);\n\n PowerMockito.mockStatic(ExternalContext.class);\n when(fc.getExternalContext()).thenReturn(ec);\n\n navigationBean = new NavigationBean();\n\n sessionUser = new SessionUserBean();\n sessionUser.setUserID(SAMPLE_ID);\n sessionUser.setLanguage(SAMPLE_LANGUAGE);\n navigationBean.setSessionUser(sessionUser);\n }", "@BeforeMethod\n private void setUp() throws ServerError {\n sessionMock.returns(updatePrxMock.getMock()).getUpdateService();\n\n // mock the session on the Blitz service mock\n updateService = new UpdateBlitzService(sessionMock.getMock());\n }", "@Override\n \tpublic void setUp() throws Exception{\n \t\tLog.i(\"got to top of setup\", \"yay\");\n \t\t\n \t\tLog.i(\"solo\", \"created solo\");\n \t\t\n \t\tLog.i(\"user name\", \"set user name\");\n \t\tIntent i = new Intent();\n \t\ti.putExtra(\"groupname\", \"GroupForTestingOnly\");\n \t\ti.putExtra(\"gm\", \"UseForTestingOnly\");\n \t\tsetActivityIntent(i);\n \t\tsolo = new Solo(getInstrumentation(), getActivity());\n \t\tSaveSharedPreference.setPersistentUserName(getActivity(), VALID_USERNAME);\n \t\tLog.i(\"set the intent\", \"what?\");\n \t}", "private void setUpLocalServices() {\n tearDownLocalServices();\n\n // UriGrantsManagerInternal\n final UriGrantsManagerInternal ugmi = mock(UriGrantsManagerInternal.class);\n LocalServices.addService(UriGrantsManagerInternal.class, ugmi);\n\n // AppOpsManager\n final AppOpsManager aom = mock(AppOpsManager.class);\n doReturn(aom).when(mContext).getSystemService(eq(Context.APP_OPS_SERVICE));\n\n // DeviceStateManager\n final DeviceStateManager dsm = mock(DeviceStateManager.class);\n doReturn(dsm).when(mContext).getSystemService(eq(Context.DEVICE_STATE_SERVICE));\n\n // Prevent \"WakeLock finalized while still held: SCREEN_FROZEN\".\n final PowerManager pm = mock(PowerManager.class);\n doReturn(pm).when(mContext).getSystemService(eq(Context.POWER_SERVICE));\n mStubbedWakeLock = createStubbedWakeLock(false /* needVerification */);\n doReturn(mStubbedWakeLock).when(pm).newWakeLock(anyInt(), anyString());\n doReturn(mStubbedWakeLock).when(pm).newWakeLock(anyInt(), anyString(), anyInt());\n\n // DisplayManagerInternal\n final DisplayManagerInternal dmi = mock(DisplayManagerInternal.class);\n doReturn(dmi).when(() -> LocalServices.getService(eq(DisplayManagerInternal.class)));\n\n // ColorDisplayServiceInternal\n final ColorDisplayService.ColorDisplayServiceInternal cds =\n mock(ColorDisplayService.ColorDisplayServiceInternal.class);\n doReturn(cds).when(() -> LocalServices.getService(\n eq(ColorDisplayService.ColorDisplayServiceInternal.class)));\n\n final UsageStatsManagerInternal usmi = mock(UsageStatsManagerInternal.class);\n LocalServices.addService(UsageStatsManagerInternal.class, usmi);\n\n // PackageManagerInternal\n final PackageManagerInternal packageManagerInternal = mock(PackageManagerInternal.class);\n LocalServices.addService(PackageManagerInternal.class, packageManagerInternal);\n doReturn(false).when(packageManagerInternal).isPermissionsReviewRequired(\n anyString(), anyInt());\n doReturn(null).when(packageManagerInternal).getDefaultHomeActivity(anyInt());\n\n ComponentName systemServiceComponent = new ComponentName(\"android.test.system.service\", \"\");\n doReturn(systemServiceComponent).when(packageManagerInternal).getSystemUiServiceComponent();\n\n // PowerManagerInternal\n final PowerManagerInternal pmi = mock(PowerManagerInternal.class);\n final PowerSaveState state = new PowerSaveState.Builder().build();\n doReturn(state).when(pmi).getLowPowerState(anyInt());\n doReturn(pmi).when(() -> LocalServices.getService(eq(PowerManagerInternal.class)));\n\n // PermissionPolicyInternal\n final PermissionPolicyInternal ppi = mock(PermissionPolicyInternal.class);\n LocalServices.addService(PermissionPolicyInternal.class, ppi);\n doReturn(true).when(ppi).checkStartActivity(any(), anyInt(), any());\n\n // InputManagerService\n mImService = mock(InputManagerService.class);\n // InputChannel cannot be mocked because it may pass to InputEventReceiver.\n final InputChannel[] inputChannels = InputChannel.openInputChannelPair(TAG);\n inputChannels[0].dispose();\n mInputChannel = inputChannels[1];\n doReturn(mInputChannel).when(mImService).monitorInput(anyString(), anyInt());\n doReturn(mInputChannel).when(mImService).createInputChannel(anyString());\n\n // StatusBarManagerInternal\n final StatusBarManagerInternal sbmi = mock(StatusBarManagerInternal.class);\n doReturn(sbmi).when(() -> LocalServices.getService(eq(StatusBarManagerInternal.class)));\n }", "@Before\r\n\tpublic void before() {\r\n\t}", "protected void forceMockUpMode(){\n teardown();\n }", "@BeforeAll\n public void setup() {\n mockMvc = MockMvcBuilders.webAppContextSetup(webContext).build();\n\n patient = new Patient();\n LocalDate dob = LocalDate.of(Integer.parseInt(\"1999\"), Integer.parseInt(\"01\"), Integer.parseInt(\"01\"));\n Patient patient = new Patient();\n patient.setGivenName(\"TestGiven\");\n patient.setFamilyName(\"TestFamily\");\n patient.setDob(dob);\n patient.setSex('F');\n patient.setAddress(\"123 Test Street\");\n patient.setPhone(\"555-555-5555\");\n }", "@BeforeEach\n public void reset() {\n WIREMOCK_SERVER.resetAll();\n // create new TestRail client instance\n restClientActor =\n RestClientActor.newBuilder()\n .withBaseURL(\"http://localhost:\" + WIREMOCK_SERVER.port())\n .withBasicAuth(\"User\", \"Password\")\n .withDefaultHeader(\"DefaultStaticHeader\", \"static-header-value\")\n .withDefaultHeader(\"DefaultDynamicHeader\", defaultDynamicHeaderSupplier)\n .build();\n }", "@Before\n public void setup() throws Exception {\n\n mockMvc = MockMvcBuilders.webAppContextSetup(wac).build();\n\n //mockMvc = MockMvcBuilders.standaloneSetup(new WorkOrderController(repository, assembler, customisedWorkOrderRepository)).build();\n\n\n String sdate1 = \"15-01-2020 01:12:12\";\n Date date1 = dateFormatter.stringToDate(sdate1);\n Long normal= 11L;\n\n String sdate2 = \"07-01-2020 01:12:12\";\n Date date2 = dateFormatter.stringToDate(sdate2);\n Long priority= 9L;\n\n String sdate3 = \"05-01-2020 01:12:12\";\n Date date3 = dateFormatter.stringToDate(sdate3);\n Long vip= 10L;\n\n String sdate4 = \"03-01-2020 01:12:12\";\n Date date4 = dateFormatter.stringToDate(sdate4);\n Long management_override= 15L;\n\n allOrders = new ArrayList<>();\n\n order1 = new WorkOrder(normal, date1);\n WorkOrder order2 = new WorkOrder(priority, date2);\n WorkOrder order3 = new WorkOrder(vip, date3);\n WorkOrder order4 = new WorkOrder(management_override, date4);\n\n allOrders.add(order1);\n allOrders.add(order2);\n allOrders.add(order3);\n allOrders.add(order4);\n\n entityModel = new EntityModel<>(order1);\n }", "@Before\r\n\tpublic void set_up(){\n\t}", "@Before\n public void before() {\n }", "@Before\n public void before() {\n }", "@Before\n public void setUp() {\n underTest = context.registerInjectActivateService(new CropSquareServlet());\n }", "public void setUp() {\n super.setUp();\n dbSessionClearCache();\n if(!compare()) {\n clear();\n populate();\n }\n dbSessionClearCache();\n }", "protected void setUp() {\n //Clear all namespace in the ConfigManager\n TestHelper.resetConfig();\n }", "@Before\n public void setUp() {\n start(fakeApplication(inMemoryDatabase(), fakeGlobal()));\n }", "@Before\n public void setUp() {\n // Need to call start and resume to get the fragment that's been added\n homeController = Robolectric.buildActivity(AuthenticationActivity.class).\n create().start().resume().visible();\n homeActivity = (Activity) homeController.get();\n }", "@Before\n public void setUp() throws Exception {\n MockServletContext mockServletContext = new MockServletContext();\n new SpannerClient().contextInitialized(new ServletContextEvent(mockServletContext));\n SpannerTestTasks.setup();\n\n eventVolunteeringFormHandlerServlet = new VolunteeringFormHandlerServlet();\n\n request = Mockito.mock(HttpServletRequest.class);\n response = Mockito.mock(HttpServletResponse.class);\n }", "@Override\r\n protected void setUp() throws Exception {\r\n deleteAllProjects();\r\n\r\n lookupProjectServiceRemoteWithUserRole();\r\n }", "@Before\r\n\tpublic void initializeDefaultMockObjects()\r\n\t{\r\n\t\tconfigs = new ArrayList<Config>();\r\n\t\tscreenshots = new ArrayList<Screenshot>();\r\n\t\tprocessedImages = new ArrayList<ProcessedImage>();\r\n\t\ttestExecutions = new ArrayList<TestExecution>();\r\n\t\ttestEnvironments = new ArrayList<TestEnvironment>();\r\n\r\n\t\tinitializeDefaultTestExecution();\r\n\t\tinitializeDefaultTestEnvironment();\r\n\t\tinitializeDefaultScreenshot();\r\n\t}", "@BeforeEach\n public void testSetup() {\n request = mock(Request.class);\n response = mock(Response.class);\n session = mock(Session.class);\n when(request.session()).thenReturn(session);\n templateEngine = mock(TemplateEngine.class);\n playerLobby = new PlayerLobby(new GameCenter());\n CuT = new PostResignRoute(playerLobby);\n }", "@Before\n\tpublic void setUp() throws Exception {\n\t\teventDao = new EventDAO();\t\t\n\t\tcontroller = new EventController();\n\t\tresponse = new MockHttpServletResponse();\t\t\n\t}", "@BeforeEach\n\tpublic void setUp() {\n\t\tMockitoAnnotations.initMocks(this);\n\t\tErsUser user= new ErsUser(\"user0\",\"pass0\",\"f0\",\"l0\",\"user0@.com\",4);\n//\t\treimb1 = new ErsReimbursement(500,\"CAD\",10018,10019,2);\n//\t\treimb2 = new ErsReimbursement(1000,500,\"CAD\",\"a\",\"b\",10018,10019,2,2);\n\t\twhen(req.getParameter(\"uName\")).thenReturn(\"user0\");\n\t\twhen(req.getParameter(\"pWord\")).thenReturn(\"pass0\");\n\t\twhen(req.getParameter(\"username\")).thenReturn(\"user0\");\n\t\twhen(req.getParameter(\"password\")).thenReturn(\"pass0\");\n\t\twhen(req.getParameter(\"fname\")).thenReturn(\"f0\");\n\t\twhen(req.getParameter(\"lname\")).thenReturn(\"l0\");\n\t\twhen(req.getParameter(\"email\")).thenReturn(\"user0@.com\");\n\t\twhen(reiUser.getOneByUserName(\"user0\")).thenReturn(user);\n//\t\twhen(Integer.parseInt(anyString())).thenReturn(4);\n//\t\tdoNothing().when(reiUser).insert(user);\n\t\t\n\t\twhen(reiUser.validateLogin(\"user0\", \"pass0\")).thenReturn(true);\n\t\twhen(req.getSession()).thenReturn(ses);\n\t\tdoNothing().when(ses).setAttribute(anyString(),anyString());\n\t\t\n\t}", "@Before\n public void setUp() {\n deviceController = Mockito.mock(DeviceController.class);\n settingController = Mockito.mock(SettingController.class);\n gprsMessageDAO = Mockito.mock(GprsMessageDAO.class);\n postResults = new ArrayList<>();\n\n Mockito.when(settingController.getSetting(\"deviceCommunicator.endpoint\"))\n .thenReturn(\"http://jouko.test/\");\n\n Mockito.when(settingController.getSetting(\"deviceCommunicator.asId\"))\n .thenReturn(\"as\");\n\n Mockito.when(settingController.getSetting(\"deviceCommunicator.enabled\", \"false\"))\n .thenReturn(\"true\");\n\n subject = new DeviceCommunicator(\n deviceController,\n settingController,\n Clock.fixed(Instant.EPOCH, ZoneOffset.UTC),\n (String postResult) -> {\n postResults.add(postResult);\n return \"<html><body>Request queued by LRC</body></html>\";\n }\n );\n }", "@Before\n\tpublic void init() {\n\t\tuserDao=new UsersDAO();\n\t\tentityManager=mock(EntityManager.class);\n\t\tuserDao.setEntityManager(entityManager);\n\t\t\n\t}", "@Before\r\n public void beforeTests() {\r\n request = Mockito.mock(HttpServletRequest.class);\r\n response = Mockito.mock(HttpServletResponse.class);\r\n session = Mockito.mock(HttpSession.class);\r\n BDDMockito.given(request.getSession()).willReturn(session);\r\n ServletContext context = Mockito.mock(ServletContext.class);\r\n BDDMockito.given(session.getServletContext()).willReturn(context);\r\n @SuppressWarnings(\"unchecked\")\r\n StorageService<String, Object> storageService = Mockito.mock(StorageService.class);\r\n BDDMockito.given(context.getAttribute(Mockito.anyString())).willReturn(storageService);\r\n LoginContextEntry loginContextEntry = Mockito.mock(LoginContextEntry.class);\r\n BDDMockito.given(loginContextEntry.isExpired()).willReturn(false);\r\n loginContext = Mockito.mock(LoginContext.class);\r\n BDDMockito.given(loginContext.getRelyingPartyId()).willReturn(\"dummyPartyId\");\r\n BDDMockito.given(loginContextEntry.getLoginContext()).willReturn(loginContext);\r\n BDDMockito.given(storageService.get(Mockito.anyString(), Mockito.anyString())).willReturn(loginContextEntry);\r\n Cookie cookie = Mockito.mock(Cookie.class);\r\n BDDMockito.given(cookie.getName()).willReturn(\"_idp_authn_lc_key\");\r\n BDDMockito.given(cookie.getValue()).willReturn(\"anythingNotNull\");\r\n Cookie[] requestCookies = { cookie };\r\n BDDMockito.given(request.getCookies()).willReturn(requestCookies);\r\n }", "public void mock(){\n\n }", "@Before\n public void setUp() {\n // Need to call start and resume to get the fragment that's been added\n activityController = Robolectric.buildActivity(AuthenticationActivity.class).\n create().start().resume().visible();\n authenticationActivity = (Activity) activityController.get();\n }", "@Before\n public void setUp() throws Exception {\n cut = new LightScheduler();\n// spyLedController = new SpyLedController();\n// fakeTimeService = new FakeTimeService();\n }", "private void setupRequestContext() {\n\t\tMockHttpServletRequest request = new MockHttpServletRequest();\n\t\tServletRequestAttributes attributes = new ServletRequestAttributes(request);\n\t\tRequestContextHolder.setRequestAttributes(attributes);\n\t}", "private void setupRequestContext() {\r\n\t\tMockHttpServletRequest request = new MockHttpServletRequest();\r\n\t\tServletRequestAttributes attributes = new ServletRequestAttributes(request);\r\n\t\tRequestContextHolder.setRequestAttributes(attributes);\r\n\t}", "private void setupRequestContext() {\r\n\t\tMockHttpServletRequest request = new MockHttpServletRequest();\r\n\t\tServletRequestAttributes attributes = new ServletRequestAttributes(request);\r\n\t\tRequestContextHolder.setRequestAttributes(attributes);\r\n\t}", "@Before\n public void setUp() {\n MockitoAnnotations.initMocks(this);\n }", "@Override\n @Before\n public void before() throws Exception {\n\n super.before();\n }", "@Before\n public void setup(){\n\tMockito.when(mockOroSecret.getOROSecretKey()).thenReturn(\"abc@123\");\n\tutility = TokenUtility.getInstance(mockOroSecret);\n }", "@Before\n public void setup() {\n ApiAuthProviders authProviders = ApiAuthProviders.builder()\n .cognitoUserPoolsAuthProvider(new FakeCognitoAuthProvider())\n .oidcAuthProvider(new FakeOidcAuthProvider())\n .build();\n decorator = new AuthRuleRequestDecorator(authProviders);\n }", "protected void setUp() {\n\t}", "@Override\n public void beforeFirstLogic() {\n }", "@Before\n public void setUp() throws IkatsDaoException {\n Facade.removeAllMacroOp();\n }", "@Before public void setUp() { }", "@Before\r\n\t public void setUp(){\n\t }", "@BeforeMethod\r\n\tpublic void beforeMethod() {\r\n\t\t//initializeTestBaseSetup();\r\n\t}", "@Before\r\n public void setUp() { \r\n ApiProxy.setEnvironmentForCurrentThread(new TestEnvironment());\r\n //ApiProxy.setDelegate(new ApiProxyLocalImpl(new File(\".\")){});\r\n \t\r\n //helper.setUp();\r\n }", "@BeforeEach\n\tpublic void setup() throws Exception {\n\t\tGDACoreActivator activator = new GDACoreActivator(); // Make an instance to call method that sets static field!\n\t\tactivator.start(mockContext); // Inject the mock\n\n\t\tosgiServiceBeanHandler = new OsgiServiceBeanHandler();\n\t}", "@Before\n public void setUp() {\n boiler1 = Boiler1.getUniqueInstance();\n boiler1.boiled = false;\n boiler1.empty = true;\n }", "@BeforeEach\n public void setUp() {\n testUserLoginRes = new LoginData(\n CURRENT_USER.getUserId(),\n CURRENT_USER.getPassword()\n );\n }", "@Before\n public void init() throws MxException {\n InjectorContainer.get().injectMembers( this );\n InjectorContainer.set( iInjector );\n testTaskDefinitionResource.setEJBContext( ejbContext );\n\n setAuthorizedUser( AUTHORIZED );\n setUnauthorizedUser( UNAUTHORIZED );\n\n initializeTest();\n\n Mockito.when( ejbContext.getCallerPrincipal() ).thenReturn( principal );\n Mockito.when( principal.getName() ).thenReturn( AUTHORIZED );\n constructTaskDefinitions();\n }", "@Before\n\tpublic void setUp()\n\t{\n\t\tm_mockery = new Mockery();\n\t\tm_values = m_mockery.mock(KeyedValues.class);\n\t}", "@Before\n public void setup() {\n MockitoAnnotations.initMocks(this);\n\n historyList = Lists.newArrayList(new History(\"WWW1234\",\n \"Kuantan\",\n Long.valueOf(\"1542022506879\"),\n \"-sdsad\",\n 0.45,\n 1));\n\n historyPresenter = new HistoryPresenter(historyView, remoteDataSource,\n sharedPreferenceService);\n }", "@Before\n public void setup() {\n MockitoAnnotations.initMocks(this);\n final AddressEndpoint addressEndpoint = new AddressEndpoint(addressRepository);\n this.mockAddressEndpoint = MockMvcBuilders.standaloneSetup(addressEndpoint).build();\n\n address01 = new Address(\"Procession St\", \"Paris\", \"75015\", \"FR\");\n address02 = new Address(\"Ritherdon Rd\", \"London\", \"8QE\", \"UK\");\n address03 = new Address(\"Inacio Alfama\", \"Lisbon\", \"A54\", \"PT\");\n address04 = new Address(\"Jardins\", \"Sao Paulo\", \"345678\", \"BR\");\n address05 = new Address(\"Coffey\", \"Perth\", \"654F543\", \"AU\");\n address06 = new Address(\"Harbour Bridge\", \"Sydney\", \"JHG3\", \"AU\");\n address07 = new Address(\"Playa de la Concha\", \"San Sebastian\", \"45678\", \"ES\");\n\n // Persist the object\n addressRepository.save(address01);\n addressRepository.save(address02);\n addressRepository.save(address03);\n addressRepository.save(address04);\n addressRepository.save(address05);\n addressRepository.save(address06);\n addressRepository.save(address07);\n }", "@BeforeTest\n public void setUp() {\n UrlaubrWsUtils.migrateDatabase(TravelServiceImpl.DEFAULT_URL, TravelServiceImpl.DEFAULT_USER, TravelServiceImpl.DEFAULT_PASSWORD);\n\n service = new TravelServiceImpl();\n }", "@Override public void setUp() throws Exception {\n\t\tsuper.setUp();\n\t\toauth = new OAuthSource(getInstrumentation().getContext());\n\t\toauth.storage = spy(oauth.storage);\n\t\toauth.storage.invalidate();\n\t}", "private void setupEnvironment() {\n // Create mocks for configurations\n bgpConfig = createMock(BgpConfig.class);\n participantsConfig = createMock(SdxParticipantsConfig.class);\n\n // Create mocks for services\n coreService = new TestCoreService();\n configService = new TestNetworkConfigService();\n registry = new NetworkConfigRegistryAdapter();\n interfaceService = createMock(InterfaceService.class);\n interfaceService.addListener(anyObject(InterfaceListener.class));\n expectLastCall().anyTimes();\n intentSynchronizer = createMock(IntentSynchronizationService.class);\n }", "private void setUpMockObjects() {\n this.request = new CustomMockHttpServletRequest();\n byte[] content = { 4, 6, 7 };\n ServletInputStream inputStream = new DelegatingServletInputStream(\n new ByteArrayInputStream(content));\n this.request.inputStream = inputStream;\n\n this.response = new MockHttpServletResponse();\n\n this.setUpXmlRpcElementFactory();\n this.setUpXmlRpcRequestParser();\n this.setUpXmlRpcResponseWriter();\n this.setUpXmlRpcServiceExporterMap();\n }", "@Before\n public void setUp() {\n MockitoAnnotations.initMocks(this);\n }", "@BeforeAll\n static void cacheManager() {\n }", "@Before\n\t public void setUp() {\n\t }", "@Test\n public void testIndexSuccess() {\n User user = new User();\n user.setTenant(\"111\");\n user.setPassword(\"pass\");\n user.setToken(\"fake-token\");\n user.setUserid(\"1\");\n user.setUsername(\"fake-user\");\n\n IUserService userServiceMock = mock(IUserService.class);\n IAuthService authServiceMock = mock(IAuthService.class);\n when(userServiceMock.isValid(anyString())).thenReturn(true);\n when(userServiceMock.findByToken(anyString())).thenReturn(user);\n Map<String, String> flashData = Collections.emptyMap();\n Map<String, Object> argData = Collections.emptyMap();\n play.api.mvc.RequestHeader header = mock(play.api.mvc.RequestHeader.class);\n Http.Request request = mock(Http.Request.class);\n when(request.getHeader(\"Token\")).thenReturn(\"fake-token\");\n Http.Context context = new Http.Context(2L, header, request, flashData, flashData, argData);\n Http.Context.current.set(context);\n\n Result result = new Login(userServiceMock, authServiceMock).index();\n assertEquals(200, result.status());\n\n verify(userServiceMock).isValid(anyString());\n verify(userServiceMock, times(2)).findByToken(anyString());\n verify(request, times(2)).getHeader(anyString());\n }", "public static void reset() {\n LeanplumInternal.setCalledStart(false);\n LeanplumInternal.setHasStarted(false);\n TestClassUtil.setField(LeanplumInternal.class, \"issuedStart\", false);\n TestClassUtil.setField(LeanplumInternal.class, \"hasStartedAndRegisteredAsDeveloper\", false);\n LeanplumInternal.setStartSuccessful(false);\n List startHandlersField = (List) TestClassUtil.getField(Leanplum.class, \"startHandlers\");\n startHandlersField.clear();\n List list = (List) TestClassUtil.getField(LeanplumInternal.class, \"startIssuedHandlers\");\n list.clear();\n\n List variablesChangedHandlers = (List) TestClassUtil.getField(Leanplum.class,\n \"variablesChangedHandlers\");\n variablesChangedHandlers.clear();\n List noDownloadsHandlers = (List) TestClassUtil.getField(Leanplum.class, \"noDownloadsHandlers\");\n noDownloadsHandlers.clear();\n List onceNoDownloadsHandlers = (List) TestClassUtil.getField(Leanplum.class,\n \"onceNoDownloadsHandlers\");\n onceNoDownloadsHandlers.clear();\n\n LeanplumInternal.getUserAttributeChanges().clear();\n Leanplum.countAggregator().getAndClearCounts();\n\n TestClassUtil.setField(Leanplum.class, \"registerDeviceHandler\", null);\n TestClassUtil.setField(Leanplum.class, \"registerDeviceFinishedHandler\", null);\n LeanplumInternal.setIsPaused(false);\n TestClassUtil.setField(Leanplum.class, \"deviceIdMode\", LeanplumDeviceIdMode.MD5_MAC_ADDRESS);\n TestClassUtil.setField(Leanplum.class, \"customDeviceId\", null);\n TestClassUtil.setField(Leanplum.class, \"userSpecifiedDeviceId\", false);\n LeanplumInternal.setStartedInBackground(false);\n TestClassUtil.setField(LeanplumInternal.class, \"inForeground\", false);\n\n TestClassUtil.setField(Leanplum.class, \"context\", null);\n\n LeanplumInbox newsfeed = (LeanplumInbox) TestClassUtil.getField(LeanplumInbox.class,\n \"instance\");\n TestClassUtil.setField(LeanplumInbox.class, newsfeed, \"unreadCount\", 0);\n Map messages = (Map) TestClassUtil.getField(LeanplumInbox.class, newsfeed, \"messages\");\n messages.clear();\n List newsfeedChangedHandlers = (List) TestClassUtil.getField(LeanplumInbox.class, newsfeed,\n \"changedCallbacks\");\n newsfeedChangedHandlers.clear();\n TestClassUtil.setField(LeanplumInbox.class, newsfeed, \"didLoad\", false);\n\n VarCache.reset();\n // Reset the map values in ActionManager.\n TestClassUtil.setField(ActionManager.getInstance(), \"messageImpressionOccurrences\", new HashMap<>());\n TestClassUtil.setField(ActionManager.getInstance(), \"messageTriggerOccurrences\", new HashMap<>());\n TestClassUtil.setField(ActionManager.getInstance(), \"sessionOccurrences\", new HashMap<>());\n\n TestClassUtil.setField(MessageTemplates.class, \"registered\", false);\n }", "@Before public void setUp() {\n }" ]
[ "0.71857", "0.69578105", "0.6814725", "0.67106956", "0.6552009", "0.6527005", "0.6514331", "0.64429843", "0.6414555", "0.6361832", "0.6352203", "0.63396955", "0.6285246", "0.6234608", "0.620836", "0.62034243", "0.61268395", "0.6093181", "0.607739", "0.6064338", "0.5997529", "0.5997158", "0.5974188", "0.5943927", "0.5940045", "0.59097284", "0.59072834", "0.5871688", "0.58651745", "0.58628464", "0.58486205", "0.5848432", "0.58371276", "0.583361", "0.5820602", "0.5817694", "0.58175004", "0.58157367", "0.5804907", "0.5804224", "0.5801664", "0.5791771", "0.57846326", "0.57842386", "0.57792825", "0.57714456", "0.57705", "0.57702595", "0.57682824", "0.5758373", "0.574703", "0.574703", "0.57385445", "0.57374", "0.5723522", "0.5716668", "0.5701159", "0.5678614", "0.5667699", "0.56668043", "0.5665176", "0.5659889", "0.56594175", "0.5658425", "0.5657033", "0.5652458", "0.56470144", "0.56365407", "0.5630726", "0.562861", "0.5627919", "0.5627919", "0.56257975", "0.56172615", "0.5613017", "0.55940896", "0.55937016", "0.55928755", "0.55924153", "0.5590645", "0.55835015", "0.5580351", "0.5578898", "0.5578883", "0.5576878", "0.5573243", "0.5564979", "0.5562206", "0.5559962", "0.55527836", "0.55497426", "0.55487883", "0.55402935", "0.5537554", "0.5534243", "0.55335426", "0.55321246", "0.55276585", "0.55256945", "0.5525059" ]
0.78359115
0
This method execute after each method and call validateMockitoUsage().
@After public void validate() { validateMockitoUsage(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "default void afterInvocation() {\n afterInvocation(false);\n }", "@Override\n protected void after() {\n }", "@After(\"execution(* test.aspect.lib.Tools.call*(..))\")\n\tpublic void callToolCalled() {\n\t\tlogger.info(\"AFTER ADVICE: Tools callable called\");\n\t}", "@Stub\n\tpublic void after()\n\t{\n\t\t//\n\t}", "@Override\n public void doAfterAllAnalysed(AnalysisContext context) {\n\n }", "@After\r\n @CallSuper\r\n public void afterTest() {\n }", "@After\n public void teardown() {\n RoboGuice.Util.reset();\n }", "@After\n public void tearDown()\n {\n mockDependencies.verifyMocks();\n mockDependencies = null;\n assertNull(\"'mockDependencies' should be null at the end of teardown\", mockDependencies);\n\n parser = null;\n assertNull(\"'parser' should be null at the end of teardown\", parser);\n }", "protected void runAfterTest() {}", "@After\r\n public void after() throws Exception {\r\n }", "@After\n\tpublic void tearDown() throws Exception {\n\t\tMockito.reset(mockMemberDao);\n\t}", "@After\n public void tearDown() {\n GWTMockUtilities.restore();\n }", "@AfterAll\n public static void afterClass() {\n System.out.println(\"After!!! **** - I am only called once!!!\");\n }", "protected void forceMockUpMode(){\n teardown();\n }", "@After\n public void tearDown() {\n \n }", "@Override\r\n\t@After\r\n\tpublic void callTearDown() throws Exception\r\n\t{\r\n\t\tsuper.callTearDown();\r\n\t}", "@AfterMethod\n\tpublic void afterMethod() {\n\t}", "@After\n public void tearDown() {\n try {\n removeKeyPair(ALIAS_IMPORTED);\n removeKeyPair(ALIAS_GENERATED);\n removeKeyPair(ALIAS_1);\n } catch (RemoteException e) {\n // Nothing to do here but warn that clean-up was not successful.\n Log.w(TAG, \"Failed cleaning up installed keys\", e);\n }\n unbindTestSupportService();\n assertThat(mIsSupportServiceBound).isFalse();\n unbindKeyChainService();\n assertThat(mIsKeyChainServiceBound).isFalse();\n }", "@After\n public final void tearDown() throws Exception\n {\n // Empty\n }", "@After\n public void afterTest(){\n }", "@After\n public void tearDown() {\n }", "@After\n public void tearDown() {\n }", "@After\n public void tearDown() {\n }", "@After\n public void tearDown() {\n }", "@After\n public void tearDown() {\n }", "@After\n public void tearDown() {\n }", "@After\r\n\tpublic void doThatEveryTime() {\n\t}", "@After\n public void tearDown () {\n }", "@AfterAll\n public static void tearDownClass() {\n }", "@AfterAll\n public static void tearDownClass() {\n }", "@AfterAll\n public static void tearDownClass() {\n }", "@AfterAll\n public static void tearDownClass() {\n }", "@AfterAll\n public static void tearDownClass() {\n }", "@AfterAll\n public static void tearDownClass() {\n }", "@AfterAll\n public static void tearDownClass() {\n }", "@AfterAll\n public static void tearDownClass() {\n }", "@AfterAll\n public static void tearDownClass() {\n }", "@AfterAll\n public static void tearDownClass() {\n }", "@After\n public void after() {\n System.out.format(\"In After of %s\\n\", ExecutionProcedureJunit2.class.getName());\n }", "@After\r\n public void tearDown()\r\n {\r\n }", "@After\r\n public void tearDown()\r\n {\r\n }", "@After\r\n public void tearDown()\r\n {\r\n }", "@After\r\n public void tearDown()\r\n {\r\n }", "protected abstract void after();", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@Override\n public void afterMethod(BQTestScope scope, ExtensionContext context) {\n this.withinTestMethod = false;\n }", "@AfterTest\n\tpublic void afterTest() {\n\t}", "@After\n public void tearDown() throws Exception {\n }", "@Test\n public void testAfterOffer() {\n pool.beforeOffer(controller1, CommInfrastructure.UEB, TOPIC1, EVENT1);\n\n // this should clear them\n assertFalse(pool.afterOffer(controller1, CommInfrastructure.UEB, TOPIC2, EVENT2, true));\n\n assertFalse(pool.beforeInsert(drools1, OBJECT1));\n verify(mgr1, never()).beforeInsert(any(), any());\n\n\n assertFalse(pool.beforeInsert(droolsDisabled, OBJECT1));\n }", "@After\r\n public void tearDown() throws Exception {\n }", "@After\r\n public void tearDown() throws Exception {\n }", "void afterMethod(Object self, Method method, Method originalMethod, Object[] args) throws Throwable;", "@After\n public void tearDown() throws Exception {\n\n }", "@After\r\n public void tearDown() throws Exception {\r\n PWCallback.resetHandle();\r\n }", "@Override\n\tpublic void afterClassSetup() {\n\t\t\n\t}", "@AfterAll\n static void cleanOperate()\n { \n //clear reference of operate after all the tests done\n operate = null;\n System.out.println(\"only After all the tests....\");\n }", "@AfterClass\n\tpublic void afterClass() {\n\t}", "@AfterMethod\n public void tearDown(){\n }", "protected void runAfterStep() {}", "@After\n public void tearDown() {\n \n }", "protected void assertCallbacksReset()\n {\n int expectedCalls = 0;\n this.assertCallsExpected(expectedCalls);\n }", "@After\n\tpublic void tearDown() {}", "@AfterTest\r\n public void tearDown() {\n }", "@AfterEach\n public void teardown() {\n mockDAO = null;\n addFlight = null;\n flight = null;\n }", "@Override\r\n\tpublic void afterInvocation(IInvokedMethod arg0, ITestResult arg1) {\n\t\t\r\n\t}", "@After\n public void tearDown(){\n }", "@After\n public void tearDown(){\n }", "@Before\n\tpublic void setup() {\n\t\tMockitoAnnotations.initMocks(this);\n\t\n\t}", "@Override\n public void afterEach(ExtensionContext context) throws Exception {\n if (!failedBoot) {\n RestAssuredURLManager.clearURL();\n TestScopeManager.tearDown(true);\n }\n }", "@AfterGroup\n public void afterGroup() {\n }", "@BeforeMethod(alwaysRun = true)\n protected void setUp()\n {\n for (final MetricName metricName : Metrics.defaultRegistry().allMetrics().keySet()) {\n Metrics.defaultRegistry().removeMetric(metricName);\n }\n\n httpHeaders = Mockito.mock(HttpHeaders.class);\n request = Mockito.mock(HttpServletRequest.class);\n filterRequestHandler = Mockito.mock(EventFilterRequestHandler.class);\n deserializerFactory = Mockito.mock(EventDeserializerFactory.class);\n eventDeserializer = new MockEventDeserializer();\n\n Mockito.verifyZeroInteractions(httpHeaders, request, filterRequestHandler, deserializerFactory);\n }", "@AfterMethod()\n\tpublic void afterMethod() {\n\t\textent.endTest(test);\n\t\textent.flush();\n\t}" ]
[ "0.64828575", "0.642888", "0.6331069", "0.63056713", "0.62700546", "0.62675077", "0.62310326", "0.6208566", "0.6191066", "0.6116214", "0.6086109", "0.6082697", "0.60675186", "0.60187316", "0.60009307", "0.5998321", "0.59375715", "0.5889738", "0.58804953", "0.58678865", "0.5866215", "0.5855339", "0.5855339", "0.5855339", "0.5855339", "0.5855339", "0.5853903", "0.58420676", "0.5834784", "0.5834784", "0.5834784", "0.5834784", "0.5834784", "0.5834784", "0.5834784", "0.5834784", "0.5834784", "0.5834784", "0.5833698", "0.58308023", "0.58308023", "0.58308023", "0.58308023", "0.5829842", "0.5821361", "0.5821361", "0.5821361", "0.5821361", "0.5821361", "0.5821361", "0.5821361", "0.5821361", "0.5821361", "0.5821361", "0.5821361", "0.5821361", "0.5821361", "0.5821361", "0.5821361", "0.5821361", "0.5821361", "0.5821361", "0.5821361", "0.5821361", "0.5821361", "0.5821361", "0.5821361", "0.5821361", "0.5821361", "0.5821361", "0.5821361", "0.5821361", "0.5821361", "0.5818732", "0.58136636", "0.58085614", "0.57798815", "0.5747412", "0.5747412", "0.57454103", "0.5743008", "0.5742444", "0.57325983", "0.57303184", "0.5727514", "0.57173085", "0.571151", "0.56910026", "0.56907946", "0.5687469", "0.5670559", "0.56659055", "0.56640506", "0.5660836", "0.5660836", "0.5656419", "0.5639424", "0.560735", "0.5592738", "0.55910754" ]
0.85676396
0
This test method tests handlers "/user" request.
@Test public void shouldReturnUserCabinetViewAndSessionWithExpectedAttributes_whenPassRequest() throws Exception { Principal principal = Mockito.mock(Principal.class); Mockito.when(principal.getName()).thenReturn("login"); List<Order> expectedResult = Collections.singletonList(new Order()); MockHttpSession session = new MockHttpSession(); Mockito.when(userServiceMock.getUsersOrders("login")) .thenReturn(expectedResult); mockMvc.perform(MockMvcRequestBuilders.get("/user").session(session).principal(principal)) .andExpect(MockMvcResultMatchers.view().name("user_cabinet")); Assert.assertNotNull(session.getAttribute("usersOrders")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testUserGET() {\n Response response = webTarget\n .path(\"user/1\")\n .request(APPLICATION_JSON)\n .get();\n User u = response.readEntity(User.class);\n assertThat(response.getStatus(), is(200));\n assertEquals(\"One\", u.getName());\n }", "@Test\n public void testAllUsersGET() {\n HttpAuthenticationFeature feature = \n HttpAuthenticationFeature.basic(\"admin\", \"admin\");\n Client client = ClientBuilder.newClient();\n URI uri = UriBuilder\n .fromUri(APPLICATION_NAME + APPLICATION_API_VERSION)\n .scheme(\"http\")\n .host(\"localhost\")\n .port(8080)\n .build();\n WebTarget webTarget = client\n .register(feature)\n .target(uri)\n .path(\"user\");\n Response response = webTarget\n .request(APPLICATION_JSON)\n .get();\n assertThat(response.getStatus(), is(200));\n }", "@Test\n\tpublic void validateAddedUser() throws Exception {\n\t\tmockMvc.perform(\n\t\t\t\tget(\"/secure/user/{username}\", \"username1\").accept(\n\t\t\t\t\t\tMediaType.APPLICATION_JSON)).andDo(print())\n\t\t\t\t.andExpect(status().isOk())\n\t\t\t\t.andExpect(content().contentType(\"application/json\"))\n\t\t\t\t.andExpect(jsonPath(\"username\").value(\"username1\"));\n\n\t}", "@Test(priority=2)\n\tpublic void ValidateNewUser() {\n\t\t\n\t\tString apiEndPoint = \"https://gorest.co.in/public-api/users/\"+newUserId;\n\t\tSystem.out.println(\"API EndPoint is: \"+apiEndPoint);\n\t\t\t\t\t\t\n\t\tGetUser getuser= given()\n\t\t\t.proxy(\"internet.ford.com\", 83)\n\t\t\t.contentType(\"application/json\")\n\t\t\t.baseUri(apiEndPoint)\t\t\t\n\t\t.when()\n\t\t\t.get(apiEndPoint).as(GetUser.class);\n\t\t\n\t\tAssert.assertEquals(getuser.getCode(),200);\n\t\tAssert.assertEquals(getuser.getData().getName(),\"Stephen M D\");\n\t\tAssert.assertEquals(getuser.getData().getStatus(),\"Active\");\n\t}", "@Test\n public void testGetUserInfoResponse() {\n // TODO: test GetUserInfoResponse\n }", "@Test\n public void testIndexNullUser() {\n User user = null;\n\n IUserService userServiceMock = mock(IUserService.class);\n IAuthService authServiceMock = mock(IAuthService.class);\n when(userServiceMock.isValid(anyString())).thenReturn(true);\n when(userServiceMock.findByToken(anyString())).thenReturn(user);\n Map<String, String> flashData = Collections.emptyMap();\n Map<String, Object> argData = Collections.emptyMap();\n play.api.mvc.RequestHeader header = mock(play.api.mvc.RequestHeader.class);\n Http.Request request = mock(Http.Request.class);\n when(request.getHeader(\"Token\")).thenReturn(\"fake-token\");\n Http.Context context = new Http.Context(2L, header, request, flashData, flashData, argData);\n Http.Context.current.set(context);\n\n Result result = new Login(userServiceMock, authServiceMock).index();\n assertEquals(401, result.status());\n\n verify(userServiceMock).isValid(anyString());\n verify(userServiceMock, times(2)).findByToken(anyString());\n verify(request, times(2)).getHeader(anyString());\n }", "@Test\n public void testIndexSuccess() {\n User user = new User();\n user.setTenant(\"111\");\n user.setPassword(\"pass\");\n user.setToken(\"fake-token\");\n user.setUserid(\"1\");\n user.setUsername(\"fake-user\");\n\n IUserService userServiceMock = mock(IUserService.class);\n IAuthService authServiceMock = mock(IAuthService.class);\n when(userServiceMock.isValid(anyString())).thenReturn(true);\n when(userServiceMock.findByToken(anyString())).thenReturn(user);\n Map<String, String> flashData = Collections.emptyMap();\n Map<String, Object> argData = Collections.emptyMap();\n play.api.mvc.RequestHeader header = mock(play.api.mvc.RequestHeader.class);\n Http.Request request = mock(Http.Request.class);\n when(request.getHeader(\"Token\")).thenReturn(\"fake-token\");\n Http.Context context = new Http.Context(2L, header, request, flashData, flashData, argData);\n Http.Context.current.set(context);\n\n Result result = new Login(userServiceMock, authServiceMock).index();\n assertEquals(200, result.status());\n\n verify(userServiceMock).isValid(anyString());\n verify(userServiceMock, times(2)).findByToken(anyString());\n verify(request, times(2)).getHeader(anyString());\n }", "@Test\n public void testGetUserByUID_Found() throws Exception {\n User user = new User();\n user.setUserUID(123);\n user.setUsername(\"resetme\");\n user.setPasswordTemporary(false);\n\n when(userService.getUserByUID(123)).thenReturn(user);\n\n mockMvc.perform(get(\"/api/users/123\").contentType(MediaType.APPLICATION_JSON)).andExpect(status().isOk());\n\n verify(userService, times(1)).getUserByUID(anyLong());\n }", "@Test\n public void testLoggedInUser() throws IOException {\n Map<String, Object> attr = new HashMap<>();\n String id = \"123\";\n attr.put(\"com.google.appengine.api.users.UserService.user_id_key\", id);\n helper.setEnvEmail(\"test@example.com\")\n .setEnvAttributes(attr)\n .setEnvAuthDomain(\"example.com\")\n .setEnvIsLoggedIn(true)\n .setUp();\n\n ArgumentCaptor<String> captor = ArgumentCaptor.forClass(String.class);\n\n HttpServletRequest request = mock(HttpServletRequest.class);\n HttpServletResponse response = mock(HttpServletResponse.class);\n\n StringWriter stringWriter = new StringWriter();\n PrintWriter writer = new PrintWriter(stringWriter);\n writer.flush();\n when(response.getWriter()).thenReturn(writer);\n\n assertNull(ofy().load().type(UserObject.class).id(id).now());\n\n new LoginRegistrationServlet().doGet(request, response);\n writer.flush();\n\n verify(response, atLeast(1)).sendRedirect(captor.capture());\n assertEquals(\"/home\", captor.getValue());\n\n UserObject result = ofy().load().type(UserObject.class).id(id).now();\n\n assertEquals(result.getId(), id);\n assertEquals(result.getUsername(), \"test\");\n assertEquals(result.getEmail(), \"test@example.com\");\n assertEquals(result.getProfilePicUrl(), \"\");\n }", "@Test\n public void userTest() {\n // TODO: test user\n }", "@Test\n\tpublic void testEditUser() {\n\t\tHttpHeaders headers = new HttpHeaders();\n\t\tHttpEntity<String> entity = new HttpEntity<String>(null, headers);\n\t\tResponseEntity<String> response = restTemplate.exchange(getRootUrl() + \"/edit-user?id=4\",HttpMethod.GET, entity, String.class);\n\t\tassertEquals(200,response.getStatusCodeValue());\n\t}", "@Test\n public void testDoPost_UserNotLoggedIn() throws IOException, ServletException {\n Mockito.when(mockRequest.getRequestURI()).thenReturn(\"/profile/invalid_username\"); \n \n profileServlet.doGet(mockRequest, mockResponse);\n\n // Verify that the error and username attribute was set\n Mockito.verify(mockRequest).setAttribute(\"username\", \"invalid_username\");\n Mockito.verify(mockRequest).setAttribute(\"error\", \"Invalid User\");\n \n Mockito.verify(mockRequestDispatcher).forward(mockRequest, mockResponse);\n }", "@Test\n public void testServerHandler() throws IOException {\n ServerHandler handler = new ServerHandler();\n\n // Add user\n String username = handler.generateUsername();\n User user = new User.UserBuilder()\n .hasUsername(username)\n .build();\n Socket socket = new Socket();\n ClientInfo clientInfo = new ClientInfo(user, socket, handler);\n handler.addUser(clientInfo);\n\n // Add another user\n String username2 = handler.generateUsername();\n User user2 = new User.UserBuilder()\n .hasUsername(username2)\n .build();\n Socket socket2 = new Socket();\n ClientInfo clientInfo2 = new ClientInfo(user2, socket2, handler);\n handler.addUser(clientInfo2);\n\n // Remove second user\n handler.removeUser(handler.getUserClientInfo(username2));\n\n // Get users\n Vector<ClientInfo> users = handler.getUsers();\n\n // Find user\n User foundUser = handler.findByUsername(username);\n\n // User existence\n boolean userExists = handler.usernameExists(foundUser.getUsername());\n\n assertEquals(10, foundUser.getUsername().length());\n assertEquals(true, userExists);\n assertEquals(1, users.size());\n }", "@Test\n\tpublic void testVerifyUser() {\n\t\tLogin login = new Login(\"unique_username_78963321864\", \"unique_password_8946531846\");\n\t\tResponse response = createUser(login);\n\t\t//printResponse(response);\n\t\tassertEquals(Status.OK.getStatusCode(), response.getStatus());\n\t\t\n\t\t//verify the user\n\t\tString resource = \"verify_user\";\n\t\tString requestType = \"POST\";\n\t\tresponse = sendRequest(resource, requestType, Entity.entity(login, MediaType.APPLICATION_JSON));\n\t\tassertEquals(Status.OK.getStatusCode(), response.getStatus());\n\t}", "@Test\n\tpublic void testGetUser() {\n\t\tassertEquals(\"Test : getUser()\", bid.getUser(), user);\n\t}", "Boolean acceptRequest(User user);", "@Test\n public void whenFetchingExistingUserReturn200() throws Exception {\n UserRegistrationRequestDTO request = getSampleRegistrationRequest();\n long userId = api.registerUser(request).execute().body();\n\n // when fetching user details\n Response<UserDTO> response = api.getUserDetails(userId).execute();\n\n // then http status code should be ok\n assertThat(response.code(), is(200));\n\n // and user should have a matching name\n assertThat(response.body().fullName, is(request.fullName));\n }", "@Test\n\tpublic void testShowAllUsers() {\n\t\tHttpHeaders headers = new HttpHeaders();\n\t\tHttpEntity<String> entity = new HttpEntity<String>(null, headers);\n\t\tResponseEntity<String> response = restTemplate.exchange(getRootUrl() + \"/show-users\",HttpMethod.GET, entity, String.class);\n\t\tassertEquals(200, response.getStatusCodeValue());\n\t}", "@Test\n\tpublic void testGetUser() {\n\t\tresetTestVars();\n\t\tuser1.setID(\"1\");\n\t\tuser2.setID(\"2\");\n\t\tuser3.setID(\"3\");\n\t\t\n\t\tassertNull(\"No users in network\", sn.getUser(\"1\"));\n\t\tsn.addUser(user1);\n\t\tassertEquals(\"Only user in network\", user1, sn.getUser(\"1\"));\n\t\tsn.addUser(user2);\n\t\tsn.addUser(user3);\n\t\tassertEquals(\"1/3 in list\", user1, sn.getUser(\"1\"));\n\t\tassertEquals(\"2/3 in list\", user2, sn.getUser(\"2\"));\n\t\tassertEquals(\"3/3 in list\", user3, sn.getUser(\"3\"));\n\t\tassertNull(\"Isnt a valid user ID\", sn.getUser(\"4\"));\n\t}", "@Override\n public boolean preHandle(HttpServletRequest request, HttpServletResponse response,\n Object handler) throws Exception {\n String testUser = request.getParameter(\"testUser\");\n if (testUser == null || testUser.isEmpty()\n || testUser.equalsIgnoreCase(\"undefined\")) {\n testUser = \"default\";\n }\n Map<String, String> userAttrs = m_userAttributes.get(testUser);\n String user = userAttrs.get(\"username\");\n String group = userAttrs.get(\"usergroup\");\n WebUtils.setSessionAttribute(request, \"currentuser\", user);\n WebUtils.setSessionAttribute(request, \"currentgroup\", group);\n return true;\n }", "@Test\n public void testCreateSucess() {\n User user = new User();\n user.setTenant(\"111\");\n user.setPassword(\"pass\");\n user.setToken(\"fake-token\");\n user.setUserid(\"1\");\n user.setUsername(\"fake-user\");\n\n IUserService userServiceMock = mock(IUserService.class);\n IAuthService authServiceMock = mock(IAuthService.class);\n try {\n when(authServiceMock.getUser(anyString(), anyString())).thenReturn(user);\n }catch(UnauthorizedException | InternalServerException e){\n fail(e.getLocalizedMessage());\n }\n\n Map<String, String> flashData = Collections.emptyMap();\n Map<String, Object> argData = Collections.emptyMap();\n play.api.mvc.RequestHeader header = mock(play.api.mvc.RequestHeader.class);\n Http.RequestBody requestBody = mock(Http.RequestBody.class);\n when(requestBody.asFormUrlEncoded()).thenReturn(new HashMap<String, String[]>(){{\n put(\"username\", new String[] {\"goodusername\" });\n put(\"password\", new String[] {\"goodpassword\" });\n } });\n Http.Request request = mock(Http.Request.class);\n when(request.body()).thenReturn(requestBody);\n Http.Context context = new Http.Context(2L, header, request, flashData, flashData, argData);\n Http.Context.current.set(context);\n\n Result result = new Login(userServiceMock, authServiceMock).create();\n assertEquals(200, result.status());\n assertEquals(\"application/json\", result.contentType());\n assertTrue(contentAsString(result).\n equals(\"{\\\"id\\\":null,\" +\n \"\\\"username\\\":\\\"fake-user\\\",\" +\n \"\\\"token\\\":\\\"fake-token\\\",\" +\n \"\\\"tenant\\\":\\\"111\\\",\" +\n \"\\\"userid\\\":\\\"1\\\",\" +\n \"\\\"expireDate\\\":null}\"));\n\n try{\n verify(authServiceMock).getUser(anyString(), anyString());\n }catch(UnauthorizedException | InternalServerException e){\n fail(e.getLocalizedMessage());\n }\n }", "@Test\n public void testBasicAuthUserSuccess() {\n HttpAuthenticationFeature feature = \n HttpAuthenticationFeature.basic(\"admin\", \"admin\");\n Client client = ClientBuilder.newClient();\n URI uri = UriBuilder\n .fromUri(APPLICATION_NAME + APPLICATION_API_VERSION)\n .scheme(\"http\")\n .host(\"localhost\")\n .port(8080)\n .build();\n WebTarget webTarget = client\n .register(feature)\n .target(uri)\n .path(\"user\");\n Response response = webTarget\n .request(APPLICATION_JSON)\n .get();\n assertThat(response.getStatus(), is(200));\n }", "@Test\n\tpublic void get_usersByIdtest(){\n\t\t\n\t}", "@Test\n public void testUserNotifiedOnRegistrationSubmission() throws Exception {\n ResponseEntity<String> response = registerUser(username, password);\n assertNotNull(userService.getUser(username));\n assertEquals(successUrl, response.getHeaders().get(\"Location\").get(0));\n }", "@Test\n void testGetByIdUser() {\n User getUser = (User) userData.crud.getById(1);\n assertEquals(\"Kevin\", getUser.getFirstName());\n logger.info(\"Got user information for ID: \" + getUser.getId());\n }", "@Override\n\tprotected String url() {\n\t\treturn \"user\";\n\t}", "@GetMapping(\"/user\")\n public String user(){\n\n return \"User .. \";\n }", "@Test\n public void fromUserIdTest() {\n // TODO: test fromUserId\n }", "@Test\n public void registerUsernameEmpty() throws Exception {\n user.setUsername(null);\n // when:\n MockHttpServletResponse response\n = this.mockMvc.perform(post(\"/user\")\n .contentType(MediaType.APPLICATION_JSON)\n .content(jacksonTester.write(user).getJson()))\n .andReturn().getResponse();\n\n // then:\n assertThat(response.getStatus()).as(\"Checking HTTP status\")\n .isEqualTo(HttpStatus.BAD_REQUEST.value());\n\n // checking links:\n JSONObject responseJson = new JSONObject(response.getContentAsString());\n Assert.assertTrue(\"Checking _links is there\", responseJson.has(\"_links\"));\n JSONObject linksJson = responseJson.getJSONObject(\"_links\");\n Assert.assertTrue(\"Checking home is there\", linksJson.has(\"home\"));\n }", "@RequestMapping(\"/test\")\n public void test(){\n User user = (User) SecurityUtils.getCurrentUser();\n System.out.println(\"user>>>\"+user.getId());\n }", "@Test\n public void testRegisteredUser() throws IOException {\n Map<String, Object> attr = new HashMap<>();\n String id = \"123\";\n attr.put(\"com.google.appengine.api.users.UserService.user_id_key\", id);\n helper.setEnvEmail(\"test@example.com\")\n .setEnvAttributes(attr)\n .setEnvAuthDomain(\"example.com\")\n .setEnvIsLoggedIn(true)\n .setUp();\n\n ArgumentCaptor<String> captor = ArgumentCaptor.forClass(String.class);\n\n HttpServletRequest request = mock(HttpServletRequest.class);\n HttpServletResponse response = mock(HttpServletResponse.class);\n\n StringWriter stringWriter = new StringWriter();\n PrintWriter writer = new PrintWriter(stringWriter);\n writer.flush();\n when(response.getWriter()).thenReturn(writer);\n\n assertNull(ofy().load().type(UserObject.class).id(id).now());\n\n new LoginRegistrationServlet().doGet(request, response);\n writer.flush();\n\n verify(response, atLeast(1)).sendRedirect(captor.capture());\n assertEquals(\"/home\", captor.getValue());\n\n // Duplicate request shouldn't change the result\n new LoginRegistrationServlet().doGet(request, response);\n writer.flush();\n\n verify(response, atLeast(1)).sendRedirect(captor.capture());\n assertEquals(\"/home\", captor.getValue());\n\n UserObject result = ofy().load().type(UserObject.class).id(id).now();\n\n assertEquals(result.getId(), id);\n assertEquals(result.getUsername(), \"test\");\n assertEquals(result.getEmail(), \"test@example.com\");\n assertEquals(result.getProfilePicUrl(), \"\");\n }", "@Test\n public void testUserDelete() {\n Response response = webTarget\n .path(\"user/1\")\n .request(APPLICATION_JSON)\n .delete();\n assertThat(response.getStatus(), anyOf(is(200), is(202), is(204)));\n }", "@Test public void givenUserByUsername_thenReturnJsonArray() throws Exception {\n User mockUser = new User(\"joe\", \"1234\", \"admin\");\n\n // studentService.addCourse to respond back with mockCourse\n Mockito.when(userService.getUserByUsername(Mockito.anyString())).thenReturn(new FetchUserResult(mockUser));\n\n String exampleUserJson = \"{\\\"username\\\":\\\"joe\\\",\\\"password\\\":\\\"1234\\\"}\";\n\n // Send user as body to\n RequestBuilder requestBuilder = MockMvcRequestBuilders\n .get(\"/admin/user/joe\");\n\n MvcResult result = mvc.perform(requestBuilder).andReturn();\n\n MockHttpServletResponse response = result.getResponse();\n\n assertEquals(HttpStatus.OK.value(), response.getStatus());\n }", "@Test\n public void registerUsernameTaken() throws Exception {\n user.setUsername(\"sabina\");\n // when:\n MockHttpServletResponse response\n = this.mockMvc.perform(post(\"/user\")\n .contentType(MediaType.APPLICATION_JSON)\n .content(jacksonTester.write(user).getJson()))\n .andReturn().getResponse();\n\n // then:\n assertThat(response.getStatus()).as(\"Checking HTTP status\")\n .isEqualTo(HttpStatus.CONFLICT.value());\n\n // checking links:\n JSONObject responseJson = new JSONObject(response.getContentAsString());\n Assert.assertTrue(\"Checking _links is there\", responseJson.has(\"_links\"));\n JSONObject linksJson = responseJson.getJSONObject(\"_links\");\n Assert.assertTrue(\"Checking home is there\", linksJson.has(\"home\"));\n }", "@Test\n\tpublic void testUserServiceUsername() {\n\t\twhen(uDAO.selectByName(anyString())).thenReturn(testEmployee);\n\t\t\n\t\tassertEquals(new UserService(uDAO).getByUsername(\"user1\"), testEmployee);\n\t}", "@Test\n public void getUserByIdCatch() {\n userDAO.createUser(new User(\"dummy\", \"dummy\", 1));\n\n //test fetching of data\n assertNull(userResource.getUser(\"notdummy\"));\n\n //clean up\n userDAO.removeUser(\"dummy\");\n }", "@Test\n\t@WithMockUser(username = \"testuser\", password = \"testpass\", authorities = \"ROLE_USER\")\n\tpublic void getCurrentUserTest2() throws Exception {\n\t\tmockMvc.perform(get(\"/api/auth/currentUser\")).andDo(print()).andExpect(status().is(200)).andExpect(content().string(containsString(\"testuser\")));\n\t}", "@Test\n @PactVerification(fragment=\"pactGetAllUsers\")\n public void runTest() {\n RestAssured\n .given()\n .port(randomPort.getPort())\n .contentType(ContentType.JSON)\n .get(\"/users\")\n .then()\n .statusCode(200)\n .assertThat()\n .body(\"userId\", Matchers.equalTo(100))\n .and()\n .body(\"name\", Matchers.equalTo(\"pramik\"))\n .and()\n .body(\"address\", Matchers.isA(String.class));\n \n }", "@Test\n public void registerUsernameTooShort() throws Exception {\n user.setUsername(\"1234\");\n // when:\n MockHttpServletResponse response\n = this.mockMvc.perform(post(\"/user\")\n .contentType(MediaType.APPLICATION_JSON)\n .content(jacksonTester.write(user).getJson()))\n .andReturn().getResponse();\n\n // then:\n assertThat(response.getStatus()).as(\"Checking HTTP status\")\n .isEqualTo(HttpStatus.BAD_REQUEST.value());\n\n // checking links:\n JSONObject responseJson = new JSONObject(response.getContentAsString());\n Assert.assertTrue(\"Checking _links is there\", responseJson.has(\"_links\"));\n JSONObject linksJson = responseJson.getJSONObject(\"_links\");\n Assert.assertTrue(\"Checking home is there\", linksJson.has(\"home\"));\n }", "@Test\n public void useridTest() {\n // TODO: test userid\n }", "@Test\r\n void testUserImplementation() {\r\n bindUser();\r\n testService.userImplementation();\r\n }", "@Test\n public void testJdoeAccess() throws IOException {\n HttpResponse response = makeRequest(\"http://localhost:8080/api/jdoe\", \"jdoe\", \"jdoe\");\n assertAccessGranted(response, \"jdoe\");\n\n // jdoe can access information about alice because he is granted with \"people-manager\" role\n response = makeRequest(\"http://localhost:8080/api/alice\", \"jdoe\", \"jdoe\");\n assertAccessGranted(response, \"alice\");\n }", "@Test\n public void testUserCanBeRegistered() {\n assert username.length() > 3 && username.length() < 16;\n registerUser(username, password);\n assertNotNull(userService.getUser(username));\n }", "@Test\n public void fetchUser() {\n openActionBarOverflowOrOptionsMenu(getInstrumentation().getTargetContext());\n\n //Click search\n onView(withText(R.string.fetch_user))\n .perform(click());\n\n }", "@Test\n public final void testUserAPICreateUserAPI() {\n UserAPI result = new UserAPI();\n assertNotNull(result);\n // add additional test code here\n }", "@Test\n public void userIdTest() {\n // TODO: test userId\n }", "@Test\n public void userIdTest() {\n // TODO: test userId\n }", "@Test\n public void iTestDeleteUser() {\n given()\n .header(\"X-Authorization\", token)\n .delete(\"/users\")\n .then()\n .statusCode(200);\n }", "@Test\n public void testAccessUserSearch() {\n try {\n driver.findElement(By.id(\"nav-users\")).click();\n wait(3);\n assertEquals(\"http://stackoverflow.com/users\", driver.getCurrentUrl());\n }\n catch(NoSuchElementException nsee) {\n fail();\n }\n }", "@Test\r\n public void testGetUserHistory() {\r\n }", "@Test\n public void getUserTest() throws Exception{\n Context appContext = InstrumentationRegistry.getTargetContext();\n String userStr= AssetsUtils.ReadAssetTxtContent(appContext, Constants.ASSET_USER_INFO_PATH);\n\n OkHttpClient client=new OkHttpClient();\n Request request = new Request.Builder().url(Constants.USER_INFO_URL).build();\n String userRequestStr=\"\";\n try(Response response=client.newCall(request).execute()){\n userRequestStr=response.body().string();\n }\n assertEquals(userStr,userRequestStr);\n }", "@Test\n public void testGetUser() {\n System.out.println(\"getUser\");\n ModelController instance = new ModelController();\n User expResult = null;\n User result = instance.getUser();\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 }", "@Test\n public void getUserById() {\n userDAO.createUser(new User(\"dummy\", \"dummy\", 1));\n\n //test fetching of data\n assertNotNull(userResource.getUser(\"dummy\"));\n\n //clean up\n userDAO.removeUser(\"dummy\");\n }", "@Test\n public void editUserWrongPath() throws Exception {\n // when:\n MockHttpServletResponse response\n = this.mockMvc.perform(put(\"/johndoe2/user\")\n .header(\"Authorization\",\n LoginHelper.getToken(this, mockMvc, jacksonLoginTester,\n \"johndoe\", \"12345678\"))\n .contentType(MediaType.APPLICATION_JSON)\n .content(jacksonTester.write(user).getJson()))\n .andReturn().getResponse();\n\n // then:\n assertThat(response.getStatus()).as(\"Checking HTTP status\")\n .isEqualTo(HttpStatus.FORBIDDEN.value());\n assertThat(response.getContentAsString()).contains(\"You cannot edit someone else's profile\");\n }", "@Test\n public void whenAdminRemoveUserShouldCheckThatUserWasRemoved() throws ServletException, IOException {\n Create createUser = new Create();\n HttpServletRequest request = mock(HttpServletRequest.class);\n HttpServletResponse response = mock(HttpServletResponse.class);\n when(request.getParameter(\"name\")).thenReturn(\"Yegor\");\n when(request.getParameter(\"surname\")).thenReturn(\"Voronyansky\");\n when(request.getParameter(\"email\")).thenReturn(\"vrnsky@vrnsky.com\");\n when(request.getParameter(\"role\")).thenReturn(\"2\");\n createUser.doPost(request, response);\n\n Remove removeUser = new Remove();\n List<User> users = ExtendedRepo.getInstance().getAllUsers();\n User user = users.get(users.size() - 1);\n when(request.getParameter(\"id\")).thenReturn(String.valueOf(user.getId()));\n removeUser.doPost(request, response);\n\n User removed = ExtendedRepo.getInstance().getUserById(user.getId());\n assertEquals(null, removed);\n }", "@Test\n\tpublic void createUserwithPOSTTest() {\n\t\tRestAssured.baseURI = \"https://gorest.co.in\";\n\t\tRequestSpecification request = RestAssured.given().log().all();\n\t request.header(\"Authorization\", \"Bearer 4242b4a465097df28229861ee3a53a1ab3e674935bb89e135543e470750c4e3b\");\n\t request.contentType(\"application/json\");\n\t File file = new File(\"/Users/testersinem/Documents/workspace/API/src/test/java/com/api/test/createuser.json\");\n\t request.body(file);\n\t Response response = request.post(\"/public-api/users\");\n\t System.out.println(response.prettyPrint());\n\t}", "@WithMockUser(username = \"guest\", authorities = {\"GUEST\"})\n @Test\n @DisplayName(\"Allowed get books requests for GUEST role \")\n void getBooksByGuest() throws Exception {\n mockMvc.perform(get(\"/books\").with(csrf())).andExpect(status().isOk());\n }", "@Test\n\tpublic void test_get_by_id_success(){\n\t\tResponseEntity<User> response = template.getForEntity(\n\t\t\t\tREST_SERVICE_URI + \"/20\" + ACCESS_TOKEN + token, User.class);\n\t\tUser user = response.getBody();\n\t\tassertThat(user.getEmail(), is(\"fengt@itiaoling.com\"));\n\t\tassertThat(response.getStatusCode(), is(HttpStatus.OK));\n\t\tvalidateCORSHttpHeaders(response.getHeaders());\n\t}", "@Test\n public void testAliceAccess() throws IOException {\n HttpResponse response = makeRequest(\"http://localhost:8080/api/alice\", \"alice\", \"alice\");\n assertAccessGranted(response, \"alice\");\n\n // alice can not access information about jdoe\n response = makeRequest(\"http://localhost:8080/api/jdoe\", \"alice\", \"alice\");\n assertEquals(403, response.getStatusLine().getStatusCode());\n }", "public UsuarioRest obtenerUsuarioRest(String user);", "@Test(expected = NullPointerException.class)\n public void testRegisterWithNullUser() throws RequestHandlerException {\n registerVM.register(null);\n }", "@Test\n public void testValidNewUser() throws Exception {\n when(request.getParameter(\"username\")).thenReturn(\"testUser\");\n when(request.getParameter(\"radius\")).thenReturn(\"10000\");\n when(request.getParameter(\"searchQuery\")).thenReturn(\"milk tea\");\n when(request.getParameter(\"numResults\")).thenReturn(\"7\");\n \n new AddSearchHistoryServlet().service(request, response);\n \n ArrayList<SearchItem> si = db.getSearchItemfromSearch(userID);\n int searchID = si.get(0).searchID;\n \n assertEquals(si.get(0).searchQuery, \"milk tea\");\n assertEquals(si.get(0).numResults, 7); \n assertEquals(si.get(0).radius, 10000);\n \n db.deleteQueryfromSearchHistory(searchID);\n \n }", "@Test\n public void fetchUserProfileSync_userIdPassedToEndpoint_returnSuccess(){\n SUT.fetchUserProfileSync(USER_ID);\n assertThat(userProfileHttpEndpointSyncTd.mUserId, is(USER_ID));\n }", "@Test\n public void testBasicAuthUserFail() {\n HttpAuthenticationFeature feature = \n HttpAuthenticationFeature.basic(\"NOTadmin\", \"admin\");\n Client client = ClientBuilder.newClient();\n URI uri = UriBuilder\n .fromUri(APPLICATION_NAME + APPLICATION_API_VERSION)\n .scheme(\"http\")\n .host(\"localhost\")\n .port(8080)\n .build();\n WebTarget webTarget = client\n .register(feature)\n .target(uri)\n .path(\"user\");\n Response response = webTarget\n .request(APPLICATION_JSON)\n .get();\n assertThat(response.getStatus(), is(401));\n }", "@Test\n public void testReadUser() throws InvalidUserException {\n //Arrange\n User user = new User();\n user.setEmail(\"user@email.com\");\n user.setFirstName(\"first\");\n user.setLastName(\"last\");\n user.setPassword(\"pass\");\n user.setRole(\"admin\");\n User createdUser = userService.createUser(user);\n \n\n //Act\n User fetchedUser = userService.readUser(createdUser.getUserId());\n \n //Assert\n assertEquals(fetchedUser.getUserId(), createdUser.getUserId());\n assertEquals(fetchedUser.getEmail(), \"user@email.com\");\n assertEquals(fetchedUser.getFirstName(), \"first\"); \n \n }", "@Test(groups=\"authentication\")\n public void anonymousPost() throws Exception {\n String json =\n given().\n headers(\"X-OpenIDM-Username\", \"anonymous\",\"X-OpenIDM-Password\", \"anonymous\",\"Content-Type\", \"application/json\").\n request().\n body(\"{\\\"userName\\\":\\\"djoe\\\", \\\"givenName\\\":\\\"Joe\\\",\\\"familyName\\\":\\\"Doe\\\", \\\"email\\\":\\\"joe@forgerock.com\\\",\\\"password\\\":\\\"ldap12345\\\"}\").\n expect().\n statusCode(201).\n when().\n post(\"/openidm/managed/user?_action=create\").asString();\n JsonPath jp = new JsonPath(json);\n String userID = jp.get(\"_id\");\n if(userID == null) {\n throw new IllegalArgumentException(\"Test Failed(AnonyPost): No result was returned\");\n }\n // we clean the repo after the test\n given().\n headers(\"X-OpenIDM-Username\", \"openidm-admin\", \"X-OpenIDM-Password\", \"openidm-admin\", \"If-Match\", \"*\").\n pathParam(\"id\", userID).\n expect().\n statusCode(204).\n when().\n delete(\"/openidm/managed/user/{id}\");\n }", "@Test\r\n void testAuthenticatedImplementation() {\r\n bindAuthenticatedUser();\r\n testService.authenticatedImplementation();\r\n }", "@Test\n public void testRegisterUser() throws AuthenticationException, IllegalAccessException {\n facade.registerUser(\"fiske\", \"JuiceIsLoose123/\");\n assertEquals(\"fiske\", facade.getVeryfiedUser(\"fiske\", \"JuiceIsLoose123/\").getUserName(), \"Expects user exist after register\");\n }", "@Test\n\tpublic void test_update_user_success(){\n\t\tUser user = new User(null, \"fengt\", \"fengt2@itiaoling.com\", \"12345678\");\n\t\ttemplate.put(REST_SERVICE_URI + \"/20\" + ACCESS_TOKEN + token, user);\n\t}", "@Test\n public void userNameTest() {\n // TODO: test userName\n }", "@Test\n\tpublic void testLoginUser(){\n\t\t\n\t\tboolean passed = true;\n\t\t\n\t\ttry {\n\t\t\tps.loginUser(new UserLoginInput(\"Sam\", \"sam\"));\n\t\t} catch (ServerException e) {\n\t\t\te.printStackTrace();\n\t\t\tpassed = false;\n\t\t}\n\t\t\n\t\tassertTrue(passed);\n\t}", "@Test\n @Transactional\n public void testUrlsRequireAuthentication() throws Exception {\n final View view = viewTestTools.createView(\"TestView\");\n\n // View \"stream\" page.\n testUrlRequiresAuthentication(\"/stream/\" + view.getId(), false);\n }", "@Test\n\tpublic void testAuthenticateUserOK() {\n\t\tgiven(userRepository.findByLogin(anyString())).willReturn(new UserBuilder(USER_RETURNED).build());\n\n\t\t// make the service call\n\t\ttry {\n\t\t\tassertThat(authService.authenticateUser(USER)).isEqualTo(USER_RETURNED);\n\t\t} catch (Exception e) {\n\t\t\tfail(\"Error testing authenticateUser: \" + e.getMessage());\n\t\t}\t\n\t}", "@Override\r\n\tpublic void visit(User user) {\n\t\t\r\n\t}", "@Test\n public void testGetUserByUID_NotFound() throws Exception {\n when(userService.getUserByUID(anyLong())).thenThrow(EmptyResultDataAccessException.class);\n\n mockMvc.perform(get(\"/api/users/123\")).andExpect(status().isNotFound());\n\n verify(userService, times(1)).getUserByUID(anyLong());\n }", "@Test\n\tpublic void testGetCurrentUserId() {\n\t\tAssert.assertNotNull(rmitAnalyticsModel.getCurrentUserId(getRequest()));\n\t}", "@Test\n\tpublic void testdeleteUser() {\n\t\tHttpHeaders headers = new HttpHeaders();\n\t\tHttpEntity<String> entity = new HttpEntity<String>(null, headers);\n\t\tResponseEntity<String> response = restTemplate.exchange(getRootUrl() + \"/delete-user?id=4\",HttpMethod.GET, entity, String.class);\n\t\tassertEquals(200,response.getStatusCodeValue());\n\t}", "@Test\r\n public void testGetName() {\r\n user = userFactory.getUser(\"C\");\r\n assertEquals(\"customer\", user.getName());\r\n }", "@Test\n public void testFindUserByFilter() {\n System.out.println(\"findUserByFilter\");\n String filter = \"adrian\";\n UserServiceImpl instance = new UserServiceImpl(passwordService);\n List<User> result = instance.findUserByFilter(filter);\n assertEquals(1, result.size());\n assertEquals(\"adrian\", result.get(0).getUsername());\n }", "boolean userExists(HttpServletRequest request, String userId);", "@Test\r\n void getAllUsers() throws IOException {\r\n }", "@Test\n\tpublic void testSaveUser() {\n\t\tfinal User user = new User();\n\t\tuser.setUserid(15);\n\t\tResponseEntity<String> responseEntity = this.restTemplate.postForEntity(getRootUrl() + \"/save-user?userid=15\", user , String.class);\n\t\tassertEquals(200,responseEntity.getStatusCodeValue());\n\t}", "@Test\n public void testUpdateUser_NoAction() throws Exception {\n when(userService.getUserByUID(anyLong())).thenThrow(IncorrectResultSizeDataAccessException.class);\n\n mockMvc.perform(put(\"/api/users/123\")).andExpect(status().isBadRequest());\n\n verify(userService, times(0)).getUserByUID(anyLong());\n }", "@Test\n public void testGetAllUsers() {\n }", "@Test\n\tpublic void testGetAllUsers() throws Exception {\n\t\tmockMvc.perform(MockMvcRequestBuilders.get(\"/users\")\n\t\t\t\t.accept(APPLICATION_JSON)).andExpect(status().isOk())\n\t\t.andExpect(content().contentType(contentType));\n\t\t// Verifies If userService.getAllUsers() is invoked at least once\n\t\tMockito.verify(userService).getAllUsers();\n\t}", "ResponseEntity<Response> userById(String userId);", "@Test\n public void testSysUser() {\n\n SysUser user = sysUserService.findByUsername(\"admin\");\n System.out.println(\"user: \" + user);\n }", "@Test\r\n public void login() throws ServletException, IOException {\r\n\r\n }", "@Test\n\tpublic void testUpdateUserWithoutUserid() {\n\t\tUser testUser = new User();\n\t\ttestUser.setUserEmail(TEST_EMAIL);\n\t\ttestUser.setUserPassword(TEST_PASSWORD);\n\t\t\n\t\tgiven().body(testUser).contentType(ContentType.JSON).when()\n\t\t\t\t.put(getBaseTestURI()).then()\n\t\t\t\t.statusCode(HttpServletResponse.SC_BAD_REQUEST);\n\t}", "@Test\n public void testFollowUser(TestContext tc) {\n\n Async async = tc.async();\n\n webClient.post(8080, \"localhost\", \"/api/profiles/Jacob/follow\")\n .putHeader(HttpProps.CONTENT_TYPE, HttpProps.JSON)\n .putHeader(HttpProps.XREQUESTEDWITH, HttpProps.XMLHTTPREQUEST)\n .putHeader(HttpProps.AUTHORIZATION, TestProps.TOKEN_USER1)\n .send(ar -> {\n\n if (ar.failed()) {\n async.complete();\n tc.fail(ar.cause());\n }else{\n tc.assertEquals(200, ar.result().statusCode());\n JsonObject returnedJson = ar.result().bodyAsJsonObject();\n tc.assertNotNull(returnedJson);\n JsonObject returnedUser = returnedJson.getJsonObject(\"profile\");\n verifyProfile(returnedUser);\n async.complete();\n }\n });\n }", "@Test\n void loginUser_validInput_userLoggedIn() throws Exception{\n // given\n User user = new User();\n user.setId(1L);\n user.setPassword(\"TestPassword\");\n user.setUsername(\"testUsername\");\n user.setToken(\"1\");\n user.setStatus(UserStatus.OFFLINE);\n\n given(loginService.checkLoginCredentials(Mockito.any())).willReturn(user);\n\n UserPostDTO userPostDTO = new UserPostDTO();\n userPostDTO.setPassword(\"TestPassword\");\n userPostDTO.setUsername(\"testUsername\");\n\n MockHttpServletRequestBuilder putRequest = put(\"/users\")\n .contentType(MediaType.APPLICATION_JSON)\n .content(asJsonString(userPostDTO));\n\n mockMvc.perform(putRequest).andExpect(status().isOk())\n .andExpect(jsonPath(\"$.token\", is(user.getToken())));\n\n }", "@Test\n public void testAuthorizedRemoveUser() throws IOException {\n testUserId2 = createTestUser();\n grantUserManagementRights(testUserId2);\n\n String userId = createTestUser();\n\n Credentials creds = new UsernamePasswordCredentials(testUserId2, \"testPwd\");\n\n String getUrl = String.format(\"%s/system/userManager/user/%s.json\", baseServerUri, userId);\n assertAuthenticatedHttpStatus(creds, getUrl, HttpServletResponse.SC_OK, null); //make sure the profile request returns some data\n\n String postUrl = String.format(\"%s/system/userManager/user/%s.delete.html\", baseServerUri, userId);\n List<NameValuePair> postParams = new ArrayList<>();\n assertAuthenticatedPostStatus(creds, postUrl, HttpServletResponse.SC_OK, postParams, null);\n\n assertAuthenticatedHttpStatus(creds, getUrl, HttpServletResponse.SC_NOT_FOUND, null); //make sure the profile request returns some data\n }", "@Test\n\tvoid validLoginTest() throws Exception {\n\t\tUser userObj = new User();\n\t\tuserObj.setUsername(\"sivass\");\n\t\tuserObj.setPassword(\"Siva123@\");\n\n\t\tUserInfo userInfo = new UserInfo();\n\t\tuserInfo.setRole(\"C\");\n\t\tuserInfo.setUserId(10);\n\t\tString userJson = new ObjectMapper().writeValueAsString(userObj);\n\t\twhen(userService.loginValidation(any(String.class), any(String.class))).thenReturn(userInfo);\n\t\tmockMvc.perform(post(\"/vegapp/v1/users/login\").contentType(MediaType.APPLICATION_JSON).content(userJson))\n\t\t\t\t.andExpect(status().isOk()).andExpect(jsonPath(\"$.role\").value(\"C\"))\n\t\t\t\t.andExpect(jsonPath(\"$.userId\").value(10));\n\t}", "@Test\n\tpublic void addUser() throws Exception {\n\t\tmockMvc.perform(\n\t\t\t\tpost(\"/secure/user/addUser\").param(\"username\", \"username1\")\n\t\t\t\t\t\t.param(\"firstName\", \"firstName1\")\n\t\t\t\t\t\t.param(\"lastName\", \"lastName1\")\n\t\t\t\t\t\t.param(\"emailAddress\", \"username1@somedomain.com\")\n\t\t\t\t\t\t.param(\"password\", \"abcd1234\")\n\n\t\t\t\t\t\t.accept(MediaType.APPLICATION_JSON)).andDo(print())\n\t\t\t\t.andExpect(status().isOk())\n\t\t\t\t.andExpect(content().contentType(\"application/json\"))\n\t\t\t\t.andExpect(jsonPath(\"message\").value(\"Success\"));\n\n\t}", "@Test\n void createUser_validInput_userCreated() throws Exception {\n // given\n User user = new User();\n user.setId(1L);\n user.setPassword(\"Test User\");\n user.setUsername(\"testUsername\");\n user.setToken(\"1\");\n user.setStatus(UserStatus.ONLINE);\n\n UserPostDTO userPostDTO = new UserPostDTO();\n userPostDTO.setPassword(\"Test User\");\n userPostDTO.setUsername(\"testUsername\");\n\n given(loginService.createUser(Mockito.any())).willReturn(user);\n\n // when/then -> do the request + validate the result\n MockHttpServletRequestBuilder postRequest = post(\"/users\")\n .contentType(MediaType.APPLICATION_JSON)\n .content(asJsonString(userPostDTO));\n\n // then\n mockMvc.perform(postRequest)\n .andExpect(status().isCreated())\n .andExpect(jsonPath(\"$.token\", is(user.getToken())));\n }", "@RequestMapping(\"/getUser\")\n public Users getUser(String userId){\n return null;\n }", "@Override\n\tprotected Object handleUserinfoEndpointRequest(String requestId) {\n\t\tif(!receivedRefreshRequest) {\n\t\t\t//we don't want the test to be marked as completed if the client sends a userinfo\n\t\t\t//request before sending a refresh request\n\t\t\t//this is not the userinfo request we are looking for\n\t\t\treceivedUserinfoRequest = false;\n\t\t}\n\t\treturn super.handleUserinfoEndpointRequest(requestId);\n\t}", "protected void switchToUser( ApplicationContext ctx, String username ) {\n\n UserDetails user = userManager.loadUserByUsername( username );\n\n List<GrantedAuthority> authrs = new ArrayList<GrantedAuthority>( user.getAuthorities() );\n\n ProviderManager providerManager = ( ProviderManager ) ctx.getBean( \"authenticationManager\" );\n providerManager.getProviders().add( new TestingAuthenticationProvider() );\n\n TestingAuthenticationToken token = new TestingAuthenticationToken( username, \"testing\", authrs );\n token.setAuthenticated( true );\n\n putTokenInContext( token );\n }", "@Test\n public void bodyContainsCurrentUserUrl() {\n ResponseEntity<User> response = restTemplate.getForEntity(BASE_URL + \"/users/YanCanCode\", User.class);\n\n // Assert\n assertEquals(\"YanCanCode\", response.getBody().getLogin());\n }", "@Test\n public void testFindByUsername() {\n\n }", "@Test\n void logoutUser_validInput_userLoggedOut() throws Exception{\n // given\n User user = new User();\n user.setId(1L);\n user.setPassword(\"TestPassword\");\n user.setUsername(\"testUsername\");\n user.setToken(\"1\");\n user.setStatus(UserStatus.OFFLINE);\n\n UserPutDTO userPutDTO = new UserPutDTO();\n userPutDTO.setToken(\"1\");\n\n MockHttpServletRequestBuilder putRequest = put(\"/users/\" + user.getId() + \"/logout\")\n .contentType(MediaType.APPLICATION_JSON)\n .content(asJsonString(userPutDTO));\n\n mockMvc.perform(putRequest).andExpect(status().isNoContent());\n }" ]
[ "0.71154547", "0.653672", "0.6407161", "0.63826656", "0.6275169", "0.6249384", "0.6247209", "0.6239902", "0.6222667", "0.61937886", "0.61370975", "0.61087185", "0.6095973", "0.6086835", "0.6078742", "0.6069024", "0.6066614", "0.6046621", "0.6027208", "0.5981016", "0.5967692", "0.5961402", "0.5947256", "0.5890039", "0.5874583", "0.5866765", "0.5858114", "0.5853339", "0.58314914", "0.5826099", "0.5821863", "0.5802991", "0.580223", "0.5783686", "0.57819015", "0.5773344", "0.57665986", "0.5761741", "0.5760322", "0.5748228", "0.5740717", "0.5740227", "0.57390696", "0.57349926", "0.5728162", "0.5726702", "0.5726702", "0.5723368", "0.57175434", "0.571217", "0.5697394", "0.56948406", "0.5675124", "0.56729525", "0.5672173", "0.5666999", "0.56637937", "0.56636715", "0.5653653", "0.5647297", "0.56448835", "0.56416076", "0.5638031", "0.56196827", "0.5619589", "0.5612669", "0.5609768", "0.5602876", "0.559618", "0.55946934", "0.5585811", "0.55850345", "0.5584986", "0.5581298", "0.5580514", "0.55769306", "0.55639863", "0.55603415", "0.55580014", "0.5557916", "0.5556069", "0.55551344", "0.5552125", "0.55476457", "0.5547098", "0.55465305", "0.5544538", "0.55442655", "0.55405754", "0.5539241", "0.55327654", "0.55299217", "0.5523898", "0.5520274", "0.55190176", "0.5518949", "0.55092716", "0.55086434", "0.5507363", "0.5506605", "0.55053" ]
0.0
-1
This test method tests handlers "/user/1" request.
@Test public void shouldReturnUserCabinetViewAndSessionWithExpectedAttributes_whenPassRequestWithNumberPage() throws Exception { Principal principal = Mockito.mock(Principal.class); Mockito.when(principal.getName()).thenReturn("login"); List<Order> expectedResult = Collections.singletonList(new Order()); MockHttpSession session = new MockHttpSession(); session.setAttribute("usersOrders", new PagedListHolder<>()); Mockito.when(userServiceMock.getUsersOrders("login")) .thenReturn(expectedResult); mockMvc.perform(MockMvcRequestBuilders.get("/user/1").session(session).principal(principal)) .andExpect(MockMvcResultMatchers.view().name("user_cabinet")); Assert.assertNotNull(session.getAttribute("usersOrders")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testUserGET() {\n Response response = webTarget\n .path(\"user/1\")\n .request(APPLICATION_JSON)\n .get();\n User u = response.readEntity(User.class);\n assertThat(response.getStatus(), is(200));\n assertEquals(\"One\", u.getName());\n }", "@Test\n public void testGetUserByUID_Found() throws Exception {\n User user = new User();\n user.setUserUID(123);\n user.setUsername(\"resetme\");\n user.setPasswordTemporary(false);\n\n when(userService.getUserByUID(123)).thenReturn(user);\n\n mockMvc.perform(get(\"/api/users/123\").contentType(MediaType.APPLICATION_JSON)).andExpect(status().isOk());\n\n verify(userService, times(1)).getUserByUID(anyLong());\n }", "@Test\n\tpublic void get_usersByIdtest(){\n\t\t\n\t}", "@Test(priority=2)\n\tpublic void ValidateNewUser() {\n\t\t\n\t\tString apiEndPoint = \"https://gorest.co.in/public-api/users/\"+newUserId;\n\t\tSystem.out.println(\"API EndPoint is: \"+apiEndPoint);\n\t\t\t\t\t\t\n\t\tGetUser getuser= given()\n\t\t\t.proxy(\"internet.ford.com\", 83)\n\t\t\t.contentType(\"application/json\")\n\t\t\t.baseUri(apiEndPoint)\t\t\t\n\t\t.when()\n\t\t\t.get(apiEndPoint).as(GetUser.class);\n\t\t\n\t\tAssert.assertEquals(getuser.getCode(),200);\n\t\tAssert.assertEquals(getuser.getData().getName(),\"Stephen M D\");\n\t\tAssert.assertEquals(getuser.getData().getStatus(),\"Active\");\n\t}", "@Test\n public void testIndexNullUser() {\n User user = null;\n\n IUserService userServiceMock = mock(IUserService.class);\n IAuthService authServiceMock = mock(IAuthService.class);\n when(userServiceMock.isValid(anyString())).thenReturn(true);\n when(userServiceMock.findByToken(anyString())).thenReturn(user);\n Map<String, String> flashData = Collections.emptyMap();\n Map<String, Object> argData = Collections.emptyMap();\n play.api.mvc.RequestHeader header = mock(play.api.mvc.RequestHeader.class);\n Http.Request request = mock(Http.Request.class);\n when(request.getHeader(\"Token\")).thenReturn(\"fake-token\");\n Http.Context context = new Http.Context(2L, header, request, flashData, flashData, argData);\n Http.Context.current.set(context);\n\n Result result = new Login(userServiceMock, authServiceMock).index();\n assertEquals(401, result.status());\n\n verify(userServiceMock).isValid(anyString());\n verify(userServiceMock, times(2)).findByToken(anyString());\n verify(request, times(2)).getHeader(anyString());\n }", "@Test\n\tpublic void validateAddedUser() throws Exception {\n\t\tmockMvc.perform(\n\t\t\t\tget(\"/secure/user/{username}\", \"username1\").accept(\n\t\t\t\t\t\tMediaType.APPLICATION_JSON)).andDo(print())\n\t\t\t\t.andExpect(status().isOk())\n\t\t\t\t.andExpect(content().contentType(\"application/json\"))\n\t\t\t\t.andExpect(jsonPath(\"username\").value(\"username1\"));\n\n\t}", "@Test\n public void testServerHandler() throws IOException {\n ServerHandler handler = new ServerHandler();\n\n // Add user\n String username = handler.generateUsername();\n User user = new User.UserBuilder()\n .hasUsername(username)\n .build();\n Socket socket = new Socket();\n ClientInfo clientInfo = new ClientInfo(user, socket, handler);\n handler.addUser(clientInfo);\n\n // Add another user\n String username2 = handler.generateUsername();\n User user2 = new User.UserBuilder()\n .hasUsername(username2)\n .build();\n Socket socket2 = new Socket();\n ClientInfo clientInfo2 = new ClientInfo(user2, socket2, handler);\n handler.addUser(clientInfo2);\n\n // Remove second user\n handler.removeUser(handler.getUserClientInfo(username2));\n\n // Get users\n Vector<ClientInfo> users = handler.getUsers();\n\n // Find user\n User foundUser = handler.findByUsername(username);\n\n // User existence\n boolean userExists = handler.usernameExists(foundUser.getUsername());\n\n assertEquals(10, foundUser.getUsername().length());\n assertEquals(true, userExists);\n assertEquals(1, users.size());\n }", "@Test\n\tpublic void testEditUser() {\n\t\tHttpHeaders headers = new HttpHeaders();\n\t\tHttpEntity<String> entity = new HttpEntity<String>(null, headers);\n\t\tResponseEntity<String> response = restTemplate.exchange(getRootUrl() + \"/edit-user?id=4\",HttpMethod.GET, entity, String.class);\n\t\tassertEquals(200,response.getStatusCodeValue());\n\t}", "@Test\n void testGetByIdUser() {\n User getUser = (User) userData.crud.getById(1);\n assertEquals(\"Kevin\", getUser.getFirstName());\n logger.info(\"Got user information for ID: \" + getUser.getId());\n }", "@Test\n public void getUserByIdCatch() {\n userDAO.createUser(new User(\"dummy\", \"dummy\", 1));\n\n //test fetching of data\n assertNull(userResource.getUser(\"notdummy\"));\n\n //clean up\n userDAO.removeUser(\"dummy\");\n }", "@Test\n public void testAllUsersGET() {\n HttpAuthenticationFeature feature = \n HttpAuthenticationFeature.basic(\"admin\", \"admin\");\n Client client = ClientBuilder.newClient();\n URI uri = UriBuilder\n .fromUri(APPLICATION_NAME + APPLICATION_API_VERSION)\n .scheme(\"http\")\n .host(\"localhost\")\n .port(8080)\n .build();\n WebTarget webTarget = client\n .register(feature)\n .target(uri)\n .path(\"user\");\n Response response = webTarget\n .request(APPLICATION_JSON)\n .get();\n assertThat(response.getStatus(), is(200));\n }", "@Test\n public void testIndexSuccess() {\n User user = new User();\n user.setTenant(\"111\");\n user.setPassword(\"pass\");\n user.setToken(\"fake-token\");\n user.setUserid(\"1\");\n user.setUsername(\"fake-user\");\n\n IUserService userServiceMock = mock(IUserService.class);\n IAuthService authServiceMock = mock(IAuthService.class);\n when(userServiceMock.isValid(anyString())).thenReturn(true);\n when(userServiceMock.findByToken(anyString())).thenReturn(user);\n Map<String, String> flashData = Collections.emptyMap();\n Map<String, Object> argData = Collections.emptyMap();\n play.api.mvc.RequestHeader header = mock(play.api.mvc.RequestHeader.class);\n Http.Request request = mock(Http.Request.class);\n when(request.getHeader(\"Token\")).thenReturn(\"fake-token\");\n Http.Context context = new Http.Context(2L, header, request, flashData, flashData, argData);\n Http.Context.current.set(context);\n\n Result result = new Login(userServiceMock, authServiceMock).index();\n assertEquals(200, result.status());\n\n verify(userServiceMock).isValid(anyString());\n verify(userServiceMock, times(2)).findByToken(anyString());\n verify(request, times(2)).getHeader(anyString());\n }", "@Test\n public void fromUserIdTest() {\n // TODO: test fromUserId\n }", "@Test\n public void testGetTravel_NumberFormatExceptionUserId() throws Exception {\n \n mockMVC.perform(get(\"/user/a/travel/1\")\n .header(\"Authorization\", \"1\"))\n .andExpect(status().isInternalServerError());\n \n verifyNoMoreInteractions(databaseMock);\n }", "@Test\n public void test_get_by_id_success() throws Exception {\n UserDto user = new UserDto(1L, \"Daenerys\", \"Targaryen\", \"motherofdragons@got.com\");\n\n when(userService.getUserById(1L)).thenReturn(user);\n\n mockMvc.perform(get(\"/users/{id}\", 1)).andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))\n .andExpect(jsonPath(\"$.userId\", is(1))).andExpect(jsonPath(\"$.userFirstName\", is(\"Daenerys\")));\n\n verify(userService, times(1)).getUserById(1L);\n verifyNoMoreInteractions(userService);\n }", "@Test\n\tpublic void testGetUser() {\n\t\tresetTestVars();\n\t\tuser1.setID(\"1\");\n\t\tuser2.setID(\"2\");\n\t\tuser3.setID(\"3\");\n\t\t\n\t\tassertNull(\"No users in network\", sn.getUser(\"1\"));\n\t\tsn.addUser(user1);\n\t\tassertEquals(\"Only user in network\", user1, sn.getUser(\"1\"));\n\t\tsn.addUser(user2);\n\t\tsn.addUser(user3);\n\t\tassertEquals(\"1/3 in list\", user1, sn.getUser(\"1\"));\n\t\tassertEquals(\"2/3 in list\", user2, sn.getUser(\"2\"));\n\t\tassertEquals(\"3/3 in list\", user3, sn.getUser(\"3\"));\n\t\tassertNull(\"Isnt a valid user ID\", sn.getUser(\"4\"));\n\t}", "@Test\n public void whenFetchingExistingUserReturn200() throws Exception {\n UserRegistrationRequestDTO request = getSampleRegistrationRequest();\n long userId = api.registerUser(request).execute().body();\n\n // when fetching user details\n Response<UserDTO> response = api.getUserDetails(userId).execute();\n\n // then http status code should be ok\n assertThat(response.code(), is(200));\n\n // and user should have a matching name\n assertThat(response.body().fullName, is(request.fullName));\n }", "@Test\n public void testGetUserByUID_NotFound() throws Exception {\n when(userService.getUserByUID(anyLong())).thenThrow(EmptyResultDataAccessException.class);\n\n mockMvc.perform(get(\"/api/users/123\")).andExpect(status().isNotFound());\n\n verify(userService, times(1)).getUserByUID(anyLong());\n }", "@Test\n public void testGetUserInfoResponse() {\n // TODO: test GetUserInfoResponse\n }", "@Test\n public void testLoggedInUser() throws IOException {\n Map<String, Object> attr = new HashMap<>();\n String id = \"123\";\n attr.put(\"com.google.appengine.api.users.UserService.user_id_key\", id);\n helper.setEnvEmail(\"test@example.com\")\n .setEnvAttributes(attr)\n .setEnvAuthDomain(\"example.com\")\n .setEnvIsLoggedIn(true)\n .setUp();\n\n ArgumentCaptor<String> captor = ArgumentCaptor.forClass(String.class);\n\n HttpServletRequest request = mock(HttpServletRequest.class);\n HttpServletResponse response = mock(HttpServletResponse.class);\n\n StringWriter stringWriter = new StringWriter();\n PrintWriter writer = new PrintWriter(stringWriter);\n writer.flush();\n when(response.getWriter()).thenReturn(writer);\n\n assertNull(ofy().load().type(UserObject.class).id(id).now());\n\n new LoginRegistrationServlet().doGet(request, response);\n writer.flush();\n\n verify(response, atLeast(1)).sendRedirect(captor.capture());\n assertEquals(\"/home\", captor.getValue());\n\n UserObject result = ofy().load().type(UserObject.class).id(id).now();\n\n assertEquals(result.getId(), id);\n assertEquals(result.getUsername(), \"test\");\n assertEquals(result.getEmail(), \"test@example.com\");\n assertEquals(result.getProfilePicUrl(), \"\");\n }", "@Test\n public void getUserById() {\n userDAO.createUser(new User(\"dummy\", \"dummy\", 1));\n\n //test fetching of data\n assertNotNull(userResource.getUser(\"dummy\"));\n\n //clean up\n userDAO.removeUser(\"dummy\");\n }", "@Test\n public void testRegisteredUser() throws IOException {\n Map<String, Object> attr = new HashMap<>();\n String id = \"123\";\n attr.put(\"com.google.appengine.api.users.UserService.user_id_key\", id);\n helper.setEnvEmail(\"test@example.com\")\n .setEnvAttributes(attr)\n .setEnvAuthDomain(\"example.com\")\n .setEnvIsLoggedIn(true)\n .setUp();\n\n ArgumentCaptor<String> captor = ArgumentCaptor.forClass(String.class);\n\n HttpServletRequest request = mock(HttpServletRequest.class);\n HttpServletResponse response = mock(HttpServletResponse.class);\n\n StringWriter stringWriter = new StringWriter();\n PrintWriter writer = new PrintWriter(stringWriter);\n writer.flush();\n when(response.getWriter()).thenReturn(writer);\n\n assertNull(ofy().load().type(UserObject.class).id(id).now());\n\n new LoginRegistrationServlet().doGet(request, response);\n writer.flush();\n\n verify(response, atLeast(1)).sendRedirect(captor.capture());\n assertEquals(\"/home\", captor.getValue());\n\n // Duplicate request shouldn't change the result\n new LoginRegistrationServlet().doGet(request, response);\n writer.flush();\n\n verify(response, atLeast(1)).sendRedirect(captor.capture());\n assertEquals(\"/home\", captor.getValue());\n\n UserObject result = ofy().load().type(UserObject.class).id(id).now();\n\n assertEquals(result.getId(), id);\n assertEquals(result.getUsername(), \"test\");\n assertEquals(result.getEmail(), \"test@example.com\");\n assertEquals(result.getProfilePicUrl(), \"\");\n }", "@Test\n public void testDoPost_UserNotLoggedIn() throws IOException, ServletException {\n Mockito.when(mockRequest.getRequestURI()).thenReturn(\"/profile/invalid_username\"); \n \n profileServlet.doGet(mockRequest, mockResponse);\n\n // Verify that the error and username attribute was set\n Mockito.verify(mockRequest).setAttribute(\"username\", \"invalid_username\");\n Mockito.verify(mockRequest).setAttribute(\"error\", \"Invalid User\");\n \n Mockito.verify(mockRequestDispatcher).forward(mockRequest, mockResponse);\n }", "@Test\n public void testUserDelete() {\n Response response = webTarget\n .path(\"user/1\")\n .request(APPLICATION_JSON)\n .delete();\n assertThat(response.getStatus(), anyOf(is(200), is(202), is(204)));\n }", "@Test\n public void testGetTravel_RecordNotFoundExceptionUserId() throws Exception {\n when(databaseMock.getUser(anyInt())).thenThrow(new RecordNotFoundException());\n \n mockMVC.perform(get(\"/user/1/travel/1\")\n .header(\"Authorization\", \"1\"))\n .andExpect(status().isNotFound());\n \n verify(databaseMock, times(1)).getUser(anyInt());\n verifyNoMoreInteractions(databaseMock);\n }", "@Test\n public void testUpdateUser_NoAction() throws Exception {\n when(userService.getUserByUID(anyLong())).thenThrow(IncorrectResultSizeDataAccessException.class);\n\n mockMvc.perform(put(\"/api/users/123\")).andExpect(status().isBadRequest());\n\n verify(userService, times(0)).getUserByUID(anyLong());\n }", "@Test\n public void userIdTest() {\n // TODO: test userId\n }", "@Test\n public void userIdTest() {\n // TODO: test userId\n }", "@RequestMapping(\"/test\")\n public void test(){\n User user = (User) SecurityUtils.getCurrentUser();\n System.out.println(\"user>>>\"+user.getId());\n }", "@Test\n public void test_get_3() throws Exception {\n User user1 = createUser(1, false);\n\n User res = instance.get(user1.getId());\n\n assertEquals(\"'get' should be correct.\", user1.getUsername(), res.getUsername());\n assertEquals(\"'get' should be correct.\", user1.getDefaultTab(), res.getDefaultTab());\n assertEquals(\"'get' should be correct.\", user1.getNetworkId(), res.getNetworkId());\n assertEquals(\"'get' should be correct.\", user1.getRole().getId(), res.getRole().getId());\n assertEquals(\"'get' should be correct.\", user1.getFirstName(), res.getFirstName());\n assertEquals(\"'get' should be correct.\", user1.getLastName(), res.getLastName());\n assertEquals(\"'get' should be correct.\", user1.getEmail(), res.getEmail());\n assertEquals(\"'get' should be correct.\", user1.getTelephone(), res.getTelephone());\n assertEquals(\"'get' should be correct.\", user1.getStatus().getId(), res.getStatus().getId());\n }", "@Test\n\tpublic void testShowAllUsers() {\n\t\tHttpHeaders headers = new HttpHeaders();\n\t\tHttpEntity<String> entity = new HttpEntity<String>(null, headers);\n\t\tResponseEntity<String> response = restTemplate.exchange(getRootUrl() + \"/show-users\",HttpMethod.GET, entity, String.class);\n\t\tassertEquals(200, response.getStatusCodeValue());\n\t}", "@Test\n public void testValidNewUser() throws Exception {\n when(request.getParameter(\"username\")).thenReturn(\"testUser\");\n when(request.getParameter(\"radius\")).thenReturn(\"10000\");\n when(request.getParameter(\"searchQuery\")).thenReturn(\"milk tea\");\n when(request.getParameter(\"numResults\")).thenReturn(\"7\");\n \n new AddSearchHistoryServlet().service(request, response);\n \n ArrayList<SearchItem> si = db.getSearchItemfromSearch(userID);\n int searchID = si.get(0).searchID;\n \n assertEquals(si.get(0).searchQuery, \"milk tea\");\n assertEquals(si.get(0).numResults, 7); \n assertEquals(si.get(0).radius, 10000);\n \n db.deleteQueryfromSearchHistory(searchID);\n \n }", "@Test\n public void userTest() {\n // TODO: test user\n }", "@Test\n public void useridTest() {\n // TODO: test userid\n }", "@Test\n public void testJdoeAccess() throws IOException {\n HttpResponse response = makeRequest(\"http://localhost:8080/api/jdoe\", \"jdoe\", \"jdoe\");\n assertAccessGranted(response, \"jdoe\");\n\n // jdoe can access information about alice because he is granted with \"people-manager\" role\n response = makeRequest(\"http://localhost:8080/api/alice\", \"jdoe\", \"jdoe\");\n assertAccessGranted(response, \"alice\");\n }", "@Test\n\tpublic void test_get_by_id_success(){\n\t\tResponseEntity<User> response = template.getForEntity(\n\t\t\t\tREST_SERVICE_URI + \"/20\" + ACCESS_TOKEN + token, User.class);\n\t\tUser user = response.getBody();\n\t\tassertThat(user.getEmail(), is(\"fengt@itiaoling.com\"));\n\t\tassertThat(response.getStatusCode(), is(HttpStatus.OK));\n\t\tvalidateCORSHttpHeaders(response.getHeaders());\n\t}", "@Test\n\tpublic void testUserServiceUsername() {\n\t\twhen(uDAO.selectByName(anyString())).thenReturn(testEmployee);\n\t\t\n\t\tassertEquals(new UserService(uDAO).getByUsername(\"user1\"), testEmployee);\n\t}", "@Test\n public void fetchUser() {\n openActionBarOverflowOrOptionsMenu(getInstrumentation().getTargetContext());\n\n //Click search\n onView(withText(R.string.fetch_user))\n .perform(click());\n\n }", "@Test\n public void first_player() {\n //Arrange scenario\n final TemplateEngineTester testHelper = new TemplateEngineTester();\n //Add a player to a new empty lobby\n when(request.queryParams(\"id\")).thenReturn(\"Name\");\n // To analyze what the Route created in the View-Model map you need\n // to be able to extract the argument to the TemplateEngine.render method.\n // Mock up the 'render' method by supplying a Mockito 'Answer' object\n // that captures the ModelAndView data passed to the template engine\n when(templateEngine.render(any(ModelAndView.class))).thenAnswer(testHelper.makeAnswer());\n\n // Invoke the test\n CuT.handle(request, response);\n\n //Check if UI received all necessary parameters\n testHelper.assertViewModelExists();\n testHelper.assertViewModelIsaMap();\n\n testHelper.assertViewModelAttribute(\"currentUser\", request.queryParams(\"id\"));\n testHelper.assertViewModelAttribute(\"title\", \"Welcome!\");\n testHelper.assertViewModelAttribute(\"message\", PostSignInRoute.WELCOME_MSG);\n }", "@Test\n public void testAliceAccess() throws IOException {\n HttpResponse response = makeRequest(\"http://localhost:8080/api/alice\", \"alice\", \"alice\");\n assertAccessGranted(response, \"alice\");\n\n // alice can not access information about jdoe\n response = makeRequest(\"http://localhost:8080/api/jdoe\", \"alice\", \"alice\");\n assertEquals(403, response.getStatusLine().getStatusCode());\n }", "@Test\n @PactVerification(fragment=\"pactGetAllUsers\")\n public void runTest() {\n RestAssured\n .given()\n .port(randomPort.getPort())\n .contentType(ContentType.JSON)\n .get(\"/users\")\n .then()\n .statusCode(200)\n .assertThat()\n .body(\"userId\", Matchers.equalTo(100))\n .and()\n .body(\"name\", Matchers.equalTo(\"pramik\"))\n .and()\n .body(\"address\", Matchers.isA(String.class));\n \n }", "@Test\n public void test_get_2() throws Exception {\n User user1 = createUser(1, true);\n\n User res = instance.get(user1.getId());\n\n assertNull(\"'get' should be correct.\", res);\n }", "ResponseEntity<Response> userById(String userId);", "@Test\n public void testEditTravel_RecordNotFoundExceptionGetUser() throws Exception {\n when(databaseMock.getUser(anyInt())).thenThrow(new RecordNotFoundException());\n \n mockMVC.perform(put(\"/user/1/travel/1\")\n .contentType(TestUtil.APPLICATION_JSON_UTF8)\n .content(TestUtil.convertObjectToJsonBytes(dto))\n .header(\"Authorization\", \"1\"))\n .andExpect(status().isNotFound());\n \n verify(databaseMock, times(1)).getUser(anyInt());\n verifyNoMoreInteractions(databaseMock);\n }", "@Test public void givenUserByUsername_thenReturnJsonArray() throws Exception {\n User mockUser = new User(\"joe\", \"1234\", \"admin\");\n\n // studentService.addCourse to respond back with mockCourse\n Mockito.when(userService.getUserByUsername(Mockito.anyString())).thenReturn(new FetchUserResult(mockUser));\n\n String exampleUserJson = \"{\\\"username\\\":\\\"joe\\\",\\\"password\\\":\\\"1234\\\"}\";\n\n // Send user as body to\n RequestBuilder requestBuilder = MockMvcRequestBuilders\n .get(\"/admin/user/joe\");\n\n MvcResult result = mvc.perform(requestBuilder).andReturn();\n\n MockHttpServletResponse response = result.getResponse();\n\n assertEquals(HttpStatus.OK.value(), response.getStatus());\n }", "@Test\r\n public void testGetUserId() {\r\n System.out.println(\"getUserId\");\r\n \r\n int expResult = 0;\r\n int result = instance.getUserId();\r\n assertEquals(expResult, result);\r\n \r\n \r\n }", "@Test\n public void testAccessUserSearch() {\n try {\n driver.findElement(By.id(\"nav-users\")).click();\n wait(3);\n assertEquals(\"http://stackoverflow.com/users\", driver.getCurrentUrl());\n }\n catch(NoSuchElementException nsee) {\n fail();\n }\n }", "@GetMapping(path = \"/{userId}\",\n produces =\n {MediaType.APPLICATION_XML_VALUE,\n MediaType.APPLICATION_JSON_VALUE\n })\n public ResponseEntity<UserRest> getUserById(@PathVariable String userId) {\n if (true) throw new UserServiceException(\"A user service exception is thrown\");\n /* String firstName=null;\n int firstNameLength=firstName.length();*/\n\n if (users.containsKey(userId)) {\n return new ResponseEntity<>(users.get(userId), HttpStatus.OK);\n } else {\n return new ResponseEntity<>(HttpStatus.NO_CONTENT);\n }\n }", "@Test\n public void editUserWrongPath() throws Exception {\n // when:\n MockHttpServletResponse response\n = this.mockMvc.perform(put(\"/johndoe2/user\")\n .header(\"Authorization\",\n LoginHelper.getToken(this, mockMvc, jacksonLoginTester,\n \"johndoe\", \"12345678\"))\n .contentType(MediaType.APPLICATION_JSON)\n .content(jacksonTester.write(user).getJson()))\n .andReturn().getResponse();\n\n // then:\n assertThat(response.getStatus()).as(\"Checking HTTP status\")\n .isEqualTo(HttpStatus.FORBIDDEN.value());\n assertThat(response.getContentAsString()).contains(\"You cannot edit someone else's profile\");\n }", "@Test\n public void registerUsernameTooShort() throws Exception {\n user.setUsername(\"1234\");\n // when:\n MockHttpServletResponse response\n = this.mockMvc.perform(post(\"/user\")\n .contentType(MediaType.APPLICATION_JSON)\n .content(jacksonTester.write(user).getJson()))\n .andReturn().getResponse();\n\n // then:\n assertThat(response.getStatus()).as(\"Checking HTTP status\")\n .isEqualTo(HttpStatus.BAD_REQUEST.value());\n\n // checking links:\n JSONObject responseJson = new JSONObject(response.getContentAsString());\n Assert.assertTrue(\"Checking _links is there\", responseJson.has(\"_links\"));\n JSONObject linksJson = responseJson.getJSONObject(\"_links\");\n Assert.assertTrue(\"Checking home is there\", linksJson.has(\"home\"));\n }", "@Test\n public void whenAdminRemoveUserShouldCheckThatUserWasRemoved() throws ServletException, IOException {\n Create createUser = new Create();\n HttpServletRequest request = mock(HttpServletRequest.class);\n HttpServletResponse response = mock(HttpServletResponse.class);\n when(request.getParameter(\"name\")).thenReturn(\"Yegor\");\n when(request.getParameter(\"surname\")).thenReturn(\"Voronyansky\");\n when(request.getParameter(\"email\")).thenReturn(\"vrnsky@vrnsky.com\");\n when(request.getParameter(\"role\")).thenReturn(\"2\");\n createUser.doPost(request, response);\n\n Remove removeUser = new Remove();\n List<User> users = ExtendedRepo.getInstance().getAllUsers();\n User user = users.get(users.size() - 1);\n when(request.getParameter(\"id\")).thenReturn(String.valueOf(user.getId()));\n removeUser.doPost(request, response);\n\n User removed = ExtendedRepo.getInstance().getUserById(user.getId());\n assertEquals(null, removed);\n }", "@Test\r\n public void testGetID() {\r\n user = userFactory.getUser(\"C\");\r\n assertEquals(\"121\", user.getID());\r\n }", "@Test\r\n public void testGetUserHistory() {\r\n }", "@Override\n public boolean preHandle(HttpServletRequest request, HttpServletResponse response,\n Object handler) throws Exception {\n String testUser = request.getParameter(\"testUser\");\n if (testUser == null || testUser.isEmpty()\n || testUser.equalsIgnoreCase(\"undefined\")) {\n testUser = \"default\";\n }\n Map<String, String> userAttrs = m_userAttributes.get(testUser);\n String user = userAttrs.get(\"username\");\n String group = userAttrs.get(\"usergroup\");\n WebUtils.setSessionAttribute(request, \"currentuser\", user);\n WebUtils.setSessionAttribute(request, \"currentgroup\", group);\n return true;\n }", "@Test\n public void testWithPathParameters(){\n given().accept(ContentType.JSON)\n .and().params(\"limit\",100)\n .and().pathParams(\"employee_id\", 110)\n .when().get(ConfigurationReader.getProperty(\"hrapp.baseresturl\")+\"/employees/{employee_id}\")\n .then().assertThat().statusCode(200)\n .and().assertThat().contentType(ContentType.JSON)\n .and().assertThat().body(\"employee_id\", equalTo(110),\n \"first_name\", equalTo(\"John\"),\n \"last_name\", equalTo(\"Chen\"),\n \"email\", equalTo(\"JCHEN\") );\n }", "@Test\n public void getNonexistentGameTest() throws IOException {\n int status = callHandler(\"/xxxxxxx\", \"GET\");\n assertEquals(404, status);\n }", "@Test\n\tpublic void testGetUser() {\n\t\tassertEquals(\"Test : getUser()\", bid.getUser(), user);\n\t}", "@Test\n\tpublic void findByUserID() {\n\t\tRegistrationDetails registrationDetailsForHappyPath = RegistrationHelper.getRegistrationDetailsForHappyPath();\n\t\ttry {\n\t\t\tem.getTransaction().begin();\n\t\t\tRegistrationDetails addRegistrationDetails = registrationDAO\n\t\t\t\t\t.addRegistrationDetails(registrationDetailsForHappyPath);\n\t\t\tem.getTransaction().commit();\n\t\t\t//fetch the registration object\n\t\t\tRegistrationDetails findByUserID = registrationDAO.findByUserID(addRegistrationDetails.getUserid());\n\t\t\tassertNotNull(findByUserID);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tfail();\n\t\t}\n\t}", "@Test\n public void testUpdateUser_InvalidAction() throws Exception {\n when(userService.getUserByUID(anyLong())).thenThrow(IncorrectResultSizeDataAccessException.class);\n\n mockMvc.perform(put(\"/api/users/123?action=invalid\")).andExpect(status().isBadRequest());\n\n verify(userService, times(0)).getUserByUID(anyLong());\n }", "@RequestMapping(\"/getUser\")\n public Users getUser(String userId){\n return null;\n }", "Boolean acceptRequest(User user);", "@Test\n public void testFindUserByFilter() {\n System.out.println(\"findUserByFilter\");\n String filter = \"adrian\";\n UserServiceImpl instance = new UserServiceImpl(passwordService);\n List<User> result = instance.findUserByFilter(filter);\n assertEquals(1, result.size());\n assertEquals(\"adrian\", result.get(0).getUsername());\n }", "@Test\n public void fetchUserProfileSync_userIdPassedToEndpoint_returnSuccess(){\n SUT.fetchUserProfileSync(USER_ID);\n assertThat(userProfileHttpEndpointSyncTd.mUserId, is(USER_ID));\n }", "@Test\n void simpleBddTest(){\n given()\n .baseUri(\"https://reqres.in/api\")\n .basePath(\"/users?page=2\")\n\n //когда система\n .when().get()\n\n .then().statusCode(200)\n .and().header(\"Content-Type\", \"application/json; charset=utf-8\");\n }", "@Test\n public void testDeleteTravel_RecordNotFoundExceptionGetUser() throws Exception {\n when(databaseMock.getUser(anyInt())).thenThrow(new RecordNotFoundException());\n \n mockMVC.perform(delete(\"/user/1/travel/1\")\n .header(\"Authorization\", \"1\"))\n .andExpect(status().isNotFound());\n \n verify(databaseMock, times(1)).getUser(anyInt());\n verifyNoMoreInteractions(databaseMock);\n }", "@Test\n public void test_getByUsername_3() throws Exception {\n User user1 = createUser(1, false);\n\n User res = instance.getByUsername(user1.getUsername());\n\n assertEquals(\"'getByUsername' should be correct.\", user1.getUsername(), res.getUsername());\n assertEquals(\"'getByUsername' should be correct.\", user1.getDefaultTab(), res.getDefaultTab());\n assertEquals(\"'getByUsername' should be correct.\", user1.getNetworkId(), res.getNetworkId());\n assertEquals(\"'getByUsername' should be correct.\", user1.getRole().getId(), res.getRole().getId());\n assertEquals(\"'getByUsername' should be correct.\", user1.getFirstName(), res.getFirstName());\n assertEquals(\"'getByUsername' should be correct.\", user1.getLastName(), res.getLastName());\n assertEquals(\"'getByUsername' should be correct.\", user1.getEmail(), res.getEmail());\n assertEquals(\"'getByUsername' should be correct.\", user1.getTelephone(), res.getTelephone());\n assertEquals(\"'getByUsername' should be correct.\", user1.getStatus().getId(), res.getStatus().getId());\n }", "@Test\n\tpublic void testdeleteUser() {\n\t\tHttpHeaders headers = new HttpHeaders();\n\t\tHttpEntity<String> entity = new HttpEntity<String>(null, headers);\n\t\tResponseEntity<String> response = restTemplate.exchange(getRootUrl() + \"/delete-user?id=4\",HttpMethod.GET, entity, String.class);\n\t\tassertEquals(200,response.getStatusCodeValue());\n\t}", "@Test\n public void testGetStudent() {\n System.out.println(\"getStudent\");\n \n given()\n .contentType(\"application/json\")\n .when()\n .get(\"/generel/student/\" + s2.getName()).then()\n .statusCode(200)\n .assertThat()\n .body(\"email\", hasItems(\"amalie@gmail.com\"), \"signedup\", hasSize(1), \"signedup.passedDate\", hasSize(1));\n\n \n }", "@Test\n public void registerUsernameEmpty() throws Exception {\n user.setUsername(null);\n // when:\n MockHttpServletResponse response\n = this.mockMvc.perform(post(\"/user\")\n .contentType(MediaType.APPLICATION_JSON)\n .content(jacksonTester.write(user).getJson()))\n .andReturn().getResponse();\n\n // then:\n assertThat(response.getStatus()).as(\"Checking HTTP status\")\n .isEqualTo(HttpStatus.BAD_REQUEST.value());\n\n // checking links:\n JSONObject responseJson = new JSONObject(response.getContentAsString());\n Assert.assertTrue(\"Checking _links is there\", responseJson.has(\"_links\"));\n JSONObject linksJson = responseJson.getJSONObject(\"_links\");\n Assert.assertTrue(\"Checking home is there\", linksJson.has(\"home\"));\n }", "@Test\r\n\tpublic void test_getEmployeeById() {\r\n\t\tgiven()\r\n\t\t\t\t.contentType(ContentType.JSON)//\r\n\t\t\t\t.queryParam(\"id\", \"2\")//\r\n\t\t\t\t.when()//\r\n\t\t\t\t.get(\"/api/v1/employee\")//\r\n\t\t\t\t.then()//\r\n\t\t\t\t.log()//\r\n\t\t\t\t.body()//\r\n\t\t\t\t.statusCode(200);\r\n\t}", "@Test\n public void registerUsernameTaken() throws Exception {\n user.setUsername(\"sabina\");\n // when:\n MockHttpServletResponse response\n = this.mockMvc.perform(post(\"/user\")\n .contentType(MediaType.APPLICATION_JSON)\n .content(jacksonTester.write(user).getJson()))\n .andReturn().getResponse();\n\n // then:\n assertThat(response.getStatus()).as(\"Checking HTTP status\")\n .isEqualTo(HttpStatus.CONFLICT.value());\n\n // checking links:\n JSONObject responseJson = new JSONObject(response.getContentAsString());\n Assert.assertTrue(\"Checking _links is there\", responseJson.has(\"_links\"));\n JSONObject linksJson = responseJson.getJSONObject(\"_links\");\n Assert.assertTrue(\"Checking home is there\", linksJson.has(\"home\"));\n }", "@Test\n public void testCreateSucess() {\n User user = new User();\n user.setTenant(\"111\");\n user.setPassword(\"pass\");\n user.setToken(\"fake-token\");\n user.setUserid(\"1\");\n user.setUsername(\"fake-user\");\n\n IUserService userServiceMock = mock(IUserService.class);\n IAuthService authServiceMock = mock(IAuthService.class);\n try {\n when(authServiceMock.getUser(anyString(), anyString())).thenReturn(user);\n }catch(UnauthorizedException | InternalServerException e){\n fail(e.getLocalizedMessage());\n }\n\n Map<String, String> flashData = Collections.emptyMap();\n Map<String, Object> argData = Collections.emptyMap();\n play.api.mvc.RequestHeader header = mock(play.api.mvc.RequestHeader.class);\n Http.RequestBody requestBody = mock(Http.RequestBody.class);\n when(requestBody.asFormUrlEncoded()).thenReturn(new HashMap<String, String[]>(){{\n put(\"username\", new String[] {\"goodusername\" });\n put(\"password\", new String[] {\"goodpassword\" });\n } });\n Http.Request request = mock(Http.Request.class);\n when(request.body()).thenReturn(requestBody);\n Http.Context context = new Http.Context(2L, header, request, flashData, flashData, argData);\n Http.Context.current.set(context);\n\n Result result = new Login(userServiceMock, authServiceMock).create();\n assertEquals(200, result.status());\n assertEquals(\"application/json\", result.contentType());\n assertTrue(contentAsString(result).\n equals(\"{\\\"id\\\":null,\" +\n \"\\\"username\\\":\\\"fake-user\\\",\" +\n \"\\\"token\\\":\\\"fake-token\\\",\" +\n \"\\\"tenant\\\":\\\"111\\\",\" +\n \"\\\"userid\\\":\\\"1\\\",\" +\n \"\\\"expireDate\\\":null}\"));\n\n try{\n verify(authServiceMock).getUser(anyString(), anyString());\n }catch(UnauthorizedException | InternalServerException e){\n fail(e.getLocalizedMessage());\n }\n }", "@Test\n public void processRegistration() throws Exception {\n String newUserName = \"goodusername\";\n long numberOfExpectedUsers = userRepository.count() + 1;\n mockMvc.perform(post(RegistrationController.BASE_URL)\n .contentType(MediaType.APPLICATION_FORM_URLENCODED)\n .param(userNameField, newUserName)\n .param(passwordField, samplePasswordValue)\n .param(verifyPasswordField, samplePasswordValue))\n .andExpect(view().name(SearchController.REDIRECT + IndexController.URL_PATH_SEPARATOR))\n .andExpect(status().is3xxRedirection());\n long updatedNumberOfUsers = userRepository.count();\n assertEquals(numberOfExpectedUsers, updatedNumberOfUsers);\n }", "@Test\n public void verifyFirstName(){\n given().accept(ContentType.JSON)\n .when().get(\"http://34.223.219.142:1212/ords/hr/employees/100\")\n .then().assertThat().statusCode(200)\n .and().contentType(ContentType.JSON)\n .and().assertThat().body(\"first_name\", Matchers.equalTo(\"Steven\"))\n .and().assertThat().body(\"employee_id\",Matchers.equalTo(\"100\"));\n\n }", "@Test\n public void testGetUser() {\n System.out.println(\"getUser\");\n ModelController instance = new ModelController();\n User expResult = null;\n User result = instance.getUser();\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 }", "BaseResponse<?> test(@InfoAnnotation String userId);", "@Test\n @Transactional\n public void testUrlsRequireAuthentication() throws Exception {\n final View view = viewTestTools.createView(\"TestView\");\n\n // View \"stream\" page.\n testUrlRequiresAuthentication(\"/stream/\" + view.getId(), false);\n }", "@Test\n public void testUpdateUser_InvalidUser() throws Exception {\n when(userService.getUserByUID(anyLong())).thenThrow(IncorrectResultSizeDataAccessException.class);\n\n mockMvc.perform(put(\"/api/users/321?action=unlock\")).andExpect(status().isNotFound());\n\n verify(userService, times(1)).getUserByUID(anyLong());\n }", "public void testFindUserByName() throws Exception\r\n {\r\n createUser(\"testFindUserByName\");\r\n\r\n // try to find existed user\r\n User u = uHandler.findUserByName(\"demo\");\r\n\r\n assertNotNull(u);\r\n assertEquals(\"demo@localhost\", u.getEmail());\r\n assertEquals(\"Demo\", u.getFirstName());\r\n assertEquals(\"exo\", u.getLastName());\r\n assertEquals(\"demo\", u.getUserName());\r\n assertTrue(u.isEnabled());\r\n\r\n // try to find a non existing user. We are supposed to get \"null\" instead of Exception.\r\n try\r\n {\r\n assertNull(uHandler.findUserByName(\"not-existed-user\"));\r\n }\r\n catch (Exception e)\r\n {\r\n fail(\"Exception should not be thrown\");\r\n }\r\n try\r\n {\r\n assertNull(uHandler.findUserByName(\"not-existed-user\", UserStatus.ENABLED));\r\n }\r\n catch (Exception e)\r\n {\r\n fail(\"Exception should not be thrown\");\r\n }\r\n try\r\n {\r\n assertNull(uHandler.findUserByName(\"not-existed-user\", UserStatus.DISABLED));\r\n }\r\n catch (Exception e)\r\n {\r\n fail(\"Exception should not be thrown\");\r\n }\r\n try\r\n {\r\n assertNull(uHandler.findUserByName(\"not-existed-user\", UserStatus.BOTH));\r\n }\r\n catch (Exception e)\r\n {\r\n fail(\"Exception should not be thrown\");\r\n }\r\n\r\n assertNotNull(uHandler.findUserByName(\"testFindUserByName\"));\r\n assertTrue(uHandler.findUserByName(\"testFindUserByName\").isEnabled());\r\n assertNotNull(uHandler.findUserByName(\"testFindUserByName\", UserStatus.ENABLED));\r\n assertTrue(uHandler.findUserByName(\"testFindUserByName\", UserStatus.ENABLED).isEnabled());\r\n assertNotNull(uHandler.findUserByName(\"testFindUserByName\", UserStatus.BOTH));\r\n assertTrue(uHandler.findUserByName(\"testFindUserByName\", UserStatus.BOTH).isEnabled());\r\n\r\n boolean unsupportedOperation = false;\r\n try\r\n {\r\n // Disable the user testFindUserByName\r\n uHandler.setEnabled(\"testFindUserByName\", false, true);\r\n\r\n // We should not find the user testFindUserByName anymore from the normal method\r\n assertNull(uHandler.findUserByName(\"testFindUserByName\"));\r\n assertNull(uHandler.findUserByName(\"testFindUserByName\", UserStatus.ENABLED));\r\n // We should find it using the method that includes the disabled user account\r\n assertNotNull(uHandler.findUserByName(\"testFindUserByName\", UserStatus.BOTH));\r\n assertFalse(uHandler.findUserByName(\"testFindUserByName\", UserStatus.BOTH).isEnabled());\r\n // We should find it using the method that queries only the disabled user account\r\n assertNotNull(uHandler.findUserByName(\"testFindUserByName\", UserStatus.DISABLED));\r\n assertFalse(uHandler.findUserByName(\"testFindUserByName\", UserStatus.DISABLED).isEnabled());\r\n\r\n // Enable the user testFindUserByName\r\n uHandler.setEnabled(\"testFindUserByName\", true, true);\r\n\r\n // We should find it again whatever the value of the parameter status\r\n assertNotNull(uHandler.findUserByName(\"testFindUserByName\"));\r\n assertTrue(uHandler.findUserByName(\"testFindUserByName\").isEnabled());\r\n assertNotNull(uHandler.findUserByName(\"testFindUserByName\", UserStatus.ENABLED));\r\n assertTrue(uHandler.findUserByName(\"testFindUserByName\", UserStatus.ENABLED).isEnabled());\r\n assertNotNull(uHandler.findUserByName(\"testFindUserByName\", UserStatus.BOTH));\r\n assertTrue(uHandler.findUserByName(\"testFindUserByName\", UserStatus.BOTH).isEnabled());\r\n // We should not find the user using the method that queries only the disabled user account\r\n assertNull(uHandler.findUserByName(\"testFindUserByName\", UserStatus.DISABLED));\r\n }\r\n catch (UnsupportedOperationException e)\r\n {\r\n // This operation can be unsupported\r\n unsupportedOperation = true;\r\n }\r\n\r\n // Remove the user testFindUserByName\r\n uHandler.removeUser(\"testFindUserByName\", true);\r\n\r\n // try to find a user that doesn't exist anymore. We are supposed to get \"null\" instead of Exception.\r\n try\r\n {\r\n assertNull(uHandler.findUserByName(\"testFindUserByName\"));\r\n }\r\n catch (Exception e)\r\n {\r\n fail(\"Exception should not be thrown\");\r\n }\r\n try\r\n {\r\n assertNull(uHandler.findUserByName(\"testFindUserByName\", UserStatus.ENABLED));\r\n }\r\n catch (Exception e)\r\n {\r\n fail(\"Exception should not be thrown\");\r\n }\r\n try\r\n {\r\n assertNull(uHandler.findUserByName(\"testFindUserByName\", UserStatus.DISABLED));\r\n }\r\n catch (Exception e)\r\n {\r\n fail(\"Exception should not be thrown\");\r\n }\r\n try\r\n {\r\n assertNull(uHandler.findUserByName(\"testFindUserByName\", UserStatus.BOTH));\r\n }\r\n catch (Exception e)\r\n {\r\n fail(\"Exception should not be thrown\");\r\n }\r\n\r\n // Check the listener's counters\r\n assertEquals(1, listener.preSaveNew);\r\n assertEquals(1, listener.postSaveNew);\r\n assertEquals(0, listener.preSave);\r\n assertEquals(0, listener.postSave);\r\n assertEquals(unsupportedOperation ? 0 : 2, listener.preSetEnabled);\r\n assertEquals(unsupportedOperation ? 0 : 2, listener.postSetEnabled);\r\n assertEquals(1, listener.preDelete);\r\n assertEquals(1, listener.postDelete);\r\n }", "@Test\n public void testGetDefaultIndex() throws Exception {\n testRequest(HttpMethod.GET, \"\", 200, \"OK\", \"<html><body>Index page</body></html>\");\n\n // with slash\n testRequest(HttpMethod.GET, \"/\", 200, \"OK\", \"<html><body>Index page</body></html>\");\n\n // and directly\n testRequest(HttpMethod.GET, \"/index.html\", 200, \"OK\", \"<html><body>Index page</body></html>\");\n }", "@Test\n\tpublic void testVerifyUser() {\n\t\tLogin login = new Login(\"unique_username_78963321864\", \"unique_password_8946531846\");\n\t\tResponse response = createUser(login);\n\t\t//printResponse(response);\n\t\tassertEquals(Status.OK.getStatusCode(), response.getStatus());\n\t\t\n\t\t//verify the user\n\t\tString resource = \"verify_user\";\n\t\tString requestType = \"POST\";\n\t\tresponse = sendRequest(resource, requestType, Entity.entity(login, MediaType.APPLICATION_JSON));\n\t\tassertEquals(Status.OK.getStatusCode(), response.getStatus());\n\t}", "@Test\n\tpublic void testGetCurrentUserId() {\n\t\tAssert.assertNotNull(rmitAnalyticsModel.getCurrentUserId(getRequest()));\n\t}", "@Test(expected = IllegalArgumentException.class)\n public void test_get_userIdZero() throws Exception {\n instance.get(0);\n }", "@Test\n public void genderTest() {\n Response response = given().accept(ContentType.JSON).\n queryParam(\"gender\", \"male\").\n when().get(\"/\");\n\n assertEquals(response.contentType(), \"application/json; charset=utf-8\");\n\n JsonPath json = response.jsonPath();\n String exp = \"male\";\n String act = json.getString(\"gender\");\n assertEquals(exp,act);\n }", "@Test\n public void testGetUser2F() throws Exception {\n User user = newUser();\n TwoFactorInfo tfi = new TwoFactorInfo(user.getIdentifier(), getRandomString(256));\n get2FStore().save(tfi);\n XMLMap m = getDBSClient().getUser(user.getIdentifier());\n checkUserAgainstMap(m, user);\n TwoFactorSerializationKeys t2k = new TwoFactorSerializationKeys();\n assert m.get(t2k.info()).toString().equals(tfi.getInfo());\n\n // API dictates that any call for the user that does not just use the id requires all 6 parameters\n m = getDBSClient().getUser(user);\n assert m.containsKey(t2k.info()) : \"Getting user with remote-user that has two factor does not return two factor information.\";\n checkUserAgainstMap(m, user, true);\n assert m.get(t2k.info()).toString().equals(tfi.getInfo());\n\n // Next test gets a user via the servlet and checks it was updated in the store\n m = getDBSClient().getUser(user.getUserMultiKey(), user.getIdP(),\n user.getIDPName() + \"foo1\",\n user.getFirstName() + \"foo2\",\n user.getLastName() + \"foo3\",\n user.getEmail() + \"foo4\",\n user.getAffiliation() + \"foo\",\n user.getDisplayName() + \"foo\",\n user.getOrganizationalUnit() + \"foo\");\n user = getUserStore().get(user.getIdentifier());\n checkUserAgainstMap(m, user);\n assert m.get(t2k.info()).toString().equals(tfi.getInfo());\n\n }", "@Test\n\tpublic void testWithPathParameters() {\n\t\tgiven().accept(ContentType.JSON).and().params(\"limit\",100)\n\t\t.and().pathParams(\"id\", 110)\n\t\t.when().get(ConfigurationReader.getProperty(\"hrapp.baseurl\")+\"/employees/{id}\") //when we send e request this id will be replaced with 110\n\t\t.then().statusCode(200)\n\t\t.and().assertThat().contentType(ContentType.JSON)\n\t\t.and().body(\"employee_id\", equalTo(110),\n\t\t\t\t\"first_name\",equalTo(\"John\"),\n\t\t\t\t\"last_name\",equalTo(\"Chen\"),\n\t\t\t\t\"email\",equalTo(\"JCHEN\"));\n\t\t\n\t}", "@Test\n public void getUser() throws Exception {\n String tokenLisa = authenticationService.authorizeUser(userCredentialsLisa);\n User lisa = service.getUser(tokenLisa, \"1\");\n User peter = service.getUser(tokenLisa, \"2\");\n\n assertNotNull(lisa);\n assertNotNull(peter);\n\n\n String tokenPeter = authenticationService.authorizeUser(userCredentialsPeter);\n lisa = service.getUser(tokenPeter, \"1\");\n peter = service.getUser(tokenPeter, \"2\");\n\n assertNull(lisa);\n assertNotNull(peter);\n }", "@Test\n public void whenFetchingNonExistingUserReturn404() throws Exception {\n Response<UserDTO> user = api.getUserDetails(1000).execute();\n\n // then http status code should be 404\n assertThat(user.code(), is(404));\n }", "@Test\n public void testAddTravel_DataAccessExceptionGetUser() throws Exception {\n when(databaseMock.getUser(anyInt())).thenThrow(new DataAccessException(\"\"));\n \n mockMVC.perform(post(\"/user/1/travel\")\n .contentType(TestUtil.APPLICATION_JSON_UTF8)\n .content(TestUtil.convertObjectToJsonBytes(dto))\n .header(\"Authorization\", \"1\"))\n .andExpect(status().isInternalServerError());\n \n verify(databaseMock, times(1)).getUser(anyInt());\n verifyNoMoreInteractions(databaseMock);\n }", "@Test\n public void testFindUserById() {\n System.out.println(\"findUserById\");\n long userId = testUsers.get(0).getId();\n UserServiceImpl instance = new UserServiceImpl(passwordService);\n User expResult = testUsers.get(0);\n User result = instance.findUserById(userId);\n assertEquals(expResult.getEmail(), result.getEmail());\n }", "@Test\n public void editUserWrongUserId() throws Exception {\n user.setId(2);\n // when:\n MockHttpServletResponse response\n = this.mockMvc.perform(put(\"/johndoe/user\")\n .header(\"Authorization\",\n LoginHelper.getToken(this, mockMvc, jacksonLoginTester,\n \"johndoe\", \"12345678\"))\n .contentType(MediaType.APPLICATION_JSON)\n .content(jacksonTester.write(user).getJson()))\n .andReturn().getResponse();\n\n // then:\n assertThat(response.getStatus()).as(\"Checking HTTP status\")\n .isEqualTo(HttpStatus.FORBIDDEN.value());\n assertThat(response.getContentAsString()).contains(\"You cannot edit someone else's profile\");\n }", "@Test\n public void Task5() {\n given()\n .when()\n .get(\"https://jsonplaceholder.typicode.com/todos\")\n .then()\n .statusCode(200)\n .contentType(ContentType.JSON)\n // .log().body()\n .body(\"userId[2]\", equalTo(1))\n .body(\"title[2]\", equalTo(\"fugiat veniam minus\"))\n ;\n }", "@Override\r\n\tpublic void visit(User user) {\n\t\t\r\n\t}", "@Test\n public void iTestDeleteUser() {\n given()\n .header(\"X-Authorization\", token)\n .delete(\"/users\")\n .then()\n .statusCode(200);\n }", "@Test\r\n public void testDoGet() throws IOException, ServletException {\r\n /* Create the fake list of events */\r\n Conversation fakeConversation = new Conversation(\r\n UUID.randomUUID(), UUID.randomUUID(), \r\n \"test_conversation\", Instant.now());\r\n\r\n Message fakeMessage = new Message(\r\n UUID.randomUUID(), UUID.randomUUID(), \r\n UUID.randomUUID(), \"test_message\", Instant.now());\r\n\r\n User fakeUser = new User(\r\n UUID.randomUUID(), \"test_user\", \r\n \"test_user_PHash\", Instant.now(), \r\n \"test_user_bio\");\r\n\r\n /* \r\n * Use the doGet function in the activity servlet with the \r\n * parameters mockRequest and mockResponse (both initialized \r\n * in setup()). \r\n */\r\n activityServlet.doGet(mockRequest, mockResponse);\r\n\r\n /* \r\n * NOTE: Essentially when we use verify we are saying\r\n * \"make sure that this function actually did this\"\r\n */\r\n\r\n\r\n /*\r\n * Verify that we our we forwarded the request to \r\n * the activity.jsp file\r\n */\r\n Mockito.verify(mockRequestDispatcher)\r\n .forward(mockRequest, mockResponse);\r\n }", "@Test\n @WithMockUser(username = \"employee\", roles = {\"EMPLOYEE\", \"CUSTOMER\"})\n public void getTransactionsByIdShouldReturnOk() throws Exception {\n when(transactionService.getTransactionById(99)).thenReturn(transaction);\n this.mvc.perform(get(\"/transactions/99\").contentType(MediaType.APPLICATION_JSON)\n .accept(MediaType.APPLICATION_JSON))\n .andExpect(status().is(200));\n }", "public interface FindUserRequest\n{\n @GET(\"/dataTest/findUserByCode/{userCode}\")\n UserInfoResponse getUserInfo(@Path(\"userCode\") String userCode);\n\n @GET(\"/dataTest/findUserBySearch/{search}\")\n UserSearchResponse searchUsers(@Path(\"search\") String search);\n}", "@Test\n public void testReadUser() throws InvalidUserException {\n //Arrange\n User user = new User();\n user.setEmail(\"user@email.com\");\n user.setFirstName(\"first\");\n user.setLastName(\"last\");\n user.setPassword(\"pass\");\n user.setRole(\"admin\");\n User createdUser = userService.createUser(user);\n \n\n //Act\n User fetchedUser = userService.readUser(createdUser.getUserId());\n \n //Assert\n assertEquals(fetchedUser.getUserId(), createdUser.getUserId());\n assertEquals(fetchedUser.getEmail(), \"user@email.com\");\n assertEquals(fetchedUser.getFirstName(), \"first\"); \n \n }", "@Test\n public void testBasicAuthUserSuccess() {\n HttpAuthenticationFeature feature = \n HttpAuthenticationFeature.basic(\"admin\", \"admin\");\n Client client = ClientBuilder.newClient();\n URI uri = UriBuilder\n .fromUri(APPLICATION_NAME + APPLICATION_API_VERSION)\n .scheme(\"http\")\n .host(\"localhost\")\n .port(8080)\n .build();\n WebTarget webTarget = client\n .register(feature)\n .target(uri)\n .path(\"user\");\n Response response = webTarget\n .request(APPLICATION_JSON)\n .get();\n assertThat(response.getStatus(), is(200));\n }", "@Test\r\n public void testGetName() {\r\n user = userFactory.getUser(\"C\");\r\n assertEquals(\"customer\", user.getName());\r\n }", "@Override\n\tprotected Object handleUserinfoEndpointRequest(String requestId) {\n\t\tif(!receivedRefreshRequest) {\n\t\t\t//we don't want the test to be marked as completed if the client sends a userinfo\n\t\t\t//request before sending a refresh request\n\t\t\t//this is not the userinfo request we are looking for\n\t\t\treceivedUserinfoRequest = false;\n\t\t}\n\t\treturn super.handleUserinfoEndpointRequest(requestId);\n\t}" ]
[ "0.70111597", "0.6179165", "0.61209035", "0.60911703", "0.60037506", "0.59878963", "0.5984863", "0.5974245", "0.59633315", "0.59617233", "0.5921556", "0.5904302", "0.59040797", "0.5873592", "0.5858262", "0.5850338", "0.58451873", "0.5832794", "0.5803441", "0.5788265", "0.57835263", "0.5749009", "0.5733632", "0.5731057", "0.57088083", "0.57058465", "0.5685271", "0.5685271", "0.56419796", "0.5637559", "0.5628197", "0.56143934", "0.5607476", "0.5594152", "0.55750537", "0.5568918", "0.5557377", "0.55530655", "0.55525863", "0.55358493", "0.5532416", "0.5525745", "0.5510451", "0.55030644", "0.5484731", "0.54783064", "0.547504", "0.54731894", "0.54730225", "0.5470536", "0.5468855", "0.5466705", "0.54462755", "0.54461074", "0.5437548", "0.5429111", "0.5427294", "0.54270524", "0.54249096", "0.5423152", "0.5418765", "0.5416502", "0.54112893", "0.54110956", "0.5403453", "0.540192", "0.540186", "0.54011285", "0.53997844", "0.5397144", "0.53955185", "0.5390405", "0.5385085", "0.5380621", "0.53806037", "0.53593135", "0.53572875", "0.5353932", "0.53411925", "0.5338322", "0.53379846", "0.533097", "0.53264666", "0.5316597", "0.53161913", "0.53135407", "0.530395", "0.5300602", "0.5292419", "0.52834517", "0.5281403", "0.52811694", "0.52784693", "0.52710956", "0.52700377", "0.52699685", "0.5269615", "0.52693224", "0.526513", "0.526157", "0.52595246" ]
0.0
-1
This test method tests handlers "/user/prev" request.
@Test public void shouldReturnUserCabinetViewAndSessionWithExpectedAttributes_whenPassRequestWithPrevPage() throws Exception { Principal principal = Mockito.mock(Principal.class); Mockito.when(principal.getName()).thenReturn("login"); List<Order> expectedResult = Collections.singletonList(new Order()); MockHttpSession session = new MockHttpSession(); session.setAttribute("usersOrders", new PagedListHolder<>()); Mockito.when(userServiceMock.getUsersOrders("login")) .thenReturn(expectedResult); mockMvc.perform(MockMvcRequestBuilders.get("/user/prev").session(session).principal(principal)) .andExpect(MockMvcResultMatchers.view().name("user_cabinet")); Assert.assertNotNull(session.getAttribute("usersOrders")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected ActionForward previousPage( UserRequest request )\n {\n int pageNumber = request.getParameterAsInt( PAGE_KEY, 2 );\n HttpServletRequest req = request.getRequest();\n req.setAttribute( PAGE_KEY, \"\"+ --pageNumber );\n return request.getMapping().findForward( PAGE_KEY + pageNumber );\n }", "public static Result prev() {\r\n\t\tMap<String, String> requestData = Form.form().bindFromRequest().data();\r\n\t\tString idCurrentNode = requestData.get(RequestParams.CURRENT_NODE);\r\n\t\tString formName = ChangeOrderForm.NAME;\r\n\t\tString username = CMSSession.getEmployeeName();\r\n\r\n\t\tDecision previousDecision = CMSGuidedFormFill.getPreviousDecision(\r\n\t\t\t\tformName, username, idCurrentNode);\r\n\r\n\t\treturn ok(backdrop.render(previousDecision));\r\n\t}", "public void setPrev(String prev){\n\t\tthis.prev = prev;\n\t}", "boolean hasPreviousPage();", "public void testPrev() {\n test1.prev();\n for (int i = 0; i < 10; i++) {\n test1.append(new Buffer(i, rec));\n }\n test1.prev();\n test1.moveToPos(8);\n assertTrue(test1.getValue().inRange(8));\n }", "@Test\n\tpublic void firstPage() throws Exception {\n\t\tpostRequest(1, 0).andExpect(content().string(CoreMatchers.containsString(\"Answered\")))\n\t\t\t\t.andExpect(content().string(IsNot.not(CoreMatchers.containsString(\"prevBtn\"))));\n\t}", "@Test\n public void whenGetPrevUnitThenReturnResult() {\n MenuUnit expected = underTestSubNext.getPrevUnit();\n assertThat(expected, is(underTestSub));\n }", "public void Prev();", "@Test(dataProvider = \"validPPData\")\r\n\tpublic void testPrevious(List<String> valid) {\r\n\t\t\r\n\t\tField field;\r\n\t\ttry {\r\n\t\t\tfield = pages.getClass().getDeclaredField(\"currentPage\");\r\n\t\t\tfield.setAccessible(true);\r\n\t\t\tfield.set(pages, 3);\r\n\t\t\t\r\n\t\t\tList<String> result = pages.previous();\r\n\t\t\tAssert.assertTrue(result.equals(valid));\r\n\t\t} catch (NoSuchFieldException e1) {\r\n\t\t\te1.printStackTrace();\r\n\t\t} catch (SecurityException e1) {\r\n\t\t\te1.printStackTrace();\r\n\t\t} catch (IllegalArgumentException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IllegalAccessException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "@Test\n public void navigateBack() throws Exception {\n }", "void previousPage() throws IndexOutOfBoundsException;", "@Test\n public void testNextAndPrevious() throws Exception {\n\n driver.get(baseUrl + \"/computerdatabase/computers?page-number=1&lang=en\");\n\n driver.findElement(By.xpath(\"//li[contains(@class, 'active')]/a[text()='1']\"));\n\n driver.findElement(By.linkText(\"Next\")).click();\n driver.findElement(By.xpath(\"//li[contains(@class, 'active')]/a[text()='2']\"));\n\n try {\n driver.findElement(By.xpath(\"//li[contains(@class, 'active')]/a[text()='1']\"));\n fail();\n } catch (NoSuchElementException e) {\n assertTrue(true);\n }\n\n driver.findElement(By.linkText(\"Previous\")).click();\n driver.findElement(By.xpath(\"//li[contains(@class, 'active')]/a[text()='1']\"));\n try {\n driver.findElement(By.xpath(\"//li[contains(@class, 'active')]/a[text()='2']\"));\n fail();\n } catch (NoSuchElementException e) {\n assertTrue(true);\n }\n }", "public void previous();", "private void prevPage()\n {\n if(currentPage - 1 >= 1)\n {\n nextPageButton.setEnabled(true);\n if(currentPage -2 < 1)\n prevPageButton.setEnabled(false);\n \n paginate(--currentPage, getResultsPerPage());\n updatePageLabel(currentPage, maxPage);\n }\n }", "@Override\r\n\tpublic void beforeNavigateBack(WebDriver arg0) {\n\t\t\r\n\t}", "@Test\r\n public void testGetUserHistory() {\r\n }", "public void prev();", "@Test(expected = NoSuchElementException.class)\n public void testPrevious_Start() {\n OasisList<Integer> baseList = new SegmentedOasisList<>();\n baseList.addAll(Arrays.asList(1, 2, 5, 8));\n\n ListIterator<Integer> instance = baseList.listIterator();\n instance.previous();\n }", "@Test\n public void testPrevious_Middle() {\n OasisList<Integer> baseList = new SegmentedOasisList<>();\n baseList.addAll(Arrays.asList(1, 2, 5, 8));\n\n ListIterator<Integer> instance = baseList.listIterator();\n instance.next();\n instance.next();\n instance.next();\n\n Integer expResult = 5;\n Integer result = instance.previous();\n assertEquals(expResult, result);\n }", "public void pgr_U_Prev(ActionEvent e) throws Exception\n\t{\n\t\tpgr_D_Prev(e);\n\t}", "public void setPrev(Version prev){\n\t\tif (prev == null){\n\t\t\tLog.e(NAME, \"Invalid parameters for 'setPrev' method!\");\n\t\t\treturn;\n\t\t}\n\t\tthis.prev = prev;\n\t}", "@Test\n public void navigateForward() throws Exception {\n }", "String getPrevious();", "@Test //Index\n public void testPageNavigationAsUserIndex() {\n loginAsUser();\n\n vinyardApp.navigationCultureClick();\n final String expectedURL = \"http://localhost:8080/index\";\n final String result = driver.getCurrentUrl();\n assertEquals(expectedURL, result);\n }", "@Override\n\tpublic void beforeNavigateBack(WebDriver arg0) {\n\n\t}", "public IWizardPage getPreviousPage();", "@Override\n\tpublic boolean hasPreviousPage() {\n\t\treturn false;\n\t}", "@Override\r\n public void beforeNavigateBack(final WebDriver arg0) {\n\r\n }", "void previous() throws NoSuchRecordException;", "private void previousButtonActionPerformed(ActionEvent e) {\n // TODO add your code here\n if(this.page == 0){\n Warning.run(\"No previous page here.\");\n }\n else{\n this.page--;\n this.update();\n }\n }", "@Test\n public void testPrevious_End() {\n OasisList<Integer> baseList = new SegmentedOasisList<>();\n baseList.addAll(Arrays.asList(1, 2));\n\n ListIterator<Integer> instance = baseList.listIterator();\n instance.next();\n instance.next();\n\n Integer expResult = 2;\n Integer result = instance.previous();\n assertEquals(expResult, result);\n }", "public static void previous() {\n\t\tsendMessage(PREVIOUS_COMMAND);\n\t}", "public void setPrev(Node prev) {\n this.prev = prev;\n }", "public void setPrev(Node<T> prev) {\n\t\tthis.prev = prev;\n\t}", "public void setPrev(Node prev)\r\n\t{\r\n\t\tthis.prev = prev;\r\n\t}", "public void setPrevHashValue(String prevHashValue) {\n this.prevHashValue = prevHashValue;\n }", "boolean hasPrevious();", "boolean hasPrevious();", "boolean hasPrevious();", "boolean hasPrevious();", "@Test\n public void testAccessUserSearch() {\n try {\n driver.findElement(By.id(\"nav-users\")).click();\n wait(3);\n assertEquals(\"http://stackoverflow.com/users\", driver.getCurrentUrl());\n }\n catch(NoSuchElementException nsee) {\n fail();\n }\n }", "@Test\n public void testListIteratorPrevious(){\n DoubleLinkedList<Integer> list1 = new DoubleLinkedList<Integer>();\n ListIterator<Integer> list1It = list1.iterator();\n try{\n list1It.previous();\n fail(\"expected a NoSuchElementException to be thrown\");\n }\n catch(NoSuchElementException error){\n assertEquals(error.getMessage(), \"There is no previous element in the list\");\n }\n list1It.add(1);\n assertEquals(\"testing with an element in the next spot\", new Integer(1), list1It.previous());\n }", "@Test\n public void shouldReturnUserCabinetViewAndSessionWithExpectedAttributes_whenPassRequestWithNextPage() throws Exception\n {\n Principal principal = Mockito.mock(Principal.class);\n Mockito.when(principal.getName()).thenReturn(\"login\");\n List<Order> expectedResult = Collections.singletonList(new Order());\n MockHttpSession session = new MockHttpSession();\n session.setAttribute(\"usersOrders\", new PagedListHolder<>());\n Mockito.when(userServiceMock.getUsersOrders(\"login\"))\n .thenReturn(expectedResult);\n mockMvc.perform(MockMvcRequestBuilders.get(\"/user/next\").session(session).principal(principal))\n .andExpect(MockMvcResultMatchers.view().name(\"user_cabinet\"));\n Assert.assertNotNull(session.getAttribute(\"usersOrders\"));\n }", "@Test\n public void backToSignInTest() {\n driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n String actualResult = forgetPasswordPO\n .clickBackToSignInLink()\n .getSignInPO()\n .getSignInTitle();\n\n Assert.assertEquals(\"Welcome back!\", actualResult);\n }", "@Override\n\tpublic void beforeNavigateBack(WebDriver driver) {\n\t\t\n\t}", "@Nullable\n WizardPage flipToPrevious();", "public void setPreviousPage(IWizardPage page);", "public void setPrev(SlideNode node) {\n\t\tthis.prev = node;\n\t}", "public void setPrevNode(int node) {\n\t\tthis.previousNode = node;\n\t}", "@Override\n public void preValidate() throws Exception\n {\n final HtmlPage page = getPreviousAction().getHtmlPage();\n Assert.assertNotNull(\"Failed to get page from previous action.\", page);\n\n // Check that the cart overview link is available.\n Assert.assertTrue(\"Cart overview link not found\", HtmlPageUtils.isElementPresent(page, \"id('miniCartMenu')//div[@class='linkButton']/a\"));\n\n // Remember cart overview link.\n viewCartLink = HtmlPageUtils.findSingleHtmlElementByXPath(page, \"id('miniCartMenu')//div[@class='linkButton']/a\");\n }", "public void setPrev(Level previous) {\n\t\tthis.prev = previous;\n\t}", "@RequestMapping(value = \"/prevQuestion\", method = RequestMethod.POST)\r\n\tpublic ModelAndView prevQuestion(@RequestParam String questionId, @RequestParam String timeCounter,\r\n\t\t\tHttpServletRequest request, HttpServletResponse response,\r\n\t\t\t@ModelAttribute(\"currentQuestion\") QuestionInstanceDto currentQuestion) throws Exception {\n\t\tUser user = (User) request.getSession().getAttribute(\"user\");\r\n\t\tTest test = (Test) request.getSession().getAttribute(\"test\");\r\n\t\tModelAndView model;\r\n\t\tif (test.getFullStackTest() != null && test.getFullStackTest()) {\r\n\t\t\tmodel = new ModelAndView(\"test_fstk\");\r\n\t\t} else {\r\n\t\t\tmodel = new ModelAndView(\"test_cognizant\");\r\n\t\t}\r\n\r\n\t\tList<SectionInstanceDto> sectionInstanceDtos = (List<SectionInstanceDto>) request.getSession()\r\n\t\t\t\t.getAttribute(\"sectionInstanceDtos\");\r\n\t\tmodel.addObject(\"sectionInstanceDtos\", sectionInstanceDtos);\r\n\r\n\t\tSectionInstanceDto currentSection = (SectionInstanceDto) request.getSession().getAttribute(\"currentSection\");\r\n\t\t// just in case a Q is of coding type value that comes from jsp has \\r\r\n\t\t// characters.so removng them so they can be rendered next time\r\n\t\tif (currentQuestion.getCode() != null) {\r\n\t\t\tcurrentQuestion.setCode(currentQuestion.getCode().replaceAll(\"\\r\", \"\"));\r\n\t\t\tString rep = \"\\\\\\\\n\";\r\n\t\t\tString rept = \"\\\\\\\\t\";\r\n\t\t\tcurrentQuestion.setCode(currentQuestion.getCode().replaceAll(\"\\n\", rep));\r\n\t\t\tcurrentQuestion.setCode(currentQuestion.getCode().replaceAll(\"\\t\", rept));\r\n\t\t}\r\n\t\tsetAnswers(request, currentSection, currentQuestion, questionId, false);\r\n\t\t// setValuesInSession(currentSection, sectionInstanceDtos);\r\n\r\n\t\tQuestionSequence questionSequence = new QuestionSequence(currentSection.getQuestionInstanceDtos());\r\n\t\tSectionSequence sectionSequence = new SectionSequence(sectionInstanceDtos);\r\n\t\tcurrentQuestion = questionSequence.previousQuestion(Long.valueOf(questionId));\r\n\t\tif (currentQuestion == null) {\r\n\r\n\t\t\tSectionInstanceDto previousSection = sectionSequence\r\n\t\t\t\t\t.prevSection(currentSection.getSection().getSectionName());\r\n\r\n\t\t\tif (previousSection != null) {\r\n\t\t\t\tpreviousSection = populateWithQuestions(previousSection, test.getTestName(),\r\n\t\t\t\t\t\tpreviousSection.getSection().getSectionName(), user.getCompanyId());\r\n\t\t\t\t// currentSection.getQuestionInstanceDtos().clear();\r\n\t\t\t\tcurrentQuestion = previousSection.getQuestionInstanceDtos()\r\n\t\t\t\t\t\t.get(previousSection.getQuestionInstanceDtos().size() - 1);\r\n\t\t\t\tmodel.addObject(\"currentSection\", previousSection);\r\n\t\t\t\tpreviousSection.setCurrent(true);\r\n\t\t\t\tcurrentSection.setCurrent(false);\r\n\t\t\t\t/**\r\n\t\t\t\t * Making sure next and prev button behave for the first and last event\r\n\t\t\t\t */\r\n\t\t\t\tquestionSequence = new QuestionSequence(previousSection.getQuestionInstanceDtos());// now\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// get\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// the\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// last\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// question\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// from\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// the\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// prev\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// section\r\n\t\t\t\tif (isQuestionLast(currentQuestion, questionSequence, sectionSequence)) {\r\n\t\t\t\t\tpreviousSection.setLast(true);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tpreviousSection.setLast(false);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (isQuestionFirst(currentQuestion, questionSequence, sectionSequence)) {\r\n\t\t\t\t\tpreviousSection.setFirst(true);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tpreviousSection.setFirst(false);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (currentQuestion.getCode() == null || currentQuestion.getCode().trim().length() == 0) {\r\n\t\t\t\t\tcurrentQuestion.setCode(currentQuestion.getQuestionMapperInstance().getQuestionMapper()\r\n\t\t\t\t\t\t\t.getQuestion().getInputCode());\r\n\t\t\t\t}\r\n\t\t\t\tmodel.addObject(\"currentQuestion\", currentQuestion);\r\n\t\t\t\trequest.getSession().setAttribute(\"currentSection\", previousSection);\r\n\t\t\t\tputMiscellaneousInfoInModel(model, request);\r\n\t\t\t\tprocessPercentages(model, sectionInstanceDtos, test.getTotalMarks());\r\n\t\t\t\t/**\r\n\t\t\t\t * Get the fullstack for Q if type is full stack.\r\n\t\t\t\t * \r\n\t\t\t\t */\r\n\t\t\t\tif (!currentQuestion.getQuestionMapperInstance().getQuestionMapper().getQuestion().getFullstack()\r\n\t\t\t\t\t\t.getStack().equals(FullStackOptions.NONE.getStack())) {\r\n\t\t\t\t\tsetWorkspaceIDEForFullStackQ(request, currentQuestion);\r\n\t\t\t\t}\r\n\t\t\t\t/**\r\n\t\t\t\t * End full stack check\r\n\t\t\t\t */\r\n\t\t\t\tmodel.addObject(\"confidenceFlag\", test.getConsiderConfidence());\r\n\t\t\t\treturn model;\r\n\t\t\t} else {\r\n\t\t\t\t// Save test and generate result\r\n\t\t\t\tmodel = new ModelAndView(\"intro\");\r\n\t\t\t\tputMiscellaneousInfoInModel(model, request);\r\n\t\t\t\treturn model;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tmodel.addObject(\"currentSection\", currentSection);\r\n//\t\t\t if(currentQuestion.getQuestionMapperInstance().getQuestionMapper().getQuestion().getQuestionType() != null && currentQuestion.getQuestionMapperInstance().getQuestionMapper().getQuestion().getQuestionType().getType().equals(QuestionType.CODING.getType())){\r\n//\t\t\t\t currentQuestion.setCode(currentQuestion.getQuestionMapperInstance().getQuestionMapper().getQuestion().getInputCode().replaceAll(\"\\r\", \"\"));\r\n//\t\t\t\t //currentQuestion.setCode(currentQuestion.getQuestionMapperInstance().getQuestionMapper().getQuestion().getInputCode().replaceAll(\"\\\\r\\\\n|\\\\r|\\\\n\", \"<br />\"));\r\n//\t\t\t \t}\r\n\t\t\tif (currentQuestion.getCode() == null || currentQuestion.getCode().trim().length() == 0) {\r\n\t\t\t\tcurrentQuestion.setCode(currentQuestion.getQuestionMapperInstance().getQuestionMapper()\r\n\t\t\t\t\t\t.getQuestion().getInputCode());\r\n\t\t\t}\r\n\t\t\tmodel.addObject(\"currentQuestion\", currentQuestion);\r\n\t\t\tif (isQuestionLast(currentQuestion, questionSequence, sectionSequence)) {\r\n\t\t\t\tcurrentSection.setLast(true);\r\n\t\t\t} else {\r\n\t\t\t\tcurrentSection.setLast(false);\r\n\t\t\t}\r\n\r\n\t\t\tif (isQuestionFirst(currentQuestion, questionSequence, sectionSequence)) {\r\n\t\t\t\tcurrentSection.setFirst(true);\r\n\t\t\t} else {\r\n\t\t\t\tcurrentSection.setFirst(false);\r\n\t\t\t}\r\n\r\n\t\t\trequest.getSession().setAttribute(\"currentSection\", currentSection);\r\n\t\t\tputMiscellaneousInfoInModel(model, request);\r\n\t\t\tsetTimeInCounter(request, Long.valueOf(timeCounter));\r\n\t\t\tprocessPercentages(model, sectionInstanceDtos, test.getTotalMarks());\r\n\t\t\t/**\r\n\t\t\t * Get the fullstack for Q if type is full stack.\r\n\t\t\t * \r\n\t\t\t */\r\n\t\t\tif (!currentQuestion.getQuestionMapperInstance().getQuestionMapper().getQuestion().getFullstack()\r\n\t\t\t\t\t.getStack().equals(FullStackOptions.NONE.getStack())) {\r\n\t\t\t\tsetWorkspaceIDEForFullStackQ(request, currentQuestion);\r\n\t\t\t}\r\n\t\t\t/**\r\n\t\t\t * End full stack check\r\n\t\t\t */\r\n\t\t\tmodel.addObject(\"confidenceFlag\", test.getConsiderConfidence());\r\n\t\t\treturn model;\r\n\t\t}\r\n\r\n\t}", "@Override\r\npublic void beforeNavigateBack(WebDriver arg0) {\n\tSystem.out.println(\"as\");\r\n}", "public TeacherPage clickPreviousPageButton() {\n previousPage.click();\n return this;\n }", "public void previousPage() {\n\t\tthis.skipEntries -= NUM_PER_PAGE;\n\t\tif (this.skipEntries < 1) {\n\t\t\tskipEntries = 1;\n\t\t}\n\t\tloadEntries();\n\t}", "public void skipToPrevious() {\n try {\n mSessionBinder.previous(mContext.getPackageName(), mCbStub);\n } catch (RemoteException e) {\n Log.wtf(TAG, \"Error calling previous.\", e);\n }\n }", "public void setPreviousHop(int previousHop) {\n this.previousHop = previousHop;\n }", "public String returnToPreviousPage() {\n if (datasetVersion.isDraft()) {\n return \"/dataset.xhtml?persistentId=\" +\n datasetVersion.getDataset().getGlobalId().asString() + \"&version=DRAFT&faces-redirect=true\";\n }\n return \"/dataset.xhtml?persistentId=\"\n + datasetVersion.getDataset().getGlobalId().asString()\n + \"&faces-redirect=true&version=\"\n + datasetVersion.getVersionNumber() + \".\" + datasetVersion.getMinorVersionNumber();\n }", "public void setPrevious(MyNode<? super E> _previous)\n\t{\n\t\tthis.previous = _previous;\n\t\t//this.previous = _previous;\n\t}", "@Override\r\n\tpublic void beforeNavigateForward(WebDriver arg0) {\n\t\t\r\n\t}", "public void setPreviousPage(MouseEvent event) {\n\t\tm_previousPage = event;\n\t}", "@Test\n public void testHasPrevious_Start() {\n OasisList<Integer> baseList = new SegmentedOasisList<>();\n baseList.addAll(Arrays.asList(1, 2, 3, 4, 5));\n\n ListIterator<Integer> instance = baseList.listIterator();\n boolean expResult = false;\n boolean result = instance.hasPrevious();\n\n assertEquals(expResult, result);\n }", "public void setPrevNode(Node<T> prevNode) {\n\t\tthis.prevNode = prevNode;\n\t}", "@Test\n public void testPreviousIndex_Start() {\n OasisList<Integer> baseList = new SegmentedOasisList<>();\n baseList.addAll(Arrays.asList(1, 2, 3, 4, 5));\n\n ListIterator<Integer> instance = baseList.listIterator();\n int expResult = -1;\n int result = instance.previousIndex();\n\n assertEquals(expResult, result);\n }", "@Test\r\n public void startNextOptionTest()\r\n {\r\n presenter.onClickNext();\r\n\r\n Assert.assertEquals(stub.getNextCounter(), 1);\r\n }", "@Override\r\n public void beforeNavigateForward(final WebDriver arg0) {\n\r\n }", "org.naru.park.ParkController.CommonAction getGetUserHistory();", "boolean previousStep();", "@Test\n public void testFollowUser(TestContext tc) {\n\n Async async = tc.async();\n\n webClient.post(8080, \"localhost\", \"/api/profiles/Jacob/follow\")\n .putHeader(HttpProps.CONTENT_TYPE, HttpProps.JSON)\n .putHeader(HttpProps.XREQUESTEDWITH, HttpProps.XMLHTTPREQUEST)\n .putHeader(HttpProps.AUTHORIZATION, TestProps.TOKEN_USER1)\n .send(ar -> {\n\n if (ar.failed()) {\n async.complete();\n tc.fail(ar.cause());\n }else{\n tc.assertEquals(200, ar.result().statusCode());\n JsonObject returnedJson = ar.result().bodyAsJsonObject();\n tc.assertNotNull(returnedJson);\n JsonObject returnedUser = returnedJson.getJsonObject(\"profile\");\n verifyProfile(returnedUser);\n async.complete();\n }\n });\n }", "@Test\n public void testDoPost_UserNotLoggedIn() throws IOException, ServletException {\n Mockito.when(mockRequest.getRequestURI()).thenReturn(\"/profile/invalid_username\"); \n \n profileServlet.doGet(mockRequest, mockResponse);\n\n // Verify that the error and username attribute was set\n Mockito.verify(mockRequest).setAttribute(\"username\", \"invalid_username\");\n Mockito.verify(mockRequest).setAttribute(\"error\", \"Invalid User\");\n \n Mockito.verify(mockRequestDispatcher).forward(mockRequest, mockResponse);\n }", "Object previous();", "public boolean isPreviousPage() {\n return previousPage;\n }", "@Test\n public void testHasPrevious_Middle() {\n OasisList<Integer> baseList = new SegmentedOasisList<>();\n baseList.addAll(Arrays.asList(1, 2, 3, 4, 5));\n\n ListIterator<Integer> instance = baseList.listIterator();\n\n instance.next();\n instance.next();\n\n boolean expResult = true;\n boolean result = instance.hasPrevious();\n\n assertEquals(expResult, result);\n }", "@Test\n public void testAdd_After_Previous() {\n OasisList<Integer> baseList = new SegmentedOasisList<>();\n baseList.addAll(Arrays.asList(1, 2, 6, 8));\n\n ListIterator<Integer> instance = baseList.listIterator();\n instance.next();\n instance.next();\n instance.previous();\n\n instance.add(9);\n int expResult = 1;\n\n assertEquals(expResult, baseList.indexOf(9));\n }", "public void beforeNavigateBack(WebDriver driver) {\n\t\t\n\t}", "private void onBack(McPlayerInterface player, GuiSessionInterface session, ClickGuiInterface gui)\r\n {\r\n session.setNewPage(this.prevPage);\r\n }", "public void setPreviousPage(boolean value) {\n this.previousPage = value;\n }", "public void setPrevious(Node<T> previous) {\r\n this.previous = previous;\r\n }", "public void beforeNavigateBack(WebDriver driver) {\n\t\t\r\n\t}", "public void beforeNavigateBack(WebDriver driver) {\n\t\t\r\n\t}", "@Test\n public void testSet_After_Previous() {\n OasisList<Integer> baseList = new SegmentedOasisList<>();\n baseList.addAll(Arrays.asList(1, 2, 6, 8));\n\n ListIterator<Integer> instance = baseList.listIterator();\n instance.next();\n instance.next();\n instance.previous();\n\n instance.set(9);\n int expResult = 1;\n\n assertEquals(expResult, baseList.indexOf(9));\n }", "@Override\r\n\tpublic String prev() {\n\t\tString pre;\r\n\r\n\t\tpre = p.getPrev();\r\n\r\n\t\tif (pre != null) {\r\n\t\t\tthisPrevious = true;\r\n\t\t\tinput(pre);\r\n\t\t}\r\n\t\treturn pre;\r\n\t}", "public void previousBtnClicked(View v){\n\t\tresetSelection();\r\n\t\tnextQuestion(-1);\r\n\t\tshowQuesAndAnswers();\r\n\t}", "@Override\n\tpublic void beforeNavigateForward(WebDriver arg0) {\n\n\t}", "public Content getNavLinkPrevious() {\n Content li;\n if (prev != null) {\n Content prevLink = getLink(new LinkInfoImpl(configuration,\n LinkInfoImpl.Kind.CLASS, prev)\n .label(prevclassLabel).strong(true));\n li = HtmlTree.LI(prevLink);\n }\n else\n li = HtmlTree.LI(prevclassLabel);\n return li;\n }", "public void previousRecord( View v){\n// \tClear out the display first\n \tclearBtn( v );\n \tLog.i(\"in prev record\", \"this sheep ID is \" + String.valueOf(thissheep_id));\n \tcursor.moveToPrevious();\n \tLog.i(\"in prev record\", \"after moving the cursor \");\n \tthissheep_id = cursor.getInt(0);\n \tLog.i(\"in prev record\", \"this sheep ID is \" + String.valueOf(thissheep_id));\n \trecNo -= 1;\n \tfindTagsShowAlert(v, thissheep_id);\n\t\t// I've moved back so enable the next record button\n\t\tButton btn2 = (Button) findViewById( R.id.next_rec_btn );\n\t\tbtn2.setEnabled(true); \t\t\n \tif (recNo == 1) {\n \t\t// at beginning so disable prev record button\n \t\tButton btn3 = (Button) findViewById( R.id.prev_rec_btn );\n \tbtn3.setEnabled(false); \t\t\n \t}\n }", "private void previous() {\n Timeline currentTimeline = simpleExoPlayerView.getPlayer().getCurrentTimeline();\n if (currentTimeline.isEmpty()) {\n return;\n }\n int currentWindowIndex = simpleExoPlayerView.getPlayer().getCurrentWindowIndex();\n\n Timeline.Window currentWindow = currentTimeline.getWindow(currentWindowIndex, new Timeline.Window());\n if (currentWindowIndex > 0 && (player.getCurrentPosition() <= MAX_POSITION_FOR_SEEK_TO_PREVIOUS\n || (currentWindow.isDynamic && !currentWindow.isSeekable))) {\n player.seekTo(currentWindowIndex - 1, C.TIME_UNSET);\n } else {\n player.seekTo(0);\n }\n }", "public void setPrev(ListElement<T> prev)\n\t{\n\t\tthis.prev = prev;\n\t}", "public void testService() {\n\n\t\ttry {\n\t\t\tString nextAction = \"next action\";\n\t\t\trequest.setAttribute(\"NEXT_ACTION\", nextAction);\n\t\t\tString nextPublisher = \"next publisher\";\n\t\t\trequest.setAttribute(\"NEXT_PUBLISHER\", nextPublisher);\n\t\t\tString expertQueryDisplayed = \"expert query displayed\";\n\t\t\trequest.setAttribute(\"expertDisplayedForUpdate\", expertQueryDisplayed);\n\t\t\tupdateFieldsForResumeAction.service(request, response);\n\t\t\tassertEquals(nextAction, response.getAttribute(\"NEXT_ACTION\"));\t\t\n\t\t\tassertEquals(nextPublisher, response.getAttribute(\"NEXT_PUBLISHER\"));\n\t\t\tassertEquals(expertQueryDisplayed, singleDataMartWizardObj.getExpertQueryDisplayed());\n\t\t\t\n\t\t} catch (SourceBeanException e) {\n\t\t\te.printStackTrace();\n\t\t\tfail(\"Unaspected exception occurred!\");\n\t\t}\n\t\t\n\t}", "public void returnToPrevious(View v) {\n }", "@Override\n @Before\n public void before() {\n super.before();\n usersSearchByLastNameUrl = rootUrl + \"/users/search/findByLastName\";\n }", "@Test\n public void testPreviousIndex_Middle() {\n\n OasisList<Integer> baseList = new SegmentedOasisList<>();\n baseList.addAll(Arrays.asList(1, 2, 6, 8));\n\n ListIterator<Integer> instance = baseList.listIterator();\n instance.next();\n instance.next();\n\n int expResult = 1;\n int result = instance.previousIndex();\n\n assertEquals(expResult, result);\n }", "@Test\n public void testListIteratorHasPrevious(){\n DoubleLinkedList<Integer> list1 = new DoubleLinkedList<Integer>();\n ListIterator<Integer> list1It = list1.iterator();\n assertFalse(\"testing with no previous element\", list1It.hasPrevious());\n list1It.add(1);\n assertTrue(\"testing with a previous element\", list1It.hasPrevious());\n }", "@Test\n public void testEditOperationAsUser(){\n loginAsUser();\n\n vinyardApp.navigationOperationsClick();\n vinyardApp.editOperation();\n String result = driver.getCurrentUrl();\n String expected = \"http://localhost:8080/edit_operation/1\";\n assertEquals(expected, result);\n }", "public Node getPrev(Node root, int key, Node prev){\n\t\tif(root==nil){\n\t\t\treturn nil;\n\t\t}\n\t\t\n\t\tif(key==root.id){\n\t\t\tif(root.left != nil){\n\t\t\t\tNode temp = root.left;\n\t\t\t\twhile(temp.right != nil){\n\t\t\t\t\ttemp = temp.right;\n\t\t\t\t}\n\t\t\t\tprev = temp;\n\t\t\t}\n\t\t\treturn prev;\n\t\t}\n\t\t\n\t\tif(key>root.id){\n\t\t\tprev = root;\n\t\t\tprev = getPrev(root.right,key,prev);\n\t\t}else{\n\t\t\tprev = getPrev(root.left,key,prev);\n\t\t}\n\t\t\n\t\treturn prev;\n\t}", "@Then(\"^user is navigated to \\\"([^\\\"]*)\\\"$\")\n public void user_is_navigated_to(String expectedUrl) {\n driver.findElement(By.xpath(\"//form[@action='https://www.phptravels.net/admin/blog/']/*[1]\")).click();\n driver.findElement(By.xpath(\"//form[@class='add_button']/*[1]\")).click();\n Assert.assertEquals(\"Navigating to wrong URL\", expectedUrl, driver.getCurrentUrl());\n }", "@Test\n public void testSearchUsersByQueryPagingNextPage() throws Exception {\n TestSubscriber testSubscriber = new TestSubscriber();\n Observable<ApiSearchUser> searchRepositoryObservable = githubApi.getSearchUser(testedString, 1);\n searchRepositoryObservable.subscribe(testSubscriber);\n testSubscriber.awaitTerminalEvent();\n ApiSearchUser apiSearchUser = (ApiSearchUser) testSubscriber.getOnNextEvents().get(0);\n assertTrue(apiSearchUser.getItems().size() > 0);\n }", "@Test\n public void testViewClientHistory() {\n for (int i = 0; i < 10; i++) {\n presenter.onViewClientHistory();\n }\n Assert.assertEquals(10, view.getManageViewClientHistoryClicks());\n }", "public Node setPrevNode(Node node);", "private void previousButtonMouseClicked(java.awt.event.MouseEvent evt) {\n if(previousButton.isEnabled() == false || checkUpdateInventoryError() == true) return;\n recordChanged();\n current --;\n displayCurrentStock();\n }" ]
[ "0.6189737", "0.5761594", "0.57091165", "0.56789416", "0.5644115", "0.5624994", "0.5581047", "0.55456126", "0.5530404", "0.54997236", "0.5496158", "0.54888874", "0.5468179", "0.53984135", "0.5365345", "0.53470945", "0.5342796", "0.53102547", "0.5301243", "0.5295881", "0.5285182", "0.5284833", "0.5275136", "0.52699125", "0.5265927", "0.52587366", "0.5254197", "0.52475405", "0.52112234", "0.51910913", "0.51872355", "0.51863277", "0.5176995", "0.51617", "0.5142637", "0.5138022", "0.5126381", "0.5126381", "0.5126381", "0.5126381", "0.51144207", "0.5112969", "0.51030296", "0.5096612", "0.508767", "0.5077342", "0.5071177", "0.5058205", "0.5053436", "0.5050482", "0.5048367", "0.5032092", "0.50168955", "0.5014983", "0.5006347", "0.4996925", "0.4977314", "0.49737427", "0.49685037", "0.49576512", "0.4956657", "0.49564663", "0.4952116", "0.49502802", "0.493672", "0.4933142", "0.4931416", "0.4928735", "0.4924706", "0.49146363", "0.49043405", "0.4901433", "0.49006942", "0.48915842", "0.48904023", "0.4883211", "0.488254", "0.48820007", "0.4880896", "0.4880896", "0.4875889", "0.48692292", "0.4868677", "0.486561", "0.48646837", "0.4861219", "0.48597664", "0.4850814", "0.48481366", "0.48439875", "0.48427916", "0.48412392", "0.4839417", "0.48387963", "0.48358366", "0.4820441", "0.48181435", "0.48167518", "0.48111838", "0.4809574" ]
0.6425368
0
This test method tests handlers "/user/next" request.
@Test public void shouldReturnUserCabinetViewAndSessionWithExpectedAttributes_whenPassRequestWithNextPage() throws Exception { Principal principal = Mockito.mock(Principal.class); Mockito.when(principal.getName()).thenReturn("login"); List<Order> expectedResult = Collections.singletonList(new Order()); MockHttpSession session = new MockHttpSession(); session.setAttribute("usersOrders", new PagedListHolder<>()); Mockito.when(userServiceMock.getUsersOrders("login")) .thenReturn(expectedResult); mockMvc.perform(MockMvcRequestBuilders.get("/user/next").session(session).principal(principal)) .andExpect(MockMvcResultMatchers.view().name("user_cabinet")); Assert.assertNotNull(session.getAttribute("usersOrders")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract void nextRequest ();", "@GetMapping(\"/next\")\n\tpublic Map<String, Object> next();", "@Test\r\n public void startNextOptionTest()\r\n {\r\n presenter.onClickNext();\r\n\r\n Assert.assertEquals(stub.getNextCounter(), 1);\r\n }", "@Test\n public void testSearchUsersByQueryPagingNextPage() throws Exception {\n TestSubscriber testSubscriber = new TestSubscriber();\n Observable<ApiSearchUser> searchRepositoryObservable = githubApi.getSearchUser(testedString, 1);\n searchRepositoryObservable.subscribe(testSubscriber);\n testSubscriber.awaitTerminalEvent();\n ApiSearchUser apiSearchUser = (ApiSearchUser) testSubscriber.getOnNextEvents().get(0);\n assertTrue(apiSearchUser.getItems().size() > 0);\n }", "@Test\n public void testGetNext() throws Exception {\n//TODO: Test goes here... \n }", "@Test\n public void testFollowUser(TestContext tc) {\n\n Async async = tc.async();\n\n webClient.post(8080, \"localhost\", \"/api/profiles/Jacob/follow\")\n .putHeader(HttpProps.CONTENT_TYPE, HttpProps.JSON)\n .putHeader(HttpProps.XREQUESTEDWITH, HttpProps.XMLHTTPREQUEST)\n .putHeader(HttpProps.AUTHORIZATION, TestProps.TOKEN_USER1)\n .send(ar -> {\n\n if (ar.failed()) {\n async.complete();\n tc.fail(ar.cause());\n }else{\n tc.assertEquals(200, ar.result().statusCode());\n JsonObject returnedJson = ar.result().bodyAsJsonObject();\n tc.assertNotNull(returnedJson);\n JsonObject returnedUser = returnedJson.getJsonObject(\"profile\");\n verifyProfile(returnedUser);\n async.complete();\n }\n });\n }", "@Test\n\tpublic void firstPage() throws Exception {\n\t\tpostRequest(1, 0).andExpect(content().string(CoreMatchers.containsString(\"Answered\")))\n\t\t\t\t.andExpect(content().string(IsNot.not(CoreMatchers.containsString(\"prevBtn\"))));\n\t}", "@Test\n public void testAddDemotivatorPageRequiresAuthentication(){\n \tResponse response = GET(\"/add\");\n \n assertNotNull(response);\n assertStatus(302, response);\n \n assertHeaderEquals(\"Location\", \"/secure/login\", response);\n }", "void setNext(final UrlArgumentBuilder next);", "@Test\n public void testAccessUserSearch() {\n try {\n driver.findElement(By.id(\"nav-users\")).click();\n wait(3);\n assertEquals(\"http://stackoverflow.com/users\", driver.getCurrentUrl());\n }\n catch(NoSuchElementException nsee) {\n fail();\n }\n }", "@RequestMapping(\"/next\")\n public void nextTurn() {\n playerService.nextTurn();\n }", "@Test\n public void testAddDemotivatorPageAccessibleIFAuthorised(){\n \tFixtures.deleteAllModels();\n \tFixtures.loadModels(\"data/user.yml\");\n \t\n\t\t//Authenticating\n \tauthenticate();\n\n //Going to add Demotivator page\n \tResponse response = GET(\"/add\");\n \n assertNotNull(response);\n assertStatus(200, response);\n }", "@Test\n public void navigateForward() throws Exception {\n }", "protected ActionForward nextPage( UserRequest request )\n {\n int pageNumber = request.getParameterAsInt( PAGE_KEY, 0 );\n HttpServletRequest req = request.getRequest();\n req.setAttribute( PAGE_KEY, \"\"+ ++pageNumber );\n return request.getMapping().findForward( PAGE_KEY + pageNumber );\n }", "@Test\n public void testUserGET() {\n Response response = webTarget\n .path(\"user/1\")\n .request(APPLICATION_JSON)\n .get();\n User u = response.readEntity(User.class);\n assertThat(response.getStatus(), is(200));\n assertEquals(\"One\", u.getName());\n }", "@Override\n protected void onNextPageRequested(int page) {\n\n }", "@Test\n void testForNextPlayerUserStartsFirst() {\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n Human testHuman = testDealer.getUser();\n testDealer.setNextPlayer(testDealer.getUser().getId());\n \n assertEquals(testDealer.getUser() , testDealer.getTrickPlayer());\n assertEquals(testDealer.getBotA().getId(), testDealer.getNextPlayer());\n }", "public void testGetUserPageList() throws Exception\r\n {\r\n assertSizeEquals(4, uHandler.getUserPageList(10).getAll());\r\n }", "@Test(priority=2)\n\tpublic void ValidateNewUser() {\n\t\t\n\t\tString apiEndPoint = \"https://gorest.co.in/public-api/users/\"+newUserId;\n\t\tSystem.out.println(\"API EndPoint is: \"+apiEndPoint);\n\t\t\t\t\t\t\n\t\tGetUser getuser= given()\n\t\t\t.proxy(\"internet.ford.com\", 83)\n\t\t\t.contentType(\"application/json\")\n\t\t\t.baseUri(apiEndPoint)\t\t\t\n\t\t.when()\n\t\t\t.get(apiEndPoint).as(GetUser.class);\n\t\t\n\t\tAssert.assertEquals(getuser.getCode(),200);\n\t\tAssert.assertEquals(getuser.getData().getName(),\"Stephen M D\");\n\t\tAssert.assertEquals(getuser.getData().getStatus(),\"Active\");\n\t}", "@Test\n public void testRegisteredUser() throws IOException {\n Map<String, Object> attr = new HashMap<>();\n String id = \"123\";\n attr.put(\"com.google.appengine.api.users.UserService.user_id_key\", id);\n helper.setEnvEmail(\"test@example.com\")\n .setEnvAttributes(attr)\n .setEnvAuthDomain(\"example.com\")\n .setEnvIsLoggedIn(true)\n .setUp();\n\n ArgumentCaptor<String> captor = ArgumentCaptor.forClass(String.class);\n\n HttpServletRequest request = mock(HttpServletRequest.class);\n HttpServletResponse response = mock(HttpServletResponse.class);\n\n StringWriter stringWriter = new StringWriter();\n PrintWriter writer = new PrintWriter(stringWriter);\n writer.flush();\n when(response.getWriter()).thenReturn(writer);\n\n assertNull(ofy().load().type(UserObject.class).id(id).now());\n\n new LoginRegistrationServlet().doGet(request, response);\n writer.flush();\n\n verify(response, atLeast(1)).sendRedirect(captor.capture());\n assertEquals(\"/home\", captor.getValue());\n\n // Duplicate request shouldn't change the result\n new LoginRegistrationServlet().doGet(request, response);\n writer.flush();\n\n verify(response, atLeast(1)).sendRedirect(captor.capture());\n assertEquals(\"/home\", captor.getValue());\n\n UserObject result = ofy().load().type(UserObject.class).id(id).now();\n\n assertEquals(result.getId(), id);\n assertEquals(result.getUsername(), \"test\");\n assertEquals(result.getEmail(), \"test@example.com\");\n assertEquals(result.getProfilePicUrl(), \"\");\n }", "IHandler next();", "ManagedEndpoint next();", "@Test\n public void first_player() {\n //Arrange scenario\n final TemplateEngineTester testHelper = new TemplateEngineTester();\n //Add a player to a new empty lobby\n when(request.queryParams(\"id\")).thenReturn(\"Name\");\n // To analyze what the Route created in the View-Model map you need\n // to be able to extract the argument to the TemplateEngine.render method.\n // Mock up the 'render' method by supplying a Mockito 'Answer' object\n // that captures the ModelAndView data passed to the template engine\n when(templateEngine.render(any(ModelAndView.class))).thenAnswer(testHelper.makeAnswer());\n\n // Invoke the test\n CuT.handle(request, response);\n\n //Check if UI received all necessary parameters\n testHelper.assertViewModelExists();\n testHelper.assertViewModelIsaMap();\n\n testHelper.assertViewModelAttribute(\"currentUser\", request.queryParams(\"id\"));\n testHelper.assertViewModelAttribute(\"title\", \"Welcome!\");\n testHelper.assertViewModelAttribute(\"message\", PostSignInRoute.WELCOME_MSG);\n }", "@Test //Index\n public void testPageNavigationAsUserIndex() {\n loginAsUser();\n\n vinyardApp.navigationCultureClick();\n final String expectedURL = \"http://localhost:8080/index\";\n final String result = driver.getCurrentUrl();\n assertEquals(expectedURL, result);\n }", "@Test\n public void testLoggedInUser() throws IOException {\n Map<String, Object> attr = new HashMap<>();\n String id = \"123\";\n attr.put(\"com.google.appengine.api.users.UserService.user_id_key\", id);\n helper.setEnvEmail(\"test@example.com\")\n .setEnvAttributes(attr)\n .setEnvAuthDomain(\"example.com\")\n .setEnvIsLoggedIn(true)\n .setUp();\n\n ArgumentCaptor<String> captor = ArgumentCaptor.forClass(String.class);\n\n HttpServletRequest request = mock(HttpServletRequest.class);\n HttpServletResponse response = mock(HttpServletResponse.class);\n\n StringWriter stringWriter = new StringWriter();\n PrintWriter writer = new PrintWriter(stringWriter);\n writer.flush();\n when(response.getWriter()).thenReturn(writer);\n\n assertNull(ofy().load().type(UserObject.class).id(id).now());\n\n new LoginRegistrationServlet().doGet(request, response);\n writer.flush();\n\n verify(response, atLeast(1)).sendRedirect(captor.capture());\n assertEquals(\"/home\", captor.getValue());\n\n UserObject result = ofy().load().type(UserObject.class).id(id).now();\n\n assertEquals(result.getId(), id);\n assertEquals(result.getUsername(), \"test\");\n assertEquals(result.getEmail(), \"test@example.com\");\n assertEquals(result.getProfilePicUrl(), \"\");\n }", "@Given(\"^Registered user is on the main page of website$\")\n public void registeredUserIsOnTheMainPageOfWebsite() {\n }", "@Test\n @InSequence(1)\n public void shouldFailGetingSessionsWithZeroPage(@ArquillianResteasyResource(\"api/sessions\") WebTarget webTarget) throws Exception {\n Response response = webTarget.queryParam(\"page\", 0).request(APPLICATION_JSON_TYPE).get();\n assertEquals(BAD_REQUEST.getStatusCode(), response.getStatus());\n checkHeaders(response);\n }", "@Test\n\tpublic void testQueryPage() {\n\n\t}", "@Test(invocationCount = 1)\n public void testRouting()\n throws Exception {\n\n token.executeStep();\n\n Thread.sleep(LONG_WAITING_TIME_TEST);\n\n Assert.assertEquals(token.getCurrentNode(), endNode1, errorMessage());\n\n Mockito.verify(token).resume(Mockito.any(IncomingIntermediateProcessEvent.class));\n }", "@Override\r\n\tpublic void visit(User user) {\n\t\t\r\n\t}", "@Test\n\tpublic void testRedirectToAboutUs() {\n\t\tServicesLogic.redirectToAboutUs();\n\t}", "@Test\n public void testGetNext()\n {\n System.out.println(\"getNext\");\n final File file = new File(\"src/test/data/test.example.txt\");\n final Lexer lexer = new Lexer();\n final Token token = lexer.analyze(file);\n assertEquals(Syntax.LABEL, token.getSyntax());\n assertTrue(token.getNext() != null);\n final Token next = token.getNext();\n assertEquals(\"{\", next.getValue());\n assertEquals(Syntax.OPEN, next.getSyntax());\n assertEquals(2, next.getLine());\n assertEquals(1, next.getPosition());\n }", "@Test\n\tpublic void test03_AcceptARequest(){\n\t\tinfo(\"Test03: Accept a Request\");\n\t\tinfo(\"prepare data\");\n\t\t/*Create data test*/\n\t\tString username1 = txData.getContentByArrayTypeRandom(4) + getRandomString();\n\t\tString password1 = username1;\n\t\tString email1 = username1 + mailSuffixData.getMailSuffixRandom();\n\n\t\tString username2 = txData.getContentByArrayTypeRandom(4) + getRandomString();\n\t\tString password2 = username2;\n\t\tString email2= username2 + mailSuffixData.getMailSuffixRandom();\n\n\t\tinfo(\"Add new user\");\n\t\tmagAc.signIn(DATA_USER1, DATA_PASS);\n\t\tnavToolBar.goToAddUser();\n\t\taddUserPage.addUser(username1, password1, email1, username1, username1);\n\t\taddUserPage.addUser(username2, password2, email2, username2, username2);\n\n\t\t/*Step Number: 1\n\t\t *Step Name: Accept a request\n\t\t *Step Description: \n\t\t\t- Login as John\n\t\t\t- Open intranet homepage\n\t\t\t- On this gadget, mouse over an invitation of mary\n\t\t\t- Click on Accept button\n\t\t *Input Data: \n\t\t/*Expected Outcome: \n\t\t\t- The invitation of root, mary is shown on the invitation gadget\n\t\t\t- The Accept and Refuse button are displayed.\n\t\t\t- John is connected to mary and the invitation fades out and is permanently removed from the list\n\t\t\t- Request of root are moving to the top of the gadget if needed*/ \n\t\tinfo(\"Sign in with mary account\");\n\t\tmagAc.signIn(username1, password1);\n\t\thp.goToConnections();\n\t\tconnMg.connectToAUser(DATA_USER1);\n\n\t\tinfo(\"--Send request 2 to John\");\n\t\tmagAc.signIn(username2, password2);\n\t\thp.goToConnections();\n\t\tconnMg.connectToAUser(DATA_USER1);\n\n\t\tmagAc.signIn(DATA_USER1, DATA_PASS);\n\t\tmouseOver(hp.ELEMENT_INVITATIONS_PEOPLE_AVATAR .replace(\"${name}\",username2),true);\n\t\tclick(hp.ELEMENT_INVITATIONS_PEOPLE_ACCEPT_BTN.replace(\"${name}\",username2), 2,true);\n\t\twaitForElementNotPresent(hp.ELEMENT_INVITATIONS_PEOPLE_AVATAR .replace(\"${name}\",username2));\n\t\twaitForAndGetElement(hp.ELEMENT_INVITATIONS_PEOPLE_AVATAR .replace(\"${name}\",username1));\n\n\t\tinfo(\"Clear Data\");\n\t\tmagAc.signIn(DATA_USER1, DATA_PASS);\n\t\tnavToolBar.goToUsersAndGroupsManagement();\n\t\tuserAndGroup.deleteUser(username1);\n\t\tuserAndGroup.deleteUser(username2);\n\t}", "@Test\n public void testIndexSuccess() {\n User user = new User();\n user.setTenant(\"111\");\n user.setPassword(\"pass\");\n user.setToken(\"fake-token\");\n user.setUserid(\"1\");\n user.setUsername(\"fake-user\");\n\n IUserService userServiceMock = mock(IUserService.class);\n IAuthService authServiceMock = mock(IAuthService.class);\n when(userServiceMock.isValid(anyString())).thenReturn(true);\n when(userServiceMock.findByToken(anyString())).thenReturn(user);\n Map<String, String> flashData = Collections.emptyMap();\n Map<String, Object> argData = Collections.emptyMap();\n play.api.mvc.RequestHeader header = mock(play.api.mvc.RequestHeader.class);\n Http.Request request = mock(Http.Request.class);\n when(request.getHeader(\"Token\")).thenReturn(\"fake-token\");\n Http.Context context = new Http.Context(2L, header, request, flashData, flashData, argData);\n Http.Context.current.set(context);\n\n Result result = new Login(userServiceMock, authServiceMock).index();\n assertEquals(200, result.status());\n\n verify(userServiceMock).isValid(anyString());\n verify(userServiceMock, times(2)).findByToken(anyString());\n verify(request, times(2)).getHeader(anyString());\n }", "public void setNextHandler(Handler nextHandler){\n\n this.nextHandler = nextHandler;\n\n }", "public void ClickNext() {\r\n\t\tnext.click();\r\n\t\t\tLog(\"Clicked the \\\"Next\\\" button on the Birthdays page\");\r\n\t}", "@Test\n public void shouldReturnUserCabinetViewAndSessionWithExpectedAttributes_whenPassRequestWithPrevPage() throws Exception\n {\n Principal principal = Mockito.mock(Principal.class);\n Mockito.when(principal.getName()).thenReturn(\"login\");\n List<Order> expectedResult = Collections.singletonList(new Order());\n MockHttpSession session = new MockHttpSession();\n session.setAttribute(\"usersOrders\", new PagedListHolder<>());\n Mockito.when(userServiceMock.getUsersOrders(\"login\"))\n .thenReturn(expectedResult);\n mockMvc.perform(MockMvcRequestBuilders.get(\"/user/prev\").session(session).principal(principal))\n .andExpect(MockMvcResultMatchers.view().name(\"user_cabinet\"));\n Assert.assertNotNull(session.getAttribute(\"usersOrders\"));\n }", "public abstract void goNext();", "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 }", "@Test\n public void testDoPost_UserNotLoggedIn() throws IOException, ServletException {\n Mockito.when(mockRequest.getRequestURI()).thenReturn(\"/profile/invalid_username\"); \n \n profileServlet.doGet(mockRequest, mockResponse);\n\n // Verify that the error and username attribute was set\n Mockito.verify(mockRequest).setAttribute(\"username\", \"invalid_username\");\n Mockito.verify(mockRequest).setAttribute(\"error\", \"Invalid User\");\n \n Mockito.verify(mockRequestDispatcher).forward(mockRequest, mockResponse);\n }", "@Test\n @Transactional\n public void testUrlsRequireAuthentication() throws Exception {\n final View view = viewTestTools.createView(\"TestView\");\n\n // View \"stream\" page.\n testUrlRequiresAuthentication(\"/stream/\" + view.getId(), false);\n }", "@Test(enabled=true)\npublic void getRequest() {\n\t\tString url = \"https://reqres.in/api/users?page=2\";\n\t\t\n\t\t//create an object of response class\n\t\t\n\t\t//Restassured will send get request to the url and store response in response object\n\t\tResponse response = RestAssured.get(url);\n\t\t\n\t\t//We have to put assertion in response code and response data\n\t\tAssert.assertEquals(response.getStatusCode(), 200 , \"Response code Mismatch\");\n\t\t\n\t\tint total_pages = response.jsonPath().get(\"total_pages\");\n\t\tAssert.assertEquals(total_pages, 2 , \"Total Pages value Mismatch\");\n \n}", "@Test\n public void userTest() {\n // TODO: test user\n }", "@Test\n\tpublic void loginTest() {\n\t\tSystem.out.println(\"Login Page Test\");\n\t}", "@Override\n public void onNext(RequestData request) {\n System.out.println(\"Requestor:\" + request.getName());\n System.out.println(\"Request Message:\" + request.getMessage());\n }", "@Override\n public void onNext(RandomUserResponse response) {\n Log.d(\"TAG\", response.getResults().get(0).getEmail());\n this.randomUserResponse = response;\n }", "@Test\n public void testSearchUsersByQueryPaging() throws Exception {\n TestSubscriber testSubscriber = new TestSubscriber();\n Observable<ApiSearchUser> searchRepositoryObservable = githubApi.getSearchUser(testedString, 0);\n searchRepositoryObservable.subscribe(testSubscriber);\n testSubscriber.awaitTerminalEvent();\n ApiSearchUser apiSearchUser = (ApiSearchUser) testSubscriber.getOnNextEvents().get(0);\n assertTrue(apiSearchUser.getItems().size() > 0);\n }", "private void sendToNextPage(String nextPage, HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows IOException, ServletException {\r\n\t\t// if the next page is null\r\n\t\tif (nextPage == null) {\r\n\t\t\tresponse.sendError(HttpServletResponse.SC_NOT_FOUND, request.getServletPath());\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// if action\r\n\t\tif (nextPage.endsWith(\".do\")) {\r\n\t\t\tresponse.sendRedirect(nextPage);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// if view\r\n\t\tif (nextPage.endsWith(\".jsp\")) {\r\n\t\t\tRequestDispatcher d = request.getRequestDispatcher(\"WEB-INF/\" + nextPage);\r\n\t\t\td.forward(request, response);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tresponse.sendRedirect(nextPage);\r\n\t\treturn;\r\n\t}", "@Test\n\tpublic void testUserSignupLogin() {\n\t\tdriver.get(baseURL + \"/signup\");\n\t\tAssertions.assertEquals(\"Sign Up\", driver.getTitle());\n\t\tSignupPage signupPage = new SignupPage(driver);\n\t\tsignupPage.signup(firstName, lastName, username, password);\n\n\t\t//user logs in\n\t\tdriver.get(baseURL + \"/login\");\n\t\tLoginPage loginPage = new LoginPage(driver);\n\t\tloginPage.loginUser(username, password);\n\n\t\t//verifies that the home page is accessible\n\t\tAssertions.assertEquals(\"Home\", driver.getTitle());\n\t}", "@Test\n @Order(3)\n public void plusButton() {\n driver.get(\"http://localhost:3000/student/new\");\n StudentUserPage studentUserPage = new StudentUserPage(driver);\n WebDriverWait wait = new WebDriverWait(driver, 30);\n\n studentUserPage.clickOnPlusButton();\n wait.until(ExpectedConditions.visibilityOf(studentUserPage.getExitButton()));\n\n assertEquals(\"\", studentUserPage.getSideStudentName());\n assertEquals(\"\", studentUserPage.getSideStudentSurname());\n assertEquals(\"\", studentUserPage.getSideStudentAccountName());\n assertEquals(\"\", studentUserPage.getSideStudentEmail());\n assertEquals(\"\", studentUserPage.getSideStudentBankCardNumber());\n }", "@Test\n public void testIndexNullUser() {\n User user = null;\n\n IUserService userServiceMock = mock(IUserService.class);\n IAuthService authServiceMock = mock(IAuthService.class);\n when(userServiceMock.isValid(anyString())).thenReturn(true);\n when(userServiceMock.findByToken(anyString())).thenReturn(user);\n Map<String, String> flashData = Collections.emptyMap();\n Map<String, Object> argData = Collections.emptyMap();\n play.api.mvc.RequestHeader header = mock(play.api.mvc.RequestHeader.class);\n Http.Request request = mock(Http.Request.class);\n when(request.getHeader(\"Token\")).thenReturn(\"fake-token\");\n Http.Context context = new Http.Context(2L, header, request, flashData, flashData, argData);\n Http.Context.current.set(context);\n\n Result result = new Login(userServiceMock, authServiceMock).index();\n assertEquals(401, result.status());\n\n verify(userServiceMock).isValid(anyString());\n verify(userServiceMock, times(2)).findByToken(anyString());\n verify(request, times(2)).getHeader(anyString());\n }", "ManagedEndpoint next(EndpointCriteria criteria);", "public void testFollowSomeone(){\n solo.assertCurrentActivity(\"Wrong activity\", MoodMainActivity.class);\n solo.clickOnButton(\"Sign In\");\n solo.assertCurrentActivity(\"Wrong activity\", SignInActivity.class);\n solo.enterText((EditText) solo.getView(R.id.signInInput), user1);\n solo.clickOnButton(\"Log In\");\n solo.assertCurrentActivity(\"Wrong activity\", DashBoard.class);\n solo.clickOnView(solo.getView(R.id.action_all));\n solo.assertCurrentActivity(\"Wrong activity\", FollowSomeoneActivity.class);\n solo.clickOnText(user2);\n solo.clickOnText(\"Yes\");\n solo.sleep(1000);\n MainController mc = MainApplication.getMainController();\n User first = mc.getUsers().getUserByName(user1);\n User second = mc.getUsers().getUserByName(user2);\n assertTrue(second.getPendingRequests().contains(first.getId()));\n\n }", "public void next (CallContext context);", "protected void handleNext(ActionEvent event) {\n\t}", "public void goToNextPage() {\n nextPageButton.click();\n }", "@Test\r\n\tpublic void test_getAllEmployeesPage2() {\r\n\t\tgiven()\r\n\t\t\t\t.contentType(ContentType.JSON)//\r\n\t\t\t\t.queryParam(\"page\", \"2\")//\r\n\t\t\t\t.when()//\r\n\t\t\t\t.get(\"/api/v1/employees\")//\r\n\t\t\t\t.then()//\r\n\t\t\t\t.log()//\r\n\t\t\t\t.body()//\r\n\t\t\t\t.statusCode(200)//\r\n\t\t\t\t.body(\"number\", equalTo(2))//\r\n\t\t\t\t.body(\"content.size()\", equalTo(10));\r\n\r\n\t}", "@Test\n public void loginTest() throws MalformedURLException{\n // User user=new User();\n loginPage.fillGmailAccountInput().hitNextbutton().fillPasswordInput();\n InboxPage inboxPage = loginPage.clickNextButton();\n Assert.assertTrue(inboxPage.isElementClickable(inboxPage.composeButton ));\n\n }", "@Test\n public void testTIM(){\n loginToVisit();\n }", "public abstract void onNext();", "@Test\r\n public void testGetUserHistory() {\r\n }", "@Test\n public void testRepositoryGotResponseOkForUser() throws InterruptedException {\n // Preconditions\n TestSubscriber<User> subscriber = new TestSubscriber<>();\n\n // Attaches the subscriber and executes the Observable.\n repository.get(1).subscribe(subscriber);\n RecordedRequest request = server.takeRequest();\n\n // Checks whether these methods from inner objects are called.\n verify(retrofitFactory).setBaseUrl(anyString());\n verify(retrofitFactory).create(UserService.class);\n verify(retrofitFactory).getClient();\n\n // Ensures there aren't new changes on the Rest adapter structure\n verifyNoMoreInteractions(retrofitFactory);\n\n // Ensures Observer and Requests are working as expected\n List<User> events = subscriber.getOnNextEvents();\n subscriber.assertNoErrors();\n subscriber.assertValueCount(1);\n subscriber.assertCompleted();\n subscriber.assertUnsubscribed();\n Assert.assertEquals(1, server.getRequestCount());\n Assert.assertEquals(\"/users/1\", request.getPath());\n Assert.assertNotNull(events);\n Assert.assertEquals(1, events.size());\n Assert.assertEquals(\"Sincere@april.biz\", events.get(0).email);\n }", "@Test\n public void testGetUserInfoResponse() {\n // TODO: test GetUserInfoResponse\n }", "@Test(groups ={Slingshot,Regression})\n\tpublic void VerifyAddNewUserLandingPage() {\n\t\tReport.createTestLogHeader(\"MuMv\", \"Verify the Add new User Landing page and their Overlay\");\n\n\t\tUserProfile userProfile = new TestDataHelper().getUserProfile(\"MuMVTestDatas\");\n\t\tnew LoginAction()\n\t\t.BgbnavigateToLogin()\n\t\t.BgbloginDetails(userProfile);\n\t\tnew MultiUserMultiViewAction()\n\t\t.ClickManageUserLink()\n\t\t.ClickAddNewUserLink()\n\t\t.AddUserRadioButton()\n\t\t.AddUsersWhatisThisverlay()\n\t\t.AddNewUserNavigationVerification(); //have to update navigation link\n\t}", "@Test\n public void navigateBack() throws Exception {\n }", "void stubNextResponse(HttpExecuteResponse nextResponse);", "public void testHasNext() {\r\n System.out.println(\"hasNext\");\r\n // tested in testNext()\r\n }", "@RelatedIssue(issueID = \"DE-4379\", comment = \"If fails, notify DE team.\")\n @Test\n public void wam_003_verifyPaginationByNextButton() {\n wam.verifyWamIndexPageFirstColumnInOrder(1, wam.DEFAULT_WAM_INDEX_ROWS);\n wam.clickNextPaginator();\n wam.verifyWamIndexPageFirstColumnInOrder(\n wam.DEFAULT_WAM_INDEX_ROWS + 1,\n 2 * wam.DEFAULT_WAM_INDEX_ROWS\n );\n wam.clickNextPaginator();\n wam.verifyWamIndexPageFirstColumnInOrder(\n 2 * wam.DEFAULT_WAM_INDEX_ROWS + 1,\n 3 * wam.DEFAULT_WAM_INDEX_ROWS\n );\n wam.clickNextPaginator();\n wam.verifyWamIndexPageFirstColumnInOrder(\n 3 * wam.DEFAULT_WAM_INDEX_ROWS + 1,\n 4 * wam.DEFAULT_WAM_INDEX_ROWS\n );\n }", "@Test\n public void shouldReturnUserCabinetViewAndSessionWithExpectedAttributes_whenPassRequestWithNumberPage() throws Exception\n {\n Principal principal = Mockito.mock(Principal.class);\n Mockito.when(principal.getName()).thenReturn(\"login\");\n List<Order> expectedResult = Collections.singletonList(new Order());\n MockHttpSession session = new MockHttpSession();\n session.setAttribute(\"usersOrders\", new PagedListHolder<>());\n Mockito.when(userServiceMock.getUsersOrders(\"login\"))\n .thenReturn(expectedResult);\n mockMvc.perform(MockMvcRequestBuilders.get(\"/user/1\").session(session).principal(principal))\n .andExpect(MockMvcResultMatchers.view().name(\"user_cabinet\"));\n Assert.assertNotNull(session.getAttribute(\"usersOrders\"));\n }", "@Test(groups ={Slingshot,Regression})\n\tpublic void VerifyManageUserLinkNavigation() {\n\t\tReport.createTestLogHeader(\"MuMv\", \"Verify MumV Navigation Links Manage user page\");\n\n\t\tUserProfile userProfile = new TestDataHelper().getUserProfile(\"MuMvAddnewStdUser\");\n\t\tnew LoginAction()\n\t\t.BgbnavigateToLogin()\n\t\t.BgbloginDetails(userProfile);\n\t\tnew MultiUserMultiViewAction()\n\t\t.ClickManageUserLink()\n\t\t.verifyWhatisthisOverlay()\n\t\t.ManageUserNavigationVerificationLinks(); \t \t \t\n\t}", "public void testFormBackingObject(UserSession us, String nextPageCode, String prePageCode){\n if(null != nextPageCode && !\"\".equals(nextPageCode)){\n request.setParameter(\"nextPageCode\", nextPageCode);\n }\n if(null != prePageCode && !\"\".equals(prePageCode)){\n request.setParameter(\"prePageCode\", prePageCode);\n }\n request.getSession().setAttribute(\"userSession\", us);\n try {\n MockForRetrieveCollectionList();\n reportForm = (ReportForm) reportController.formBackingObject(request);\n } catch (ModelAndViewDefiningException e) {\n System.out.println(\"execute method formBackingObject take ModelAndViewDefiningException: \" + e);\n } catch (Exception e) {\n System.out.println(\"execute method formBackingObject take exception: \" + e);\n }\n }", "public void setNextHandler(Handler nextHandler) {\n\t\tthis.nextHandler = nextHandler;\n\t}", "void visit(User user);", "@Test(priority=1)\n\tpublic void LoginPageTest() {\n\t\tloginpage.testLogin();\n\t\t\n\t}", "@Test\n public void testGetUSerHomeViewModel() throws Exception{\n for(User currentUser: userServiceLayer.getAllUsers(Integer.MAX_VALUE, 0)){\n userServiceLayer.deleteUser(currentUser.getId());\n }\n \n List<User> users = createTestUsers(15);\n \n UserHomeViewModel userHomeViewModel = userWebServices.getUSerHomeViewModel(5, 0, 5);\n \n assert userHomeViewModel.getUsers().size()==5;\n assert userHomeViewModel.getPageNumber() == 1;\n \n assert userHomeViewModel.getPageNumbers().size() == 5;\n \n assert userHomeViewModel.getPageNumbers().get(1) == 2;\n assert userHomeViewModel.getPageNumbers().get(4) == 5;\n \n int count = 0;\n for(UserViewModel userViewModel: userHomeViewModel.getUsers()){\n assert(\"Tephon\"+count).equals(userViewModel.getUsername());\n assert(\"password\"+count).equals(userViewModel.getPassword()); \n \n User sameUser = users.get(count);\n User user = userServiceLayer.getUser(sameUser.getId());\n \n assert user.getId() == userViewModel.getId();\n assert user.getUsername().equals(userViewModel.getUsername());\n assert user.getPassword().equals(userViewModel.getPassword());\n\n count++; \n }\n }", "@Test\n\tpublic void testGetReturnsLastNext() {\n\t\tSmartScriptLexer lexer = new SmartScriptLexer(\"\");\n\t\t\n\t\tSmartScriptToken token = lexer.nextToken();\n\t\tassertEquals(token, lexer.getToken(), \"getToken returned different token than nextToken.\");\n\t\tassertEquals(token, lexer.getToken(), \"getToken returned different token than nextToken.\");\n\t}", "@Test\n public void processRegistration() throws Exception {\n String newUserName = \"goodusername\";\n long numberOfExpectedUsers = userRepository.count() + 1;\n mockMvc.perform(post(RegistrationController.BASE_URL)\n .contentType(MediaType.APPLICATION_FORM_URLENCODED)\n .param(userNameField, newUserName)\n .param(passwordField, samplePasswordValue)\n .param(verifyPasswordField, samplePasswordValue))\n .andExpect(view().name(SearchController.REDIRECT + IndexController.URL_PATH_SEPARATOR))\n .andExpect(status().is3xxRedirection());\n long updatedNumberOfUsers = userRepository.count();\n assertEquals(numberOfExpectedUsers, updatedNumberOfUsers);\n }", "@Test(priority = 1)\n\tpublic void homePageRedirection() {\n\t\tlogger = extent.startTest(\"Flight Booking\");\n\t\tlog.info(\"Starting Redirection validation\");\n\t\thome.isRedirectionCorrect();\n\t\tlog.info(\"Redirection is on the correct page\");\n\t\tlog.info(\"Starting the homepage testing\");\n\t}", "@Test\n\tpublic void Test_LoginTest_() throws InterruptedException {\n\t\tnew LoginPage().registerNow();\n\t}", "protected abstract ResponseEntity<T> doRequest(String nextHref, RestTemplate template,\n HttpEntity<?> requestEntity);", "@Test\n public void SignInTest() throws InterruptedException {\n LoginTC login = new LoginTC(driver);\n login.LoginTest();\n\n SignInPagePO signInPage = new SignInPagePO(driver);\n\n\n //Step 1: Click On Users\n Assert.assertEquals(signInPage.clickUsers(), true,\"Opps!! unable to click Users\");\n\n //Step 2 :: Click On Managers\n\n Assert.assertEquals(signInPage.clickManagers(), true,\"Opps!! unable to click Managers\");\n\n //Step 3: Click On addmanager\n\n Assert.assertEquals(signInPage.clickAddmanager(), true,\"Opps!! unable to click addmanager\");\n\n //Step 1 :: Enter valid Username\n\n String firstname=\"testname\";\n Assert.assertEquals(signInPage.enterfirstName(firstname), true,\"Opps!! unable to enter first name\");\n\n //Step 1 :: Enter valid Username\n String lastname=\"testlastname\";\n Assert.assertEquals(signInPage.enterlasttName(lastname), true,\"Opps!! unable to enter last name\");\n\n\n }", "@Test\n public void _1passwordUrlTest() {\n // TODO: test _1passwordUrl\n }", "public ActionForward handleRequest( UserRequest request )\n throws IOException, ServletException\n {\n int pageNumber = request.getParameterAsInt( PAGE_KEY, 1 );\n ActionErrors errors = new ActionErrors();\n /*\n java.util.Enumeration enum = request.getParameterNames();\n while(enum.hasMoreElements()){\n String key = (String)enum.nextElement();\n String[] paramValues = request.getParameterValues(key);\n log.debug(\"request params\");\n for(int i=0;i < paramValues.length;i++){\n log.debug(key + \" : \" + paramValues[i]);\n }\n } \n */ \n if( buttonPressed( request, BUTTON_NEXT ) )\n {\n log.debug(\"Processing next button\");\n if (validatePage( request, pageNumber, BUTTON_NEXT ) )\n {\n log.debug(\"Showing next page\");\n onBeforeDisplayEvent( request, pageNumber, BUTTON_NEXT );\n return nextPage( request );\n }\n else\n {\n log.debug(\"Showing current page\");\n saveErrors(request);\n return currentPage( request );\n }\n }\n else if (buttonPressed( request, BUTTON_BACK ) )\n {\n log.debug(\"Processing back button\");\n if( validatePage( request, pageNumber, BUTTON_BACK ) )\n {\n log.debug(\"Showing previous page\");\n onBeforeDisplayEvent( request, pageNumber, BUTTON_BACK );\n return previousPage( request );\n }\n else\n {\n log.debug(\"Showing current page\");\n saveErrors(request);\n return currentPage( request );\n }\n \n }\n else if (buttonPressed( request, BUTTON_CREATE ) )\n {\n log.debug(\"Processing create button\");\n if( validatePage( request, pageNumber, BUTTON_CREATE ) )\n {\n log.debug(\"Processing create button\");\n return processCreate( request );\n }\n else\n {\n log.debug(\"Showing current page\");\n saveErrors(request);\n return currentPage( request );\n }\n }\n else if (buttonPressed( request, BUTTON_CANCEL ) )\n {\n log.debug(\"Processing cancel button\");\n return processCancel( request );\n }\n else\n {\n log.debug(\"Processing unknown button\");\n return processUnknownButton( request );\n }\n }", "@Test\n public void testNextAndPrevious() throws Exception {\n\n driver.get(baseUrl + \"/computerdatabase/computers?page-number=1&lang=en\");\n\n driver.findElement(By.xpath(\"//li[contains(@class, 'active')]/a[text()='1']\"));\n\n driver.findElement(By.linkText(\"Next\")).click();\n driver.findElement(By.xpath(\"//li[contains(@class, 'active')]/a[text()='2']\"));\n\n try {\n driver.findElement(By.xpath(\"//li[contains(@class, 'active')]/a[text()='1']\"));\n fail();\n } catch (NoSuchElementException e) {\n assertTrue(true);\n }\n\n driver.findElement(By.linkText(\"Previous\")).click();\n driver.findElement(By.xpath(\"//li[contains(@class, 'active')]/a[text()='1']\"));\n try {\n driver.findElement(By.xpath(\"//li[contains(@class, 'active')]/a[text()='2']\"));\n fail();\n } catch (NoSuchElementException e) {\n assertTrue(true);\n }\n }", "@Test\n public void testGetFollowing_returnsServiceResult() throws IOException {\n Assertions.assertEquals(response, presenter.post(request));\n }", "@Override\n\tpublic String step0(RequestContext context) {\n\t\tUserEntity user = (UserEntity) context.getFlashScope().get(\"userSession\");\n\t\t//check\n\t\tassertNotNull(user);\n\t\t\n\t\t//log\n\t\tlogger.debug(\"User flashScope is \"+user.getUsername());\n\t\t\n\t\t//redirect to next state\n\t\treturn \"step1\";\n\t}", "@Test\n void simpleBddTest(){\n given()\n .baseUri(\"https://reqres.in/api\")\n .basePath(\"/users?page=2\")\n\n //когда система\n .when().get()\n\n .then().statusCode(200)\n .and().header(\"Content-Type\", \"application/json; charset=utf-8\");\n }", "public void testGetNextFinishButtonEnabled() {\n System.out.println(\"getNextFinishButtonEnabled\");\n Wizard instance = new Wizard();\n boolean expResult = false;\n boolean result = instance.getNextFinishButtonEnabled();\n assertEquals(expResult, result);\n }", "@Given(\"^user is on the login page$\")\n public void userIsOnTheLoginPage() throws Throwable {\n }", "@Test\n public void testReferRequest() {\n // TODO: test ReferRequest\n }", "@Test\r\n public void login() throws ServletException, IOException {\r\n\r\n }", "@Then(\"^I should go to the next page$\")\n public void iShouldGoToTheNextPage() throws Throwable {\n driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n second = new SecondPage(driver);\n second.isPageOpened();\n driver.close();\n //throw new PendingException();\n }", "@Test\n public void nextTest() {\n this.it.next();\n this.it.next();\n assertThat(\"work3\", is(this.it.next()));\n }", "public void testService() {\n\n\t\ttry {\n\t\t\tString nextAction = \"next action\";\n\t\t\trequest.setAttribute(\"NEXT_ACTION\", nextAction);\n\t\t\tString nextPublisher = \"next publisher\";\n\t\t\trequest.setAttribute(\"NEXT_PUBLISHER\", nextPublisher);\n\t\t\tString expertQueryDisplayed = \"expert query displayed\";\n\t\t\trequest.setAttribute(\"expertDisplayedForUpdate\", expertQueryDisplayed);\n\t\t\tupdateFieldsForResumeAction.service(request, response);\n\t\t\tassertEquals(nextAction, response.getAttribute(\"NEXT_ACTION\"));\t\t\n\t\t\tassertEquals(nextPublisher, response.getAttribute(\"NEXT_PUBLISHER\"));\n\t\t\tassertEquals(expertQueryDisplayed, singleDataMartWizardObj.getExpertQueryDisplayed());\n\t\t\t\n\t\t} catch (SourceBeanException e) {\n\t\t\te.printStackTrace();\n\t\t\tfail(\"Unaspected exception occurred!\");\n\t\t}\n\t\t\n\t}", "@Test\n @PactVerification(fragment=\"pactGetAllUsers\")\n public void runTest() {\n RestAssured\n .given()\n .port(randomPort.getPort())\n .contentType(ContentType.JSON)\n .get(\"/users\")\n .then()\n .statusCode(200)\n .assertThat()\n .body(\"userId\", Matchers.equalTo(100))\n .and()\n .body(\"name\", Matchers.equalTo(\"pramik\"))\n .and()\n .body(\"address\", Matchers.isA(String.class));\n \n }", "@Test\r\n public void testDoGet() throws IOException, ServletException {\r\n /* Create the fake list of events */\r\n Conversation fakeConversation = new Conversation(\r\n UUID.randomUUID(), UUID.randomUUID(), \r\n \"test_conversation\", Instant.now());\r\n\r\n Message fakeMessage = new Message(\r\n UUID.randomUUID(), UUID.randomUUID(), \r\n UUID.randomUUID(), \"test_message\", Instant.now());\r\n\r\n User fakeUser = new User(\r\n UUID.randomUUID(), \"test_user\", \r\n \"test_user_PHash\", Instant.now(), \r\n \"test_user_bio\");\r\n\r\n /* \r\n * Use the doGet function in the activity servlet with the \r\n * parameters mockRequest and mockResponse (both initialized \r\n * in setup()). \r\n */\r\n activityServlet.doGet(mockRequest, mockResponse);\r\n\r\n /* \r\n * NOTE: Essentially when we use verify we are saying\r\n * \"make sure that this function actually did this\"\r\n */\r\n\r\n\r\n /*\r\n * Verify that we our we forwarded the request to \r\n * the activity.jsp file\r\n */\r\n Mockito.verify(mockRequestDispatcher)\r\n .forward(mockRequest, mockResponse);\r\n }", "String nextLink();", "@Test\n public void testUserNotifiedOnRegistrationSubmission() throws Exception {\n ResponseEntity<String> response = registerUser(username, password);\n assertNotNull(userService.getUser(username));\n assertEquals(successUrl, response.getHeaders().get(\"Location\").get(0));\n }", "@Test\n public void fetchUser() {\n openActionBarOverflowOrOptionsMenu(getInstrumentation().getTargetContext());\n\n //Click search\n onView(withText(R.string.fetch_user))\n .perform(click());\n\n }", "@Test\r\n public void testGetNeedsLoginURLOverride() throws Exception {\r\n when(ctx.getString(\"annotator.test.user.email\")).thenReturn(\"\");\r\n when(ctx.getString(\"annotator.test.user.name\")).thenReturn(\"\");\r\n when(ctx.getString(\"annotator.test.user.notest\")).thenReturn(\"true\");\r\n \r\n when(request.getScheme()).thenReturn(\"http\");\r\n when(request.getServerName()).thenReturn(\"someserver\");\r\n when(request.getServerPort()).thenReturn(1234);\r\n when(request.getContextPath()).thenReturn(\"annotator\");\r\n \r\n when(ctx.getString(\"oauth2.google.auth.uri\")).thenReturn(\"https://accounts.google.com/o/oauth2/auth\");\r\n when(ctx.getString(\"oauth2.google.client.id\")).thenReturn(\"super-special-client-id\");\r\n when(ctx.getString(\"oauth2.google.scope\")).thenReturn(\"da-scope\");\r\n \r\n when(session.getAttribute(\"user.email\")).thenReturn(\"\");\r\n when(session.getAttribute(\"user.fullname\")).thenReturn(\"\");\r\n \r\n when(request.getSession(true)).thenReturn(session);\r\n when(request.getRequestURL()).thenReturn(new StringBuffer(\"http://my-test-server.testing.com:5678/annotator/home\"));\r\n when(request.getScheme()).thenReturn(\"http\");\r\n when(request.getServerName()).thenReturn(\"my-test-server.testing.com\");\r\n when(request.getServerPort()).thenReturn(5678);\r\n when(request.getContextPath()).thenReturn(\"annotator\");\r\n \r\n servlet.doGet(request, response);\r\n \r\n assertTrue(StringUtils.isBlank(outputBuf.toString()));\r\n \r\n verify(response).setStatus(HttpServletResponse.SC_SEE_OTHER);\r\n verify(response).setHeader(matches(\"Location\"), startsWith(\"https://accounts.google.com/o/oauth2/auth\"));\r\n verify(response).setHeader(matches(\"Location\"), contains(\"my-test-server.testing.com\"));\r\n verify(response).setHeader(matches(\"Location\"), contains(\"5678\"));\r\n verify(response, never()).setHeader(matches(\"Location\"), contains(\"test.localhost\"));\r\n verify(response, never()).setHeader(matches(\"Location\"), contains(\"1234\"));\r\n }" ]
[ "0.627551", "0.6135847", "0.5901877", "0.58791", "0.5828941", "0.5737461", "0.5734102", "0.57271683", "0.5702121", "0.5587356", "0.5533765", "0.55155617", "0.5461586", "0.54372025", "0.53973293", "0.5393885", "0.5392592", "0.5350792", "0.53484464", "0.52942634", "0.5289302", "0.52870953", "0.52861595", "0.5284069", "0.52788013", "0.52694744", "0.52449876", "0.5242581", "0.52380097", "0.5202049", "0.5199311", "0.51948094", "0.51921064", "0.51805687", "0.5177935", "0.51749396", "0.5164009", "0.5153881", "0.51536644", "0.5151493", "0.51448804", "0.51447", "0.513339", "0.5120108", "0.5115714", "0.5109016", "0.510022", "0.5097242", "0.5091905", "0.50909865", "0.50626034", "0.5056792", "0.5049578", "0.5045422", "0.50195575", "0.50144947", "0.5013315", "0.5010395", "0.49999616", "0.49989924", "0.49987778", "0.49869242", "0.49848667", "0.49757475", "0.49721247", "0.49689785", "0.49593917", "0.49593574", "0.4941991", "0.49416786", "0.49332467", "0.49322262", "0.49292612", "0.49269733", "0.49253365", "0.4916653", "0.49098712", "0.49077854", "0.49073103", "0.4903218", "0.489966", "0.48908615", "0.48885268", "0.48830676", "0.48823416", "0.488091", "0.48801675", "0.48794478", "0.48794228", "0.48758483", "0.48744175", "0.48687267", "0.48686987", "0.48619995", "0.48615444", "0.48562282", "0.48517558", "0.48459196", "0.4842369", "0.48404247" ]
0.62791413
0
write your code here
public static void main(String[] args) { int n=1; for(System.out.print('a');n<=3;System.out.print('c'),n++){ System.out.print('b'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void logic(){\r\n\r\n\t}", "public static void generateCode()\n {\n \n }", "@Override\n\tprotected void logic() {\n\n\t}", "private static void cajas() {\n\t\t\n\t}", "void pramitiTechTutorials() {\n\t\n}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "public void ganar() {\n // TODO implement here\n }", "public static void main(String[] args) {\n // write your code here - this is called comment and it always starts with double slash\n // and comlier will ignore this because of the // sign.\n // I am gonna say hello\n // JAVA IS CASE SENSITIVE LANGUAGE\n // System and system are very different things in java\n //Hello AND hello are different for java\n // System.out.println(\"Hello Batch 15!\");\n // System.out.println(\"I am still here.\");\n // System.out.println(\"I love Java.\");\n\n // Write a program to display your information.\n // When you run it, it should have this outcome.\n // I am your name here\n // I am from batch 15\n // I am from your city here\n // I love Java\n\n System.out.println(\"I am Sevim.\");\n System.out.println(\"I am from Batch 15.\");\n System.out.println(\"I'm from New Jersey.\");\n System.out.println(\"I love Java.\");\n\n\n\n }", "CD withCode();", "private stendhal() {\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "public void gored() {\n\t\t\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\r\n\tpublic void runn() {\n\t\t\r\n\t}", "public void genCode(CodeFile code) {\n\t\t\n\t}", "public void hello(){\n\t\t\r\n \t\r\n\t\t\r\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "public void baocun() {\n\t\t\n\t}", "public void mo38117a() {\n }", "public void furyo ()\t{\n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "private void strin() {\n\n\t}", "public void themesa()\n {\n \n \n \n \n }", "Programming(){\n\t}", "@Override\n\tvoid output() {\n\t\t\n\t}", "private void yy() {\n\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "void rajib () {\n\t\t \n\t\t System.out.println(\"Rajib is IT Eng\");\n\t }", "private void kk12() {\n\n\t}", "public void edit() {\n\t\tSystem.out.println(\"编写java笔记\");\r\n\t}", "public static void main(String[] args) {\n\t// write your code here\n }", "private static void ThridUmpireReview() {\n\t\tSystem.out.println(\" Umpier Reviews the Score Board\");\n\t\t \n\t\t\n\t}", "@Override\r\n\t\tpublic void doDomething() {\r\n\t\t\tSystem.out.println(\"I am here\");\r\n\t\t\t\r\n\t\t}", "protected void mo6255a() {\n }", "public void gen(CodeSeq code, ICodeEnv env) {\n\r\n\t}", "@Override\n\tpublic void function() {\n\t\t\n\t}", "public void working()\n {\n \n \n }", "@Override\n\tprotected void postRun() {\n\n\t}", "public void perder() {\n // TODO implement here\n }", "public void smell() {\n\t\t\n\t}", "protected void execute() {\n\t\t\n\t}", "public void mo55254a() {\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tpublic void orgasm() {\n\t\t\n\t}", "public void cocinar(){\n\n }", "@Override\r\n\tvoid func04() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}", "@Override\n\tprotected void interr() {\n\t}", "public void run() {\n\t\t\t\t\n\t\t\t}", "protected void execute() {\n\n\n \n }", "@Override\n public void execute() {\n \n \n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\r\n\tpublic void crawl_data() {\n\t\t\r\n\t}", "@Override\n public void memoria() {\n \n }", "public static void main(String args[]) throws Exception\n {\n \n \n \n }", "@Override\r\n\tpublic void code() {\n\t\tus.code();\r\n\t\tSystem.out.println(\"我会java...\");\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "protected void display() {\n\r\n\t}", "private void sout() {\n\t\t\n\t}", "private static void oneUserExample()\t{\n\t}", "public void nhapdltextlh(){\n\n }", "public void miseAJour();", "protected void additionalProcessing() {\n\t}", "private void sub() {\n\n\t}", "@Override\n\tpublic void view() {\n\t\t\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void engine() {\r\n\t\t// TODO Auto-generated method stub\t\t\r\n\t}", "@Override\r\n\tpublic void code() {\n\t\tSystem.out.println(\"我会C语言....\");\r\n\t}", "void mo67924c();", "@Override\n\tpublic void dosomething() {\n\t\t\n\t}", "@Override\r\n public void run() {\n basicEditor.createEdge(); // replaced Bibianas method with Moritz Roidl, Orthodoxos Kipouridis\r\n }", "public void mo5382o() {\n }", "@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void doF6() {\n\t\t\r\n\t}", "public void mo3376r() {\n }", "public static void main(String[] args)\r\n {\n System.out.println(\"Mehedi Hasan Nirob\");\r\n //multiple line comment\r\n /*\r\n At first printing my phone number\r\n then print my address \r\n then print my university name\r\n */\r\n System.out.println(\"01736121659\\nJamalpur\\nDhaka International University\");\r\n \r\n }", "void kiemTraThangHopLi() {\n }", "public void skystonePos5() {\n }", "public final void cpp() {\n }", "public final void mo51373a() {\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(\"This is the main class of this project\");\r\n\t\tSystem.out.println(\"how about this\");\r\n\r\n\t\t\r\n\t\tSystem.out.println(\"new push\");\r\n\r\n\t\t//how to update this line\r\n\t\t\r\n\t\tSystem.out.println(\"hello there\");\r\n\r\n\t\tSystem.out.println(\"zen me shuoXXXXXXXXXXXKKKKkKKKKKKXXXXXXXX\");\r\n\r\n\t\tSystem.out.println(\"eventually we succeeded!\");\r\n\t\t//wa!!!\r\n\t\t\r\n\r\n\r\n\t\t//hen shu fu !\r\n\t\t\r\n\t\t//it is a good day\r\n\t\t\r\n\t\t//testing\r\n\r\n\t\t\r\n\t\tSystem.out.println(\"hope it works\");\r\n\t\t\r\n\r\n\t\t\r\n\r\n\t}", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}" ]
[ "0.61019534", "0.6054925", "0.58806974", "0.58270746", "0.5796887", "0.56999695", "0.5690986", "0.56556827", "0.5648637", "0.5640487", "0.56354505", "0.56032085", "0.56016207", "0.56006724", "0.5589654", "0.5583692", "0.55785793", "0.55733466", "0.5560209", "0.55325305", "0.55133164", "0.55123806", "0.55114794", "0.5500045", "0.5489272", "0.5482718", "0.5482718", "0.5477585", "0.5477585", "0.54645246", "0.5461012", "0.54548836", "0.5442613", "0.5430592", "0.5423748", "0.5419415", "0.5407118", "0.54048806", "0.5399331", "0.539896", "0.5389593", "0.5386248", "0.5378453", "0.53751254", "0.5360644", "0.5357343", "0.5345515", "0.53441405", "0.5322276", "0.5318302", "0.53118485", "0.53118485", "0.53085434", "0.530508", "0.53038436", "0.5301922", "0.5296964", "0.52920514", "0.52903354", "0.5289583", "0.5287506", "0.52869135", "0.5286737", "0.5286737", "0.5286737", "0.5286737", "0.5286737", "0.5286737", "0.5286737", "0.52859664", "0.52849185", "0.52817136", "0.52791214", "0.5278664", "0.5278048", "0.5276269", "0.52728665", "0.5265451", "0.526483", "0.526005", "0.5259683", "0.52577406", "0.5257731", "0.5257731", "0.52560073", "0.5255759", "0.5255707", "0.5250705", "0.5246863", "0.5243053", "0.52429926", "0.5242727", "0.52396125", "0.5239378", "0.5232576", "0.5224529", "0.52240705", "0.52210563", "0.52203166", "0.521787", "0.52172214" ]
0.0
-1
Return the country name by the code Alpha2 or Alpha3. Ex IE or IRL for Ireland
public String getCoutryName(String code) { String countryName = code; if (code.length() == 3) { countryName = jsonCountryAlpha3.getString(code); } else if (code.length() == 2) { countryName = jsonCountryAlpha2.getString(code); } if (countryName == null) { return code; } return countryName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getCountryName();", "private String getCountryName(String name)\r\n {\r\n }", "java.lang.String getCountryCode();", "java.lang.String getCountryCode();", "java.lang.String getCountry();", "java.lang.String getCountry();", "String toAlpha2(final String iso3166Alpha3);", "String getCountryCode();", "String toAlpha3(final String iso3166Alpha2);", "private String getCountry(int countryCode) {\n switch (countryCode) {\n case 1:\n return countryName = \"Korea\";\n case 2:\n return countryName = \"England\";\n case 3:\n return countryName = \"France\";\n default:\n return \"Error\";\n }\n }", "public static String getCountry(final String rfcLocale) {\n return rfcLocale.contains(DASH)\n ? rfcLocale.toUpperCase(Locale.ENGLISH).substring(3)\n : \"\";\n }", "public String getCountryName();", "private String countryCode(String address) {\n\t\tint j = address.lastIndexOf('.') + 1;\n\t\tString cc = address.substring(j);\n\t\treturn cc.toLowerCase();\n\t}", "private String getCountry(String id) {\n\t\tif(Utility.keyLevel(id) == 0 ) // It's a country\n\t\t\treturn id;\n\t\telse if(Utility.keyLevel(id) == -1 ) // ZZZ\n\t\t\t return id;\n\t\telse {\n\t\t\t// It's higher admin than level 0. We need to find the country the code is in\n\t\t\tString ctrcode = GeographicMapper.getAlpha3(id.substring(0, 2));\n\t\t\treturn ctrcode;\n\t\t}\n\t}", "public String getCountryCode() {\n return normalizedBic.substring(COUNTRY_CODE_INDEX, COUNTRY_CODE_INDEX + COUNTRY_CODE_LENGTH);\n }", "public java.lang.CharSequence getCountry() {\n return country;\n }", "public java.lang.CharSequence getCountry() {\n return country;\n }", "public static String getISO3Country(String localeID) {\n/* 477 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public static String m21399d(Context context) {\n String str = \"\";\n try {\n TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(\"phone\");\n if (telephonyManager != null) {\n str = telephonyManager.getSimCountryIso().toUpperCase();\n }\n } catch (Exception e) {\n C5205o.m21464a((Throwable) e);\n }\n return TextUtils.isEmpty(str) ? Locale.getDefault().getCountry().toString().toUpperCase() : str;\n }", "public String getCountryName(){\n\t\treturn (String)this.entryMap.get(ObjectGeoKeys.OBJ_GEO_COUNTRY_NAME);\n\t}", "public java.lang.String getCountry() {\n java.lang.Object ref = country_;\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 country_ = s;\n }\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public interface CountryIsoConverter {\n\n /**\n * <p> Converts an ISO 3166 alpha-2 country code to ISO 3166 alpha-3.\n * Example: toAlpha3(\"DE\") would result in \"DEU\".\n * </p>\n * \n * @since 1.8\n * @param iso3166Alpha2 the ISO 3166 alpha-2 country code\n * @return the ISO 3166 alpha-3 conversion of the parameter\n * @throws NullPointerException if parameter iso3166Alpha2 is null\n * @throws IllegalArgumentException if parameter iso3166Alpha2 is not in ISO 3166 alpha-2\n * @throws IsoConversionException if no alpha-3 code is known for the given alpha-2 code\n */\n String toAlpha3(final String iso3166Alpha2);\n\n /**\n * <p> Converts an ISO 3166 alpha-3 country code to ISO 3166 alpha-2.\n * Example: toAlpha2(\"DEU\") would result in \"DE\".\n * </p>\n * \n * @since 1.8\n * @param iso3166Alpha3 the ISO 3166 alpha-3 country code\n * @return the ISO 3166 alpha-2 conversion of the parameter\n * @throws NullPointerException if parameter iso3166Alpha3 is null\n * @throws IsoConversionException if no alpha-2 code is known for the given alpha-3 code\n */\n String toAlpha2(final String iso3166Alpha3);\n\n}", "public java.lang.String getCountry() {\n java.lang.Object ref = country_;\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 country_ = s;\n }\n return s;\n }\n }", "Country getCountry();", "@DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 13:00:06.410 -0500\", hash_original_method = \"BFC255CAA5852747525F7A463403B75F\", hash_generated_method = \"5E246E1D734705125312F8B71BE424A7\")\n \nprivate String getCountryNameForNumber(PhoneNumber number, Locale language) {\n String regionCode = phoneUtil.getRegionCodeForNumber(number);\n return (regionCode == null || regionCode.equals(\"ZZ\"))\n ? \"\" : new Locale(\"\", regionCode).getDisplayCountry(language);\n }", "public String getCountryCode()\r\n\t{\r\n\t\treturn this.countryCode;\r\n\t}", "com.google.protobuf.ByteString\n getCountryNameBytes();", "public int findCountry(String input) {\n\t\tinput = input.toLowerCase();\n\t\tint output = -1;\n\t\tfor(int i=0; i<Constants.NUM_COUNTRIES; i++) {\n\t\t\tif(Constants.COUNTRY_NAMES[i].toLowerCase().startsWith(input)==true || Constants.COUNTRY_NAMES[i].toLowerCase().replaceAll(\" \", \"\").startsWith(input)==true) {\n\t\t\t\tif(output==-1) {\n\t\t\t\t\toutput=i;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn -2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t}", "public Country findByIso2(String iso2);", "List<GenericTypedGrPostal> getCountryNames();", "public String getISO3Country() {\n/* 467 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "@JsonGetter(\"countryCodeA3\")\r\n public String getCountryCodeA3 ( ) { \r\n return this.countryCodeA3;\r\n }", "public String getCountryName() {\n return countryName;\n }", "public String getCountryName() {\n return countryName;\n }", "public String getCountryName() {\n return countryName;\n }", "public String countryCode() {\n return countryCode;\n }", "public java.lang.String getCountryCode() {\n return countryCode;\n }", "public String getCountry() {\n Scanner scanner = new Scanner(System.in);\n\n // Tell User to enter two digit state\n System.out.println(\"Enter two digit country: \");\n\n // Get the two digit state\n String country = scanner.next();\n\n System.out.print(\"You entered: \" + country);\n\n return country;\n\n }", "public java.lang.String getCountry () {\n\t\treturn country;\n\t}", "public String getcountryCode() {\n return countryCode;\n }", "String getAbbr();", "public String getCountryCode() {\n return countryCode;\n }", "public String getCountryCode() {\n return countryCode;\n }", "public java.lang.String getCountryName() {\n java.lang.Object ref = countryName_;\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 countryName_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public Country findByName(String name);", "public final EObject ruleCountry() throws RecognitionException {\r\n EObject current = null;\r\n\r\n Token otherlv_1=null;\r\n AntlrDatatypeRuleToken lv_name_2_0 = null;\r\n\r\n\r\n\r\n \tenterRule();\r\n\r\n try {\r\n // InternalEsportDsl.g:1236:2: ( ( () otherlv_1= 'Country' ( (lv_name_2_0= ruleEString ) ) ) )\r\n // InternalEsportDsl.g:1237:2: ( () otherlv_1= 'Country' ( (lv_name_2_0= ruleEString ) ) )\r\n {\r\n // InternalEsportDsl.g:1237:2: ( () otherlv_1= 'Country' ( (lv_name_2_0= ruleEString ) ) )\r\n // InternalEsportDsl.g:1238:3: () otherlv_1= 'Country' ( (lv_name_2_0= ruleEString ) )\r\n {\r\n // InternalEsportDsl.g:1238:3: ()\r\n // InternalEsportDsl.g:1239:4: \r\n {\r\n\r\n \t\t\t\tcurrent = forceCreateModelElement(\r\n \t\t\t\t\tgrammarAccess.getCountryAccess().getCountryAction_0(),\r\n \t\t\t\t\tcurrent);\r\n \t\t\t\r\n\r\n }\r\n\r\n otherlv_1=(Token)match(input,22,FOLLOW_4); \r\n\r\n \t\t\tnewLeafNode(otherlv_1, grammarAccess.getCountryAccess().getCountryKeyword_1());\r\n \t\t\r\n // InternalEsportDsl.g:1249:3: ( (lv_name_2_0= ruleEString ) )\r\n // InternalEsportDsl.g:1250:4: (lv_name_2_0= ruleEString )\r\n {\r\n // InternalEsportDsl.g:1250:4: (lv_name_2_0= ruleEString )\r\n // InternalEsportDsl.g:1251:5: lv_name_2_0= ruleEString\r\n {\r\n\r\n \t\t\t\t\tnewCompositeNode(grammarAccess.getCountryAccess().getNameEStringParserRuleCall_2_0());\r\n \t\t\t\t\r\n pushFollow(FOLLOW_2);\r\n lv_name_2_0=ruleEString();\r\n\r\n state._fsp--;\r\n\r\n\r\n \t\t\t\t\tif (current==null) {\r\n \t\t\t\t\t\tcurrent = createModelElementForParent(grammarAccess.getCountryRule());\r\n \t\t\t\t\t}\r\n \t\t\t\t\tset(\r\n \t\t\t\t\t\tcurrent,\r\n \t\t\t\t\t\t\"name\",\r\n \t\t\t\t\t\tlv_name_2_0,\r\n \t\t\t\t\t\t\"org.xtext.example.mydsl1.EsportDsl.EString\");\r\n \t\t\t\t\tafterParserOrEnumRuleCall();\r\n \t\t\t\t\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n\r\n \tleaveRule();\r\n\r\n }\r\n\r\n catch (RecognitionException re) {\r\n recover(input,re);\r\n appendSkippedTokens();\r\n }\r\n finally {\r\n }\r\n return current;\r\n }", "public static String getCountryName(int countryId){\n String userCountry;\n switch (countryId){\n case 1:\n userCountry = \"India\";\n break;\n case 2:\n userCountry = \"Italy\";\n break;\n case 3:\n userCountry = \"Germany\";\n break;\n default:\n userCountry = null;\n }\n return userCountry;\n }", "public String getCountryCode() {\r\n return (String) getAttributeInternal(COUNTRYCODE);\r\n }", "static Country getByNumber(Context context, List<Country> preferredCountries, String fullNumber) {\n int firstDigit;\n if (fullNumber.length() != 0) {\n if (fullNumber.charAt(0) == '+') {\n firstDigit = 1;\n } else {\n firstDigit = 0;\n }\n Country country;\n for (int i = firstDigit; i < firstDigit + 4; i++) {\n String code = fullNumber.substring(firstDigit, i);\n country = getByCode(context, preferredCountries, code);\n if (country != null) {\n return country;\n }\n }\n }\n return null;\n }", "public static String getCountry(String localeID) {\n/* 284 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public Country findByCode(String code);", "public String getCountryLink(){\n\t\treturn (String)this.entryMap.get(GeoKeys.LOCAL_GEO_COUNTRY_LINK);\n\t}", "public String getCountryCode() {\n return countryCode_;\n }", "public StrColumn getCountry() {\n return delegate.getColumn(\"country\", DelegatingStrColumn::new);\n }", "public String getCountryCode() {\n\t\treturn countryCode;\n\t}", "public String getCountryFeature() {\n\n return (String) this.getAdditionalTagValue(\n GeographicErrorTest.MAPPED_FEATURE_TAG_ID, BGConcepts.COUNTRY);\n }", "static Predicate<Beer> countryQuery(String countryName) {\n return b -> b.country.equals(countryName);\n }", "public static void countryName (){\n System.out.println(\"Enter a country domain\");\n Scanner input = new Scanner(System.in);\n String userInput = input.nextLine();\n userInput = userInput.toLowerCase();\n\n switch (userInput) {\n case \"us\":\n System.out.println(\"United States\");\n break;\n case \"de\":\n System.out.println(\"Germany\");\n break;\n case \"hu\":\n System.out.println(\"Hungary:\");\n break;\n default:\n System.out.println(\"Unknown\");\n }\n\n }", "public final String getCountry() {\n\t\treturn country;\n\t}", "public void setCountry(java.lang.CharSequence value) {\n this.country = value;\n }", "public static String getDisplayCountry(String localeID, String displayLocaleID) {\n/* 636 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public void setCountryName(String value);", "boolean hasCountryCode();", "boolean hasCountryCode();", "public java.lang.String getCountry() {\n return Country;\n }", "com.google.protobuf.ByteString\n getCountryCodeBytes();", "com.google.protobuf.ByteString\n getCountryCodeBytes();", "public String getCountryCode() {\n return (String)getAttributeInternal(COUNTRYCODE);\n }", "public String getCountryCode() {\n return (String)getAttributeInternal(COUNTRYCODE);\n }", "@Override\n\tpublic String toString() {\n\t\treturn super.country;\n\t}", "public String getCountry() {\n return (String)getAttributeInternal(COUNTRY);\n }", "public String getCountry() {\n return (String)getAttributeInternal(COUNTRY);\n }", "public String getCountry() {\n return (String)getAttributeInternal(COUNTRY);\n }", "private static String getCountryLocale() {\n return Locale.getDefault().getCountry();\n }", "public String getCountryCode() {\n return instance.getCountryCode();\n }", "public Country(String countryName) {\n\t\tthis.countryName = countryName.toLowerCase();\n\t}", "public java.lang.String getCountryName() {\n java.lang.Object ref = countryName_;\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 countryName_ = s;\n return s;\n }\n }", "String getCountryOfOrigin(long id) throws RemoteException;", "public static String getDisplayCountry(String localeID, ULocale displayLocale) {\n/* 648 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public String getCountry() {\r\n\t\treturn country;\r\n\t}", "public String getCountry() {\r\n\t\treturn country;\r\n\t}", "public String getCountry() {\r\n\t\treturn country;\r\n\t}", "public String getCountry() {\n\t\treturn addressFormat;\n\t}", "public String getName(String iso639code) \n\tthrows LanguageNotAvailableException;", "public java.lang.String getCountry() {\r\n return country;\r\n }", "public int getCountryCode() {\r\n\t\treturn countryCode;\r\n\t}", "public String detectCountry(String ip) {\n try {\n if (\"127.0.0.1\".equals(ip)) {\n return \"lv\"; // for test purposes\n }\n GeoIpResponse geoIpResponse = geoIpService.getGeoIpData(ip);\n String country = geoIpResponse.getCountry_code();\n if (StringUtils.hasText(country)) {\n return country.toLowerCase();\n }\n } catch (IOException e) {\n log.error(\"Could not detect country by IP {}. Use default value {}\", ip, defaultCountry, e);\n }\n return defaultCountry.toLowerCase();\n }", "public String getCountry() {\r\n return this.country;\r\n }", "@AutoEscape\n\tpublic String getNationality();", "@GET\r\n\t@Path(\"/code/{currencycode}\")\r\n\tpublic String getCountryByCurrencyCode(@PathParam(\"currencycode\") final Currency currency) {\r\n\t\treturn currency.getCountry();\r\n\t}", "public String getCountry() {\n return Country;\n }", "public String getDisplayCountry(ULocale displayLocale) {\n/* 624 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public java.lang.String getCountry() {\n return country;\n }", "public String getCountry(){\n\t\treturn country;\n\t}", "public String getCountry(){\n\t\treturn country;\n\t}", "public String getCountryName(Context context, double latitude, double longitude, int maxAddresses) {\n List<Address> addresses = getGeocoderAddress(context, latitude, longitude, maxAddresses);\n if (addresses != null && addresses.size() > 0) {\n Address address = addresses.get(0);\n String countryName = address.getCountryName();\n\n return countryName;\n } else {\n return null;\n }\n }", "private static String getCountrySim(NgApp ngApp) {\n TelephonyManager tm = (TelephonyManager)ngApp.activity.getSystemService(Context.TELEPHONY_SERVICE);\n return tm.getSimCountryIso();\n }", "@ApiModelProperty(value = \"Nation with its own government, occupying a particular territory.\")\n\n@Pattern(regexp=\"^[A-Z]{2,2}$\") \n public String getCountry() {\n return country;\n }", "com.google.protobuf.ByteString\n getCountryCodeBytes();", "public String getCountry() {\r\n return country;\r\n }" ]
[ "0.7367213", "0.7273183", "0.72251767", "0.72251767", "0.71864736", "0.71864736", "0.70695055", "0.70351803", "0.6961878", "0.6867209", "0.68017685", "0.6793294", "0.6520097", "0.6440913", "0.63493925", "0.62334836", "0.6192426", "0.6163025", "0.61554897", "0.61498016", "0.5999383", "0.5944748", "0.5930592", "0.59061086", "0.58943623", "0.5891533", "0.5868814", "0.5857462", "0.58541507", "0.58113295", "0.5790538", "0.57866144", "0.57754695", "0.57754695", "0.57754695", "0.5749045", "0.5728509", "0.5703201", "0.57005686", "0.5689511", "0.5676196", "0.56748855", "0.56748855", "0.567435", "0.56735206", "0.566723", "0.56583875", "0.5656956", "0.5656915", "0.564706", "0.5646651", "0.5645857", "0.5641928", "0.56363636", "0.5630698", "0.5629032", "0.562589", "0.562333", "0.56223387", "0.56187516", "0.5615069", "0.56150174", "0.56073755", "0.56073755", "0.56040317", "0.5598338", "0.5598338", "0.5598146", "0.5598146", "0.5582308", "0.558224", "0.558224", "0.558224", "0.5578396", "0.5575479", "0.5573952", "0.5573784", "0.55725735", "0.5571977", "0.55635333", "0.55635333", "0.55635333", "0.5562603", "0.55593663", "0.55420876", "0.5540436", "0.552969", "0.5523263", "0.5520747", "0.5509329", "0.5507764", "0.55012", "0.5498683", "0.5497673", "0.5497673", "0.5480711", "0.54669833", "0.5460829", "0.54607606", "0.54562354" ]
0.74191964
0
Sends a Get Request to the Rest Countries API. Returns all the countries.
private String sendGetRequest() throws IOException { String inline = ""; URL url = new URL(COUNTRYAPI); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("GET"); conn.connect(); int responsecode = conn.getResponseCode(); if (responsecode != 200) { throw new RuntimeException("HttpResponseCode: " + responsecode); } else { Scanner sc = new Scanner(url.openStream()); while (sc.hasNext()) { inline += sc.nextLine(); } sc.close(); } return inline.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@GET\r\n\t@Path(\"/countries\")\r\n\tpublic Response getAllCountries() {\r\n\t\ttry {\r\n\t\t\tList<CountryCreatedDto> countryCreatedDto = institutionService.getAllCountries();\r\n\t\t\treturn FarmsResponse.ok(countryCreatedDto);\r\n\t\t} catch (Exception ex) {\r\n\t\t\t// logger.error(ErrorMessage.OPERATION_NOT_RESPONDING, ex);\r\n\t\t\tFarmsMail.sendMailText(\"contact.farms@gmail.com\", \"Erro\", ex.getMessage() + \" \" + ex.toString());\r\n\t\t\treturn FarmsResponse.error(ErrorMessage.OPERATION_NOT_RESPONDING);\r\n\t\t}\r\n\t}", "@Override\n\tpublic List<Country> getCountries() {\n\t\tCountryRootObject countryRootObject = restTemplate.getForObject(urlForDatabaseCountries(), CountryRootObject.class);\n\n\t\treturn countryRootObject.getResponse().getItems();\n\t}", "@RequestMapping(value = \"/countries\", method = RequestMethod.GET)\n public List<Country> countries() {\n return dictionaryService.findAllCountries();\n }", "public List<Country> getAll() throws Exception;", "@Test\n\tpublic void ListAllCountry() {\n\t\tRequestSpecification requestSpecification = new base().getRequestSpecification();\n\t\tString json = given().get(Endpoint.GET_COUNTRY).then().extract().asString();\n\t\tJsonPath jp = new JsonPath(json);\n\t\tList<String> list = jp.get(\"name\");\n\t\tSystem.out.println(\"Country's are -------\" + list.get(0));\n\t}", "@RequestMapping(value = \"/getCountries.abhi\")\n\tpublic List<CountryTO> getCountries(Model model, HttpServletRequest request) {\n\n\t\treturn addressService.getAllActiveCountries();\n\n\t}", "List<Country> listCountries();", "@Override\n\tpublic List<String> findAllCountries() {\n\t\treturn theCountryRepository.findAllCountries();\n\t}", "@RequestMapping(value = \"/getCountries\", method = RequestMethod.GET, produces = \"application/json\")\n @ResponseBody\n public SPResponse getCountries(@RequestParam(defaultValue = \"en_US\") String locale) {\n \n locale = LocaleHelper.isSupported(locale);\n \n String countryList = countryListMap.get(locale);\n \n if (countryList == null) {\n String fileName = null;\n if (Constants.DEFAULT_LOCALE.equalsIgnoreCase(locale)) {\n fileName = \"countryList.json\";\n } else {\n fileName = \"countryList_\" + locale.toString() + \".json\";\n }\n \n ObjectMapper mapper = new ObjectMapper();\n try {\n Resource resource = resourceLoader.getResource(\"classpath:\" + fileName);\n Countries readValue = mapper.readValue(resource.getFile(), Countries.class);\n countryList = mapper.writeValueAsString(readValue);\n } catch (Exception e) {\n LOG.error(\"error occurred retreving the country list for the locale \" + locale + \": file :\"\n + fileName, e);\n Resource resource = resourceLoader.getResource(\"classpath:countryList.json\");\n Countries readValue;\n try {\n readValue = mapper.readValue(resource.getFile(), Countries.class);\n countryList = mapper.writeValueAsString(readValue);\n } catch (IOException e1) {\n LOG.error(\"Error occurred while getting the country list\", e1);\n }\n }\n \n if (countryList == null) {\n countryList = MessagesHelper.getMessage(\"countries.list\");\n } else {\n countryListMap.put(locale, countryList);\n }\n }\n return new SPResponse().add(\"countries\", countryList);\n }", "public static void getCountries() {\n\t\tJSONArray countries = (JSONArray) FileParser.dataSetter().get(\"countries\");\n\t\tfor(int i = 0, size = countries.size(); i < size; i++) {\n\t\t\tJSONObject objectInArray = (JSONObject) countries.get(i);\n\t\t\tSystem.out.println(objectInArray.get(\"name\"));\n\t\t}\n\t}", "public List<Country> getCountries()\n {\n return countries;\n }", "@RequestMapping(value = \"/country\", method = RequestMethod.GET)\n public List<CountryCustomerCount> customersInCountry() {\n return customerRepository.customerInCountry();\n }", "public static URL getUrlForGetCountries()\r\n {\r\n String strUrl = getBaseURL() + \"account_services/api/1.0/static_content/countries/client_type/3/language/\"+\r\n \t\tA.getContext().getString( R.string.backend_language_code )+\"?brand=\"+Config.BRAND_NAME_URL;\r\n return str2url( strUrl );\r\n }", "@GetMapping(\"/country\")\n public List<ReadableCountry> getCountry(@ApiIgnore Language language, HttpServletRequest request) {\n MerchantStore merchantStore = storeFacade.getByCode(request);\n return countryFacade.getListCountryZones(language, merchantStore);\n }", "public List<Country> getAllAvailableCountry() {\n\t\treturn countryManager.getAllAvailable();\n\t}", "@GetMapping(\"/all\")\n public List<Country> getAll(){\n return countryRepository.findAll();\n }", "public List<Country> getAll() {\n\t\tif (countries != null) {\n\t\t\treturn countries;\n\t\t}\n\t\telse {\n\t\t\tcountries = new ArrayList<>();\n\n\t\t\tif (Files.exists(countriesPath)) {\n\t\t\t\ttry (BufferedReader in = new BufferedReader(\n\t\t\t\t\t\t\t\t\t\t new FileReader(countriesFile))) {\n\t\t\t\t\tString line = in.readLine();\n\t\t\t\t\twhile (line != null) {\n\t\t\t\t\t\tString[] fields = line.split(FIELD_SEP);\n\t\t\t\t\t\tString idStr = fields[0];\n\t\t\t\t\t\tString code = fields[1];\n\t\t\t\t\t\tString name = fields[2];\n\t\t\t\t\t\tint id = Integer.parseInt(idStr);\n\t\t\t\t\t\tCountry country = new Country(id, code, name);\n\t\t\t\t\t\tcountries.add(country);\n\t\t\t\t\t\tline = in.readLine();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (IOException ioe) {\n\t\t\t\t\tSystem.out.println(ioe);\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn countries;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(countriesPath.toAbsolutePath()+\" doesn't exist.\");\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t}", "public void getCountries(HttpServletResponse resp, List<CountryDto> countries,\n CountryUcc countryUcc) {\n try {\n if (countries == null) {\n countries = countryUcc.findAllDtos();\n }\n String json = new Genson().serialize(countries);\n resp.setContentType(\"application/json\");\n resp.getOutputStream().write(json.getBytes());\n } catch (IOException exp) {\n exp.printStackTrace();\n } catch (TransactionErrorException exp1) {\n exp1.printStackTrace();\n } catch (InternalServerException exp2) {\n exp2.printStackTrace();\n }\n }", "public LiveData<List<CountryEntity>> getCountries() {\n return mObservableCountries;\n }", "public ArrayList<Country> getCountryList() throws LocationException;", "public ComboItem[] getCountries() {\r\n\t\treturn countries;\r\n\t}", "@GetMapping(\"/list\")\n\tpublic String findAllCountries(Model model ){\n\t List<countriesEntity> lista= countriesService.findAllCountries();\n\t model.addAttribute(\"lista\", lista);\n\t return \"countries/findAllCountries\";\n\t}", "void fetchCountryInformation();", "List<Country> selectAll();", "public ArrayList<String> getCountries() {\n\n JSONArray jsonArray = readFromJSON();\n\n ArrayList<String> cList=new ArrayList<String>();\n\n if (jsonArray != null) {\n for (int i = 0; i < jsonArray.length(); i++) {\n try {\n cList.add(jsonArray.getJSONObject(i).getString(\"name\")); //getting the name of the country and adding it to an arraylist\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n }\n return cList;\n }", "public List<String> getCountries() {\n\t\tif (countries == null) {\r\n\t\t\tcountries = new ArrayList<>();\r\n\t\t\tif (Files.exists(countriesPath)) {\r\n\t\t\t\ttry (BufferedReader in = new BufferedReader(\r\n\t\t\t\t\t\t new FileReader(countriesFile))) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t//read countries from file into array list\r\n\t\t\t\t\tString line = in.readLine();\r\n\t\t\t\t\twhile (line != null) {\r\n\t\t\t\t\t countries.add(line);\r\n\t\t\t\t\t line = in.readLine();\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tFiles.createFile(countriesPath);\r\n\t\t\t\t\tSystem.out.println(\"** countries file create!\");\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn countries;\r\n\t}", "@SuppressWarnings(\"unchecked\")\n\t@Override\n\t public List<Country> listCountry(){\n\t Session session = factory.openSession();\n\t Transaction tx = null;\n\t List<Country> countries = null;\n\t \n\t tx = session.beginTransaction();\n\t Query query = session.createQuery(\"FROM Country\");\n\t //countries = (List<Country>)session.createQuery(\"FROM Country\");\n\t countries = (List<Country>)query.list();\n\t \n\t System.out.print(\"Currency: \" );\n\t \n\t tx.commit();\n\t return countries;\n\t }", "public List<Country> getCountries() {\r\n\t\tList<Country> country=new ArrayList<Country>();\r\n\t\tfor(Country c : graph.vertexSet()){\r\n\t\t\tcountry.add(c);\r\n\t\t}\r\n\t\treturn country;\r\n\t}", "public Set<Country> getCountriesSet() {\n\t\treturn d_countriesSet;\n\t}", "public static ObservableList<Country> getAllCountries() {\n ObservableList<Country> countries = FXCollections.observableArrayList();\n try {\n String sql = \"SELECT * from countries\";\n PreparedStatement ps = DBConnection.getConnection().prepareStatement(sql);\n ResultSet rs = ps.executeQuery();\n\n while(rs.next()) {\n int countryID = rs.getInt(\"Country_ID\");\n String countryName = rs.getString(\"Country\");\n Country c = new Country(countryID,countryName);\n countries.add(c);\n }\n } catch (SQLException throwables) {\n throwables.printStackTrace();\n }\n return countries;\n }", "Observable<List<CountryEntity>> fetchAllCountries();", "@GetMapping(\"/countries\")\n public String getCountries(Model model){\n List<Country> countryList = countryService.getCountries();\n model.addAttribute(\"countries\",countryList);\n\n return \"country\";\n }", "public ArrayList<String> getListOfCountries() {\n ArrayList<String> countries = new ArrayList<>(gameMap.getCountryHashMap().keySet());\n return countries;\n }", "@PostConstruct\r\n public void getCountriesKeysAndNamesAtApplicationStartUp() {\r\n ViewsController.countries = new HashMap<>();\r\n Object object = restTemplate.getForObject(\"https://api.covid19tracking.narrativa.com/api/countries\", Object.class);\r\n new HashMap<>();\r\n if (object != null) {\r\n ObjectMapper objectMapper = new ObjectMapper();\r\n Country data = objectMapper.convertValue(object, Country.class);\r\n for (Country_ country : data.getCountries()) {\r\n ViewsController.countries.put(country.getId(), country.getName());\r\n }\r\n }\r\n }", "private String urlForDatabaseCountries() {\n\t\tString token;\n\t\tStringBuilder builder = new StringBuilder(ConstantsForVkApi.URL);\n\n\t\ttoken = proxyServerService.getProxyServerByDestiny(\"user\").get(0).getToken();\n\n\t\tbuilder.append(ConstantsForVkApi.METHOD_GET_COUNTRIES);\n\t\tbuilder.append(ConstantsForVkApi.PARAMETERS_FOR_COUNTRIES);\n\t\tbuilder.append(ConstantsForVkApi.TOKEN);\n\t\tbuilder.append(token);\n\t\tbuilder.append(ConstantsForVkApi.VERSION);\n\n\t\treturn builder.toString();\n\t}", "@GetMapping(path = \"/\", consumes = MediaType.APPLICATION_JSON_VALUE, produces = \"application/json; charset=UTF-8\")\n\tpublic ResponseEntity<?> getAllContinentFlag() {\n\t\treturn new ResponseEntity<List<ContinentDocument>>(continentCountriesFlagService.findAllContinent(), HttpStatus.OK);\n\t}", "List<GenericTypedGrPostal> getCountryNames();", "public String[] getCountryNames() {\r\n return countryNames;\r\n }", "public LiveData<List<Countries>> getCountryList() {\n return this.countryLiveData;\n }", "@GetMapping(\"/findAllStateCountry/name\")\n\tpublic ResponseEntity<List<State>> stateNameCountry(@RequestParam String name) {\n\t\tList<State> STATES = stateService.stateNameCountry(name);\n\t\treturn new ResponseEntity<List<State>>(STATES, HttpStatus.OK);\n\t}", "com.google.protobuf.ByteString\n getCountryBytes();", "public interface CountriesService {\n\n @GET(\"/rest/v1/all\")\n public Observable<List<Country>> getAllCountries();\n}", "void countries_init() throws SQLException {\r\n countries = DatabaseQuerySF.get_all_stations();\r\n }", "public Map<Integer, HealthMapCountry> getCountryMap() {\n if (countryMap == null) {\n List<HealthMapCountry> countries = geometryService.getAllHealthMapCountries();\n countryMap = index(countries, on(HealthMapCountry.class).getId());\n }\n return countryMap;\n }", "com.google.protobuf.ByteString\n getCountryBytes();", "@RequestMapping(value = \"/charitys\",\n method = RequestMethod.GET,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public List<Charity> getAll() {\n log.debug(\"REST request to get all Charitys\");\n return charityRepository.findAll();\n }", "java.lang.String getCountry();", "java.lang.String getCountry();", "Country getCountry();", "@GetMapping(\"/localisations\")\n @Timed\n public List<Localisation> getAllLocalisations() {\n log.debug(\"REST request to get all Localisations\");\n return localisationService.findAll();\n }", "public static ObservableList<String> getCountryList() throws SQLException{\r\n\r\n //connection and prepared statement set up\r\n countryList.clear();\r\n Connection conn = DBConnection.getConnection();\r\n String selectStatement = \"SELECT * FROM countries;\";\r\n DBQuery.setPreparedStatement(conn, selectStatement);\r\n PreparedStatement ps = DBQuery.getPreparedStatement();\r\n\r\n ps.execute();\r\n ResultSet rs = ps.getResultSet();\r\n\r\n //fills list with countries\r\n while(rs.next()){\r\n countryList.add(rs.getString(\"Country\"));\r\n }\r\n return countryList;\r\n }", "@Override\n public void initialize(URL url, ResourceBundle resourceBundle) {\n ObservableList<String> countryNames = FXCollections.observableArrayList();\n for (Countries c : DBCountries.getAllCountries()) {\n countryNames.add(c.getName());\n }\n countryCombo.setItems(countryNames);\n }", "@GET(\"stripe_supported_country_list\")\n Call<ResponseBody> stripeSupportedCountry(@Query(\"token\") String token);", "@GetMapping(value = \"/getAll\")\n public ResponseEntity getAll(@RequestHeader(value = \"language\", defaultValue = \"\") final String languageCode) {\n final Language language = languageCode.isEmpty() ? null : Language.getLanguage(languageCode);\n return ResponseEntity.status(HttpStatus.OK).body(this.ingredientController.listIngredientNames(language));\n }", "@org.junit.Test\n\tpublic void allStatesOfCountry() {\n\t\tResponse response = given().when().get(\"http://services.groupkt.com/state/get/IND/all\");\n\n\t\tresponse.prettyPrint();\n\n\t\t/* 1. verify status code */\n\t\tresponse.then().statusCode(200);\n\n\t\t/* 2. verify countryCode */\n//\t\tresponse.then().body(\"RestResponse.result.country\", equalTo(\"IND\")).body(\"RestResponse.result.name\",\n//\t\t\t\tequalTo(\"Karnataka\"));\n//\t\t\n//\t\tresponse.then().body(\"RestResponse.result.name\", hasItems(\"Andhra Pradesh,Arunachal Pradesh\"));\n\t\t\n\t\t\n\t\tresponse.then().assertThat().body(\"RestResponse.result.name\", hasValue(\"Jammu and Kashmir\"));\n\t\t\n//\t\t\n//\t\tJsonPath jsonPath = new JsonPath(response.toString()).setRoot(\"RestResponse\");\n//\t\tJsonObject lottoId = jsonPath.getJsonObject(\"result\");\n//\t\tList<Integer> winnerIds = jsonPath.get(\"result.id\");\n\n\t}", "List<City> getCityList(Integer countryId)throws EOTException;", "public JSONArray getCordsOfCountry(String Country) throws UnirestException;", "public void getDisasters( boolean newSettings, ArrayList<String> countries, AsyncHttpResponseHandler handler ) {\n String apiURL = BASE_URL;\n Integer count = 0;\n String param;\n \n if ( newSettings ) {\n offset = (long) 0;\n }\n \n for ( String country : countries ) {\n param = String.format(CONDITION_COUNTRY, count, count, Uri.encode(country) );\n apiURL += param;\n count++;\n }\n \n param = String.format(LIMIT_FIELD, limit);\n apiURL += param;\n apiURL += SORT_FIELD;\n \n if ( offset > 0 ) {\n param = String.format(OFFSET_FIELD, offset);\n apiURL += param;\n }\n \n Log.d(\"DEBUG\", \"Making first call to \" + apiURL );\n \n client.get(apiURL, handler);\n }", "public Country getById(Integer id) throws Exception;", "Country getAvailableCountryById(int countryId);", "public ObservableList<String> queryAllCountries() {\n ObservableList<String> countries = FXCollections.observableArrayList();\n try (PreparedStatement stmt = this.conn.prepareStatement(\"SELECT DISTINCT country from country GROUP BY country\")) {\n\n ResultSet result = stmt.executeQuery();\n\n while (result.next()) {\n countries.add(result.getString(\"country\"));\n }\n\n } catch (SQLException ex) {\n System.out.println(ex.getMessage());\n }\n return countries;\n }", "private void buildCountryComboBox() {\n ResultSet rs = DatabaseConnection.performQuery(\n session.getConn(),\n Path.of(Constants.QUERY_SCRIPT_PATH_BASE + \"SelectCountryByID.sql\"),\n Collections.singletonList(Constants.WILDCARD)\n );\n\n ObservableList<Country> countries = FXCollections.observableArrayList();\n try {\n if (rs != null) {\n while (rs.next()) {\n int id = rs.getInt(\"Country_ID\");\n String name = rs.getString(\"Country\");\n countries.add(new Country(id, name));\n }\n }\n } catch (Exception e) {\n Common.handleException(e);\n }\n\n countryComboBox.setItems(countries);\n\n countryComboBox.setConverter(new StringConverter<>() {\n @Override\n public String toString(Country item) {\n return item.getCountryName();\n }\n\n @Override\n public Country fromString(String string) {\n return null;\n }\n });\n }", "public List<Country_Language> getcountry(String id) {\n \tIterable<Country_Language> countries=new ArrayList<>();\n \tList<Country_Language> countr=new ArrayList<>();\n \tcountries=country_Language_Repository.findAll();\n \tfor (Country_Language s :countries)\n \t{ \n\t\t if (s.getCountry_code().equals(id) && s.isIs_official())\n\t\t\t{countr.add(s);\n\t\t return countr;\n\t\t\t}\n \t}\n\t\t return countr;\n \t \n \t\n }", "public JSONArray getCountry(Activity act)\n\t{\n\t\tJSONArray json = null;\n\n\t\tprefManager = new SharedPrefManager(act);\n\t\tHashMap<String, String> init = prefManager.getCountry();\n\t\tString dataCountry = init.get(SharedPrefManager.COUNTRY);\n\t\tLog.e(\"dataCountry\",dataCountry);\n\n\t\ttry {\n\t\t\tjson = new JSONArray(dataCountry);\n\t\t\tLog.e(\"json\",Integer.toString(json.length()));\n\t\t}catch (JSONException e){\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn json;\n\n\t\t/*Locale[] locales = Locale.getAvailableLocales();\n\t\tArrayList<String> countries = new ArrayList<String>();\n\n\t\tfor (Locale locale : locales) {\n\t\t\tString country = locale.getDisplayCountry();\n\t\t\tString countryCode = locale.getCountry();\n\n\n\t\t\tif (country.trim().length()>0 && !countries.contains(country)) {\n\t\t\t\tcountries.add(country+\"-\"+countryCode);\n\t\t\t}\n\t\t}\n\n\t\tCollections.sort(countries);\n\t\treturn countries;*/\n\t}", "public List<City> getAll() throws Exception;", "@SuppressWarnings(\"unchecked\")\n\t@Cacheable(value=API_COUNTRIES, key=\"{#type, #id}\")\n public List<ApiCountryDTO> getCountriesForMetadata(MetaDataType type, Long id) {\n return currentSession().getNamedQuery(\"metadata.country.\"+type.name().toLowerCase()).setParameter(LITERAL_ID, id).list();\n }", "List<Country> getAvailableByStatus(int status);", "@Transactional(readOnly = true) \n public List<CountryState> findAll() {\n log.debug(\"Request to get all CountryStates\");\n List<CountryState> result = countryStateRepository.findAllByDelStatusIsFalse();\n\n return result;\n }", "public Vector getListCountries(){\n Vector listCountries = new Vector();\n try{\n String sqlGet = \"SELECT * FROM country ORDER BY country_name\";\n\n ResultSet rsGet = this.queryData(sqlGet);\n int order = 0;\n while(rsGet.next()){\n order++;\n Vector dataSet = new Vector();\n dataSet.add(rsGet.getInt(\"country_id\"));\n dataSet.add(rsGet.getString(\"country_name\"));\n\n listCountries.add(dataSet);\n }\n } catch(Exception e){\n System.out.println(e.getMessage());\n }\n return listCountries;\n }", "public String getCountryName();", "public int countryCount(){\n\t\treturn this.countries.size();\n\t}", "public List<CountryMasterDesc> getCountryListFromDB() {\n\t\t sessionStateManage = new SessionStateManage(); \n\t\tcountryList = new ArrayList<CountryMasterDesc>();\n\t\tcountryList.addAll( getGeneralService().getCountryList(new BigDecimal(sessionStateManage.isExists(\"languageId\")?sessionStateManage.getSessionValue(\"languageId\"):\"1\")));\n\t\tfor(CountryMasterDesc countryMasterDesc:countryList) {\n\t\t\tmapCountryList.put(countryMasterDesc.getFsCountryMaster().getCountryId(), countryMasterDesc.getCountryName());\n\t\t}\n \t\treturn countryList;\n\t}", "@GetMapping(\"/all\")\n public List<CityInfo> getAll(){\n return service.getAll();\n }", "@RequestMapping(value = \"/current_location/all\", method = RequestMethod.GET)\n public ResponseEntity<List<CurrentLocation>> getAllFavoriteZones() {\n\n List<CurrentLocation> currentLocationList = currentLocationService.findAllCurrentLocation();\n\n if(currentLocationList.isEmpty()){\n return new ResponseEntity<List<CurrentLocation>>(HttpStatus.NO_CONTENT);\n }\n\n return new ResponseEntity<List<CurrentLocation>>(currentLocationList, HttpStatus.OK);\n }", "@Override\r\n\tpublic List<City> getAllCitiesInCountry(String countryName) {\n\t\t\r\n\t\tSystem.out.println(\"getAllCitiesInCountry,countryName\");\r\n\t\tSession session=HibernateUtil.getSessionFactory().getCurrentSession();\r\n\t\tsession.beginTransaction();\r\n\r\n\t\tList<City> list=new ArrayList<City>();\r\n\t\tQuery query=session.createQuery(\"from City where country.name = :countryName\");\r\n\t\tquery.setParameter(\"countryName\", countryName);\r\n\t\tlist=query.list();\r\n\t\tsession.getTransaction().commit();\r\n\t\t//session.flush();\r\n\t\t//session.close();\r\n\t\treturn list;\r\n\t}", "java.lang.String getCountryName();", "@Path(\"/list\")\n @GET\n @Produces({ MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML })\n public List<Food> getFoods_JSON() throws ClassNotFoundException {\n List<Food> listOfCountries=DBFood.listAllFoods();\t\n return listOfCountries;\n }", "@Override\n @Transactional(readOnly = true)\n public Page<Fund> findAllWithCountries(Pageable pageable) {\n log.debug(\"Request to get all Funds\");\n Page<Fund> result = fundRepository.findAllWithEagerRelationships(pageable);\n\n\n\n return result;\n }", "public CountryList() {\n\t\tthis.totalCount = 0;\n\t\tthis.nextAvailable = 0;\n\t}", "@RequestLine(\"GET /geoip/territories?codes={codes}\")\n Collection<Collection<Region>> getAvailableRegions(@Param(\"codes\") String codes);", "@GET(\"/cities\")\n Call<List<City>> getCities();", "com.google.protobuf.ByteString\n getCountryNameBytes();", "@GET(\"alpha/{code}\")\n public Call<Country> getCountryById(@Path(\"code\") String codigo);", "public void populateAllCountries(SolrGazetteer gaz) {\n // SolrGazetteer has full Country metadata, like\n // GeonamesUtility lists offical countries (with TZ, region, aliases, codes)\n // SolrGazetteer lists more aliases/name variants.\n // So have Map( variant =&gt; Country ), where Country is official one.\n //\n allCountries = new HashMap<>();\n\n // Gather 'Official names'\n for (Country C : countries.getCountries()) {\n // NAME: 'United States of America'\n allCountries.put(C.getName().toLowerCase(), C);\n // ISO alpha-2 'US'\n allCountries.put(C.CC_ISO2.toLowerCase(), C);\n // ISO alpha-3 'USA'\n allCountries.put(C.CC_ISO3.toLowerCase(), C);\n }\n\n // Gather name variants from anything that looks like PCLI or PCLI* in\n // gazetteer:\n //\n for (String cc : gaz.getCountries().keySet()) {\n Country alt = gaz.getCountries().get(cc);\n Country C = countries.getCountry(cc);\n // NAME: 'United States of America'\n allCountries.put(alt.getName().toLowerCase(), C);\n // ISO alpha-2 'US'\n allCountries.put(alt.CC_ISO2.toLowerCase(), C);\n // ISO alpha-3 'USA'\n allCountries.put(alt.CC_ISO3.toLowerCase(), C);\n for (String a : alt.getAliases()) {\n // Aliases: 'U.S.A', 'US of A', 'America', etc.\n //\n allCountries.put(a.toLowerCase(), C);\n }\n }\n }", "static IdNameSelect<INameIdParent> getCountriesSelect() {\r\n\t\treturn new IdNameSelect<INameIdParent>() {\r\n\t\t\t\r\n\t\t\tList<INameIdParent> result = new ArrayList<INameIdParent>();\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tprotected String getSqlString() {\r\n\t\t\t\treturn countrySelect;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tList<INameIdParent> getReuslt() {\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tprotected void retrieveResult(ResultSet rs) throws SQLException {\r\n\t\t\t\twhile (rs.next()) {\r\n\t\t\t\t\tNameIdParent p = new NameIdParent();\r\n\t\t\t\t\tp.id = rs.getLong(\"id\");\r\n\t\t\t\t\tp.name = rs.getString(\"n\");\r\n\t\t\t\t\tresult.add(p);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t}", "public void getCountries() {\n\n\n SimpleProgressBar.showProgress(AddressesActivity.this);\n try {\n final String url = Contents.baseURL + \"getAllCountries\";\n\n StringRequest stringRequest = new StringRequest(Request.Method.POST, url,\n new Response.Listener<String>() {\n @Override\n public void onResponse(String response) {\n\n SimpleProgressBar.closeProgress();\n Log.e(\"device response\", response);\n try {\n JSONObject object = new JSONObject(response);\n String status = object.getString(\"status\");\n String message = object.getString(\"message\");\n if (status.equals(\"1\")) {\n\n country_name = new ArrayList<String>();\n iso_name = new ArrayList<String>();\n JSONArray jsonArray = object.getJSONArray(\"record\");\n for (int i = 0; i < jsonArray.length(); i++) {\n JSONObject c = jsonArray.getJSONObject(i);\n if (session.getKeyLang().equals(\"Arabic\")) {\n country_name.add(c.getString(\"name_arabic\"));\n } else {\n country_name.add(c.getString(\"name\"));\n }\n iso_name.add(c.getString(\"iso\"));\n }\n\n //Creating the ArrayAdapter instance having the country list\n ArrayAdapter aa = new ArrayAdapter(AddressesActivity.this, android.R.layout.simple_spinner_item, country_name);\n aa.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n spin_country.setAdapter(aa);\n\n spin_country.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n\n System.out.println(\"OSO NAME===\" + iso_name.get(position));\n getProvinces(iso_name.get(position));\n }\n\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n\n }\n });\n\n for (int i = 0; i < iso_name.size(); i++) {\n if (iso_name.get(i).contains(\"KW\")) {\n position = i;\n //mDob=iso_name.get(position);\n break;\n }\n }\n\n spin_country.setSelection(position);\n\n } else {\n\n Toast.makeText(getApplicationContext(), message, Toast.LENGTH_LONG).show();\n }\n } catch (JSONException e) {\n SimpleProgressBar.closeProgress();\n }\n\n }\n },\n new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n if (error != null && error.networkResponse != null) {\n Toast.makeText(getApplicationContext(), R.string.server_error, Toast.LENGTH_SHORT).show();\n\n } else {\n Toast.makeText(getApplicationContext(), R.string.no_internet, Toast.LENGTH_SHORT).show();\n }\n SimpleProgressBar.closeProgress();\n }\n }) {\n @Override\n protected Map<String, String> getParams() {\n Map<String, String> params = new HashMap<String, String>();\n params.put(\"appUser\", \"tefsal\");\n params.put(\"appSecret\", \"tefsal@123\");\n params.put(\"appVersion\", \"1.1\");\n\n Log.e(\"Refsal device == \", url + params);\n\n return params;\n }\n\n };\n\n stringRequest.setRetryPolicy(new DefaultRetryPolicy(30000,\n DefaultRetryPolicy.DEFAULT_MAX_RETRIES,\n DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));\n RequestQueue requestQueue = Volley.newRequestQueue(AddressesActivity.this);\n stringRequest.setShouldCache(false);\n requestQueue.add(stringRequest);\n\n } catch (Exception surError) {\n surError.printStackTrace();\n }\n }", "public static String[] getDownloadedCountries(Context context){\n SharedPreferences sharedPreferences = context.getSharedPreferences(Values.PREFERENCES_NAME, Context.MODE_PRIVATE);\n File downloadPath = null;\n //We can save resources either in external sd or internal shared storage, we scan the last known download location\n switch (sharedPreferences.getString(Values.DOWNLOAD_LOCATION, Values.LOCATION_INTERNAL)){\n case Values.LOCATION_INTERNAL:\n downloadPath = context.getExternalFilesDir(null);\n break;\n case Values.LOCATION_EXTERNAL:\n if(hasWritableSd(context))\n downloadPath = context.getExternalFilesDirs(null)[1];\n break;\n //If the user has yet to download a package, we return null. This branch is repetitive but added for clarity\n case Values.NOT_YET_DECIDED:\n downloadPath = null;\n break;\n }\n if(downloadPath != null){\n String[] downloadedCountries;\n //Get list of directories, each corresponding to a different country\n File[] resFolders = downloadPath.listFiles(new FileFilter() {\n @Override\n public boolean accept(File pathname) {\n return pathname.isDirectory();\n }\n });\n if(resFolders != null){\n if(resFolders.length == 0)\n return null;\n //countriesNames contains the english name of all supported countries\n //All resFolders will always use the english names of the countries\n String[] countriesNames = Values.COUNTRIES_DEFAULT_NAMES;\n downloadedCountries = new String[resFolders.length];\n //Get folder name and translate country name\n for(int i = 0; i < resFolders.length; i++) {\n String[] folderPath = resFolders[i].getAbsolutePath().split(\"/\");\n String folderName = folderPath[folderPath.length - 1];\n for (String countryName : countriesNames) {\n //If found folder with name matching one country, add it to the list\n if (folderName.equals(countryName)) {\n downloadedCountries[i] = folderName;\n break;\n }\n }\n }\n return downloadedCountries;\n }\n }\n\n return null;\n }", "public List<String> getAdjacentCountries() {\n return adjacentCountries;\n }", "@Override\n protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n ArrayList<Country> countries = new ArrayList<Country>();\n countries.add(new Country(\"IDN\", \"Indonesia\"));\n countries.add(new Country(\"MYS\", \"Malaysia\"));\n // Log the objects\n LOG.info(\"Countries: {}\", countries);\n // Convert POJO objects to JSON using Jackson\n String countriesJson = mapper.writeValueAsString(countries);\n LOG.info(\"Countries JSON: {}\", countriesJson);\n // Ensure the response MIME type is application/json\n resp.setHeader(\"Content-Type\", \"application/json\");\n // Write out the response body\n PrintWriter writer = resp.getWriter();\n writer.write(countriesJson);\n }", "@RequestMapping(value = \"/Asyn/getStates.abhi\", headers = \"X-Requested-With=XMLHttpRequest\", produces = MediaType.APPLICATION_JSON_VALUE)\n\t@ResponseBody\n\tpublic List<StateTO> getStates(Model model, HttpServletRequest request, HttpServletResponse response,\n\t\t\t@RequestParam(name = \"countryId\") String countryId) throws IOException {\n\n\t\tInteger id = Integer.parseInt(countryId);\n\n\t\treturn addressService.getAllActiveStates(id);\n\n\t}", "@ResponseBody\n @RequestMapping(\n value = { \"\" },\n method = {RequestMethod.GET},\n produces = {\"application/json;charset=UTF-8\"})\n public List<Map<String, Object>> listMunicipios() {\n return municipioService.listMunicipios();\n }", "public com.google.protobuf.ByteString\n getCountryBytes() {\n java.lang.Object ref = country_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n country_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@PostMapping(path = \"/\", consumes = MediaType.APPLICATION_JSON_VALUE, produces = \"application/json; charset=UTF-8\")\n\tpublic ResponseEntity<?> getContinentCountriesFlag(@Valid @RequestBody SearchCriteria searchCriteria) {\n\t\t\n\t\t//log.info(\"ContinentsCountryController::getContinentCountriesFlag: start\");\n\t\t\n\t\t/* Validating Request body */\n\t\tOptional<SearchCriteria> checkSearchCriteriaNull = Optional.ofNullable(searchCriteria);\n\t\tif (!checkSearchCriteriaNull.isPresent() || null == checkSearchCriteriaNull.get().getFieldName()) {\n\t\t\t\n\t\t\treturn new ResponseEntity<List<ContinentDocument>>(continentCountriesFlagService.findAllContinent(), HttpStatus.OK);\n\n\t\t} \n\t\t\n\t\t/* if search is based on continent */\n\t\telse if (checkSearchCriteriaNull.get().getFieldName().equals(\"continent\")) {\n\n\t\t\treturn new ResponseEntity<List<ContinentDocument>>(\n\t\t\t\t\tcontinentCountriesFlagService.findByContientName(checkSearchCriteriaNull.get().getFieldValue()),\n\t\t\t\t\tHttpStatus.OK);\n\n\t\t} \n\t\t\n\t\t/* if search is based on country */\n\t\telse if (checkSearchCriteriaNull.get().getFieldName().equals(\"country\")) {\n\n\t\t\treturn new ResponseEntity<CountryDocument>(\n\t\t\t\t\t(CountryDocument) continentCountriesFlagService.findByCountryName(checkSearchCriteriaNull.get().getFieldValue()),\n\t\t\t\t\tHttpStatus.OK);\n\n\t\t} else {\n\t\t\t\n\t\t\t/* if searched criteria not match */\n\t\t\treturn new ResponseEntity<String>(\"Not Found\", HttpStatus.OK);\n\t\t}\n\n\t}", "public com.google.protobuf.ByteString\n getCountryBytes() {\n java.lang.Object ref = country_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n country_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public Country findByName(String name);", "public ArrayList<Country> getContinentPop() {\n try {\n // Create an SQL statement\n Statement stmt = con.createStatement();\n // Create string for SQL statement\n String strSelect =\n \"SELECT SUM(country.Population) AS cPopulation, country.Code, country.Name, country.Continent, country.Region, country.Capital\"\n + \" FROM country\"\n + \" GROUP BY country.Continent, country.Code, country.Name, country.Continent, country.Region, country.Capital\"\n + \" ORDER BY country.Continent, cPopulation DESC\";\n // Execute SQL statement\n ResultSet rset = stmt.executeQuery(strSelect);\n // Check one is returned\n ArrayList<Country> Country = new ArrayList<>();\n System.out.println(\"2. All the countries in a CONTINENT organised by largest population to smallest.\");\n System.out.println(\"Code | Name | Continent | Region | Population | Capital\");\n while (rset.next()) {\n // Create new Country (to store in database)\n Country cnt = new Country();\n cnt.Code = rset.getString(\"Code\");\n cnt.Name = rset.getString(\"Name\");\n cnt.Continent = rset.getString(\"Continent\");\n cnt.Region = rset.getString(\"Region\");\n cnt.Population = rset.getInt(\"cPopulation\");\n cnt.Capital = rset.getInt(\"Capital\");\n\n System.out.println(cnt.Code + \" | \" + cnt.Name + \" | \" + cnt.Continent + \" | \" + cnt.Region + \" | \" + cnt.Population + \" | \" + cnt.Capital );\n Country.add(cnt);\n }\n return Country;\n } catch (Exception e) {\n // Capital City not found.\n System.out.println(e.getMessage());\n System.out.println(\"2. Failed to get country details\");\n return null;\n }\n }", "@Override\n\tpublic List<Client> getAll() {\n\t\treturn dao.getAll(Client.class);\n\t}", "public String getCurrencies() {\n\n\t\treturn getJson(API_VERSION, PUBLIC, \"getcurrencies\");\n\t}", "public CountryCode getCountry() {\n return country;\n }", "public List<Client> getAllClient();" ]
[ "0.80041325", "0.7925638", "0.78088605", "0.75862217", "0.72735876", "0.70287776", "0.7012964", "0.69752324", "0.68767494", "0.6855212", "0.680398", "0.68017733", "0.67881143", "0.66435385", "0.65888375", "0.655428", "0.6528824", "0.6436235", "0.64021355", "0.637132", "0.6368274", "0.62677884", "0.6245663", "0.61753166", "0.6154366", "0.6131519", "0.61250097", "0.6116805", "0.60940063", "0.6083089", "0.6079389", "0.6036141", "0.603478", "0.60076904", "0.59705245", "0.5932697", "0.590458", "0.5898665", "0.5890873", "0.5828856", "0.57835376", "0.5756121", "0.5754933", "0.57524276", "0.57319474", "0.57289016", "0.57154024", "0.57154024", "0.570985", "0.5703019", "0.56960016", "0.5650902", "0.56501466", "0.5647311", "0.5628425", "0.5621965", "0.5608583", "0.56051034", "0.5581816", "0.5579749", "0.55731183", "0.55610466", "0.5556003", "0.5544268", "0.5534404", "0.5517229", "0.5517215", "0.54837924", "0.54705954", "0.54481786", "0.5409132", "0.5405314", "0.54027766", "0.53685284", "0.5362858", "0.5349455", "0.53313744", "0.5329851", "0.5327101", "0.53250164", "0.5299314", "0.52970636", "0.52953285", "0.52835935", "0.52794635", "0.5254976", "0.5238787", "0.5237365", "0.5225071", "0.5208706", "0.5198309", "0.51944995", "0.5174989", "0.5173048", "0.5167063", "0.5158784", "0.51580036", "0.5150692", "0.51491183", "0.51479554" ]
0.5299375
80
Method to return place order service resource path
private static String placeOrderResource() { return "/store/order"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getLocationPath();", "private String getResourcePath() {\n\t\tString reqResource = getRequest().getResourceRef().getPath();\n\t\treqResource = actualPath(reqResource, 1);\n\t\tLOGGERS.info(\"reqResourcePath---->\" + reqResource);\n\t\treturn reqResource;\n\t}", "@Override\n public String getServicesXMLPath()\n {\n return servicesXMLPath;\n }", "private String getUriForAdd(UriInfo uriInfo, OrderRepresentation ordRep) {\r\n\t\tString url = uriInfo.getBaseUriBuilder()\r\n\t\t\t\t.path(OrderResource.class)\r\n\t\t\t\t.path(\"order\")\r\n\t\t\t\t.build()\r\n\t\t\t\t.toString();\r\n\t\treturn url;\r\n\t}", "private String getUriForSelf(UriInfo uriInfo,OrderRepresentation ordRep){\r\n\t\tString url = uriInfo.getBaseUriBuilder()\r\n\t\t\t\t\t\t\t.path(OrderResource.class)\r\n\t\t\t\t\t\t\t.path(\"order\")\r\n\t\t\t\t\t\t\t.path(\"Order_ID\" +ordRep.getOrderID())\r\n\t\t\t\t\t\t\t.build()\r\n\t\t\t\t\t\t\t.toString();\r\n\t\treturn url;\r\n\t\t\r\n\t}", "Path getBookingSystemFilePath();", "protected abstract String getBaseEndpointPath();", "public String getWsdlLocation()\r\n {\r\n return wsdlLocation;\r\n }", "public File getServiceRoot(String serviceName) {\n return new File(new File(new File(getRootDir(), ToolboxFoldersFileConstants.WEB_INF), ToolboxFoldersFileConstants.SERVICES), serviceName);\n }", "public String getOperationClassFullPath() {\n\t\treturn operationClassFullPath;\n\t}", "public String getHandleServiceBaseUrl();", "@Override\r\n\tprotected String getPath() {\n\t\treturn \"/product/detail.do?param=\";\r\n\t}", "protected String getAppPath(String serviceId) {\n if (Strings.isNullOrBlank(serviceId)) {\n return null;\n }\n MBeanServer beanServer = getMBeanServer();\n Objects.notNull(beanServer, \"MBeanServer\");\n if (!beanServer.isRegistered(KUBERNETES_OBJECT_NAME)) {\n LOG.warn(\"No MBean is available for: \" + KUBERNETES_OBJECT_NAME);\n return null;\n }\n String branch = \"master\";\n Object[] params = {\n branch,\n serviceId\n };\n String[] signature = {\n String.class.getName(),\n String.class.getName()\n };\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"About to invoke \" + KUBERNETES_OBJECT_NAME + \" appPath\" + Arrays.asList(params) + \" signature\" + Arrays.asList(signature));\n }\n try {\n Object answer = beanServer.invoke(KUBERNETES_OBJECT_NAME, \"appPath\", params, signature);\n if (answer != null) {\n return answer.toString();\n }\n } catch (Exception e) {\n LOG.warn(\"Failed to invoke \" + KUBERNETES_OBJECT_NAME + \" appPath\" + Arrays.asList(params) + \". \" + e, e);\n }\n return null;\n }", "public File getPublicServiceDir(String serviceName) {\n return new File(new File(getRootDir(), ToolboxFoldersFileConstants.WSDL), serviceName);\n }", "protected String path() {\n return path(getName());\n }", "public URL getWSDLDocumentLocation() {\n\t\treturn null;\n\t}", "public String getLocation() throws ServiceLocalException {\n\t\treturn (String) this.getPropertyBag().getObjectFromPropertyDefinition(\n\t\t\t\tAppointmentSchema.Location);\n\t}", "private String getSwaggerDocumentPath(String rootLocation, JsonObject content) throws RegistryException {\n\n\n\n\t\tString swaggerDocPath = requestContext.getResourcePath().getPath();\n\t\tString swaggerDocName = swaggerDocPath.substring(swaggerDocPath.lastIndexOf(RegistryConstants.PATH_SEPARATOR) + 1);\n\t\tJsonElement infoElement = content.get(SwaggerConstants.INFO);\n\t\tJsonObject infoObject = (infoElement != null) ? infoElement.getAsJsonObject() : null;\n\n\t\tif (infoObject == null || infoElement.isJsonNull()) {\n\t\t\tthrow new RegistryException(\"Invalid swagger document.\");\n\t\t}\n\t\tString serviceName = infoObject.get(SwaggerConstants.TITLE).getAsString().replaceAll(\"\\\\s\", \"\");\n\t\tString serviceProvider = CarbonContext.getThreadLocalCarbonContext().getUsername();\n\n\t\tswaggerResourcesPath = rootLocation + serviceProvider + RegistryConstants.PATH_SEPARATOR + serviceName +\n\t\t RegistryConstants.PATH_SEPARATOR + documentVersion;\n\n String pathExpression = getSwaggerRegistryPath(swaggerDocName, serviceProvider);\n\n\n\t\treturn RegistryUtils.getAbsolutePath(registry.getRegistryContext(),pathExpression);\n\t}", "public String getPathName()\n {\n return getString(\"PathName\");\n }", "public String getPath() {\n\t\treturn getString(\"path\");\n\t}", "public static String getOrderImagesPath() {\n\t\treturn \"/home/ftpshared/OrderImages\";\n\t}", "String getServiceUrl();", "public SoPath getPath() {\n\t\t return path; \n\t}", "String getPath();", "String getPath();", "String getPath();", "String getPath();", "String getPath();", "public String getPath()\n {\n StringBuilder buff = new StringBuilder();\n Resource r = this;\n while(r != null)\n {\n if(r.getId() != 1)\n {\n buff.insert(0, r.getName());\n }\n r = r.getParent();\n if(r != null || this.getId() == 1)\n {\n buff.insert(0, '/');\n }\n }\n return buff.toString();\n }", "private String getUriForOrderStatus(UriInfo uriInfo, OrderRepresentation ordRep) {\r\n\t\tString url = uriInfo.getBaseUriBuilder()\r\n\t\t\t\t.path(OrderResource.class)\r\n\t\t\t\t.path(\"order\")\r\n\t\t\t\t.path(\"status\")\r\n\t\t\t\t.path(Integer.toString(ordRep.getOrderID()))\r\n\t\t\t\t.build()\r\n\t\t\t\t.toString();\r\n\t\treturn url;\r\n\t}", "public String getPath();", "public String getPath();", "public String getPath();", "Path getCartFilePath();", "public static String getServiceRootPath(String frameworkName) {\n // /dcos-service-<your__name__here>\n return SERVICE_ROOT_PATH_PREFIX + SchedulerUtils.withEscapedSlashes(frameworkName);\n }", "@Override\r\n public String getPath() {\r\n if (VFS.isUriStyle()) {\r\n return absPath + getUriTrailer();\r\n }\r\n return absPath;\r\n }", "String getContextPath();", "String getContextPath();", "String getContextPath();", "String getIPGeolocationCityEmbeddedResource();", "public String getPath(){\n\t\t\treturn this.path;\n\t\t}", "public String resolvePath();", "public String getOperationClassPath() {\n\t\treturn operationClassPath;\n\t}", "public static String getPath() {\n\t\t// Lấy đường dẫn link\n\t\tAuthentication auth1 = SecurityContextHolder.getContext().getAuthentication();\n\t\tAgentconnection cus = (Agentconnection) auth1.getPrincipal();\n\t\t \n\t\t//String PATH_STRING_REAL = fileStorageProperties.getUploadDir()+cus.getMerchant()+\"/hotel/images/\" + year + \"/\" + month + \"/\" ;\n\t String PATH_STRING_REAL = \"E:/ezcloud/upload/\"+cus.getMerchant()+\"/hotel/images/\" + year + \"/\" + month + \"/\" ;\n\t return PATH_STRING_REAL;\n\t}", "public String getPathForPrefix(String prefix) {\r\n String ns = this.getNamespaceURI(prefix);\r\n if (ns != null) {\r\n for (Import imp : getDefinitions().getImports()) {\r\n if (ns.equals(imp.getNamespace())) {\r\n // TODO: Also check that imp.getType() is BPMN\r\n return imp.getLocation();\r\n }\r\n }\r\n }\r\n return \"\";\r\n }", "private String getUriForCancel(UriInfo uriInfo, OrderRepresentation ordRep) {\r\n\t\tString url = uriInfo.getBaseUriBuilder()\r\n\t\t\t\t.path(OrderResource.class)\r\n\t\t\t\t.path(\"order\")\r\n\t\t\t\t.path(\"cancel\")\r\n\t\t\t\t.path(Integer.toString(ordRep.getOrderID()))\r\n\t\t\t\t.build()\r\n\t\t\t\t.toString();\r\n\t\treturn url;\r\n\t}", "public static Path locateResourcesDir(ServiceContext context) {\n if (context.getServlet() != null) {\n return locateResourcesDir(context.getServlet().getServletContext(), context.getApplicationContext());\n }\n\n return context.getBean(GeonetworkDataDirectory.class).getResourcesDir();\n }", "private String getUriForCustomer(UriInfo uriInfo, OrderRepresentation ordRep) {\r\n\t\tString url = uriInfo.getBaseUriBuilder()\r\n\t\t\t\t.path(CustomerResource.class)\r\n\t\t\t\t.path(\"customer\")\r\n\t\t\t\t.path(Integer.toString(ordRep.getOrderID()))\r\n\t\t\t\t.build()\r\n\t\t\t\t.toString();\r\n\t\treturn url;\r\n\t}", "protected String getPath ()\n\t{\n\t\treturn path;\n\t}", "public abstract String getPath(boolean urlEncode, boolean includeOwner) throws\n\t\t\tUnsupportedEncodingException;", "public String getPathName();", "String getNodeServiceUrl()\n throws IOException, SoapException;", "public abstract String getPath();", "public abstract String getPath();", "public interface PathService {\n /**\n * Used to get list of all paths\n *\n * @return list of all paths\n */\n public List<Path> getAllPaths();\n\n /**\n * Used to get a specific path\n *\n * @return path instance\n */\n public Path getPath(Integer id) throws ResourceNotFoundException;\n\n /**\n * Used to save or update a path\n *\n * @param Path path instance to save or update\n * @return path instance\n */\n public Path saveOrUpdatePath(Path path);\n}", "Path getPath();", "String getPath() {\r\n\t\treturn path;\r\n\t}", "public String getResourceLocation() {\n return resourceLocation;\n }", "@Override\n\t\tpublic String getPathTranslated() {\n\t\t\treturn null;\n\t\t}", "public String getPath()\n {\n\n return _path;\n }", "Path getLocation();", "String getPathName();", "String getPathName();", "String getServiceRef();", "public String getPath(){\r\n\t\treturn path;\r\n\t}", "@Override\r\n public String getPath() {\n return null;\r\n }", "java.lang.String getService();", "java.lang.String getService();", "java.lang.String getService();", "public abstract String getResourcePath(Method method);", "protected static String getObjectPath(URI resource) {\n String objectPath = resource.getPath().isEmpty() ? \"/\" : resource.getPath();\n return String.format(\"%s%s\", resource.getAuthority(),\n objectPath.charAt(0) == '/' ? objectPath : \"/\" + objectPath);\n }", "public String getResourcePath();", "String getPath() {\n return this.path;\n }", "public String getPath() {\n return this.path;\n }", "public String getPath() {\n return this.path;\n }", "public String getPath() {\n return this.path;\n }", "public String getPath() {\n return this.path;\n }", "public String getPath() {\n return this.path;\n }", "public String getPath() {\n return this.path;\n }", "public String getPath() {\n return this.path;\n }", "public String getPath() {\n return this.path;\n }", "public String getPath() {\n return this.path;\n }", "public String getPath() {\n return this.path;\n }", "public String getPath() {\n return this.path;\n }", "public String getPath() {\n return this.path;\n }", "public String getPath() {\n return this.path;\n }", "public abstract String getFullPath();", "public String getRelativePath();", "private String getPath(PSItemDefSummary itemDefSummary) throws PSExtensionProcessingException\n {\n Map<IPSGuid, String> itemPaths = new HashMap<>();\n String path = \"\";\n IPSGuid guid = null;\n try\n {\n\n guid = itemDefSummary.getGUID();\n IPSUiDesignWs ui = PSUiWsLocator.getUiDesignWebservice();\n path = ui.objectIdToPath(guid);\n // strip off content type name and prefix\n if (path != null && path.startsWith(CONTENTTYPES_PATH_PREFIX))\n {\n int nodeNamePosition = path.lastIndexOf(\"/\");\n path = path.substring(CONTENTTYPES_PATH_PREFIX.length(), nodeNamePosition);\n }\n else if (path == null || !path.equals(\"Navigation\"))\n {\n path = \"\";\n }\n\n return path;\n\n }\n catch (PSErrorsException e)\n {\n throw new PSExtensionProcessingException(\"Failed to obtain node path for content items \", e);\n }\n\n }", "public String getServiceOrderNumber() {\n return serviceOrderNumber.get();\n }", "@Override\n\tprotected String getWebServiceUri() {\n\t\treturn this.uri;\n\t}", "CtPath getPath();", "String getRouteDest();", "String getPath() {\n return path;\n }", "protected abstract String getResourcePath();", "public String customPath() {\n return this.customPath;\n }", "public abstract String getFullPath(final String resourcePath);", "public String getBranchLocationOperationsServiceReference() {\n return branchLocationOperationsServiceReference;\n }", "public String getPath() {\n return this.path;\n }", "public String getOrderItemUrl() {\n return orderItemUrl;\n }" ]
[ "0.58509004", "0.5836603", "0.57816285", "0.5778859", "0.5768983", "0.5709193", "0.56069493", "0.5555822", "0.5516565", "0.55017793", "0.54971164", "0.54755116", "0.54280776", "0.54245794", "0.54064", "0.53642946", "0.5337087", "0.53316206", "0.5287319", "0.52803576", "0.5258379", "0.52556354", "0.5252368", "0.52146244", "0.52146244", "0.52146244", "0.52146244", "0.52146244", "0.5201095", "0.5197938", "0.5177832", "0.5177832", "0.5177832", "0.5163871", "0.51526386", "0.5151539", "0.5147193", "0.5147193", "0.5147193", "0.5138242", "0.51286256", "0.5122808", "0.5105411", "0.50960106", "0.5083594", "0.50812143", "0.5078828", "0.5077047", "0.507372", "0.5073324", "0.50686216", "0.50637686", "0.505454", "0.505454", "0.50493807", "0.5029807", "0.50263584", "0.50261813", "0.501396", "0.50090706", "0.49980798", "0.4991507", "0.4991507", "0.49914092", "0.49808124", "0.4978394", "0.49783504", "0.49783504", "0.49783504", "0.4969332", "0.49663854", "0.496629", "0.49642995", "0.49551544", "0.49551544", "0.49551544", "0.49551544", "0.49551544", "0.49551544", "0.49551544", "0.49551544", "0.49551544", "0.49551544", "0.49551544", "0.49551544", "0.49551544", "0.49550337", "0.49540037", "0.4950883", "0.49501657", "0.4948448", "0.49475268", "0.4946903", "0.49415877", "0.493801", "0.49357194", "0.49278507", "0.49264094", "0.49235293", "0.49184263" ]
0.71489626
0
Method to return place order service payload
private static String placeOrderPayload(long id, long petId, int quantity, String shipDate, String status, boolean completed) { return "{\n" + " \"id\": \"" + id + "\",\n" + " \"petId\": \"" + petId + "\",\n" + " \"quantity\": \"" + quantity + "\",\n" + " \"shipDate\": \"" + shipDate + "\",\n" + " \"status\": \"" + status + "\",\n" + " \"complete\": \"" + completed + "\"\n" + "}"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Map<String, String> createOrder(boolean debug) throws IOException {\n Map<String, String> map = new HashMap<>();\n OrdersCreateRequest request = new OrdersCreateRequest();\n request.prefer(\"return=representation\");\n request.requestBody(buildRequestBody());\n //3. Call PayPal to set up a transaction\n HttpResponse<Order> response = client().execute(request);\n System.out.println(\"Response: \" + response.toString());\n // if (true) {\n if (response.statusCode() == 201) {\n System.out.println(\"Status Code: \" + response.statusCode());\n System.out.println(\"Status: \" + response.result().status());\n System.out.println(\"Order ID: \" + response.result().id());\n System.out.println(\"Intent: \" + response.result().intent());\n System.out.println(\"Links: \");\n for (LinkDescription link : response.result().links()) {\n System.out.println(\"\\t\" + link.rel() + \": \" + link.href() + \"\\tCall Type: \" + link.method());\n }\n System.out.println(\"Total Amount: \" + response.result().purchaseUnits().get(0).amount().currencyCode()\n + \" \" + response.result().purchaseUnits().get(0).amount().value());\n\n\n map.put(\"statusCode\" , response.statusCode()+\"\");\n map.put(\"status\" , response.result().status());\n map.put(\"orderID\" , response.result().id());\n\n //return response.result().id();\n } else {\n System.out.println(\"Response: \" + response.toString());\n map.put(\"Reponse\",response.toString());\n //return response.toString();\n }\n\n return map;\n //}\n }", "public static JSONObject placeOrder(Map<String, String> orderDetails) {\n JSONObject responseJson = new JSONObject();\n\n System.out.println(\"building json\");\n\n try {\n JSONObject orderJson = new JSONObject();\n\n /* \n required attributes: \n 1. retailer\n 2. products\n 3. shipping_address\n 4. shipping_method\n 5. billing_address\n 6. payment_method\n 7. retailer_credentials\n \n /* other attributes we will use:\n 8. max_price \n \n */\n // 1.\n // put the retailer attribute in\n orderJson.put(\"retailer\", \"amazon\");\n\n // 2.\n // create the products array\n JSONArray products = new JSONArray();\n JSONObject product = createProductObject(orderDetails);\n // put product in array\n products.put(product);\n // put the products array in orderJson\n orderJson.put(\"products\", products);\n\n // 3. \n // create shipping address object\n JSONObject shipAddress = createShipAddressObject(orderDetails);\n orderJson.put(\"shipping_address\", shipAddress);\n\n // 4. \n // insert shipping method attribute\n orderJson.put(\"shipping_method\", \"cheapest\");\n\n // 5.\n // create billing address object\n JSONObject billAddress = createBillAddressObject(orderDetails);\n orderJson.put(\"billing_address\", billAddress);\n\n // 6. \n // create payment method object\n JSONObject paymentMethod = createPaymentMethod(orderDetails);\n orderJson.put(\"payment_method\", paymentMethod);\n\n // 7. \n // create retailer credentials object\n JSONObject retailerCredentials = createRetailerCredentialsObject();\n orderJson.put(\"retailer_credentials\", retailerCredentials);\n\n // 8.\n // put max_price in orderJson\n // NOTE: this is the last thing that will prevent an order from \n // actually going through. use 0 for testing purposes, change to \n // maxPrice to actually put the order through\n orderJson.put(\"max_price\", 0); // replace with: orderDetails.get(\"maxPrice\")\n\n //===--- finally: send the json to the api ---===//\n responseJson = sendRequest(orderJson);\n //===-----------------------------------------===//\n\n } catch (JSONException ex) {\n Logger.getLogger(ZincUtils.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n return responseJson;\n }", "public interface PlaceService {\n\n @FormUrlEncoded\n @POST(\"order/create_order.html\")\n @DataKey(\"\")\n @DataChecker\n @DataPaser\n @AutoShowLogin\n Observable<JsonRetEntity<PayOrderInfo>>\n create_order(\n @Field(\"commodity\") String commodityId,\n @Field(\"orderType\") String orderType,\n @Field(\"payType\") String payType\n );\n\n /**\n * 3.3 订单支付结果(√)\n * 接口描述:支付完成后,APP轮询获取订单状态 ,订单流程第三步\n * 接口地址:/order/place/pay_result.html\n * 接口参数:\n * <p/>\n * 字段\t字段名称\t类型\t非空\t描述\n * orderId\t订单号\tLong\t是\n * {\n *\n * @param orderId\n * @return\n */\n @FormUrlEncoded\n @POST(\"order/pay_result.html\")\n @DataKey(\"\")\n @DataChecker(ValidPayResultChecker.class)\n @DataPaser\n @AutoShowLogin\n Observable<JsonRetEntity<PayResultEntity>>\n pay_result(\n @Field(\"orderId\") String orderId\n );\n}", "public interface OrderService {\n\n /**\n * Get Quote ID\n *\n * @return String id of quote\n */\n @POST(\"V1/carts/mine\")\n Observable<String> getQuoteID();\n\n /**\n * Add item to cart\n *\n * @param CartItemRequest\n * @return CartProductItem\n * @see CartProductItem\n */\n @POST(\"V1/carts/mine/items\")\n Observable<CartProductItem> addItemToCart(@Body CartItemRequest CartItemRequest);\n\n /**\n * @param mail\n * @return\n */\n @POST(\"V2/eshopping/store/clearCart/{mail}\")\n Observable<Integer> clearItemFromCart(@Path(\"mail\") String mail);\n\n /**\n * @param id\n * @return OrderDetail\n * @see OrderDetail\n */\n @GET(\"V1/orders/{order_id}\")\n Observable<OrderDetail> getOrderDetail(@Path(\"order_id\") Long id);\n\n /**\n * Get order detail list\n *\n * @param stringHashMap\n * @return ItemList\n * @see ItemList\n */\n @GET(\"V1/orders/?\")\n Observable<ItemList> getOrderDetailList(@QueryMap HashMap<String, String> stringHashMap);\n\n /**\n * @param shippingMethod\n * @return List of ShipmentMethodInfo\n * @see ShipmentMethodInfo\n */\n @POST(\"V1/carts/mine/estimate-shipping-methods\")\n Observable<List<ShipmentMethodInfo>> estimateShippingMethods(@Body ShippingMethod shippingMethod);\n\n /**\n * @param shippingBilling\n * @return CheckoutResponse\n * @see CheckoutResponse\n */\n @POST(\"V1/carts/mine/shipping-information\")\n Observable<CheckoutResponse> summitShipment(@Body ShippingBilling shippingBilling);\n\n /**\n * @param orderProduct\n * @return List of Bulk Order\n */\n @POST(\"V2/eshopping/store/orderProduct\")\n Observable<List<String>> bulkOrder(@Body OrderProduct orderProduct);\n\n /**\n *\n * @param id\n * @return\n */\n @GET(\"V2/eshopping/order/getAddressLatitudeLongitude/{order_id}\")\n Observable<List<String>> getOrderDetailLatLng(@Path(\"order_id\") Long id);\n\n /**\n *\n * @param id\n * @return\n */\n @GET(\"V2/eshopping/order/getServiceFee/{order_id}\")\n Observable<String> getOrderServiceFee(@Path(\"order_id\") Long id);\n\n /**\n *\n * @param id\n * @return\n */\n @GET(\"V2/eshopping/order/getDeliveryDate/{order_id}\")\n Observable<String> getDeliveryDate(@Path(\"order_id\") Long id);\n\n /**\n *\n * @param id\n * @return\n */\n @GET(\"V2/eshopping/order/getDeliveryComment/{order_id}\")\n Observable<String> getOrderComment(@Path(\"order_id\") Long id);\n\n /**\n *\n * @param incrementId\n * @return\n */\n @GET(\"V2/eshopping/order/getItemsByIncrementId/{increment_id}\")\n Observable<List<ProductItem>> getOrderItems(@Path(\"increment_id\") String incrementId);\n\n /**\n * @see OrderItem\n * @param orderId orderId\n * @return List of OrderItem\n */\n @GET(\"V2/eshopping/order/visibaleItem/{orderId}\")\n Observable<List<OrderItem>> getOrderItemsByOrderId(@Path(\"orderId\") Long orderId);\n\n /**\n * get order status comment\n * @param orderId Long\n * @return List of OrderStatus\n */\n @GET(\"V2/eshopping/order/statusHistories/{orderId}\")\n Observable<List<OrderStatus>> getOrderStatusComment(@Path(\"orderId\") Long orderId);\n\n /**\n * Get driver location history\n * @param orderId Long\n * @return List<DriverLocation>\n */\n @GET(\"V2/eshopping/driver/getDriverLocationByOrderId/{orderId}\")\n Observable<List<DriverLocation>> getLocationHistoryByOrderId(@Path(\"orderId\") Long orderId);\n\n /**\n * Get last driver location history\n * @param orderId Long\n * @return List<DriverLocation>\n */\n @GET(\"V2/eshopping/driver/getDriverLastLocation/{orderId}\")\n Observable<List<DriverLocation>> getLastDriverLocationByOrderId(@Path(\"orderId\") Long orderId);\n\n /**\n *\n * @param orderId\n * @return\n */\n @GET(\"V2/eshopping/driver/getDriverInfoByOrderId/{orderId}\")\n Observable<List<DriverInfo>> getDriverInfoByOrderId(@Path(\"orderId\") Long orderId);\n}", "private OrderRequest buildRequestBody(OriginalOrder originalOrder) {\n String currency = \"MXN\";\n\n OrderRequest orderRequest = new OrderRequest();\n orderRequest.intent(originalOrder.getIntent());\n\n ApplicationContext applicationContext = new ApplicationContext()\n .brandName(originalOrder.getBrandName())\n .landingPage(originalOrder.getLandingPage())\n .shippingPreference(originalOrder.getShippingPreference());\n orderRequest.applicationContext(applicationContext);\n System.out.println(\"item Category: \"+ originalOrder.getItems().get(0).getCategory());\n List<PurchaseUnitRequest> purchaseUnitRequests = new ArrayList<PurchaseUnitRequest>();\n PurchaseUnitRequest purchaseUnitRequest = new PurchaseUnitRequest()\n .referenceId(originalOrder.getReferenceId())\n .description(originalOrder.getDescription())\n .customId(originalOrder.getCustomId())\n .softDescriptor(originalOrder.getSoftDescriptor())\n .amount(new AmountWithBreakdown().currencyCode(currency).value(originalOrder.getTotal())\n .breakdown(\n new AmountBreakdown().itemTotal(new Money().currencyCode(currency).value(originalOrder.getTotal()))\n .shipping(new Money().currencyCode(currency).value(originalOrder.getShipping()))\n .handling(new Money().currencyCode(currency).value(originalOrder.getHandling()))\n .taxTotal(new Money().currencyCode(currency).value(originalOrder.getTaxTotal()))\n .shippingDiscount(new Money().currencyCode(currency).value(originalOrder.getShippingDiscount()))))\n .items(new ArrayList<Item>() {\n {\n add(new Item()\n .name(originalOrder.getItems().get(0).getName())\n .description(originalOrder.getItems().get(0).getDescription())\n .sku(originalOrder.getItems().get(0).getSku())\n .unitAmount(new Money().currencyCode(currency).value(originalOrder.getItems().get(0).getUnitAmount()))\n .tax(new Money().currencyCode(currency).value(originalOrder.getItems().get(0).getTax()))\n .quantity(originalOrder.getItems().get(0).getQuantity())\n .category(originalOrder.getItems().get(0).getCategory()));\n }\n })\n .shipping(new ShippingDetails().name(new Name().fullName(originalOrder.getAddress().getName()))\n .addressPortable(new AddressPortable()\n .addressLine1(originalOrder.getAddress().getAddressLine1())\n .addressLine2(originalOrder.getAddress().getAddressLine2())\n .adminArea2(originalOrder.getAddress().getAdminArea2())\n .adminArea1(originalOrder.getAddress().getAdminArea1())\n .postalCode(originalOrder.getAddress().getPostalCode())\n .countryCode(originalOrder.getAddress().getCountryCode())));\n System.out.println(\"purchaseUnitRequest: \\n\" +\n \"\\ndescription \"+ purchaseUnitRequest.description() +\n \"\\nreferenceId \"+ purchaseUnitRequest.referenceId() +\n \"\\nsoftDescriptor \"+ purchaseUnitRequest.softDescriptor() +\n \"\\namount currencyCode \"+ purchaseUnitRequest.amount().currencyCode() +\n \"\\namount value\"+ purchaseUnitRequest.amount().value() +\n \"\\namount taxTotal \"+ purchaseUnitRequest.amount().breakdown().taxTotal().value() +\n \"\\namount handling \"+ purchaseUnitRequest.amount().breakdown().handling().value() +\n \"\\namount shipping \"+ purchaseUnitRequest.amount().breakdown().shipping().value() +\n \"\\namount shippingDiscount \"+ purchaseUnitRequest.amount().breakdown().shippingDiscount().value() +\n \"\\namount itemTotal \"+ purchaseUnitRequest.amount().breakdown().itemTotal().value()\n );\n purchaseUnitRequests.add(purchaseUnitRequest);\n orderRequest.purchaseUnits(purchaseUnitRequests);\n System.out.println(\"Request: \" + orderRequest.toString());\n return orderRequest;\n }", "public APIResponse placeOrder(@NotNull Order order){\n try {\n validateOrder(order);\n \n order.getItems().addAll(\n orderItemRepository.saveAll(order.getItems())\n );\n orderRepository.save( order );\n return APIResponse.builder()\n .success( true)\n .data( true )\n .error( null )\n .build();\n }catch (Exception exception){\n\n log.error(exception.getMessage());\n return APIResponse.builder()\n .success( true)\n .data( false )\n .error( exception.getMessage() )\n .build();\n }\n }", "com.google.protobuf.StringValue getOrderId();", "private void getOrderFromDatabase() {\r\n Cursor cursor = helper.getOrderMoreDetails(orderId);\r\n cursor.moveToFirst();\r\n try {\r\n JSONObject senderObject = new JSONObject(cursor.getString(0));\r\n sender = senderObject.getString(\"name\");\r\n JSONObject receiverObject = new JSONObject(cursor.getString(1));\r\n receiver = receiverObject.getString(\"name\");\r\n JSONObject departureObject = new JSONObject(cursor.getString(2));\r\n if (departureObject.getString(\"type\").equals(\"SpecifyAddress\"))\r\n departure = departureObject.getString(\"long_name\");\r\n else\r\n departure = departureObject.getString(\"short_name\");\r\n JSONObject destinationObject = new JSONObject(cursor.getString(3));\r\n if (destinationObject.getString(\"type\").equals(\"SpecifyAddress\"))\r\n destination = destinationObject.getString(\"long_name\");\r\n else\r\n destination = destinationObject.getString(\"short_name\");\r\n numberOfGoods = cursor.getInt(4);\r\n orderTime = cursor.getString(5);\r\n state = cursor.getString(6);\r\n JSONArray goodIdArray = new JSONArray(cursor.getString(7));\r\n goodId = new String[goodIdArray.length()];\r\n for (int i = 0; i < goodIdArray.length(); i++) {\r\n goodId[i] = goodIdArray.getString(i);\r\n }\r\n orderType = cursor.getString(8);\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n cursor.close();\r\n }", "public OrderResponse build() {\r\n return orderResponse;\r\n }", "public interface WithHoldOrderContract {\r\n\r\n ResponseData resendWithholdOrder();\r\n \r\n}", "@PostMapping\r\n\tpublic ResponseEntity<Object> addOrder(@RequestBody Order Order) \r\n\t{logger.info(\"Inside addOrder method\");\r\n\t\t//System.out.println(\"Enterd in post method\");\r\n\t\tOrder orderList = orderservice.addOrder(Order);\r\n\t\tlogger.info(\"New Order\" + Order);\r\n\t\tif (orderList == null)\r\n\r\n\t\t\treturn ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(\"Inernal server error\");\r\n\t\t// response is set to inserted message id in response header section.\r\n\t\r\n\t\tURI location = ServletUriComponentsBuilder.fromCurrentRequest().path(\"/{id}\")\r\n\t\t\t\t.buildAndExpand((orderList).getBookingOrderId()).toUri();\r\n\t\treturn ResponseEntity.created(location).build();\r\n\t}", "public JSONObject fetchOrder(long orderId) throws Exception;", "com.google.protobuf.StringValueOrBuilder getOrderIdOrBuilder();", "public interface OrderUsingService {\n @Headers({\n \"Content-Type: application/json\",\n \"Accept: application/json\"\n })\n @POST(\"usingorder\")\n Call<OrderUsingResponse> orderUsing(@Body OrderUsingRequest orderUsingRequest);\n}", "private Order getOrder()\n {\n return orderController.getOrder(getOrderNumber());\n }", "public interface OrderService {\n\n /**\n * Returns route time\n * @param routeDTO route data transfer object\n * @param orderDTO order dto for building route\n * @return\n */\n Long getRouteTime(RouteDTO routeDTO, OrderDTO orderDTO);\n\n /**\n * Returns drivers from database by specified order duration and order dto\n * @param time order duration\n * @param orderDTO order dto for building a route\n * @return linked hash map, key - drivers' id, value - drivers\n */\n LinkedHashMap<Long, Driver> getDriversForOrder(Long time, OrderDTO orderDTO);\n\n /**\n * Returns trucks from database by specified weight of cargoes\n * @param weight cargoes's weight\n * @return linked hash map, key - trucks' id, value - trucks\n */\n LinkedHashMap<Long, Truck> getTrucksForOrder(Long weight);\n\n /**\n * Specifies drop locations for picked up cargoes\n * @param routeDTO route dto with route points\n * @param points temp collection for building sub route\n */\n void setDropLocations(RouteDTO routeDTO, List<RoutePointDTO> points);\n\n /**\n * Returns weight of cargoes\n * @param routePointDTO temp route point dto with cargo or drop location\n * @param points already built route as list of ordered route points\n * @param weight previous weight data before adding new route point\n * @return weight\n */\n Long getWeight(RoutePointDTO routePointDTO, List<RoutePointDTO> points, Long weight);\n\n /**\n * Adds new route point to the route\n * @param routePointDTO new route point dto\n * @param routeDTO route data transfer object\n * @param points route as an ordered list of route points dtos\n */\n void newRoutePoint(RoutePointDTO routePointDTO, RouteDTO routeDTO, List<RoutePointDTO> points);\n\n /**\n * Returns all cities from database\n * @return linked hash map of cities, key - cities' id\n */\n LinkedHashMap<Long, City> getAllCitiesMap();\n\n /**\n * Adds order to a database\n * @param routeDTO route for building path for the order\n * @param orderDTO complex order data\n */\n void saveOrder(RouteDTO routeDTO, OrderDTO orderDTO);\n\n /**\n * Returns orders' from database as dtos\n * @return unsorted list of orders' data transfer objects\n */\n List<OrderDTO> getAllOrdersDTO();\n\n /**\n * Returns route points for order\n * @param order order entity for getting specified route points\n * @return unsorted list of route points\n */\n List<RoutePoint> getRoutePointsForOrder(Order order);\n\n /**\n * Returns cities dto adopted for RESTful architecture\n * @param id order id for retrieving data from database\n * @return unsorted list of cities as dtos adopted for RESTful architecture\n */\n List<CityDTORest> getRoutePointsForOrder(Long id);\n\n /**\n * Returns cargoes from database for the given order dto\n * @param orderDTO order dto\n * @return unsorted list of cargoes\n */\n List<Cargo> getCargoesForOrder(OrderDTO orderDTO);\n\n /**\n * Deletes order from database\n * @param id order's id for deletion\n */\n void deleteOrder(Long id);\n\n /**\n * Updates order\n * @param order order entity for updating\n */\n void updateOrder(Order order);\n\n /**\n * Return orders as dtos adopted for RESTful architecture\n * @return unsorted list of orders dtos adopted for RESTful architecture\n */\n List<OrderDTORest> getAllOrdersDTORest();\n\n /**\n * Delete temp route point dto from the route dto\n * @param routePoint temp route point dto\n * @param routeDTO route dto collected already built route\n */\n void deleteRoutePoint(String routePoint, RouteDTO routeDTO);\n\n /**\n * Processes new route point, recalculates distance and weight\n * @param orderDTO order dto\n * @param routeDTO route dto\n * @param routePointDTO new route point\n * @return temp cargoes weight\n */\n Long tempProcessPoint(OrderDTO orderDTO, RouteDTO routeDTO, RoutePointDTO routePointDTO);\n}", "public interface OrderService {\n\n List<OrderInfoDto> getAllOrders();\n\n Long addNewOrder(OrderDto orderDto);\n\n OrderInfoDto getOrderInfoById(Long id);\n\n OrderDto getOrderById(Long id);\n\n void setTruckForOrder(Long orderId, Long truckId);\n\n void setDriverForOrder(Long orderId, Long driverId);\n\n void detachDriver(Long orderId, Long driverId);\n\n <T> T getCurrentOrderByDriverLogin(String login, Class<T> tClass);\n\n List<OrderInfoBoardDto> getOrdersInfo();\n\n List<CityDto> getRouteByOrderId(Long orderId);\n\n void addCityToRoute(Long orderId, List<Long> cityIdList);\n\n void removeCityFromRoute(Long orderId, Long cityId);\n\n void updateBoardUpdateOrder(Order order);\n\n void updateBoardUpdateOrder(String driverLogin);\n\n void closeOrder(Long orderId);\n\n boolean isAllPointsDoneByOrder(Order order);\n\n boolean isAllPointsDoneByOrderId(Long orderId);\n\n Order sortPathPointsByRoute(Order order);\n\n}", "NewOrderResponse newOrder(NewOrder order);", "@Test\n public void placeOrderTest() {\n Order body = new Order().id(10L)\n .petId(10L)\n .complete(false)\n .status(Order.StatusEnum.PLACED)\n .quantity(1);\n Order response = api.placeOrder(body);\n\n Assert.assertEquals(10L, response.getId().longValue());\n Assert.assertEquals(10L, response.getPetId().longValue());\n Assert.assertEquals(1, response.getQuantity().intValue());\n Assert.assertEquals(true, response.isComplete());\n Assert.assertEquals(Order.StatusEnum.APPROVED, response.getStatus());\n\n verify(exactly(1), postRequestedFor(urlEqualTo(\"/store/order\")));\n }", "Order getOrder();", "String getOrderId();", "public interface StoreService {\n\n void registerOrder(Order order);\n Order getRecievedOrder(String id);\n\n}", "public static String placePostData()\r\n\t{\t\r\n\t\tString res=\"/maps/api/place/add/json\";\r\n\t\treturn res;\r\n\t}", "@PostMapping(value = \"/insertorderdetails\")\r\n public OrderInfo insertDummyOrder(@RequestBody OrderInfo order) \r\n\t\r\n\t{\r\n\t\treturn new OrderService().addOrder(order); //calling the service\r\n }", "@FormUrlEncoded\n @POST(\"UserData/create_order\")\n public Observable<UserDataResponse> CreateOrder(@Field(\"ord_slm_id\") String ord_slm_id,\n @Field(\"ord_dl_id\") String dealer_id,\n @Field(\"sord_prd_id\") String sord_prd_id,\n @Field(\"sord_qty\") String sord_qty,\n @Field(\"sord_price\") String sord_price,\n @Field(\"ord_total\") String ord_total,\n @Field(\"ord_point\") String ord_point,\n @Field(\"sord_point\") String sord_point,\n @Field(\"sord_total\") String sord_total,\n @Field(\"ord_type\") String ord_type,\n @Field(\"ord_dstr_id\") String ord_dstr_id,\n @Field(\"ord_dl_id\") String ord_dl_id);", "public ServiceOrder retrieveServiceOrder( String orderid) {\r\n\t\tlogger.info(\"will retrieve Service Order from catalog orderid=\" + orderid );\r\n\t\ttry {\r\n\t\t\tObject response = template.\r\n\t\t\t\t\trequestBody( CATALOG_GET_SERVICEORDER_BY_ID, orderid);\r\n\t\t\t\r\n\t\t\tif ( !(response instanceof String)) {\r\n\t\t\t\tlogger.error(\"Service Order object is wrong.\");\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t\tlogger.debug(\"retrieveServiceOrder response is: \" + response);\r\n\t\t\tServiceOrder sor = toJsonObj( (String)response, ServiceOrder.class); \r\n\t\t\t\r\n\t\t\treturn sor;\r\n\t\t\t\r\n\t\t}catch (Exception e) {\r\n\t\t\tlogger.error(\"Cannot retrieve Service Order details from catalog. \" + e.toString());\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public CustomerOrder getOrder() {\n return (CustomerOrder) get(\"order\");\n }", "public interface PurchaseOrderService {\n /**\n * create Purchase Order From Boq.\n * @param boqDetail boqDetail\n * @param appUser appUser\n * @return PurchaseOrderHeader\n */\n PurchaseOrderHeader createPoFromBoq(BoqDetail boqDetail, AppUser appUser);\n /**\n * add lines to Purchase Order Header.\n * @param purchaseOrderHeader purchaseOrderHeader\n * @param boqDetail boqDetail\n * @return boolean\n */\n boolean addLineToPoFromBoqDetail(PurchaseOrderHeader purchaseOrderHeader, BoqDetail boqDetail);\n\n /**\n * save Purchase Order Header into database.\n * @param purchaseOrderHeader purchaseOrderHeader\n * @param securityContext securityContext\n * @return response\n */\n CommonResponse savePurchaseOrder(PurchaseOrderHeader purchaseOrderHeader, SecurityContext securityContext);\n\n /**\n * get all purchase Order Header.\n * @return List of PurchaseOrderHeader\n */\n List<PurchaseOrderHeader> getAllPurchaseOrderHeaders();\n\n /**\n * get PurchaseOrderHeader whole oblect per pohId.\n * @param pohId pohId.\n * @return PurchaseOrderHeader\n */\n PurchaseOrderHeader getPurchaseOrderHeaderWhole(long pohId);\n /**\n /**\n * get product purchase items for specific supplier.\n * @param suppId suppId\n * @param searchStr searchStr\n * @return List of PruductPurchaseItem\n */\n List<ProductPurchaseItem> getAllSupplierProductPurchaseItems(long suppId, String searchStr);\n /**\n * get all purchase Order Header.\n * @param supplierId supplierId\n * @return List of PurchaseOrderHeader\n */\n List<PurchaseOrderHeader> getAllPurchaseOrderHeaderPerOrguIdAndSupplierIdAndStatusCode(long supplierId);\n\n /**\n * get all purchase Order Header per orguid and status.\n * @return List of PurchaseOrderHeader\n */\n List<PurchaseOrderHeader> getAllPurchaseOrderHeaderNotFullyReceived();\n\n /**\n * get all purchase Order Header for specific supplier.\n * @param supplierId supplierId\n * @return List of PurchaseOrderHeader\n */\n List<PurchaseOrderHeader> getAllPurchaseOrderHeaderPerOrguIdAndSupplierId(long supplierId);\n /**\n * search purchase order header.\n * @param searchForm searchForm\n * @return List of PurchaseOrderHeader\n */\n List<PurchaseOrderHeader> searchPurchaseOrderHeaders(GeneralSearchForm searchForm);\n\n /**\n * get product purchase item for specific supplier and catalog no.\n * @param suppId suppId\n * @param catalogNo catalogNo\n * @return List of PruductPurchaseItem\n */\n ProductPurchaseItem getSupplierProductPurchaseItemPerCatalogNo(long suppId, String catalogNo);\n\n /**\n * get all purchase Order Header for specific product.\n * @param prodId prodId\n * @return List of PurchaseOrderHeader\n */\n List<PurchaseLine> getAllPurchaseOrderOfProduct(long prodId);\n\n /**\n * search purchase order header.\n * @param searchForm searchForm\n * @return List of PurchaseOrderHeader\n */\n GeneralSearchForm searchPurchaseOrderHeadersPaging(GeneralSearchForm searchForm);\n /**\n * create Purchase Order From Boq.\n * @param txnDetail sale order detail\n * @param appUser appUser\n * @return PurchaseOrderHeader\n */\n PurchaseOrderHeader createPoFromSaleOrder(TxnDetail txnDetail, AppUser appUser);\n\n /**\n * add lines to Purchase Order Header from txn detail.\n * @param purchaseOrderHeader purchaseOrderHeader\n * @param txnDetail txnDetail\n * @return true if successfull, otherwise return false;\n */\n boolean addLineToPoFromTxnDetail(PurchaseOrderHeader purchaseOrderHeader, TxnDetail txnDetail);\n\n /**\n * get all purchase order headers linked to specific sale order.\n * @param txhdId transaction header id.\n * @return List of purchase order linked to sale order\n */\n List<PurchaseOrderHeader> getAllPurchaseOrderOfSaleOrder(long txhdId);\n\n /**\n * update status of linked BOQ.\n * @param pohId purchaes order header id.\n */\n void updatePurchaseOrderLinkedBoqStatus(long pohId);\n\n /**\n * delete purchase order per poh id.\n * @param pohId pohId\n * @return CommonResponse.\n */\n CommonResponse deletePurchaseOrderPerPhoId(long pohId);\n\n /**\n * update order status of linked sales orders.\n * @param pohId purchaes order header id.\n */\n void updatePurchaseOrderLinkedSaleOrderStatus(long pohId);\n\n /**\n * get all IN-PROGRESS and CONFIRMED purchase Order Header.\n * @param supplierId supplierId\n * @return List of PurchaseOrderHeader\n */\n List<PurchaseOrderHeader> getAllOutstandingAndConfirmedPurchaseOrderHeaderPerOrguIdAndSupplierId(long supplierId);\n\n\n /**\n * get product purchase item for specific supplier and catalog no.\n * @param sprcId sprcId\n * @return List of PruductPurchaseItem\n */\n ProductPurchaseItem getProductPurchaseItemPerId(long sprcId);\n}", "@PostMapping(value = \"farmers\")\n @ApiOperation(value = \"Place/create a delivery order\", response = ApiResponse.class)\n public ResponseEntity<ApiResponse> placeOrder(\n @Valid @RequestBody AcceptOrderRequest acceptOrderRequest) {\n var activeOrders =\n doPlaceOrder(acceptOrderRequest)\n .stream()\n .map(ApiMapper::toDeliveryResponse)\n .collect(Collectors.toUnmodifiableList());\n return ApiMapper.buildResponseEntity(activeOrders, HttpStatus.CREATED);\n }", "@PostMapping(\"/add-order\")\n\tpublic ResponseEntity<Object> insertOrder(@RequestBody Order order) {\n\t\tLOGGER.info(\"add-Order URL is opened\");\n\t\tLOGGER.info(\"addOrder() is initiated\");\n\t\tOrderDTO orderDTO = null;\n\t\tResponseEntity<Object> orderResponse = null;\n\t\torderDTO = orderService.addOrder(order);\n\t\torderResponse = new ResponseEntity<>(orderDTO, HttpStatus.ACCEPTED);\n\t\tLOGGER.info(\"addOrder() has executed\");\n\t\treturn orderResponse;\n\t}", "private static String placeOrderResource() {\n return \"/store/order\";\n }", "@GetMapping(\"/order\")\r\n\tprivate ResponseEntity<Object> getAllOrder() \r\n\t{\tOrderDetailsResponse response = new OrderDetailsResponse();\r\n\t\tList<OrderDetailsRequest> ordersDetails = new ArrayList<OrderDetailsRequest>();\r\n\t\tList<OrderDetails> orders = orderService.getAllOrder();\r\n\t\t\r\n\t\tfor(OrderDetails order : orders) {\r\n\t\t\t\r\n\t\t\tOrderDetailsRequest details = new OrderDetailsRequest();\r\n\t\t\tconstructResponseData(order,details);\r\n\t\t\tList<OrderItemDetails> items = restClientService.findByOrderid(order.getId());\r\n\t\t\tdetails.setProductDetails(items);\r\n\t\t\tordersDetails.add(details);\r\n\t\t}\r\n\t\tresponse.setOrders(ordersDetails);\r\n\t\tresponse.setMessage(\"SUCCESS\");\r\n\t\tresponse.setStatus((long) 200);\r\n\t\treturn new ResponseEntity<Object>(response, HttpStatus.OK);\r\n\t}", "private static JSONObject placeOrderByPost(org.json.simple.JSONObject shipMent) throws org.json.simple.parser.ParseException {\n\t\tJSONObject jObject = new JSONObject();\n\t\tString line = \"\";\n\t\tJSONParser parser = new JSONParser();\n\t\tJSONObject newJObject = null;\n\t\tSystem.out.println(\"shipment object-->\"+shipMent.toJSONString());\n\t\ttry{\n\t\t\tDefaultHttpClient client = new DefaultHttpClient();\n\t\t\t//client = (DefaultHttpClient) wrapClient(client);\n\t\t\t/* TESTING URL */\n\t\t\t//String url=\"https://apitest.roadrunnr.in/v1/orders/ship\";\n\t\t\t/* LIVE URL : https://runnr.in/v1/orders/ship\n\t\t\t//String url=\"http://roadrunnr.in/v1/orders/ship\";\n\t\t\t//New url*/\n\t\t\tString url =\"http://api.pickji.com/corporateapi/sandbox/placeorder\";\n\t\t\tHttpPost post = new HttpPost(url.trim());\n\t\t\tStringEntity input = new StringEntity(shipMent.toJSONString());\n\t\t\tpost.addHeader(\"Content-Type\", \"application/json\");\n\t\t\t//post.addHeader(\"Authorization\" , generateAuthToken());\n\t\t\t//post.addHeader(\"Authorization\" ,getToken(false));\n\n\t\t\tpost.setEntity(input);\n\t\t\t//System.out.println(\"StringEntity - - ->\"+input.toString());\n\t\t\tHttpResponse response = client.execute(post);\n\t\t\tBufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent())); \n\t\t\twhile ((line = rd.readLine()) != null) {\n\t\t\t\t// System.out.println(\"Line - - >\"+line);\n\t\t\t\tnewJObject = new JSONObject(line);\n\t\t\t}\n\t\t}catch(UnsupportedEncodingException e){\n\n\t\t}catch(JSONException e){\n\n\t\t} catch (ClientProtocolException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn newJObject; \n\t}", "public interface OrderService {\n\n /**\n * 分页\n * @param rebateVo\n * @return\n */\n PageDTO<RebateDTO> fetchPage(OrderVo rebateVo);\n\n /**\n * 获得订单详细信息\n *\n * @param orderId\n * @return\n */\n OrderDTO getOrder(long orderId);\n\n /**\n * 确认订单\n * @param orderId\n * @return\n */\n OrderDTO sureOrder(long orderId);\n\n}", "@ResponseBody\n @RequestMapping(method = RequestMethod.POST, value = \"/{orderId}/item}\")\n public ResultData viewItem(@PathVariable(\"orderId\") String orderId) {\n ResultData result = new ResultData();\n Map<String, Object> condition = new HashMap<>();\n condition.put(\"orderId\", orderId);\n List<Integer> status = new ArrayList<>(Arrays.asList(OrderStatus.PAYED.getCode(), OrderStatus.PATIAL_SHIPMENT.getCode(), OrderStatus.FULLY_SHIPMENT.getCode(), OrderStatus.FINISHIED.getCode()));\n condition.put(\"status\", status);\n ResultData response = orderService.fetchOrder(condition);\n if (response.getResponseCode() == ResponseCode.RESPONSE_OK) {\n Order order = ((List<Order>) response.getData()).get(0);\n\n }\n return result;\n }", "public interface OrderService {\n\n /**\n * 司机发布信息\n *\n * @param idno\n * @param driverShareInfo\n * @return\n */\n DriverShareInfo shareDriverInfo(String idno, DriverShareInfo driverShareInfo);\n\n /**\n * 乘客预定校验\n *\n * @param idno\n * @param driverOrderId\n * @param passerOrderId\n * @param genToken\n * @return\n */\n Result passerReserveCheck(String idno, Long driverOrderId, Long passerOrderId, boolean genToken);\n\n /**\n * 乘客预定\n *\n * @param radomToken\n * @param idno\n * @param driverOrderId\n * @param passerOrderId\n * @return\n */\n Result passerReserve(String radomToken, String idno, Long driverOrderId, Long passerOrderId);\n\n\n}", "public String getOrderDetails(String symbol,String currency) \r\n\t{\r\n\t\t//timestamp is mandatory one \t\t\r\n\t\tWebTarget target = getTarget().path(RESOURCE_OPENORDER);\r\n\t\t Map<String, String> postData = new TreeMap<String, String>();\r\n\t\t//symbol is not mandatory one\r\n\t\tif(symbol!= null && !symbol.equalsIgnoreCase(\"\") && currency!=null && !currency.equalsIgnoreCase(\"\")) \r\n\t\t{\r\n\t\t\t postData.put(CURRENCY_PAIR, getSymbolForExchange(symbol,currency));\r\n\t\t}\t\r\n\t\t\r\n String queryString = buildQueryString(postData);\r\n TradeLogger.LOGGER.finest(\"QueryString to generate the signature \" + queryString);\t\r\n \r\n\t\tString signature = generateSignature(queryString);\r\n\t\tTradeLogger.LOGGER.finest(\"Signature Genereated \" + signature);\r\n\t\tString returnValue= null;\r\n\t\tif(signature!= null )\r\n\t\t{\t\r\n\t\t\ttarget = addParametersToRequest(postData, target);\r\n\t\t\tTradeLogger.LOGGER.finest(\"Final Request URL : \"+ target.getUri().toString());\r\n\t\t\tResponse response = target.request(MediaType.APPLICATION_JSON).header(APIKEY_HEADER_KEY,API_KEY).header(\"Sign\", signature).get();\r\n\t\t\t\t\r\n\t\t\tif(response.getStatus() == 200) \r\n\t\t\t{\r\n\t\t\t\treturnValue = response.readEntity(String.class);\r\n\t\t\t\tTradeLogger.LOGGER.info(returnValue);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tTradeLogger.LOGGER.severe(\"Response Code \" + response.getStatus());\r\n\t\t\t\tTradeLogger.LOGGER.severe(\"Response Data \" + response.readEntity(String.class));\r\n\t\t\t}\r\n\t\t\tresponse.close();\r\n\t\t}\r\n\t\treturn returnValue;\r\n\r\n\t}", "private Order getIntentData(Intent intent) {\n\t\treturn intent != null ? (Order) intent\n\t\t\t\t.getSerializableExtra(TarrifActivity.TICKET_CONTIANS_ORDER_SERIALIZABLE_KEY)\n\t\t\t\t: null;\n\t}", "public interface OrderManager {\n\n\n OrderDTO getOrderDTO(Long orderId,Long sellerid,String appKey);\n\n List<OrderDTO> queryOrder(OrderQTO orderQTO, String appKey) throws ItemException;\n}", "public interface RegisterOrderUseCase {\n\n Map<String, String> putOrderInCart(ClientOrder order);\n\n}", "void getOrders();", "public List getOrderDetails(OrderDetail orderDetail);", "@Override\n\tpublic OrderResponseDto createOrder(OrderRequestDto orderRequestDto) {\n\t\tLOGGER.info(\"Enter into order service impl\");\n\n\t\tOptional<Stocks> stock = stockRepository.findById(orderRequestDto.getStockId());\n\t\tOptional<User> user = userRepository.findById(orderRequestDto.getUserId());\n\n\t\tif (!stock.isPresent())\n\t\t\tthrow new CommonException(TradingConstants.ERROR_STOCK_NOT_FOUND);\n\t\tif (!user.isPresent())\n\t\t\tthrow new CommonException(TradingConstants.ERROR_USER_NOT_FOUND);\n\t\tif (orderRequestDto.getStockQuantity() >= 100)\n\t\t\tthrow new CommonException(TradingConstants.ERROR_QUANTITY);\n\t\tDouble brokeragePercent = Double.valueOf(stock.get().getBrokerageAmount() / 100d);\n\t\tDouble brokerageAmount = stock.get().getStockPrice() * orderRequestDto.getStockQuantity() + brokeragePercent;\n\t\tDouble totalPrice = stock.get().getStockPrice() * orderRequestDto.getStockQuantity() + brokerageAmount;\n\n\t\tOrders orders = Orders.builder().stockId(stock.get().getStockId())\n\t\t\t\t.stockQuantity(orderRequestDto.getStockQuantity()).totalPrice(totalPrice)\n\t\t\t\t.stockStatus(StockStatus.P.toString()).userId(orderRequestDto.getUserId()).build();\n\t\torderRepository.save(orders);\n\t\tResponseEntity<GlobalQuoteDto> latest = latestStockPrice(stock.get().getStockName());\n\t\treturn new OrderResponseDto(orders.getOrderId(), stock.get().getStockPrice(),\n\t\t\t\tlatest.getBody().getGlobalQuote().getPrice());\n\t}", "public Order getOrder() {\n return order;\n }", "public interface OrderService {\n\n /**\n * 查询订单列表\n *\n * @param userId userId\n * @param pageNum pageNum\n * @param pageSize pageSize\n * @return pageInfo\n */\n ServerResponse<PageInfo> list(Integer userId, int pageNum, int pageSize);\n\n /**\n * 创建订单\n *\n * @param userId userId\n * @param shippingId shippingId\n * @return orderVo\n */\n ServerResponse insert(Integer userId, Integer shippingId);\n\n /**\n * 取消订单\n *\n * @param userId userId\n * @param orderNo orderNo\n * @return 取消的结果\n */\n ServerResponse<String> delete(Integer userId, Long orderNo);\n\n /**\n * 查询购物车商品\n *\n * @param userId userId\n * @return orderProductVO\n */\n ServerResponse getOrderCartProduct(Integer userId);\n\n /**\n * 查询订单详情\n *\n * @param userId userId\n * @param orderNo orderNo\n * @return orderVo\n */\n ServerResponse<OrderVO> getOrderDetail(Integer userId, Long orderNo);\n\n /**\n * 管理员查询所有订单\n *\n * @param pageNum pageNum\n * @param pageSize pageSize\n * @return 订单列表\n */\n ServerResponse<PageInfo> listOfAdmin(int pageNum, int pageSize);\n\n /**\n * 查看订单详情\n *\n * @param orderNo orderNo\n * @return 订单详情\n */\n ServerResponse<OrderVO> detail(Long orderNo);\n\n /**\n * 搜索订单\n *\n * @param orderNo orderNo\n * @param pageNum pageNum\n * @param pageSize pageSize\n * @return 搜索结果\n */\n ServerResponse<PageInfo> search(Long orderNo, int pageNum, int pageSize);\n\n /**\n * 发货\n *\n * @param orderNo orderNo\n * @return 发货结果\n */\n ServerResponse<String> sendGoods(Long orderNo);\n\n /**\n * 订单支付\n *\n * @param userId userId\n * @param orderNo orderNo\n * @param path path\n * @return 支付结果\n */\n ServerResponse pay(Integer userId, Long orderNo, String path);\n\n /**\n * 支付宝回调\n *\n * @param params params\n * @return 更新结果\n */\n ServerResponse alipayCallback(Map<String, String> params);\n\n /**\n * 查询订单支付状态\n *\n * @param userId userId\n * @param orderNo orderNo\n * @return 支付状态\n */\n ServerResponse queryOrderPayStatus(Integer userId, Long orderNo);\n}", "@POST\n\t@Consumes(MediaType.APPLICATION_JSON)\n\tpublic Response postOrder(Order order) {\n\t\tif (order == null) {\n\t\t\treturn RestResponse.BAD();\n\t\t}\n\t\tString hash_uid = UserUtils.getCurrentUserObscureID();\n\t\tList<String> meats = order.getMeats();\n\t\tString meat1 = null;\n\t\tString meat2 = null;\n\t\tString meat3 = null;\n\t\tif (meats != null && meats.size() > 0) {\n\t\t\tint i = meats.size();\n\t\t\tif (i == 3) {\n\t\t\t\tmeat3 = meats.get(3);\n\t\t\t\ti--;\n\t\t\t}\n\t\t\tif (i == 2) {\n\t\t\t\tmeat2 = meats.get(2);\n\t\t\t\ti--;\n\t\t\t}\n\t\t\tif (i == 1) {\n\t\t\t\tmeat1 = meats.get(1);\n\t\t\t}\n\t\t}\n\t\tList<String> vegs = order.getVegs();\n\t\tString veg1 = null;\n\t\tString veg2 = null;\n\t\tString veg3 = null;\n\t\tif (vegs != null && vegs.size() > 0) {\n\t\t\tint i = vegs.size();\n\t\t\tif (i == 3) {\n\t\t\t\tveg3 = vegs.get(3);\n\t\t\t\ti--;\n\t\t\t}\n\t\t\tif (i == 2) {\n\t\t\t\tveg2 = vegs.get(2);\n\t\t\t\ti--;\n\t\t\t}\n\t\t\tif (i == 1) {\n\t\t\t\tveg1 = vegs.get(1);\n\t\t\t}\n\t\t}\n\t\treturn newOrder(hash_uid, order.getPizzaShop(), order.getSize(),\n\t\t\t\torder.getCrust(), order.getCheese(), order.getSauce(), meat1,\n\t\t\t\tmeat2, meat3, veg1, veg2, veg3);\n\t}", "public interface IOrderDetails {\n String getOrderNumber();\n String getOrderDate();\n String getTrainNumber();\n String getDispatchStation();\n String getDestinationStation();\n String getDepartureDate();\n String getArrivalDate();\n String getWagonRoad();\n String getWagonOwner();\n String getWagonNumber();\n String getWagonType();\n String getNumberOfSeats();\n String getSeats();\n String getAdditionalInformation();\n String getPrice();\n String getOrderState();\n String getEcState();\n String getEcDate();\n}", "public interface OpenOrder {\n\n /**\n * Returns the ID for this order.\n *\n * @return the ID of the order.\n */\n String getId();\n\n /**\n * Returns the exchange date/time the order was created.\n *\n * @return The exchange date/time.\n */\n Date getCreationDate();\n\n /**\n * Returns the id of the market this order was placed on.\n *\n * @return the id of the market.\n */\n String getMarketId();\n\n /**\n * Returns the type of order. Value will be {@link OrderType#BUY} or {@link OrderType#SELL}.\n *\n * @return the type of order.\n */\n OrderType getType();\n\n /**\n * Returns the price per unit for this order. This is usually in BTC or USD.\n *\n * @return the price per unit for this order.\n */\n BigDecimal getPrice();\n\n /**\n * Returns the Quantity remaining for this order. This is usually the amount of the other currency\n * you want to trade for BTC/USD.\n *\n * @return the Quantity remaining for this order.\n */\n BigDecimal getQuantity();\n\n /**\n * Returns the Original total order quantity. If the Exchange does not provide this information,\n * the value will be null. This is usually the amount of the other currency you want to trade for\n * BTC/USD.\n *\n * @return the Original total order quantity if the Exchange provides this information, null\n * otherwise.\n */\n BigDecimal getOriginalQuantity();\n\n /**\n * Returns the Total value of order (price * quantity). This is usually in BTC or USD.\n *\n * @return the Total value of order (price * quantity).\n */\n BigDecimal getTotal();\n}", "com.google.protobuf.ByteString\n getOrderIdBytes();", "public interface OrderService {\r\n\r\n /**\r\n * 创建订单\r\n * @param orderDTO\r\n * @return\r\n */\r\n OrderDTO create(OrderDTO orderDTO);\r\n\r\n /**\r\n * 完结订单(只能卖家操作)\r\n * @param orderId\r\n * @return\r\n */\r\n OrderDTO finish(String orderId);\r\n}", "private static RequestSpecification placeOrderRequest(long id, long petId, int quantity, String shipDate, String status, boolean completed) {\n RestAssured.baseURI = MicroservicesEnvConfig.BASEURL;\n RestAssured.config = RestAssured.config().logConfig(LogConfig.logConfig().defaultStream(RSLOGGER.getPrintStream()));\n\n APILogger.logInfo(LOGGER,\"Place Store Order service Request...\");\n return RestAssured.given().header(\"Content-Type\", \"application/json\").body(placeOrderPayload(id, petId, quantity, shipDate, status, completed)).log().all();\n }", "@Override\n public void onClick(View v) {\n\n String order = sendOrder(parcelCart);\n\n String orderPost = \"http://project-order-food.appspot.com/send_order\";\n final PostTask sendOrderTask = new PostTask(); // need to make a new httptask for each request\n try {\n // try the getTask with actual location from gps\n sendOrderTask.execute(orderPost, order).get(30, TimeUnit.SECONDS);\n Log.d(\"httppost\", order);\n }\n catch (Exception e)\n {\n e.printStackTrace();\n }\n\n Log.d(\"Button\", \"clicked\");\n Log.d(\"sendorder\", sendOrder(parcelCart));\n Toast toast = Toast.makeText(getApplication().getBaseContext(), \"Order Placed!\", Toast.LENGTH_LONG);\n toast.show();\n }", "OrderDto map(Order order);", "public interface OrderService {\n OrderDto makeOrder(OrderDto orderDto);\n\n List<OrderDto> getAllOrders(String userPhone);\n\n void removeOrderById(Long id);\n\n boolean getOrderById(Long id);\n\n List<OrderDto> getAllOrders();\n\n List<OrdersEntity> getOrders();\n\n OrderDto acceptOrder(OrderDto orderDto);\n\n List<OrderDto> getAcceptOrders(String driverPhone);\n\n OrderDto removeAcceptedOrder(Long id);\n}", "public interface OrderService {\n\n void makeOrder(Order order);\n}", "@ApiMethod(name = \"getOrder\", httpMethod = ApiMethod.HttpMethod.POST)\n public Order getOrder(OrderPackage orderPackage) throws MOHException{\n\n EntityManager productManager = EMFProduct.get().createEntityManager();\n EntityManager userManager = EMFUser.get().createEntityManager();\n Order order = orderPackage.getOrder();\n Identify identify = orderPackage.getIdentify();\n Status status;\n try {\n status = verifyIdentity(identify, userManager);\n if(status!=Status.USER_ALREADY_EXISTS) throw new MOHException(status.getMessage(),status.getCode());\n identify = (Identify) status.getResponse();\n\n order = productManager.find(Order.class,order.getId_order());\n for(CustomerOrder co: order.getCustomerOrders())\n if(co.getId_customer()==identify.getUser().getId_user())\n return order;\n\n throw new MOHException(\"The user is not in the order\", MOHException.STATUS_OBJECT_NOT_ACCESSIBLE);\n\n }finally {\n productManager.close();\n }\n\n\n }", "@Override\n\tpublic Order getRawCopy(){\n\t\treturn new TaskOrder(details.getRawCopy());\n\t}", "List<Order> getOpenOrders(OpenOrderRequest orderRequest);", "public interface OrderService {\n /**\n * Create new order object and put it to database\n *\n * @param cart cart with data about new order\n * @param user session user - order owner\n * @throws FlowerValidationException if flowers count in cart more then count in shop\n * @see Cart\n */\n void create(Cart cart, User user) throws FlowerValidationException;\n\n /**\n * Change order status in database to PAID\n *\n * @param order order to update\n * @see flowershop.backend.enums.OrderStatus\n */\n void pay(Order order);\n\n /**\n * Change order status in database to CLOSED\n *\n * @param order order to update\n * @see flowershop.backend.enums.OrderStatus\n */\n void close(Order order);\n\n /**\n * Delete corresponding order object from database\n *\n * @param id order id to delete\n */\n void delete(Long id);\n\n /**\n * Find order in database with given id\n *\n * @param id order id\n * @return Order dto\n */\n Order find(Long id);\n\n /**\n * Get all orders from database\n *\n * @return orders list\n */\n List<Order> getAll();\n\n /**\n * Get all orders of given user from database\n *\n * @param user orders owner\n * @return orders list\n */\n List<Order> getByUser(User user);\n\n /**\n * Get items list (bought flowers) of given order\n *\n * @param order order to get details\n * @return items list (bought flowers)\n * @see OrderFlowerData\n */\n List<OrderFlowerData> getFlowersData(Order order);\n\n /**\n * Generates detailed cart from regular cart to represent data\n *\n * @param cart Cart to be detailed\n * @return DetailedCart\n * @see Cart\n * @see DetailedCart\n */\n DetailedCart generateDetailedCart(Cart cart);\n}", "public interface IOrderService {\n ServerResponse pay(Long orderNo, Long userId, String path);\n\n ServerResponse aliCallback(Map<String, String> params);\n\n ServerResponse queryOrderPayStatus(Long userId, Long orderNo);\n\n ServerResponse createOrder(Long userId, Integer shippingId);\n\n ServerResponse<String> cancel(Long userId, Long orderNo);\n\n ServerResponse getOrderCartProduct(Long userId);\n\n ServerResponse<OrderVo> getOrderDetail(Long userId, Long orderNo);\n\n ServerResponse<PageInfo> getOrderList(Long userId, int pageNum, int pageSize);\n\n //backend\n ServerResponse<PageInfo> manageList(int pageNum, int pageSize);\n\n ServerResponse<OrderVo> manageDetail(Long orderNo);\n\n ServerResponse<PageInfo> manageSearch(Long orderNo, int pageNum, int pageSize);\n\n ServerResponse<String> manageSendGoods(Long orderNo);\n\n}", "OrderType getOrderType();", "List<OrderDTORest> getAllOrdersDTORest();", "@Test\n\tpublic void getOrderTest() {\n\t\tOrderDTO order = service.getOrder(2);\n\n\t\tassertEquals(3, order.getClientId());\n\t\tassertEquals(\"BT Group\", order.getInstrument().getName());\n\t\tassertEquals(\"BT\", order.getInstrument().getTicker());\n\t\tassertEquals(30.0, order.getPrice(), 1);\n\t\tassertEquals(500, order.getQuantity());\n\t\tassertEquals(OrderType.SELL, order.getType());\n\t}", "List<OrderDto> getOrders();", "public Payload.Outbound getOutboundPayload();", "List<OrderDto> getAllOrders(String restaurantId);", "public interface OrderMapper<OrderPojo> {\n\n\n String setOrder(OrderPojo model);\n List<OrderPojo> getOrderList(List<String> orderIds,String searchWord);\n PageInfo getOrderList(List<Map> taskInfoList, String searchWord, Integer page, Integer size);\n OrderPojo getOrderInfo(String orderId);\n boolean deleteOrder(String id);\n String getProcessDefinitionId();\n List<OrderPojo> getOrderByTime(Date startTime,Date endTime);\n boolean doAfterCommit(ClaimInfo claimInfo , TaskInfo taskInfo);\n boolean setProInsId(String orderId , String proInsId);\n boolean setOrderStatus(String orderId , String orderStatus);\n PageInfo getOrderListByQueryCriteria(Map queryCriteria, Integer page, Integer size);\n}", "public Order getOrder() {\n return this.order;\n }", "@POST\r\n\t@Produces({\"application/xml\" , \"application/json\"})\r\n\t@Path(\"/order\")\r\n\tpublic String addOrder(OrderRequest orderRequest) {\n\t\tOrderActivity ordActivity = new OrderActivity();\r\n\t\treturn ordActivity.addOrder(orderRequest.getOrderDate(),orderRequest.getTotalPrice(), orderRequest.getProductOrder(),orderRequest.getCustomerEmail());\r\n\t}", "public interface OrderProductService {\n\n public void save(OrderProductDTO orderProductDTO);\n\n public List<OrderProductDTO> getOrderedProductsByOrderId(int orderId, int userId);\n}", "public JSONArray getOrders() throws Exception;", "@CrossOrigin(origins = \"http://localhost:8000\")\n @ApiOperation(value = \"Add a new order\", response = PizzaOrder.class, produces = \"application/json\")\n @RequestMapping(value = \"/orders\", method = RequestMethod.POST, consumes = \"application/json\")\n public PizzaOrder addPizzaOrder(\n @ApiParam(value = \"New pizza order to add\", required = true) @RequestBody PizzaOrder pizzaOrder) {\n\t\t \n\tlogger.info(\"TrackingId:89a80896-35a4-468c-9ec3-b762ab161429|ClientId:89a80897-35a4-468c-9ec3-b762ab161429|Pizza Ordered : {}\",pizzaOrder.getId());\t \n return pizzaOrderService.addOrder(pizzaOrder);\n }", "PurchaseOrderHeader createPoFromSaleOrder(TxnDetail txnDetail, AppUser appUser);", "@RequestMapping(value = \"/\", method = RequestMethod.POST)\n public ResponseEntity create(@RequestBody Order order)\n {\n throw new NotImplementedException();\n }", "public String gatherOrder(View view) {\n\n // get user input\n EditText userInputNameView = (EditText) findViewById(R.id.user_input);\n String userInputName = userInputNameView.getText().toString();\n\n // check if whipped cream is selected\n CheckBox extraCheese = (CheckBox) findViewById(R.id.extra_cheese_checked);\n boolean hasExtraCheese = extraCheese.isChecked();\n\n // check if pepperoni is selected\n CheckBox pepperoni = (CheckBox) findViewById(R.id.pepperoni_checked);\n boolean hasPepperoni = pepperoni.isChecked();\n\n // check if pepperoni is selected\n CheckBox hawaiian = (CheckBox) findViewById(R.id.hawaiian_checked);\n boolean hasHawaiin = hawaiian.isChecked();\n\n Spinner crust = (Spinner) findViewById(R.id.crust_spinner);\n String crustType = crust.getSelectedItem().toString();\n\n Spinner size = (Spinner) findViewById(R.id.size_spinner);\n String sizeVal = size.getSelectedItem().toString();\n\n // calculate and store the total price\n double totalPrice = calculatePrice(hasExtraCheese, hasPepperoni, hasHawaiin, sizeVal);\n\n // create and store the order summary\n String orderSummaryMessage = createOrderSummary(userInputName, hasExtraCheese, hasPepperoni,\n hasHawaiin, crustType, sizeVal, totalPrice);\n\n // Write the relevant code for making the buttons work(i.e implement the implicit and explicit intents\n return orderSummaryMessage;\n }", "public interface ReceiveThirdDataService {\n\n /**\n * 解析第三数据,每叫号业务推送\n *\n * @param courtTakeNumPojo\n * @return\n */\n RestApiMsg<String> transferThirdData(CourtTakeNumPojo courtTakeNumPojo, HttpServletRequest request);\n}", "public String getServiceOrderNumber() {\n return serviceOrderNumber.get();\n }", "public ComplexOrderEntryTO[] getStockItems(long storeID, ProductTO[] requiredProductTOs) throws NotImplementedException;", "Order getOrderStatus(OrderStatusRequest orderStatusRequest);", "private Order convertOrderElemeToOrderObj04(ISqlAdapter adapter, String orderId) throws HitspException {\n SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n SimpleDateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss\");\r\n DataTable dtOrderEleme = getOrderElemeInfo(adapter, orderId);\r\n if (dtOrderEleme == null || dtOrderEleme.size() == 0) {\r\n return null;\r\n }\r\n\r\n Order order = new Order();\r\n if (!Converter.toBoolean(dtOrderEleme.get(0, \"book\"))) {\r\n //若该订单非预订单\r\n order.setDeliverTime(null);\r\n } else {\r\n //若该订单为预订单\r\n formatter.setTimeZone(TimeZone.getTimeZone(\"GMT+8\"));\r\n// Date b = formatter.parse(a);\r\n// order.setDeliverTime(Converter.toDate(dtOrderEleme.get(0, \"deliverTime\")));\r\n try {\r\n order.setDeliverTime(formatter.parse(dtOrderEleme.get(0, \"deliverTime\")));\r\n } catch (ParseException e) {\r\n logger.error(\"预计送达时间处理错误\");\r\n }\r\n }\r\n order.setOrderId(dtOrderEleme.get(0, \"orderId\"));\r\n order.setId(Converter.toLong(orderId));\r\n\r\n String udate = dtOrderEleme.get(0, \"activeAt\");\r\n String cdate = dtOrderEleme.get(0, \"createdAt\");\r\n try {\r\n Date uDate = df.parse(udate);\r\n Date cDate = df.parse(cdate);\r\n order.setGmtCreate(cDate);\r\n order.setGmtModify(uDate);\r\n } catch (ParseException e) {\r\n logger.error(\"下单时间处理错误\");\r\n }\r\n\r\n order.setOrderFrom(\"15\");\r\n order.setTotalPrice(Converter.toBigDecimal(dtOrderEleme.get(0, \"totalPrice\")));\r\n order.setOriginalPrice(Converter.toBigDecimal(dtOrderEleme.get(0, \"originalPrice\")));\r\n order.setStatus(\"0\");\r\n String elemeShopId = dtOrderEleme.get(0, \"shopId\");\r\n DataTable dtShop = getShopInfoByElemeShopId(adapter, elemeShopId);\r\n if (dtShop == null || dtShop.size() == 0) {\r\n logger.error(\"饿了么({})门店不存在\", elemeShopId);\r\n return null;\r\n }\r\n\r\n order.setShopId(dtShop.get(0, \"id\"));\r\n order.setShopName(dtShop.get(0, \"name\"));\r\n// order.setShopAddress(dtOrderEleme.get(0, \"address\"));\r\n order.setShopAddress(\"\");//饿了么推送订单中无门店地址,暂置为空\r\n order.setShopPhone(null);\r\n order.setRecipientName(dtOrderEleme.get(0, \"consignee\"));\r\n order.setRecipientAddress(dtOrderEleme.get(0, \"deliveryPoiAddress\"));\r\n\r\n StringBuilder phones = new StringBuilder();\r\n JSONArray phoneList = JSON.parseArray(dtOrderEleme.get(0, \"phoneList\"));\r\n if (phoneList != null) {\r\n for (int i = 0; i < phoneList.size(); i++) {\r\n String phone = phoneList.getString(i);\r\n if (i != 0) {\r\n phones.append(\";\");\r\n }\r\n phones.append(phone);\r\n }\r\n }\r\n order.setRecipientPhone(phones.toString());\r\n\r\n order.setRecipientLongitude(Converter.toBigDecimal(dtOrderEleme.get(0, \"deliveryGeo\").split(\",\")[0]));\r\n order.setRecipientLatitude(Converter.toBigDecimal(dtOrderEleme.get(0, \"deliveryGeo\").split(\",\")[1]));\r\n order.setShippingType(\"10\");\r\n order.setShippingFee(dtOrderEleme.get(0, \"deliverFee\") == null ? BigDecimal.valueOf(0) : Converter.toBigDecimal(dtOrderEleme.get(0, \"deliverFee\")));\r\n order.setShipperName(null);\r\n order.setShipperPhone(null);\r\n order.setHasInvoiced(Converter.toBoolean(dtOrderEleme.get(0, \"invoiced\")));\r\n order.setInvoiceTitle(dtOrderEleme.get(0, \"invoice\"));\r\n order.setPackageFee(Converter.toBigDecimal(dtOrderEleme.get(0, \"packageFee\")));\r\n order.setPayType(Converter.toBoolean(dtOrderEleme.get(0, \"onlinePaid\")) == false ? \"1\" : \"2\");\r\n order.setCaution(dtOrderEleme.get(0, \"description\"));\r\n order.setRemark(\"\");\r\n BigDecimal shopPart = Converter.toBigDecimal(dtOrderEleme.get(0, \"shopPart\"));\r\n if (shopPart.signum() == -1) {\r\n shopPart = shopPart.abs();\r\n }\r\n order.setShopPart(shopPart);\r\n order.setShopIncome(Converter.toBigDecimal(dtOrderEleme.get(0, \"income\")));\r\n BigDecimal serviceFee = Converter.toBigDecimal(dtOrderEleme.get(0, \"serviceFee\"));\r\n if (serviceFee.signum() == -1) {\r\n serviceFee = serviceFee.abs();\r\n }\r\n order.setServiceFee(serviceFee);\r\n// List<OrderDetail> detailList = convertOrderElemeToOrderDetailList(adapter, dtOrderEleme);\r\n List<OrderDetail> detailList = convertOrderElemeToOrderDetailList04(adapter, dtOrderEleme, dtShop.get(0, \"id\"));\r\n order.setDetail(detailList);\r\n return order;\r\n }", "@Path(\"showorder\")\n @GET\n @Produces(MediaType.TEXT_PLAIN)\n public String getOrder(@QueryParam(\"jsonpcallback\") String jsonpcallback) {\n return jsonpcallback + \"(\" + os.getAllOrders().toJSONString() + \")\";\n }", "public interface OrderService {\n Order create(Order order);\n Order update(Order order);\n boolean delete(Order order);\n Order get(int id);\n Collection<Order> get();\n}", "void getMarketOrders();", "public ServiceOrderRecord(Integer orderId, Integer storeId, String orderSn, Integer userId, Byte orderStatus, String orderStatusName, String subscriber, String mobile, Integer serviceId, Integer technicianId, String technicianName, String serviceDate, String servicePeriod, String addMessage, String adminMessage, String verifyCode, String verifyAdmin, String payCode, String payName, String paySn, BigDecimal moneyPaid, BigDecimal discount, Integer couponId, BigDecimal orderAmount, Timestamp payTime, Timestamp cancelledTime, Timestamp finishedTime, String prepayId, Byte delFlag, Byte verifyType, String cancelReason, Byte type, Byte verifyPay, String aliTradeNo, Timestamp createTime, Timestamp updateTime, String memberCardNo, BigDecimal memberCardBalance, BigDecimal useAccount) {\n super(ServiceOrder.SERVICE_ORDER);\n\n set(0, orderId);\n set(1, storeId);\n set(2, orderSn);\n set(3, userId);\n set(4, orderStatus);\n set(5, orderStatusName);\n set(6, subscriber);\n set(7, mobile);\n set(8, serviceId);\n set(9, technicianId);\n set(10, technicianName);\n set(11, serviceDate);\n set(12, servicePeriod);\n set(13, addMessage);\n set(14, adminMessage);\n set(15, verifyCode);\n set(16, verifyAdmin);\n set(17, payCode);\n set(18, payName);\n set(19, paySn);\n set(20, moneyPaid);\n set(21, discount);\n set(22, couponId);\n set(23, orderAmount);\n set(24, payTime);\n set(25, cancelledTime);\n set(26, finishedTime);\n set(27, prepayId);\n set(28, delFlag);\n set(29, verifyType);\n set(30, cancelReason);\n set(31, type);\n set(32, verifyPay);\n set(33, aliTradeNo);\n set(34, createTime);\n set(35, updateTime);\n set(36, memberCardNo);\n set(37, memberCardBalance);\n set(38, useAccount);\n }", "public interface OrderProcessing extends Serializable {\n\t// Used by\n\tpublic void newOrder(Basket bought) // Cashier\n\t\t\tthrows OrderException;\n\n\tpublic int uniqueNumber() // Cashier\n\t\t\tthrows OrderException;\n\n\tpublic Basket getOrderToPick() // Picker\n\t\t\tthrows OrderException;\n\n\tpublic boolean informOrderPicked(int orderNum) // Picker\n\t\t\tthrows OrderException;\n\n\tpublic boolean informOrderCollected(int orderNum) // Collection\n\t\t\tthrows OrderException;\n\n\tpublic Map<String, List<Integer>> getOrderState() // Display\n\t\t\tthrows OrderException;\n}", "public interface OrderService {\n /**\n * Save a order\n * \n * @param object\n * @return just saved profile\n */\n Order save(Order object);\n\n /**\n * Get all the order\n * \n * @return all the order\n */\n Collection<Order> getAll();\n\n /**\n * Get all the user profile filtered on user and project\n * \n * @param user\n * @param project\n * @param filterDate\n * @param filterDeliveredDate\n * @param filterStatus\n * @param firstResult\n * @param excludeCancelled\n * @param maxResult\n * @param sortProperty\n * @param isAscending\n * @return all the user profile\n */\n Collection<Order> get(User user, Project project, Date filterDate, Date filterDeliveredDate, OrderStatus filterStatus, boolean excludeCancelled, int firstResult,\n int maxResult, String sortProperty, boolean isAscending);\n\n /**\n * Remove a profile\n * \n * @param order\n */\n void remove(Order order);\n\n /**\n * Cancel an order\n * \n * @param order\n * @param user user is performing the action\n * \n */\n Order cancel(Order order, User user);\n\n /**\n * Return the order by id\n * \n * @param id\n * @return user with the passed email\n */\n Order getByID(String id);\n\n /**\n * place a new order\n * \n * @param order the new order to insert\n * @param project project relates to order\n * @param user user that place the order\n * @return\n */\n Order placeNewOrder(Order order, Project project, User user);\n\n /**\n * Creates a {@link ProductOrdered} with correct data, adds the new ProductOrdered to the Order, recalculates all the prices and discounts. <strong>NOT persists</strong>\n * \n * @param order\n * @param product\n * @param project\n * @param numberOfProds\n\n * @return\n */\n ProductOrdered addProductOrdered(Order order, Product product, Project project, int numberOfProds);\n\n /**\n * Remove a {@link ProductOrdered} from the given order, recalculates all the prices and discounts on the order.<strong>NOT persists</strong>\n * \n * @param order\n * @param productOrderedIndex position on the list of product to be removed\n * \n */\n void removeProductOrdered(Order order, int productOrderedIndex);\n\n /**\n * \n * @param user\n * @param project\n * @return\n */\n List<Date> getDates(User user, Project project);\n\n /**\n * \n * @param user\n * @param project\n * @return\n */\n List<Date> getDeliveredDates(User user, Project project);\n\n /**\n * Send mail notification, <b>Note</b>: <b>notificationEnabled</b> properties must be set to true\n * \n * @param order\n * @return\n */\n Order sendNotificationNewOrder(Order order);\n\n /**\n * Sets this order as in charge \n * \n * @param order\n * @param user user is performing the action\n * @return\n */\n Order setAsInCharge(Order order, User user);\n\n /**\n * Remove this order as in charge \n * \n * @param order\n * @param user user is performing the action\n * @return\n */\n Order removeInCharge(Order order, User user);\n\n /**\n * Sets this order as \"sent\" \n * \n * @param order\n * @param user user is performing the action\n * @return\n */\n Order setSentStatus(Order order, User user);\n\n /**\n * Remove this order as \"sent\" \n * \n * @param order\n * @param user user is performing the action\n * @return\n */\n Order removeSentStatus(Order order, User user);\n\n /**\n * Sets this order as \"delivered\" \n * \n * @param order\n * @param user user is performing the action\n * @param deliveredTime \n * @return\n */\n Order setDeliveredStatus(Order order, User user, Date deliveredTime);\n\n /**\n * Remove this order as \"delivered\" \n * \n * @param order\n * @param user user is performing the action\n * @return\n */\n Order removeDeliveredStatus(Order order, User user);\n\n /**\n * Sets this order as \"InvoiceApproved\" \n * \n * @param order\n * @param user user is performing the action\n * @param invoiceDate\n * @param invoiceDueDate \n * @return\n */\n Order setInvoiceApprovedStatus(Order order, User user);\n\n /**\n * Removes this order as \"InvoiceApproved\" \n * \n * @param order\n * @param user user is performing the action\n * @return\n */\n Order removeInvoiceApprovedStatus(Order order, User user);\n\n /**\n * Sets this order as \"InvoiceCreated\" \n * \n * @param order\n * @param user user is performing the action\n * @param invoiceDate\n * @param invoiceDueDate data di pagamento prevista \n * @return\n */\n Order setInvoiceCreatedStatus(Order order, User user, Date invoiceDate, Date invoiceDueDate);\n\n /**\n * Sets this order as \"PaidInvoice\" \n * \n * @param order\n * @param user user is performing the action\n * @return\n */\n Order setInvoicePaidStatus(Order order, User user);\n\n /**\n * Remove this order as \"InvoiceCreated\" \n * \n * @param order\n * @param user user is performing the action\n * @return\n */\n Order removeInvoiceCreatedStatus(Order order, User user);\n\n /**\n * Set the OrderStatus \n * \n * @param orderStatus\n * @param order\n * @param user user is performing the action\n * @return\n */\n Order setStatus(OrderStatus orderStatus, Order order, User user);\n\n /**\n * Set order on the given dates/project in charge\n * \n * @param user\n * @param project\n * @param date\n * @return\n */\n void setAsInCharge(User user, Project project, Date date);\n\n /**\n * Get products base on the given order properties\n * \n * @param order\n * @return\n */\n List<Product> getProducts(Order order);\n\n // /**\n // * \n // * @param o\n // * @return\n // */\n // Order applyDiscountIfApplicable(Order o);\n //\n // \n // /**\n // * \n // * @param o\n // * @return\n // */\n // Order applyFreeShippingCostIfApplicable(Order o);\n\n /**\n * \n * @param order\n * @return\n */\n boolean isOrderValid(Order order);\n\n String getNotesForDisplay(Order o);\n\n String getNotesForPDF(Order order);\n\n /**\n * Force discount on existing order <b>Use with caution</b>\n * \n * @param order\n * @param discountToAppply to the order\n * @return\n */\n Order modifyDiscountToOrder(Order order, int discountToAppply);\n\n /**\n * \n * @param o\n * @return the order, product ordered with the correct costs and discount applied\n */\n public abstract Order calculatesCostsAndDiscount(Order o);\n\n /**\n * \n * @param o\n * @param cost cost to apply\n * @param discountForced discount to be forced\n * @return\n */\n Order forcePriceAndDiscountAndRecalculate(Order o, BigDecimal cost, BigDecimal discountForced);\n\n}", "public interface OrderService {\n\n void insertOrder(Order order);\n\n void updateState(String state);\n\n Order selectByPrice(String uuid);\n\n PageInfo<Order> queryOrderList(Page page);\n}", "private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, org.pahospital.www.radiologyservice.RadiologyServiceStub.RadiologyOrder param, boolean optimizeContent, javax.xml.namespace.QName methodQName)\n throws org.apache.axis2.AxisFault{\n\n \n try{\n\n org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope();\n emptyEnvelope.getBody().addChild(param.getOMElement(org.pahospital.www.radiologyservice.RadiologyServiceStub.RadiologyOrder.MY_QNAME,factory));\n return emptyEnvelope;\n } catch(org.apache.axis2.databinding.ADBException e){\n throw org.apache.axis2.AxisFault.makeFault(e);\n }\n \n\n }", "public ExternalServicesDto getExternalServiceData();", "public interface GetOrderDetails {\n @FormUrlEncoded\n @POST(\"/getorderdetails\")\n Call<List<OrderCustomerDetails>> getOrderDetails(\n @Field(\"OrderId\") String OrderId\n\n );\n @FormUrlEncoded\n @POST(\"/canceluser\")\n Call<Updatepending> canceluser(\n @Field(\"OrderId\") String OrderId\n\n );\n\n\n}", "public Order save(OrderDto orderDto) throws Exception {\n\n Order order = new Order();\n order.setShopId(orderDto.getShopId());\n order.setUserId(orderDto.getUserId());\n List<OrderItem> orderItems = orderDto.getItems()\n .stream()\n .map(i -> {\n OrderItem orderItem = new OrderItem();\n orderItem.setProductId(i.getProductId());\n orderItem.setQty(i.getQty());\n orderItem.setOrder(order);\n\n return orderItem;\n }).collect(Collectors.toList());\n order.setItems(orderItems);\n order.setStatus(OrderStatus.PLACED);\n\n Order entity = orderRepository.saveAndFlush(order);\n\n // call core-service to notify the queue\n // TODO: using event-based or async request\n jmsTemplate.convertAndSend(QueueNames.QUEUE_NEW_ORDER, new Ordering(entity.getId()));\n// restTemplate.postForObject(\"http://core-service/ordering\", new Ordering(entity.getId()), Ordering.class);\n\n return orderRepository.findById(entity.getId()).orElse(null);\n\n }", "public interface OrderDetailService {\n\t\n\t/**\n\t * This method is to create all order details to a specific order. \n\t * @param lOrderDetails List of details to a specific order.\n\t * @param order Order to assigned the list of details\n\t * @return\n\t */\n\tpublic int addOrderDetail(List<OrderDetail> lOrderDetails, Order order);\n\t\n\t/**\n\t * This method find all order details of the a specific order\n\t * @param orderId orderId\n\t * @return List of order detail asociated a specific order \n\t */\n\tpublic List<OrderDetail> getOrderDetailByOrder(Long orderId);\n\n}", "public static Response placeOrderServiceCall(long id, long petId, int quantity, String shipDate, String status, boolean completed) {\n Response response = placeOrderRequest(id, petId, quantity, shipDate, status, completed).when().post(placeOrderResource());\n APILogger.logInfo(LOGGER, \"Place Store Order service Response...\");\n response.then().log().all();\n return response;\n }", "public interface OrderService {\n\n MiaoshaOrder getMiaoshaOrderByUserIdGoodsId(long userId, long goodsId);\n\n OrderInfo createOrder(MiaoshaUser user, GoodsVo goods);\n\n OrderInfo getOrderById(long orderId);\n\n OrderInfo miaosha(MiaoshaUser user, GoodsVo goods);\n\n long getMiaoshaResult(Long userId, long goodsId);\n\n int updateOrderStatusById(OrderInfo orderInfo);\n\n int closeOrder(Date deadLine);\n}", "String registerOrder(int userId, int quantity, int pricePerUnit, OrderType orderType);", "@Override\n\tpublic void getSpecificOrders() {\n\t\t\n\t}", "@Override\n\tpublic void getSpecificOrders() {\n\t\t\n\t}", "@GetMapping(value = \"farmers/{farmId}/orders/{orderId}\")\n @ApiOperation(value = \"Get an order by farmId and orderId\", response = ApiResponse.class)\n public ResponseEntity<ApiResponse> getFarmOrder(\n @PathVariable(\"farmId\") UUID farmId, @PathVariable(\"orderId\") UUID orderId) {\n return ApiMapper.buildResponseEntity(\n List.of(ApiMapper.toDeliveryResponse(deliveryService.getDeliveryOrder(farmId, orderId))),\n HttpStatus.OK);\n }", "@POST(\"orders/new_order/\")\n Call<ApiStatus> createNewOrderByUser(@Body Order myOrder);", "public ComplexOrderTO getOrder(long storeID, long orderId) throws NotInDatabaseException;" ]
[ "0.6320902", "0.6186191", "0.60813606", "0.6080844", "0.59683365", "0.5904918", "0.58168733", "0.5776789", "0.57739866", "0.57503766", "0.5637145", "0.5616145", "0.5612634", "0.5580307", "0.5569738", "0.5543768", "0.55435157", "0.55420524", "0.553737", "0.55277187", "0.5516302", "0.55082667", "0.55039907", "0.549068", "0.548417", "0.5476055", "0.54758185", "0.5466724", "0.54639935", "0.54538536", "0.54456055", "0.5441153", "0.5429935", "0.54219866", "0.5413433", "0.54065794", "0.5405998", "0.537841", "0.53678924", "0.53668034", "0.53504413", "0.5347319", "0.5340975", "0.5331539", "0.53262895", "0.53163064", "0.53095955", "0.5305721", "0.53049433", "0.53032917", "0.52980906", "0.52948385", "0.5284197", "0.5272004", "0.5266284", "0.5264466", "0.5261733", "0.5255467", "0.5239476", "0.52362937", "0.52127767", "0.5211519", "0.5208973", "0.52084136", "0.5199757", "0.51957685", "0.5194626", "0.5189549", "0.51857454", "0.518374", "0.51797885", "0.5174982", "0.5163008", "0.5162206", "0.5158107", "0.5157349", "0.51492536", "0.51374537", "0.51359046", "0.51338506", "0.5133154", "0.5127635", "0.51255333", "0.5119176", "0.5118607", "0.5106527", "0.50905377", "0.50888705", "0.50880533", "0.5087357", "0.50841725", "0.50833327", "0.5077535", "0.5076275", "0.5074595", "0.50717735", "0.50717735", "0.5069079", "0.506883", "0.50607586" ]
0.6125919
2
Method to return place order service request specification
private static RequestSpecification placeOrderRequest(long id, long petId, int quantity, String shipDate, String status, boolean completed) { RestAssured.baseURI = MicroservicesEnvConfig.BASEURL; RestAssured.config = RestAssured.config().logConfig(LogConfig.logConfig().defaultStream(RSLOGGER.getPrintStream())); APILogger.logInfo(LOGGER,"Place Store Order service Request..."); return RestAssured.given().header("Content-Type", "application/json").body(placeOrderPayload(id, petId, quantity, shipDate, status, completed)).log().all(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public CreateOrderRequest() {\n\t\t_pcs = new PropertyChangeSupport(this);\n\t}", "public interface IDeviceSpecificationCreateRequest {\r\n\r\n /**\r\n * Get name that describes specification.\r\n * \r\n * @return\r\n */\r\n public String getName();\r\n\r\n /**\r\n * Get id for asset module.\r\n * \r\n * @return\r\n */\r\n public String getAssetModuleId();\r\n\r\n /**\r\n * Get id for specification asset type.\r\n * \r\n * @return\r\n */\r\n public String getAssetId();\r\n\r\n /**\r\n * Allows the specification id to be specified. (Optional)\r\n * \r\n * @return\r\n */\r\n public String getToken();\r\n\r\n /**\r\n * Get container policy.\r\n * \r\n * @return\r\n */\r\n public DeviceContainerPolicy getContainerPolicy();\r\n\r\n /**\r\n * Get {@link IDeviceElementSchema} for locating nested devices.\r\n * \r\n * @return\r\n */\r\n public IDeviceElementSchema getDeviceElementSchema();\r\n\r\n /**\r\n * Get metadata values.\r\n * \r\n * @return\r\n */\r\n public Map<String, String> getMetadata();\r\n}", "com.indosat.eai.catalist.standardInputOutput.RequestType getRequest();", "private OrderRequest buildRequestBody(OriginalOrder originalOrder) {\n String currency = \"MXN\";\n\n OrderRequest orderRequest = new OrderRequest();\n orderRequest.intent(originalOrder.getIntent());\n\n ApplicationContext applicationContext = new ApplicationContext()\n .brandName(originalOrder.getBrandName())\n .landingPage(originalOrder.getLandingPage())\n .shippingPreference(originalOrder.getShippingPreference());\n orderRequest.applicationContext(applicationContext);\n System.out.println(\"item Category: \"+ originalOrder.getItems().get(0).getCategory());\n List<PurchaseUnitRequest> purchaseUnitRequests = new ArrayList<PurchaseUnitRequest>();\n PurchaseUnitRequest purchaseUnitRequest = new PurchaseUnitRequest()\n .referenceId(originalOrder.getReferenceId())\n .description(originalOrder.getDescription())\n .customId(originalOrder.getCustomId())\n .softDescriptor(originalOrder.getSoftDescriptor())\n .amount(new AmountWithBreakdown().currencyCode(currency).value(originalOrder.getTotal())\n .breakdown(\n new AmountBreakdown().itemTotal(new Money().currencyCode(currency).value(originalOrder.getTotal()))\n .shipping(new Money().currencyCode(currency).value(originalOrder.getShipping()))\n .handling(new Money().currencyCode(currency).value(originalOrder.getHandling()))\n .taxTotal(new Money().currencyCode(currency).value(originalOrder.getTaxTotal()))\n .shippingDiscount(new Money().currencyCode(currency).value(originalOrder.getShippingDiscount()))))\n .items(new ArrayList<Item>() {\n {\n add(new Item()\n .name(originalOrder.getItems().get(0).getName())\n .description(originalOrder.getItems().get(0).getDescription())\n .sku(originalOrder.getItems().get(0).getSku())\n .unitAmount(new Money().currencyCode(currency).value(originalOrder.getItems().get(0).getUnitAmount()))\n .tax(new Money().currencyCode(currency).value(originalOrder.getItems().get(0).getTax()))\n .quantity(originalOrder.getItems().get(0).getQuantity())\n .category(originalOrder.getItems().get(0).getCategory()));\n }\n })\n .shipping(new ShippingDetails().name(new Name().fullName(originalOrder.getAddress().getName()))\n .addressPortable(new AddressPortable()\n .addressLine1(originalOrder.getAddress().getAddressLine1())\n .addressLine2(originalOrder.getAddress().getAddressLine2())\n .adminArea2(originalOrder.getAddress().getAdminArea2())\n .adminArea1(originalOrder.getAddress().getAdminArea1())\n .postalCode(originalOrder.getAddress().getPostalCode())\n .countryCode(originalOrder.getAddress().getCountryCode())));\n System.out.println(\"purchaseUnitRequest: \\n\" +\n \"\\ndescription \"+ purchaseUnitRequest.description() +\n \"\\nreferenceId \"+ purchaseUnitRequest.referenceId() +\n \"\\nsoftDescriptor \"+ purchaseUnitRequest.softDescriptor() +\n \"\\namount currencyCode \"+ purchaseUnitRequest.amount().currencyCode() +\n \"\\namount value\"+ purchaseUnitRequest.amount().value() +\n \"\\namount taxTotal \"+ purchaseUnitRequest.amount().breakdown().taxTotal().value() +\n \"\\namount handling \"+ purchaseUnitRequest.amount().breakdown().handling().value() +\n \"\\namount shipping \"+ purchaseUnitRequest.amount().breakdown().shipping().value() +\n \"\\namount shippingDiscount \"+ purchaseUnitRequest.amount().breakdown().shippingDiscount().value() +\n \"\\namount itemTotal \"+ purchaseUnitRequest.amount().breakdown().itemTotal().value()\n );\n purchaseUnitRequests.add(purchaseUnitRequest);\n orderRequest.purchaseUnits(purchaseUnitRequests);\n System.out.println(\"Request: \" + orderRequest.toString());\n return orderRequest;\n }", "private GeofencingRequest getGeofencingRequest() {\n GeofencingRequest.Builder builder = new GeofencingRequest.Builder();\n\n // The INITIAL_TRIGGER_ENTER flag indicates that geofencing service should trigger a\n // GEOFENCE_TRANSITION_ENTER notification when the geofence is added and if the device\n // is already inside that geofence.\n builder.setInitialTrigger(GeofencingRequest.INITIAL_TRIGGER_ENTER);\n\n // Add the geofences to be monitored by geofencing service.\n builder.addGeofences(mGeofenceList);\n\n // Return a GeofencingRequest.\n return builder.build();\n }", "private GeofencingRequest getGeofencingRequest() {\n GeofencingRequest.Builder builder = new GeofencingRequest.Builder();\n\n // The INITIAL_TRIGGER_ENTER flag indicates that geofencing service should trigger a\n // GEOFENCE_TRANSITION_ENTER notification when the geofence is added and if the device\n // is already inside that geofence.\n builder.setInitialTrigger(GeofencingRequest.INITIAL_TRIGGER_ENTER);\n\n // Add the geofences to be monitored by geofencing service.\n builder.addGeofences(mGeofenceList);\n\n // Return a GeofencingRequest.\n return builder.build();\n }", "com.icare.eai.schema.om.evSORequest.EvSORequestDocument.EvSORequest getEvSORequest();", "io.envoyproxy.envoy.type.metadata.v3.MetadataKind.Request getRequest();", "com.exacttarget.wsdl.partnerapi.QueryRequest getQueryRequest();", "void createRequest(EnumOperationType opType, IParameter parameter);", "List<Order> getOpenOrders(OpenOrderRequest orderRequest);", "public SveaRequest<SveaCloseOrder> prepareRequest() {\n String errors = validateRequest();\n \n if (!errors.equals(\"\")) {\n throw new SveaWebPayException(\"Validation failed\", new ValidationException(errors));\n }\n \n // build inspectable request object and insert into order builder\n SveaCloseOrder sveaCloseOrder = new SveaCloseOrder();\n sveaCloseOrder.Auth = getStoreAuthorization();\n SveaCloseOrderInformation orderInfo = new SveaCloseOrderInformation();\n orderInfo.SveaOrderId = order.getOrderId();\n sveaCloseOrder.CloseOrderInformation = orderInfo;\n \n SveaRequest<SveaCloseOrder> object = new SveaRequest<SveaCloseOrder>();\n object.request = sveaCloseOrder;\n \n return object;\n }", "private GeofencingRequest getAddGeofencingRequest() {\n List<Geofence> geofencesToAdd = new ArrayList<>();\n geofencesToAdd.add(geofenceToAdd);\n GeofencingRequest.Builder builder = new GeofencingRequest.Builder();\n builder.setInitialTrigger(GeofencingRequest.INITIAL_TRIGGER_EXIT)\n .addGeofences(geofencesToAdd);\n return builder.build();\n\n }", "private GeofencingRequest getGeofencingRequest(LBAction lbAction) {\n GeofencingRequest.Builder builder = new GeofencingRequest.Builder();\n builder.setInitialTrigger(GeofencingRequest.INITIAL_TRIGGER_ENTER);// change upon params\n builder.addGeofence(createGeofenceForAction(lbAction));\n return builder.build();\n }", "TxnRequestProto.TxnRequest getTxnrequest();", "io.envoyproxy.envoy.type.metadata.v3.MetadataKind.RequestOrBuilder getRequestOrBuilder();", "Order getOrderStatus(OrderStatusRequest orderStatusRequest);", "com.google.openrtb.OpenRtb.BidRequest getRequest();", "private MarketDataRequest generateRequestFromAtom(MarketDataRequestAtom inAtom,\n MarketDataRequest inCompleteRequest)\n {\n return MarketDataRequestBuilder.newRequest().withAssetClass(inCompleteRequest.getAssetClass()).withSymbols(inAtom.getSymbol()).withContent(inAtom.getContent()).withExchange(inAtom.getExchange()).create();\n }", "public String getProductServiceSpecificationOperationalRequirements() {\n return productServiceSpecificationOperationalRequirements;\n }", "org.naru.park.ParkModel.UIParkRequest getRequest();", "public static String generateQueryOption(HttpServletRequest request) {\n\t\tHashMap<String, String> optionMapMap = new HashMap<String, String>();\n\t\tString reservation_Num = request.getParameter(\"reservation_Num\");\n\t\tString team_ID = request.getParameter(\"team_ID\");\n\t\tString room_ID = request.getParameter(\"room_ID\");\n\t\tString purpose = request.getParameter(\"purpose\");\n\t\tString status = request.getParameter(\"status\");\n\t\tString email = request.getParameter(\"email\");\n\t\tString tele = request.getParameter(\"tele\");\n\t\tString Applied_Start_Date = request.getParameter(\"Applied_Start_Date\");\n\t\tString Applied_End_Date = request.getParameter(\"Applied_End_Date\");\n\t\tString order_Time = request.getParameter(\"order_Time\");\n\t\tif (reservation_Num != null && reservation_Num.length() > 0) {\n\t\t\toptionMapMap.put(\"reservation_Num\", reservation_Num);\n\t\t}\n\t\tif (team_ID != null && team_ID.length() > 0) {\n\t\t\toptionMapMap.put(\"team_ID\", team_ID);\n\t\t}\n\t\tif (room_ID != null && room_ID.length() > 0) {\n\t\t\toptionMapMap.put(\"room_ID\", room_ID);\n\t\t}\n\t\tif (purpose != null && purpose.length() > 0) {\n\t\t\toptionMapMap.put(\"purpose\", purpose);\n\t\t}\n\t\tif (status != null && status.length() > 0) {\n\t\t\toptionMapMap.put(\"status\", status);\n\t\t}\n\t\tif (tele != null && tele.length() > 0) {\n\t\t\toptionMapMap.put(\"tele\", tele);\n\t\t}\n\t\tif (email != null && email.length() > 0) {\n\t\t\toptionMapMap.put(\"email\", email);\n\t\t}\n\t\tif (Applied_Start_Date != null && Applied_Start_Date.length() > 0) {\n\t\t\toptionMapMap.put(\"Applied_Start_Date\", Applied_Start_Date);\n\t\t}\n\t\tif (Applied_End_Date != null && Applied_End_Date.length() > 0) {\n\t\t\toptionMapMap.put(\"Applied_End_Date\", Applied_End_Date);\n\t\t}\n\t\tif (order_Time != null && order_Time.length() > 0) {\n\t\t\toptionMapMap.put(\"order_Time\", order_Time);\n\t\t}\n\n\t\tStringBuilder builder = new StringBuilder();\n\t\tSet<String> keys = optionMapMap.keySet();\n\t\tint i = 0;\n\t\tfor (String key : keys) {\n\t\t\tif (key.equals(\"team_ID\") || key.equals(\"room_ID\")\n\t\t\t\t\t|| key.equals(\"user_ID\") || key.equals(\"status\")) {\n\t\t\t\tbuilder.append(\"Reservation.\" + key + \"=\"\n\t\t\t\t\t\t+ optionMapMap.get(key).trim());\n\t\t\t} else if (key.equals(\"purpose\") || key.equals(\"reservation_Num\")\n\t\t\t\t\t|| key.equals(\"email\") || key.equals(\"tele\")) {\n\t\t\t\tbuilder.append(\"Reservation.\" + key + \" like \" + \"'%\"\n\t\t\t\t\t\t+ optionMapMap.get(key).toString().trim() + \"%'\");\n\t\t\t} else if (key.equals(\"Applied_Start_Date\")) {\n\t\t\t\tbuilder.append(\"Reservation.\" + key + \">='\"\n\t\t\t\t\t\t+ optionMapMap.get(key).trim() + \"'\");\n\t\t\t} else if (key.equals(\"Applied_End_Date\")) {\n\t\t\t\tbuilder.append(\"Reservation.\" + key + \"<='\"\n\t\t\t\t\t\t+ optionMapMap.get(key).trim() + \"'\");\n\t\t\t} else if (key.equals(\"order_Time\")) {\n\t\t\t\tbuilder.append(\"Reservation.\" + key + \"='\"\n\t\t\t\t\t\t+ optionMapMap.get(key).trim() + \"'\");\n\t\t\t}\n\t\t\tif ((i + 1) != keys.size()) {\n\t\t\t\tbuilder.append(\" and \");\n\t\t\t}\n\t\t\t++i;\n\t\t}\n\t\treturn builder.toString();\n\t}", "public interface GetFeatureRequest extends Request{\n\n /**\n * @return QName : requested type name, can be null\n * if not yet configured.\n */\n QName getTypeName();\n\n /**\n * @param type : requested type name, must not be null\n */\n void setTypeName(QName type);\n\n /**\n * @return Filter : the request filter, null for no filter\n */\n Filter getFilter();\n\n /**\n * @param filter : the request filter, null for no filter\n */\n void setFilter(Filter filter);\n\n /**\n * @return Integer : maximum features returned by this request,\n * null for no limit.\n */\n Integer getMaxFeatures();\n\n /**\n * @param max : maximum features returned by this request,\n * null for no limit.\n */\n void setMaxFeatures(Integer max);\n\n /**\n * @return String[] : array of requested properties,\n * null if all properties, empty for only the id.\n */\n GenericName[] getPropertyNames();\n\n /**\n * @param properties : array of requested properties,\n * null if all properties, empty for only the id.\n */\n void setPropertyNames(GenericName[] properties);\n\n /**\n * Return the output format to use for the response.\n * text/xml; subtype=gml/3.1.1 must be supported.\n * Other output formats are possible as well as long as their MIME\n * type is advertised in the capabilities document.\n *\n * @return The current outputFormat\n */\n String getOutputFormat();\n\n /**\n * Set the output format to use for the response.\n * text/xml; subtype=gml/3.1.1 must be supported.\n * Other output formats are possible as well as long as their MIME\n * type is advertised in the capabilities document.\n *\n * @param outputFormat The current outputFormat\n */\n void setOutputFormat(String outputFormat);\n}", "public com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.searchcriteria.v1.SearchCriteria \n\t\t\t\t\t\t\t\t\t\tgetSearchCriteriaReq(SearchCriteria searchCriteria){\n\t\tcom.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.searchcriteria.v1.SearchCriteria searchCriteriaReq =\n\t\t\tnew com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.searchcriteria.v1.SearchCriteria();\n\t\t\n\t\tsearchCriteriaReq.setGateway( searchCriteria.getGateway() );\n\t\tsearchCriteriaReq.setPromoCode( searchCriteria.getPromoCode() );\n\t\tsearchCriteriaReq.setAnchorGateway( searchCriteria.getAnchorGateway() );\n\t\tsearchCriteriaReq.setBookingNo( searchCriteria.getBookingNo() );\n\t\tsearchCriteriaReq.setFilterSpecials( new Boolean( searchCriteria.isFilterSpecials() ));\n\t\tif( searchCriteria.getDepartureDate() != null ){\n\t\t\tsearchCriteriaReq.setDepartureDate( this.getDate( searchCriteria.getDepartureDate() ));\n\t\t}\n\t\tif( searchCriteria.getAnchorDepartureDate() != null ){\n\t\t\tsearchCriteriaReq.setAnchorDepartureDate( this.getDate( searchCriteria.getAnchorDepartureDate() ) );\n\t\t}\n\t\tif( searchCriteria.getFlightTripType() != null ){\n\t\t\tsearchCriteriaReq.setFlightTripType( this.getFlightTripTypeReq( searchCriteria.getFlightTripType() ) );\n\t\t}\n\t\tif( searchCriteria.getOccupancy() != null ){\n\t\t\tsearchCriteriaReq.setOccupancy( this.getOccupancyReq( searchCriteria.getOccupancy() ) );\n\t\t}\n\t\tif( (searchCriteria.getDestinationOptions() != null) && (searchCriteria.getDestinationOptions().size() > 0) ){\n\t\t\tfor(int i=0; i < searchCriteria.getDestinationOptions().size(); i++){\n\t\t\t\tsearchCriteriaReq.getDestinationOptions().add( this.getDestinationOptionsReq( searchCriteria.getDestinationOptions().get(i) ) );\n\t\t\t}\n\t\t}\n\t\tif( (searchCriteria.getNearByGateways() != null) && (searchCriteria.getNearByGateways().size() > 0) ){\n\t\t\tsearchCriteriaReq.getNearByGateways().addAll( searchCriteria.getNearByGateways() );\n\t\t}\n\t\t\n\t\treturn searchCriteriaReq;\n\t}", "private PendingIntent createRequestPendingIntent() {\n\n // If the PendingIntent already exists\n if (null != geofenceRequestIntent) {\n\n // Return the existing intent\n return geofenceRequestIntent;\n\n // If no PendingIntent exists\n } else {\n\n // Create an Intent pointing to the IntentService\n // TODO correct service?\n Intent intent = new Intent(activity, ReceiveTransitionsIntentService.class);\n /*\n * Return a PendingIntent to start the IntentService.\n * Always create a PendingIntent sent to Location Services\n * with FLAG_UPDATE_CURRENT, so that sending the PendingIntent\n * again updates the original. Otherwise, Location Services\n * can't match the PendingIntent to requests made with it.\n */\n return PendingIntent.getService(\n activity,\n 0,\n intent,\n PendingIntent.FLAG_UPDATE_CURRENT);\n }\n }", "net.iGap.proto.ProtoRequest.Request getRequest();", "RecordDataSchema getActionRequestSchema();", "PToP.AS2Req getAS2Req();", "com.google.protobuf.ByteString\n getRequestBytes();", "com.google.openrtb.OpenRtb.BidRequestOrBuilder getRequestOrBuilder();", "public OrderBySpecResponse(String name, String sipp, Vehicle.CarType carType, Vehicle.DoorType doorType, Vehicle.Transmission transmission, Vehicle.Extras extras) {\n this.name = name;\n this.sipp = sipp;\n this.carType = carType;\n this.doorType = doorType;\n this.transmission = transmission;\n this.extras = extras;\n }", "pb4server.MakeCityAskReq getMakeCityAskReq();", "pb4server.MoveCityAskReq getMoveCityAskReq();", "private GeofencingRequest createGeofenceRequest(Geofence geofence) {\n\n\n T.t(TripMapsActivity.this, \"createGeofenceRequest\");\n return new GeofencingRequest.Builder()\n .setInitialTrigger(GeofencingRequest.INITIAL_TRIGGER_ENTER)\n .addGeofence(geofence)\n .build();\n }", "@Get\n public String serviceRequest() {\n counter.increment(endpoint);\n\n boolean rateResult = false;\n boolean cdrResult = false;\n boolean tcdrResult = false;\n\n // Get the list of enabled resources\n enabledResourceList = getEnabledResources();\n // Service the request\n try {\n if (action.equalsIgnoreCase(\"rate\")) {\n logger.debug(\"Attempting to generate a Rate\");\n rateResult = generateRate();\n } else if (action.equalsIgnoreCase(\"cdr\")) {\n logger.debug(\"Attempting to generate a CDR\");\n cdrResult = generateCdr();\n } else if (action.equalsIgnoreCase(\"t-cdr\")) {\n logger.debug(\"Attempting to generate a CDR for T-nova\");\n tcdrResult = generateTNovaCdr();\n }\n // Construct the response\n if (rateResult) {\n return \"The rate generation was successful\";\n } else if (cdrResult) {\n return \"The cdr generation was successful\";\n } else if (tcdrResult) {\n return \"The T-Nova cdr generation was successful\";\n } else {\n return \"Operation Failed\";\n }\n }catch (Exception e){\n logger.error(\"Error while generating it: \"+e.getMessage());\n return \"Operation Failed\";\n }\n }", "public String getSpecification() {\n return specification;\n }", "public String getSpecification() {\n return specification;\n }", "public String getSpecification() {\n return specification;\n }", "public com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.service.v1.Service getServiceReq(Service service){\n\t\tcom.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.service.v1.Service serviceReq =\n\t\t\tnew com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.service.v1.Service();\n\t\t\n\t\tserviceReq.setServiceCode( service.getServiceCode() );\n\t\tserviceReq.setServiceName( service.getServiceName() );\n\t\tserviceReq.setGateway( service.getGateway() );\n\t\tserviceReq.setDestination( service.getDestination() );\n\t\tserviceReq.setAdultPrice( new Double( service.getAdultPrice() ) );\n\t\tserviceReq.setChild1Price( new Double( service.getChild1Price() ) );\n\t\tserviceReq.setChild2Price( new Double( service.getChild2Price() ) );\n\t\tserviceReq.setChild3Price( new Double( service.getChild3Price() ) );\n\t\tserviceReq.setChild1MinAge( new Byte( service.getChild1MinAge() ) );\n\t\tserviceReq.setChild2MinAge( new Byte( service.getChild2MinAge() ) );\n\t\tserviceReq.setChild3MinAge( new Byte( service.getChild3MinAge() ) );\n\t\tserviceReq.setChild1MaxAge( new Byte( service.getChild1MaxAge() ) );\n\t\tserviceReq.setChild2MaxAge( new Byte( service.getChild2MaxAge() ) );\n\t\tserviceReq.setChild3MaxAge( new Byte( service.getChild3MaxAge() ) );\n\t\tserviceReq.setCurrency( service.getCurrency() );\n\t\tserviceReq.setMaxQuantity( new Double( service.getMaxQuantity() ) );\n\t\tserviceReq.setUnitOfMeasure( service.getUnitOfMeasure() );\n\t\tserviceReq.setMandatory( new Boolean( service.isMandatory() ) );\n\t\tserviceReq.setFree( new Boolean( service.isFree() ) );\n\t\tserviceReq.setOccupancyBased( new Boolean( service.isOccupancyBased() ) );\n\t\tserviceReq.setDateSpecific( new Boolean( service.isDateSpecific() ) );\n\t\tserviceReq.setAllOrNothing( new Boolean( service.isAllOrNothing() ) );\n\t\tserviceReq.setWeightBased( new Boolean( service.isWeightBased() ) );\n\t\tserviceReq.setTierBased( new Boolean( service.isTierBased() ) );\n\t\tserviceReq.setGroupCode( service.getGroupCode() );\n\t\tserviceReq.setGroupDescription( service.getGroupDescription() );\n\t\tserviceReq.setMonday( new Boolean( service.isMonday() ) );\n\t\tserviceReq.setTuesday( new Boolean( service.isTuesday() ) );\n\t\tserviceReq.setWednesday( new Boolean( service.isWednesday() ) );\n\t\tserviceReq.setThursday( new Boolean( service.isThursday() ) );\n\t\tserviceReq.setFriday( new Boolean( service.isFriday() ) );\n\t\tserviceReq.setSaturday( new Boolean( service.isSaturday() ) );\n\t\tserviceReq.setSunday( new Boolean( service.isSunday() ) );\n\t\tserviceReq.setAdultQty( new Byte( service.getAdultQty() ) );\n\t\tserviceReq.setChild1Qty( new Byte( service.getChild1Qty() ) );\n\t\tserviceReq.setChild2Qty( new Byte( service.getChild2Qty() ) );\n\t\tserviceReq.setChild3Qty( new Byte( service.getChild3Qty() ) );\n\t\tserviceReq.setTravelAgentFee( new Double( service.getTravelAgentFee() ) );\n\t\tserviceReq.setFlightMaterialCode( service.getFlightMaterialCode() );\n\t\tserviceReq.setHotelMaterialCode( service.getHotelMaterialCode() );\n\t\tserviceReq.setParentItemRph(service.getParentItemRph() );\n\t\tserviceReq.setGuestAllocation( service.getGuestAllocation() );\n\t\tserviceReq.setTotalPrice( new Double( service.getTotalPrice() ) );\n\t\tserviceReq.setPosnr( service.getPosnr() );\n\t\tserviceReq.setOldPosnr( service.getOldPosnr() );\n\t\tif( service.getSelectedDate() != null ){\n\t\t\tserviceReq.setSelectedDate( this.getDate( service.getSelectedDate() ) );\n\t\t}\n\t\tif( service.getDepatureDate() != null ){\n\t\t\tserviceReq.setDepatureDate( this.getDate( service.getDepatureDate() ) );\n\t\t}\n\t\tif( service.getReturnDate() != null ){\n\t\t\tserviceReq.setReturnDate( this.getDate( service.getReturnDate() ));\n\t\t}\n\t\tif( (service.getAvailableDates() != null) && (service.getAvailableDates().size() > 0) ){\n\t\t\tfor(int i=0; i < service.getAvailableDates().size();i++){\n\t\t\t\tserviceReq.getAvailableDates().add( this.getDate( service.getAvailableDates().get(i) ) );\n\t\t\t}\n\t\t}\n\t\tif( (service.getServiceDescription() != null) && (service.getServiceDescription().size() > 0) ){\n\t\t\tfor(int i=0; i < service.getServiceDescription().size();i++){\n\t\t\t\tserviceReq.getServiceDescription().add( service.getServiceDescription().get(i) );\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn serviceReq;\n\t}", "public interface IRequest {\n\t/**\n\t * This method creates request based on operationType and parameter object.\n\t * @param opType operation type of the request to be created.\n\t * @param params List of parameters to be sent along with the request.\n\t */\n\tvoid createRequest(EnumOperationType opType, IParameter parameter);\n\t\n\t/**\n\t * This method retrieves operation type of the the request.\n\t * \n\t * @return operation type\n\t */\n\tEnumOperationType getOperationType();\n\t\n\t/**\n\t * This method retrieves the parameters object configured for the request.\n\t */\n\tIParameter getParameter();\n\t\n\t/**\n\t * This method allows user to get configured request in XML.\n\t * \n\t * @return\n\t * @throws Exception \n\t */\n\tpublic String getRequestInXML() throws Exception;\n\t\n\t/**\n\t * This method parses XML and creates a request object out of it. \n\t */\n\tpublic void parseXML(String XML);\n\t\n\tpublic void setId(String id);\n\t\n\tpublic String getId();\n}", "io.opencannabis.schema.commerce.CommercialOrder.OrderSchedulingOrBuilder getSchedulingOrBuilder();", "Map<String, String> journeyRequestLocationsToParameters(Trip trip){\n Map<String, String> parameters = new HashMap<>();\n parameters.put(\"pickup\", trip.getPickupLat() + \",\" + trip.getPickupLong());\n parameters.put(\"dropoff\", trip.getDropoffLat() + \",\" + trip.getDropoffLong());\n return parameters;\n }", "@Override\n public String getDescription() {\n return \"Ask order placement\";\n }", "com.exacttarget.wsdl.partnerapi.QueryRequestMsgDocument.QueryRequestMsg getQueryRequestMsg();", "com.indosat.eai.catalist.standardInputOutput.RequestType addNewRequest();", "pb4server.MakeCityAskReqOrBuilder getMakeCityAskReqOrBuilder();", "private void getTransactionDetailsRequest() {\r\n\t\tBasicXmlDocument document = new BasicXmlDocument();\r\n\t\tdocument.parseString(\"<\" + TransactionType.GET_TRANSACTION_DETAILS.getValue()\r\n\t\t\t\t+ \" xmlns = \\\"\" + XML_NAMESPACE + \"\\\" />\");\r\n\r\n\t\taddAuthentication(document);\r\n\t\taddReportingTransactionId(document);\r\n\r\n\t\tcurrentRequest = document;\r\n\t}", "private String determineRequestType(DocumentAccessBean argDocument) {\n\t\n\tString reqType = REQUESTTYPES.UNKNOWN;\n\n\ttry {\n\t\tint docType = determineDocType(argDocument);\n\t\tint fromStorageType = determineStorageType(argDocument.getFrom());\n\t\tint toStorageType = determineStorageType(argDocument.getTo());\n\t\tif ( (docType == DOCTYPES.I13NACT) && (1==1) )\n\t\t\treqType = REQUESTTYPES.O_INVEN1;\n\t\telse if ( (docType == DOCTYPES.CHANGEACT) && (fromStorageType == STORAGETYPES.EXPEDITOR) )\n\t\t\treqType = REQUESTTYPES.O_ZAMEN1;\n\t\telse if ( (docType == DOCTYPES.CHANGEACT) && ( \n\t\t\t(fromStorageType == STORAGETYPES.POSITION) || (fromStorageType == STORAGETYPES.STORAGE) ) )\n\t\t\treqType = REQUESTTYPES.O_ZAMEN2;\n\t\telse if ( (docType == DOCTYPES.EXT_IN) && (toStorageType == STORAGETYPES.STORAGE) )\n\t\t\treqType = REQUESTTYPES.O_VPRIX1;\n\t\telse if ( (docType == DOCTYPES.EXT_OUT) && (fromStorageType == STORAGETYPES.STORAGE) )\n\t\t\treqType = REQUESTTYPES.O_VRASX1;\n\t\telse if ( (docType == DOCTYPES.INT_IN) && (fromStorageType == STORAGETYPES.EXPEDITOR) )\n\t\t\treqType = REQUESTTYPES.O_VPRIX2;\n\t\telse if ( (docType == DOCTYPES.PAYOFF) && (fromStorageType == STORAGETYPES.STORAGE) )\n\t\t\treqType = REQUESTTYPES.O_SPIS1;\n\t\telse if ( (docType == DOCTYPES.EXT_IN) && (toStorageType == STORAGETYPES.STORAGE) )\n\t\t\treqType = REQUESTTYPES.O_VPRIX1;\n\t\telse if ( (docType == DOCTYPES.EXT_OUT) && (fromStorageType == STORAGETYPES.STORAGE) )\n\t\t\treqType = REQUESTTYPES.O_VRASX1;\n\t\telse if ( ( (docType == DOCTYPES.INT_IN) || (docType == DOCTYPES.BLOK_IN) )&& (fromStorageType == STORAGETYPES.EXPEDITOR) )\n\t\t\treqType = REQUESTTYPES.O_VPRIX2;\n\t} catch (Exception e) {\n\t\tSystem.out.println(\"PLATINUM-SYNC: Cannot determine PIE request type\");\n\t\te.printStackTrace(System.out);\n\t}\n\t\t\n\tlogIt(\"Determine PIE query type, type=\" + reqType);\n\treturn reqType;\n}", "@Nonnull\n public static UBL23WriterBuilder <RequestForQuotationType> requestForQuotation ()\n {\n return UBL23WriterBuilder.create (RequestForQuotationType.class);\n }", "public String getOrderDetails(String symbol,String currency) \r\n\t{\r\n\t\t//timestamp is mandatory one \t\t\r\n\t\tWebTarget target = getTarget().path(RESOURCE_OPENORDER);\r\n\t\t Map<String, String> postData = new TreeMap<String, String>();\r\n\t\t//symbol is not mandatory one\r\n\t\tif(symbol!= null && !symbol.equalsIgnoreCase(\"\") && currency!=null && !currency.equalsIgnoreCase(\"\")) \r\n\t\t{\r\n\t\t\t postData.put(CURRENCY_PAIR, getSymbolForExchange(symbol,currency));\r\n\t\t}\t\r\n\t\t\r\n String queryString = buildQueryString(postData);\r\n TradeLogger.LOGGER.finest(\"QueryString to generate the signature \" + queryString);\t\r\n \r\n\t\tString signature = generateSignature(queryString);\r\n\t\tTradeLogger.LOGGER.finest(\"Signature Genereated \" + signature);\r\n\t\tString returnValue= null;\r\n\t\tif(signature!= null )\r\n\t\t{\t\r\n\t\t\ttarget = addParametersToRequest(postData, target);\r\n\t\t\tTradeLogger.LOGGER.finest(\"Final Request URL : \"+ target.getUri().toString());\r\n\t\t\tResponse response = target.request(MediaType.APPLICATION_JSON).header(APIKEY_HEADER_KEY,API_KEY).header(\"Sign\", signature).get();\r\n\t\t\t\t\r\n\t\t\tif(response.getStatus() == 200) \r\n\t\t\t{\r\n\t\t\t\treturnValue = response.readEntity(String.class);\r\n\t\t\t\tTradeLogger.LOGGER.info(returnValue);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tTradeLogger.LOGGER.severe(\"Response Code \" + response.getStatus());\r\n\t\t\t\tTradeLogger.LOGGER.severe(\"Response Data \" + response.readEntity(String.class));\r\n\t\t\t}\r\n\t\t\tresponse.close();\r\n\t\t}\r\n\t\treturn returnValue;\r\n\r\n\t}", "private OCSPReq generateOCSPRequest() throws OCSPException, IOException\n {\n Security.addProvider(SecurityProvider.getProvider());\n\n // Generate the ID for the certificate we are looking for\n CertificateID certId;\n try\n {\n certId = new CertificateID(new SHA1DigestCalculator(),\n new JcaX509CertificateHolder(issuerCertificate),\n certificateToCheck.getSerialNumber());\n }\n catch (CertificateEncodingException e)\n {\n throw new IOException(\"Error creating CertificateID with the Certificate encoding\", e);\n }\n\n // https://tools.ietf.org/html/rfc2560#section-4.1.2\n // Support for any specific extension is OPTIONAL. The critical flag\n // SHOULD NOT be set for any of them.\n\n Extension responseExtension = new Extension(OCSPObjectIdentifiers.id_pkix_ocsp_response,\n false, new DLSequence(OCSPObjectIdentifiers.id_pkix_ocsp_basic).getEncoded());\n\n encodedNonce = new DEROctetString(new DEROctetString(create16BytesNonce()));\n Extension nonceExtension = new Extension(OCSPObjectIdentifiers.id_pkix_ocsp_nonce, false,\n encodedNonce);\n\n OCSPReqBuilder builder = new OCSPReqBuilder();\n builder.setRequestExtensions(\n new Extensions(new Extension[] { responseExtension, nonceExtension }));\n builder.addRequest(certId);\n return builder.build();\n }", "public interface IRequestFactory {\n /**\n * Conditions request by location name\n *\n * @param location\n * @param listener\n * @return request object\n */\n IConditionsRequest getConditionsRequest(String location, IRequestListener listener);\n\n /**\n * Conditions request by lat/lon\n *\n * @param lat\n * @param lon\n * @param listener\n * @return request object\n */\n IConditionsRequest getConditionsRequest(double lat, double lon, IRequestListener listener);\n\n /**\n * Location request\n *\n * @param location\n * @param listener\n * @return\n */\n ILocationRequest getLocationRequest(String location, IRequestListener listener);\n}", "@Bean(name=\"confirmOrderService\")\r\n\tpublic RequestHandlerChain<PlaceOrderParamDto, PlaceOrderDto> confirmOrderService() {\r\n\t\tRequestHandlerChain<PlaceOrderParamDto, PlaceOrderDto> chain = new RequestHandlerChain<PlaceOrderParamDto, PlaceOrderDto>();\r\n\t\t// 第一步 :校验店铺\r\n\t\tchain.addHandlerChain(checkStoreService);\r\n\t\t// 第二步校验活动\r\n\t\tchain.addHandlerChain(checkStoreActivityService);\r\n\t\t// 第三步:校验商品\r\n\t\tchain.addHandlerChain(checkSkuService);\r\n\t\t// 第四步:校验商品库存\r\n\t\tchain.addHandlerChain(checkStockService);\r\n\t\t// 第五步:查询最优用户地址\r\n\t\tchain.addHandlerChain(findUserAddrService);\r\n\t\t// 第六步:查询零花钱信息\r\n\t\tchain.addHandlerChain(findPinMoneyService);\r\n\t\t// 第七步:查询用户有效的优惠信息\r\n\t\tchain.addHandlerChain(findFavourService);\r\n\t\treturn chain;\r\n\t}", "@GetMapping(\"/placeOrder\")\n public String placeOrder(HttpServletRequest request, Model model){\n Map<String, String[]> requestParam = request.getParameterMap();\n String customerName[] = requestParam.get(\"customerName\");\n String orderQuantity[] = requestParam.get(\"orderQty\");\n String productTypes[] = requestParam.get(\"productType\");\n OrderDetails orderDetails = new OrderDetails();\n orderDetails.setCustomerName(customerName[0]);\n orderDetails.setOrderQty(orderQuantity[0]);\n orderDetails.setOrderProduct(productTypes[0]);\n String orderConfirmation = sportyShoesService.saveCustomerOrder(orderDetails);\n\n model.addAttribute(\"appName\", appName);\n model.addAttribute(\"orderConfirmation\", orderConfirmation);\n\n return \"orderPlaceSuccess\";\n }", "InvoiceSpecification createInvoiceSpecification();", "protected void createLocationRequest() {\n\t\tmLocationRequest = new LocationRequest();\n\t\tmLocationRequest.setInterval(UPDATE_INTERVAL);\n\t\tmLocationRequest.setFastestInterval(FATEST_INTERVAL);\n\t\tmLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n\t\tmLocationRequest.setSmallestDisplacement(DISPLACEMENT);\n\t}", "private GeofencingRequest createGeofenceRequest(Geofence geofence) {\n Log.d(TAG, \"createGeofenceRequest\");\n return new GeofencingRequest.Builder()\n .setInitialTrigger(GeofencingRequest.INITIAL_TRIGGER_ENTER)\n .addGeofence(geofence)\n .build();\n }", "public com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.vehicleoptions.v1.VehicleOptions \n\t\t\t\t\t\t\tgetVehicleOptionsReq( VehicleOptions vehicleOptions ){\n\t\tcom.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.vehicleoptions.v1.VehicleOptions vehicleOptionsReq =\n\t\t\tnew com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.vehicleoptions.v1.VehicleOptions();\n\t\t\n\t\tvehicleOptionsReq.setPickupLocation( vehicleOptions.getPickupLocation() );\n\t\tvehicleOptionsReq.setDropoffLocation( vehicleOptions.getDropoffLocation() );\n\t\tvehicleOptionsReq.setVendorCode( vehicleOptions.getVendorCode() );\n\t\tvehicleOptionsReq.setVehicleClass( vehicleOptions.getVehicleClass() );\n\t\tif( vehicleOptions.getPickupDateTime() != null ){\n\t\t\tvehicleOptionsReq.setPickupDateTime( this.getDate( vehicleOptions.getPickupDateTime() ) );\n\t\t}\n\t\tif( vehicleOptions.getDropoffDateTime() != null ){\n\t\t\tvehicleOptionsReq.setDropoffDateTime( this.getDate( vehicleOptions.getDropoffDateTime() ) );\n\t\t}\n\t\t\n\t\treturn vehicleOptionsReq;\n\t}", "private void validateSpecificationOrder(HttpServletRequest request,\n HttpServletResponse response,\n PrintWriter out) throws Exception{\n\n NewOrderService objOrderServiceSpec = new NewOrderService();\n HashMap objHashMap = null;\n\n String strCodigoCliente = \"\",\n strSpecification = \"\";\n\n strCodigoCliente = request.getParameter(\"txtCompanyId\");\n strSpecification = request.getParameter(\"cmbSubCategoria\");\n\n long an_customerid = MiUtil.parseLong(strCodigoCliente);\n long an_specification = MiUtil.parseLong(strSpecification);\n\n objHashMap = objOrderServiceSpec.getAllowedSpecification(an_specification, an_customerid);\n\n if( objHashMap.get(\"strMessage\") != null ){\n throw new UserException((String)objHashMap.get(\"strMessage\"));\n }\n\n }", "private ApplicationAddressReqType buildUpdateApplicationAddressChangeRequest(\n UpdateApplicationAddressForm updateApplicationAddressForm) {\n System.out.println(\"inside buildUpdateApplicationAddressChangeRequest\");\n ApplicationAddressReqType applicationAddressReqType = new ApplicationAddressReqType();\n AuditAdmin audit = new AuditAdmin();\n audit.setLastModifiedUser(\"erinkklein FQT Attor\");\n applicationAddressReqType.setAudit(audit);\n System.out.println(audit.getLastModifiedUser());\n \n LifecycleAdmin lifecycle= new LifecycleAdmin();\n lifecycle.setBeginDate(\"1595704744\");\n lifecycle.setEndDate(\"1595704744\");\n applicationAddressReqType.setLifeCycle(lifecycle);\n applicationAddressReqType.setChangeCustomerNumber(updateApplicationAddressForm.getCustomerNumber());\n applicationAddressReqType.setNoticeActionCd(\"addressChange\");\n applicationAddressReqType.setRegistrationNumber(updateApplicationAddressForm.getRegistrationNumber());\n applicationAddressReqType.setRequestIdentifier(updateApplicationAddressForm.getPairId());\n \n List<AddressChangeSupportData> addressSupportingDataArray = new ArrayList<AddressChangeSupportData>();\n \n AddressChangeSupportData addressSupportingData = new AddressChangeSupportData();\n addressSupportingData.setNameLineText(updateApplicationAddressForm.getCommonName());\n \n addressSupportingData.setSignature(updateApplicationAddressForm.getSubmitterSignature());\n addressSupportingDataArray.add(addressSupportingData);\n applicationAddressReqType.setSupportData(addressSupportingDataArray);\n System.out.println(applicationAddressReqType.getChangeCustomerNumber());\n \n return applicationAddressReqType;\n }", "@Override\n\tpublic LinkedHashMap<String,?> getRequiredParams() {\n\t\tLinkedHashMap<String,String> requiredParams = new LinkedHashMap<>();\n\t\trequiredParams.put(\"crv\", crv.toString());\n\t\trequiredParams.put(\"kty\", getKeyType().getValue());\n\t\trequiredParams.put(\"x\", x.toString());\n\t\trequiredParams.put(\"y\", y.toString());\n\t\treturn requiredParams;\n\t}", "java.util.List<? extends TransmissionProtocol.RequestOrBuilder> \n getRequestOrBuilderList();", "@Override\n public String toString() {\n return \"ConfirmOrderReferenceRequest{\"\n + \"amazonOrderReferenceId=\" + amazonOrderReferenceId\n + \", authorizationAmount=\" + authorizationAmount\n + \", authorizationCurrencyCode=\" + authorizationCurrencyCode\n + \", successUrl=\" + successUrl\n + \", failureUrl=\" + failureUrl\n + \", mwsAuthToken=\" + getMwsAuthToken() \n + \", expectImmediateAuthorize=\" + isExpectImmediateAuthorization() +'}';\n }", "@Override\r\n\t\t\tprotected Map<String, String> getParams() throws AuthFailureError {\n\t\t\t\tMap<String, String> map = new HashMap<String, String>();\r\n\t\t\t\tmap.put(\"mer_session_id\", application.getLoginInfo()\r\n\t\t\t\t\t\t.getMer_session_id());\r\n\t\t\t\tmap.put(\"pagenum\", 15 + \"\");\r\n\t\t\t\tmap.put(\"type\", orderType);\r\n\t\t\t\treturn map;\r\n\t\t\t}", "NewOrderResponse newOrder(NewOrder order);", "com.uzak.inter.bean.test.TestRequest.TestBeanRequestOrBuilder getRequestOrBuilder();", "public PlaceReserveInformationExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "public com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.hoteloptions.v1.HotelOptions getHotelOptionsReq(HotelOptions hotelOptions){\n\t\tcom.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.hoteloptions.v1.HotelOptions hotelOptionsReq = \n\t\t\tnew com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.hoteloptions.v1.HotelOptions();\n\t\t\n\t\thotelOptionsReq.setAppleRating( hotelOptions.getAppleRating() );\n\t\t//hotelOptionsReq.setGdsHotelCode(arg0)//ignore\n\t\thotelOptionsReq.setHotelChain( hotelOptions.getHotelChain() );\n\t\tif( hotelOptions.getHotelCode() != null ){\n\t\t\thotelOptionsReq.setHotelCode( hotelOptions.getHotelCode() );\n\t\t}\n\t\telse{\n\t\t\thotelOptionsReq.setHotelCode( \"\" );\n\t\t}\n\t\thotelOptionsReq.setHotelName( hotelOptions.getHotelName() );\n\t\t\n\t\tif( this.getIMApplicationInfo() != null ){\n\t\t\thotelOptionsReq.setImApplicationInfo( this.getImApplicationInfoReq( this.getIMApplicationInfo() ) );\n\t\t}\n\t\t\n\t\thotelOptionsReq.setNoOfRooms( new Integer(hotelOptions.getNoOfRooms()) );\n\t\thotelOptionsReq.setShowAll( new Boolean(hotelOptions.isShowAll()) );\n\t\thotelOptionsReq.setRoomTypeCode( hotelOptions.getRoomTypeCode() );\n\t\thotelOptionsReq.setRatePlanCode( hotelOptions.getRatePlanCode() );\n\t\tif( hotelOptions.getResortArea() != null ){\n\t\t\thotelOptionsReq.setResortArea( this.getResortAreaReq( hotelOptions.getResortArea() ) );\n\t\t}\n\t\tif( (hotelOptions.getAmenities() != null) && (hotelOptions.getAmenities().size() > 0) ){\n\t\t\tfor(int i=0; i < hotelOptions.getAmenities().size(); i++){\n\t\t\t\tif( hotelOptions.getAmenities().get(i) != null ){\n\t\t\t\t\thotelOptionsReq.getAmenities().add(this.getAmenityReq(hotelOptions.getAmenities().get(i)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn hotelOptionsReq;\n\t}", "public interface PlaceService {\n\n @FormUrlEncoded\n @POST(\"order/create_order.html\")\n @DataKey(\"\")\n @DataChecker\n @DataPaser\n @AutoShowLogin\n Observable<JsonRetEntity<PayOrderInfo>>\n create_order(\n @Field(\"commodity\") String commodityId,\n @Field(\"orderType\") String orderType,\n @Field(\"payType\") String payType\n );\n\n /**\n * 3.3 订单支付结果(√)\n * 接口描述:支付完成后,APP轮询获取订单状态 ,订单流程第三步\n * 接口地址:/order/place/pay_result.html\n * 接口参数:\n * <p/>\n * 字段\t字段名称\t类型\t非空\t描述\n * orderId\t订单号\tLong\t是\n * {\n *\n * @param orderId\n * @return\n */\n @FormUrlEncoded\n @POST(\"order/pay_result.html\")\n @DataKey(\"\")\n @DataChecker(ValidPayResultChecker.class)\n @DataPaser\n @AutoShowLogin\n Observable<JsonRetEntity<PayResultEntity>>\n pay_result(\n @Field(\"orderId\") String orderId\n );\n}", "public com.kcdataservices.partners.kcdebdmnlib_common.businessobjects.address.v1.Address getAddressReq(Address address){\n\t\tcom.kcdataservices.partners.kcdebdmnlib_common.businessobjects.address.v1.Address addressReq =\n\t\t\tnew com.kcdataservices.partners.kcdebdmnlib_common.businessobjects.address.v1.Address();\n\t\t//Start theAV-3749/HBsi 52 Enhancement of emergency info tab for passegner\t\n\t\taddressReq.setStreetAddress( address.getStreetAddress() );\n\t\taddressReq.setCity( address.getCity() );\n\t\taddressReq.setState( address.getState() );\n\t\t//Business wise not require for now\n\t\t//addressReq.setCountry( address.getCountry() );\n\t\taddressReq.setZipCode( address.getZipCode() );\n\t\t//End of the AV-3749/HBsi 52 Enhancement of emergency info tab for passegner\t\n\t\treturn addressReq;\n\t}", "public VehicleSearchRequest createSearchVechicle() {\r\n\r\n\t\tVehicleSearchRequest searchRequest = new VehicleSearchRequest();\r\n\r\n\t\tif (StringUtils.isBlank(searchLocation)) {\r\n\t\t\tsearchRequest.setLocation(DefaultValues.LOCATION_DEFAULT.getDef());\r\n\t\t} else {\r\n\t\t\tsearchRequest.setLocation(searchLocation);\r\n\t\t}\r\n\r\n\t\tif (StringUtils.isBlank(searchVehicleType)) {\r\n\t\t\tsearchRequest.setVehicleType(VehicleType.getEnum(DefaultValues.VEHICLE_TYPE_DEFAULT.getDef()));\r\n\t\t} else {\r\n\t\t\tsearchRequest.setVehicleType(VehicleType.getEnum(searchVehicleType));\r\n\t\t}\r\n\r\n\t\tif (StringUtils.isBlank(searchFin)) {\r\n\t\t\tsearchRequest.setFin(DefaultValues.FIN_DEFAULT.getDef());\r\n\t\t} else {\r\n\t\t\tsearchRequest.setFin(searchFin);\r\n\t\t}\r\n\r\n\t\tif (StringUtils.isBlank(searchModel)) {\r\n\t\t\tsearchRequest.setModel(DefaultValues.MODEL_DEFAULT.getDef());\r\n\t\t} else {\r\n\t\t\tsearchRequest.setModel(searchModel);\r\n\t\t}\r\n\r\n\t\tif (StringUtils.isBlank(searchFuelType)) {\r\n\t\t\tsearchRequest.setFuelType(FuelType.DEFAULT);\r\n\t\t} else {\r\n\t\t\tsearchRequest.setFuelType(FuelType.getEnum(searchFuelType));\r\n\t\t}\r\n\r\n\t\tif (searchMaxCapacity == 0) {\r\n\t\t\tsearchRequest.setMaxCapacity(DefaultValues.MAX_CAPACITY_DEFAULT.getDefValue());\r\n\t\t} else {\r\n\t\t\tsearchRequest.setMaxCapacity(searchMaxCapacity);\r\n\t\t}\r\n\r\n\t\tif (searchMinCapacity == 0) {\r\n\t\t\tsearchRequest.setMinCapacity(DefaultValues.MIN_CAPACITY_DEFAULT.getDefValue());\r\n\t\t} else {\r\n\t\t\tsearchRequest.setMinCapacity(searchMinCapacity);\r\n\t\t}\r\n\r\n\t\tif (searchMinYear == 0) {\r\n\t\t\tsearchRequest.setMinYear(DefaultValues.MIN_YEAR_DEFAULT.getDefValue());\r\n\t\t} else {\r\n\t\t\tsearchRequest.setMinYear(searchMinYear);\r\n\t\t}\r\n\r\n\t\tif (searchMaxYear == 0) {\r\n\t\t\tsearchRequest.setMaxYear(DefaultValues.MAX_YEAR_DEFAULT.getDefValue());\r\n\t\t} else {\r\n\t\t\tsearchRequest.setMaxYear(searchMaxYear);\r\n\t\t}\r\n\r\n\t\tif (searchMaxPrice == 0) {\r\n\t\t\tsearchRequest.setMaxPrice(DefaultValues.MAX_PRICE_DEFAULT.getDefValue());\r\n\t\t} else {\r\n\t\t\tsearchRequest.setMaxPrice(searchMaxPrice);\r\n\t\t}\r\n\r\n\t\tif (searchMinPrice == 0) {\r\n\t\t\tsearchRequest.setMinPrice(DefaultValues.MIN_PRICE_DEFAULT.getDefValue());\r\n\t\t} else {\r\n\t\t\tsearchRequest.setMinPrice(searchMinPrice);\r\n\t\t}\r\n\t\treturn searchRequest;\r\n\t}", "java.util.List<pb4client.TransportRequest> \n getReqList();", "public com.vodafone.global.er.decoupling.binding.request.GetServiceRequest createGetServiceRequest()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.GetServiceRequestImpl();\n }", "com.exacttarget.wsdl.partnerapi.QueryRequest addNewQueryRequest();", "public interface OrderService {\n\n /**\n * 司机发布信息\n *\n * @param idno\n * @param driverShareInfo\n * @return\n */\n DriverShareInfo shareDriverInfo(String idno, DriverShareInfo driverShareInfo);\n\n /**\n * 乘客预定校验\n *\n * @param idno\n * @param driverOrderId\n * @param passerOrderId\n * @param genToken\n * @return\n */\n Result passerReserveCheck(String idno, Long driverOrderId, Long passerOrderId, boolean genToken);\n\n /**\n * 乘客预定\n *\n * @param radomToken\n * @param idno\n * @param driverOrderId\n * @param passerOrderId\n * @return\n */\n Result passerReserve(String radomToken, String idno, Long driverOrderId, Long passerOrderId);\n\n\n}", "com.google.protobuf.StringValueOrBuilder getOrderIdOrBuilder();", "@Override\n @XmlElement(name = \"specification\")\n public synchronized InternationalString getSpecification() {\n return specification;\n }", "TxnRequestProto.TxnRequestOrBuilder getTxnrequestOrBuilder();", "PToP.S2InfoReq getS2InfoReq();", "public String toXMLString() {\r\n\t\tswitch (this.transactionType) {\r\n\t\tcase GET_SETTLED_BATCH_LIST :\r\n\t\t\tgetSettledBatchListRequest();\r\n\t\t\tbreak;\r\n\t\tcase GET_TRANSACTION_DETAILS :\r\n\t\t\tgetTransactionDetailsRequest();\r\n\t\t\tbreak;\r\n\t\tcase GET_TRANSACTION_LIST :\r\n\t\t\tgetTransactionListRequest();\r\n\t\t\tbreak;\r\n\t\tcase GET_BATCH_STATISTICS :\r\n\t\t\tgetBatchStatisticsRequest();\r\n\t\t\tbreak;\r\n\t\tcase GET_UNSETTLED_TRANSACTION_LIST :\r\n\t\t\tgetUnsettledTransactionListRequest();\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn currentRequest.dump();\r\n\t}", "protected static ServiceRequest createServiceRequest( Element elem, String webinfPath )\n throws XMLParsingException, IOException {\n String requestName = XMLTools.getAttrValue( elem, null, \"name\", null );\n String attr = XMLTools.getAttrValue( elem, null, \"isGetable\", null );\n boolean canGet = ( attr != null && attr.equals( \"1\" ) ) ? true : false;\n\n attr = XMLTools.getAttrValue( elem, null, \"isPostable\", null );\n boolean canPost = ( attr != null && attr.equals( \"1\" ) ) ? true : false;\n\n String getForm = XMLTools.getNodeAsString( elem, StringTools.concat( 100, \"./\", dotPrefix, \"GetForm\" ), cnxt,\n null );\n String postForm = XMLTools.getNodeAsString( elem, StringTools.concat( 100, \"./\", dotPrefix, \"PostForm\" ), cnxt,\n null );\n List<Element> list = XMLTools.getElements( elem, StringTools.concat( 100, \"./\", dotPrefix,\n \"RequestParameters/\", dotPrefix, \"Key\" ),\n cnxt );\n List<String> htmlKeys = new ArrayList<String>();\n for ( Element key : list ) {\n htmlKeys.add( key.getTextContent() );\n }\n String getSnippetPath = null;\n if ( getForm != null && getForm.length() > 0 ) {\n StringBuilder builder = new StringBuilder( 150 );\n builder.append( webinfPath );\n if ( !webinfPath.endsWith( \"/\" ) ) {\n builder.append( \"/\" );\n }\n builder.append( getForm );\n getSnippetPath = builder.toString();\n }\n\n String postSnippetPath = null;\n if ( postForm != null && postForm.length() > 0 ) {\n StringBuilder builder = new StringBuilder( 150 );\n builder.append( webinfPath );\n if ( !webinfPath.endsWith( \"/\" ) ) {\n builder.append( \"/\" );\n }\n builder.append( postForm );\n postSnippetPath = builder.toString();\n }\n\n return new ServiceRequest( requestName, getSnippetPath, postSnippetPath, canPost, canGet, htmlKeys );\n }", "private CartReceiptRequest buildRequestFromParameters(String[] requestParameters) throws ParseException {\n CartReceiptRequest receiptRequest = new CartReceiptRequest();\n LOGGER.debug(\"localeParam =\" + requestParameters[2] + \" \\t applicationId =\" + requestParameters[1]);\n /* Building request for the Reprint API */\n receiptRequest.setUserId(Long.valueOf(requestParameters[0]));\n receiptRequest.setApplicationId(Long.valueOf(requestParameters[1]));\n receiptRequest.setLocale(requestParameters[2]);\n receiptRequest.setCartId(Long.valueOf(requestParameters[3]));\n Long milliSeconds = Long.parseLong(requestParameters[4]);\n Date date = new Date(milliSeconds);\n receiptRequest.setCartDate(date);\n /* Returning constructed API request*/\n return receiptRequest;\n }", "private void getTransactionListRequest() {\r\n\t\tBasicXmlDocument document = new BasicXmlDocument();\r\n\t\tdocument.parseString(\"<\" + TransactionType.GET_TRANSACTION_LIST.getValue()\r\n\t\t\t\t+ \" xmlns = \\\"\" + XML_NAMESPACE + \"\\\" />\");\r\n\r\n\t\taddAuthentication(document);\r\n\t\taddReportingBatchId(document);\r\n\r\n\t\tcurrentRequest = document;\r\n\t}", "Request _request(String operation);", "@GetMapping(\"/createorders\")\n\tpublic void generateOrderRequest(){\n\t\tSystem.out.println(\" == generateOrderRequest == \");\n\t\tfor(int i=0;i<150;i++) {\n\t\t\t// create new order\n\t\t\tOrderRequest order = new OrderRequest();\n\t\t\torder.setOrderReqId(\n\t\t\t\t\tInteger.parseInt(new RandomStringGenerator.Builder().withinRange('1', '9').build().generate(5))\n\t\t\t\t\t);\n\t\t\torder.setName(new RandomStringGenerator.Builder().withinRange('a', 'z').build().generate(5));\n\t\t\t// create status row for this order\n\t\t\tOrderRequestStatus orderStatus = new OrderRequestStatus();\n\t\t\torderStatus.setStatus(\"new\");\n\t\t\torderStatus.setOrderRequest(order);\n\t\t\torderStateRepository.save(orderStatus);\n\t\t}\n\t}", "@Override\n\tpublic void make_body() {\n\t\t\n\t\tElement order_e=body.addElement(\"RouteRequest\");\n\t\t\n\t\torder_e.addAttribute(\"tracking_type\", \"1\");\n\t\torder_e.addAttribute(\"method_type\", \"1\");\n\t\tString mail_nos=\"\";\n\t\t\n\t\t\tmail_nos=com.cqqyd2014.util.ArrayTools.convertFieldToArrayString(this.getDbs(), \"getExpress_no\",String.class);\n\t\t\n\t\tmail_nos=mail_nos.substring(1, mail_nos.length()-1);\n\t\t\n\t\torder_e.addAttribute(\"tracking_number\",mail_nos);\n\t}", "WebClientServiceRequest serviceRequest();", "com.learning.learning.grpc.ManagerOperationRequest.Operations getOperation();", "private void getSettledBatchListRequest() {\r\n\t\tBasicXmlDocument document = new BasicXmlDocument();\r\n\t\tdocument.parseString(\"<\" + TransactionType.GET_SETTLED_BATCH_LIST.getValue()\r\n\t\t\t\t+ \" xmlns = \\\"\" + XML_NAMESPACE + \"\\\" />\");\r\n\r\n\t\taddAuthentication(document);\r\n\t\taddReportingBatchListOptions(document);\r\n\r\n\t\tcurrentRequest = document;\r\n\t}", "private PredictRequest() {\n\t}", "TypedRequest createTypedRequest();", "public static JSONObject placeOrder(Map<String, String> orderDetails) {\n JSONObject responseJson = new JSONObject();\n\n System.out.println(\"building json\");\n\n try {\n JSONObject orderJson = new JSONObject();\n\n /* \n required attributes: \n 1. retailer\n 2. products\n 3. shipping_address\n 4. shipping_method\n 5. billing_address\n 6. payment_method\n 7. retailer_credentials\n \n /* other attributes we will use:\n 8. max_price \n \n */\n // 1.\n // put the retailer attribute in\n orderJson.put(\"retailer\", \"amazon\");\n\n // 2.\n // create the products array\n JSONArray products = new JSONArray();\n JSONObject product = createProductObject(orderDetails);\n // put product in array\n products.put(product);\n // put the products array in orderJson\n orderJson.put(\"products\", products);\n\n // 3. \n // create shipping address object\n JSONObject shipAddress = createShipAddressObject(orderDetails);\n orderJson.put(\"shipping_address\", shipAddress);\n\n // 4. \n // insert shipping method attribute\n orderJson.put(\"shipping_method\", \"cheapest\");\n\n // 5.\n // create billing address object\n JSONObject billAddress = createBillAddressObject(orderDetails);\n orderJson.put(\"billing_address\", billAddress);\n\n // 6. \n // create payment method object\n JSONObject paymentMethod = createPaymentMethod(orderDetails);\n orderJson.put(\"payment_method\", paymentMethod);\n\n // 7. \n // create retailer credentials object\n JSONObject retailerCredentials = createRetailerCredentialsObject();\n orderJson.put(\"retailer_credentials\", retailerCredentials);\n\n // 8.\n // put max_price in orderJson\n // NOTE: this is the last thing that will prevent an order from \n // actually going through. use 0 for testing purposes, change to \n // maxPrice to actually put the order through\n orderJson.put(\"max_price\", 0); // replace with: orderDetails.get(\"maxPrice\")\n\n //===--- finally: send the json to the api ---===//\n responseJson = sendRequest(orderJson);\n //===-----------------------------------------===//\n\n } catch (JSONException ex) {\n Logger.getLogger(ZincUtils.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n return responseJson;\n }", "public interface RequestInfo {\n\n /**\n * Sets status for the request\n * @param status\n */\n void setStatus(STATUS status);\n\n /**\n * @return status of the request\n */\n STATUS getStatus();\n\n /**\n * @return unique id of the request\n */\n Long getId();\n\n /**\n * @return list of errors for this request if any\n */\n List<? extends ErrorInfo> getErrorInfo();\n\n /**\n * @return number of retries available for this request\n */\n int getRetries();\n\n /**\n * @return number of already executed attempts\n */\n int getExecutions();\n\n /**\n * @return command name for this request\n */\n String getCommandName();\n\n /**\n * @return business key assigned to this request\n */\n String getKey();\n\n /**\n * @return descriptive message assigned to this request\n */\n String getMessage();\n\n /**\n * @return time that this request shall be executed (for the first attempt)\n */\n Date getTime();\n\n /**\n * @return serialized bytes of the contextual request data\n */\n byte[] getRequestData();\n\n /**\n * @return serialized bytes of the response data\n */\n byte[] getResponseData();\n \n /**\n * @return optional deployment id in case this job is scheduled from within process context\n */\n String getDeploymentId();\n \n /**\n * @return optional process instance id in case this job is scheduled from within process context\n */\n Long getProcessInstanceId();\n \n /**\n * @return get priority assigned to this job request\n */\n int getPriority();\n}", "pb4client.TransportRequestOrBuilder getReqOrBuilder(\n int index);", "public interface OrderService {\n\n /**\n * Get Quote ID\n *\n * @return String id of quote\n */\n @POST(\"V1/carts/mine\")\n Observable<String> getQuoteID();\n\n /**\n * Add item to cart\n *\n * @param CartItemRequest\n * @return CartProductItem\n * @see CartProductItem\n */\n @POST(\"V1/carts/mine/items\")\n Observable<CartProductItem> addItemToCart(@Body CartItemRequest CartItemRequest);\n\n /**\n * @param mail\n * @return\n */\n @POST(\"V2/eshopping/store/clearCart/{mail}\")\n Observable<Integer> clearItemFromCart(@Path(\"mail\") String mail);\n\n /**\n * @param id\n * @return OrderDetail\n * @see OrderDetail\n */\n @GET(\"V1/orders/{order_id}\")\n Observable<OrderDetail> getOrderDetail(@Path(\"order_id\") Long id);\n\n /**\n * Get order detail list\n *\n * @param stringHashMap\n * @return ItemList\n * @see ItemList\n */\n @GET(\"V1/orders/?\")\n Observable<ItemList> getOrderDetailList(@QueryMap HashMap<String, String> stringHashMap);\n\n /**\n * @param shippingMethod\n * @return List of ShipmentMethodInfo\n * @see ShipmentMethodInfo\n */\n @POST(\"V1/carts/mine/estimate-shipping-methods\")\n Observable<List<ShipmentMethodInfo>> estimateShippingMethods(@Body ShippingMethod shippingMethod);\n\n /**\n * @param shippingBilling\n * @return CheckoutResponse\n * @see CheckoutResponse\n */\n @POST(\"V1/carts/mine/shipping-information\")\n Observable<CheckoutResponse> summitShipment(@Body ShippingBilling shippingBilling);\n\n /**\n * @param orderProduct\n * @return List of Bulk Order\n */\n @POST(\"V2/eshopping/store/orderProduct\")\n Observable<List<String>> bulkOrder(@Body OrderProduct orderProduct);\n\n /**\n *\n * @param id\n * @return\n */\n @GET(\"V2/eshopping/order/getAddressLatitudeLongitude/{order_id}\")\n Observable<List<String>> getOrderDetailLatLng(@Path(\"order_id\") Long id);\n\n /**\n *\n * @param id\n * @return\n */\n @GET(\"V2/eshopping/order/getServiceFee/{order_id}\")\n Observable<String> getOrderServiceFee(@Path(\"order_id\") Long id);\n\n /**\n *\n * @param id\n * @return\n */\n @GET(\"V2/eshopping/order/getDeliveryDate/{order_id}\")\n Observable<String> getDeliveryDate(@Path(\"order_id\") Long id);\n\n /**\n *\n * @param id\n * @return\n */\n @GET(\"V2/eshopping/order/getDeliveryComment/{order_id}\")\n Observable<String> getOrderComment(@Path(\"order_id\") Long id);\n\n /**\n *\n * @param incrementId\n * @return\n */\n @GET(\"V2/eshopping/order/getItemsByIncrementId/{increment_id}\")\n Observable<List<ProductItem>> getOrderItems(@Path(\"increment_id\") String incrementId);\n\n /**\n * @see OrderItem\n * @param orderId orderId\n * @return List of OrderItem\n */\n @GET(\"V2/eshopping/order/visibaleItem/{orderId}\")\n Observable<List<OrderItem>> getOrderItemsByOrderId(@Path(\"orderId\") Long orderId);\n\n /**\n * get order status comment\n * @param orderId Long\n * @return List of OrderStatus\n */\n @GET(\"V2/eshopping/order/statusHistories/{orderId}\")\n Observable<List<OrderStatus>> getOrderStatusComment(@Path(\"orderId\") Long orderId);\n\n /**\n * Get driver location history\n * @param orderId Long\n * @return List<DriverLocation>\n */\n @GET(\"V2/eshopping/driver/getDriverLocationByOrderId/{orderId}\")\n Observable<List<DriverLocation>> getLocationHistoryByOrderId(@Path(\"orderId\") Long orderId);\n\n /**\n * Get last driver location history\n * @param orderId Long\n * @return List<DriverLocation>\n */\n @GET(\"V2/eshopping/driver/getDriverLastLocation/{orderId}\")\n Observable<List<DriverLocation>> getLastDriverLocationByOrderId(@Path(\"orderId\") Long orderId);\n\n /**\n *\n * @param orderId\n * @return\n */\n @GET(\"V2/eshopping/driver/getDriverInfoByOrderId/{orderId}\")\n Observable<List<DriverInfo>> getDriverInfoByOrderId(@Path(\"orderId\") Long orderId);\n}", "pb4server.AddDecreeAskReq getAddDecreeAskReq();", "public Map<String, String> createOrder(boolean debug) throws IOException {\n Map<String, String> map = new HashMap<>();\n OrdersCreateRequest request = new OrdersCreateRequest();\n request.prefer(\"return=representation\");\n request.requestBody(buildRequestBody());\n //3. Call PayPal to set up a transaction\n HttpResponse<Order> response = client().execute(request);\n System.out.println(\"Response: \" + response.toString());\n // if (true) {\n if (response.statusCode() == 201) {\n System.out.println(\"Status Code: \" + response.statusCode());\n System.out.println(\"Status: \" + response.result().status());\n System.out.println(\"Order ID: \" + response.result().id());\n System.out.println(\"Intent: \" + response.result().intent());\n System.out.println(\"Links: \");\n for (LinkDescription link : response.result().links()) {\n System.out.println(\"\\t\" + link.rel() + \": \" + link.href() + \"\\tCall Type: \" + link.method());\n }\n System.out.println(\"Total Amount: \" + response.result().purchaseUnits().get(0).amount().currencyCode()\n + \" \" + response.result().purchaseUnits().get(0).amount().value());\n\n\n map.put(\"statusCode\" , response.statusCode()+\"\");\n map.put(\"status\" , response.result().status());\n map.put(\"orderID\" , response.result().id());\n\n //return response.result().id();\n } else {\n System.out.println(\"Response: \" + response.toString());\n map.put(\"Reponse\",response.toString());\n //return response.toString();\n }\n\n return map;\n //}\n }", "@Override\n public Type getType() {\n return Type.TypeRequest;\n }", "KafkaRequestParamOrBuilder getRequestOrBuilder();", "public interface ICloudRequest {\n \n public int getOp();\n public void incrementRetries();\n public void resetRetries();\n public int getRetries();\n \n /**\n * Retrieve the data unit associated with this request\n * @return {@link DepSkyDataUnit}\n */\n public DepSkyDataUnit getDataUnit();\n \n /**\n * Determine when this procedure started originally\n * @return long - start time of this procedure\n */\n public long getStartTime();\n \n /**\n * Determine the sequence of this request\n * @return long\n */\n public long getSequenceNumber();\n \n /**\n * Get the data resulting from this request\n * @return byte[] consisting of the data\n */\n public byte[] getData();\n \n \n}" ]
[ "0.587135", "0.5787134", "0.57580096", "0.5735386", "0.5705783", "0.5705783", "0.56952465", "0.56449926", "0.55998045", "0.5567796", "0.5549368", "0.55227816", "0.5498427", "0.5400307", "0.53988457", "0.5385814", "0.53819776", "0.5368674", "0.5367636", "0.5290995", "0.5273545", "0.52393633", "0.5217187", "0.52135694", "0.5192648", "0.5192567", "0.51817113", "0.5178428", "0.517755", "0.5177381", "0.5174952", "0.5174642", "0.5171847", "0.51703036", "0.5165985", "0.51597005", "0.51597005", "0.51597005", "0.51527804", "0.514252", "0.5120152", "0.51106495", "0.51070815", "0.51060295", "0.5105311", "0.51030195", "0.508957", "0.5074523", "0.5064099", "0.50629574", "0.5062347", "0.5051975", "0.504905", "0.5041715", "0.50284785", "0.50241804", "0.5022872", "0.5010932", "0.5009163", "0.500404", "0.4989197", "0.49833846", "0.49694782", "0.49612996", "0.4960247", "0.49585795", "0.49573773", "0.4955699", "0.4951801", "0.49456403", "0.49433082", "0.4934512", "0.49321568", "0.49249896", "0.49124312", "0.49047938", "0.48994407", "0.489618", "0.48953342", "0.48943862", "0.48833272", "0.4878187", "0.4875575", "0.48735556", "0.4860469", "0.4859013", "0.48515874", "0.48462638", "0.48439014", "0.48427615", "0.48423597", "0.4838315", "0.48363277", "0.4833129", "0.48328936", "0.48292005", "0.48183724", "0.4815132", "0.4814067", "0.481144" ]
0.6385335
0
Method to call place order service and return response
public static Response placeOrderServiceCall(long id, long petId, int quantity, String shipDate, String status, boolean completed) { Response response = placeOrderRequest(id, petId, quantity, shipDate, status, completed).when().post(placeOrderResource()); APILogger.logInfo(LOGGER, "Place Store Order service Response..."); response.then().log().all(); return response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface PlaceService {\n\n @FormUrlEncoded\n @POST(\"order/create_order.html\")\n @DataKey(\"\")\n @DataChecker\n @DataPaser\n @AutoShowLogin\n Observable<JsonRetEntity<PayOrderInfo>>\n create_order(\n @Field(\"commodity\") String commodityId,\n @Field(\"orderType\") String orderType,\n @Field(\"payType\") String payType\n );\n\n /**\n * 3.3 订单支付结果(√)\n * 接口描述:支付完成后,APP轮询获取订单状态 ,订单流程第三步\n * 接口地址:/order/place/pay_result.html\n * 接口参数:\n * <p/>\n * 字段\t字段名称\t类型\t非空\t描述\n * orderId\t订单号\tLong\t是\n * {\n *\n * @param orderId\n * @return\n */\n @FormUrlEncoded\n @POST(\"order/pay_result.html\")\n @DataKey(\"\")\n @DataChecker(ValidPayResultChecker.class)\n @DataPaser\n @AutoShowLogin\n Observable<JsonRetEntity<PayResultEntity>>\n pay_result(\n @Field(\"orderId\") String orderId\n );\n}", "@Test\n public void placeOrderTest() {\n Order body = new Order().id(10L)\n .petId(10L)\n .complete(false)\n .status(Order.StatusEnum.PLACED)\n .quantity(1);\n Order response = api.placeOrder(body);\n\n Assert.assertEquals(10L, response.getId().longValue());\n Assert.assertEquals(10L, response.getPetId().longValue());\n Assert.assertEquals(1, response.getQuantity().intValue());\n Assert.assertEquals(true, response.isComplete());\n Assert.assertEquals(Order.StatusEnum.APPROVED, response.getStatus());\n\n verify(exactly(1), postRequestedFor(urlEqualTo(\"/store/order\")));\n }", "@Override\n public void onClick(View v) {\n\n String order = sendOrder(parcelCart);\n\n String orderPost = \"http://project-order-food.appspot.com/send_order\";\n final PostTask sendOrderTask = new PostTask(); // need to make a new httptask for each request\n try {\n // try the getTask with actual location from gps\n sendOrderTask.execute(orderPost, order).get(30, TimeUnit.SECONDS);\n Log.d(\"httppost\", order);\n }\n catch (Exception e)\n {\n e.printStackTrace();\n }\n\n Log.d(\"Button\", \"clicked\");\n Log.d(\"sendorder\", sendOrder(parcelCart));\n Toast toast = Toast.makeText(getApplication().getBaseContext(), \"Order Placed!\", Toast.LENGTH_LONG);\n toast.show();\n }", "@Override\n public List<Order> call() throws Exception {\n String lastName = customer.getLastName();\n String firstName = customer.getFirstName();\n String str = \"http://10.0.2.2:8082/getCustomerOrders?lastName=\" +lastName + \"&firstName=\"+firstName;\n URLConnection urlConn;\n BufferedReader bufferedReader;\n List<Order> orderList = new ArrayList<>();\n\n\n try {\n URL url = new URL(str);\n urlConn = url.openConnection();\n bufferedReader = new BufferedReader(new InputStreamReader(urlConn.getInputStream()));\n\n String line;\n while ((line = bufferedReader.readLine()) != null) {\n\n JSONObject jsonObject = new JSONObject(line);\n Order order = new Order();\n order.setOrderID(jsonObject.getString(\"_id\"));\n order.setLastName(jsonObject.getString(\"lastName\"));\n order.setFirstName(jsonObject.getString(\"firstName\"));\n order.setDate(jsonObject.getString(\"dateOfOrder\"));\n order.setTotal(jsonObject.getDouble(\"Total\"));\n orderList.add(order);\n\n\n }\n\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n return orderList;\n }", "public APIResponse placeOrder(@NotNull Order order){\n try {\n validateOrder(order);\n \n order.getItems().addAll(\n orderItemRepository.saveAll(order.getItems())\n );\n orderRepository.save( order );\n return APIResponse.builder()\n .success( true)\n .data( true )\n .error( null )\n .build();\n }catch (Exception exception){\n\n log.error(exception.getMessage());\n return APIResponse.builder()\n .success( true)\n .data( false )\n .error( exception.getMessage() )\n .build();\n }\n }", "public interface OrderService {\n\n /**\n * Get Quote ID\n *\n * @return String id of quote\n */\n @POST(\"V1/carts/mine\")\n Observable<String> getQuoteID();\n\n /**\n * Add item to cart\n *\n * @param CartItemRequest\n * @return CartProductItem\n * @see CartProductItem\n */\n @POST(\"V1/carts/mine/items\")\n Observable<CartProductItem> addItemToCart(@Body CartItemRequest CartItemRequest);\n\n /**\n * @param mail\n * @return\n */\n @POST(\"V2/eshopping/store/clearCart/{mail}\")\n Observable<Integer> clearItemFromCart(@Path(\"mail\") String mail);\n\n /**\n * @param id\n * @return OrderDetail\n * @see OrderDetail\n */\n @GET(\"V1/orders/{order_id}\")\n Observable<OrderDetail> getOrderDetail(@Path(\"order_id\") Long id);\n\n /**\n * Get order detail list\n *\n * @param stringHashMap\n * @return ItemList\n * @see ItemList\n */\n @GET(\"V1/orders/?\")\n Observable<ItemList> getOrderDetailList(@QueryMap HashMap<String, String> stringHashMap);\n\n /**\n * @param shippingMethod\n * @return List of ShipmentMethodInfo\n * @see ShipmentMethodInfo\n */\n @POST(\"V1/carts/mine/estimate-shipping-methods\")\n Observable<List<ShipmentMethodInfo>> estimateShippingMethods(@Body ShippingMethod shippingMethod);\n\n /**\n * @param shippingBilling\n * @return CheckoutResponse\n * @see CheckoutResponse\n */\n @POST(\"V1/carts/mine/shipping-information\")\n Observable<CheckoutResponse> summitShipment(@Body ShippingBilling shippingBilling);\n\n /**\n * @param orderProduct\n * @return List of Bulk Order\n */\n @POST(\"V2/eshopping/store/orderProduct\")\n Observable<List<String>> bulkOrder(@Body OrderProduct orderProduct);\n\n /**\n *\n * @param id\n * @return\n */\n @GET(\"V2/eshopping/order/getAddressLatitudeLongitude/{order_id}\")\n Observable<List<String>> getOrderDetailLatLng(@Path(\"order_id\") Long id);\n\n /**\n *\n * @param id\n * @return\n */\n @GET(\"V2/eshopping/order/getServiceFee/{order_id}\")\n Observable<String> getOrderServiceFee(@Path(\"order_id\") Long id);\n\n /**\n *\n * @param id\n * @return\n */\n @GET(\"V2/eshopping/order/getDeliveryDate/{order_id}\")\n Observable<String> getDeliveryDate(@Path(\"order_id\") Long id);\n\n /**\n *\n * @param id\n * @return\n */\n @GET(\"V2/eshopping/order/getDeliveryComment/{order_id}\")\n Observable<String> getOrderComment(@Path(\"order_id\") Long id);\n\n /**\n *\n * @param incrementId\n * @return\n */\n @GET(\"V2/eshopping/order/getItemsByIncrementId/{increment_id}\")\n Observable<List<ProductItem>> getOrderItems(@Path(\"increment_id\") String incrementId);\n\n /**\n * @see OrderItem\n * @param orderId orderId\n * @return List of OrderItem\n */\n @GET(\"V2/eshopping/order/visibaleItem/{orderId}\")\n Observable<List<OrderItem>> getOrderItemsByOrderId(@Path(\"orderId\") Long orderId);\n\n /**\n * get order status comment\n * @param orderId Long\n * @return List of OrderStatus\n */\n @GET(\"V2/eshopping/order/statusHistories/{orderId}\")\n Observable<List<OrderStatus>> getOrderStatusComment(@Path(\"orderId\") Long orderId);\n\n /**\n * Get driver location history\n * @param orderId Long\n * @return List<DriverLocation>\n */\n @GET(\"V2/eshopping/driver/getDriverLocationByOrderId/{orderId}\")\n Observable<List<DriverLocation>> getLocationHistoryByOrderId(@Path(\"orderId\") Long orderId);\n\n /**\n * Get last driver location history\n * @param orderId Long\n * @return List<DriverLocation>\n */\n @GET(\"V2/eshopping/driver/getDriverLastLocation/{orderId}\")\n Observable<List<DriverLocation>> getLastDriverLocationByOrderId(@Path(\"orderId\") Long orderId);\n\n /**\n *\n * @param orderId\n * @return\n */\n @GET(\"V2/eshopping/driver/getDriverInfoByOrderId/{orderId}\")\n Observable<List<DriverInfo>> getDriverInfoByOrderId(@Path(\"orderId\") Long orderId);\n}", "@RequestMapping(\"/create\")\r\n\t@Produces({ MediaType.TEXT_PLAIN })\r\n\tpublic String createOrder() {\n\t\tString response = \"\";\r\n\t\ttry {\r\n\t\t\tSystem.out.println(\"in EO calling Validate REST API : \"+System.currentTimeMillis()); \r\n\t\t\tStopWatch watch = new StopWatch();\r\n\t\t\tHttpUriRequest request = new HttpGet(\"http://localhost:\" + \"\" + \"9091\" + \"/eo/validate\");\r\n\t\t\tHttpResponse httpResponse;\r\n\t\t\twatch.start();\r\n\t\t\thttpResponse = HttpClientBuilder.create().build().execute(request);\r\n\t\t\twatch.stop();\r\n\t\t\tresponse = EntityUtils.toString(httpResponse.getEntity());\r\n\t\t\tSystem.out.println(\">>>>>>>Response:\" + response + \" Response time(hh:mm:SS:mS): \" + watch.toString());\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 (response.contains(\"Order Validated\"))\r\n\t\t\treturn \"Order Created!!\";\r\n\t\telse\r\n\t\t\tthrow new InternalServerErrorException();\r\n\t}", "public interface OrderService {\n\n /**\n * 查询订单列表\n *\n * @param userId userId\n * @param pageNum pageNum\n * @param pageSize pageSize\n * @return pageInfo\n */\n ServerResponse<PageInfo> list(Integer userId, int pageNum, int pageSize);\n\n /**\n * 创建订单\n *\n * @param userId userId\n * @param shippingId shippingId\n * @return orderVo\n */\n ServerResponse insert(Integer userId, Integer shippingId);\n\n /**\n * 取消订单\n *\n * @param userId userId\n * @param orderNo orderNo\n * @return 取消的结果\n */\n ServerResponse<String> delete(Integer userId, Long orderNo);\n\n /**\n * 查询购物车商品\n *\n * @param userId userId\n * @return orderProductVO\n */\n ServerResponse getOrderCartProduct(Integer userId);\n\n /**\n * 查询订单详情\n *\n * @param userId userId\n * @param orderNo orderNo\n * @return orderVo\n */\n ServerResponse<OrderVO> getOrderDetail(Integer userId, Long orderNo);\n\n /**\n * 管理员查询所有订单\n *\n * @param pageNum pageNum\n * @param pageSize pageSize\n * @return 订单列表\n */\n ServerResponse<PageInfo> listOfAdmin(int pageNum, int pageSize);\n\n /**\n * 查看订单详情\n *\n * @param orderNo orderNo\n * @return 订单详情\n */\n ServerResponse<OrderVO> detail(Long orderNo);\n\n /**\n * 搜索订单\n *\n * @param orderNo orderNo\n * @param pageNum pageNum\n * @param pageSize pageSize\n * @return 搜索结果\n */\n ServerResponse<PageInfo> search(Long orderNo, int pageNum, int pageSize);\n\n /**\n * 发货\n *\n * @param orderNo orderNo\n * @return 发货结果\n */\n ServerResponse<String> sendGoods(Long orderNo);\n\n /**\n * 订单支付\n *\n * @param userId userId\n * @param orderNo orderNo\n * @param path path\n * @return 支付结果\n */\n ServerResponse pay(Integer userId, Long orderNo, String path);\n\n /**\n * 支付宝回调\n *\n * @param params params\n * @return 更新结果\n */\n ServerResponse alipayCallback(Map<String, String> params);\n\n /**\n * 查询订单支付状态\n *\n * @param userId userId\n * @param orderNo orderNo\n * @return 支付状态\n */\n ServerResponse queryOrderPayStatus(Integer userId, Long orderNo);\n}", "static void apiSample() {\n ApiClient client = new ApiClient(API_KEY, API_SECRET);\n // get symbol list:\n print(client.getSymbols());\n // get accounts:\n List<Account> accounts = client.getAccounts();\n print(accounts);\n if (!accounts.isEmpty()) {\n // find account id:\n Account account = accounts.get(0);\n long accountId = account.id;\n // create order:\n CreateOrderRequest createOrderReq = new CreateOrderRequest();\n createOrderReq.accountId = String.valueOf(accountId);\n createOrderReq.amount = \"0.02\";\n createOrderReq.price = \"1100.99\";\n createOrderReq.symbol = \"ethcny\";\n createOrderReq.type = CreateOrderRequest.OrderType.BUY_LIMIT;\n Long orderId = client.createOrder(createOrderReq);\n print(orderId);\n // place order:\n String r = client.placeOrder(orderId);\n print(r);\n }\n }", "public interface OrderUsingService {\n @Headers({\n \"Content-Type: application/json\",\n \"Accept: application/json\"\n })\n @POST(\"usingorder\")\n Call<OrderUsingResponse> orderUsing(@Body OrderUsingRequest orderUsingRequest);\n}", "public Map<String, String> createOrder(boolean debug) throws IOException {\n Map<String, String> map = new HashMap<>();\n OrdersCreateRequest request = new OrdersCreateRequest();\n request.prefer(\"return=representation\");\n request.requestBody(buildRequestBody());\n //3. Call PayPal to set up a transaction\n HttpResponse<Order> response = client().execute(request);\n System.out.println(\"Response: \" + response.toString());\n // if (true) {\n if (response.statusCode() == 201) {\n System.out.println(\"Status Code: \" + response.statusCode());\n System.out.println(\"Status: \" + response.result().status());\n System.out.println(\"Order ID: \" + response.result().id());\n System.out.println(\"Intent: \" + response.result().intent());\n System.out.println(\"Links: \");\n for (LinkDescription link : response.result().links()) {\n System.out.println(\"\\t\" + link.rel() + \": \" + link.href() + \"\\tCall Type: \" + link.method());\n }\n System.out.println(\"Total Amount: \" + response.result().purchaseUnits().get(0).amount().currencyCode()\n + \" \" + response.result().purchaseUnits().get(0).amount().value());\n\n\n map.put(\"statusCode\" , response.statusCode()+\"\");\n map.put(\"status\" , response.result().status());\n map.put(\"orderID\" , response.result().id());\n\n //return response.result().id();\n } else {\n System.out.println(\"Response: \" + response.toString());\n map.put(\"Reponse\",response.toString());\n //return response.toString();\n }\n\n return map;\n //}\n }", "@Override\n\t\tprotected void onPostExecute(JSONObject result) {\n\t\t\tsuper.onPostExecute(result);\n\t\t\tIntent broad=new Intent();\n\t\t\tbroad.setAction(MY_ACTION);\n\t\t\tbroad.putExtra(\"status\", status);\n\t\t\tbroad.putExtra(\"latitude\", latitude);\n\t\t\tbroad.putExtra(\"longitude\", longitude);\n\t\t\tsendBroadcast(broad);\n\t\t\t\n\t\t\tJSONObject position=new JSONObject();\n\t\t\tposition=new JSONObject();\n\t\t\t\n\t\t\ttry {\n\t\t\t\tposition.put(\"driver_uuid\", order_id);\n\t\t\t\tposition.put(\"driver_lat\", latitude.toString());\n\t\t\t\tposition.put(\"driver_lon\", longitude.toString());\n\t\t\t\tpr= new Position_Request(getResources().getString(R.string.Set_Position_Url));\n\t\t\t\tpr.execute(position).get();\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} catch (InterruptedException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (ExecutionException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\tLog.d(\"mylog\", \"POSTEXEC\");\n\t\t\tif (status<2){\n\t\t\t\tdsf=new Do_Service_Staff();\n\t\t\t\tdsf.execute(0);\n\t\t\t}\n\t\t}", "private void callAlipay(final String orderInfo) {\n\n Runnable payRunnable = new Runnable() {\n @Override\n public void run() {\n // 构造PayTask 对象\n PayTask alipay = new PayTask(mActivity);\n // 调用支付接口,获取支付结果\n String result = alipay.pay(orderInfo);\n\n Message msg = new Message();\n msg.what = SDK_PAY_FLAG;\n msg.obj = result;\n mHandler.sendMessage(msg);\n }\n };\n // 必须异步调用\n Thread payThread = new Thread(payRunnable);\n payThread.start();\n }", "public static JSONObject placeOrder(Map<String, String> orderDetails) {\n JSONObject responseJson = new JSONObject();\n\n System.out.println(\"building json\");\n\n try {\n JSONObject orderJson = new JSONObject();\n\n /* \n required attributes: \n 1. retailer\n 2. products\n 3. shipping_address\n 4. shipping_method\n 5. billing_address\n 6. payment_method\n 7. retailer_credentials\n \n /* other attributes we will use:\n 8. max_price \n \n */\n // 1.\n // put the retailer attribute in\n orderJson.put(\"retailer\", \"amazon\");\n\n // 2.\n // create the products array\n JSONArray products = new JSONArray();\n JSONObject product = createProductObject(orderDetails);\n // put product in array\n products.put(product);\n // put the products array in orderJson\n orderJson.put(\"products\", products);\n\n // 3. \n // create shipping address object\n JSONObject shipAddress = createShipAddressObject(orderDetails);\n orderJson.put(\"shipping_address\", shipAddress);\n\n // 4. \n // insert shipping method attribute\n orderJson.put(\"shipping_method\", \"cheapest\");\n\n // 5.\n // create billing address object\n JSONObject billAddress = createBillAddressObject(orderDetails);\n orderJson.put(\"billing_address\", billAddress);\n\n // 6. \n // create payment method object\n JSONObject paymentMethod = createPaymentMethod(orderDetails);\n orderJson.put(\"payment_method\", paymentMethod);\n\n // 7. \n // create retailer credentials object\n JSONObject retailerCredentials = createRetailerCredentialsObject();\n orderJson.put(\"retailer_credentials\", retailerCredentials);\n\n // 8.\n // put max_price in orderJson\n // NOTE: this is the last thing that will prevent an order from \n // actually going through. use 0 for testing purposes, change to \n // maxPrice to actually put the order through\n orderJson.put(\"max_price\", 0); // replace with: orderDetails.get(\"maxPrice\")\n\n //===--- finally: send the json to the api ---===//\n responseJson = sendRequest(orderJson);\n //===-----------------------------------------===//\n\n } catch (JSONException ex) {\n Logger.getLogger(ZincUtils.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n return responseJson;\n }", "public void callMarket(OrderManagementContext orderManagementContext_);", "public void startgetOrderStatus(\n\n org.pahospital.www.radiologyservice.RadiologyServiceStub.RadiologyOrderID radiologyOrderID6,\n\n final org.pahospital.www.radiologyservice.RadiologyServiceCallbackHandler callback)\n\n throws java.rmi.RemoteException{\n\n org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[2].getName());\n _operationClient.getOptions().setAction(\"http://www.PAHospital.org/RadiologyService/GetOrderStatus\");\n _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);\n\n \n \n addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,\"&\");\n \n\n\n // create SOAP envelope with that payload\n org.apache.axiom.soap.SOAPEnvelope env=null;\n final org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext();\n\n \n //Style is Doc.\n \n \n env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),\n radiologyOrderID6,\n optimizeContent(new javax.xml.namespace.QName(\"http://www.PAHospital.org/RadiologyService/\",\n \"getOrderStatus\")), new javax.xml.namespace.QName(\"http://www.PAHospital.org/RadiologyService/\",\n \"getOrderStatus\"));\n \n // adding SOAP soap_headers\n _serviceClient.addHeadersToEnvelope(env);\n // create message context with that soap envelope\n _messageContext.setEnvelope(env);\n\n // add the message context to the operation client\n _operationClient.addMessageContext(_messageContext);\n\n\n \n _operationClient.setCallback(new org.apache.axis2.client.async.AxisCallback() {\n public void onMessage(org.apache.axis2.context.MessageContext resultContext) {\n try {\n org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope();\n \n java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(),\n org.pahospital.www.radiologyservice.RadiologyServiceStub.OrderStatus.class,\n getEnvelopeNamespaces(resultEnv));\n callback.receiveResultgetOrderStatus(\n (org.pahospital.www.radiologyservice.RadiologyServiceStub.OrderStatus)object);\n \n } catch (org.apache.axis2.AxisFault e) {\n callback.receiveErrorgetOrderStatus(e);\n }\n }\n\n public void onError(java.lang.Exception error) {\n\t\t\t\t\t\t\t\tif (error instanceof org.apache.axis2.AxisFault) {\n\t\t\t\t\t\t\t\t\torg.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error;\n\t\t\t\t\t\t\t\t\torg.apache.axiom.om.OMElement faultElt = f.getDetail();\n\t\t\t\t\t\t\t\t\tif (faultElt!=null){\n\t\t\t\t\t\t\t\t\t\tif (faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),\"GetOrderStatus\"))){\n\t\t\t\t\t\t\t\t\t\t\t//make the fault by reflection\n\t\t\t\t\t\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\t\t\t\t\t\t\tjava.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),\"GetOrderStatus\"));\n\t\t\t\t\t\t\t\t\t\t\t\t\tjava.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName);\n\t\t\t\t\t\t\t\t\t\t\t\t\tjava.lang.reflect.Constructor constructor = exceptionClass.getConstructor(String.class);\n java.lang.Exception ex = (java.lang.Exception) constructor.newInstance(f.getMessage());\n\t\t\t\t\t\t\t\t\t\t\t\t\t//message class\n\t\t\t\t\t\t\t\t\t\t\t\t\tjava.lang.String messageClassName = (java.lang.String)faultMessageMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),\"GetOrderStatus\"));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tjava.lang.Class messageClass = java.lang.Class.forName(messageClassName);\n\t\t\t\t\t\t\t\t\t\t\t\t\tjava.lang.Object messageObject = fromOM(faultElt,messageClass,null);\n\t\t\t\t\t\t\t\t\t\t\t\t\tjava.lang.reflect.Method m = exceptionClass.getMethod(\"setFaultMessage\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnew java.lang.Class[]{messageClass});\n\t\t\t\t\t\t\t\t\t\t\t\t\tm.invoke(ex,new java.lang.Object[]{messageObject});\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t callback.receiveErrorgetOrderStatus(new java.rmi.RemoteException(ex.getMessage(), ex));\n } catch(java.lang.ClassCastException e){\n // we cannot intantiate the class - throw the original Axis fault\n callback.receiveErrorgetOrderStatus(f);\n } catch (java.lang.ClassNotFoundException e) {\n // we cannot intantiate the class - throw the original Axis fault\n callback.receiveErrorgetOrderStatus(f);\n } catch (java.lang.NoSuchMethodException e) {\n // we cannot intantiate the class - throw the original Axis fault\n callback.receiveErrorgetOrderStatus(f);\n } catch (java.lang.reflect.InvocationTargetException e) {\n // we cannot intantiate the class - throw the original Axis fault\n callback.receiveErrorgetOrderStatus(f);\n } catch (java.lang.IllegalAccessException e) {\n // we cannot intantiate the class - throw the original Axis fault\n callback.receiveErrorgetOrderStatus(f);\n } catch (java.lang.InstantiationException e) {\n // we cannot intantiate the class - throw the original Axis fault\n callback.receiveErrorgetOrderStatus(f);\n } catch (org.apache.axis2.AxisFault e) {\n // we cannot intantiate the class - throw the original Axis fault\n callback.receiveErrorgetOrderStatus(f);\n }\n\t\t\t\t\t\t\t\t\t } else {\n\t\t\t\t\t\t\t\t\t\t callback.receiveErrorgetOrderStatus(f);\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t callback.receiveErrorgetOrderStatus(f);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t callback.receiveErrorgetOrderStatus(error);\n\t\t\t\t\t\t\t\t}\n }\n\n public void onFault(org.apache.axis2.context.MessageContext faultContext) {\n org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext);\n onError(fault);\n }\n\n public void onComplete() {\n try {\n _messageContext.getTransportOut().getSender().cleanup(_messageContext);\n } catch (org.apache.axis2.AxisFault axisFault) {\n callback.receiveErrorgetOrderStatus(axisFault);\n }\n }\n });\n \n\n org.apache.axis2.util.CallbackReceiver _callbackReceiver = null;\n if ( _operations[2].getMessageReceiver()==null && _operationClient.getOptions().isUseSeparateListener()) {\n _callbackReceiver = new org.apache.axis2.util.CallbackReceiver();\n _operations[2].setMessageReceiver(\n _callbackReceiver);\n }\n\n //execute the operation client\n _operationClient.execute(false);\n\n }", "@PostMapping(value = \"farmers\")\n @ApiOperation(value = \"Place/create a delivery order\", response = ApiResponse.class)\n public ResponseEntity<ApiResponse> placeOrder(\n @Valid @RequestBody AcceptOrderRequest acceptOrderRequest) {\n var activeOrders =\n doPlaceOrder(acceptOrderRequest)\n .stream()\n .map(ApiMapper::toDeliveryResponse)\n .collect(Collectors.toUnmodifiableList());\n return ApiMapper.buildResponseEntity(activeOrders, HttpStatus.CREATED);\n }", "@Override\r\n public void onSuccess(OrderProxy response)\r\n {\n }", "@Override\r\n public void onSuccess(OrderProxy response)\r\n {\n }", "public interface IOrderService {\n ServerResponse pay(Long orderNo, Long userId, String path);\n\n ServerResponse aliCallback(Map<String, String> params);\n\n ServerResponse queryOrderPayStatus(Long userId, Long orderNo);\n\n ServerResponse createOrder(Long userId, Integer shippingId);\n\n ServerResponse<String> cancel(Long userId, Long orderNo);\n\n ServerResponse getOrderCartProduct(Long userId);\n\n ServerResponse<OrderVo> getOrderDetail(Long userId, Long orderNo);\n\n ServerResponse<PageInfo> getOrderList(Long userId, int pageNum, int pageSize);\n\n //backend\n ServerResponse<PageInfo> manageList(int pageNum, int pageSize);\n\n ServerResponse<OrderVo> manageDetail(Long orderNo);\n\n ServerResponse<PageInfo> manageSearch(Long orderNo, int pageNum, int pageSize);\n\n ServerResponse<String> manageSendGoods(Long orderNo);\n\n}", "@RequestMapping(path=\"/initPaymentGet\", method = RequestMethod.GET)//, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)\n\tpublic ResponseEntity<Object> test() {\n\t\tlogger.info(\"Init payment\");\n\t\t//System.out.println(\"DTO: \" + btcDTO.getPrice_currency());\n\t\tString pom = \"\";\n\t\tRestTemplate restTemplate = new RestTemplate();\n\t\t\n\t\tHttpHeaders headers = new HttpHeaders();\n\t\theaders.add(\"Authorization\", \"ab7fzPdN49-xBVoY_LdSifCZiVrqCbdcfjWdweJS\");\n\t\tResponseEntity<String> responseEntity = new RestTemplate().exchange(CREATE_ORDER_API, HttpMethod.GET,\n\t\t\t\tnew HttpEntity<String>(pom, headers), String.class);\n\n\t\t//restTemplate.getForEntity(\"https://google.rs\", String.class);\n\t\t//ResponseEntity<String> response = restTemplate.getForEntity(\"https://api-sandbox.coingate.com/v2/orders\", String.class);\n\t\t//ResponseEntity<String> response = restTemplate.postForEntity(\"https://api.coingate.com/v2/orders\", btcDTO, String.class);\n\t\t\n\t\treturn new ResponseEntity<Object>(responseEntity,HttpStatus.OK);\n\t}", "@Override\n\t\tprotected String doInBackground(Void... params) {\n\t\t\tString orderResult = null;\n\t\t\ttry {\n\t\t\t\tdes_token =\n\t\t\t\t\t\t\t(String) DesCodeUtils.encode(\"11119688\",\n\t\t\t\t\t\t\t\t\t\t\"SubmitOrder|2471CB5496F2A8C8\");\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tSystem.out.println(\"des_token ---> \" + des_token);\n\t\t\t\n\t\t\tOrderId = getOrderId();\n\t\t\tSystem.out.println(\"2.OrderId ---> \" + OrderId);\n\t\t\tif(OrderId !=null){\n\t\t\t\tOrderInfo = getOrderInfo();\n\t\t\t\tSystem.out.println(\"OrderInfo ---> \" + OrderInfo);\n\t\t\t\tString sign = Rsa.sign(OrderInfo, Keys.PRIVATE);\n\t\t\t\tSystem.out.println(\"sign before encode ---> \" + sign);\n\t\t\t\tsign = URLEncoder.encode(sign);\n\t\t\t\tOrderInfo +=\"&sign=\\\"\" + sign + \"\\\"\"+ \"&sign_type=\\\"RSA\\\"\";\n\t\t\t\tSystem.out.println(\"OrderInfo****** \" + OrderInfo);\n\t\t\t\t\n\t\t\t\t\t\tAliPay aliPay = new AliPay(OrderPnrMain.this, mhandler);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t//支付宝支付后去的的返回值,orderResult\n\t\t\t\t\t\torderResult = aliPay.pay(OrderInfo);\n\t\t\t\t\t\tSystem.out.println(\"orderResult ---> \" + orderResult);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\n\t\t\t\t\n\t\t\t//\thttpPostData();\n\t\t\t} else{\n\t\t\t\tSystem.out.println(\"null OrderId\");\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\treturn orderResult;\n\t\t\t\n\t\t}", "@RequestMapping(value = \"confirmpurchase/v1/wallets/{walletId}/serviceproviders/{spId}/widgets/{widgetId}\", method = RequestMethod.GET)\n public TicketPurchaseResponse confirmPurchaseV1(@PathVariable(value = \"walletId\") String walletId,\n @PathVariable(value = \"spId\") String spId, @PathVariable(value = \"widgetId\") String widgetId) {\n LOG.info(\"########confirmPurchaseV1 started\");\n TicketPurchaseResponse ticketPurchaseResponse = null;\n String result = \"Success\";\n String productRef;\n GenerateProductIDResponse generateProductIDResponse;\n String status = \"success\";\n try {\n /* MIFAREHttpClient mifareClient = new MIFAREHttpClient(DIGITIZE_BASE_URI, GENERATE_PRODUCT_REFERENCE); */\n // MIFAREHttpClient mifareClient = new MIFAREHttpClient.Builder().serviceURL(DIGITIZE_BASE_URI)\n // .apiURL(GENERATE_PRODUCT_REFERENCE).build();\n GenerateProductIDRequest request = new GenerateProductIDRequest();\n RequestContextV1 requestContext = new RequestContextV1();\n requestContext.setServiceProviderId(spId);\n String idRequest = \"\" + System.currentTimeMillis();\n requestContext.setCorrelationId(idRequest);\n requestContext.setRequestId(idRequest);\n request.setRequestContext(requestContext);\n Products products = new Products();\n products.setProductTypeId(widgetId);\n productRef = UUID.randomUUID().toString();\n products.setSpProductReference(productRef);\n request.setProductOrders(new ArrayList<>(Arrays.asList(products)));\n \n /** calling seglan service InitPurchaseOrder API if serviceProviderId is NAME_CRTM */\n if (spId.equals(configBean.getCrtmServiceProviderId())) {\n InitPurchaseOrderRequest InitPurchaseOrderRequest = new InitPurchaseOrderRequest();\n InitPurchaseOrderRequest.setDeviceId(\"1234\");\n InitPurchaseOrderRequest.setGoogleAccountId(\"gsrini@gmail.com\");\n InitPurchaseOrderRequest.setProduct(widgetId);\n InitPurchaseOrderResponse initPurchaseOrderResponse = crtmService.processInitPurchaseOrder(InitPurchaseOrderRequest);\n if (!initPurchaseOrderResponse.getResponseCode().equals(\"00\")) {\n status = \"failed\";\n result = \"failed\";\n }\n ticketPurchaseResponse = TicketPurchaseResponse.builder().status(status).ticketId(productRef)\n .digitalTicketId(initPurchaseOrderResponse.getM2gReference()).build();\n } else {\n Header[] headers = new Header[] {\n new BasicHeader(\"content-type\", ContentType.APPLICATION_JSON.getMimeType())};\n // generateProductIDResponse = mifareClient.invokePost(request, GenerateProductIDResponse.class, headers);\n generateProductIDResponse = utils.postRequestWithAbsoluteURL1(request, configBean, configBean.getDIGITIZE_BASE_URI() + configBean.getGENERATE_PRODUCT_REFERENCE(),\n GenerateProductIDResponse.class);\n ticketPurchaseResponse = TicketPurchaseResponse.builder()\n .status(generateProductIDResponse.getResponseContext().getResponseMessage()).ticketId(productRef)\n .digitalTicketId(generateProductIDResponse.getReferences().get(0).getM2gReference()).build();\n result = JsonUtil.toJSON(generateProductIDResponse);\n }\n LOG.info(\"########confirmPurchaseV1 result:\" + result);\n } catch (Exception e) {\n LOG.info(\"#Error occurred during confirm purchase:\" + e);\n result = \"failed\";\n LOG.info(\"########confirmPurchaseV1 result:\" + result);\n ticketPurchaseResponse = TicketPurchaseResponse.builder().status(result).build();\n }\n return ticketPurchaseResponse;\n }", "public void addToOrders(HashMap<String, String> orderParams, final RetrofitCallBack<String> retrofitCallBack){\n Call<ResponseResult<String>> responseCall = appAPIInterface.addToOrders(orderParams);\n responseCall.enqueue(new Callback<ResponseResult<String>>() {\n @Override\n public void onResponse(Call<ResponseResult<String>> call, Response<ResponseResult<String>> response) {\n if(response.isSuccessful()){\n if(response.body().getSuccess()){\n retrofitCallBack.Success(response.body().getData());\n }else{\n retrofitCallBack.Failure(\"Something went wrong\");\n }\n }else {\n retrofitCallBack.Failure(\"Some error happened !!\");\n }\n }\n\n @Override\n public void onFailure(Call<ResponseResult<String>> call, Throwable t) {\n\n }\n });\n }", "private static RequestSpecification placeOrderRequest(long id, long petId, int quantity, String shipDate, String status, boolean completed) {\n RestAssured.baseURI = MicroservicesEnvConfig.BASEURL;\n RestAssured.config = RestAssured.config().logConfig(LogConfig.logConfig().defaultStream(RSLOGGER.getPrintStream()));\n\n APILogger.logInfo(LOGGER,\"Place Store Order service Request...\");\n return RestAssured.given().header(\"Content-Type\", \"application/json\").body(placeOrderPayload(id, petId, quantity, shipDate, status, completed)).log().all();\n }", "public interface OrderService {\n\n /**\n * 司机发布信息\n *\n * @param idno\n * @param driverShareInfo\n * @return\n */\n DriverShareInfo shareDriverInfo(String idno, DriverShareInfo driverShareInfo);\n\n /**\n * 乘客预定校验\n *\n * @param idno\n * @param driverOrderId\n * @param passerOrderId\n * @param genToken\n * @return\n */\n Result passerReserveCheck(String idno, Long driverOrderId, Long passerOrderId, boolean genToken);\n\n /**\n * 乘客预定\n *\n * @param radomToken\n * @param idno\n * @param driverOrderId\n * @param passerOrderId\n * @return\n */\n Result passerReserve(String radomToken, String idno, Long driverOrderId, Long passerOrderId);\n\n\n}", "public static void verifyPlaceStoreOrderResponse(Response response, long expectedId, long expectedPetId, int expectedQuantity, String expectedShipDate, String expectedStatus, boolean expectedCompleted) {\n verifySuccessStatusCodeInPlaceStoreOrderResponse(response);\n\n StoreOrderResponse storeOrderResponse = response.as(StoreOrderResponse.class);\n\n long actualId = storeOrderResponse.getId();\n APILogger.logInfo(LOGGER,\"Verifying Place Store Order service response - id, Actual: \" + actualId + \" , Expected: \" + expectedId);\n MicroservicesEnvConfig.softAssert.assertEquals(actualId, expectedId, \"Place Store Order service response - id field error\");\n\n long actualPetId = storeOrderResponse.getPetId();\n APILogger.logInfo(LOGGER,\"Verifying Place Store Order service response - pet id, Actual: \" + actualPetId + \" , Expected: \" + expectedPetId);\n MicroservicesEnvConfig.softAssert.assertEquals(actualPetId, expectedPetId, \"Place Store Order service response - pet id field error\");\n\n int actualQuantity = storeOrderResponse.getQuantity();\n APILogger.logInfo(LOGGER,\"Verifying Place Store Order service response - quantity, Actual: \" + actualQuantity + \" , Expected: \" + expectedQuantity);\n MicroservicesEnvConfig.softAssert.assertEquals(actualQuantity, expectedQuantity, \"Place Store Order service response - quantity field error\");\n\n String actualShipDate = storeOrderResponse.getShipDate().substring(0,23);\n expectedShipDate = expectedShipDate.replace(\"Z\", \"\");\n APILogger.logInfo(LOGGER,\"Verifying Place Store Order service response - ship date, Actual: \" + actualShipDate + \" , Expected: \" + expectedShipDate);\n MicroservicesEnvConfig.softAssert.assertEquals(actualShipDate, expectedShipDate, \"Place Store Order service response - ship date field error\");\n\n String actualStatus = storeOrderResponse.getStatus();\n APILogger.logInfo(LOGGER,\"Verifying Place Store Order service response - status, Actual: \" + actualStatus + \" , Expected: \" + expectedStatus);\n MicroservicesEnvConfig.softAssert.assertEquals(actualStatus, expectedStatus, \"Place Store Order service response - status field error\");\n\n boolean actualCompleted = storeOrderResponse.isComplete();\n APILogger.logInfo(LOGGER,\"Verifying Place Store Order service response - complete, Actual: \" + actualCompleted + \" , Expected: \" + expectedCompleted);\n MicroservicesEnvConfig.softAssert.assertEquals(actualCompleted, expectedCompleted, \"Place Store Order service response - complete field error\");\n }", "NewOrderResponse newOrder(NewOrder order);", "public interface GetOrderDetails {\n @FormUrlEncoded\n @POST(\"/getorderdetails\")\n Call<List<OrderCustomerDetails>> getOrderDetails(\n @Field(\"OrderId\") String OrderId\n\n );\n @FormUrlEncoded\n @POST(\"/canceluser\")\n Call<Updatepending> canceluser(\n @Field(\"OrderId\") String OrderId\n\n );\n\n\n}", "public void receiveResultpayOrder(\n com.speed.esalDemo.generation.OrderServiceImplServiceStub.PayOrderResponse0 result\n ) {\n }", "@Path(\"showorder\")\n @GET\n @Produces(MediaType.TEXT_PLAIN)\n public String getOrder(@QueryParam(\"jsonpcallback\") String jsonpcallback) {\n return jsonpcallback + \"(\" + os.getAllOrders().toJSONString() + \")\";\n }", "@POST(\"orders/new_order/\")\n Call<ApiStatus> createNewOrderByUser(@Body Order myOrder);", "void getOrders();", "public org.pahospital.www.radiologyservice.RadiologyServiceStub.OrderStatus getOrderStatus(\n\n org.pahospital.www.radiologyservice.RadiologyServiceStub.RadiologyOrderID radiologyOrderID6)\n \n\n throws java.rmi.RemoteException\n \n {\n org.apache.axis2.context.MessageContext _messageContext = null;\n try{\n org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[2].getName());\n _operationClient.getOptions().setAction(\"http://www.PAHospital.org/RadiologyService/GetOrderStatus\");\n _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);\n\n \n \n addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,\"&\");\n \n\n // create a message context\n _messageContext = new org.apache.axis2.context.MessageContext();\n\n \n\n // create SOAP envelope with that payload\n org.apache.axiom.soap.SOAPEnvelope env = null;\n \n \n env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),\n radiologyOrderID6,\n optimizeContent(new javax.xml.namespace.QName(\"http://www.PAHospital.org/RadiologyService/\",\n \"getOrderStatus\")), new javax.xml.namespace.QName(\"http://www.PAHospital.org/RadiologyService/\",\n \"getOrderStatus\"));\n \n //adding SOAP soap_headers\n _serviceClient.addHeadersToEnvelope(env);\n // set the message context with that soap envelope\n _messageContext.setEnvelope(env);\n\n // add the message contxt to the operation client\n _operationClient.addMessageContext(_messageContext);\n\n //execute the operation client\n _operationClient.execute(true);\n\n \n org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext(\n org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE);\n org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope();\n \n \n java.lang.Object object = fromOM(\n _returnEnv.getBody().getFirstElement() ,\n org.pahospital.www.radiologyservice.RadiologyServiceStub.OrderStatus.class,\n getEnvelopeNamespaces(_returnEnv));\n\n \n return (org.pahospital.www.radiologyservice.RadiologyServiceStub.OrderStatus)object;\n \n }catch(org.apache.axis2.AxisFault f){\n\n org.apache.axiom.om.OMElement faultElt = f.getDetail();\n if (faultElt!=null){\n if (faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),\"GetOrderStatus\"))){\n //make the fault by reflection\n try{\n java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),\"GetOrderStatus\"));\n java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName);\n java.lang.reflect.Constructor constructor = exceptionClass.getConstructor(String.class);\n java.lang.Exception ex = (java.lang.Exception) constructor.newInstance(f.getMessage());\n //message class\n java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),\"GetOrderStatus\"));\n java.lang.Class messageClass = java.lang.Class.forName(messageClassName);\n java.lang.Object messageObject = fromOM(faultElt,messageClass,null);\n java.lang.reflect.Method m = exceptionClass.getMethod(\"setFaultMessage\",\n new java.lang.Class[]{messageClass});\n m.invoke(ex,new java.lang.Object[]{messageObject});\n \n\n throw new java.rmi.RemoteException(ex.getMessage(), ex);\n }catch(java.lang.ClassCastException e){\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.ClassNotFoundException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }catch (java.lang.NoSuchMethodException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.reflect.InvocationTargetException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.IllegalAccessException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.InstantiationException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }\n }else{\n throw f;\n }\n }else{\n throw f;\n }\n } finally {\n if (_messageContext.getTransportOut() != null) {\n _messageContext.getTransportOut().getSender().cleanup(_messageContext);\n }\n }\n }", "@GetMapping(\"/order\")\r\n\tprivate ResponseEntity<Object> getAllOrder() \r\n\t{\tOrderDetailsResponse response = new OrderDetailsResponse();\r\n\t\tList<OrderDetailsRequest> ordersDetails = new ArrayList<OrderDetailsRequest>();\r\n\t\tList<OrderDetails> orders = orderService.getAllOrder();\r\n\t\t\r\n\t\tfor(OrderDetails order : orders) {\r\n\t\t\t\r\n\t\t\tOrderDetailsRequest details = new OrderDetailsRequest();\r\n\t\t\tconstructResponseData(order,details);\r\n\t\t\tList<OrderItemDetails> items = restClientService.findByOrderid(order.getId());\r\n\t\t\tdetails.setProductDetails(items);\r\n\t\t\tordersDetails.add(details);\r\n\t\t}\r\n\t\tresponse.setOrders(ordersDetails);\r\n\t\tresponse.setMessage(\"SUCCESS\");\r\n\t\tresponse.setStatus((long) 200);\r\n\t\treturn new ResponseEntity<Object>(response, HttpStatus.OK);\r\n\t}", "public String getOrderDetails(String symbol,String currency) \r\n\t{\r\n\t\t//timestamp is mandatory one \t\t\r\n\t\tWebTarget target = getTarget().path(RESOURCE_OPENORDER);\r\n\t\t Map<String, String> postData = new TreeMap<String, String>();\r\n\t\t//symbol is not mandatory one\r\n\t\tif(symbol!= null && !symbol.equalsIgnoreCase(\"\") && currency!=null && !currency.equalsIgnoreCase(\"\")) \r\n\t\t{\r\n\t\t\t postData.put(CURRENCY_PAIR, getSymbolForExchange(symbol,currency));\r\n\t\t}\t\r\n\t\t\r\n String queryString = buildQueryString(postData);\r\n TradeLogger.LOGGER.finest(\"QueryString to generate the signature \" + queryString);\t\r\n \r\n\t\tString signature = generateSignature(queryString);\r\n\t\tTradeLogger.LOGGER.finest(\"Signature Genereated \" + signature);\r\n\t\tString returnValue= null;\r\n\t\tif(signature!= null )\r\n\t\t{\t\r\n\t\t\ttarget = addParametersToRequest(postData, target);\r\n\t\t\tTradeLogger.LOGGER.finest(\"Final Request URL : \"+ target.getUri().toString());\r\n\t\t\tResponse response = target.request(MediaType.APPLICATION_JSON).header(APIKEY_HEADER_KEY,API_KEY).header(\"Sign\", signature).get();\r\n\t\t\t\t\r\n\t\t\tif(response.getStatus() == 200) \r\n\t\t\t{\r\n\t\t\t\treturnValue = response.readEntity(String.class);\r\n\t\t\t\tTradeLogger.LOGGER.info(returnValue);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tTradeLogger.LOGGER.severe(\"Response Code \" + response.getStatus());\r\n\t\t\t\tTradeLogger.LOGGER.severe(\"Response Data \" + response.readEntity(String.class));\r\n\t\t\t}\r\n\t\t\tresponse.close();\r\n\t\t}\r\n\t\treturn returnValue;\r\n\r\n\t}", "void getData(){\n getListPlaceBody getListPlaceBody = new getListPlaceBody(0,0,\"\");\n Retrofit retrofit = new Retrofit\n .Builder()\n .addConverterFactory(GsonConverterFactory.create())\n .baseUrl(\"http://150.95.115.192/api/\")\n .build();\n retrofit.create(WonderVNAPIService.class)\n .getListPlace(getListPlaceBody)\n .enqueue(new Callback<ResponseBody>() {\n @Override\n public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {\n try {\n Log.e(\"onResponse\", \"Response\");\n String strJson = response.body().string();\n tvContent.setText(strJson);\n Gson gson = new Gson();\n placeData =gson.fromJson(strJson, PlaceData.class);\n }catch (IOException e){\n e.printStackTrace();\n }\n\n }\n\n @Override\n public void onFailure(Call<ResponseBody> call, Throwable t) {\n Log.e(\"onFailure\", \"Failure\");\n }\n });\n\n }", "public void startorderRadiologyExamination(\n\n org.pahospital.www.radiologyservice.RadiologyServiceStub.RadiologyOrder radiologyOrder4,\n\n final org.pahospital.www.radiologyservice.RadiologyServiceCallbackHandler callback)\n\n throws java.rmi.RemoteException{\n\n org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[1].getName());\n _operationClient.getOptions().setAction(\"http://www.PAHospital.org/RadiologyService/OrderRadiologyExamination\");\n _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);\n\n \n \n addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,\"&\");\n \n\n\n // create SOAP envelope with that payload\n org.apache.axiom.soap.SOAPEnvelope env=null;\n final org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext();\n\n \n //Style is Doc.\n \n \n env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),\n radiologyOrder4,\n optimizeContent(new javax.xml.namespace.QName(\"http://www.PAHospital.org/RadiologyService/\",\n \"orderRadiologyExamination\")), new javax.xml.namespace.QName(\"http://www.PAHospital.org/RadiologyService/\",\n \"orderRadiologyExamination\"));\n \n // adding SOAP soap_headers\n _serviceClient.addHeadersToEnvelope(env);\n // create message context with that soap envelope\n _messageContext.setEnvelope(env);\n\n // add the message context to the operation client\n _operationClient.addMessageContext(_messageContext);\n\n\n \n _operationClient.setCallback(new org.apache.axis2.client.async.AxisCallback() {\n public void onMessage(org.apache.axis2.context.MessageContext resultContext) {\n try {\n org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope();\n \n java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(),\n org.pahospital.www.radiologyservice.RadiologyServiceStub.RadiologyOrderID.class,\n getEnvelopeNamespaces(resultEnv));\n callback.receiveResultorderRadiologyExamination(\n (org.pahospital.www.radiologyservice.RadiologyServiceStub.RadiologyOrderID)object);\n \n } catch (org.apache.axis2.AxisFault e) {\n callback.receiveErrororderRadiologyExamination(e);\n }\n }\n\n public void onError(java.lang.Exception error) {\n\t\t\t\t\t\t\t\tif (error instanceof org.apache.axis2.AxisFault) {\n\t\t\t\t\t\t\t\t\torg.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error;\n\t\t\t\t\t\t\t\t\torg.apache.axiom.om.OMElement faultElt = f.getDetail();\n\t\t\t\t\t\t\t\t\tif (faultElt!=null){\n\t\t\t\t\t\t\t\t\t\tif (faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),\"OrderRadiologyExamination\"))){\n\t\t\t\t\t\t\t\t\t\t\t//make the fault by reflection\n\t\t\t\t\t\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\t\t\t\t\t\t\tjava.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),\"OrderRadiologyExamination\"));\n\t\t\t\t\t\t\t\t\t\t\t\t\tjava.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName);\n\t\t\t\t\t\t\t\t\t\t\t\t\tjava.lang.reflect.Constructor constructor = exceptionClass.getConstructor(String.class);\n java.lang.Exception ex = (java.lang.Exception) constructor.newInstance(f.getMessage());\n\t\t\t\t\t\t\t\t\t\t\t\t\t//message class\n\t\t\t\t\t\t\t\t\t\t\t\t\tjava.lang.String messageClassName = (java.lang.String)faultMessageMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),\"OrderRadiologyExamination\"));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tjava.lang.Class messageClass = java.lang.Class.forName(messageClassName);\n\t\t\t\t\t\t\t\t\t\t\t\t\tjava.lang.Object messageObject = fromOM(faultElt,messageClass,null);\n\t\t\t\t\t\t\t\t\t\t\t\t\tjava.lang.reflect.Method m = exceptionClass.getMethod(\"setFaultMessage\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnew java.lang.Class[]{messageClass});\n\t\t\t\t\t\t\t\t\t\t\t\t\tm.invoke(ex,new java.lang.Object[]{messageObject});\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t callback.receiveErrororderRadiologyExamination(new java.rmi.RemoteException(ex.getMessage(), ex));\n } catch(java.lang.ClassCastException e){\n // we cannot intantiate the class - throw the original Axis fault\n callback.receiveErrororderRadiologyExamination(f);\n } catch (java.lang.ClassNotFoundException e) {\n // we cannot intantiate the class - throw the original Axis fault\n callback.receiveErrororderRadiologyExamination(f);\n } catch (java.lang.NoSuchMethodException e) {\n // we cannot intantiate the class - throw the original Axis fault\n callback.receiveErrororderRadiologyExamination(f);\n } catch (java.lang.reflect.InvocationTargetException e) {\n // we cannot intantiate the class - throw the original Axis fault\n callback.receiveErrororderRadiologyExamination(f);\n } catch (java.lang.IllegalAccessException e) {\n // we cannot intantiate the class - throw the original Axis fault\n callback.receiveErrororderRadiologyExamination(f);\n } catch (java.lang.InstantiationException e) {\n // we cannot intantiate the class - throw the original Axis fault\n callback.receiveErrororderRadiologyExamination(f);\n } catch (org.apache.axis2.AxisFault e) {\n // we cannot intantiate the class - throw the original Axis fault\n callback.receiveErrororderRadiologyExamination(f);\n }\n\t\t\t\t\t\t\t\t\t } else {\n\t\t\t\t\t\t\t\t\t\t callback.receiveErrororderRadiologyExamination(f);\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t callback.receiveErrororderRadiologyExamination(f);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t callback.receiveErrororderRadiologyExamination(error);\n\t\t\t\t\t\t\t\t}\n }\n\n public void onFault(org.apache.axis2.context.MessageContext faultContext) {\n org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext);\n onError(fault);\n }\n\n public void onComplete() {\n try {\n _messageContext.getTransportOut().getSender().cleanup(_messageContext);\n } catch (org.apache.axis2.AxisFault axisFault) {\n callback.receiveErrororderRadiologyExamination(axisFault);\n }\n }\n });\n \n\n org.apache.axis2.util.CallbackReceiver _callbackReceiver = null;\n if ( _operations[1].getMessageReceiver()==null && _operationClient.getOptions().isUseSeparateListener()) {\n _callbackReceiver = new org.apache.axis2.util.CallbackReceiver();\n _operations[1].setMessageReceiver(\n _callbackReceiver);\n }\n\n //execute the operation client\n _operationClient.execute(false);\n\n }", "public interface ApiService {\n @POST(\"/AutoComplete/autocomplete/json\")\n void placeAuto(@Query(\"input\") String input, @Query(\"key\") String key, Callback<AutoComplete> callback);\n\n @POST(\"/geocode/json\")\n void getLatLng(@Query(\"address\") String address, @Query(\"key\") String key, Callback<GeocodingMain> callback);\n\n @POST(\"/directions/json\")\n void getroute(@Query(\"origin\") String origin, @Query(\"destination\") String destination, @Query(\"key\") String key, Callback<Directions> callback);\n\n @POST(\"/geocode/json\")\n void reverseGeoCoding(@Query(\"latlng\") String latLng, @Query(\"key\") String key, Callback<RevGeocodingMain> callback);\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n}", "@Test\n\tpublic void getOrderTest() {\n\t\tOrderDTO order = service.getOrder(2);\n\n\t\tassertEquals(3, order.getClientId());\n\t\tassertEquals(\"BT Group\", order.getInstrument().getName());\n\t\tassertEquals(\"BT\", order.getInstrument().getTicker());\n\t\tassertEquals(30.0, order.getPrice(), 1);\n\t\tassertEquals(500, order.getQuantity());\n\t\tassertEquals(OrderType.SELL, order.getType());\n\t}", "@Bean(name=\"confirmOrderService\")\r\n\tpublic RequestHandlerChain<PlaceOrderParamDto, PlaceOrderDto> confirmOrderService() {\r\n\t\tRequestHandlerChain<PlaceOrderParamDto, PlaceOrderDto> chain = new RequestHandlerChain<PlaceOrderParamDto, PlaceOrderDto>();\r\n\t\t// 第一步 :校验店铺\r\n\t\tchain.addHandlerChain(checkStoreService);\r\n\t\t// 第二步校验活动\r\n\t\tchain.addHandlerChain(checkStoreActivityService);\r\n\t\t// 第三步:校验商品\r\n\t\tchain.addHandlerChain(checkSkuService);\r\n\t\t// 第四步:校验商品库存\r\n\t\tchain.addHandlerChain(checkStockService);\r\n\t\t// 第五步:查询最优用户地址\r\n\t\tchain.addHandlerChain(findUserAddrService);\r\n\t\t// 第六步:查询零花钱信息\r\n\t\tchain.addHandlerChain(findPinMoneyService);\r\n\t\t// 第七步:查询用户有效的优惠信息\r\n\t\tchain.addHandlerChain(findFavourService);\r\n\t\treturn chain;\r\n\t}", "List<Order> getOpenOrders(OpenOrderRequest orderRequest);", "private void sendRequestAPI(Double lat,Double lng, String places) {\n\n String origin = String.valueOf(lat) + \",\" + String.valueOf(lng);\n Geocoder geocoder = new Geocoder(getActivity(), Locale.getDefault());\n String destination = \"0,0\";\n String wayPoints = \"0,0\";\n\n switch (places) {\n case \"Family Walk\" :\n destination = formatCoordinates(6);\n wayPoints = formatCoordinates(4) + \"|\" + formatCoordinates(5);\n break;\n\n case \"Retro Tour\" :\n destination = formatCoordinates(9);\n wayPoints =formatCoordinates(7) + \"|\" + formatCoordinates(8);\n break;\n\n case \"Sports Tour\" :\n destination = formatCoordinates(11);\n wayPoints = formatCoordinates(9) + \"|\" + formatCoordinates(8);\n break;\n case \"custom\":\n destination = getActivity().getIntent().getStringExtra(\"destination\");\n wayPoints = getActivity().getIntent().getStringExtra(\"waypoints\");\n break;\n\n }\n //String destination = \"-27.494721,153.014262\";\n //String wayPoints = \"-27.498172, 153.013585\";\n try {\n\n new Directions(this, origin, destination, wayPoints).execute();\n Double latDes= Double.parseDouble(destination.split(\",\")[0]);\n Double lngDes= Double.parseDouble(destination.split(\",\")[1]);\n String [] points = wayPoints.split(Pattern.quote(\"|\")) ;\n\n if(wayPoints.equals(\"\")){\n\n }\n else{\n for(String point : points) {\n Double latPoint = Double.parseDouble((point.split(\",\")[0]));\n Double lngPoint = Double.parseDouble((point.split(\",\")[1]));\n List<Address> addressesPoint = geocoder.getFromLocation(latPoint, lngPoint, 1);\n wayPointsMarkers.add(mMap.addMarker(new MarkerOptions().title(addressesPoint.get(0).getAddressLine(0))\n .position(new LatLng(latPoint, lngPoint))));\n }\n }\n\n\n List<Address> addressesStart = geocoder.getFromLocation(lat, lng, 1);\n List<Address> addressesEnd = geocoder.getFromLocation(latDes,\n lngDes, 1);\n //originMarkers.add(mMap.addMarker(new MarkerOptions().title(addressesStart.get(0).getAddressLine(0))\n //.position(new LatLng(lat, lng))));\n destinationMarkers.add(mMap.addMarker((new MarkerOptions().title(addressesEnd.get(0).getAddressLine(0))\n .position(new LatLng(latDes, lngDes)))));\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(latDes,\n lngDes), 16));\n\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public static void main(String[] args) {\n\t\tRestAssured.baseURI = \"https://rahulshettyacademy.com\";\n\t\tString response = given().log().all().queryParam(\"key\", \"qaclick123\").header(\"Content-Type\", \"application/json\")\n\t\t\t\t.body(payLoad.AddPlace()).when().post(\"maps/api/place/add/json\").then().assertThat().statusCode(200)\n\t\t\t\t.body(\"scope\", equalTo(\"APP\")).header(\"Server\", \"Apache/2.4.18 (Ubuntu)\").extract().response()\n\t\t\t\t.asString();\n\t\t// System.out.println(response);\n\t\tString placeID = ReusableMethods.rawToJson(response, \"place_id\");\n\t\tSystem.out.println(placeID);\t\t\n\t\t\n\t\t// Update place PUT HTTP Method\n\t\tString newAddress = \"Summar Walk, USA\";\n\t\tgiven().log().all().queryParam(\"key\", \"qaclick123\").header(\"Content-Type\", \"application/json\")\n\t\t\t\t.body(\"{\\r\\n\" + \" \\\"place_id\\\": \\\"\" + placeID + \"\\\",\\r\\n\" + \" \\\"address\\\": \\\"\" + newAddress\n\t\t\t\t\t\t+ \"\\\",\\r\\n\" + \" \\\"key\\\": \\\"qaclick123\\\"\\r\\n\" + \"}\")\n\t\t\t\t.when().put(\"maps/api/place/update/json\").then().assertThat().log().all().statusCode(200)\n\t\t\t\t.body(\"msg\", equalTo(\"Address successfully updated\"));\n\t\t// This is body() assertion\n\t\t\n\t\t\n\t\t// Get Place HTTP Method\n\t\tString getPlaceResponse = given().log().all().queryParam(\"key\", \"qaclick123\").queryParam(\"place_id\", placeID)\n\t\t\t\t.when().get(\"maps/api/place/get/json\").then().assertThat().log().all().statusCode(200).extract()\n\t\t\t\t.response().asString();\n\n\t\tString actualAddress = ReusableMethods.rawToJson(getPlaceResponse, \"address\");\n\t\tAssert.assertEquals(actualAddress, newAddress);\n\t\tif (actualAddress.equalsIgnoreCase(newAddress)) {\n\t\t\tSystem.out.println(\"Success...........\");\n\t\t}\n\t}", "public JSONObject fetchOrder(long orderId) throws Exception;", "public org.pahospital.www.radiologyservice.RadiologyServiceStub.RadiologyOrderID orderRadiologyExamination(\n\n org.pahospital.www.radiologyservice.RadiologyServiceStub.RadiologyOrder radiologyOrder4)\n \n\n throws java.rmi.RemoteException\n \n {\n org.apache.axis2.context.MessageContext _messageContext = null;\n try{\n org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[1].getName());\n _operationClient.getOptions().setAction(\"http://www.PAHospital.org/RadiologyService/OrderRadiologyExamination\");\n _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);\n\n \n \n addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,\"&\");\n \n\n // create a message context\n _messageContext = new org.apache.axis2.context.MessageContext();\n\n \n\n // create SOAP envelope with that payload\n org.apache.axiom.soap.SOAPEnvelope env = null;\n \n \n env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),\n radiologyOrder4,\n optimizeContent(new javax.xml.namespace.QName(\"http://www.PAHospital.org/RadiologyService/\",\n \"orderRadiologyExamination\")), new javax.xml.namespace.QName(\"http://www.PAHospital.org/RadiologyService/\",\n \"orderRadiologyExamination\"));\n \n //adding SOAP soap_headers\n _serviceClient.addHeadersToEnvelope(env);\n // set the message context with that soap envelope\n _messageContext.setEnvelope(env);\n\n // add the message contxt to the operation client\n _operationClient.addMessageContext(_messageContext);\n\n //execute the operation client\n _operationClient.execute(true);\n\n \n org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext(\n org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE);\n org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope();\n \n \n java.lang.Object object = fromOM(\n _returnEnv.getBody().getFirstElement() ,\n org.pahospital.www.radiologyservice.RadiologyServiceStub.RadiologyOrderID.class,\n getEnvelopeNamespaces(_returnEnv));\n\n \n return (org.pahospital.www.radiologyservice.RadiologyServiceStub.RadiologyOrderID)object;\n \n }catch(org.apache.axis2.AxisFault f){\n\n org.apache.axiom.om.OMElement faultElt = f.getDetail();\n if (faultElt!=null){\n if (faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),\"OrderRadiologyExamination\"))){\n //make the fault by reflection\n try{\n java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),\"OrderRadiologyExamination\"));\n java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName);\n java.lang.reflect.Constructor constructor = exceptionClass.getConstructor(String.class);\n java.lang.Exception ex = (java.lang.Exception) constructor.newInstance(f.getMessage());\n //message class\n java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),\"OrderRadiologyExamination\"));\n java.lang.Class messageClass = java.lang.Class.forName(messageClassName);\n java.lang.Object messageObject = fromOM(faultElt,messageClass,null);\n java.lang.reflect.Method m = exceptionClass.getMethod(\"setFaultMessage\",\n new java.lang.Class[]{messageClass});\n m.invoke(ex,new java.lang.Object[]{messageObject});\n \n\n throw new java.rmi.RemoteException(ex.getMessage(), ex);\n }catch(java.lang.ClassCastException e){\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.ClassNotFoundException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }catch (java.lang.NoSuchMethodException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.reflect.InvocationTargetException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.IllegalAccessException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.InstantiationException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }\n }else{\n throw f;\n }\n }else{\n throw f;\n }\n } finally {\n if (_messageContext.getTransportOut() != null) {\n _messageContext.getTransportOut().getSender().cleanup(_messageContext);\n }\n }\n }", "public int createInvoice(final Order order) {\n final int[] httpResponse = {0};\n\n ExecutorService executorService = Executors.newFixedThreadPool(10);\n executorService.execute(new Runnable() {\n public void run() {\n\n StringBuilder orderMongo = new StringBuilder(\"http://10.0.2.2:8082/createInvoice?lastName=\" + order.getLastName() + \"&firstName=\"\n + order.getFirstName() + \"&products=\");\n for (Product product : order.getProducts()) {\n orderMongo.append(removeSpaces(product.getProductName())).append(\",\").append(product.getQuantity()).append(\",\").append(product.getProductPriceString()).append(\",\");\n }\n System.out.print(orderMongo);\n\n URL url = null;\n try {\n url = new URL(orderMongo.toString());\n } catch (MalformedURLException e) {\n e.printStackTrace();\n }\n HttpURLConnection urlConnection = null;\n try {\n assert url != null;\n urlConnection = (HttpURLConnection) url.openConnection();\n } catch (IOException e) {\n e.printStackTrace();\n }\n int responseCode = 0;\n\n try {\n assert urlConnection != null;\n responseCode = urlConnection.getResponseCode();\n httpResponse[0] = responseCode;\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n InputStream inputStream = null;\n if (responseCode != HttpURLConnection.HTTP_OK) {\n inputStream = urlConnection.getErrorStream();\n } else {\n try {\n inputStream = urlConnection.getInputStream();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n urlConnection.disconnect();\n\n\n }\n });\n\n executorService.shutdown();\n return httpResponse[0];\n }", "public interface GooglePlacesApi {\n\n @GET(\"maps/api/place/autocomplete/json?type=(cities)&language=es\")\n Call<PredictionResult> autoComplete(@Query(\"input\") String text);\n\n @GET(\"maps/api/place/details/json\")\n Call<DetailsResult> getPlaceDetails(@Query(\"place_id\") String text);\n\n\n}", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n initiateOrder(request, response);\n }", "@RequestMapping(path=\"/createOrder\", method = RequestMethod.POST, produces = \"application/json\", consumes = \"application/json\")\n\tpublic ResponseEntity<PaymentResponseDTO> createOrder(@RequestBody PaymentRequestDTO btcDTO) { \n\t\tlogger.info(\"Init payment\");\n\t\t\n\t\tSellerBitcoinInfo sbi = bitcoinRepo.findByidMagazine(btcDTO.getSellerId());\n\t\t\n\t\tSystem.out.println(\"ADDRESS \" + sbi.getBitcoinAddress());\n\t\t\n\t\tString token = sbi.getBitcoinAddress();\n\t\t\n\t\tString authToken = \"Bearer \" + token;\n\t\t//trebali bismo da kreiramo transakciju koja ce biti u stanju \"pending\" sve dok korisnik ne plati ili mu ne istekne odredjeno vreme\n\t\t\n\t\t//txRepo.save(tx);\n\t\t//RestTemplate restTemplate = new RestTemplate();\n\t\t\n\t\t//restTemplate.getForEntity(\"https://google.rs\", String.class);\n\t\t//restTemplate.getForEntity(\"https://api.coingate.com/v2/ping\", String.class);\n\t\t\n\t\tHttpHeaders headers = new HttpHeaders();\n\t\theaders.add(\"Authorization\", authToken);\t \n\t\t\n\t\tSystem.out.println(\"Amount: \" + btcDTO.getAmount());\n\t\t\n\t\tCreateOrderRequestDTO order = new CreateOrderRequestDTO(\"1111\", btcDTO.getAmount(), \"BTC\", \"DO_NOT_CONVERT\", \"Title\", \"Description\", \"https://localhost:4200/success\", \"https://localhost:4200/failed\", \"https://localhost:4200/success\", \"token\");\n\t\t\n\t\tResponseEntity<Object> responseEntity = new RestTemplate().exchange(\"https://api-sandbox.coingate.com/v2/orders\", HttpMethod.POST,\n\t\t\t\tnew HttpEntity<Object>(order, headers), Object.class);\n\t\t\n\t\tlogger.info(responseEntity.getBody().toString());\n\t\t\n\t\tObjectMapper mapper = new ObjectMapper();\n\t\tmapper.configure(Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);\n\t\tBitCoinResponseDTO btcResponse = new BitCoinResponseDTO();\n\n\t\tbtcResponse = mapper.convertValue(responseEntity.getBody(), BitCoinResponseDTO.class);\n\t\t\n\t\tString paymentUrl = btcResponse.getPayment_url();\n\t\t\n\t\tlogger.info(paymentUrl);\n\t\t\n\t\tTx tx = createTransaction(btcResponse,sbi);\n\t\ttxRepo.save(tx);\n\t\t\n\t\tTxInfoDto txInfo = new TxInfoDto();\n\t\ttxInfo.setOrderId(btcDTO.getOrderId());\n\t\ttxInfo.setServiceWhoHandlePayment(\"https://localhost:8764/bitCoin\");\n\t\ttxInfo.setPaymentId(tx.getorder_id()); //ovde se nalazi orderId koji je i na coingate-u\n\t\t\n\t\tRestTemplate restTemplate = new RestTemplate();\n\t\tResponseEntity<TxInfoDto> r = restTemplate.postForEntity(\"https://localhost:8111/request/updateTxAfterPaymentInit\", txInfo, TxInfoDto.class);\n\t\t\n\t\t//BitCoinResponseDTO response = parser.parseList(responseEntity.getBody().toString());\n\t\t\n\t\t//BitCoinResponseDTO responseDTO = responseEntity.;\n\t\t\n\t\t//String pageToRedirec = responseDTO.getPayment_url();\n\t\t\n\t\t//restTemplate.exchange\n\t\t//ResponseEntity<String> response = restTemplate.postForEntity(\"https://api-sandbox.coingate.com/v2/orders\", btcDTO, String.class);\n\t\t\n\t\tPaymentResponseDTO responseDTO = new PaymentResponseDTO();\n\t\tresponseDTO.setPaymentUrl(paymentUrl);\n\t\tresponseDTO.setPaymentId(1l);\n\n\t\tSTATIC_ID = btcResponse.getId();\n\t\tSTATIC_TOKEN = authToken;\n\t\tIS_CREATE = true;\n\t\t\n\t\t//scheduleFixedDelayTask();\n\t\t//scheduleFixedDelayTask(btcResponse.getId(), authToken);\n\t\t\n\t\treturn new ResponseEntity<PaymentResponseDTO>(responseDTO,HttpStatus.OK);\n\t}", "@Override\n\tprotected void doPostProcessRequest(SSRequest ssRequest, SSResponse ssResponse) throws Exception \n\t{\t\n\t\tString orderNo = ssRequest.getFromData(APP_CONSTANT.BASKET_ORDER_NO);\n\t\t\n\t\tViewPendingOrderRequest viewReq = new ViewPendingOrderRequest();\n\t\tviewReq.setOrderNo(orderNo);\n\t\t\n\t\tViewPendingOrderResponse viewRes = viewReq.doOperations();\n\t\t\n\t\tssResponse.addToData(APP_CONSTANT.SYMBOLS,viewRes.getSymbolArr());\n\t\tssResponse.addToData(APP_CONSTANT.NET_PRICE,SamcoHelper.getIndianCurrencyFormat(viewRes.getNetPrice()));\n\t\tssResponse.addToData(APP_CONSTANT.ESTIMATED_TAX,SamcoHelper.getIndianCurrencyFormat(viewRes.getEstimatedTax()));\n\t\tssResponse.addToData(APP_CONSTANT.TOTAL_PRICE,SamcoHelper.getIndianCurrencyFormat(viewRes.getTotalPrice()));\n\n\t}", "@Test\n\tpublic void AddandDeletePlace() {\n\t\tRestAssured.baseURI = prop.getProperty(\"HOST\");\n\t\tResponse res = given().\n\n\t\t\t\tqueryParam(\"key\", prop.getProperty(\"KEY\")).body(payLoad.getPostData()).when()\n\t\t\t\t.post(resources.placePostData()).then().assertThat().statusCode(200).and().contentType(ContentType.JSON)\n\t\t\t\t.and().body(\"status\", equalTo(\"OK\")).extract().response();\n\t\t// Task 2 - Grab the Place ID from response\n\n\t\tString responseString = res.asString();\n\t\tSystem.out.println(responseString);\n\t\tJsonPath js = new JsonPath(responseString);\n\t\tString placeid = js.get(\"place_id\");\n\t\tSystem.out.println(placeid);\n\n\t\t// Task 3 place this place id in the Delete request\n\t\tgiven().queryParam(\"key\", \"qaclick123\").body(\"{\" + \"\\\"place_id\\\": \\\"\" + placeid + \"\\\"\" + \"}\").when()\n\t\t\t\t.post(\"/maps/api/place/delete/json\").then().assertThat().statusCode(200).and()\n\t\t\t\t.contentType(ContentType.JSON).and().body(\"status\", equalTo(\"OK\"));\n\t}", "void addPlaceAPI() {\n RestAssured.baseURI = \"https://rahulshettyacademy.com/\";\n String response = given().log().all().queryParam(\"key\",\"qaclick123\")\n .header(\"Content-Type\",\"application/json\")\n\n .body(Payloads.addPlaceJson())\n .when().post(\"maps/api/place/add/json\")\n .then().log().all().assertThat().statusCode(200).body(\"scope\",equalTo(\"APP\"))\n .header(\"server\",\"Apache/2.4.18 (Ubuntu)\").extract().response().asString();\n System.out.println(\"the response is\" + response );\n JsonPath jsonpath = new JsonPath(response); // for parsing the json body/payload\n String OriginalpalaceId = jsonpath.getString(\"place_id\");\n System.out.println(\"the place id is\" + OriginalpalaceId );\n\n // update the address using original place id\n\n String updateResponse = given().log().all().queryParam(\"key\",\"qaclick123\")\n .header(\"Content-Type\",\"application/json\")\n .body(\"{\\n\" +\n \"\\\"place_id\\\":\\\"\"+ OriginalpalaceId + \"\\\",\\n\" +\n \"\\\"address\\\":\\\"70 Summer walk, USA\\\",\\n\" +\n \"\\\"key\\\":\\\"qaclick123\\\"\\n\" +\n \"}\")\n .when().put(\"maps/api/place/update/json\")\n .then().log().all().assertThat().statusCode(200).body(\"msg\",equalTo(\"Address successfully updated\"))\n .extract().response().asString();\n jsonpath = null;\n jsonpath = new JsonPath(updateResponse);\n String msg = jsonpath.getString(\"msg\");\n System.out.println(\"the successful msg is \" + msg );\n\n // now getPlace API call to get the updated Place Id\n\n String getResponse = given().log().all().queryParam(\"key\",\"qaclick123\")\n .queryParam(\"place_id\",OriginalpalaceId)\n .when().get(\"maps/api/place/get/json\")\n .then().log().all().assertThat().statusCode(200).extract().response().asString();\n\n jsonpath = null;\n jsonpath = new JsonPath(getResponse);\n System.out.println(jsonpath.getString(\"address\"));\n System.out.println(\"the response of the get API method \"+ getResponse);\n\n Assert.assertEquals(jsonpath.getString(\"address\"),\"70 Summer walk, USA\",\"Address not matched\" );\n\n }", "@PostMapping(\"/add-order\")\n\tpublic ResponseEntity<Object> insertOrder(@RequestBody Order order) {\n\t\tLOGGER.info(\"add-Order URL is opened\");\n\t\tLOGGER.info(\"addOrder() is initiated\");\n\t\tOrderDTO orderDTO = null;\n\t\tResponseEntity<Object> orderResponse = null;\n\t\torderDTO = orderService.addOrder(order);\n\t\torderResponse = new ResponseEntity<>(orderDTO, HttpStatus.ACCEPTED);\n\t\tLOGGER.info(\"addOrder() has executed\");\n\t\treturn orderResponse;\n\t}", "public interface OrderService {\n\n /**\n * 分页\n * @param rebateVo\n * @return\n */\n PageDTO<RebateDTO> fetchPage(OrderVo rebateVo);\n\n /**\n * 获得订单详细信息\n *\n * @param orderId\n * @return\n */\n OrderDTO getOrder(long orderId);\n\n /**\n * 确认订单\n * @param orderId\n * @return\n */\n OrderDTO sureOrder(long orderId);\n\n}", "private static String placeOrderResource() {\n return \"/store/order\";\n }", "@PostMapping\r\n\tpublic ResponseEntity<Object> addOrder(@RequestBody Order Order) \r\n\t{logger.info(\"Inside addOrder method\");\r\n\t\t//System.out.println(\"Enterd in post method\");\r\n\t\tOrder orderList = orderservice.addOrder(Order);\r\n\t\tlogger.info(\"New Order\" + Order);\r\n\t\tif (orderList == null)\r\n\r\n\t\t\treturn ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(\"Inernal server error\");\r\n\t\t// response is set to inserted message id in response header section.\r\n\t\r\n\t\tURI location = ServletUriComponentsBuilder.fromCurrentRequest().path(\"/{id}\")\r\n\t\t\t\t.buildAndExpand((orderList).getBookingOrderId()).toUri();\r\n\t\treturn ResponseEntity.created(location).build();\r\n\t}", "public ServiceOrder retrieveServiceOrder( String orderid) {\r\n\t\tlogger.info(\"will retrieve Service Order from catalog orderid=\" + orderid );\r\n\t\ttry {\r\n\t\t\tObject response = template.\r\n\t\t\t\t\trequestBody( CATALOG_GET_SERVICEORDER_BY_ID, orderid);\r\n\t\t\t\r\n\t\t\tif ( !(response instanceof String)) {\r\n\t\t\t\tlogger.error(\"Service Order object is wrong.\");\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t\tlogger.debug(\"retrieveServiceOrder response is: \" + response);\r\n\t\t\tServiceOrder sor = toJsonObj( (String)response, ServiceOrder.class); \r\n\t\t\t\r\n\t\t\treturn sor;\r\n\t\t\t\r\n\t\t}catch (Exception e) {\r\n\t\t\tlogger.error(\"Cannot retrieve Service Order details from catalog. \" + e.toString());\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "@RequestMapping(value =\"/customer/place_order\", method = RequestMethod.POST)\n public String placeOrder(ModelMap model, Order order, @RequestParam(\"code\") String code) {\n logger.info(\"*** OrderController - placeOrder ***\");\n Product product = productService.getProduct(code);\n order.setProduct(product);\n order.setStatus(\"completed\");\n order.setOrderDate(new Date());\n Order completedOrder = orderService.placeOrder(order);\n if(!completedOrder.equals(null)){\n productService.updateInventory(product,order.getQuantity());\n }\n model.addAttribute(\"completedOrder\", completedOrder);\n return \"success\";\n }", "public interface WithHoldOrderContract {\r\n\r\n ResponseData resendWithholdOrder();\r\n \r\n}", "public interface OrderService {\n\n /**\n * Returns route time\n * @param routeDTO route data transfer object\n * @param orderDTO order dto for building route\n * @return\n */\n Long getRouteTime(RouteDTO routeDTO, OrderDTO orderDTO);\n\n /**\n * Returns drivers from database by specified order duration and order dto\n * @param time order duration\n * @param orderDTO order dto for building a route\n * @return linked hash map, key - drivers' id, value - drivers\n */\n LinkedHashMap<Long, Driver> getDriversForOrder(Long time, OrderDTO orderDTO);\n\n /**\n * Returns trucks from database by specified weight of cargoes\n * @param weight cargoes's weight\n * @return linked hash map, key - trucks' id, value - trucks\n */\n LinkedHashMap<Long, Truck> getTrucksForOrder(Long weight);\n\n /**\n * Specifies drop locations for picked up cargoes\n * @param routeDTO route dto with route points\n * @param points temp collection for building sub route\n */\n void setDropLocations(RouteDTO routeDTO, List<RoutePointDTO> points);\n\n /**\n * Returns weight of cargoes\n * @param routePointDTO temp route point dto with cargo or drop location\n * @param points already built route as list of ordered route points\n * @param weight previous weight data before adding new route point\n * @return weight\n */\n Long getWeight(RoutePointDTO routePointDTO, List<RoutePointDTO> points, Long weight);\n\n /**\n * Adds new route point to the route\n * @param routePointDTO new route point dto\n * @param routeDTO route data transfer object\n * @param points route as an ordered list of route points dtos\n */\n void newRoutePoint(RoutePointDTO routePointDTO, RouteDTO routeDTO, List<RoutePointDTO> points);\n\n /**\n * Returns all cities from database\n * @return linked hash map of cities, key - cities' id\n */\n LinkedHashMap<Long, City> getAllCitiesMap();\n\n /**\n * Adds order to a database\n * @param routeDTO route for building path for the order\n * @param orderDTO complex order data\n */\n void saveOrder(RouteDTO routeDTO, OrderDTO orderDTO);\n\n /**\n * Returns orders' from database as dtos\n * @return unsorted list of orders' data transfer objects\n */\n List<OrderDTO> getAllOrdersDTO();\n\n /**\n * Returns route points for order\n * @param order order entity for getting specified route points\n * @return unsorted list of route points\n */\n List<RoutePoint> getRoutePointsForOrder(Order order);\n\n /**\n * Returns cities dto adopted for RESTful architecture\n * @param id order id for retrieving data from database\n * @return unsorted list of cities as dtos adopted for RESTful architecture\n */\n List<CityDTORest> getRoutePointsForOrder(Long id);\n\n /**\n * Returns cargoes from database for the given order dto\n * @param orderDTO order dto\n * @return unsorted list of cargoes\n */\n List<Cargo> getCargoesForOrder(OrderDTO orderDTO);\n\n /**\n * Deletes order from database\n * @param id order's id for deletion\n */\n void deleteOrder(Long id);\n\n /**\n * Updates order\n * @param order order entity for updating\n */\n void updateOrder(Order order);\n\n /**\n * Return orders as dtos adopted for RESTful architecture\n * @return unsorted list of orders dtos adopted for RESTful architecture\n */\n List<OrderDTORest> getAllOrdersDTORest();\n\n /**\n * Delete temp route point dto from the route dto\n * @param routePoint temp route point dto\n * @param routeDTO route dto collected already built route\n */\n void deleteRoutePoint(String routePoint, RouteDTO routeDTO);\n\n /**\n * Processes new route point, recalculates distance and weight\n * @param orderDTO order dto\n * @param routeDTO route dto\n * @param routePointDTO new route point\n * @return temp cargoes weight\n */\n Long tempProcessPoint(OrderDTO orderDTO, RouteDTO routeDTO, RoutePointDTO routePointDTO);\n}", "public static Future<IOrder> placeOrder(OrderTicket ticket) \r\n\t{\t\t\r\n\t\tOrderTask task = INSTANCE.new OrderTask(ticket);\r\n\t\treturn JForexContext.getContext().executeTask(task);\t\r\n\t}", "void getMarketOrders();", "public interface OrderManager {\n\n\n OrderDTO getOrderDTO(Long orderId,Long sellerid,String appKey);\n\n List<OrderDTO> queryOrder(OrderQTO orderQTO, String appKey) throws ItemException;\n}", "List<Inventory> executeOrder(OrderForm orderForm) throws Exception;", "public void receiveResultorderQuery(\n com.xteam.tourismpay.PFTMXStub.OrderQueryResponse result) {\n }", "public void makePayment(\n org.pahospital.www.radiologyservice.RadiologyServiceStub.RadiologyOrderIDForPayment radiologyOrderIDForPayment8\n\n ) throws java.rmi.RemoteException\n \n \n {\n org.apache.axis2.context.MessageContext _messageContext = null;\n\n \n org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[3].getName());\n _operationClient.getOptions().setAction(\"http://www.PAHospital.org/RadiologyService/MakePayment\");\n _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);\n\n \n \n addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,\"&\");\n \n org.apache.axiom.soap.SOAPEnvelope env = null;\n _messageContext = new org.apache.axis2.context.MessageContext();\n\n \n //Style is Doc.\n \n \n env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),\n radiologyOrderIDForPayment8,\n optimizeContent(new javax.xml.namespace.QName(\"http://www.PAHospital.org/RadiologyService/\",\n \"makePayment\")),new javax.xml.namespace.QName(\"http://www.PAHospital.org/RadiologyService/\",\n \"makePayment\"));\n \n\n //adding SOAP soap_headers\n _serviceClient.addHeadersToEnvelope(env);\n // create message context with that soap envelope\n\n _messageContext.setEnvelope(env);\n\n // add the message contxt to the operation client\n _operationClient.addMessageContext(_messageContext);\n\n _operationClient.execute(true);\n\n \n if (_messageContext.getTransportOut() != null) {\n _messageContext.getTransportOut().getSender().cleanup(_messageContext);\n }\n \n return;\n }", "@ResponseBody\n @RequestMapping(method = RequestMethod.POST, value = \"/{orderId}/item}\")\n public ResultData viewItem(@PathVariable(\"orderId\") String orderId) {\n ResultData result = new ResultData();\n Map<String, Object> condition = new HashMap<>();\n condition.put(\"orderId\", orderId);\n List<Integer> status = new ArrayList<>(Arrays.asList(OrderStatus.PAYED.getCode(), OrderStatus.PATIAL_SHIPMENT.getCode(), OrderStatus.FULLY_SHIPMENT.getCode(), OrderStatus.FINISHIED.getCode()));\n condition.put(\"status\", status);\n ResultData response = orderService.fetchOrder(condition);\n if (response.getResponseCode() == ResponseCode.RESPONSE_OK) {\n Order order = ((List<Order>) response.getData()).get(0);\n\n }\n return result;\n }", "public interface ShopOrderService {\n Page<OrderBiz> queryPageOrderInfo(ShopOrderQuery query);\n\n OrderRechargeBiz queryOrderRechargeInfoByOrderId(Long orderid);\n\n void send(Long orderid,String remark) throws ManagerException;\n\n void rechargeOrder(Long orderid) throws ManagerException;\n\n void rechargeResult(Long orderid,Integer resultstatus);\n\n boolean updateSendRemarkById(Long orderid, String sendremark);\n\n boolean updateRemarkById(Long orderid, String remark);\n\n String queryRemarkById(Long orderid);\n}", "public interface OrderService {\n\n List<OrderInfoDto> getAllOrders();\n\n Long addNewOrder(OrderDto orderDto);\n\n OrderInfoDto getOrderInfoById(Long id);\n\n OrderDto getOrderById(Long id);\n\n void setTruckForOrder(Long orderId, Long truckId);\n\n void setDriverForOrder(Long orderId, Long driverId);\n\n void detachDriver(Long orderId, Long driverId);\n\n <T> T getCurrentOrderByDriverLogin(String login, Class<T> tClass);\n\n List<OrderInfoBoardDto> getOrdersInfo();\n\n List<CityDto> getRouteByOrderId(Long orderId);\n\n void addCityToRoute(Long orderId, List<Long> cityIdList);\n\n void removeCityFromRoute(Long orderId, Long cityId);\n\n void updateBoardUpdateOrder(Order order);\n\n void updateBoardUpdateOrder(String driverLogin);\n\n void closeOrder(Long orderId);\n\n boolean isAllPointsDoneByOrder(Order order);\n\n boolean isAllPointsDoneByOrderId(Long orderId);\n\n Order sortPathPointsByRoute(Order order);\n\n}", "public void receiveResultpFT_Order_Submit(\n com.xteam.tourismpay.PFTMXStub.PFT_Order_SubmitResponse result) {\n }", "public interface OrderService {\r\n\r\n /**\r\n * 创建订单\r\n * @param orderDTO\r\n * @return\r\n */\r\n OrderDTO create(OrderDTO orderDTO);\r\n\r\n /**\r\n * 完结订单(只能卖家操作)\r\n * @param orderId\r\n * @return\r\n */\r\n OrderDTO finish(String orderId);\r\n}", "@Override\n\tpublic Response call() throws Exception {\n\t\tClientResponse response = callWebService(this.spaceEntry);\n\t\tthis.transId = (int) response.getEntity(Integer.class);\n\t\tresponse.close();\n\t\t/*wait for web service to provide tuple Object result*/\n\t\tawaitResult();\n\t\t\n\t\t/*return result*/\n\t\treturn result;\n\t}", "private Transaction callPaymentServiceApi(Transaction paymentDetails) {\n HttpHeaders headers = new HttpHeaders();\n headers.setAccept(Arrays.asList(MediaType.APPLICATION_JSON));\n HttpEntity<Transaction> entity = new HttpEntity<Transaction>(paymentDetails,headers);\n\n return restTemplate.exchange(\n \"http://localhost:8083/transaction\", HttpMethod.POST, entity, Transaction.class).getBody();\n }", "public interface OrderService {\n\n Order createOrder(List<OrderItem> orderItems);\n\n List<Order> getOrdersForUser(User user);\n\n List<Order> findAll();\n\n Order findById(Long orderId);\n\n Order updateOrder(Order order);\n\n void cancelOrder(Long orderId);\n}", "@CrossOrigin(origins = \"http://localhost:8000\")\n @ApiOperation(value = \"Add a new order\", response = PizzaOrder.class, produces = \"application/json\")\n @RequestMapping(value = \"/orders\", method = RequestMethod.POST, consumes = \"application/json\")\n public PizzaOrder addPizzaOrder(\n @ApiParam(value = \"New pizza order to add\", required = true) @RequestBody PizzaOrder pizzaOrder) {\n\t\t \n\tlogger.info(\"TrackingId:89a80896-35a4-468c-9ec3-b762ab161429|ClientId:89a80897-35a4-468c-9ec3-b762ab161429|Pizza Ordered : {}\",pizzaOrder.getId());\t \n return pizzaOrderService.addOrder(pizzaOrder);\n }", "public void execute(){\n\t\tnew PayCarOrderTask().execute();\n\t}", "public interface OrderService {\n OrderDto makeOrder(OrderDto orderDto);\n\n List<OrderDto> getAllOrders(String userPhone);\n\n void removeOrderById(Long id);\n\n boolean getOrderById(Long id);\n\n List<OrderDto> getAllOrders();\n\n List<OrdersEntity> getOrders();\n\n OrderDto acceptOrder(OrderDto orderDto);\n\n List<OrderDto> getAcceptOrders(String driverPhone);\n\n OrderDto removeAcceptedOrder(Long id);\n}", "public void placeOrder() {\n String url = APIBaseURL.placeOrder + SaveSharedPreference.getLoggedInUserEmail(ConsumerCheckOutActivity.this);\n\n CustomVolleyRequest stringRequest = new CustomVolleyRequest(Request.Method.GET, url, new Response.Listener<String>() {\n @Override\n public void onResponse(String response) {\n\n isOrderPlacedAPI = true;\n try {\n JSONObject jsonObject = new JSONObject(response);\n JSONObject dataObject = jsonObject.getJSONObject(\"data\");\n orderNumber = dataObject.optString(\"orderId\");\n\n if((offlineDelivery.isChecked())&&(offlinePayment.isChecked()))\n {\n Globaluse.orderInvoiceNo_str=orderNumber;\n\n }else\n {\n Intent intent = new Intent(ConsumerCheckOutActivity.this, CashFreePaymentWebActivity.class);\n intent.putExtra(\"paymentLink\", dataObject.optString(\"paymentLink\"));\n startActivityForResult(intent, 103);\n\n }\n\n // Globaluse.orderInvoiceNo_str=orderNumber;\n\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n if (error instanceof AuthFailureError) {\n //TODO\n ViewGroup viewGroup = ConsumerCheckOutActivity.this.findViewById(android.R.id.content);\n\n //then we will inflate the custom alert dialog xml that we created\n View dialogView = LayoutInflater.from(ConsumerCheckOutActivity.this).inflate(R.layout.access_token_expired_dialog, viewGroup, false);\n\n Button buttonreset = dialogView.findViewById(R.id.buttonreset);\n Button buttonOk = dialogView.findViewById(R.id.buttonOk);\n ImageView closeBtn = dialogView.findViewById(R.id.closeBtn);\n\n //Now we need an AlertDialog.Builder object\n android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(ConsumerCheckOutActivity.this);\n\n //setting the view of the builder to our custom view that we already inflated\n builder.setView(dialogView);\n\n //finally creating the alert dialog and displaying it\n android.app.AlertDialog alertDialog = builder.create();\n\n\n buttonOk.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n alertDialog.dismiss();\n ConsumerMainActivity.logout();\n\n }\n });\n\n closeBtn.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n alertDialog.dismiss();\n\n }\n });\n\n buttonreset.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n alertDialog.dismiss();\n }\n });\n alertDialog.setCanceledOnTouchOutside(false);\n alertDialog.show();\n } else if (error instanceof NetworkError) {\n Toast.makeText(consumerCheckOutActivity, \"Cannot connect to Internet...Please check your connection!\", Toast.LENGTH_SHORT).show();\n }\n }\n }, consumerCheckOutActivity);\n ApplicationController.getInstance().addToRequestQueue(stringRequest, \"place_order_taq\");\n\n }", "ServiceResponse execute(RequestParameters request);", "@PostMapping(value = \"/insertorderdetails\")\r\n public OrderInfo insertDummyOrder(@RequestBody OrderInfo order) \r\n\t\r\n\t{\r\n\t\treturn new OrderService().addOrder(order); //calling the service\r\n }", "@Override\n\t\t\tprotected String doInBackground(Void... params) {\n\t\t\t\tString rev1 = null;\n\t\t\t\tJSONObject jsonObject = null;\n\t\t\t\ttry {\n\t\t\t\t\tjsonObject = jsonObjectDict();\n\t\t\t\t} catch (UnsupportedEncodingException e1) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\n\t\t\t\tString jsonString = \"OrderRequest=\"+jsonObject.toString();\n\t\t\t\t\n\t\t\t\tLog.e(\"jsonString****\", \"\"+jsonString);\n\t\t\t\t\n\t\t\t\tString url = \"http://mapi.tripglobal.cn/Hotel.aspx?action=SubmitHotelOrder\";\n\t\t\t\t\n\t\t\t\t\n//\t\t\t\thotelOrderInterFaces = new HotelOrderInterFaces(HotelOrderYuDingMain.this, handler);\n//\t\t\t\thotelOrderInterFaces.getModelFromPOST(url, jsonString, TripgMessage.HANGBAN);\n\t\t\t\t\n\t\t\t\ttry { \n\t\t\t\t HttpClient httpclient = new DefaultHttpClient(); \n\t\t\t\t HttpPost httppost = new HttpPost(url); \n\t\t\t\t //添加http头信息 \n\t\t\t\t \n\t\t\t\t //认证token \n\t\t\t\t httppost.addHeader(\"OrderRequest\", \"application/json\"); \n\t\t\t\t httppost.addHeader(\"Content-type\", \"application/x-www-form-urlencoded\"); \n\n\t\t\t\t httppost.setEntity(new StringEntity(jsonString)); \n\t\t\t\t HttpResponse response; \n\t\t\t\t response = httpclient.execute(httppost); \n\t\t\t\t rev1 = EntityUtils.toString(response.getEntity());\n\t\t\t\t \n\t\t\t\t //obj = new JSONObject(rev); \n\t\t\t\t //检验状态码,如果成功接收数据\n//\t\t\t\t int code = response.getStatusLine().getStatusCode();\n\t\t\t\t \n\n\t\t\t\t } catch (ClientProtocolException e) { \n\t\t\t\t \t\n\t\t\t\t } catch (IOException e) {\n\t\t\t\t \t\n\t\t\t\t } catch (Exception e) { \n\t\t\t\t \t\n\t\t\t\t } \n\t\t\t\t\n\t\t\t\treturn rev1;\n\t\t\t}", "@Override\r\n\tprotected IAPIResponse executeOrderFulfillmentService(APIRequestVO apiVO) {\r\n\t\tProcessResponse cancelResponse = new ProcessResponse();\r\n\t\tOrderFulfillmentRequest ofRequest = null;\t\t\r\n\t\tString soId = apiVO.getSOId();\r\n\t\tint buyerId = apiVO.getBuyerIdInteger();\r\n\t\tSOCancelRequest soCancelRequest = (SOCancelRequest) apiVO.getRequestFromPostPut();\r\n\t\tcancelResponse.setCode(PublicAPIConstant.ONE);\r\n\t\t//Ensure that all the mandatory fields have actual values (excluding white spaces)\r\n\t\ttrimRequestElements(soCancelRequest);\r\n\t\tcancelResponse = validateMandatoryTags(soCancelRequest);\r\n\t\tif(!PublicAPIConstant.ONE.equals(cancelResponse.getCode())){\r\n\t\t\t//Create error response when request parameter mandatory validation failed.\r\n\t\t\treturn createErrorResponse(cancelResponse);\r\n\t\t}\r\n\t\tSecurityContext securityContext; \r\n\t\tif(PublicAPIConstant.BUYER_RESOURCE_ID.equalsIgnoreCase(soCancelRequest.getIdentification().getType())){\r\n\t\t\tsecurityContext = getSecurityContextForBuyer(apiVO.getBuyerResourceId());\r\n\t\t}else{\r\n\t\t\tsecurityContext = getSecCtxtForBuyerAdmin(buyerId);\r\n\t\t}\r\n\t\tServiceOrder so;\r\n\t\ttry {\r\n\t\t\tso = serviceOrderBO.getServiceOrder(soId);\r\n\t\t\t /* Validates the cancellation request.*/\r\n\t\t\tcancelResponse = validateCancelRequest(so, securityContext, soCancelRequest);\r\n\t\t} catch (Exception be) {\r\n\t\t\tLOGGER.error(be);\r\n\t\t\tcancelResponse.setMessage(be.getMessage());\r\n\t\t\tcancelResponse.setCode(ServiceConstants.SYSTEM_ERROR_RC);\r\n\t\t\treturn createErrorResponse(cancelResponse);\r\n\t\t}\r\n\t\t\r\n\t\tsetProviderAcknowledgement(soCancelRequest);\r\n\t\t//Use appropriate Signal based on the SO State (For draft/routed/expired use\r\n\t\t//cancellation through front specific signal SL_CANCEL_ORDER)\r\n\t\tSignalType signalType = getSignalType(so.getWfStateId().intValue());\r\n\t\tif ((PublicAPIConstant.ONE).equalsIgnoreCase(cancelResponse.getCode())) {\r\n\t\t\t//If request parameters are validated then create OF Request\r\n\t\t\ttry{\r\n\t\t\t\tofRequest = createOrderFulfillmentCancelSORequest(so, securityContext, soCancelRequest);\r\n\t\t\t}catch(Exception e){\r\n\t\t\t\tLOGGER.error(e);\r\n\t\t\t\tcancelResponse.setMessage(e.getMessage());\r\n\t\t\t\tcancelResponse.setCode(ServiceConstants.SYSTEM_ERROR_RC);\r\n\t\t\t\treturn createErrorResponse(cancelResponse);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(null == ofRequest){\r\n\t\t\t\tLOGGER.error(\"Error in fetching data from DB.\");\r\n\t\t\t\tcancelResponse.setMessage(CommonUtility\r\n\t\t\t\t\t\t.getMessage(PublicAPIConstant.cancelSO.DEFAULT_SYS_ERROR_MESSAGE));\r\n\t\t\t\tcancelResponse.setCode(ServiceConstants.SYSTEM_ERROR_RC);\r\n\t\t\t\treturn createErrorResponse(cancelResponse);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t//Create error response when request parameter validation failed.\r\n\t\t\treturn createErrorResponse(cancelResponse);\r\n\t\t}\r\n\t\t//OF call\r\n\t\tOrderFulfillmentResponse ofResponse = ofHelper\r\n\t\t\t\t.runOrderFulfillmentProcess(soId, signalType, ofRequest);\r\n\t\tif (!ofResponse.isSignalAvailable()) {\r\n\t\t\t//Create So Cancellation response when Signal is invalid.\r\n\t\t\treturn createInvalidStateResponse();\r\n\t\t}\r\n\t\tif (ofResponse.isError()) {\r\n\t\t\t//Create Error response for Cancellation when error\r\n\t\t\t//Occurred while OF processing\r\n\t\t\treturn createErrorResponse(ofResponse);\r\n\t\t}\r\n\t\treturn createCancelResponse(ofHelper.getServiceOrder(soId));\r\n\t}", "public interface PlacesInterface {\n\n @GET(\"nearbysearch/json?type=restaurant\" )\n Call<Restaurants> listRestaurants(@Query(\"key\") String apikey, @Query(\"location\") String latlong, @Query(\"radius\") String radius);\n\n @GET(\"nearbysearch/json?type=restaurant&rankby=distance\" )\n Call<Restaurants> listRestaurantsByDistance(@Query(\"key\") String apikey, @Query(\"location\") String latlong);\n\n @GET(\"details/json\" )\n Call<Place> getDetails(@Query(\"key\") String apikey, @Query(\"placeid\") String placeid);\n\n}", "Order getOrderStatus(OrderStatusRequest orderStatusRequest);", "@Path(\"insertorder\")\n @GET\n @Produces(MediaType.TEXT_PLAIN)\n public String insertOrder(@QueryParam(\"jsonpcallback\") String jsonpcallback, @QueryParam(\"userid\") int userid) {\n String val = \"Error!Check constraints\";\n Orders order = new Orders();\n order.setUserid(userid);\n boolean status = os.insertOrders(order);\n if (status == true) {\n val = \"Added!!\";\n }\n return jsonpcallback + \"(\\\"\" + val + \"\\\")\";\n }", "protected void processOrder(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException \r\n {\r\n \t//Get the valid user id from the session\r\n// \tint cid = (int) request.getSession(false).getAttribute(\"customerid\");\r\n// \tString customerid = Integer.toString(cid);\r\n// \t\r\n// \t//Get the items in the cart\r\n// \tCart cartItems = (Cart) request.getSession(false).getAttribute(\"items_in_cart\");\r\n// \tdouble cart_total = cartItems.getTotalPrice();\r\n \t\r\n \tresponse.setContentType(\"application/json;charset=UTF-8\");\r\n\t\t \r\n\t\tresponse.setHeader(\"Cache-Control\", \"no-cache\");\r\n\t\t// get the PrintWriter object to write the html page\r\n\t\tPrintWriter out = response.getWriter();\r\n \t\r\n \t\r\n \tString customerid = request.getParameter(\"customerid\");\r\n \tString cart_total = request.getParameter(\"cart_total\");\r\n \tSystem.out.println(\"ID : \" + customerid + \" cartTOTAl : \" + cart_total);\r\n \t\r\n \t\r\n \tSslConfig sslconf= new SslConfig();\r\n \tClient client = sslconf.ssl(); \r\n \t\r\n\t\tString URL= \"https://localhost:8443/OnlineBookStore/rest/OrderProcess\";\r\n\t\tWebTarget target = client.target(URL).path(\"/order\").queryParam(\"customerid\", customerid).queryParam(\"cart_total\", cart_total);\r\n\t\tInvocation.Builder ib = target.request(MediaType.APPLICATION_JSON);\r\n\t\tResponse res = ib.get();\r\n\t\t\r\n\t\tPurchaseOrder PO = res.readEntity(PurchaseOrder.class); \r\n\t\t\r\n\t\tAddress addr = PO.getAddr();\r\n\t\tGson gsonBuilder = new GsonBuilder().create();\r\n\t\tString address = gsonBuilder.toJson(addr);\r\n\t\t\r\n\t\t//HttpSession session = request.getSession(false);\r\n\t\t//session.setAttribute(\"Address\", addr);\r\n\t\t//session.setAttribute(\"POID\", PO.getId());\r\n\t\t\r\n\t\t//response.sendRedirect(\"order_details.jsp\");\r\n\t\t\r\n\t\tJSONObject orderObj = new JSONObject();\r\n\t\ttry {\r\n\t\t\torderObj.put(\"Address\", address);\r\n\t\t\torderObj.put(\"Poid\", PO.getId());\r\n\t\t\t\r\n\t\t} catch (JSONException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tSystem.out.println(\" Order ::: \" + orderObj.toString());\r\n\t\tout.print(orderObj.toString());\r\n\t\t\r\n }", "public static Result getOrder(String orderId){\n \n MysqlDBOperations mysql = new MysqlDBOperations();\n ResourceProperty rs = new ResourceProperty(\"com.generic.resources.mysqlQuery\");\n Connection conn = mysql.getConnection(); \n Orders order;\n List<MarketProduct> productList;\n\n try{\n\n // -1- Prepare Statement\n PreparedStatement preStat = conn.prepareStatement(rs.getPropertyValue(\"mysql.order.select.4\"));\n preStat.setString(1, orderId);\n \n ResultSet resultSet = preStat.executeQuery();\n \n // -2- Get Result\n if(resultSet.first()){\n \n // -2.1- Get Order Object\n order = ORMHandler.resultSetToOrder(resultSet);\n \n // -2.2- Get User & UserAddress Object\n User user = ORMHandler.resultSetToUser(resultSet);\n UserAddress userAddress = ORMHandler.resultSetToUserAddress(resultSet);\n userAddress.setAddress(ORMHandler.resultSetToAddress(resultSet));\n \n // -2.3- Get MarketProduct list \n productList = new ArrayList<>();\n do{\n MarketProduct product = ORMHandler.resultSetToProduct(resultSet);\n productList.add(product);\n }while(resultSet.next());\n \n // -2.4- Set \n order.setUserAddress(userAddress);\n order.setUser(user);\n order.setProductList(productList);\n \n return Result.SUCCESS.setContent(order);\n }else{\n return Result.SUCCESS_EMPTY;\n } \n\n } catch (SQLException ex) { \n return Result.FAILURE_DB.setContent(ex.getMessage());\n }finally{\n mysql.closeAllConnection();\n } \n }", "CancelOrderResponse cancelOrder(CancelOrderRequest cancelOrderRequest);", "public void submitOrder(BeverageOrder order);", "private void test2() {\n Retrofit retrofit = new Retrofit.Builder()\n .baseUrl(baseUrl)\n .addConverterFactory(GsonConverterFactory.create())\n .build();\n IQuote iQuote = retrofit.create(IQuote.class);\n //set request params\n Call<List<QuoteBean>> call = iQuote.getQuote(\"rand\", \"1\");\n call.enqueue(new Callback<List<QuoteBean>>() {\n @Override\n public void onResponse(Call<List<QuoteBean>> call, Response<List<QuoteBean>> response) {\n List<QuoteBean> quotes = response.body();\n Log.d(TAG + \"onresponse\", quotes.get(0).toString());\n }\n\n @Override\n public void onFailure(Call<List<QuoteBean>> call, Throwable t) {\n Log.d(TAG + \"onFailure\", \"\");\n }\n });\n }", "public void startdirectOrderStateQuery(\n\n net.wit.webservice.TerminalServiceXmlServiceStub.DirectOrderStateQuery directOrderStateQuery0,\n\n final net.wit.webservice.TerminalServiceXmlServiceCallbackHandler callback)\n\n throws java.rmi.RemoteException{\n\n org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[0].getName());\n _operationClient.getOptions().setAction(\"http://www.epaylinks.cn/webservice/services/TerminalServiceXml/TerminalServiceXml/directOrderStateQueryRequest\");\n _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);\n\n \n \n addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,\"&\");\n \n\n\n // create SOAP envelope with that payload\n org.apache.axiom.soap.SOAPEnvelope env=null;\n final org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext();\n\n \n //Style is Doc.\n \n \n env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),\n directOrderStateQuery0,\n optimizeContent(new javax.xml.namespace.QName(\"http://www.epaylinks.cn/webservice/services/TerminalServiceXml\",\n \"directOrderStateQuery\")), new javax.xml.namespace.QName(\"http://www.epaylinks.cn/webservice/services/TerminalServiceXml\",\n \"directOrderStateQuery\"));\n \n // adding SOAP soap_headers\n _serviceClient.addHeadersToEnvelope(env);\n // create message context with that soap envelope\n _messageContext.setEnvelope(env);\n\n // add the message context to the operation client\n _operationClient.addMessageContext(_messageContext);\n\n\n \n _operationClient.setCallback(new org.apache.axis2.client.async.AxisCallback() {\n public void onMessage(org.apache.axis2.context.MessageContext resultContext) {\n try {\n org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope();\n \n java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(),\n net.wit.webservice.TerminalServiceXmlServiceStub.DirectOrderStateQueryResponse.class,\n getEnvelopeNamespaces(resultEnv));\n callback.receiveResultdirectOrderStateQuery(\n (net.wit.webservice.TerminalServiceXmlServiceStub.DirectOrderStateQueryResponse)object);\n \n } catch (org.apache.axis2.AxisFault e) {\n callback.receiveErrordirectOrderStateQuery(e);\n }\n }\n\n public void onError(java.lang.Exception error) {\n\t\t\t\t\t\t\t\tif (error instanceof org.apache.axis2.AxisFault) {\n\t\t\t\t\t\t\t\t\torg.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error;\n\t\t\t\t\t\t\t\t\torg.apache.axiom.om.OMElement faultElt = f.getDetail();\n\t\t\t\t\t\t\t\t\tif (faultElt!=null){\n\t\t\t\t\t\t\t\t\t\tif (faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),\"directOrderStateQuery\"))){\n\t\t\t\t\t\t\t\t\t\t\t//make the fault by reflection\n\t\t\t\t\t\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\t\t\t\t\t\t\tjava.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),\"directOrderStateQuery\"));\n\t\t\t\t\t\t\t\t\t\t\t\t\tjava.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName);\n\t\t\t\t\t\t\t\t\t\t\t\t\tjava.lang.reflect.Constructor constructor = exceptionClass.getConstructor(String.class);\n java.lang.Exception ex = (java.lang.Exception) constructor.newInstance(f.getMessage());\n\t\t\t\t\t\t\t\t\t\t\t\t\t//message class\n\t\t\t\t\t\t\t\t\t\t\t\t\tjava.lang.String messageClassName = (java.lang.String)faultMessageMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(),\"directOrderStateQuery\"));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tjava.lang.Class messageClass = java.lang.Class.forName(messageClassName);\n\t\t\t\t\t\t\t\t\t\t\t\t\tjava.lang.Object messageObject = fromOM(faultElt,messageClass,null);\n\t\t\t\t\t\t\t\t\t\t\t\t\tjava.lang.reflect.Method m = exceptionClass.getMethod(\"setFaultMessage\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnew java.lang.Class[]{messageClass});\n\t\t\t\t\t\t\t\t\t\t\t\t\tm.invoke(ex,new java.lang.Object[]{messageObject});\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t callback.receiveErrordirectOrderStateQuery(new java.rmi.RemoteException(ex.getMessage(), ex));\n } catch(java.lang.ClassCastException e){\n // we cannot intantiate the class - throw the original Axis fault\n callback.receiveErrordirectOrderStateQuery(f);\n } catch (java.lang.ClassNotFoundException e) {\n // we cannot intantiate the class - throw the original Axis fault\n callback.receiveErrordirectOrderStateQuery(f);\n } catch (java.lang.NoSuchMethodException e) {\n // we cannot intantiate the class - throw the original Axis fault\n callback.receiveErrordirectOrderStateQuery(f);\n } catch (java.lang.reflect.InvocationTargetException e) {\n // we cannot intantiate the class - throw the original Axis fault\n callback.receiveErrordirectOrderStateQuery(f);\n } catch (java.lang.IllegalAccessException e) {\n // we cannot intantiate the class - throw the original Axis fault\n callback.receiveErrordirectOrderStateQuery(f);\n } catch (java.lang.InstantiationException e) {\n // we cannot intantiate the class - throw the original Axis fault\n callback.receiveErrordirectOrderStateQuery(f);\n } catch (org.apache.axis2.AxisFault e) {\n // we cannot intantiate the class - throw the original Axis fault\n callback.receiveErrordirectOrderStateQuery(f);\n }\n\t\t\t\t\t\t\t\t\t } else {\n\t\t\t\t\t\t\t\t\t\t callback.receiveErrordirectOrderStateQuery(f);\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t callback.receiveErrordirectOrderStateQuery(f);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t callback.receiveErrordirectOrderStateQuery(error);\n\t\t\t\t\t\t\t\t}\n }\n\n public void onFault(org.apache.axis2.context.MessageContext faultContext) {\n org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext);\n onError(fault);\n }\n\n public void onComplete() {\n try {\n _messageContext.getTransportOut().getSender().cleanup(_messageContext);\n } catch (org.apache.axis2.AxisFault axisFault) {\n callback.receiveErrordirectOrderStateQuery(axisFault);\n }\n }\n });\n \n\n org.apache.axis2.util.CallbackReceiver _callbackReceiver = null;\n if ( _operations[0].getMessageReceiver()==null && _operationClient.getOptions().isUseSeparateListener()) {\n _callbackReceiver = new org.apache.axis2.util.CallbackReceiver();\n _operations[0].setMessageReceiver(\n _callbackReceiver);\n }\n\n //execute the operation client\n _operationClient.execute(false);\n\n }", "amdocs.iam.pd.pdwebservices.GetQuoteDocument.GetQuote getGetQuote();", "private void requestOrderDetail() {\n\n ModelHandler.OrderRequestor.requestOrderDetail(client, mViewData.getOrder().getId(), (order) -> {\n mViewData.setOrder(order);\n onViewDataChanged();\n }, this::showErrorMessage);\n }", "public interface GrabTicketQueryService {\n\n\n /**\n * 抢票查询\n * @param method\n * @param train_date\n * @param from_station\n * @param to_station\n * @return\n */\n JSONObject grabTicketQuery(String uid, String partnerid, String method, String from_station, String to_station, String from_station_name, String to_station_name, String train_date, String purpose_codes);\n// JSONObject grabTicketQuery(String partnerid, String method, String from_station, String to_station, String train_date, String purpose_codes);\n}", "public interface BuyerService {\n\n //查询一个订单\n OrderDTO findOrderOne(String openid, String orderId);\n\n //取消订单\n OrderDTO cancelOrder(String openid, String orderId);\n}", "public void receiveResultcreateOrderByPnr(\n com.speed.esalDemo.generation.OrderServiceImplServiceStub.CreateOrderByPnrResponseE result\n ) {\n }", "public void orderClicked(View view) {\n Log.d(\"Method\", \"orderClicked()\");\n orderPlace();\n }", "public static void main(String[] args) throws Exception {\n String secretKey = \"WOw+6dMYD2W/Qt5i3FzM0TNMOe4jpGEACmhEvlSW\";\n\n // Use the endpoint for your marketplace\n String serviceUrl = \"https://mws.amazonservices.com.cn/Orders/2013-09-01\";\n\n // Create set of parameters needed and store in a map\n HashMap<String, String> parameters = new HashMap<String, String>();\n\n System.out.println(\"\\u6ca1\\u6709\\u7528\\u5e10\\u53f7\\u767b\\u5f55\");\n\n // Add required parameters. Change these as needed.\n parameters.put(\"AWSAccessKeyId\", urlEncode(\"AKIAIUPF5HHXOHP33PXQ\"));\n parameters.put(\"Action\", urlEncode(\"GetOrder\"));\n// parameters.put(\"MWSAuthToken\", urlEncode(\"\"));\n parameters.put(\"SellerId\", urlEncode(\"A2BJRKK636DQMN\"));\n parameters.put(\"SignatureMethod\", urlEncode(ALGORITHM));\n parameters.put(\"SignatureVersion\", urlEncode(\"2\"));\n// parameters.put(\"SubmittedFromDate\", urlEncode(\"2013-05-01T12:00:00Z\"));\n parameters.put(\"Timestamp\", urlEncode(\"2016-04-11T21:42:52Z\"));\n parameters.put(\"Version\", urlEncode(\"2013-09-01\"));\n\n System.out.println(new Date());\n // Format the parameters as they will appear in final format\n // (without the signature parameter)\n String formattedParameters = calculateStringToSignV2(parameters, serviceUrl);\n\n String signature = sign(formattedParameters, secretKey);\n\n // Add signature to the parameters and display final results\n// parameters.put(\"Signature\", urlEncode(signature));\n parameters.put(\"Signature\", \"g/YTA9HMsbWJZ7v9YBmQewD6FtkDD8SlWKZYVQNpgjY=\");\n parameters.put(\"AmazonOrderId.Id.1\", \"C02-3104734-8660044\");\n String url = calculateStringToSignV2(parameters, serviceUrl);\n System.out.println(url);\n url = \"https://mws.amazonservices.com.cn/Orders/2013-09-01?AWSAccessKeyId=AKIAIUPF5HHXOHP33PXQ&Action=GetOrder&SellerId=A2BJRKK636DQMN&SignatureVersion=2&Timestamp=2016-04-11T02%3A44%3A48Z&Version=2013-09-01&Signature=8W0iiMV0Jtea%2BnukhZnqfb1pa6zIUEeRmmA6vOh2tWI%3D&SignatureMethod=HmacSHA256&AmazonOrderId.Id.1=C03-6051918-4780805\";\n JSoupParser parser = new JSoupParser(\"https://mws.amazonservices.com.cn/Orders/2013-09-01\");\n Map<String, String> headers = new HashMap<>();\n headers.put(\"x-amazon-user-agent\", \"AmazonJavascriptScratchpad/1.0 (Language=Javascript)\\n\");\n headers.put(\"X-Requested-With\", \"XMLHttpRequest\\n\");\n Map<String, String> cookies = new HashMap<>();\n cookies.put(\"session-id-time-cn\", \"1460962800l\");\n cookies.put(\"session-id-cn\", \"475-2855409-1672501\");\n cookies.put(\"ubid-acbcn\", \"475-9817303-5467017\");\n cookies.put(\"csm-hit\", \"32.13|1460410865762\");\n Document doc = parser.parse(parameters,headers, cookies);\n// Document doc = Jsoup.connect(serviceUrl).header(\"x-amazon-user-agent\", \"AmazonJavascriptScratchpad/1.0 (Language=Javascript)\").data(parameters).get();\n System.out.println(doc.html());\n }", "private static JSONObject placeOrderByPost(org.json.simple.JSONObject shipMent) throws org.json.simple.parser.ParseException {\n\t\tJSONObject jObject = new JSONObject();\n\t\tString line = \"\";\n\t\tJSONParser parser = new JSONParser();\n\t\tJSONObject newJObject = null;\n\t\tSystem.out.println(\"shipment object-->\"+shipMent.toJSONString());\n\t\ttry{\n\t\t\tDefaultHttpClient client = new DefaultHttpClient();\n\t\t\t//client = (DefaultHttpClient) wrapClient(client);\n\t\t\t/* TESTING URL */\n\t\t\t//String url=\"https://apitest.roadrunnr.in/v1/orders/ship\";\n\t\t\t/* LIVE URL : https://runnr.in/v1/orders/ship\n\t\t\t//String url=\"http://roadrunnr.in/v1/orders/ship\";\n\t\t\t//New url*/\n\t\t\tString url =\"http://api.pickji.com/corporateapi/sandbox/placeorder\";\n\t\t\tHttpPost post = new HttpPost(url.trim());\n\t\t\tStringEntity input = new StringEntity(shipMent.toJSONString());\n\t\t\tpost.addHeader(\"Content-Type\", \"application/json\");\n\t\t\t//post.addHeader(\"Authorization\" , generateAuthToken());\n\t\t\t//post.addHeader(\"Authorization\" ,getToken(false));\n\n\t\t\tpost.setEntity(input);\n\t\t\t//System.out.println(\"StringEntity - - ->\"+input.toString());\n\t\t\tHttpResponse response = client.execute(post);\n\t\t\tBufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent())); \n\t\t\twhile ((line = rd.readLine()) != null) {\n\t\t\t\t// System.out.println(\"Line - - >\"+line);\n\t\t\t\tnewJObject = new JSONObject(line);\n\t\t\t}\n\t\t}catch(UnsupportedEncodingException e){\n\n\t\t}catch(JSONException e){\n\n\t\t} catch (ClientProtocolException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn newJObject; \n\t}" ]
[ "0.6523282", "0.6477878", "0.63862425", "0.62574035", "0.62121284", "0.62105954", "0.5989053", "0.59852344", "0.5942029", "0.59191406", "0.5860117", "0.58284324", "0.5808725", "0.57887876", "0.5758919", "0.57414204", "0.5701423", "0.5679558", "0.5679558", "0.5645659", "0.5640124", "0.56207514", "0.56049246", "0.56016964", "0.55899924", "0.55737036", "0.55568945", "0.5534976", "0.55340034", "0.5533653", "0.5527267", "0.55231845", "0.5518363", "0.5509511", "0.54625726", "0.5461702", "0.5449437", "0.54366124", "0.5433297", "0.54330415", "0.5422798", "0.54192245", "0.5414365", "0.5411982", "0.5409756", "0.54062825", "0.5395591", "0.5386962", "0.53850496", "0.53827363", "0.5368038", "0.5365112", "0.5360427", "0.53595036", "0.53451055", "0.53447396", "0.5343927", "0.534365", "0.534197", "0.53397423", "0.53355265", "0.5333862", "0.5321053", "0.531924", "0.53181833", "0.5316536", "0.53160644", "0.5307219", "0.5304343", "0.53004825", "0.52989435", "0.5294688", "0.5290435", "0.5284773", "0.52757174", "0.5275518", "0.5259061", "0.52476895", "0.52418476", "0.52414167", "0.5237648", "0.52321", "0.5228597", "0.5228359", "0.5221247", "0.52098095", "0.5208803", "0.52080333", "0.52006847", "0.519815", "0.5191502", "0.519073", "0.5189743", "0.5189413", "0.5189396", "0.5188567", "0.5184974", "0.51846045", "0.5179033", "0.5171735" ]
0.5927929
9
Method to verify place order service response status code is 200
public static void verifySuccessStatusCodeInPlaceStoreOrderResponse(Response response) { int statusCode = response.then().extract().statusCode(); APILogger.logInfo(LOGGER,"Verifying Place Store Order service response - status code, Expected: 200, Actual: " + statusCode); MicroservicesEnvConfig.softAssert.assertEquals(statusCode, 200, "Place Store Order service response - status code error"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tpublic void verifyStatusCode() {\n\t\tAssert.assertEquals(response.getStatusCode(), 200);\n\t}", "@Test\n\tpublic void requestDataForCustomer12212_checkResponseCode_expect200() {\n\n\t\tgiven().\n\t\t\tspec(requestSpec).\n\t\twhen().\n\t\tthen();\n\t}", "protected abstract boolean isExpectedResponseCode(int httpStatus);", "@Test\n\t@Then(\"Validate the positive response code received\")\n\tpublic void validate_the_positive_response_code_received() {\n\t\tint code=response.getStatusCode();\n\t\t System.out.println(\"Status Code Received: \"+code);\n\t\t Assert.assertEquals(200,code);\n\t\t RestAssured.given()\n\t\t\t.when()\n\t\t\t.get(\"https://api.ratesapi.io/api/2050-01-12\") \n\t\t\t.then()\n\t\t\t.log().body();\n\t}", "@Test\r\n\tpublic void testResponseCode(){\r\n\t\t\r\n\t\tint code = get(api1).getStatusCode();\r\n\t\tSystem.out.println(\"Code: \"+code);\r\n\t\tAssert.assertEquals(code, 200);\r\n\t}", "public static void verifyPlaceStoreOrderResponse(Response response, long expectedId, long expectedPetId, int expectedQuantity, String expectedShipDate, String expectedStatus, boolean expectedCompleted) {\n verifySuccessStatusCodeInPlaceStoreOrderResponse(response);\n\n StoreOrderResponse storeOrderResponse = response.as(StoreOrderResponse.class);\n\n long actualId = storeOrderResponse.getId();\n APILogger.logInfo(LOGGER,\"Verifying Place Store Order service response - id, Actual: \" + actualId + \" , Expected: \" + expectedId);\n MicroservicesEnvConfig.softAssert.assertEquals(actualId, expectedId, \"Place Store Order service response - id field error\");\n\n long actualPetId = storeOrderResponse.getPetId();\n APILogger.logInfo(LOGGER,\"Verifying Place Store Order service response - pet id, Actual: \" + actualPetId + \" , Expected: \" + expectedPetId);\n MicroservicesEnvConfig.softAssert.assertEquals(actualPetId, expectedPetId, \"Place Store Order service response - pet id field error\");\n\n int actualQuantity = storeOrderResponse.getQuantity();\n APILogger.logInfo(LOGGER,\"Verifying Place Store Order service response - quantity, Actual: \" + actualQuantity + \" , Expected: \" + expectedQuantity);\n MicroservicesEnvConfig.softAssert.assertEquals(actualQuantity, expectedQuantity, \"Place Store Order service response - quantity field error\");\n\n String actualShipDate = storeOrderResponse.getShipDate().substring(0,23);\n expectedShipDate = expectedShipDate.replace(\"Z\", \"\");\n APILogger.logInfo(LOGGER,\"Verifying Place Store Order service response - ship date, Actual: \" + actualShipDate + \" , Expected: \" + expectedShipDate);\n MicroservicesEnvConfig.softAssert.assertEquals(actualShipDate, expectedShipDate, \"Place Store Order service response - ship date field error\");\n\n String actualStatus = storeOrderResponse.getStatus();\n APILogger.logInfo(LOGGER,\"Verifying Place Store Order service response - status, Actual: \" + actualStatus + \" , Expected: \" + expectedStatus);\n MicroservicesEnvConfig.softAssert.assertEquals(actualStatus, expectedStatus, \"Place Store Order service response - status field error\");\n\n boolean actualCompleted = storeOrderResponse.isComplete();\n APILogger.logInfo(LOGGER,\"Verifying Place Store Order service response - complete, Actual: \" + actualCompleted + \" , Expected: \" + expectedCompleted);\n MicroservicesEnvConfig.softAssert.assertEquals(actualCompleted, expectedCompleted, \"Place Store Order service response - complete field error\");\n }", "@Test(priority=1)\r\n\tpublic void validateStatusCode()\r\n\t{\r\n\t\tgiven()\r\n\t\t.get(\"https://reqres.in/api/users/2\")\r\n\t\t.then()\r\n\t\t.statusCode(200);\r\n\t\t\r\n\t}", "@Test\n\tpublic void testStatusCode() {\n\t\tgiven().\n\t\tget(Endpoint.GET_COUNTRY).then().statusCode(200);\n\t}", "public static int getStatusCode() {\r\n\r\n\r\n\r\n\t\tCloseableHttpResponse response= postSoapRequest(\"getDealList_Request\",baseURI);\r\n\r\n\r\n\r\n\t\tint statuseCode=response.getStatusLine().getStatusCode();\r\n\r\n\t\tSystem.out.println(\"statuseCode= \"+statuseCode);\r\n\r\n\t\t//Assert.assertEquals(200,statuseCode);\r\n\r\n\t\treturn statuseCode;\r\n\r\n\t}", "@Test\n public void testStatusCode(){\n Assert.assertEquals(resp.getStatusCode(),200, \"Status code does not match\");\n }", "public boolean isSuccessful() {\n return code >= 200 && code < 300;\n }", "@Test(priority=1)\n\tpublic void teststatuscode() {\n\t\t\n\t\twhen()\n\t\t\t.get(\"http://jsonplaceholder.typicode.com/posts/1\")\n\t\t.then()\n\t\t\t.statusCode(200);\n\t\t\t//.log().all();\n\t}", "public boolean isSuccessful() {\n return responseCode >= 200 && responseCode < 300;\n }", "protected boolean isSuccessful(Response response) {\n if (response == null) {\n return false;\n }\n //System.out.println(\" Get Status is \" + response.getStatus());\n return response.getStatus() == 200;\n }", "@Test\n\tpublic void teststatuscode() {\n\t\t\n\t\tgiven()\n\t\t\n\t\t.when()\n\t\t\t.get(\"http://jsonplaceholder.typicode.com/posts/5\")\n\t\t.then()\n\t\t\t.statusCode(200)\n\t\t\t.log().all();\n\t}", "public static void validateResponseStatusCode(Response response) {\n\t\tresponse.then().statusCode(200);\n\n\t}", "public void verifyResponseCode(int responseCode){\n\n Assert.assertEquals(responseCode,response.statusCode());\n System.out.println(\"Verify Response code: \"+responseCode);\n }", "private static Boolean compareStatusCode(String test, HttpResponse<InputStream> jsonResponse) {\n return test.equalsIgnoreCase(Integer.toString(jsonResponse.getStatus()));\n }", "public boolean isSuccessful()\n\t{\n\t\tif (response.get(\"Result\").equals(\"APPROVED\") && !response.get(\"MESSAGE\").equals(\"DUPLICATE\")) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "@Override\n public void onSuccess(int statusCode, cz.msebera.android.httpclient.Header[] headers, JSONObject response) {\n try {\n String status = response.getString(\"status\");\n if (status.contains(\"status not ok\")) {\n lt.error();\n Toast.makeText(activity, response.getString(\"error\"), Toast.LENGTH_LONG).show();\n } else {\n lt.success();\n }\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }", "@Test\n\t\tpublic void testRestSuccessfulResponse() throws Exception {\n\n\t\t\tString responseBody = TestUtils.getValidResponse();\n\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tResponseEntity<ResponseWrapper> responseEntity= prepareReponseEntity(responseBody);\n\t\t\t\t\n\t\t\t\tboolean flag=weatherService.checkForErrors(responseEntity);\n\t\t\t\tassertFalse(flag);\n\t\t\t\n\t\t\t\tthis.mockServer.verify();\n\t\t\t} catch (Exception e) {\n\t\t\t\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}", "public boolean isHttpOK(){\n return getStatusCode() == HttpURLConnection.HTTP_OK;\n }", "@Test\n\tpublic void checkStatus() {\n\t\tclient.execute(\"1095C-16-111111\");\n\t}", "public boolean getResponseStatus();", "public boolean validateReponse(Response response, int id,int which)\n {\n return response.isSuccessful();\n }", "public void verifyRespStatus(OCSPResp resp) throws OCSPException\n {\n String statusInfo = \"\";\n if (resp != null)\n {\n int status = resp.getStatus();\n switch (status)\n {\n case OCSPResponseStatus.INTERNAL_ERROR:\n statusInfo = \"INTERNAL_ERROR\";\n LOG.error(\"An internal error occurred in the OCSP Server!\");\n break;\n case OCSPResponseStatus.MALFORMED_REQUEST:\n // This happened when the \"critical\" flag was used for extensions\n // on a responder known by the committer of this comment.\n statusInfo = \"MALFORMED_REQUEST\";\n LOG.error(\"Your request did not fit the RFC 2560 syntax!\");\n break;\n case OCSPResponseStatus.SIG_REQUIRED:\n statusInfo = \"SIG_REQUIRED\";\n LOG.error(\"Your request was not signed!\");\n break;\n case OCSPResponseStatus.TRY_LATER:\n statusInfo = \"TRY_LATER\";\n LOG.error(\"The server was too busy to answer you!\");\n break;\n case OCSPResponseStatus.UNAUTHORIZED:\n statusInfo = \"UNAUTHORIZED\";\n LOG.error(\"The server could not authenticate you!\");\n break;\n case OCSPResponseStatus.SUCCESSFUL:\n break;\n default:\n statusInfo = \"UNKNOWN\";\n LOG.error(\"Unknown OCSPResponse status code! \" + status);\n }\n }\n if (resp == null || resp.getStatus() != OCSPResponseStatus.SUCCESSFUL)\n {\n throw new OCSPException(\"OCSP response unsuccessful, status: \" + statusInfo);\n }\n }", "@Then(\"Validate status code is {string}\")\r\n\tpublic void validate_status_code_is(String arg1) throws Throwable {\n\t\tAssert.assertTrue(StripeCustomer.response.getStatusCode()==Integer.parseInt(arg1));\r\n\t}", "@Test\n public void testPostOrdersAction() throws ClientException, IOException, ProcessingException {\n CloudResponse response = this.actions.postOrdersAction(\"{cartId}\", \"{customerId}\");\n List<Integer> expectedResults = Arrays.asList(200, 400, 403, 404);\n LOG.info(\"Got status {}\", response.getStatusLine());\n Assert.assertTrue(expectedResults.contains(response.getStatusLine().getStatusCode()));\n\n if(response.getStatusLine().getStatusCode() == 200) {\n this.actions.checkResponseJSONSchema(\"#/definitions/Order\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 400) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 403) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 404) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n \n }", "public boolean isOK() {\r\n return getPayload().getString(\"status\").equals(\"ok\");\r\n }", "@Test\n public void teststatusCode() {\n\t \n\t given().\n\t \tget(\"https://reqres.in/api/unknown\").\n\t then().\t\t\n\t \tstatusCode(200);\n\t \n }", "@Test\n public void placeOrderTest() {\n Order body = new Order().id(10L)\n .petId(10L)\n .complete(false)\n .status(Order.StatusEnum.PLACED)\n .quantity(1);\n Order response = api.placeOrder(body);\n\n Assert.assertEquals(10L, response.getId().longValue());\n Assert.assertEquals(10L, response.getPetId().longValue());\n Assert.assertEquals(1, response.getQuantity().intValue());\n Assert.assertEquals(true, response.isComplete());\n Assert.assertEquals(Order.StatusEnum.APPROVED, response.getStatus());\n\n verify(exactly(1), postRequestedFor(urlEqualTo(\"/store/order\")));\n }", "static final <T> CompletionStage<HttpResponse<T>>\n assert200ResponseCode(HttpResponse<T> response) {\n assertEquals(response.statusCode(), 200);\n return CompletableFuture.completedFuture(response);\n }", "@SuppressWarnings(\"unchecked\")\n private boolean checkResponse (HttpResponse<?> pResponse) {\n boolean result = false;\n if (pResponse != null\n && pResponse.getStatus() == 200\n && pResponse.getBody() != null) {\n HttpResponse<String> response = (HttpResponse<String>)pResponse;\n JSONObject body = new JSONObject(response.getBody());\n if (body.has(\"result\")) {\n result = Boolean.TRUE.equals(body.getBoolean(\"success\"));\n }\n }\n return result;\n }", "@Test\n public void getStatus_StatusIsGot_Passes() throws Exception {\n Assert.assertEquals(test1JsonResponse.getStatus(), test1status);\n }", "private void postValidationResponseCodeSuccess() throws APIRestGeneratorException\r\n\t{\r\n\t\tfinal Iterator<String> iterator = this.localResponses.getResponsesMap().keySet().iterator() ;\r\n\t\tboolean found \t\t\t\t = false ;\r\n\t\t\r\n\t\twhile (iterator.hasNext() && !found)\r\n\t\t{\r\n\t\t\tfinal String codeKey = iterator.next() ;\r\n\t\t\tfound \t\t\t\t = ConstantsMiddle.RESP_CODE_SUCCESS.equals(codeKey) ;\r\n\t\t}\r\n\t\t\r\n\t\tif (!found)\r\n\t\t{\r\n\t\t\tfinal String errorString = \"The path '\" + this.pathValue + \"' ('\" + this.pathOp + \"' operation) \" +\r\n\t\t\t\t\t\t\t\t\t \"needs a defined response with code \" + ConstantsMiddle.RESP_CODE_SUCCESS ;\r\n\t\t\t\r\n\t\t\tResponsesPostValidator.LOGGER.error(errorString) ;\r\n\t \tthrow new APIRestGeneratorException(errorString) ;\r\n\t\t}\r\n\t}", "@Test\n\tpublic void testIncorrectStatusCode() {\n\t\tgiven().\n\t\tget(Endpoint.GET_COUNTRY_invalid).then().statusCode(404);\n\t}", "@Test\n\tpublic void testStatusCode() {\n\t\tassertEquals(\"404\", myReply.getStatusCode());\n\t}", "trinsic.services.common.v1.CommonOuterClass.ResponseStatus getStatus();", "@Test\n public void testPostCartsIdBillingaddressAction() throws ClientException, IOException, ProcessingException {\n CloudResponse response = this.actions.postCartsIdBillingaddressAction(\"{id}\", \"{body}\");\n List<Integer> expectedResults = Arrays.asList(200, 400, 403, 404);\n LOG.info(\"Got status {}\", response.getStatusLine());\n Assert.assertTrue(expectedResults.contains(response.getStatusLine().getStatusCode()));\n\n if(response.getStatusLine().getStatusCode() == 200) {\n this.actions.checkResponseJSONSchema(\"#/definitions/Cart\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 400) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 403) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 404) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n \n }", "public static boolean validResponse(int code) {\n return code >= 200 && code < 300;\n }", "public static boolean getOrderStatus() {\r\n \treturn orderSucceed;\r\n }", "static boolean checkOk(String response) {\n\t\tMatcher m = PAT_ES_SUCCESS.matcher(response);\n\t\tif (m.find()) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "@Then(\"the API call got success with status code {int}\")\npublic void the_api_call_got_success_with_status_code(Integer int1) {\n\tassertEquals(response.getStatusCode(),200);\n\t\n}", "public boolean validateResponse(Response response) {\n return response.isSuccessful();\n }", "int getStatusCode();", "int getStatusCode();", "protected boolean isSuccessfulResponse(final int httpStatusCode) {\n return (httpStatusCode >= HTTP_OK_RANGE_LO && httpStatusCode < HTTP_OK_RANGE_HI);\n }", "protected static boolean ok(int status) {\n return (status >= 200 && status < 300);\n }", "@Then(\"user validates status code {string}\")\r\n\tpublic void user_validates_status_code(String arg1) throws Throwable {\n\t\tAssert.assertTrue(StripeCustomer.response.getStatusCode()==Integer.parseInt(arg1));\r\n\t}", "protected boolean isSuccessCode(int code) {\n return code >= 200 && code <= 399;\n }", "@Then(\"the API call got success with status code {int}\")\n public void the_API_call_got_success_with_status_code(Integer expectedCode) {\n System.out.println(\"Then1\");\n assertEquals(200,response.getStatusCode());\n\n\n // throw new io.cucumber.java.PendingException();\n }", "public boolean isResponseSuccess(int statusCode) {\r\n return statusCode == HttpStatus.SC_NO_CONTENT || statusCode == HttpStatus.SC_CREATED || statusCode == HttpStatus.SC_OK;\r\n }", "int getStatusCode( );", "@Override\n\t\t\t\tpublic void onFailure(int statusCode, Header[] headers,\n\t\t\t\t\t\tThrowable throwable, JSONObject errorResponse) {\n\t\t\t\t\tToast.makeText(getActivity().getApplicationContext(), \"获取订单超时\", Toast.LENGTH_SHORT).show();\n\t\t\t\t}", "public static Integer getStatusCode() {\n Response res = (Response) Serenity.getCurrentSession().get(\"apiResponse\");\n return res.then().extract().statusCode();\n //return SerenityRest.then().extract().statusCode();\n }", "@Then(\"validate status code is {string}\")\r\n\tpublic void validate_status_code_is_(String arg1) throws Throwable {\n\t\tresponse.prettyPrint();\r\n\t\t//System.out.println(response.getStatusCode()+\"*****\"+arg1);\r\n\t\tAssert.assertTrue(response.getStatusCode()==Integer.parseInt(arg1));\r\n\t}", "@Test public void addCard_response_check_status_test() throws ClientProtocolException, IOException\n\t{\n\t\tSystem.out.println(\"\\n--------------------------------------------------\");\n\t\tSystem.out.println(\"Start test: \" + testName.getMethodName());\n\t\t\n\t\t//Given\n\t\tString idList = testSuite.listId;\n\t\tString due = \"null\";\n\t\tString name = \"Add card\";\n\t\tString desc = \"API test - Add card through trello API\";\n\t\t\n\t\tString query = String.format(\"idList=%s&due=%s&name=%s&desc=%s&key=%s&token=%s\", \n\t\t\t\t\t\t\t\t\t\tURLEncoder.encode(idList, charset), \n\t\t\t\t\t\t\t\t\t\tURLEncoder.encode(due, charset),\n\t\t\t\t\t\t\t\t\t\tURLEncoder.encode(name, charset), \n\t\t\t\t\t\t\t\t\t\tURLEncoder.encode(desc, charset), \n\t\t\t\t\t\t\t\t\t\tURLEncoder.encode(key, charset), \n\t\t\t\t\t\t\t\t\t\tURLEncoder.encode(token, charset));\n\t\t//When\n\t\tCloseableHttpClient httpClient = HttpClients.createDefault();\n\t\tHttpPost postRequest = new HttpPost(cardUrl + \"?\" + query);\n\t\tHttpResponse response = httpClient.execute(postRequest);\n\t\t//Then\n\t\t/*\n\t\t * Expect: 200 - status code\n\t\t * */\n\t\tassertEquals(response.getStatusLine().getStatusCode(), 200);\n\t\t\n\t\t//Tear down\n\t\thttpClient.close();\n\t\t\n\t\tSystem.out.println(\"Finish test: \" + testName.getMethodName());\n\t\tSystem.out.println(\"--------------------------------------------------\\n\");\n\t}", "Http.Status status();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "private boolean isSuccessful(SocketMessage response) {\r\n if (\"success\".equals(response.getValue(\"status\"))) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "HttpStatusCode getStatusCode();", "@Override\n public RestStatus status() {\n return response.status();\n }", "com.google.rpc.Status getStatus();", "com.google.rpc.Status getStatus();", "public boolean mo7249a(HttpURLConnection httpURLConnection) {\n return httpURLConnection.getResponseCode() == 200;\n }", "ResponseEntity<?> verifyOtp(HttpServletRequest request, HttpServletResponse response);", "boolean hasListResponse();", "@Test\n\t\tpublic void testRestErrorResponse() throws Exception {\n\n\t\t\tString responseBody = TestUtils.getErrorResultString();\n\t\ttry {\n\t\t\t\t\n\t\t\t\tResponseEntity<ResponseWrapper> responseEntity= prepareReponseEntity(responseBody);\n\t\t\t\t\n\t\t\t\tboolean flag=weatherService.checkForErrors(responseEntity);\n\t\t\t\tassertTrue(flag);\n\t\t\t\tthis.mockServer.verify();\n\t\t\t} catch (Exception e) {\n\t\t\t\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}", "boolean isSuccessful();", "public static boolean isResponseCodeOk(Integer responseCode) {\n\n if (responseCode >= HttpStatus.SC_BAD_REQUEST) return false;\n return true;\n }", "private static void checkStatus() {\n\r\n\t\tDate date = new Date();\r\n\t\tSystem.out.println(\"Checking at :\"+date.toString());\r\n\t\tString response = \"\";\r\n\t\ttry {\r\n\t\t\tresponse = sendGET(GET_URL_COVAXIN);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t//System.out.println(response.toString());\r\n\t\tArrayList<Map> res = formatResponse(response);\r\n\r\n\t\tres = checkAvailability(res);\r\n\t\tif(res.size()>0)\r\n\t\t\tnotifyUser(res);\r\n\t\t//System.out.println(emp.toString());\r\n\t}", "@Given(\"^an invalid or missing token and making a POST request to account_ID_checkout then it should return a (\\\\d+) and an empty body$\")\n\tpublic void an_invalid_or_missing_token_and_making_a_POST_request_to_account_ID_checkout_then_it_should_return_a_and_an_empty_body(int StatusCode) throws Throwable {\n\t\tPostCheckout.POST_account_id_checkout_UnAuthorized();\n\t try{}catch(Exception e){}\n\t}", "@Test\n\tpublic void verifyflightNumber() {\n\t\tJsonPath path = new JsonPath(response.getBody().asString());\n\t\tAssert.assertEquals(path.getString(\"flight_number\"), \"102\");\n\t}", "public int statusCode(){\n return code;\n }", "@Test\n public void testSuccess() throws Exception {\n\n client.makeBooking(\"Paul\", new Date(System.currentTimeMillis()), false);\n\n BookingStatus bookingStatus = client.getLastBookingStatus();\n Assert.assertTrue(\"Expected booking to be confirmed, but it wasn't: \" + bookingStatus, bookingStatus.equals(BookingStatus.CONFIRMED));\n }", "public static boolean okResponseOrThrow(JsonObject jsonObject) throws ResponseException {\n final StatusResponse statusResponse = Application.GSON.fromJson(jsonObject, StatusResponse.class);;\n\n if (statusResponse.status != StatusResponse.Status.Ok) {\n throw new ResponseException(statusResponse);\n }\n\n return true;\n }", "@Test\n public void transStatusTest() {\n assertEquals(\"P\", authResponse.getTransStatus());\n }", "private static boolean canResponseHaveBody(int status) {\n LOG.trace(\"enter HttpMethodBase.canResponseHaveBody(int)\");\n\n boolean result = true;\n\n if ((status >= 100 && status <= 199) || (status == 204)\n || (status == 304)) { // NOT MODIFIED\n result = false;\n }\n\n return result;\n }", "boolean hasResultCode();", "boolean hasResultCode();", "@Test\n public void testPostCartsIdPaymentAction() throws ClientException, IOException, ProcessingException {\n CloudResponse response = this.actions.postCartsIdPaymentAction(\"{id}\", \"{body}\");\n List<Integer> expectedResults = Arrays.asList(200, 400, 403, 404);\n LOG.info(\"Got status {}\", response.getStatusLine());\n Assert.assertTrue(expectedResults.contains(response.getStatusLine().getStatusCode()));\n\n if(response.getStatusLine().getStatusCode() == 200) {\n this.actions.checkResponseJSONSchema(\"#/definitions/Cart\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 400) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 403) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 404) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n \n }", "public abstract int statusCode();", "boolean hasIsSuccess();", "@GET(\"system/status\")\n Call<InlineResponse200> getStatus();", "private Integer getStatus(Map<String, Object> info) {\n return 200;\n }", "public void verifyGetCircuiteStatus(JSONObject jsonObject, int status) throws Exception {\n Assert.assertEquals(jsonObject.getInt(\"status\"), status);\n }", "private boolean m43013b(int responseCode) {\n if (responseCode == 200 || responseCode == 202 || responseCode == 206) {\n return true;\n }\n return false;\n }", "@Given(\"^an invalid or missing token and making a GET request to account_ID_billing then it should return a (\\\\d+) and an empty body$\")\n\tpublic void an_invalid_or_missing_token_and_making_a_GET_request_to_account_ID_billing_then_it_should_return_a_and_an_empty_body(int StatusCode) throws Throwable {\n\t\tGetBilling.GET_account_id_billing_Unauthorised();\n\t try{}catch(Exception e){}\n\t}", "@Test\n\tpublic void testAccountSummaryTest()\n\t{\n\t\t\n\t\tMockito.when(accountService.accountSummary(1)).thenReturn(accountSummaryResponseDto);\n\t\tAccountSummaryResponseDto response = accountController.accountSummary(1);\n\t\tInteger expected = Constant.ACCEPTED;\n\t\tassertEquals(expected, response.getStatusCode());\n\t}", "@Test\n void executeMoneyTransfer() throws ParseException, JsonProcessingException {\n\n String idAccount = \"14537780\";\n String receiverName = \"Receiver Name\";\n String description = \"description text\";\n String currency = \"EUR\";\n String amount = \"100\";\n String executionDate = \"2020-12-12\";\n MoneyTransfer moneyTransfer = Utils.fillMoneyTransfer(idAccount, receiverName, description, currency, amount, executionDate);\n\n Response response = greetingWebClient.executeMoneyTransfer(moneyTransfer, idAccount);\n assertTrue(response.getStatus().equals(\"KO\"));\n\n\n }", "@Given(\"^an invalid or missing token and making a GET request to account_ID_wallet then it should return a (\\\\d+) and an empty body$\")\n\tpublic void an_invalid_or_missing_token_and_making_a_GET_request_to_account_ID_wallet_then_it_should_return_a_and_an_empty_body(int StatusCode) throws Throwable {\n\t\tGetWallet.GET_account_id_wallet_UnAuthorized();\n\t try{}catch(Exception e){}\n\t}", "@Test\n\t\tpublic void testZipCodeNotFound() throws Exception {\n\n\t\t\tString responseBody = TestUtils.getErrorResultString();\n\t\t\t\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\tResponseEntity<ResponseWrapper> responseEntity= prepareReponseEntity(responseBody);\n\t\t\t\t\n\t\t\t\tboolean flag=weatherService.checkForErrors(responseEntity);\n\t\t\t\tassertTrue(flag);\n\t\t\t\n\t\t\t\tthis.mockServer.verify();\n\t\t\t} catch (Exception e) {\n\t\t\t\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}" ]
[ "0.7230633", "0.6935289", "0.6881154", "0.6772217", "0.6771027", "0.6698431", "0.6649447", "0.65508485", "0.6537369", "0.6519093", "0.6507936", "0.6503499", "0.64748573", "0.6428127", "0.6305242", "0.6274922", "0.62478256", "0.6198293", "0.6197891", "0.6192274", "0.6157207", "0.6133268", "0.61252743", "0.60871464", "0.60861933", "0.6080725", "0.6071193", "0.60552293", "0.60449684", "0.60226285", "0.6015774", "0.6008887", "0.6008733", "0.59962744", "0.5990926", "0.5983622", "0.5982074", "0.5958721", "0.59374946", "0.5920179", "0.59065443", "0.5899561", "0.58883256", "0.5879526", "0.5872596", "0.5872596", "0.58528125", "0.5851009", "0.5850708", "0.5832911", "0.5831841", "0.5828627", "0.58177054", "0.5788446", "0.57852215", "0.5777981", "0.5761825", "0.5760096", "0.57150364", "0.57150364", "0.57150364", "0.57150364", "0.57150364", "0.57150364", "0.57150364", "0.57150364", "0.57150364", "0.5673193", "0.5671092", "0.5670614", "0.5652827", "0.5652827", "0.5614405", "0.5609767", "0.56094193", "0.560818", "0.5605354", "0.56021583", "0.55963105", "0.5579737", "0.5579654", "0.5572774", "0.5569682", "0.55457366", "0.55243486", "0.55104256", "0.54970753", "0.54970753", "0.54940474", "0.5484234", "0.54783624", "0.5476751", "0.5472214", "0.54721266", "0.54685384", "0.5464266", "0.5462956", "0.5454173", "0.5452731", "0.5446134" ]
0.8233459
0
Method to verify place order service response details
public static void verifyPlaceStoreOrderResponse(Response response, long expectedId, long expectedPetId, int expectedQuantity, String expectedShipDate, String expectedStatus, boolean expectedCompleted) { verifySuccessStatusCodeInPlaceStoreOrderResponse(response); StoreOrderResponse storeOrderResponse = response.as(StoreOrderResponse.class); long actualId = storeOrderResponse.getId(); APILogger.logInfo(LOGGER,"Verifying Place Store Order service response - id, Actual: " + actualId + " , Expected: " + expectedId); MicroservicesEnvConfig.softAssert.assertEquals(actualId, expectedId, "Place Store Order service response - id field error"); long actualPetId = storeOrderResponse.getPetId(); APILogger.logInfo(LOGGER,"Verifying Place Store Order service response - pet id, Actual: " + actualPetId + " , Expected: " + expectedPetId); MicroservicesEnvConfig.softAssert.assertEquals(actualPetId, expectedPetId, "Place Store Order service response - pet id field error"); int actualQuantity = storeOrderResponse.getQuantity(); APILogger.logInfo(LOGGER,"Verifying Place Store Order service response - quantity, Actual: " + actualQuantity + " , Expected: " + expectedQuantity); MicroservicesEnvConfig.softAssert.assertEquals(actualQuantity, expectedQuantity, "Place Store Order service response - quantity field error"); String actualShipDate = storeOrderResponse.getShipDate().substring(0,23); expectedShipDate = expectedShipDate.replace("Z", ""); APILogger.logInfo(LOGGER,"Verifying Place Store Order service response - ship date, Actual: " + actualShipDate + " , Expected: " + expectedShipDate); MicroservicesEnvConfig.softAssert.assertEquals(actualShipDate, expectedShipDate, "Place Store Order service response - ship date field error"); String actualStatus = storeOrderResponse.getStatus(); APILogger.logInfo(LOGGER,"Verifying Place Store Order service response - status, Actual: " + actualStatus + " , Expected: " + expectedStatus); MicroservicesEnvConfig.softAssert.assertEquals(actualStatus, expectedStatus, "Place Store Order service response - status field error"); boolean actualCompleted = storeOrderResponse.isComplete(); APILogger.logInfo(LOGGER,"Verifying Place Store Order service response - complete, Actual: " + actualCompleted + " , Expected: " + expectedCompleted); MicroservicesEnvConfig.softAssert.assertEquals(actualCompleted, expectedCompleted, "Place Store Order service response - complete field error"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void verifySuccessStatusCodeInPlaceStoreOrderResponse(Response response) {\n int statusCode = response.then().extract().statusCode();\n APILogger.logInfo(LOGGER,\"Verifying Place Store Order service response - status code, Expected: 200, Actual: \" + statusCode);\n MicroservicesEnvConfig.softAssert.assertEquals(statusCode, 200, \"Place Store Order service response - status code error\");\n }", "@Then(\"^verify order is placed successfully in Order History$\")\r\n\tpublic void verifyOrderHistory() throws Exception {\n\t assertTrue(new ProductCheckout(driver).isOrderPlaced());\r\n\t}", "@Test\n public void placeOrderTest() {\n Order body = new Order().id(10L)\n .petId(10L)\n .complete(false)\n .status(Order.StatusEnum.PLACED)\n .quantity(1);\n Order response = api.placeOrder(body);\n\n Assert.assertEquals(10L, response.getId().longValue());\n Assert.assertEquals(10L, response.getPetId().longValue());\n Assert.assertEquals(1, response.getQuantity().intValue());\n Assert.assertEquals(true, response.isComplete());\n Assert.assertEquals(Order.StatusEnum.APPROVED, response.getStatus());\n\n verify(exactly(1), postRequestedFor(urlEqualTo(\"/store/order\")));\n }", "public boolean VerifyOrderDetails_OrderConfirmation(){\n\tboolean flag = false;\n\tflag=CommonVariables.CommonDriver.get().findElement(OrderConfirmationScreen_OR.PAYMENTCONFIRMATION_LABEL).isDisplayed();\n\tif(flag){extentLogs.passWithCustom(\"VerifyOrderDetails\", \"PAYMENTCONFIRMATION_LABEL\");\n\t\tflag=CommonVariables.CommonDriver.get().findElement(OrderConfirmationScreen_OR.ORDERNUMBER_LABEL).isDisplayed();\n\t\tif(flag){\n\t\t\textentLogs.passWithCustom(\"VerifyOrderDetails\", \"OrderNumberLabelIsDisplayed\");\n\t\t}else{extentLogs.fail(\"VerifyOrderDetails\", \"OrderNumberLabelIsNotDisplayed\");}\n\t}else{extentLogs.fail(\"VerifyOrderDetails\", \"PAYMENTCONFIRMATION_LABEL\");}\n\t\n\treturn flag;\n\t}", "@Then(\"^Validate that response contains correct information$\")\n public void validateThatResponseContainsCorrectInformation() {\n id = myResponse.then().extract().path(\"id\").toString();\n System.out.println(\"Wishlist ID is: \" + id);\n }", "private static boolean validAddressREST_Postman() throws JSONException, IOException {\n\t\tOkHttpClient client = new OkHttpClient();\n\n\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n\t\tString state = \"IL\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"AccessRequest\\\": {\\r\\n\\t\\t\\\"UserId\\\": \\\"attarsaaniya\\\",\\r\\n\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\",\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"Password\\\": \\\"Summer2017\\\"\\r\\n\\t},\\r\\n\\t\\\"AddressValidationRequest\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\\"Address\\\": {\\r\\n\\t\\t\\t\\\"StateProvinceCode\\\": \" + state + \",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"PostalCode\\\": \" + zip + \",\\r\\n\\t\\t\\t\\\"City\\\": \" + city + \"\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"Request\\\": {\\r\\n\\t\\t\\t\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\": \"\n\t\t\t\t+ \"\\\"mycustomer\\\"\\r\\n\\t\\t\\t},\\r\\n\\t\\t\\t\\\"RequestAction\\\": \\\"AV\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://wwwcie.ups.com/rest/AV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\t\tJSONObject jResp = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResp);\n\t\t\n\t\t// there shoudl be a better way to parse through the tree tbh\n\t\t// but this seems intuitive enough to do (though so extra) \n\t\tJSONObject addrValResp = jResp.getJSONObject(\"AddressValidationResponse\");\n\t\tJSONObject addrVal = addrValResp.getJSONObject(\"AddressValidationResult\");\n\t\tJSONObject addr = addrVal.getJSONObject(\"Address\");\n\t\tString cityResponse = addr.getString(\"City\");\n\t\tString stateResponse = addr.getString(\"StateProvinceCode\");\n\t\t\n\t\tString zipResponse = addrVal.getString(\"PostalCodeLowEnd\");\n\t\t\n\t\t\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n//\t\tString success = addrVal\n\t\t\n\t\treturn false;\n\t}", "boolean hasTxnresponse();", "public void receiveResultorder_chk_verify(\n com.xteam.tourismpay.PFTMXStub.Order_chk_verifyResponse result) {\n }", "private static boolean validAddress2() throws IOException, JSONException {\n\n\t\tOkHttpClient client = new OkHttpClient();\n\t\t\n\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n\t\tString state = \"Illinois\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n\t\tString street = \"1741 S Lalonde Ave\";\n\t\tstreet = \"\\\"\" + street + \"\\\"\";\n\t\t\n\t\t// RequestBody b2 = new RequestBody.create(\"application/json\");\n\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"UPSSecurity\\\": {\\r\\n\\t\\t\\\"UsernameToken\\\": {\\r\\n\\t\\t\\t\\\"Username\\\": \"\n\t\t\t\t+ \"\\\"attarsaaniya\\\",\\r\\n\\t\\t\\t\\\"Password\\\": \"\n\t\t\t\t+ \"\\\"Summer2017\\\"\\r\\n\\t\\t},\\r\\n\\t\\t\\\"ServiceAccessToken\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\"\\r\\n\\t\\t}\\r\\n\\t},\"\n\t\t\t\t+ \"\\r\\n\\t\\\"XAVRequest\\\": {\\r\\n\\t\\t\\\"Request\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"RequestOption\\\": \\\"1\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\":\"\n\t\t\t\t+ \" \\\"Your Customer Context\\\"\\r\\n\\t\\t\\t}\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"MaximumListSize\\\": \\\"10\\\",\\r\\n\\t\\t\\\"AddressKeyFormat\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"ConsigneeName\\\": \\\"Consignee Name\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"BuildingName\\\": \\\"Building Name\\\",\\r\\n\\t\\t\\t\\\"AddressLine\\\": \"\n\t\t\t\t+ street + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision2\\\": \"\n\t\t\t\t+ city + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision1\\\": \"\n\t\t\t\t+ state + \" ,\\r\\n\\t\\t\\t\\\"PostcodePrimaryLow\\\":\"\n\t\t\t\t+ zip + \",\\r\\n\\t\\t\\t\\\"CountryCode\\\": \\\"US\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://onlinetools.ups.com/rest/XAV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\n\t\tJSONObject jResponse = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResponse);\n\n\t\tJSONObject xavResponse = jResponse.getJSONObject(\"XAVResponse\");\n\t\tJSONObject response5 = xavResponse.getJSONObject(\"Response\");\n\t\tJSONObject respStatus = response5.getJSONObject(\"ResponseStatus\");\n\t\tString desc = respStatus.getString(\"Description\");\n\t\t\n\t\t// check desc == \"Success\"\n\t\t// check if this matches city/state/zip from other api\n\n\t\tSystem.out.println(desc);\n\t\tJSONObject candidate = xavResponse.getJSONObject(\"Candidate\");\n\t\tJSONObject addrKeyFormat = candidate.getJSONObject(\"AddressKeyFormat\");\n\t\tString addrResponse = addrKeyFormat.getString(\"AddressLine\");\n\t\tString cityResponse = addrKeyFormat.getString(\"PoliticalDivision2\");\n\t\tString stateResponse = addrKeyFormat.getString(\"PoliticalDivision1\");\n\t\tString zipResponse = addrKeyFormat.getString(\"PostcodePrimaryLow\");\n\t\t\n\t\tSystem.out.println(addrResponse);\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n\t\treturn false;\n\t}", "boolean hasResponseAddress();", "private SpeechletResponse bankAddressResponse() {\n\n Place place = getPlaceWithOpeningHours();\n\n if (place == null) {\n log.error(\"No place was found! Your address: \" + deviceAddress.toString());\n return getAskResponse(BANK_CONTACT_CARD, ERROR_TEXT);\n }\n\n return doBankAddressResponse(place);\n }", "ResponseEntity<?> verifyOtp(HttpServletRequest request, HttpServletResponse response);", "public void verifyOTP() {\n HashMap<String, String> commonParams = new CommonParams.Builder()\n .add(AppConstant.KEY_COUNTRY_CODE, mCountryCode)\n .add(AppConstant.KEY_PHONE, mPhoneno)\n .add(AppConstant.KEY_OTP, mOTP).build().getMap();\n ApiInterface apiInterface = RestClient.getApiInterface();\n apiInterface.userVerifyOTP(\"bearer\" + \" \" + CommonData.getAccessToken(), commonParams)\n .enqueue(new ResponseResolver<CommonResponse>(OtpActivity.this, true, true) {\n @Override\n public void success(final CommonResponse commonResponse) {\n Log.d(\"debug\", commonResponse.getMessage());\n\n }\n\n @Override\n public void failure(final APIError error) {\n Log.d(\"debug\", error.getMessage());\n\n }\n });\n }", "private void checkManualPlaceDetails() {\n // now in DetailActivity, check the name and address are correct\n onView(withId(R.id.et_name)).check(matches(withText(PLACE_NAME)));\n onView(withId(R.id.et_address)).check(matches(withText(PLACE_ADDRESS)));\n\n checkManualVisit();\n\n // scroll to notes EditText\n onView(withId(R.id.et_notes))\n .perform(scrollTo());\n onView(withId(R.id.et_notes)).check(matches(isDisplayed()));\n // check notes displays correct text\n onView(withId(R.id.et_notes)).check(matches(withText(NOTES)));\n\n // go back\n Espresso.pressBack();\n }", "public void verifyRespStatus(OCSPResp resp) throws OCSPException\n {\n String statusInfo = \"\";\n if (resp != null)\n {\n int status = resp.getStatus();\n switch (status)\n {\n case OCSPResponseStatus.INTERNAL_ERROR:\n statusInfo = \"INTERNAL_ERROR\";\n LOG.error(\"An internal error occurred in the OCSP Server!\");\n break;\n case OCSPResponseStatus.MALFORMED_REQUEST:\n // This happened when the \"critical\" flag was used for extensions\n // on a responder known by the committer of this comment.\n statusInfo = \"MALFORMED_REQUEST\";\n LOG.error(\"Your request did not fit the RFC 2560 syntax!\");\n break;\n case OCSPResponseStatus.SIG_REQUIRED:\n statusInfo = \"SIG_REQUIRED\";\n LOG.error(\"Your request was not signed!\");\n break;\n case OCSPResponseStatus.TRY_LATER:\n statusInfo = \"TRY_LATER\";\n LOG.error(\"The server was too busy to answer you!\");\n break;\n case OCSPResponseStatus.UNAUTHORIZED:\n statusInfo = \"UNAUTHORIZED\";\n LOG.error(\"The server could not authenticate you!\");\n break;\n case OCSPResponseStatus.SUCCESSFUL:\n break;\n default:\n statusInfo = \"UNKNOWN\";\n LOG.error(\"Unknown OCSPResponse status code! \" + status);\n }\n }\n if (resp == null || resp.getStatus() != OCSPResponseStatus.SUCCESSFUL)\n {\n throw new OCSPException(\"OCSP response unsuccessful, status: \" + statusInfo);\n }\n }", "public Map<String, String> createOrder(boolean debug) throws IOException {\n Map<String, String> map = new HashMap<>();\n OrdersCreateRequest request = new OrdersCreateRequest();\n request.prefer(\"return=representation\");\n request.requestBody(buildRequestBody());\n //3. Call PayPal to set up a transaction\n HttpResponse<Order> response = client().execute(request);\n System.out.println(\"Response: \" + response.toString());\n // if (true) {\n if (response.statusCode() == 201) {\n System.out.println(\"Status Code: \" + response.statusCode());\n System.out.println(\"Status: \" + response.result().status());\n System.out.println(\"Order ID: \" + response.result().id());\n System.out.println(\"Intent: \" + response.result().intent());\n System.out.println(\"Links: \");\n for (LinkDescription link : response.result().links()) {\n System.out.println(\"\\t\" + link.rel() + \": \" + link.href() + \"\\tCall Type: \" + link.method());\n }\n System.out.println(\"Total Amount: \" + response.result().purchaseUnits().get(0).amount().currencyCode()\n + \" \" + response.result().purchaseUnits().get(0).amount().value());\n\n\n map.put(\"statusCode\" , response.statusCode()+\"\");\n map.put(\"status\" , response.result().status());\n map.put(\"orderID\" , response.result().id());\n\n //return response.result().id();\n } else {\n System.out.println(\"Response: \" + response.toString());\n map.put(\"Reponse\",response.toString());\n //return response.toString();\n }\n\n return map;\n //}\n }", "public static void verifyOrderIsPlaced(long expectedId, long expectedPetId, int expectedQuantity, String expectedShipDate, String expectedStatus, boolean expectedCompleted) {\n Response response = GetStoreOrderServiceHandler.getStoreOrderServiceCall(expectedId);\n GetStoreOrderServiceHandler.verifyGetStoreOrderResponse(response, expectedId, expectedPetId, expectedQuantity, expectedShipDate, expectedStatus, expectedCompleted);\n }", "public boolean validateReponse(Response response, int id,int which)\n {\n return response.isSuccessful();\n }", "@Test\n\tpublic void requestDataForCustomer12212_checkAddressCity_expectBeverlyHills() {\n\n\t\tgiven().\n\t\t\tspec(requestSpec).\n\t\twhen().\n\t\tthen();\n\t}", "protected abstract boolean isResponseValid(SatelMessage response);", "@Test\n\tpublic void verifyflightNumber() {\n\t\tJsonPath path = new JsonPath(response.getBody().asString());\n\t\tAssert.assertEquals(path.getString(\"flight_number\"), \"102\");\n\t}", "public void receiveResultgetOrderDetailInfo(\n com.speed.esalDemo.generation.OrderServiceImplServiceStub.GetOrderDetailInfoResponseE result\n ) {\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 }", "public void verifyBillingWithDeliveryAddress(){\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Both Billing and Delivery address should be same\");\r\n\t\ttry{\r\n\t\t\tString BillingAddress = driver.findElement(locator_split(\"txtBillingAddress\")).getText().toString();\r\n\t\t\tclick(locator_split(\"btnDeliverytab\"));\r\n\t\t\tString DeliveryAddress = driver.findElement(locator_split(\"txtDeliveryAddress\")).getText().toString();\r\n\t\t\tif(BillingAddress.equals(DeliveryAddress)){\r\n\t\t\t\tSystem.out.println(\"Both Billing and Delivery address are same\");\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- Both Billing and Delivery address are same\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tReporter.log(\"FAIL_MESSAGE:- Billing and Delivery address are not same\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Element \"+elementProperties.getProperty(\"txtBillingAddress\")+\" \"+elementProperties.getProperty(\"txtDeliveryAddress\")+\" \"+elementProperties.getProperty(\"btnDeliverytab\"));\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtAddtoCartPage\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\t}", "public void placeOrder() {\n String url = APIBaseURL.placeOrder + SaveSharedPreference.getLoggedInUserEmail(ConsumerCheckOutActivity.this);\n\n CustomVolleyRequest stringRequest = new CustomVolleyRequest(Request.Method.GET, url, new Response.Listener<String>() {\n @Override\n public void onResponse(String response) {\n\n isOrderPlacedAPI = true;\n try {\n JSONObject jsonObject = new JSONObject(response);\n JSONObject dataObject = jsonObject.getJSONObject(\"data\");\n orderNumber = dataObject.optString(\"orderId\");\n\n if((offlineDelivery.isChecked())&&(offlinePayment.isChecked()))\n {\n Globaluse.orderInvoiceNo_str=orderNumber;\n\n }else\n {\n Intent intent = new Intent(ConsumerCheckOutActivity.this, CashFreePaymentWebActivity.class);\n intent.putExtra(\"paymentLink\", dataObject.optString(\"paymentLink\"));\n startActivityForResult(intent, 103);\n\n }\n\n // Globaluse.orderInvoiceNo_str=orderNumber;\n\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n if (error instanceof AuthFailureError) {\n //TODO\n ViewGroup viewGroup = ConsumerCheckOutActivity.this.findViewById(android.R.id.content);\n\n //then we will inflate the custom alert dialog xml that we created\n View dialogView = LayoutInflater.from(ConsumerCheckOutActivity.this).inflate(R.layout.access_token_expired_dialog, viewGroup, false);\n\n Button buttonreset = dialogView.findViewById(R.id.buttonreset);\n Button buttonOk = dialogView.findViewById(R.id.buttonOk);\n ImageView closeBtn = dialogView.findViewById(R.id.closeBtn);\n\n //Now we need an AlertDialog.Builder object\n android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(ConsumerCheckOutActivity.this);\n\n //setting the view of the builder to our custom view that we already inflated\n builder.setView(dialogView);\n\n //finally creating the alert dialog and displaying it\n android.app.AlertDialog alertDialog = builder.create();\n\n\n buttonOk.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n alertDialog.dismiss();\n ConsumerMainActivity.logout();\n\n }\n });\n\n closeBtn.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n alertDialog.dismiss();\n\n }\n });\n\n buttonreset.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n alertDialog.dismiss();\n }\n });\n alertDialog.setCanceledOnTouchOutside(false);\n alertDialog.show();\n } else if (error instanceof NetworkError) {\n Toast.makeText(consumerCheckOutActivity, \"Cannot connect to Internet...Please check your connection!\", Toast.LENGTH_SHORT).show();\n }\n }\n }, consumerCheckOutActivity);\n ApplicationController.getInstance().addToRequestQueue(stringRequest, \"place_order_taq\");\n\n }", "void addPlaceAPI() {\n RestAssured.baseURI = \"https://rahulshettyacademy.com/\";\n String response = given().log().all().queryParam(\"key\",\"qaclick123\")\n .header(\"Content-Type\",\"application/json\")\n\n .body(Payloads.addPlaceJson())\n .when().post(\"maps/api/place/add/json\")\n .then().log().all().assertThat().statusCode(200).body(\"scope\",equalTo(\"APP\"))\n .header(\"server\",\"Apache/2.4.18 (Ubuntu)\").extract().response().asString();\n System.out.println(\"the response is\" + response );\n JsonPath jsonpath = new JsonPath(response); // for parsing the json body/payload\n String OriginalpalaceId = jsonpath.getString(\"place_id\");\n System.out.println(\"the place id is\" + OriginalpalaceId );\n\n // update the address using original place id\n\n String updateResponse = given().log().all().queryParam(\"key\",\"qaclick123\")\n .header(\"Content-Type\",\"application/json\")\n .body(\"{\\n\" +\n \"\\\"place_id\\\":\\\"\"+ OriginalpalaceId + \"\\\",\\n\" +\n \"\\\"address\\\":\\\"70 Summer walk, USA\\\",\\n\" +\n \"\\\"key\\\":\\\"qaclick123\\\"\\n\" +\n \"}\")\n .when().put(\"maps/api/place/update/json\")\n .then().log().all().assertThat().statusCode(200).body(\"msg\",equalTo(\"Address successfully updated\"))\n .extract().response().asString();\n jsonpath = null;\n jsonpath = new JsonPath(updateResponse);\n String msg = jsonpath.getString(\"msg\");\n System.out.println(\"the successful msg is \" + msg );\n\n // now getPlace API call to get the updated Place Id\n\n String getResponse = given().log().all().queryParam(\"key\",\"qaclick123\")\n .queryParam(\"place_id\",OriginalpalaceId)\n .when().get(\"maps/api/place/get/json\")\n .then().log().all().assertThat().statusCode(200).extract().response().asString();\n\n jsonpath = null;\n jsonpath = new JsonPath(getResponse);\n System.out.println(jsonpath.getString(\"address\"));\n System.out.println(\"the response of the get API method \"+ getResponse);\n\n Assert.assertEquals(jsonpath.getString(\"address\"),\"70 Summer walk, USA\",\"Address not matched\" );\n\n }", "public void VerifyBillingAddress(String billingaddresstitle, String billingaddress){\r\n\t\tString BilingTitle=getValue(billingaddresstitle);\r\n\t\tString Billingaddress=getValue(billingaddress);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Billing address and title should be present\");\r\n\r\n\t\ttry{\r\n\t\t\tif(getAndVerifyPartialText(locator_split(\"txtCheckoutBillingAddressTitle\"), BilingTitle)){\r\n\t\t\t\tSystem.out.println(\"Billing address title is present \"+getText(locator_split(\"txtCheckoutBillingAddressTitle\")));\r\n\t\t\t}else{\r\n\t\t\t\tthrow new Error(\"Billing address title is not present\");\r\n\t\t\t}\r\n\t\t\tif(getAndVerifyPartialText(locator_split(\"txtCheckoutBillingAddress\"), Billingaddress)){\r\n\t\t\t\tSystem.out.println(\"Billing address is present \"+getText(locator_split(\"txtCheckoutBillingAddress\")));\r\n\t\t\t}else{\r\n\t\t\t\tthrow new Error(\"Billing address is not present\");\r\n\t\t\t}\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Billing address and title are present\");\r\n\r\n\t\t}catch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Element is not present\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCheckoutBillingAddressTitle\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCheckoutBillingAddress\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\t\tcatch (Error e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Billing title or address is not present\");\r\n\t\t\tthrow new Error(\"Billing address is not present\");\r\n\r\n\t\t}\r\n\t}", "@Then(\"verify place created maps to {string} using {string}\")\r\n\tpublic void verify_place_created_maps_to_using(String expectedName, String resource) throws IOException {\n\t\tjs=new JsonPath(responseJson.asString());\r\n\t\tPlaceId=js.get(\"place_id\");\r\n\t\tSystem.out.println(\"Place id created is= \"+PlaceId);\r\n\t\treqspec=given().log().all().spec(RequestSpecs()).queryParam(\"place_id\", PlaceId);\r\n\t\t//reusing existing method from above\r\n\t\tuser_calls_with_https_request(resource, \"GET\");\r\n\t\tjs=new JsonPath(responseJson.asString());\r\n\t\tSystem.out.println(\"name fetched from GetAPI response= \"+js.get(\"name\"));\r\n\t\tSystem.out.println(\"name that got added by AddPlaceAPI= \"+expectedName);\r\n\t\tassertEquals(expectedName,js.get(\"name\"));\r\n\r\n\t}", "@Test\n public void testPostCartsIdBillingaddressAction() throws ClientException, IOException, ProcessingException {\n CloudResponse response = this.actions.postCartsIdBillingaddressAction(\"{id}\", \"{body}\");\n List<Integer> expectedResults = Arrays.asList(200, 400, 403, 404);\n LOG.info(\"Got status {}\", response.getStatusLine());\n Assert.assertTrue(expectedResults.contains(response.getStatusLine().getStatusCode()));\n\n if(response.getStatusLine().getStatusCode() == 200) {\n this.actions.checkResponseJSONSchema(\"#/definitions/Cart\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 400) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 403) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 404) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n \n }", "private void validateSpecificationOrder(HttpServletRequest request,\n HttpServletResponse response,\n PrintWriter out) throws Exception{\n\n NewOrderService objOrderServiceSpec = new NewOrderService();\n HashMap objHashMap = null;\n\n String strCodigoCliente = \"\",\n strSpecification = \"\";\n\n strCodigoCliente = request.getParameter(\"txtCompanyId\");\n strSpecification = request.getParameter(\"cmbSubCategoria\");\n\n long an_customerid = MiUtil.parseLong(strCodigoCliente);\n long an_specification = MiUtil.parseLong(strSpecification);\n\n objHashMap = objOrderServiceSpec.getAllowedSpecification(an_specification, an_customerid);\n\n if( objHashMap.get(\"strMessage\") != null ){\n throw new UserException((String)objHashMap.get(\"strMessage\"));\n }\n\n }", "boolean hasOrderId();", "boolean hasOrderId();", "private void fireOrderValidityCheck() {\n ordersDatabaseReference.child(eventUid).child(order.getUid()).addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n if (dataSnapshot.exists() && (dataSnapshot.getValue() != null)) {\n order = dataSnapshot.getValue(Order.class);\n\n // We check if by the time the user finished entering his details the order has become invalid\n // If so, we send him back to main activity\n if (order.getStatusAsEnum() == DataUtils.OrderStatus.CANCELLED) {\n progressDialog.dismiss();\n onOrderExpired();\n }\n // Otherwise continue the order process\n else {\n fireCreditCardTokenCreation();\n }\n }\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {}\n });\n }", "private String parseSOAPResponse(SoapObject response) {\n\n\t\tString isSuccess =response.getPrimitivePropertySafelyAsString(\"UpdateStundentDetailsResult\");\n\t\t\n\t\treturn isSuccess;\n\t}", "@Test\n public void testValidateNewOrderState() throws Exception {\n\n Order order3 = new Order(\"003\");\n order3.setCustomerName(\"Paul\");\n order3.setState(\"Ky\");\n order3.setTaxRate(new BigDecimal(\"6.75\"));\n order3.setArea(new BigDecimal(\"5.00\"));\n order3.setOrderDate(\"Date_Folder_Orders/Orders_06232017.txt\");\n order3.setProductName(\"tile\");\n order3.setMatCostSqFt(new BigDecimal(\"5.50\"));\n order3.setLaborCostSqFt(new BigDecimal(\"6.00\"));\n order3.setMatCost(new BigDecimal(\"50.00\"));\n order3.setLaborCost(new BigDecimal(\"500.00\"));\n order3.setOrderTax(new BigDecimal(\"50.00\"));\n order3.setTotalOrderCost(new BigDecimal(\"30000.00\"));\n\n assertEquals(true, service.validateNewOrderState(order3));\n }", "@GET\n\t @Produces(MediaType.APPLICATION_JSON)\n\t public String checkLocationValidity(@QueryParam(\"address\") String addr) {\n\t\t String response;\n\t\t if(checkaddress(addr)) {\n\t\t\t //obj.put(\"Location\", \"Office\");\n\t\t\t response = ConstructJSON.constructJSON(\"Yes Office\", true);\n\t\t } else {\n\t\t\t //obj.put(\"location\", \"not office\");\n\t\t\t response = ConstructJSON.constructJSON(\"NOT Office\", false);\n\t\t }\n\t\t System.out.println(\"----*****-----\"+response);\n\t return response;\n\t }", "public boolean validateResponse(Response response) {\n return response.isSuccessful();\n }", "private void verifyOcspResponse(OCSPResp ocspResponse)\n throws OCSPException, RevokedCertificateException, IOException\n {\n verifyRespStatus(ocspResponse);\n\n BasicOCSPResp basicResponse = (BasicOCSPResp) ocspResponse.getResponseObject();\n if (basicResponse != null)\n {\n ResponderID responderID = basicResponse.getResponderId().toASN1Primitive();\n // https://tools.ietf.org/html/rfc6960#section-4.2.2.3\n // The basic response type contains:\n // (...)\n // either the name of the responder or a hash of the responder's\n // public key as the ResponderID\n // (...)\n // The responder MAY include certificates in the certs field of\n // BasicOCSPResponse that help the OCSP client verify the responder's\n // signature.\n X500Name name = responderID.getName();\n if (name != null)\n {\n findResponderCertificateByName(basicResponse, name);\n }\n else\n {\n byte[] keyHash = responderID.getKeyHash();\n if (keyHash != null)\n {\n findResponderCertificateByKeyHash(basicResponse, keyHash);\n }\n else\n {\n throw new OCSPException(\"OCSP: basic response must provide name or key hash\");\n }\n }\n\n if (ocspResponderCertificate == null)\n {\n throw new OCSPException(\"OCSP: certificate for responder \" + name + \" not found\");\n }\n\n try\n {\n SigUtils.checkResponderCertificateUsage(ocspResponderCertificate);\n }\n catch (CertificateParsingException ex)\n {\n // unlikely to happen because the certificate existed as an object\n LOG.error(ex, ex);\n }\n checkOcspSignature(ocspResponderCertificate, basicResponse);\n\n boolean nonceChecked = checkNonce(basicResponse);\n\n SingleResp[] responses = basicResponse.getResponses();\n if (responses.length != 1)\n {\n throw new OCSPException(\n \"OCSP: Received \" + responses.length + \" responses instead of 1!\");\n }\n\n SingleResp resp = responses[0];\n Object status = resp.getCertStatus();\n\n if (!nonceChecked)\n {\n // https://tools.ietf.org/html/rfc5019\n // fall back to validating the OCSPResponse based on time\n checkOcspResponseFresh(resp);\n }\n\n if (status instanceof RevokedStatus)\n {\n RevokedStatus revokedStatus = (RevokedStatus) status;\n if (revokedStatus.getRevocationTime().compareTo(signDate) <= 0)\n {\n throw new RevokedCertificateException(\n \"OCSP: Certificate is revoked since \" +\n revokedStatus.getRevocationTime(),\n revokedStatus.getRevocationTime());\n }\n LOG.info(\"The certificate was revoked after signing by OCSP \" + ocspUrl + \n \" on \" + revokedStatus.getRevocationTime());\n }\n else if (status != CertificateStatus.GOOD)\n {\n throw new OCSPException(\"OCSP: Status of Cert is unknown\");\n }\n }\n }", "private String validateValidResponse(Response response) {\n\n\t\t\n\t\tlogger.debug(response.getBody().asString());\n\t\tlogger.debug(response.body().asString());\n\t\t\n\t\treturn response.body().asString();\n\t}", "public static boolean verifyOrderSummaryEmail(String xpath, List<Param> params) throws Exception {\n boolean flag = false;\n try {\n\t\t\t\t\tThread.sleep(40000);\n\t\t\t\t\t String orderSummery = GmailUtility.getOrderHistoryEmailDetails(params.get(0).getValue(), params.get(1).getValue());\n\t\t\t\t\t //String orderSummery = GmailUtility.getOrderHistoryEmailDetails(\"efaretesting55@gmail.com\", \"Orange@5\");\n\t\t\t\t\t //if (orderSummery.contains(\"3473\") && orderSummery.contains(\"raj kumar\"))\n\t\t\t\t\t \n\t\t\t\t\t System.out.println(\"Date in Email:\" + catchingInfo.get(\"Date\") + \":OrderID in Email:\" + catchingInfo.get(\"OrderId\"));\n\t\t\t\t\t if (orderSummery.contains(catchingInfo.get(\"Date\")) && orderSummery.contains(catchingInfo.get(\"OrderId\")))\n\t\t\t\t\t flag = true;\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\tSystem.out.println(\"Exception was raised in verifyOrderSummaryEmail method and the exception is :\"+e);\n\t\t\t\t\tflag=false;\n\t\t\t\t}\n return flag;\n }", "@Test\n public void enterOrderWithUnmatchedActiveOrder() throws Exception {\n LimitOrderRequest limitOrderRequest = getLimitOrderRequest(Direction.BUY);\n LimitOrder referenceLimitOrder = getLimitOrder();\n String orderRequestJsonString = jsonMapper.writeValueAsString(limitOrderRequest);\n\n //When: the order is posted to the service\n MvcResult postResponse = performEnterOrderPostRequest(orderRequestJsonString);\n\n OrderRequestResponse response = jsonMapper\n .readValue(postResponse.getResponse().getContentAsString(), OrderRequestResponse.class);\n Assert.assertEquals(\"Response should be successful\", ResponseType.SUCCESS,\n response.getResponseType());\n\n MvcResult getResponse = mvc.perform(get(\"/status\")\n .contentType(MediaType.APPLICATION_JSON))\n .andReturn();\n\n PublicMarketStatus status = jsonMapper\n .readValue(getResponse.getResponse().getContentAsString(), PublicMarketStatus.class);\n\n //Then: the order is entered correctly in to the market\n List<Ticker> tickers = status.getOrders();\n Assert.assertEquals(\"There is a ticker\", 1, tickers.size());\n Ticker ticker = tickers.get(0);\n Assert.assertEquals(\"Ticker name is correct\", limitOrderRequest.getTicker(), ticker.getName());\n Assert.assertTrue(\"Order is not in wrong queue\", ticker.getSell().isEmpty());\n Assert.assertEquals(\"Order is in right queue\", 1, ticker.getBuy().size());\n AbstractActiveOrder order = ticker.getBuy().get(0);\n Assert.assertEquals(\"Order is correct one\", referenceLimitOrder, order);\n\n }", "public static void main(String[] args) {\n\t\tRestAssured.baseURI=\"https://rahulshettyacademy.com\";\n\t\tString response=given().log().all().queryParam(\"key\",\"qaclick123\").header(\"Content-Type\",\"application/json\")\n\t\t.body(Paylod.Addplace()).when().post(\"maps/api/place/add/json\")\n\t\t.then().assertThat().statusCode(200).body(\"scope\", equalTo(\"APP\")).\n\t\theader(\"Server\",\"Apache/2.4.18 (Ubuntu)\").extract().response().asString();\n\t\t\n\t\tSystem.out.println(response);\n\t\tJsonPath jsonparse =jsonParsing.inputToJson(response);\n\t\t//JsonPath jsonparse = new JsonPath(response);\n\t\tString placeID=jsonparse.getString(\"place_id\");\n\t\tSystem.out.println(placeID);\n\t\tSystem.out.println(\"-----------------End of Add API Test----------------------------------------\");\n\t\t\n//update the place added with new address - automation PUT (update place) API\n\t\t\n\t\t\n\t\tString newAddress = \"170 IndraNagar,IND\";\n\n\t\tgiven().log().all().queryParam(\"key\", \"qaclick123\").header(\"Content-Type\",\"application/json\")\n\t\t.body(\"{\\r\\n\" + \n\t\t\t\t\"\\\"place_id\\\":\\\"\"+placeID+\"\\\",\\r\\n\" + \n\t\t\t\t\"\\\"address\\\":\\\"\"+newAddress+\"\\\",\\r\\n\" + \n\t\t\t\t\"\\\"key\\\":\\\"qaclick123\\\"\\r\\n\" + \n\t\t\t\t\"}\\r\\n\" + \"\").when().put(\"maps/api/place/update/json\")\n\t\t.then().log().all().assertThat().statusCode(200).body(\"msg\", equalTo(\"Address successfully updated\"));\n\t\tSystem.out.println(\"-----------------End of Update API Test----------------------------------------\");\n\t\t\n\t\t// GetAPI to get the place to see if new address is added to the Place\n\t\tString newPlace=given().log().all().queryParam(\"key\", \"qaclick123\").queryParam(\"place_id\", placeID)\n\t\t.when().get(\"/maps/api/place/get/json\")\n\t\t.then().log().all().assertThat().statusCode(200).extract().response().asString();\n\t\t\n\t\t\n\t\tJsonPath jsparse =jsonParsing.inputToJson(newPlace);\n\t\t//JsonPath jsparse = new JsonPath(newPlace);\n\t\tString actualAddress=jsparse.getString(\"address\");\n\t\tSystem.out.println(actualAddress);\n\t\t//cucumber junit , testng testing framework - to add assertions -we have to use one of this frmwork,\n\t\t//since in java we do not have such assertion scenarios\n\t\tAssert.assertEquals(actualAddress,newAddress);\n\t\t\n\t\t\n\t\t\n\t}", "@Test\n\tpublic void requestDataForCustomer12212_checkResponseCode_expect200() {\n\n\t\tgiven().\n\t\t\tspec(requestSpec).\n\t\twhen().\n\t\tthen();\n\t}", "@Test\n\tpublic void getDeZipCode24848_checkThirdPlaceInList_expectKropp() {\n\n\t\tgiven().\n\t\t\tspec(requestSpec).\n\t\twhen().\n\t\t\t\tget().\n\t\tthen();\n\t}", "@Test\n public void testDAM32001002() {\n // Index page\n DAM3IndexPage dam3IndexPage = new DAM3IndexPage(driver);\n\n OrderMB3PageListPage orderMB3PageListPage = dam3IndexPage\n .dam32001002Click();\n\n orderMB3PageListPage.checkITM0000001();\n\n orderMB3PageListPage = orderMB3PageListPage.clickItemCodeSearch();\n\n String expectedOrdeDetails = \"Order accepted, ITM0000001\\nITM0000002, Orange juice\\nNotePC, CTG0000001\\nCTG0000002, Drink\\nPC, dummy7\";\n\n // get the details of the specified order in a single string\n String actualOrderDetails = orderMB3PageListPage.getOrderDetails(7);\n\n assertThat(actualOrderDetails, is(expectedOrdeDetails));\n\n expectedOrdeDetails = \"Order accepted, ITM0000001, Orange juice, CTG0000001, Drink, dummy4\";\n actualOrderDetails = orderMB3PageListPage.getOrderDetails(4);\n assertThat(actualOrderDetails, is(expectedOrdeDetails));\n }", "public void receiveResultuPD_Order_Print_Status(\n com.xteam.tourismpay.PFTMXStub.UPD_Order_Print_StatusResponse result) {\n }", "public interface PlaceService {\n\n @FormUrlEncoded\n @POST(\"order/create_order.html\")\n @DataKey(\"\")\n @DataChecker\n @DataPaser\n @AutoShowLogin\n Observable<JsonRetEntity<PayOrderInfo>>\n create_order(\n @Field(\"commodity\") String commodityId,\n @Field(\"orderType\") String orderType,\n @Field(\"payType\") String payType\n );\n\n /**\n * 3.3 订单支付结果(√)\n * 接口描述:支付完成后,APP轮询获取订单状态 ,订单流程第三步\n * 接口地址:/order/place/pay_result.html\n * 接口参数:\n * <p/>\n * 字段\t字段名称\t类型\t非空\t描述\n * orderId\t订单号\tLong\t是\n * {\n *\n * @param orderId\n * @return\n */\n @FormUrlEncoded\n @POST(\"order/pay_result.html\")\n @DataKey(\"\")\n @DataChecker(ValidPayResultChecker.class)\n @DataPaser\n @AutoShowLogin\n Observable<JsonRetEntity<PayResultEntity>>\n pay_result(\n @Field(\"orderId\") String orderId\n );\n}", "public void VerifyRecapBillinfo(){\r\n\t\tString BillingName = getValue(\"FirstName\")+\" \"+getValue(\"LastName\");\r\n\t\tString Companyname = getValue(\"CompanyName\");\r\n\t\tString Address = getValue(\"Address\");\r\n\t\tString ZipCity = getValue(\"Zip\")+\" , \"+getValue(\"City\");\r\n\t\tString CardType= getValue(\"CardType\");\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- shopping cart image link should be clicked\");\r\n\r\n\r\n\t\ttry{\r\n\t\t\tString[] BD=getWebTableData(locator_split(\"txtRecapBillinfo\"), locator_split(\"txtRecapBillinfodata\"));\r\n\t\t\tif(BD[1].equalsIgnoreCase(BillingName)&&BD[2].equalsIgnoreCase(Companyname)\r\n\t\t\t\t\t&&BD[3].equalsIgnoreCase(Address)&&BD[5].equalsIgnoreCase(ZipCity)\r\n\t\t\t\t\t&&BD[6].contains(CardType)){\r\n\t\t\t\tSystem.out.println(\"The data from Web matches with Excel Registration data\");\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- The data from Web matches with Excel Registration data\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tReporter.log(\"FAIL_MESSAGE:- The data from Web dosent match with Excel Registration data\");\r\n\t\t\t\tthrow new Exception(\"The data from Web dosent match with Excel Registration data\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- shopping cart image link is not clicked \");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtRecapBillinfo\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtRecapBillinfodata\")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\r\n\t}", "@Override\r\n\tpublic String checkOrder(String userId, List<String> placeIds) {\n\r\n\t\treturn null;\r\n\t}", "@Then(\"the Booking page shows correct booking details\")\n public void bookingpage_verify_booking_details(){\n }", "@PostMapping(\"/validate\")\r\n\tpublic ValidateOrderResponse validate(@RequestBody ValidateOrderRequest validateOrderRequest) {\n\t\tString updatedGSXML = validateOrderRequest.getInputDoc().replaceAll(\"xmlns=\\\\\\\"\\\\\\\"\", \"\");\r\n\r\n\t\tBiztalk1 gsxml = XmlObjectUtil.getGSXMLObjFromXML(updatedGSXML);\r\n\r\n\t\tValidateOrderResponse validateOrderResponse = new ValidateOrderResponse();\r\n\r\n\t\t// logic to validate gsxml starts here\r\n\r\n\t\t// logic to validate gsxml ends here\r\n\t\t\r\n\t\tif(isValidCustomer(gsxml))\r\n\t\t{\r\n\t\t\tvalidateOrderResponse.setOutputDoc(XmlObjectUtil.getXMLStringFromGSXMLObj(gsxml));\r\n\t\t\tvalidateOrderResponse.setStatusCode(\"200\");\r\n\t\t\tvalidateOrderResponse.setStatusDesc(\"Order validated successfuly\");\r\n\t\t\treturn validateOrderResponse;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t\r\n\t\t\t validateOrderResponse.setStatusDesc(\"Customer Not Found\");\r\n\t\t\t validateOrderResponse.setStatusCode(\"511\");\r\n\t\t\t return validateOrderResponse;\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\t\tRestAssured.baseURI = \"https://rahulshettyacademy.com\";\n\t\tString response = given().log().all().queryParam(\"key\", \"qaclick123\").header(\"Content-Type\", \"application/json\")\n\t\t\t\t.body(payLoad.AddPlace()).when().post(\"maps/api/place/add/json\").then().assertThat().statusCode(200)\n\t\t\t\t.body(\"scope\", equalTo(\"APP\")).header(\"Server\", \"Apache/2.4.18 (Ubuntu)\").extract().response()\n\t\t\t\t.asString();\n\t\t// System.out.println(response);\n\t\tString placeID = ReusableMethods.rawToJson(response, \"place_id\");\n\t\tSystem.out.println(placeID);\t\t\n\t\t\n\t\t// Update place PUT HTTP Method\n\t\tString newAddress = \"Summar Walk, USA\";\n\t\tgiven().log().all().queryParam(\"key\", \"qaclick123\").header(\"Content-Type\", \"application/json\")\n\t\t\t\t.body(\"{\\r\\n\" + \" \\\"place_id\\\": \\\"\" + placeID + \"\\\",\\r\\n\" + \" \\\"address\\\": \\\"\" + newAddress\n\t\t\t\t\t\t+ \"\\\",\\r\\n\" + \" \\\"key\\\": \\\"qaclick123\\\"\\r\\n\" + \"}\")\n\t\t\t\t.when().put(\"maps/api/place/update/json\").then().assertThat().log().all().statusCode(200)\n\t\t\t\t.body(\"msg\", equalTo(\"Address successfully updated\"));\n\t\t// This is body() assertion\n\t\t\n\t\t\n\t\t// Get Place HTTP Method\n\t\tString getPlaceResponse = given().log().all().queryParam(\"key\", \"qaclick123\").queryParam(\"place_id\", placeID)\n\t\t\t\t.when().get(\"maps/api/place/get/json\").then().assertThat().log().all().statusCode(200).extract()\n\t\t\t\t.response().asString();\n\n\t\tString actualAddress = ReusableMethods.rawToJson(getPlaceResponse, \"address\");\n\t\tAssert.assertEquals(actualAddress, newAddress);\n\t\tif (actualAddress.equalsIgnoreCase(newAddress)) {\n\t\t\tSystem.out.println(\"Success...........\");\n\t\t}\n\t}", "boolean isSetIdVerificationResponseData();", "protected void verifyResponseInputModel( String apiName)\n {\n verifyResponseInputModel( apiName, apiName);\n }", "@Test\n\tpublic void AddandDeletePlace() {\n\t\tRestAssured.baseURI = prop.getProperty(\"HOST\");\n\t\tResponse res = given().\n\n\t\t\t\tqueryParam(\"key\", prop.getProperty(\"KEY\")).body(payLoad.getPostData()).when()\n\t\t\t\t.post(resources.placePostData()).then().assertThat().statusCode(200).and().contentType(ContentType.JSON)\n\t\t\t\t.and().body(\"status\", equalTo(\"OK\")).extract().response();\n\t\t// Task 2 - Grab the Place ID from response\n\n\t\tString responseString = res.asString();\n\t\tSystem.out.println(responseString);\n\t\tJsonPath js = new JsonPath(responseString);\n\t\tString placeid = js.get(\"place_id\");\n\t\tSystem.out.println(placeid);\n\n\t\t// Task 3 place this place id in the Delete request\n\t\tgiven().queryParam(\"key\", \"qaclick123\").body(\"{\" + \"\\\"place_id\\\": \\\"\" + placeid + \"\\\"\" + \"}\").when()\n\t\t\t\t.post(\"/maps/api/place/delete/json\").then().assertThat().statusCode(200).and()\n\t\t\t\t.contentType(ContentType.JSON).and().body(\"status\", equalTo(\"OK\"));\n\t}", "public boolean Verify_NonIpoConfirmation() {\n\t\n\tboolean flag = false;\n\tflag=CommonVariables.CommonDriver.get().findElement(OrderConfirmationScreen_OR.THANKYOU_LABEL).isDisplayed();\n\tif(flag){extentLogs.pass(\"VerifyNonIPOConfirmationScreen_ThankYou\", \"DISPLAYED\");\n\t\tflag=CommonVariables.CommonDriver.get().findElement(OrderConfirmationScreen_OR.ORDERRECEIVED_LABEL).isDisplayed();\n\t\tif(flag){extentLogs.pass(\"VerifyNonIPOConfirmationScreen_ORDERRECEIVED_LABEL\", \"DISPLAYED\");\n\t\t\tflag=CommonVariables.CommonDriver.get().findElement(OrderConfirmationScreen_OR.WHATNEXT_SECTION).isDisplayed();\n\t\t\tif(flag){extentLogs.pass(\"VerifyNonIPOConfirmationScreen_WHATNEXT_SECTION\", \"DISPLAYED\");\n\t\t\t\tflag=CommonVariables.CommonDriver.get().findElement(OrderConfirmationScreen_OR.UPONDELIVERY_SECTION).isDisplayed();\n\t\t\t\tif(flag){extentLogs.pass(\"VerifyNonIPOConfirmationScreen_UPONDELIVERY_SECTION\", \"DISPLAYED\");\n\t\t\t\t\tflag=CommonVariables.CommonDriver.get().findElement(OrderConfirmationScreen_OR.STOREDETAILS_CONFIRMATIONSECTION).isDisplayed();\n\t\t\t\t\tif(flag){extentLogs.pass(\"VerifyNonIPOConfirmationScreen_STOREDETAILS_CONFIRMATIONSECTION\", \"DISPLAYED\");\n\t\t\t\t\t\tflag=CommonVariables.CommonDriver.get().findElement(OrderConfirmationScreen_OR.MYSTORE_SECTION).isDisplayed();\n\t\t\t\t\t\tif(flag){extentLogs.pass(\"VerifyNonIPOConfirmationScreen_STOREDETAILS_MYSTORE_SECTION\", \"DISPLAYED\");\n\t\t\t\t\t\t flag=CommonVariables.CommonDriver.get().findElement(OrderConfirmationScreen_OR.GOTOHOMEPAGE_BUTTON).isDisplayed();\n\t\t\t\t\t\t if(flag){extentLogs.pass(\"VerifyNonIPOConfirmationScreen_GOTOHOMEPAGE_BUTTON\", \"DISPLAYED\");\n\t\t\t\t\t\t\t}else{extentLogs.pass(\"VerifyNonIPOConfirmationScreen_GOTOHOMEPAGE_BUTTON\", \"DISPLAYED\");}\n\t\t\t\t\t\t}else{extentLogs.fail(\"VerifyNonIPOConfirmationScreen_STOREDETAILS_MYSTORE_SECTION\", \"NOTDISPLAYED\");}\n\t\t\t\t\t\t}else{extentLogs.fail(\"VerifyNonIPOConfirmationScreen_STOREDETAILS_CONFIRMATIONSECTION\", \"NOTDISPLAYED\");}\n\t\t \t\t}else{extentLogs.fail(\"VerifyNonIPOConfirmationScreen_UPONDELIVERY_SECTION\", \"NOTDISPLAYED\");}\n\t\t\t}else{extentLogs.fail(\"VerifyNonIPOConfirmationScreen_WHATNEXT_SECTION\", \"NOTDISPLAYED\");}\n\t\t}else{extentLogs.fail(\"VerifyNonIPOConfirmationScreen_ORDERRECEIVED_LABEL\", \"NOTDISPLAYED\");}\n\t}else{extentLogs.fail(\"VerifyNonIPOConfirmationScreen_ThankYou\", \"NOTDISPLAYED\");}\n\t\nreturn flag;\n\t}", "@Test\n public void getOrderByIdTest() {\n Long orderId = 10L;\n Order response = api.getOrderById(orderId);\n Assert.assertNotNull(response);\n Assert.assertEquals(10L, response.getId().longValue());\n Assert.assertEquals(10L, response.getPetId().longValue());\n Assert.assertEquals(1, response.getQuantity().intValue());\n\n verify(exactly(1), getRequestedFor(urlEqualTo(\"/store/order/10\")));\n }", "public boolean VerifyOrderConfirmation_ProductDetails() {\n\t\tboolean flag = false;\n\t\t\n\t\tflag=CommonVariables.CommonDriver.get().findElement(OrderConfirmationScreen_OR.PRODUCTIMAGE).isDisplayed();\n\t\tif(flag){extentLogs.pass(\"VerifyProductDetails\", \"ProductDetailsareIsDisplayed\");\n\t }else{extentLogs.fail(\"VerifyProductDetails\", \"ProductDetailsareNotDisplayed\");}\n\t\t\n\t\treturn flag;\n\t}", "private static JSONObject validateStreet(String street, String city, String state, String zip) throws Exception {\n\n\t\tOkHttpClient client = new OkHttpClient();\n\t\t\n//\t\tString city = \"Lombard\";\n\t\tcity = \"\\\"\" + city + \"\\\"\";\n\t\t\n//\t\tString state = \"Illinois\";\n\t\tstate = \"\\\"\" + state + \"\\\"\";\n\t\t\n//\t\tString zip = \"60148\";\n\t\tzip = \"\\\"\" + zip + \"\\\"\";\n\t\t\n//\t\tString street = \"1741 S Lalonde Ave\";\n\t\tstreet = \"\\\"\" + street + \"\\\"\";\n\t\t\n\t\t// RequestBody b2 = new RequestBody.create(\"application/json\");\n\n\t\tMediaType mediaType = MediaType.parse(\"application/json\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"{\\r\\n\\t\\\"UPSSecurity\\\": {\\r\\n\\t\\t\\\"UsernameToken\\\": {\\r\\n\\t\\t\\t\\\"Username\\\": \"\n\t\t\t\t+ \"\\\"attarsaaniya\\\",\\r\\n\\t\\t\\t\\\"Password\\\": \"\n\t\t\t\t+ \"\\\"Summer2017\\\"\\r\\n\\t\\t},\\r\\n\\t\\t\\\"ServiceAccessToken\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"AccessLicenseNumber\\\": \"\n\t\t\t\t+ \"\\\"DD33B9ADDD7ADDC8\\\"\\r\\n\\t\\t}\\r\\n\\t},\"\n\t\t\t\t+ \"\\r\\n\\t\\\"XAVRequest\\\": {\\r\\n\\t\\t\\\"Request\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"RequestOption\\\": \\\"1\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"TransactionReference\\\": {\\r\\n\\t\\t\\t\\t\\\"CustomerContext\\\":\"\n\t\t\t\t+ \" \\\"Your Customer Context\\\"\\r\\n\\t\\t\\t}\\r\\n\\t\\t},\\r\\n\\t\\t\"\n\t\t\t\t+ \"\\\"MaximumListSize\\\": \\\"10\\\",\\r\\n\\t\\t\\\"AddressKeyFormat\\\": \"\n\t\t\t\t+ \"{\\r\\n\\t\\t\\t\\\"ConsigneeName\\\": \\\"Consignee Name\\\",\\r\\n\\t\\t\\t\"\n\t\t\t\t+ \"\\\"BuildingName\\\": \\\"Building Name\\\",\\r\\n\\t\\t\\t\\\"AddressLine\\\": \"\n\t\t\t\t+ street + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision2\\\": \"\n\t\t\t\t+ city + \",\\r\\n\\t\\t\\t\\\"PoliticalDivision1\\\": \"\n\t\t\t\t+ state + \" ,\\r\\n\\t\\t\\t\\\"PostcodePrimaryLow\\\":\"\n\t\t\t\t+ zip + \",\\r\\n\\t\\t\\t\\\"CountryCode\\\": \\\"US\\\"\\r\\n\\t\\t}\\r\\n\\t}\\r\\n}\");\n\t\t\n\t\tRequest request = new Request.Builder().url(\"https://onlinetools.ups.com/rest/XAV\").post(body).build();\n\n\t\tokhttp3.Response response = client.newCall(request).execute();\n\n\t\tJSONObject jResponse = new JSONObject(response.body().string());\n\t\tSystem.out.println(jResponse);\n\n\t\tJSONObject xavResponse = jResponse.getJSONObject(\"XAVResponse\");\n\t\tJSONObject response5 = xavResponse.getJSONObject(\"Response\");\n\t\tJSONObject respStatus = response5.getJSONObject(\"ResponseStatus\");\n\t\tString desc = respStatus.getString(\"Description\");\n\t\t\n\t\t// check desc == \"Success\"\n\t\t// check if this matches city/state/zip from other api\n\n\t\tSystem.out.println(desc);\n\t\tJSONObject candidate = xavResponse.getJSONObject(\"Candidate\");\n\t\tJSONObject addrKeyFormat = candidate.getJSONObject(\"AddressKeyFormat\");\n\t\tString addrResponse = addrKeyFormat.getString(\"AddressLine\");\n\t\tString cityResponse = addrKeyFormat.getString(\"PoliticalDivision2\");\n\t\tString stateResponse = addrKeyFormat.getString(\"PoliticalDivision1\");\n\t\tString zipResponse = addrKeyFormat.getString(\"PostcodePrimaryLow\");\n\t\t\n\t\tSystem.out.println(addrResponse);\n\t\tSystem.out.println(cityResponse);\n\t\tSystem.out.println(stateResponse);\n\t\tSystem.out.println(zipResponse);\n\n\t\treturn addrKeyFormat;\n\t}", "@Override\r\n public void onSuccess(OrderProxy response)\r\n {\n }", "@Override\r\n public void onSuccess(OrderProxy response)\r\n {\n }", "private boolean validate(Map<String,String> requestMap){\r\n\t\tboolean result = false;\r\n\t\tString zip = requestMap.get(PublicAPIConstant.ZIP);\r\n\t\tString soStatus = requestMap.get(PublicAPIConstant.SO_STATUS);\r\n\t\tList<String> soStatusList = new ArrayList<String>();\r\n\r\n\t\tif (null != soStatus) {\r\n\t\t\tStringTokenizer strTok = new StringTokenizer(\r\n\t\t\t\t\tsoStatus,\r\n\t\t\t\t\tPublicAPIConstant.SEPARATOR, false);\r\n\t\t\tint noOfStatuses = strTok.countTokens();\r\n\t\t\tfor (int i = 1; i <= noOfStatuses; i++) {\r\n\t\t\t\tsoStatusList.add(new String(strTok\r\n\t\t\t\t\t\t.nextToken()));\r\n\t\t\t}\r\n\t\t}\r\n\t\tInteger pageSize = Integer.parseInt(requestMap.get(\r\n\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET));\r\n\t\t\r\n\t\tif(null!=zip&&zip.length() != 5){\r\n\t\t\trequestMap.put(PublicAPIConstant.ERROR_FIELD, \r\n\t\t\t\t\tPublicAPIConstant.ZIP);\r\n\t\t\treturn result;\t\r\n\t\t}\r\n\t\tList<Integer> pageSizeSetValues = Arrays.asList(\r\n\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET_10,\r\n\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET_20,\r\n\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET_50,\r\n\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET_100,\r\n\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET_200,\r\n\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET_500);\t\t\r\n\t\tif(!pageSizeSetValues.contains(pageSize)){\r\n\t\t\trequestMap.put(PublicAPIConstant.ERROR_FIELD, \r\n\t\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET);\r\n\t\t\treturn result;\t\r\n\t\t}\t\r\n\t\t\r\n\t\tList<String> soStatusValues = Arrays.asList(\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_POSTED,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_ACCEPTED,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_ACTIVE,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_CLOSED,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_COMPLETED,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_DRAFTED,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_PROBLEM,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_EXPIRED,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_PENDINGCANCEL\r\n\t\t);\t\t\r\n\t\tif(!soStatusValues.containsAll(soStatusList)){\r\n\t\t\trequestMap.put(PublicAPIConstant.ERROR_FIELD, \r\n\t\t\t\t\tPublicAPIConstant.SO_STATUS_SET);\r\n\t\t\treturn result;\t\r\n\t\t}\t\r\n\t\tresult = true;\r\n\t\treturn result;\r\n\t}", "boolean hasPassCardsResponse();", "@Test\n\t\tpublic void testRestSuccessfulResponse() throws Exception {\n\n\t\t\tString responseBody = TestUtils.getValidResponse();\n\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tResponseEntity<ResponseWrapper> responseEntity= prepareReponseEntity(responseBody);\n\t\t\t\t\n\t\t\t\tboolean flag=weatherService.checkForErrors(responseEntity);\n\t\t\t\tassertFalse(flag);\n\t\t\t\n\t\t\t\tthis.mockServer.verify();\n\t\t\t} catch (Exception e) {\n\t\t\t\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}", "@Override\n public void onComplete(boolean completed, final String pinResults) {\n if (completed) {\n final Dialog loadingDialog = new ShowPopup(context).loading(false);\n loadingDialog.show();\n\n JSONObject mainObject = new JSONObject();\n try {\n mainObject.put(\"access_token\", \"LDT1Aose0cu0AHUVHurhf6ZCU0SE\");\n mainObject.put(\"otp\", pinResults);\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n Debug.Log(\"requestOTP params -> \" + mainObject.toString());\n\n LoadJson loadJson = new LoadJson(context, \"http://main-test.odooviet.vn/izi_saas/validate_request\",\n new StringEntity(mainObject.toString(), ContentType.APPLICATION_JSON),\n new LoadJson.OnLoadJson() {\n @Override\n public void onLoadJsonLoading() {\n\n }\n\n @Override\n public void onLoadJsonSuccess(JSONObject response) {\n popupDialog.dismiss();\n loadingDialog.dismiss();\n\n new ShowPopup(context).info(\"Cảm ơn bạn đã đăng ký sử dụng ứng dụng ErpViet\\n \\n\" +\n \"Chúng tôi sẽ liên hệ với bạn trong thời gian sớm nhất\", new OnPopupActionListener() {\n @Override\n public void onCancel() {\n\n }\n\n @Override\n public void onAccept() {\n SignupActivity activity = (SignupActivity) context;\n if (activity != null)\n activity.finish();\n }\n }).show();\n\n }\n\n @Override\n public void onLoadJsonError(String error, boolean needToShowErrorDialog) {\n popupDialog.dismiss();\n loadingDialog.dismiss();\n }\n });\n }\n }", "public String processResponse(Map<String, String> fields) {\r\n\r\n\t\t// remove the vpc_TxnResponseCode code from the response fields as we do\r\n\t\t// not\r\n\t\t// want to include this field in the hash calculation\r\n\t\tString vpc_Txn_Secure_Hash = null2unknown((String) fields.remove(\"vpc_SecureHash\"));\r\n\t\tString hashValidated = null;\r\n\t\tString txtref = fields.get(\"vpc_MerchTxnRef\");\r\n//\t\tif(txtref==null || txtref.isEmpty()){\r\n//\t\t\t//TODO Error Validating Data\r\n//\t\t}\r\n//\t\t\r\n//\t\tString city = getCity(txtref);\r\n//\t\tif(city==null || city.isEmpty()){\r\n//\t\t\t//TODO Error Validating Data\r\n//\t\t}\r\n\t\t// defines if error message should be output\r\n\t\tboolean errorExists = false;\r\n\r\n\t\t// create secure hash and append it to the hash map if it was\r\n\t\t// created\r\n\t\t// remember if SECURE_SECRET = \"\" it wil not be created\r\n\t\tString secureHash = SHAEncrypt.hashAllFields(fields, secureHashMap.get(\"DUBAI\"));\r\n\r\n\t\t// Validate the Secure Hash (remember MD5 hashes are not case\r\n\t\t// sensitive)\r\n\t\tif (vpc_Txn_Secure_Hash != null && vpc_Txn_Secure_Hash.equalsIgnoreCase(secureHash)) {\r\n\t\t\t// Secure Hash validation succeeded, add a data field to be\r\n\t\t\t// displayed later.\r\n\t\t\thashValidated = \"CORRECT\";\r\n\t\t} else {\r\n\t\t\t// Secure Hash validation failed, add a data field to be\r\n\t\t\t// displayed later.\r\n\t\t\terrorExists = true;\r\n\t\t\thashValidated = \"INVALID HASH\";\r\n\t\t}\r\n\r\n\t\t// Extract the available receipt fields from the VPC Response\r\n\t\t// If not present then let the value be equal to 'Unknown'\r\n\t\t// Standard Receipt Data\r\n\t\tString amount = null2unknown((String) fields.get(\"vpc_Amount\"));\r\n\t\tString locale = null2unknown((String) fields.get(\"vpc_Locale\"));\r\n\t\tString batchNo = null2unknown((String) fields.get(\"vpc_BatchNo\"));\r\n\t\tString command = null2unknown((String) fields.get(\"vpc_Command\"));\r\n\t\tString message = null2unknown((String) fields.get(\"vpc_Message\"));\r\n\t\tString version = null2unknown((String) fields.get(\"vpc_Version\"));\r\n\t\tString cardType = null2unknown((String) fields.get(\"vpc_Card\"));\r\n\t\tString orderInfo = null2unknown((String) fields.get(\"vpc_OrderInfo\"));\r\n\t\tString receiptNo = null2unknown((String) fields.get(\"vpc_ReceiptNo\"));\r\n\t\tString merchantID = null2unknown((String) fields.get(\"vpc_Merchant\"));\r\n\t\tString merchTxnRef = null2unknown((String) txtref);\r\n\t\tString authorizeID = null2unknown((String) fields.get(\"vpc_AuthorizeId\"));\r\n\t\tString transactionNo = null2unknown((String) fields.get(\"vpc_TransactionNo\"));\r\n\t\tString acqResponseCode = null2unknown((String) fields.get(\"vpc_AcqResponseCode\"));\r\n\t\tString txnResponseCode = null2unknown((String) fields.get(\"vpc_TxnResponseCode\"));\r\n\r\n\t\t// CSC Receipt Data\r\n\t\tString vCSCResultCode = null2unknown((String) fields.get(\"vpc_CSCResultCode\"));\r\n\t\tString vCSCRequestCode = null2unknown((String) fields.get(\"vpc_CSCRequestCode\"));\r\n\t\tString vACQCSCRespCode = null2unknown((String) fields.get(\"vpc_AcqCSCRespCode\"));\r\n\r\n\t\t// 3-D Secure Data\r\n\t\tString transType3DS = null2unknown((String) fields.get(\"vpc_VerType\"));\r\n\t\tString verStatus3DS = null2unknown((String) fields.get(\"vpc_VerStatus\"));\r\n\t\tString token3DS = null2unknown((String) fields.get(\"vpc_VerToken\"));\r\n\t\tString secureLevel3DS = null2unknown((String) fields.get(\"vpc_VerSecurityLevel\"));\r\n\t\tString enrolled3DS = null2unknown((String) fields.get(\"vpc_3DSenrolled\"));\r\n\t\tString xid3DS = null2unknown((String) fields.get(\"vpc_3DSXID\"));\r\n\t\tString eci3DS = null2unknown((String) fields.get(\"vpc_3DSECI\"));\r\n\t\tString status3DS = null2unknown((String) fields.get(\"vpc_3DSstatus\"));\r\n\t\tString acqAVSRespCode = null2unknown((String) fields.get(\"vpc_AcqAVSRespCode\"));\r\n\t\tString riskOverallResult = null2unknown((String) fields.get(\"vpc_RiskOverallResult\"));\r\n\r\n\t\tString error = \"\";\r\n\t\t// Show this page as an error page if error condition\r\n\t\tif (txnResponseCode == null || txnResponseCode.equals(\"7\") || txnResponseCode.equals(\"No Value Returned\") || errorExists) {\r\n\t\t\terror = \"Error \";\r\n\t\t\tlog.info(\"ERROR in Processing Transaction\");\r\n\t\t}\r\n\t\tPaymentResponse response = new PaymentResponse();\r\n\t\tresponse.setAmount(amount);\r\n\t\tresponse.setLocale(locale);\r\n\t\tresponse.setBatchNo(batchNo);\r\n\t\tresponse.setCommand(command);\r\n\t\tresponse.setMessage(message);\r\n\t\tresponse.setVersion(version);\r\n\t\tresponse.setCard(cardType);\r\n\t\tresponse.setOrderInfo(orderInfo);\r\n\t\tresponse.setReceiptNo(receiptNo);\r\n\t\tresponse.setMerchant(merchantID);\r\n\t\tresponse.setMerchTxnRef(merchTxnRef);\r\n\t\tresponse.setAuthorizeId(authorizeID);\r\n\t\tresponse.setTransactionNo(transactionNo);\r\n\t\tresponse.setAcqResponseCode(acqResponseCode);\r\n\t\tresponse.setTxnResponseCode(txnResponseCode);\r\n\t\tresponse.setcSCResultCode(vCSCResultCode);\r\n\t\tresponse.setcSCRequestCode(vCSCRequestCode);\r\n\t\tresponse.setAcqCSCRespCode(vACQCSCRespCode);\r\n\t\tresponse.setVerType(transType3DS);\r\n\t\tresponse.setVerStatus(verStatus3DS);\r\n\t\tresponse.setVerToken(token3DS);\r\n\t\tresponse.setVerSecurityLevel(secureLevel3DS);\r\n\t\tresponse.setD3Senrolled(enrolled3DS);\r\n\t\tresponse.setD3sxid(xid3DS);\r\n\t\tresponse.setD3SECI(eci3DS);\r\n\t\tresponse.setD3Sstatus(status3DS);\r\n\t\tresponse.setAcqAVSRespCode(acqAVSRespCode);\r\n\t\tresponse.setSecureHash(vpc_Txn_Secure_Hash);\r\n\t\tresponse.setRiskOverallResult(riskOverallResult);\r\n\t\tDate date = Calendar.getInstance().getTime();\r\n\t\tresponse.setUpdateDate(date);\r\n\t\tresponse.setCreationDate(date);\r\n\r\n\t\ttry {\r\n\t\t\tFacadeFactory.getFacade().store(response);\r\n\t\t\tTransaction txn = getPaymentByTxnRef(merchTxnRef);\r\n\t\t\tif (txnResponseCode.equals(\"0\")) {\r\n\t\t\t\ttxn.setStatus(\"SUCCESS\");\r\n\t\t\t\ttxn.setReceiptNo(receiptNo);\r\n\t\t\t\ttxn.setSyncStatus(2);\r\n\t\t\t} else {\r\n\t\t\t\ttxn.setStatus(\"FAIL\");\r\n\t\t\t}\r\n\t\t\tFacadeFactory.getFacade().store(txn);\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\tlog.error(\"Error n saving response\" + response.toString(), e);\r\n\t\t}\r\n\r\n\t\treturn txnResponseCode;\r\n\r\n\t}", "@RequestMapping(\"/create\")\r\n\t@Produces({ MediaType.TEXT_PLAIN })\r\n\tpublic String createOrder() {\n\t\tString response = \"\";\r\n\t\ttry {\r\n\t\t\tSystem.out.println(\"in EO calling Validate REST API : \"+System.currentTimeMillis()); \r\n\t\t\tStopWatch watch = new StopWatch();\r\n\t\t\tHttpUriRequest request = new HttpGet(\"http://localhost:\" + \"\" + \"9091\" + \"/eo/validate\");\r\n\t\t\tHttpResponse httpResponse;\r\n\t\t\twatch.start();\r\n\t\t\thttpResponse = HttpClientBuilder.create().build().execute(request);\r\n\t\t\twatch.stop();\r\n\t\t\tresponse = EntityUtils.toString(httpResponse.getEntity());\r\n\t\t\tSystem.out.println(\">>>>>>>Response:\" + response + \" Response time(hh:mm:SS:mS): \" + watch.toString());\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 (response.contains(\"Order Validated\"))\r\n\t\t\treturn \"Order Created!!\";\r\n\t\telse\r\n\t\t\tthrow new InternalServerErrorException();\r\n\t}", "@Override\n protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n if (resultCode == 101) {\n getAvailableDeliveryAddresses(1);\n } else if (resultCode == 102) {\n getAvailableDeliveryAddresses(1);\n } else if (resultCode == 103) {\n assert data != null;\n String orderID = data.getStringExtra(\"OrderID\");\n String status = data.getStringExtra(\"status\");\n try {\n if (status.equals(\"SUCCESS\")) {\n SuperActivityToast.create(ConsumerCheckOutActivity.this)\n .setProgressBarColor(Color.WHITE)\n .setText(\"Your Order is received\")\n .setDuration(Style.DURATION_SHORT)\n .setFrame(Style.FRAME_KITKAT)\n .setColor(getResources().getColor(R.color.colorWhite))\n .setTextColor(getResources().getColor(R.color.colorBlack))\n .setAnimations(Style.ANIMATIONS_FLY).show();\n\n AlertDialog.Builder builder = new AlertDialog.Builder(ConsumerCheckOutActivity.this);\n LayoutInflater inflater = getLayoutInflater();\n View dialogLayout = inflater.inflate(R.layout.consumer_checkout_dialogue, null);\n TextView header = dialogLayout.findViewById(R.id.header);\n TextView subHeader = dialogLayout.findViewById(R.id.subHeader);\n Button trackOrderButton = dialogLayout.findViewById(R.id.trackOrderButton);\n trackOrderButton.setVisibility(View.GONE);\n Button exploreFoodButton = dialogLayout.findViewById(R.id.exploreFoodButton);\n RecyclerView recyclerView = dialogLayout.findViewById(R.id.recyclerView);\n header.setTypeface(RobotoBold);\n subHeader.setTypeface(poppinsMedium);\n subHeader.setText(\"Invoice No: \" + getOrderNoWithDashes(orderID, \"-\", 4));\n\n trackOrderButton.setTypeface(poppinsBold);\n exploreFoodButton.setTypeface(poppinsBold);\n\n builder.setView(dialogLayout);\n AlertDialog alertDialog = builder.create();\n trackOrderButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n\n alertDialog.dismiss();\n Intent intent = new Intent(ConsumerCheckOutActivity.this, TrackOrderActivity.class);\n intent.putExtra(\"OrderID\", orderID);\n intent.putExtra(\"From\", \"Checkout\");\n startActivity(intent);\n finish();\n }\n });\n exploreFoodButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n alertDialog.dismiss();\n Intent intent = new Intent(ConsumerCheckOutActivity.this, ConsumerMainActivity.class);\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n startActivity(intent);\n finish();\n }\n });\n getOrdersListFromInvoiceNumber(orderID, recyclerView, alertDialog);\n alertDialog.show();\n alertDialog.setCanceledOnTouchOutside(false);\n } else {\n SuperActivityToast.create(ConsumerCheckOutActivity.this)\n .setProgressBarColor(Color.WHITE)\n .setText(\"Your Payment has beed failed\")\n .setDuration(Style.DURATION_SHORT)\n .setFrame(Style.FRAME_KITKAT)\n .setColor(getResources().getColor(R.color.colorWhite))\n .setTextColor(getResources().getColor(R.color.colorBlack))\n .setAnimations(Style.ANIMATIONS_FLY).show();\n\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }\n }", "public void receiveResultpayOrder(\n com.speed.esalDemo.generation.OrderServiceImplServiceStub.PayOrderResponse0 result\n ) {\n }", "boolean hasFlightdetails();", "boolean hasListResponse();", "private static RequestSpecification placeOrderRequest(long id, long petId, int quantity, String shipDate, String status, boolean completed) {\n RestAssured.baseURI = MicroservicesEnvConfig.BASEURL;\n RestAssured.config = RestAssured.config().logConfig(LogConfig.logConfig().defaultStream(RSLOGGER.getPrintStream()));\n\n APILogger.logInfo(LOGGER,\"Place Store Order service Request...\");\n return RestAssured.given().header(\"Content-Type\", \"application/json\").body(placeOrderPayload(id, petId, quantity, shipDate, status, completed)).log().all();\n }", "@SuppressWarnings(\"unchecked\")\n private boolean checkResponse (HttpResponse<?> pResponse) {\n boolean result = false;\n if (pResponse != null\n && pResponse.getStatus() == 200\n && pResponse.getBody() != null) {\n HttpResponse<String> response = (HttpResponse<String>)pResponse;\n JSONObject body = new JSONObject(response.getBody());\n if (body.has(\"result\")) {\n result = Boolean.TRUE.equals(body.getBoolean(\"success\"));\n }\n }\n return result;\n }", "@Override\n\t\t\t\t\t\tpublic void onSuccess(int statusCode, Header[] headers,\n\t\t\t\t\t\t\t\tJSONObject response) {\n\t\t\t\t\t\t\tif (response != null) {\n\t\t\t\t\t\t\t\tplace = Place.decodeJSON(response);\n\t\t\t\t\t\t\t\tplace.id = idPlace;\n\t\t\t\t\t\t\t\tupdateDetailGUI();\n\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\tToast.makeText(getApplicationContext(),\n\t\t\t\t\t\t\t\t\t\t\"Errore\", Toast.LENGTH_LONG).show();\n\t\t\t\t\t\t}", "public boolean processRequirementSummary() throws NbaBaseException {\n\t\tboolean success = false;\n\t\tNbaVpmsAdaptor vpmsProxy = null; //SPR3362\n\t\ttry {\n\t\t\tNbaOinkDataAccess oinkData = new NbaOinkDataAccess(txLifeReqResult); //ACN009\n\t\t\toinkData.setAcdbSource(new NbaAcdb(), nbaTxLife);\n\t\t\toinkData.setLobSource(work.getNbaLob());\n\t\t\tif(getLogger().isDebugEnabled()) { //SPR3290\n\t\t\t getLogger().logDebug(\"########### Testing Requirment Summary ###########\");\n\t\t\t getLogger().logDebug(\"########### PartyId: \" + partyID);\n\t\t\t}//SPR3290\n\t\t\tvpmsProxy = new NbaVpmsAdaptor(oinkData, NbaVpmsAdaptor.ACREQUIREMENTSUMMARY); //SPR3362\n\t\t\tvpmsProxy.setVpmsEntryPoint(NbaVpmsAdaptor.EP_GET_CALCXMLOBJECTS);\n\t\t\tMap deOink = new HashMap();\n\t\t\t//\t\t\t######## DEOINK\n\t\t\tdeOink.put(NbaVpmsConstants.A_PROCESS_ID, NbaUtils.getBusinessProcessId(getUser())); //SPR2639\n\t\t\tdeOinkContractFieldsForRequirement(deOink);\n\t\t\tdeOinkXMLResultFields(deOink);\n deOinkSubstanceUsage(oinkData, deOink, partyID); //AXAL3.7.07\n\t\t\tdeOinkLabTestResults(deOink);\n\t\t\tObject[] args = getKeys();\n\t\t\tNbaOinkRequest oinkRequest = new NbaOinkRequest();\n\t\t\toinkRequest.setRequirementIdFilter(reqId);\n\t\t\toinkRequest.setArgs(args);\n\t\t\tvpmsProxy.setANbaOinkRequest(oinkRequest);\n\t\t\tvpmsProxy.setSkipAttributesMap(deOink);\n\t\t\tVpmsComputeResult vcr = vpmsProxy.getResults();\n\t\t\tNbaVpmsResultsData vpmsResultsData = new NbaVpmsResultsData(vcr);\n\t\t\tArrayList results = vpmsResultsData.getResultsData();\n\t\t\tresults = vpmsResultsData.getResultsData();\n\t\t\t//Resulting string will be the zeroth element.\n\t\t\tif (results == null) {\n\t\t\t\t//SPR3362 code deleted\n\t\t\t\tthrow new NbaVpmsException(NbaVpmsException.VPMS_NO_RESULTS + NbaVpmsAdaptor.ACREQUIREMENTSUMMARY); //SPR2652\n\t\t\t} //SPR2652\n\t\t\tvpmsResult = (String) results.get(0);\n\t\t\tNbaVpmsModelResult vpmsOutput = new NbaVpmsModelResult(vpmsResult);\n\t\t\tVpmsModelResult vpmModelResult = vpmsOutput.getVpmsModelResult();\n\t\t\tupdateDefaultValues(vpmModelResult.getDefaultValues());\n\t\t\tupdateSummaryValues(vpmModelResult.getSummaryValues());\n\t\t\tsuccess = true;\n\t\t\t// SPR2652 Code Deleted\n\t\t\t//SPR3362 code deleted\n\t\t} catch (RemoteException re) {\n\t\t\tthrow new NbaBaseException(\"Remote Exception occured in processRequirementSummary\", re);\n\t\t// SPR2652 Code Deleted\n\t\t//begin SPR3362\n\t\t} finally {\n\t\t if(vpmsProxy != null){\n\t\t try {\n vpmsProxy.remove();\n } catch (RemoteException e) {\n getLogger().logError(NbaBaseException.VPMS_REMOVAL_FAILED);\n }\n\t\t }\n\t\t//end SPR3362\n\t\t}\n\t\treturn success;\n\t}", "private SpeechletResponse bankTelephoneNumberResponse(){\n\n Place place = getPlaceWithTelephoneNumber();\n\n if (place == null) {\n log.error(\"No place was found! Your address: \" + deviceAddress.toString());\n return getAskResponse(BANK_CONTACT_CARD, ERROR_TEXT);\n }\n\n return doBankTelephoneNumberResponse(place);\n }", "public static boolean getOrderStatus() {\r\n \treturn orderSucceed;\r\n }", "public void verifyTransactionInfo(final Map<String, String> transactionInfo)\n throws ParseException {\n final String normalizedDate = DateFormatter.MY_ACCOUNT_TRANSACTION_HISTORY_DATE_LONG\n .getFormatter()\n .parse(stPaymentDateTime().getText()).toString();\n\n final boolean isPaymentStatusEqual = stPaymentStatus().getText()\n .toLowerCase()\n .contains(transactionInfo.get(\"Confirmation\").toLowerCase())\n || transactionInfo.get(\"Confirmation\").toLowerCase()\n .contains(stPaymentStatus().getText().toLowerCase())\n || \"successful\".equalsIgnoreCase(stPaymentStatus().getText())\n && !transactionInfo.get(\"Confirmation\").toLowerCase()\n .contains(\"fail\");\n\n Log.altVerify(transactionInfo.get(\"Entity\"), stPaymentEntity().getText(),\n true,\n \"Is payment entity equal?\");\n Log.altVerify(transactionInfo.get(\"Payment Type\"),\n stPaymentType().getText(), true,\n \"Is payment type equal?\");\n Log.altVerify(transactionInfo.get(\"Amount\"), stPaymentAmount().getText(),\n true,\n \"Is payment amount equal?\");\n Log.altVerify(true, isPaymentStatusEqual,\n \"Is payment status /confirmation code equal?\");\n Log.altVerify(transactionInfo.get(\"Payment Date\"), normalizedDate, true,\n \"Is payment date equal?\");\n }", "private static void verifyMocksCalled(DataRequestResponse response) {\n for (ConnectionDetail entry : response.getResources().values()) {\n verify(((DataService) entry.createService()), times(1)).read(any());\n }\n }", "@Override\n public void onResponse(Call call, Response response) throws IOException {\n assert response.body() != null;\n aadresponse = response.body().string();\n if (aadresponse!= null) {\n\n Log.d(\"AADHAAR\", \"VERIFIED AADHAAR RESPONSE\" + aadresponse);\n\n\n }\n if (aadresponse.equals(\"true\")) {\n LoanActivity_PrimaryScreen.this.runOnUiThread(new Runnable() {\n @Override\n public void run() {\n Toast.makeText(LoanActivity_PrimaryScreen.this,\"Duplicate Aadhaar\",Toast.LENGTH_SHORT).show();\n }\n });\n checkAadhaar = false;\n } else {\n LoanActivity_PrimaryScreen.this.runOnUiThread(new Runnable() {\n @Override\n public void run() {\n Toast.makeText(LoanActivity_PrimaryScreen.this,\"Aadhaar Verified\",Toast.LENGTH_SHORT).show();\n }\n });\n LoanActivity_PrimaryScreen.this.runOnUiThread(new Runnable() {\n @Override\n public void run() {\n et_aadhaar.setEnabled(false);\n et_pan.setEnabled(true);\n et_phn.setEnabled(true);\n aadverify.setText(\"VERIFIED\");\n }\n });\n\n checkAadhaar = true;\n }\n System.out.println(\"RESPONSE STRING IS\" + aadresponse);\n\n }", "@Test\n public void fetch() throws RazorpayException{\n String mockedResponseJson = \"{\\n\" +\n \" \\\"id\\\": \"+REFUND_ID+\",\\n\" +\n \" \\\"entity\\\": \\\"refund\\\",\\n\" +\n \" \\\"amount\\\": 300100,\\n\" +\n \" \\\"currency\\\": \\\"INR\\\",\\n\" +\n \" \\\"payment_id\\\": \\\"pay_FIKOnlyii5QGNx\\\",\\n\" +\n \" \\\"notes\\\": {\\n\" +\n \" \\\"comment\\\": \\\"Comment for refund\\\"\\n\" +\n \" },\\n\" +\n \" \\\"receipt\\\": null,\\n\" +\n \" \\\"acquirer_data\\\": {\\n\" +\n \" \\\"arn\\\": \\\"10000000000000\\\"\\n\" +\n \" },\\n\" +\n \" \\\"created_at\\\": 1597078124,\\n\" +\n \" \\\"batch_id\\\": null,\\n\" +\n \" \\\"status\\\": \\\"processed\\\",\\n\" +\n \" \\\"speed_processed\\\": \\\"normal\\\",\\n\" +\n \" \\\"speed_requested\\\": \\\"optimum\\\"\\n\" +\n \"}\";\n try {\n mockResponseFromExternalClient(mockedResponseJson);\n mockResponseHTTPCodeFromExternalClient(200);\n Refund fetch = refundClient.fetch(REFUND_ID);\n assertNotNull(fetch);\n assertEquals(REFUND_ID,fetch.get(\"id\"));\n String fetchRequest = getHost(String.format(Constants.REFUND,REFUND_ID));\n verifySentRequest(false, null, fetchRequest);\n } catch (IOException e) {\n assertTrue(false);\n }\n }", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "boolean hasResponse();", "public void VerifyReferencePOField(){\r\n\t\tString countriesReferencePO=\"Germany,UK,Denmark\";\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Comments or ReferencePOField or both should be present based on country\");\r\n\r\n\t\ttry{\r\n\t\t\tif(countriesReferencePO.contains(countries.get(countrycount))){\r\n\t\t\t\tSystem.out.println(\"Reference Po field is present as \"+getPropertyValue(locator_split(\"txtCheckoutReferencePO\"), \"name\"));\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- Reference Po field is present as \"+getPropertyValue(locator_split(\"txtCheckoutReferencePO\"), \"name\"));\r\n\t\t\t}else{\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- Reference PO field will not be present for this counry\");\r\n\t\t\t}\r\n\r\n\t\t}catch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Reference PO field is not present\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCheckoutCommentssection\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtCheckoutReferencePO\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\t}", "@Test\n public void testPostOrdersAction() throws ClientException, IOException, ProcessingException {\n CloudResponse response = this.actions.postOrdersAction(\"{cartId}\", \"{customerId}\");\n List<Integer> expectedResults = Arrays.asList(200, 400, 403, 404);\n LOG.info(\"Got status {}\", response.getStatusLine());\n Assert.assertTrue(expectedResults.contains(response.getStatusLine().getStatusCode()));\n\n if(response.getStatusLine().getStatusCode() == 200) {\n this.actions.checkResponseJSONSchema(\"#/definitions/Order\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 400) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 403) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 404) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n \n }", "@Test\n\tpublic void getDeZipCode24848_checkNumberOfPlacesInSH_expect4() {\n\n\t\tgiven().\n\t\t\tspec(requestSpec).\n\t\twhen().\n\t\tthen();\n\t}", "public static JSONObject placeOrder(Map<String, String> orderDetails) {\n JSONObject responseJson = new JSONObject();\n\n System.out.println(\"building json\");\n\n try {\n JSONObject orderJson = new JSONObject();\n\n /* \n required attributes: \n 1. retailer\n 2. products\n 3. shipping_address\n 4. shipping_method\n 5. billing_address\n 6. payment_method\n 7. retailer_credentials\n \n /* other attributes we will use:\n 8. max_price \n \n */\n // 1.\n // put the retailer attribute in\n orderJson.put(\"retailer\", \"amazon\");\n\n // 2.\n // create the products array\n JSONArray products = new JSONArray();\n JSONObject product = createProductObject(orderDetails);\n // put product in array\n products.put(product);\n // put the products array in orderJson\n orderJson.put(\"products\", products);\n\n // 3. \n // create shipping address object\n JSONObject shipAddress = createShipAddressObject(orderDetails);\n orderJson.put(\"shipping_address\", shipAddress);\n\n // 4. \n // insert shipping method attribute\n orderJson.put(\"shipping_method\", \"cheapest\");\n\n // 5.\n // create billing address object\n JSONObject billAddress = createBillAddressObject(orderDetails);\n orderJson.put(\"billing_address\", billAddress);\n\n // 6. \n // create payment method object\n JSONObject paymentMethod = createPaymentMethod(orderDetails);\n orderJson.put(\"payment_method\", paymentMethod);\n\n // 7. \n // create retailer credentials object\n JSONObject retailerCredentials = createRetailerCredentialsObject();\n orderJson.put(\"retailer_credentials\", retailerCredentials);\n\n // 8.\n // put max_price in orderJson\n // NOTE: this is the last thing that will prevent an order from \n // actually going through. use 0 for testing purposes, change to \n // maxPrice to actually put the order through\n orderJson.put(\"max_price\", 0); // replace with: orderDetails.get(\"maxPrice\")\n\n //===--- finally: send the json to the api ---===//\n responseJson = sendRequest(orderJson);\n //===-----------------------------------------===//\n\n } catch (JSONException ex) {\n Logger.getLogger(ZincUtils.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n return responseJson;\n }", "public void receiveResultcheckRateIdPnrValid(\n com.speed.esalDemo.generation.OrderServiceImplServiceStub.CheckRateIdPnrValidResponseE result\n ) {\n }", "private SpeechletResponse doCompleteBankOpeningHoursResponse(Place place) {\n\n StringBuilder stringBuilder = new StringBuilder();\n stringBuilder.append(place.getName()).append(\" hat am \");\n List<String> openingWeekdayHours = PlaceFinder.getCompleteWeekdayHours(place);\n\n for (String hours : openingWeekdayHours) {\n stringBuilder.append(hours);\n }\n\n return getSSMLResponse(BANK_CONTACT_CARD, stringBuilder.toString());\n }", "public APIResponse placeOrder(@NotNull Order order){\n try {\n validateOrder(order);\n \n order.getItems().addAll(\n orderItemRepository.saveAll(order.getItems())\n );\n orderRepository.save( order );\n return APIResponse.builder()\n .success( true)\n .data( true )\n .error( null )\n .build();\n }catch (Exception exception){\n\n log.error(exception.getMessage());\n return APIResponse.builder()\n .success( true)\n .data( false )\n .error( exception.getMessage() )\n .build();\n }\n }", "private SpeechletResponse doBankTelephoneNumberResponse(Place place) {\n String speechText = place.getName() + \" hat die Telefonnummer \" + place.getPhoneNumber();\n\n return getResponse(BANK_CONTACT_CARD, speechText);\n }", "public void verifyOrderRecape(String orderrecape1){\r\n\r\n\t\tString order = getValue(orderrecape1);\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- orderrecape page should be displayed\");\r\n\t\ttry{\r\n\r\n\t\t\tif(getAndVerifyPartialText(locator_split(\"orderrecape\"),order)) { \r\n\t\t\t\twaitForPageToLoad(20);\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- orderrecape page is Displayed\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- orderrecape is not displayed \"+elementProperties.getProperty(\"orderrecape\"));\r\n\t\t\tthrow new NoSuchElementException(\"The element with \" + elementProperties.getProperty(\"orderrecape\").toString().replace(\"By.\", \" \") + \" not found\");\r\n\r\n\t\t}\r\n\r\n\r\n\t}", "private void requestOrderDetail() {\n\n ModelHandler.OrderRequestor.requestOrderDetail(client, mViewData.getOrder().getId(), (order) -> {\n mViewData.setOrder(order);\n onViewDataChanged();\n }, this::showErrorMessage);\n }" ]
[ "0.71165764", "0.6141974", "0.6066602", "0.60373306", "0.5962764", "0.58993095", "0.58651096", "0.5819569", "0.57620823", "0.5753422", "0.5745342", "0.5743488", "0.5712534", "0.5683158", "0.56784576", "0.5662064", "0.5647081", "0.55830735", "0.55783796", "0.5561595", "0.5551896", "0.5551307", "0.55186564", "0.5487941", "0.54840773", "0.5477768", "0.54543203", "0.5419856", "0.5388423", "0.5370986", "0.53675467", "0.53675467", "0.53625846", "0.5358811", "0.53366673", "0.5332973", "0.5306801", "0.5273815", "0.5273419", "0.52657944", "0.52589905", "0.52527034", "0.5252149", "0.5249122", "0.52466553", "0.52460474", "0.52425253", "0.52269614", "0.52245456", "0.52199435", "0.52190363", "0.5203148", "0.5194634", "0.5191415", "0.51903766", "0.5189923", "0.51884395", "0.5179815", "0.5179248", "0.516695", "0.516695", "0.5164005", "0.5160418", "0.5160171", "0.51539135", "0.51409906", "0.5133179", "0.51307416", "0.5127543", "0.5115286", "0.51123834", "0.5111662", "0.51091313", "0.51067495", "0.50993323", "0.5096679", "0.50945514", "0.5093697", "0.50864166", "0.5085125", "0.5084425", "0.50716305", "0.50716305", "0.50716305", "0.50716305", "0.50716305", "0.50716305", "0.50716305", "0.50716305", "0.50716305", "0.5069475", "0.506618", "0.5063479", "0.50566655", "0.5051704", "0.5043693", "0.50436413", "0.5043608", "0.50422174", "0.5041736" ]
0.80191153
0
Method to confirm order is placed
public static void verifyOrderIsPlaced(long expectedId, long expectedPetId, int expectedQuantity, String expectedShipDate, String expectedStatus, boolean expectedCompleted) { Response response = GetStoreOrderServiceHandler.getStoreOrderServiceCall(expectedId); GetStoreOrderServiceHandler.verifyGetStoreOrderResponse(response, expectedId, expectedPetId, expectedQuantity, expectedShipDate, expectedStatus, expectedCompleted); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void confirmOrders() {\n\t\t\n\t}", "@Override\n\tpublic void confirmOrders() {\n\t\t\n\t}", "@Override\n\tpublic void confirmOrders() {\n\t\t\n\t}", "public void orderPlace() {\n Log.d(\"Method\", \"orderPlaced()\");\n\n if (coffeeCount < getResources().getInteger(R.integer.min_coffee)) {\n Log.e(\"\", \"coffeeCount < minimum coffee order\");\n displayMessage(String.format(Locale.getDefault(), getString(R.string.min_order_message), getResources().getInteger(R.integer.min_coffee)));\n } else if (coffeeCount > getResources().getInteger(R.integer.max_coffee)) {\n Log.e(\"\", \"coffeeCount > maximum coffee order\");\n displayMessage(String.format(Locale.getDefault(), getString(R.string.max_order_message), getResources().getInteger(R.integer.max_coffee)));\n } else {\n Log.i(\"\", \"Order placed: \" + coffeeCount + \" coffee.\");\n displayMessage(String.format(Locale.getDefault(), getString(R.string.order_thanks), 176));\n }\n resetQuantity();\n }", "public void confirmPrepared() {\n getCurrentOrder().setPrepared(true);\n getRestaurant().getOrderSystem().preparedOrder(getCurrentOrder());\n EventLogger.log(\"Order #\" + getCurrentOrder().getOrderNum() + \" has been prepared by chef \" + this.getName());\n doneWithOrder();\n }", "@Then(\"^verify order is placed successfully in Order History$\")\r\n\tpublic void verifyOrderHistory() throws Exception {\n\t assertTrue(new ProductCheckout(driver).isOrderPlaced());\r\n\t}", "@PostMapping(\"/order\")\n public ResponseEntity<OrderConfirmation> placeOrder(final HttpSession session) throws Exception {\n Map<String, CartProduct> initialCart = (Map<String, CartProduct>) session.getAttribute(CART_SESSION_CONSTANT);\n log.info(session.getId() + \" : Reviewing the order\");\n //check if the cart is empty\n ControllerUtils.checkEmptyCart(initialCart, session.getId());\n\n //check if items are still available during confirmation of order\n List<OrderProduct> orderProducts = new ArrayList<>();\n for (String key : initialCart.keySet())\n orderProducts.add(ControllerUtils.parse(initialCart.get(key)));\n List<String> chckQuantity = prodService.checkQuantityList(orderProducts);\n if (chckQuantity != null) {\n log.error(session.getId() + \" : Error submitting order for products unavailable\");\n throw new AvailabilityException(chckQuantity);\n }\n\n //Confirm order and update tables\n log.info(session.getId() + \" : confirming the order and killing the session\");\n OrderConfirmation orderConfirmation = prodService.confirmOrder(initialCart);\n session.invalidate();\n return ResponseEntity.status(HttpStatus.OK).body(orderConfirmation);\n }", "@Test\n public void placeOrderTest() {\n Order body = new Order().id(10L)\n .petId(10L)\n .complete(false)\n .status(Order.StatusEnum.PLACED)\n .quantity(1);\n Order response = api.placeOrder(body);\n\n Assert.assertEquals(10L, response.getId().longValue());\n Assert.assertEquals(10L, response.getPetId().longValue());\n Assert.assertEquals(1, response.getQuantity().intValue());\n Assert.assertEquals(true, response.isComplete());\n Assert.assertEquals(Order.StatusEnum.APPROVED, response.getStatus());\n\n verify(exactly(1), postRequestedFor(urlEqualTo(\"/store/order\")));\n }", "public void onSuccess(Token token) {\n placeOrder(token);\n\n progressDialog.dismiss();\n\n // Proceed to confirmation activity\n proceedToConfirmation();\n }", "private void acceptOrder() {\n buttonAcceptOrder.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n order.setDriver(ParseUser.getCurrentUser());\n order.saveInBackground();\n Log.i(TAG, \"driver!!: \" + order.getDriver().getUsername());\n ParseUser.getCurrentUser().put(KEY_HAS_ORDER, true);\n ParseUser.getCurrentUser().saveInBackground();\n\n finish();\n }\n });\n }", "@Override\n\tpublic boolean PlaceOrder(Order order) {\n\t\treturn false;\n\t}", "@Test (priority = 3)\n\t@Then(\"^Create Order$\")\n\tpublic void create_Order() throws Throwable {\n\t\tCommonFunctions.clickButton(\"wlnk_Home\", \"Sheet1\", \"Home\", \"CLICK\");\n\t\t//Thread.sleep(2000);\n\t\tCommonFunctions.clickButton(\"WLNK_OrderNewServices\", \"Sheet1\", \"Oreder New Service\", \"CLICK\");\n\t\t//Thread.sleep(3000);\n\t\tCommonFunctions.clickButton(\"WRD_complete\", \"Sheet1\", \"Complete\", \"CLICK\");\n\t\t//Thread.sleep(2000);\n\t\tCommonFunctions.clickButton(\"WLK_continue\", \"Sheet1\", \"Contine\", \"CLICK\");\n\t\t//Thread.sleep(2000);\n\t\tCommonFunctions.clickButton(\"WCB_Additional\", \"Sheet1\", \"Additional\", \"CLICK\");\n\t\t//Thread.sleep(2000);\n\t\tCommonFunctions.clickButton(\"WLK_continue\", \"Sheet1\", \"Complete\", \"CLICK\");\n\t\tCommonFunctions.clickButton(\"WBT_checkout\", \"Sheet1\", \"Checkout\", \"CLICK\");\n\t\tCommonFunctions.clickButton(\"WBT_completeOrder\", \"Sheet1\", \"complete order\", \"CLICK\");\n\t\tCommonFunctions.clickButton(\"WBT_PayNow\", \"Sheet1\", \"Pay Now\", \"CLICK\");\n\t\tCommonFunctions.checkObjectExist(\"WBT_PayPal\", \"Sheet1\", \"Pay pal\", \"NO\");\n\t\tCommonFunctions.clickButton(\"WBT_PayPal\", \"Sheet1\", \"Pay pal\", \"CLICK\");\n\t}", "@Then(\"Order is placed successfully confirmed by screenshot\")\r\n public void successfulOrder() throws InterruptedException {\n ProductPage prodPage = new ProductPage(driver);\r\n prodPage.goToCartAfterProductAdding();\r\n //Finishing an order form cart\r\n CartAndOrderProcess cartAndOrderProcess = new CartAndOrderProcess(driver);\r\n cartAndOrderProcess.proceedToChekout();\r\n cartAndOrderProcess.addressContinue();\r\n cartAndOrderProcess.shippingContinue();\r\n cartAndOrderProcess.payByCheckAndOrder();\r\n // Taking screenshot of successfully placed order\r\n // Also checking order history to make sure that amount is the same in order history\r\n cartAndOrderProcess.takeScreenshot(driver);\r\n cartAndOrderProcess.checkOfTotalCostAndPaymentStatus();\r\n }", "boolean isOrderCertain();", "@When(\"je verifie les informations et clique sur Submit Order\")\n\tpublic void je_verifie_les_informations_et_clique_sur_Submit_Order() {\n\t throw new PendingException();\n\t}", "@Override\n public void sure(OrderDetail orderDetail) {\n }", "public boolean VerifyOrderDetails_OrderConfirmation(){\n\tboolean flag = false;\n\tflag=CommonVariables.CommonDriver.get().findElement(OrderConfirmationScreen_OR.PAYMENTCONFIRMATION_LABEL).isDisplayed();\n\tif(flag){extentLogs.passWithCustom(\"VerifyOrderDetails\", \"PAYMENTCONFIRMATION_LABEL\");\n\t\tflag=CommonVariables.CommonDriver.get().findElement(OrderConfirmationScreen_OR.ORDERNUMBER_LABEL).isDisplayed();\n\t\tif(flag){\n\t\t\textentLogs.passWithCustom(\"VerifyOrderDetails\", \"OrderNumberLabelIsDisplayed\");\n\t\t}else{extentLogs.fail(\"VerifyOrderDetails\", \"OrderNumberLabelIsNotDisplayed\");}\n\t}else{extentLogs.fail(\"VerifyOrderDetails\", \"PAYMENTCONFIRMATION_LABEL\");}\n\t\n\treturn flag;\n\t}", "Order sendNotificationNewOrder(Order order);", "boolean checkOrderNotAcceptedYet(int idOrder);", "@Test(dependsOnMethods = \"checkSiteVersion\")\n public void createNewOrder() {\n actions.openRandomProduct();\n\n // save product parameters\n actions.saveProductParameters();\n\n // add product to Cart and validate product information in the Cart\n actions.addToCart();\n actions.goToCart();\n actions.validateProductInfo();\n\n // proceed to order creation, fill required information\n actions.proceedToOrderCreation();\n\n // place new order and validate order summary\n\n // check updated In Stock value\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}", "@Override\n\tpublic String confirmOrder(int oid, int code) {\n \n\t\tOrder order = orderRepo.findById(oid).get();\n\t\tUser user = order.getUser();\n\t\t\n\t\tSystem.out.println(\"code at conifrmOdrer \"+user.getVerficationCode()+\" matches with int code \"+code);\n\t\tif (user.getVerficationCode() == code) {\n\t\t\tfor (Cart c : user.getCart()) {\n\t\t\t\tcartRepo.delete(c);\n\t\t\t}\n\t\t\tuser.getCart().clear();\n\t\t\torder.setPaymentStatus(\"Success\");\n\t\t\temailService.sendConfirmationMail(user, oid); //Order Information sent to Email.\n\t\t\treturn \"Order successfull\";\n\t\t} else {\n\t\t\torder.setPaymentStatus(\"Failed\");\n\t\t\tfor (Cart c : user.getCart()) {\n\t\t\t\tc.getProduct().setStock(c.getProduct().getStock()+c.getQuantity());\n\t\t\t}\t\t\t\n\t\t\treturn \"Order not successfull\";\n\t\t }\n\t\t\n\t\t\n\n\t}", "@Override\n\tpublic boolean placeOrder(ArrayList<CartItems> cart_items) {\n\t\tboolean b = false;\n\t\tif(checkStock.isAvailable(cart_items)) {\n\t\t\tb=true;\n\t\t}\n\t\treturn b;\n\t}", "public void placeOrder(TradeOrder order)\r\n {\r\n brokerage.placeOrder(order);\r\n }", "boolean hasOrderId();", "boolean hasOrderId();", "public void EditOrderTest() {\n wait.until(ExpectedConditions.visibilityOfElementLocated(editOrderQuantityLocator));\n WebElement editOrderQuantity = driver.findElement(editOrderQuantityLocator);\n editOrderQuantity.click();\n // Click on the checkout button\n By goToCheckOutBtnLocator = By.xpath(\"//div[@class='Basket-bf28b64c20927ec7']//button[contains(@class,'ccl-d0484b0360a2b432')]\");\n wait.until(ExpectedConditions.visibilityOfElementLocated(goToCheckOutBtnLocator));\n WebElement goToCheckOutBtn = driver.findElement(goToCheckOutBtnLocator);\n goToCheckOutBtn.click();\n // Check that the order added to the basket\n By basketSectionSummaryLocator = By.className(\"ccl-9aab795066526b4d ccl-24c197eb36c1c3d3\");\n wait.until(ExpectedConditions.visibilityOfElementLocated(basketSectionSummaryLocator));\n\n }", "Receipt chargeOrder(PizzaOrder order, CreditCard creditCard);", "@Override\n\tpublic void showConfirmation(Customer customer, List<Item> items, double totalPrice, int loyaltyPointsEarned) {\n\t}", "void acceptOrd(final int vId) {\r\n Orders emp = OrdersFactory.getvalidateOrders();\r\n if (emp != null) {\r\n showPlacedOrders(vId);\r\n System.out.println(\"Enter the Order ID to Accept :\");\r\n int ordid = option.nextInt();\r\n int val = OrdersFactory.acceptOrders(ordid);\r\n System.out.println(\"Succes value is :\" + val);\r\n if (val == 1) {\r\n System.out.println(\"Accepted the Order\");\r\n return;\r\n }\r\n } else {\r\n System.out.println(\"---------No Placed Orders---------\");\r\n return;\r\n }\r\n }", "private void fireOrderValidityCheck() {\n ordersDatabaseReference.child(eventUid).child(order.getUid()).addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n if (dataSnapshot.exists() && (dataSnapshot.getValue() != null)) {\n order = dataSnapshot.getValue(Order.class);\n\n // We check if by the time the user finished entering his details the order has become invalid\n // If so, we send him back to main activity\n if (order.getStatusAsEnum() == DataUtils.OrderStatus.CANCELLED) {\n progressDialog.dismiss();\n onOrderExpired();\n }\n // Otherwise continue the order process\n else {\n fireCreditCardTokenCreation();\n }\n }\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {}\n });\n }", "private void AndOrderIsSentToKitchen() throws Exception {\n assert true;\n }", "public void submitOrder(BeverageOrder order);", "OrderFullDao confirmOrder(String orderNr, String status, Long businessId);", "public static Result confirmOrder(Orders orderObj){\n \n Result result = Result.FAILURE_PROCESS;\n MysqlDBOperations mysql = new MysqlDBOperations();\n ResourceBundle rs = ResourceBundle.getBundle(\"com.generic.resources.mysqlQuery\");\n Connection conn = mysql.getConnection();\n PreparedStatement preStat;\n boolean isSuccessInsertion;\n \n// if(!Checker.isValidDate(date))\n// return Result.FAILURE_CHECKER_DATE;\n\n try{ \n String order_id = Util.generateID();\n \n preStat = conn.prepareStatement(rs.getString(\"mysql.order.update.insert.1\"));\n preStat.setString(1, order_id);\n preStat.setString(2, \"1\" );\n preStat.setInt(3, 0);\n preStat.setLong(4, orderObj.getDate());\n preStat.setLong(5, orderObj.getDelay());\n preStat.setString(6, orderObj.getNote());\n preStat.setDouble(7, -1);\n preStat.setString(8, orderObj.getUserAddressID());\n preStat.setString(9, orderObj.getDistributerAddressID());\n \n \n if(preStat.executeUpdate()==1){\n List<OrderProduct> orderProductList = orderObj.getOrderProductList();\n isSuccessInsertion = orderProductList.size()>0;\n\n // - * - If process fail then break operation\n insertionFail:\n for(OrderProduct orderProduct:orderProductList){\n preStat = conn.prepareStatement(rs.getString(\"mysql.orderProduct.update.insert.1\"));\n preStat.setString(1, order_id);\n preStat.setString(2, orderProduct.getCompanyProduct_id());\n preStat.setDouble(3, orderProduct.getQuantity());\n\n if(preStat.executeUpdate()!=1){\n isSuccessInsertion = false;\n break insertionFail;\n }\n }\n\n // - * - Return success\n if(isSuccessInsertion){\n mysql.commitAndCloseConnection();\n return Result.SUCCESS.setContent(\"Siparişiniz başarılı bir şekilde verilmiştir...\");\n }\n\n // - * - If operation fail then rollback \n mysql.rollbackAndCloseConnection();\n }\n\n } catch (Exception ex) {\n mysql.rollbackAndCloseConnection();\n Logger.getLogger(DBOrder.class.getName()).log(Level.SEVERE, null, ex);\n return Result.FAILURE_PROCESS.setContent(ex.getMessage());\n } finally {\n mysql.closeAllConnection();\n } \n\n return result;\n }", "public void payForOrder(){\n\t\tcurrentOrder.setDate(new Date()); // setting date to current\n\t\t\n\t\t//Checking if tendered money is enough to pay for the order.\n\t\tfor(;;){\n\t\t\tJOptionPane.showMessageDialog(this.getParent(), new CheckoutPanel(currentOrder), \"\", JOptionPane.PLAIN_MESSAGE);\n\t\t\tif(currentOrder.getTendered().compareTo(currentOrder.getSubtotal())==-1){\n\t\t\t\tJOptionPane.showMessageDialog(this.getParent(), \"Not enough money tendered\", \"Error\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\t//Setting order number.\n\t\tSimpleDateFormat df = new SimpleDateFormat(\"yyyyMMdd\");\n\t\tString str = df.format(currentOrder.getDate());\n\t\tString number = Integer.toString(till.getOrders().size()+1) +\"/\"+str;\n\t\tcurrentOrder.setNumber(number);\n\t\t\n\t\t//Setting customer name.\n\t\tcurrentOrder.setCustomerName(custNameField.getText());\n\t\t\n\t\t//Adding current order to orders list.\n\t\ttill.getOrders().add(currentOrder); \n\t\t\n\t\t//Displays the receipt.\n\t\tJOptionPane.showMessageDialog(this.getParent(), new ReceiptPanel(currentOrder), \"Receipt\", \n\t\t\t\tJOptionPane.PLAIN_MESSAGE);\n\t\t\n\t\t//Resets OrderPanel.\n\t\tthis.resetOrder();\n\t}", "@Override\n\tpublic void sendOrderConfirmationHtmlEmail(Order order) {\n\t\t\n\t}", "@Override\n public void onClick(View view) {\n String location = \"\";\n boolean met = false;\n if(method == 0){\n location = spTableChoice.getSelectedItem().toString();\n met = true;\n }else if(method == 1 && !etPickupName.getText().toString().isEmpty()){\n met = true;\n location = etPickupName.getText().toString();\n }else{\n Toast.makeText(getApplicationContext(), \"Please enter a pickup name!\", Toast.LENGTH_SHORT).show();\n }\n\n if(met){\n // Finalise the order as an order object\n order.setDestination(location);\n order.setOrderItems(orderHeld);\n order.setTotalPrice(totalPrice);\n\n addOrderDB();\n Toast.makeText(getApplicationContext(), \"Placed!\", Toast.LENGTH_SHORT).show();\n\n // Move to payment now\n //PayPalPay(totalPrice);\n }\n\n }", "public void makeComplete(Order order) {}", "@Override\n public String getDescription() {\n return \"Ask order placement\";\n }", "public boolean orderCanceled() {\n\t\tordered = false;\n\t\tSystem.out.println(\"Ok your \" + name + \" order has been canceled.\");\n\t\treturn ordered;\n\t}", "public void saveOrder() {\n setVisibility();\n Order order = checkInputFromUser();\n if (order == null){return;}\n if(orderToLoad != null) DBSOperations.remove(connection,orderToLoad);\n DBSOperations.add(connection, order);\n }", "private void requestOrderDetail() {\n\n ModelHandler.OrderRequestor.requestOrderDetail(client, mViewData.getOrder().getId(), (order) -> {\n mViewData.setOrder(order);\n onViewDataChanged();\n }, this::showErrorMessage);\n }", "@Override\n public void sure() {\n onOrderUpdate();\n orderListAdpater.notifyDataSetChanged();\n }", "@Override\n public void sure() {\n onOrderUpdate();\n orderListAdpater.notifyDataSetChanged();\n }", "public boolean placeOrder(int pId) {\n\t\tboolean orderFulfilled = false;\n\n\t\tProduct product = new Product();\n\t\t//checks if product is available\n\t\tif (InventoryService.isAvailable(product)) {\n\t\t\tlogger.info(\"Product with ID: {} is available.\", product.getId());\n\t\t\t//paying service\n\t\t\tboolean paymentConfirmed = PaymentService.makePayment();\n\n\t\t\tif (paymentConfirmed) {\n\t\t\t\tlogger.info(\"Payment confirmed...\");\n\t\t\t\t//shipping service\n\t\t\t\tShippingService.shipProduct(product);\n\t\t\t\tlogger.info(\"Product shipped...\");\n\t\t\t\torderFulfilled = true;\n\t\t\t}\n\n\t\t}\n\t\treturn orderFulfilled;\n\t}", "@Override\n public void onClick(DialogInterface dialogInterface, int i) {\n Log.d(TAG, \"showMessageBox: order field check \" + msg);\n\n return;\n }", "private void btnCompleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCompleteActionPerformed\n DBManager db = new DBManager();\n \n for(Map.Entry<Integer, OrderLine> olEntry : loggedInCustomer.findLatestOrder().getOrderLines().entrySet())\n {\n OrderLine actualOrderLine = olEntry.getValue();\n Product orderedProduct = actualOrderLine.getProduct();\n \n orderedProduct.setStockLevel(orderedProduct.getStockLevel() - olEntry.getValue().getQuantity());\n db.updateProductAvailability(orderedProduct); \n }\n \n loggedInCustomer.findLatestOrder().setStatus(\"Complete\");\n db.completeOrder(orderId); \n \n Confirmation confirmation = new Confirmation(loggedInCustomer, orderId);\n this.dispose();\n confirmation.setVisible(true);\n \n }", "public void placeSingleTaskOrder(User user, SingleTaskOrder order);", "public void submitOrder(View view) {\n EditText nameText = (EditText) findViewById(R.id.edt_Name);\n String name = nameText.getText().toString();\n\n CheckBox whippedCream = (CheckBox) findViewById(R.id.chx_WhippedCream);\n boolean cream = whippedCream.isChecked();\n\n CheckBox hasChocolate = (CheckBox) findViewById(R.id.chx_Chocolate);\n boolean chocolate = hasChocolate.isChecked();\n\n int price = calculatePrice(cream, chocolate);\n displayMessage(createOrderSummary(price, cream, chocolate, name));\n sendReceipt(name, createOrderSummary(price,cream,chocolate,name));\n }", "private void orderCompleted(ArrayList<Transaction> transactionList) {\n String customerName = studentDetails[0].getName();\n String customerMobile = studentDetails[0].getMobile();\n String customerEmail = studentDetails[0].getEmail();\n Order order = new Order(-1, customerName, customerMobile, customerEmail\n , \"\",\n total, discount, false);\n\n ArrayList<SubOrder> subOrderList = new ArrayList<>();\n\n for (CartItem cartItem : cartList) {\n ProductHeader product = cartItem.getProductHeader();\n subOrderList.add(new SubOrder(product.getName(), product.getId(),\n product.getSku(), cartItem.getPrice(), cartItem.getQuantity(),\n 0, 0, 0, 0, false));\n }\n\n ProductAPI.saveAndSyncOrder(getContext(), db, order, subOrderList, transactionList);\n\n Toast.makeText(getContext(), \"Order completed\", Toast.LENGTH_SHORT).show();\n cartList.clear();\n cartAdapter.notifyDataSetChanged();\n updatePriceView();\n\n cartRecyclerView.setVisibility(View.GONE);\n emptyCartView.setVisibility(View.VISIBLE);\n dismissDialog();\n }", "void placeOrder(Cashier cashier){\n }", "void rejectNewOrders();", "public APIResponse placeOrder(@NotNull Order order){\n try {\n validateOrder(order);\n \n order.getItems().addAll(\n orderItemRepository.saveAll(order.getItems())\n );\n orderRepository.save( order );\n return APIResponse.builder()\n .success( true)\n .data( true )\n .error( null )\n .build();\n }catch (Exception exception){\n\n log.error(exception.getMessage());\n return APIResponse.builder()\n .success( true)\n .data( false )\n .error( exception.getMessage() )\n .build();\n }\n }", "void finishOrder(int orderId);", "@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 }", "public void orderClicked(View view) {\n Log.d(\"Method\", \"orderClicked()\");\n orderPlace();\n }", "private static boolean checkOrderList() {\n if (size != MainGUI.orderList.size()) {\n size = MainGUI.orderList.size();\n return true;\n }\n\n return false;\n }", "@FXML\r\n void submitNewOrder(MouseEvent event) {\r\n\t\t\t//everything is ok, now we will add casual traveler order.\r\n\t\t\tif ( order != null && WorkerControllerClient.createNewOrder(order) ) {\r\n\t\t\t\torderSucceed = true;\r\n\t\t\t\tAlert alert = new Alert(AlertType.INFORMATION);\r\n\t\t\t\talert.setHeaderText(\"succeed!\");\r\n\t\t\t\talert.setContentText(\"order created successfully\");\r\n\t\t\t\talert.showAndWait();\r\n\t\t\t\tsubmitButton.getScene().getWindow().hide();\r\n\t\t\t} else {\r\n\t\t\t\tAlert alert = new Alert(AlertType.ERROR);\r\n\t\t\t\talert.setHeaderText(\"Failed!\");\r\n\t\t\t\talert.setContentText(\"Order Failed\");\r\n\t\t\t\talert.showAndWait();\r\n\t\t\t\tsubmitButton.getScene().getWindow().hide();\r\n\t\t\t}\r\n\t\t\r\n }", "private void confirmDrugOrder(String paySerialNumber) {\r\n\r\n showNetworkCacheCardView();\r\n lockPayNowOrHavePayButton(BEING_VERIFICATION);\r\n String requestAction = \"confirmOrder\";\r\n String parameter = \"&paySerialNumber=\" + paySerialNumber;\r\n HttpUtil.sendOkHttpRequest(requestAction, parameter, new Callback() {\r\n @Override\r\n public void onFailure(Call call, IOException e) {\r\n //because of network,the client can't recive message,but has success.\r\n closeNetworkCacheCardView();\r\n showErrorCardView(ACCESS_TIMEOUT);\r\n lockPayNowOrHavePayButton(ACCESS_TIMEOUT);\r\n }\r\n\r\n @Override\r\n public void onResponse(Call call, Response response) throws IOException {\r\n message = gson.fromJson(response.body().string(), Message.class);\r\n closeNetworkCacheCardView();\r\n if (message.isSuccess()) {\r\n // show pay success\r\n showPaySuccessCardView();\r\n lockPayNowOrHavePayButton(HAVE_PAY);\r\n } else {\r\n // other problems.it cause update fail\r\n showErrorCardView(UNKNOWN_ERROR);\r\n lockPayNowOrHavePayButton(UNKNOWN_ERROR);\r\n }\r\n }\r\n });\r\n\r\n }", "public void submitOrder(View view) {\n EditText getName = (EditText)findViewById(R.id.name_field);\n String nameValue = getName.getText().toString();\n\n CheckBox whippedCreamCheckBox = (CheckBox) findViewById(R.id.Whipped_cream_checkbox);\n boolean hasWhippedCream = whippedCreamCheckBox.isChecked();\n\n CheckBox chocolateCheckBox = (CheckBox) findViewById(R.id.Chocolate_checkbox);\n boolean hasChocolate = chocolateCheckBox.isChecked();\n\n CheckBox CinnamonCheckBox = (CheckBox) findViewById(R.id.Cinnamon_checkbox);\n boolean hasCinnamon = CinnamonCheckBox.isChecked();\n\n CheckBox MarshmallowsCheckBox = (CheckBox) findViewById(R.id.Marshmallows_checkbox);\n boolean hasMarshmallows = MarshmallowsCheckBox.isChecked();\n\n int price = calculatePrice(hasWhippedCream, hasChocolate, hasMarshmallows, hasCinnamon);\n String priceMessage = createOrderSummary(nameValue, price, hasWhippedCream,hasChocolate, hasCinnamon, hasMarshmallows);\n /*displayMessage(priceMessage);*/\n // Use an intent to launch an email app.\n // Send the order summary in the email body.\n Intent intent = new Intent(Intent.ACTION_SENDTO);\n intent.setData(Uri.parse(\"mailto:\")); // only email apps should handle this\n intent.putExtra(Intent.EXTRA_SUBJECT, \"JustJava order for \" + nameValue);\n intent.putExtra(Intent.EXTRA_TEXT, priceMessage);\n\n if (intent.resolveActivity(getPackageManager()) != null) {\n startActivity(intent);\n }\n }", "public boolean orderConfirm(int id) {\n\t\ttry {\n\t\t\tConnection conn=DB.getConn();\n\t\t\tPreparedStatement stmt=conn.prepareStatement(\"update orders set status='confirm' where id=?\");\n\t\t\tstmt.setInt(1,id);\n\t\t\tstmt.executeUpdate();\n\t\t\treturn true;\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t}", "@Override\n protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n if (resultCode == 101) {\n getAvailableDeliveryAddresses(1);\n } else if (resultCode == 102) {\n getAvailableDeliveryAddresses(1);\n } else if (resultCode == 103) {\n assert data != null;\n String orderID = data.getStringExtra(\"OrderID\");\n String status = data.getStringExtra(\"status\");\n try {\n if (status.equals(\"SUCCESS\")) {\n SuperActivityToast.create(ConsumerCheckOutActivity.this)\n .setProgressBarColor(Color.WHITE)\n .setText(\"Your Order is received\")\n .setDuration(Style.DURATION_SHORT)\n .setFrame(Style.FRAME_KITKAT)\n .setColor(getResources().getColor(R.color.colorWhite))\n .setTextColor(getResources().getColor(R.color.colorBlack))\n .setAnimations(Style.ANIMATIONS_FLY).show();\n\n AlertDialog.Builder builder = new AlertDialog.Builder(ConsumerCheckOutActivity.this);\n LayoutInflater inflater = getLayoutInflater();\n View dialogLayout = inflater.inflate(R.layout.consumer_checkout_dialogue, null);\n TextView header = dialogLayout.findViewById(R.id.header);\n TextView subHeader = dialogLayout.findViewById(R.id.subHeader);\n Button trackOrderButton = dialogLayout.findViewById(R.id.trackOrderButton);\n trackOrderButton.setVisibility(View.GONE);\n Button exploreFoodButton = dialogLayout.findViewById(R.id.exploreFoodButton);\n RecyclerView recyclerView = dialogLayout.findViewById(R.id.recyclerView);\n header.setTypeface(RobotoBold);\n subHeader.setTypeface(poppinsMedium);\n subHeader.setText(\"Invoice No: \" + getOrderNoWithDashes(orderID, \"-\", 4));\n\n trackOrderButton.setTypeface(poppinsBold);\n exploreFoodButton.setTypeface(poppinsBold);\n\n builder.setView(dialogLayout);\n AlertDialog alertDialog = builder.create();\n trackOrderButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n\n alertDialog.dismiss();\n Intent intent = new Intent(ConsumerCheckOutActivity.this, TrackOrderActivity.class);\n intent.putExtra(\"OrderID\", orderID);\n intent.putExtra(\"From\", \"Checkout\");\n startActivity(intent);\n finish();\n }\n });\n exploreFoodButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n alertDialog.dismiss();\n Intent intent = new Intent(ConsumerCheckOutActivity.this, ConsumerMainActivity.class);\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n startActivity(intent);\n finish();\n }\n });\n getOrdersListFromInvoiceNumber(orderID, recyclerView, alertDialog);\n alertDialog.show();\n alertDialog.setCanceledOnTouchOutside(false);\n } else {\n SuperActivityToast.create(ConsumerCheckOutActivity.this)\n .setProgressBarColor(Color.WHITE)\n .setText(\"Your Payment has beed failed\")\n .setDuration(Style.DURATION_SHORT)\n .setFrame(Style.FRAME_KITKAT)\n .setColor(getResources().getColor(R.color.colorWhite))\n .setTextColor(getResources().getColor(R.color.colorBlack))\n .setAnimations(Style.ANIMATIONS_FLY).show();\n\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }\n }", "@Override\n public void sure() {\n orderListAdpater.notifyDataSetChanged();\n onOrderUpdate();\n }", "public boolean cakeOrdered() {\n\t\tordered = true;\n\t\tSystem.out.println(\"Your \" +name+ \" order has been placed\");\n\t\treturn ordered;\n\t}", "Order placeNewOrder(Order order, Project project, User user);", "public void submitOrder(View view) {\n\n EditText nameField = (EditText) findViewById(R.id.name_field);\n String name = nameField.getText().toString();\n //Figure out if you want to add whipped cream\n CheckBox whippedCream = (CheckBox) findViewById(R.id.whipped_cream_checkbox);\n Boolean hasWhippedCream = whippedCream.isChecked();\n //Figure out if you want to add chocolate\n CheckBox chocolate = (CheckBox) findViewById(R.id.chocolate_checkbox);\n Boolean hasChocolate = chocolate.isChecked();\n\n int price = calculatePrice(hasWhippedCream, hasChocolate);\n\n// // Log.v(\"MainActivity\", \"This price is \" + price);\n\n String priceMessage = createOrderSummary(name, price, hasWhippedCream, hasChocolate);\n\n\n// composeEmail(\"jsbaidwan@gmail.com\", name, priceMessage);\n displayText(priceMessage);\n }", "public boolean VerifyProductDisplayed_OrderConfirmation() {\n\t\t\n\t\tboolean flag = false;\n\t\tflag=CommonVariables.CommonDriver.get().findElement(OrderConfirmationScreen_OR.PRODUCTIMAGE).isDisplayed();\n\t\tif(flag){\n\t\t\textentLogs.pass(\"VerifyProductImageDisplayedInConfirmationPage\", \"Displayed\");\n\t\t}else{extentLogs.fail(\"VerifyProductImageDisplayedInConfirmationPage\", \"NotDisplayed\");\t\t}\n\treturn flag;\n\t\t}", "public void submitOrder(){\t\n\t\tSharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);\n\t\tint tableNumber = Integer.parseInt(sharedPref.getString(\"table_num\", \"\"));\n\t\t\n\t\tif(menu != null){\n\t\t\tParseUser user = ParseUser.getCurrentUser();\n\t\t\tParseObject order = new ParseObject(\"Order\");\n\t\t\torder.put(\"user\", user);\n\t\t\torder.put(\"paid\", false);\n\t\t\torder.put(\"tableNumber\", tableNumber); // Fix this -- currently hard coding table number\n\t\t\t\n\t\t\tParseRelation<ParseObject> items = order.getRelation(\"items\");\n\t\t\t\n\t\t\tfor(ParseObject item : selectedItems) {\n\t\t\t\titems.add(item);\n\t\t\t}\n\t\t\t\n\t\t\torder.saveInBackground(new SaveCallback(){\n\n\t\t\t\t@Override\n\t\t\t\tpublic void done(ParseException e) {\n\t\t\t\t\tif(e == null){\n\t\t\t\t\t\tToast.makeText(getApplicationContext(), \"Order Submitted!\", 5).show();\n\t\t\t\t\t\tfinish();\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tToast.makeText(getApplicationContext(), \"Submitting Order Failed!\", 5).show();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t});\n\t\t}\n\t}", "private void addOrder() {\r\n // Variables\r\n String date = null, cust_email = null, cust_location = null, product_id = null;\r\n int quantity = 0;\r\n\r\n // Date-Time Format \"YYYY-MM-DD\"\r\n DateTimeFormatter dateFormatter = DateTimeFormatter.ISO_LOCAL_DATE;\r\n boolean date_Valid = false;\r\n\r\n // Separator for user readability\r\n String s = \"----------------------------------------\"; // separator\r\n\r\n boolean user_confirmed = false;\r\n while (!user_confirmed) {\r\n\r\n // module header\r\n System.out.println(s);\r\n System.out.println(\"Adding Order: \");\r\n System.out.println(s);\r\n\r\n // Getting the user date for entry\r\n System.out.print(\"Enter Date(YYYY-MM-DD): \");\r\n date = console.next();\r\n //This while loop will check if the date is valid\r\n while (!date_Valid) {\r\n try {\r\n LocalDate.parse(date, dateFormatter);\r\n System.out.println(\"Validated Date\");\r\n date_Valid = true;\r\n } catch (DateTimeParseException e) {\r\n date_Valid = false;\r\n System.out.println(\"Invalid Date\");\r\n System.out.print(\"Enter valid date(YYYY-MM-DD):\");\r\n date = console.next();\r\n }\r\n }\r\n\r\n // Getting user email\r\n System.out.print(\"Enter customer email: \");\r\n cust_email = console.next();\r\n boolean flag = false;\r\n int countr = 0, countd = 0;\r\n while(!flag) {\r\n //This loop will check if the email is valid\r\n for (int i = 0; i < cust_email.length(); i++) {\r\n if (cust_email.charAt(i) == '@') {\r\n countr++;\r\n if (countr > 1) {\r\n flag = false;\r\n break;\r\n }\r\n if (i >= 1) flag = true;\r\n else {\r\n flag = false;\r\n break;\r\n }\r\n\r\n }\r\n if (cust_email.charAt(i) == '.') {\r\n countd++;\r\n if (countd > 1) {\r\n flag = false;\r\n break;\r\n }\r\n if (i >= 3) flag = true;\r\n else {\r\n flag = false;\r\n break;\r\n }\r\n }\r\n if (cust_email.indexOf(\".\") - cust_email.indexOf(\"@\") >= 2) {\r\n flag = true;\r\n }\r\n if (!flag) break;\r\n }\r\n if (flag && cust_email.length() >= 5) {\r\n System.out.println(\"Validated Email\");\r\n break;\r\n } else {\r\n System.out.println(\"Invalid Email\");\r\n }\r\n }\r\n\r\n //Validate the customer ZIP code\r\n System.out.print(\"Enter ZIP Code: \");\r\n cust_location = console.next();\r\n while((cust_location.length()) != 5){\r\n System.out.println(\"ZIP Code must be 5 characters long\");\r\n System.out.print(\"Enter ZIP Code: \");\r\n cust_location = console.next();\r\n }\r\n\r\n // Validate product id\r\n System.out.print(\"Enter Product ID: \");\r\n product_id = console.next();\r\n while ((product_id.length()) != 12) {\r\n System.out.println(\"Product ID must be 12 characters long!\");\r\n System.out.print(\"Enter Product ID: \");\r\n product_id = console.next();\r\n }\r\n\r\n // Validate quantity\r\n System.out.print(\"Enter Quantity: \");\r\n while (!console.hasNextInt()) {\r\n System.out.println(\"Quantity must be a whole number!\");\r\n System.out.print(\"Enter Quantity: \");\r\n console.next();\r\n }\r\n quantity = console.nextInt();\r\n\r\n //Confirming Entries\r\n System.out.println(s);\r\n System.out.println(\"You entered the following values:\");\r\n System.out.println(s);\r\n System.out.printf(\"%-11s %-20s %-20s %-18s %-11s\\n\", \"|DATE:|\", \"|CUSTOMER EMAIL:|\", \"|CUSTOMER LOCATION:|\", \"|PRODUCT ID:|\", \"|QUANTITY:|\");\r\n System.out.printf(\"%-11s %-20s %-20s %-18s %11s\\n\", date, cust_email, cust_location, product_id, quantity);\r\n System.out.println(s);\r\n System.out.println(\"Is this correct?\");\r\n System.out.print(\"Type 'yes' to add this record, type 'no' to start over: \");\r\n String inp = console.next();\r\n boolean validated = false;\r\n while (validated == false) {\r\n if (inp.toLowerCase().equals(\"yes\")) {\r\n validated = true;\r\n user_confirmed = true;\r\n }\r\n else if (inp.toLowerCase().equals(\"no\")) {\r\n validated = true;\r\n\r\n }\r\n else {\r\n System.out.print(\"Invalid response. Please type 'yes' or 'no': \");\r\n inp = console.next();\r\n }\r\n }\r\n }\r\n OrderItem newItem = new OrderItem(date, cust_email, cust_location, product_id, quantity);\r\n orderInfo.add(newItem);\r\n\r\n // alert user and get next step\r\n System.out.println(s);\r\n System.out.println(\"Entry added to Data Base!\");\r\n System.out.println(s);\r\n System.out.println(\"Do you want to add another entry?\");\r\n System.out.print(\"Type 'yes' to add another entry, or 'no' to exit to main menu: \");\r\n String inp = console.next();\r\n boolean valid = false;\r\n while (valid == false) {\r\n if (inp.toLowerCase().equals(\"yes\")) {\r\n valid = true;\r\n addOrder();\r\n } else if (inp.toLowerCase().equals(\"no\")) {\r\n valid = true; // possibly direct to main menu later\r\n } else {\r\n System.out.print(\"Invalid response. Please type 'yes' or 'no': \");\r\n inp = console.next();\r\n }\r\n }\r\n }", "@Override\n public void sure() {\n orderListAdpater.notifyDataSetChanged();\n onOrderUpdate();\n }", "public void placeRushOrder() throws SQLException {\n\t\tCart.getCart().checkAvailabilityOfProduct();\n\t}", "public void submitOrder(View view) {\n CheckBox whippedCreamCheckBox = (CheckBox) findViewById(R.id.whipped_cream_checkbox);\n boolean hasWhippedCream = whippedCreamCheckBox.isChecked();\n CheckBox chocolateCheckBox= (CheckBox) findViewById(R.id.chocolate_checkbox);\n boolean hasChocolate = chocolateCheckBox.isChecked();\n EditText nameField = (EditText)findViewById(R.id.name_field);\n\n /**getting the name */\n String name = nameField.getText().toString();\n\n /**calculating price*/\n int price=calculatePrice(hasWhippedCream,hasChocolate);\n\n /**creating order summary*/\n String priceMessage=createOrderSummary(price,hasWhippedCream,hasChocolate,name);\n\n Intent intent = new Intent(Intent.ACTION_SEND);\n intent.setType(\"*/*\");\n intent.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.order_summary_email_subject,name));\n intent.putExtra(Intent.EXTRA_TEXT,priceMessage);\n if (intent.resolveActivity(getPackageManager()) != null) {\n startActivity(intent);\n }\n }", "public boolean VerifyOrderConfirmation_UponDeliverySection() {\n\t\t\tboolean flag = false;\n\t\t\t\n\t\t\tflag=CommonVariables.CommonDriver.get().findElement(OrderConfirmationScreen_OR.UPONDELIVERY_SECTION).isDisplayed();\n\t\t\tif(flag){extentLogs.pass(\"VerifyUponDeliverySection\", \"UponDeliverySectionIsDisplayed\");\n\t\t }else{extentLogs.fail(\"VerifyUponDeliverySection\", \"UponDeliverySectionIsNotDisplayed\");}\n\t\t\t\n\t\t\treturn flag;\n\t\t}", "@Override\n\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\tboolean allOK = true;//boolean allOk is set to true\n\t\t\t\t\tString order = orderTextField.getText();//get text within the textfield\n\t\t\t\t\tif (order.equals(\"\")) {//if the textfield is blank nothing happens...\n\t\t\t\t\t\tallOK=false;\n\t\t\t\t\t}\n\t\t\t\t\tif (allOK==true) {//if allOk is set to true then....\n\t\t\t\t\t\t//Order orders = new Order(order);//\n\t\t\t\t\t\tRestaurant.runMyRestaurant(order);//Restaurant class is called\n\t\t\t\t\t}\n\t\t\t\t\t}", "public void cancelOrder() {\n order.clear();\n }", "@Override\n\tpublic void placeOrder() {\n\t\t\n\t}", "@Override\n\tpublic void takeNewOrder() {\n\t\tif(customersInLine.size()>0&&wait==0){\n\t\t\tint customerSelectedIndex = 0;\n\t\t\tfor(int i=0; i<customersInLine.size(); i++){\n\t\t\t\tif(customersInLine.get(i).getTimeToPrepare()<customersInLine.get(customerSelectedIndex).getTimeToPrepare()){\n\t\t\t\t\tcustomerSelectedIndex = i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tsetWait(customersInLine.get(customerSelectedIndex).getTimeToPrepare());\n\t\t\taddToProfit(customersInLine.get(customerSelectedIndex).getCostOfOrder());\n\t\t\tcustomersInLine.remove(customerSelectedIndex);\n\t\t\tcustomersInRestaurant--;\n\t\t}\n\t}", "private boolean promptNewOrder(String productName) {\r\n System.out.println(\"It doesn't look like you've placed this order before. \"\r\n + \"Would you like to place a new order for - \" + productName + \"?\\n\"\r\n + \"ENTER \\\"YES\\\" to Place a New Order or \\\"NO\\\" to continue.\");\r\n boolean responseIsYes;\r\n try {\r\n responseIsYes = scan.next().equalsIgnoreCase(\"yes\");\r\n } \r\n //if the user does not type anything, default to \"Yes\"\r\n catch(java.util.NoSuchElementException e){\r\n responseIsYes = true;\r\n }\r\n if (responseIsYes) {\r\n System.out.println(\"Thank you! A new Order will be placed.\\n\"\r\n + \"----------------------------------------------------------\");\r\n return true;\r\n }\r\n System.out.println(\"Thank you! This order has been cancelled.\\n\"\r\n + \"----------------------------------------------------------\");\r\n return false;\r\n }", "public static boolean collectOrder(int foodItemNumber) {\n\t\tif (!checkStatus((foodItemNumber))) {\n\t\t\tRandom r = new Random();\n\t\t\tSystem.out.println(\"Sorry this \" + Menu.getDishName(foodItemNumber)\n\t\t\t\t\t+ \" is unavailable, Check our top other dishes \" + Menu.getDishName(r.nextInt(18) + 1));\n\t\t\treturn false;\n\t\t} else {\n\t\t\torder.add(foodItemNumber); // if there is availability we add the foodItemNumber in Order ArrayList.\n\t\t}\n\t\treturn true;\n\n\t}", "@Test\n\tpublic void testOrder() {\n\t\t\n\t\tDateFormat df1 = new SimpleDateFormat(\"yyyy-MM-dd\");\t\t\n\t\tDate date = null;\n\t\ttry {\n\t\t\tdate = df1 .parse(\"2021-10-15\");\n\t\t} catch (ParseException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tshoppingCart = new ShoppingCart();\n\t\tshoppingCart.setExpiry(date);\n\t\tshoppingCart.setUserId(11491);\n\t\tshoppingCart.setItems(shoppingCartSet);\n\t\t\n\t\torder.setId(1);\n\t\torder.setShoppingCart(shoppingCart);\n\t\t\n\t\ttry {\n\t\t\tassertEquals(orderService.order(order), 1);\n\t\t\t\n\t\t} catch (OrderException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n public void onSuccess() {\n Toast.makeText(context, \"Successfully ordered\", Toast.LENGTH_SHORT).show();\n\n }", "@Override\n public void onSuccess(Location location) {\n if (location != null) {\n latitude = location.getLatitude();\n longitude = location.getLongitude();\n finalList = adapter.getMenu();\n Order newOrder = new Order();\n newOrder.setVendor(Id);\n newOrder.setCustomer(userID);\n newOrder.setCustomerLocation(latitude+\",\"+longitude);\n newOrder.setVendorName(curr.getName());\n newOrder.setDate(new SimpleDateFormat(\"dd/MM/yyyy\", Locale.getDefault()).format(new Date()));\n HashMap<String, CartItem> newCart = new HashMap<>();\n float amount = 0;\n for (MenuItem item : finalList) {\n if (!item.getQuantity().equals(\"0\")) {\n amount += Integer.parseInt(item.getQuantity()) * Integer.parseInt(item.getPrice());\n newCart.put(item.getName(), new CartItem(item.getPrice(), item.getQuantity()));\n }\n }\n if(newCart.size()==0)\n {\n Toast.makeText(restrauntPage.this, \"Please add atleast 1 item\", Toast.LENGTH_SHORT).show();\n return;\n }\n amount = amount * 1.14f;\n newOrder.setTotalAmount(String.valueOf(amount));\n newOrder.setItemsOrdered(newCart);\n Log.d(\"checkout\", newOrder.toString());\n Intent mainIntent = new Intent(restrauntPage.this, paymentOrder.class);\n mainIntent.putExtra(\"order\",newOrder);\n mainIntent.putExtra(\"userId\",userID);\n mainIntent.putExtra(\"userInfo\",currUser);\n startActivity(mainIntent);\n finish();\n }\n }", "@Override\n\tpublic void placeOrder(Map<String, Integer> orderDetails, Buyer buyer) {\n\t\tif (successor != null) {\n\t\t\tsuccessor.placeOrder(orderDetails, buyer);\n\t\t} else {\n\t\t\tSystem.out.println(\"Did not set successor of SupplierProxy\");\n\t\t}\n\t\t\n\t}", "@Override\n public void clickPositive() {\n meetingManager.undoConfirm(chosenTrade, chosenTrader);\n Toast.makeText(this, \"Successfully undo confirm\", Toast.LENGTH_SHORT).show();\n viewList();\n\n }", "public void submitOrder(View view) {\n\n CheckBox whippedCreamCheckBox = (CheckBox) findViewById(R.id.whipped_cream_checkbox);\n boolean hasWhippedCream = whippedCreamCheckBox.isChecked();\n\n CheckBox chocolateCheckBox = (CheckBox) findViewById(R.id.chocolate);\n boolean hasChocolateChecked = chocolateCheckBox.isChecked();\n EditText editText = (EditText) findViewById(R.id.name);\n String name = editText.getText().toString();\n createOrderSummary(quantity, hasWhippedCream, hasChocolateChecked, name);\n\n\n }", "public void submitOrder(View view) {\n\n //For cream CheckBox\n CheckBox checkCream = findViewById(R.id.whipped_cream_check_box);\n boolean hasWhippedCream = checkCream.isChecked();\n //For chocolate CheckBox\n CheckBox checkChocolate = findViewById(R.id.chocolate_check_box);\n boolean hasChocolate = checkChocolate.isChecked();\n\n //For entering your name\n EditText editName = findViewById(R.id.enter_name_edit_text);\n\n int price = calculatePrice(hasWhippedCream, hasChocolate);\n\n String summary = createOrderSummary(price, hasWhippedCream, hasChocolate);\n\n nameChecker(editName, summary);\n }", "@Override\n\tprotected String showConfirmation() {\n\t\treturn \"Payment is successful. Check your credit card statement for PetSitters, Inc.\";\n\t}", "public boolean VerifyOrderConfirmation_ThankYouMessage() {\n\t\tboolean flag = false;\n\t\t\n\t\tflag=CommonVariables.CommonDriver.get().findElement(OrderConfirmationScreen_OR.THANKYOU_LABEL).isDisplayed();\n\t\tif(flag){extentLogs.pass(\"VerifyOrderDetails\", \"OrderConfirmationIsDisplayed\");\n\t }else{extentLogs.fail(\"VerifyOrderDetails\", \"OrderNumberLabelIsNotDisplayed\");}\n\t\t\n\t\treturn flag;\n\t}", "@Override\n\tpublic void msgReadyToOrder(Customer customerAgent) {\n\t\t\n\t}", "public void confirmFlight();", "public void placeOrder(TradeOrder order) {\r\n\t\tString msg = \"New order: \";\r\n\t\tif (order.isBuy()) {\r\n\t\t\tbuy.add(order);\r\n\t\t\tmsg += \"Buy \";\r\n\r\n\t\t}\r\n\r\n\t\tif (order.isSell()) {\r\n\t\t\tsell.add(order);\r\n\t\t\tmsg += \"Sell \";\r\n\t\t}\r\n\r\n\t\tmsg += this.getSymbol() + \" (\" + this.getName() + \")\";\r\n\t\tmsg += \"\\n\" + order.getShares() + \" shares at \";\r\n\r\n\t\tif (order.isLimit())\r\n\t\t\tmsg += money.format(order.getPrice());\r\n\t\telse\r\n\t\t\tmsg += \"market\";\r\n\t\tdayVolume += order.getShares();\r\n\t\torder.getTrader().receiveMessage(msg);\r\n\t\t\r\n\t}", "@Override\n public void sure() {\n orderListAdpater.notifyDataSetChanged();\n onOrderUpdate();\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n if(e.getSource()==autopay){\n model.getCustomer().getOrder().orderStatus=OrderStatus.paid;\n dispose();\n }\n\n if(e.getSource()==Paywithanothercard){\n if(model.getCustomer().getOrder().orderStatus.name().equals(\"unpaid\")){\n //String orNUm=model.getCustomer().or.orderNumber;\n new Payment(model.getCustomer().getOrder(),model.getCustomer().getOrder().orderType);\n // System.out.println(model.getCustomer().or.orderNumber+\" \"+model.getCustomer().or.orderStatus);\n }else{\n JOptionPane.showMessageDialog(this,\n \"Your order has paied\", \"Error Message\",\n JOptionPane.ERROR_MESSAGE);\n }\n dispose();\n }\n\n\n if(e.getSource()==cancel){\n dispose();\n }\n\n }", "public void submitOrder(View view) {\n //int price = calculatePrice();\n String priceMessage = createOrderSummary();\n\n displayMessage(priceMessage);\n\n }", "public void clearOrder()\r\n\t{\r\n\t\tsubtotal = new BigDecimal(\"0.0\");\r\n\t\torderSize = 0;\r\n\t\tSystem.out.println(\"Starting a new order\");\r\n\t\tModelEvent me = new ModelEvent(this,0,\"New Order\",0);\r\n\t\tnotifyChanged(me);\r\n\t}", "private void showOrderDetails(Order order) {\n\t\tString status, shownOption;\n\n\t\tif (order.getStatus()) {\n\t\t\tstatus = new String();\n\t\t\tstatus = \"Processed\";\n\n\t\t\tshownOption = new String();\n\t\t\tshownOption = \"Return\";\n\t\t}\n\t\telse {\n\t\t\tstatus = new String();\n\t\t\tshownOption = new String();\n\n\t\t\tstatus = \"Pending\";\n\t\t\tshownOption = \"Set Processed\";\n\t\t}\n\n\t\tString orderDetailsMessage = \"ORDER DATE : \" + order.getDate();\n\t\torderDetailsMessage += \"\\nSTATUS: \" + status;\n\t\torderDetailsMessage += \"\\nITEMS: \";\n\t\tfor (StockItem stockItem : order.getOrderEntryList()) {\n\t\t\torderDetailsMessage += \"\\n \" + stockItem.getQuantity() + \" \\t x \\t \"\n\t\t\t\t\t+ stockItem.getProduct().getProductName() + \" \\t\\t\\t Subtotal: \\t\\u20ac\"\n\t\t\t\t\t+ (stockItem.getProduct().getRetailPrice() * stockItem.getQuantity());\n\t\t}\n\n\t\torderDetailsMessage += \"\\n\\nCUSTOMER ID: \" + order.getPerson().getId()\n\t\t\t\t+ \"\\nPersonal Details: \";\n\t\torderDetailsMessage += \"\\n Name: \\t\" + order.getPerson().getName();\n\t\torderDetailsMessage += \"\\n Phone: \\t\" + order.getPerson().getContactNumber();\n\t\torderDetailsMessage += \"\\n Address: \\t\" + order.getPerson().getAddress();\n\t\torderDetailsMessage += \"\\n\\nThe total order value is \\t\\u20ac\"\n\t\t\t\t+ order.getGrandTotalOfOrder() + \"\\n\";\n\n\t\tObject[] options = { \"OK\", shownOption };\n\t\tint n = JOptionPane.showOptionDialog(null, orderDetailsMessage, \"ORDER ID: \"\n\t\t\t\t+ (order.getId()) + \" STAFF ID: \" + order.getCurrentlyLoggedInStaff().getId()\n\t\t\t\t+ \" STATUS : \" + status /* order.isStatus() */, JOptionPane.YES_NO_OPTION,\n\t\t\t\tJOptionPane.PLAIN_MESSAGE, null, options, options[0]);\n\t\tif (n == 1) {\n\t\t\torder.setStatus(true);\n\t\t}\n\t}", "@After\n \tpublic void confirm() {\n \t\tcheckGlobalStatus();\n \n \t\tIterator<CyNetworkView> viewIt = viewManager.getNetworkViewSet().iterator();\n \n \t\tCyNetworkView view = viewIt.next(); \n \t\tCyNetwork network = view.getModel();\n \t\t\n \t\tcheckNetwork(network);\n \t\tcheckNetworkView(network);\n \t\tcheckAttributes(network);\n \t}", "private static void placeOrder() {\n System.out.println();\n System.out.println(\"Menu : \");\n for (int i = 0; i < menuItems.length; i++) {\n System.out.printf(\"%2d. %-30s Price: %8.2f Baht%n\", i + 1, menuItems[i], menuPrices[i]);\n }\n System.out.println();\n\n int orderNo = getIntReply(\"What would you like to menuOrder (by menu number)\");\n if (orderNo > menuOrder.length || orderNo == -1) {\n System.out.println(\"Invalid menu number\");\n return;\n }\n\n int amount = getIntReply(\"How many of them\");\n if (amount == -1) return;\n menuOrder[orderNo - 1] += amount;\n\n System.out.printf(\"You've ordered %s for %d piece(s)%n%n\", menuItems[orderNo - 1], menuOrder[orderNo - 1]);\n }", "@RequestMapping(value =\"/customer/place_order\", method = RequestMethod.POST)\n public String placeOrder(ModelMap model, Order order, @RequestParam(\"code\") String code) {\n logger.info(\"*** OrderController - placeOrder ***\");\n Product product = productService.getProduct(code);\n order.setProduct(product);\n order.setStatus(\"completed\");\n order.setOrderDate(new Date());\n Order completedOrder = orderService.placeOrder(order);\n if(!completedOrder.equals(null)){\n productService.updateInventory(product,order.getQuantity());\n }\n model.addAttribute(\"completedOrder\", completedOrder);\n return \"success\";\n }" ]
[ "0.78760105", "0.78760105", "0.78760105", "0.7182954", "0.68532336", "0.6785615", "0.67327917", "0.66307646", "0.6629908", "0.6542727", "0.65344644", "0.6531347", "0.65032864", "0.6486623", "0.6434336", "0.6423407", "0.64063853", "0.6371122", "0.63462883", "0.62941474", "0.6290549", "0.6281975", "0.62592787", "0.62431794", "0.6239434", "0.6239434", "0.6235618", "0.62306064", "0.62232816", "0.62230563", "0.6220654", "0.62047905", "0.61963975", "0.61949116", "0.618786", "0.6156544", "0.6099043", "0.6085891", "0.60563695", "0.6042414", "0.6040604", "0.6033111", "0.6031723", "0.6029595", "0.6029595", "0.6019331", "0.6013101", "0.60050935", "0.59965205", "0.59780914", "0.59695166", "0.59321666", "0.59190947", "0.59126407", "0.5911754", "0.5900974", "0.58840823", "0.5872612", "0.5868783", "0.5860708", "0.58549416", "0.58543396", "0.58458495", "0.5841154", "0.5831882", "0.58309084", "0.58273077", "0.5823217", "0.5813227", "0.5802966", "0.57997906", "0.5799646", "0.5794594", "0.5789342", "0.5764621", "0.57579774", "0.57551503", "0.57506406", "0.5749793", "0.57496053", "0.5748894", "0.57465184", "0.5746063", "0.5732187", "0.5730463", "0.57257533", "0.5725125", "0.57197714", "0.5712434", "0.5707656", "0.57075596", "0.5705479", "0.5701401", "0.5700421", "0.5697822", "0.5691966", "0.5691867", "0.5691151", "0.56881416", "0.5687681" ]
0.60060793
47
Init method needed by superclass
@Override public void init(GameContainer gc) throws SlickException { // Initialization of map, camera, player, pathfinding theMap = new TiledMap("res/tilemap01.tmx"); thePTBMap = new PropertyTileBasedMap(theMap); camera = new Camera(0f, 0f); unitOne = new Player(64f, 64f); unitTwo = new Player(64f, 128f); pathFinder = new AStarPathFinder(thePTBMap, 100, false); // player's animation. Need a better way to deal with it int duration[] = {200, 200, 200}; SpriteSheet character = new SpriteSheet("res/monsters.png", tileSize, tileSize); Image[] walkUp = {character.getSubImage(6, 1), character.getSubImage(7, 1), character.getSubImage(8, 1)}; Image[] walkDown = {character.getSubImage(0, 1), character.getSubImage(1, 1), character.getSubImage(2, 1)}; Image[] walkLeft = {character.getSubImage(9, 1), character.getSubImage(10, 1), character.getSubImage(11, 1)}; Image[] walkRight = {character.getSubImage(3, 1), character.getSubImage(4, 1), character.getSubImage(5, 1)}; movingUp = new Animation(walkUp, duration, true); movingDown = new Animation(walkDown, duration, true); movingLeft = new Animation(walkLeft, duration, true); movingRight = new Animation(walkRight, duration, true); unitOne.setMovement(movingDown); unitTwo.setMovement(movingDown); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void init() {\r\n\t\t// to override\r\n\t}", "@Override public void init()\n\t\t{\n\t\t}", "protected void init() {\n // to override and use this method\n }", "@Override\n protected void init() {\n }", "@Override\r\n\tpublic void init() {}", "@Override\n\t\tpublic void init() {\n\t\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "protected void init() {\n }", "@Override\r\n\tpublic final void init() {\r\n\r\n\t}", "@Override\n public void init() {\n\n super.init();\n\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\r\n\tpublic void init()\r\n\t{\n\t}", "protected void _init(){}", "@Override // opcional\n public void init(){\n\n }", "@Override\n public void init() {}", "@Override\n public void init() {\n }", "@Override\r\n\tpublic void init() {\n\t\tsuper.init();\r\n\t}", "protected void init() {\n\t}", "protected void init() {\n\t}", "protected abstract void init();", "protected abstract void init();", "protected abstract void init();", "protected abstract void init();", "protected abstract void init();", "protected abstract void init();", "protected abstract void init();", "protected abstract void init();", "protected abstract void init();", "protected abstract void init();", "protected abstract void init();", "@Override\n\tpublic void init()\n\t{\n\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 init() {\n\t}", "@Override\n void init() {\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 public void init() {\n }", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "public void init() {\n\t\t}", "abstract public void init();", "public void init()\n\t{\n\t\tsuper.init();\n\t\tM_log.info(\"init()\");\n\t}", "public void init()\n\t{\n\t\tsuper.init();\n\t\tM_log.info(\"init()\");\n\t}", "public void init() {\r\n\r\n\t}", "public void init() {\n \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}", "public void init(){}", "@objid (\"4bb3363c-38e1-48f1-9894-6dceea1f8d66\")\n public void init() {\n }", "public void init() {\n\n\t}", "public void init() {\n\n\t}", "public void init() {\n\n\t}", "public void init() { }", "public void init() { }", "protected void initialize() {}", "protected void initialize() {}", "public abstract void init();", "public abstract void init();", "public abstract void init();", "public abstract void init();", "public abstract void init();", "public abstract void init();", "public abstract void init();", "public abstract void init();", "public abstract void init();", "public abstract void init();", "private void init() {\n }", "private void init() {\n }", "private void init() {\n }", "private void init() {\n }", "public void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "private void init() {\n\n\t}", "public void init() {\n\t\t \r\n\t\t }", "public void init() {\n }", "public void init() {\n }", "public void init() {\n }", "public void init() {\n }", "public void init() {}", "public void init() {}", "public void init() {\n\t\n\t}", "private void init() {\n }", "public void init() {\n\t}", "public void init() {\n\t}", "public void init() {\n\t}", "public void init(){\n \n }", "protected void initialize() {\n \t\n }", "protected void init() {\n init(null);\n }", "public void initialize(){\n\t\t//TODO: put initialization code here\n\t\tsuper.initialize();\n\t\t\n\t}", "@Override\n\tpublic synchronized void init() {\n\t}", "public void init()\n {\n }", "public void init(){\r\n\t\t\r\n\t}" ]
[ "0.8782944", "0.8702502", "0.8680855", "0.84756577", "0.84680706", "0.8453265", "0.84442824", "0.8441557", "0.84259987", "0.8403", "0.8377815", "0.83496046", "0.83496046", "0.83496046", "0.8333764", "0.8320961", "0.83188784", "0.8314994", "0.83135855", "0.8306018", "0.82572806", "0.82572806", "0.82501084", "0.82501084", "0.82501084", "0.82501084", "0.82501084", "0.82501084", "0.82501084", "0.82501084", "0.82501084", "0.82501084", "0.82501084", "0.8247192", "0.8203803", "0.8203803", "0.8203803", "0.814304", "0.81288373", "0.81258893", "0.81258893", "0.81258893", "0.81258893", "0.81258893", "0.8096757", "0.80783004", "0.80783004", "0.8077705", "0.8055032", "0.805408", "0.805408", "0.799673", "0.7990919", "0.7956941", "0.7956941", "0.7956941", "0.79560995", "0.79385865", "0.79287153", "0.79287153", "0.79287153", "0.7919788", "0.7919788", "0.7912808", "0.7912808", "0.7907614", "0.7907614", "0.7907614", "0.7907614", "0.7907614", "0.7907614", "0.7907614", "0.7907614", "0.7907614", "0.7907614", "0.7904615", "0.7904615", "0.7904615", "0.7904615", "0.78996855", "0.7888406", "0.7884555", "0.78661907", "0.7850731", "0.7850731", "0.7850731", "0.7850731", "0.784237", "0.784237", "0.78389573", "0.7837139", "0.78314394", "0.78314394", "0.78314394", "0.78190815", "0.77989954", "0.77944577", "0.7776986", "0.77739763", "0.7762234", "0.7759719" ]
0.0
-1