query
stringlengths 8
1.54M
| document
stringlengths 9
312k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
start the collapse of one node by the index. | public void startCollapse(GraphData data,int nodeNumber){
Vector edgesFromSource = data.findEdgesWithSource(nodeNumber);
Vector nodesToConnect = new Vector();
// data.nodes[nodeNumber].fixed=true;
Iterator i = edgesFromSource.iterator();
while (i.hasNext()){
Edge edge = (Edge) i.next();
// System.out.println("Collapsing edge of nodes :" + edge.from + "->" + edge.to);
Vector collapsedNodes = new Vector();
Vector nodesToAdd = collapse(data,edge.to,collapsedNodes);
nodesToConnect.addAll(nodesToAdd);
edge.isCollapsed = true;
Iterator k = collapsedNodes.iterator();
while(k.hasNext())
{
Node node = (Node) k.next();
node.isCollapsed = true;
node.collapseSource = nodeNumber;
node.collapseDest = ((Integer)nodesToAdd.get(0)).intValue();
}
}
Iterator j = nodesToConnect.iterator();
while (j.hasNext()){
Integer nodeConnection = (Integer) j.next();
Edge edgeToAdd = new Edge();
edgeToAdd.from = nodeNumber;
edgeToAdd.to = nodeConnection.intValue();
data.virtualEdges.add(edgeToAdd);
}
} | [
"public void collapseAll(GraphData data) {\r\n \t\tIterator i = collapsingList.iterator();\r\n \t\twhile (i.hasNext())\r\n \t\t{\r\n \t\t\tint nodeToCollapse = ((Integer)i.next()).intValue(); \t\t\t\r\n \t\t\tthis.startCollapse(data,nodeToCollapse);\r\n \t\t}\r\n \t\t\r\n \t}",
"public void startVirtualCollapse(GraphData data,int nodeNumber){\r\n \t\tVector edgesFromSource = data.findEdgesWithSource(nodeNumber);\r\n \t\tVector nodesToConnect = new Vector();\r\n \t\t\r\n \t\tIterator i = edgesFromSource.iterator();\r\n \t\twhile (i.hasNext())\r\n \t\t{\r\n \t\t\tEdge edge = (Edge) i.next();\r\n \t\t\tint lastLeafOrJunction = virtualCollapse(data,nodeNumber,edge.to,edge.len);\r\n \t\t}\r\n \t\t\r\n \t}",
"public void addNodeToCollapseList(int i){\r\n \t\tif (!collapsingList.contains(new Integer(i))){\r\n\t\t\t\tcollapsingList.add(new Integer(i));\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tcollapsingList.remove(new Integer(i));\r\n \t}",
"public void collapse() {\n if (isExpanded()) triggerNodeHandlerClick();\n\n Graphene.waitAjax().until(isCollapsedCondition());\n }",
"private void connectWithMaster(final int i, final int j) {\n if (i == 1) { uf.union(MASTER, toIndex(i, j)); }\n }",
"public void byIndex(int index) { se.selectByIndex(index); }",
"public void build(Index index);",
"public void nodeCollapse(CollapseEvent event);",
"private void sink(int idx) {\r\n\t\twhile (idx * 2 <= curPtr) {\r\n\t\t\tint child = idx * 2;\r\n\t\t\tif ((child) < curPtr && less(child + 1, child))\r\n\t\t\t\t/*\r\n\t\t\t\t * this is the key!!! to pop the minimal number compare the left\r\n\t\t\t\t * and right child!\r\n\t\t\t\t */\r\n\t\t\t\tchild++;\r\n\t\t\tif (less(idx, child))\r\n\t\t\t\tbreak;\r\n\t\t\texch(idx, child);\r\n\t\t\tidx = child;\r\n\t\t}\r\n\t}",
"public void fill(int idx) \r\n\t{ \r\n\t\r\n\t\t// If the next child(C[idx+1]) has more than t-1 keys, borrow a key \r\n\t\t// from that child \r\n\t\tif (idx!=keyTally && references[idx+1].keyTally>=m) \r\n\t\t\tborrowFromNext(idx); \r\n\t\t\r\n\t\t// If the previous child(C[idx-1]) has more than t-1 keys, borrow a key \r\n\t\t// from that child \r\n\t\telse if (idx!=0 && references[idx-1].keyTally>=m) \r\n\t\tborrowFromPrev(idx); \r\n\t\r\n\t\t// Merge C[idx] with its sibling \r\n\t\t// If C[idx] is the last child, merge it with with its previous sibling \r\n\t\t// Otherwise merge it with its next sibling \r\n\t\telse\r\n\t\t{ \r\n\t\t\tif (idx != keyTally) \r\n\t\t\t\tmerge(idx); \r\n\t\t\telse\r\n\t\t\t\tmerge(idx-1); \r\n\t\t} \r\n\t\treturn; \r\n\t}",
"public void selectAction() {\n\t\tList<MCTSNode> visited = new ArrayList<MCTSNode>();\n\t\tMCTSNode current = this;\n\t\tvisited.add(this);\n\n\t\t// Find a leaf node to expand (iterative)\n\t\twhile(!current.isLeaf()) {\n\t\t\tcurrent = current.select();\n\t\t\tvisited.add(current);\n\t\t}\n\t\tcurrent.expand(gameState.getMoves());\n\t\tMCTSNode newNode = current.select();\n//System.out.println(newNode==null);\n\t\tvisited.add(newNode);\n\t\tState state = simulate(newNode);\n\t\tfor(MCTSNode node : visited) {\n\t\t\tnode.updateStats(state);\n\t\t}\n\t}",
"public void expand() {\n if (isCollapsed()) triggerNodeHandlerClick();\n\n Graphene.waitAjax().until(isExpandedCondition());\n }",
"public abstract boolean setNodeExpanded(int nodeIndex,boolean true_is_yes);",
"public void makeAllCollapse(GraphData data){\r\n// \t\tSystem.out.println(\"Collapsing all..\");\r\n \t\tcollapsingList.clear();\r\n \t\tthis.collapsingList.add(new Integer(0));\r\n \t\tfor (int i=1;i<data.nnodes; i++){\r\n \t\t\tif ((data.nodes[i].inDegree > 1) || (data.nodes[i].outDegree>1))\r\n \t\t\t\t\tthis.collapsingList.add(new Integer(i));\r\n \t\t\t}\r\n \t\tthis.clearCollapseList(data);\r\n\t\tthis.unCollaspeAll(data);\r\n\t\tthis.collapseAll(data);\r\n \t}",
"private void collapse() {\n\t\tTreePath path = tree.getLeadSelectionPath();\n\t\tcollapseNode((ProgramNode) tree.getLastSelectedPathComponent());\n\t\texpandAction.setEnabled(!allPathsExpanded(path));\n\t\tcollapseAction.setEnabled(!allPathsCollapsed(path));\n\t}",
"private void disconnectNode(int index) {\n Node parentNode = getNodeParent(index);\n if (parentNode.next == tail) {\n cutTail(parentNode);\n } else {\n parentNode.next = parentNode.next.next;\n }\n }",
"private void reIndex()\n {\n for(int i = 0; i < NodeList.size(); i++)\n NodeList.get(i).setID(i);\n ID = NodeList.size();\n }",
"public void collapseTree() {\n for (int i = 1; i < resultsTree.getRowCount(); ++i) {\n resultsTree.collapseRow(i);\n }\n }",
"private void collapseAll() {\n int count = listAdapter.getGroupCount();\n for (int i = 0; i < count; i++){\n simpleExpandableListView.collapseGroup(i);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test method for toArray(E[]). When size is less. | @Test
public void testToArrayEArraySmallSize() {
list1.push("Test1");
list1.push("Test2");
list1.push("Test3");
String[] output = list1.toArray(new String[2]);
assertTrue(output.length == list1.size());
assertTrue(output[0].equals("Test1"));
assertTrue(output[1].equals("Test2"));
assertTrue(output[2].equals("Test3"));
} | [
"@Test\n\tpublic void testToArrayEArrayBigSize() {\n\t\tlist1.push(\"Test1\");\n\t\tlist1.push(\"Test2\");\n\t\tlist1.push(\"Test3\");\n\t\tString[] output = new String[6];\n\t\toutput = list1.toArray(output);\n\t\tassertTrue(output.length == 6);\n\t\tassertTrue(output[0].equals(\"Test1\"));\n\t\tassertTrue(output[1].equals(\"Test2\"));\n\t\tassertTrue(output[2].equals(\"Test3\"));\n\t}",
"@Test\r\n\tpublic void testToArray() {\r\n\t\tObject[] sample = list.toArray();\r\n\t\tAssert.assertEquals(15, sample.length);\r\n\t\tfor (int i = 0; i < sample.length; i++) {\r\n\t\t\tAssert.assertNotNull(sample[i]);\r\n\t\t}\r\n\t}",
"@Test\n\tpublic void testToArrayEArrayEqualSize() {\n\t\tlist1.push(\"Test1\");\n\t\tlist1.push(\"Test2\");\n\t\tlist1.push(\"Test3\");\n\t\tString[] output = new String[3];\n\t\toutput = list1.toArray(output);\n\t\tassertTrue(output.length == list1.size());\n\t\tassertTrue(output[0].equals(\"Test1\"));\n\t\tassertTrue(output[1].equals(\"Test2\"));\n\t\tassertTrue(output[2].equals(\"Test3\"));\n\t}",
"@Test\n public void testSize() {\n List list = ArrayToCollection.convertArrayToCollection(this.array);\n ArrayToCollectionTest.assertEquals((int)list.size(), (int)this.size);\n }",
"@Test\n\tvoid testToArray() {\n\t\tLinkedListIndexedCollection l1 = new LinkedListIndexedCollection();\n\t\t\n\t\tl1.add(7);\n\t\tl1.add(42);\n\t\tObject[] newArray = l1.toArray();\n\t\tObject[] trueArray = {7,42};\n\t\t\n\t\tassertArrayEquals(trueArray, newArray);\n\t}",
"@Test\n public void testToArray_0args() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2);\n instance.add(1);\n instance.add(2);\n instance.add(3);\n instance.add(4);\n instance.add(5);\n instance.add(6);\n\n Integer[] expResult = { 1, 2, 3, 4, 5, 6 };\n Object[] result = instance.toArray();\n assertArrayEquals(expResult, result);\n\n }",
"public void testCrearArrayEnForNoEspecificado(int size) {\n\t\tfor (int i = 1; i <= size; i++) { \n\t\t\tint[] array = new int[i]; //tempLocal = size : size >=1\t \n\t\t}\n\t}",
"@Test\n public void testToArray(){\n Object[] temp = list.toArray();\n assertAll(\n \"ToArray: check elements order and size of the list\",\n () -> assertEquals(list.size(), temp.length),\n () -> assertEquals(list.get(0), temp[0]),\n () -> assertEquals(list.get(1), temp[1])\n );\n }",
"@Test\n @SuppressWarnings(\"deprecation\")\n public void testToArray_0args() {\n System.out.println(\"toArray\");\n Bag<String> instance = new Bag<String>();\n instance.add(\"aaa\");\n instance.add(\"bbb\");\n Object[] expResult = new Object[2];\n expResult[0] = \"aaa\";\n expResult[1] = \"bbb\";\n Object[] result = instance.toArray();\n assertEquals(expResult, result);\n }",
"@Test\n public void testToArray_GenericType() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2);\n instance.add(1);\n instance.add(2);\n instance.add(3);\n instance.add(4);\n instance.add(5);\n instance.add(6);\n\n Integer[] expResult = { 1, 2, 3, 4, 5, 6 };\n Integer[] result = instance.toArray(new Integer[] {});\n assertArrayEquals(expResult, result);\n }",
"@Override\n @SuppressWarnings(\"SuspiciousToArrayCall\")\n public <T> T[] toArray(final T[] array) {\n return sizeIfKnown() >= 0 ? super.toArray(array) : SetOfUnknownSize.toArray(iterator(), array, false);\n }",
"@Test\n @SuppressWarnings(\"deprecation\")\n public void testToArray_ObjectArr() {\n System.out.println(\"toArray\");\n Object[] a = new Object[2];\n Bag<String> instance = new Bag<String>();\n instance.add(\"aaa\");\n instance.add(\"bbb\");\n Object[] expResult = new Object[2];\n expResult[0] = \"aaa\";\n expResult[1] = \"bbb\";\n Object[] result = instance.toArray(a);\n assertEquals(expResult, result);\n }",
"public static boolean isArray_estLength() {\n return false;\n }",
"@Test\n public void whenAddElementsThenCapacityIncreasedAndGetElementsForCheck() {\n for (int i = 6; i < 12; i++) {\n simpleArray.add(String.valueOf(i));\n }\n ArrayList<String> resultlist = new ArrayList<>();\n for (int i = 0; i < simpleArray.getSize(); i++) {\n resultlist.add(simpleArray.get(i));\n }\n ArrayList<String> checkList = new ArrayList<>(Arrays.asList(\"1\", \"2\", \"3\", \"4\", \"5\", \"6\",\n \"7\", \"8\", \"9\", \"10\", \"11\"));\n assertThat(resultlist, is(checkList));\n }",
"public void testCrearArrayEnForEspecificado(int size) {\n\t\tfor (int i = 1; i <= size; i++) { \n\t\t\tint[] array = new int[i]; //tempLocal = (size * (size + 1))/2\t\n\t\t}\n\t}",
"public void testGetArray() {\n assertTrue(\"Array returned is not correct.\", \n Arrays.equals(expected, array.getArray()));\n\n assertTrue(\"Array returned is not empty.\",\n Arrays.equals(new int[] {}, empty.getArray()));\n\n assertTrue(\"Copy array is not equal to original.\",\n Arrays.equals(expected, copy.getArray()));\n }",
"private void ensureCapacity(){\r\n\t\tif(elements.length == size){\r\n\t\t\telements = Arrays.copyOf(elements, 2*size + 1);\r\n\t\t}\r\n\t\t\r\n\t}",
"@Override\n public Object[] toArray() {\n return Arrays.copyOf(elements, size);\n }",
"private void checkForResize()\n {\n if(arraySize == arrayCapacity)\n {\n int copyIndex;\n arrayCapacity *=2;\n StudentClass[] temp = new StudentClass[arrayCapacity];\n for(copyIndex = 0; copyIndex <= arraySize; copyIndex++)\n {\n temp[copyIndex] = studentArray[copyIndex];\n }\n studentArray = temp;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Refreshes the panel with buttons that represents the current list of shapes found in the model. | private void refreshRemoveButtons() {
removeShapePanel.removeAll();
List<Shape> shapes = m.getShapesInModel();
JRadioButton[] removeRadioButtons = new JRadioButton[shapes.size()];
for (int i = 0; i < removeRadioButtons.length; i++) {
removeRadioButtons[i] = new JRadioButton(shapes.get(i).getName());
removeRadioButtons[i].setSelected(false);
removeShapeGroup.add(removeRadioButtons[i]);
removeShapePanel.add(removeRadioButtons[i]);
}
// button to execute the removal
JPanel removeShapeButtonAndDisplay = new JPanel();
removeShapeButtonAndDisplay.setLayout(new FlowLayout());
removeShapeButtonAndDisplay.add(removeShapeButton);
removeShapeButtonAndDisplay.add(removeShapeDisplay);
removeShapePanel.add(removeShapeButtonAndDisplay);
} | [
"private void refreshSelectionList() {\n dataForListOfShapes.clear();\n for (Shape s : m.getShapesInModel()) {\n dataForListOfShapes.addElement(s.getName());\n }\n }",
"public void redrawButtons(){\r\n \t\tthis.removeAll();\r\n \t\tmButtons = new buttonArray(mIval,mJval);\r\n \t\tmButtons.initArray();\r\n \t mButtons.randomiseButtons();\r\n \t mButtons.addToFrame(this);\r\n \t this.mLayoutManager.setColumns(mJval);\r\n \t this.mLayoutManager.setRows(mIval);\r\n \t this.repaint();\r\n \t this.revalidate();\r\n \t}",
"public void updateShapes(ArrayList<IWhiteboardShape> shapes) {\n this.shapes = shapes;\n this.repaint();\n }",
"private void updateCreateShapeButton() {\n IColoredShape current = oneShape.get(0);\n Color color = current.getColor();\n createShapeHelperButton.setActionCommand(\"addShape \" + currentShape.toString()\n + \" \" + name + \" \" + x + \" \" + y + \" \" + current.getWidth() + \" \" + current.getHeight()\n + \" \"\n + color.getRed() + \" \" + color.getGreen() + \" \" + color.getBlue());\n }",
"private void addShapesPanel(){\n shapesPanel = new ShapesPanel();\n add(shapesPanel);\n }",
"private void sync(){\n canvas.getGraphicsContext2D().clearRect(0, 0, canvas.getWidth(), canvas.getHeight());//clear the canvas first\n\n ObservableList<Shape> shapes = displayedData.getDisplayedShapes();\n if (shapes == null || shapes.isEmpty()){\n return;\n }\n\n GraphicsContext context = canvas.getGraphicsContext2D();\n for (Shape shape : shapes) {//draw shape\n shapeDrawer.drawShape(context, shape);\n }\n }",
"private void redraw()\n\t{\n\t\terase();\n\t\tfor(Iterator i=objects.iterator(); i.hasNext(); ) {\n ((ShapeDescription)shapes.get(i.next())).draw(graphic);\n }\n canvas.repaint();\n }",
"private void setNewShapesList() {\n newShapesList = new ArrayList<Shapes>();\n\n // iterate through model's shapes and create a\n // new list of shapes\n for (Shapes s : model.getShapes()) {\n Shapes newS = s;\n newShapesList.add(newS);\n }\n }",
"private void redraw()\n {\n erase();\n drawAxes(graphic);\n for (Object shape : objects) \n {\n shapes.get(shape).draw(graphic);\n }\n canvas.repaint();\n }",
"public void actionPerformed(ActionEvent e){\n\t\t\t\tpanel.createArrayOfCircles();\n\t\t\t\tpanel.repaint();\n\t\t\t}",
"private void addShapeNameButtons() {\n popupPanel.add(SHAPE_NAME_LABEL);\n ButtonGroup bg = new ButtonGroup();\n for (String name : model.getIds()) {\n JRadioButton jb = new JRadioButton(name);\n bg.add(jb);\n shapeNames.add(jb);\n popupPanel.add(jb);\n }\n\n }",
"private void refreshButtons() {\n this.getChildren().clear();\n int row = 0;\n int column = 0;\n for (Button button : this.buttons) {\n this.add(button, column, row);\n if (this.orientation == Orientation.COLUMN_SPAN) {\n if (column < this.maxColumn) {\n column++;\n } else {\n column = 0;\n }\n } else if (this.orientation == Orientation.ROW_SPAN) {\n if (row < this.maxRow) {\n row++;\n } else {\n row = 0;\n }\n } else {\n if (column < this.maxColumn) {\n column ++;\n } else {\n if (row < this.maxRow) {\n row++;\n column = 0;\n } else {\n row = 0;\n column = 0;\n }\n }\n }\n }\n }",
"private void updateShapeHandles() {\n for (Shape shape : this.model.getShapes()) {\n shape.updateHandles(this.viewModel.getZoomFactor());\n }\n }",
"public void updateAllShapes() {\n\t\tplayerPane.setSoundProgression(player.getProgression());\n\t\t\n\t\tfor(ReactiveShape shape: MainStage.getInstance().getShapes()) {\n \t\tshape.update();\n \t}\n\t}",
"public void redo() {\n\t\tif (!deleted_shapes.isEmpty()) {\n\t\t\tMyShape r = deleted_shapes.getLast();\n\t\t\tdeleted_shapes.removeLast();\n\t\t\tmyshapes.add(r);\n\t\t\trepaint();\n\t\t}\n\t}",
"public void updatePanel() \n\t{\n\t\tthis.removeAll();\n\t\tdrawPanelLines();\n\t\t\n\t\tfor(DraggableIcon currico:DataHandler.getIconRecord()) \n\t\t{\n\t\t\tthis.add(currico);\t\n\t\t}\n\t\t\n\t\tthis.repaint();\n\t}",
"public void update(List<Shape> currentShapes) {\n\t\tthis.listOfShapes = currentShapes;\n\t\trepaint();\n\n\t}",
"private void repaint() {\n\t\tview.clear();\n\t\tfor (HW2Model.HW2Circle c : model.drawDataProperty()) {\n\t\t\tview.drawCircle(c.getCenterX(), c.getCenterY(), c.getRadius(),\n\t\t\t\t\tc.getColor(), false);\n\t\t}\n\t\tif (getSelection() != null) {\n\t\t\tHW2Model.HW2Circle c = getSelection();\n\t\t\tview.drawCircle(c.getCenterX(), c.getCenterY(), c.getRadius(), c.getColor(), true);\n\t\t}\n\t}",
"private void refresh() {\r\n drawingPanel.repaint();\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$ANTLR end "rule__Declar__Group__1__Impl" $ANTLR start "rule__Declar__Group__2" InternalSymboleoide.g:4126:1: rule__Declar__Group__2 : rule__Declar__Group__2__Impl rule__Declar__Group__3 ; | public final void rule__Declar__Group__2() throws RecognitionException {
int stackSize = keepStackSize();
try {
// InternalSymboleoide.g:4130:1: ( rule__Declar__Group__2__Impl rule__Declar__Group__3 )
// InternalSymboleoide.g:4131:2: rule__Declar__Group__2__Impl rule__Declar__Group__3
{
pushFollow(FOLLOW_4);
rule__Declar__Group__2__Impl();
state._fsp--;
pushFollow(FOLLOW_2);
rule__Declar__Group__3();
state._fsp--;
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
restoreStackSize(stackSize);
}
return ;
} | [
"public final void rule__Declar__Group_2__2() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalSymboleoide.g:4238:1: ( rule__Declar__Group_2__2__Impl rule__Declar__Group_2__3 )\n // InternalSymboleoide.g:4239:2: rule__Declar__Group_2__2__Impl rule__Declar__Group_2__3\n {\n pushFollow(FOLLOW_11);\n rule__Declar__Group_2__2__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_2);\n rule__Declar__Group_2__3();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Declar__Group_2__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalSymboleoide.g:4211:1: ( rule__Declar__Group_2__1__Impl rule__Declar__Group_2__2 )\n // InternalSymboleoide.g:4212:2: rule__Declar__Group_2__1__Impl rule__Declar__Group_2__2\n {\n pushFollow(FOLLOW_4);\n rule__Declar__Group_2__1__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_2);\n rule__Declar__Group_2__2();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Declar__Group__2__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalSymboleoide.g:4142:1: ( ( ( rule__Declar__Group_2__0 )* ) )\n // InternalSymboleoide.g:4143:1: ( ( rule__Declar__Group_2__0 )* )\n {\n // InternalSymboleoide.g:4143:1: ( ( rule__Declar__Group_2__0 )* )\n // InternalSymboleoide.g:4144:2: ( rule__Declar__Group_2__0 )*\n {\n before(grammarAccess.getDeclarAccess().getGroup_2()); \n // InternalSymboleoide.g:4145:2: ( rule__Declar__Group_2__0 )*\n loop41:\n do {\n int alt41=2;\n int LA41_0 = input.LA(1);\n\n if ( (LA41_0==RULE_ID) ) {\n int LA41_1 = input.LA(2);\n\n if ( (LA41_1==94) ) {\n int LA41_2 = input.LA(3);\n\n if ( (LA41_2==RULE_ID) ) {\n int LA41_3 = input.LA(4);\n\n if ( (LA41_3==81) ) {\n alt41=1;\n }\n\n\n }\n\n\n }\n\n\n }\n\n\n switch (alt41) {\n \tcase 1 :\n \t // InternalSymboleoide.g:4145:3: rule__Declar__Group_2__0\n \t {\n \t pushFollow(FOLLOW_6);\n \t rule__Declar__Group_2__0();\n\n \t state._fsp--;\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break loop41;\n }\n } while (true);\n\n after(grammarAccess.getDeclarAccess().getGroup_2()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Declar__Group_2__0() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalSymboleoide.g:4184:1: ( rule__Declar__Group_2__0__Impl rule__Declar__Group_2__1 )\n // InternalSymboleoide.g:4185:2: rule__Declar__Group_2__0__Impl rule__Declar__Group_2__1\n {\n pushFollow(FOLLOW_21);\n rule__Declar__Group_2__0__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_2);\n rule__Declar__Group_2__1();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Declar__Group__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalSymboleoide.g:4103:1: ( rule__Declar__Group__1__Impl rule__Declar__Group__2 )\n // InternalSymboleoide.g:4104:2: rule__Declar__Group__1__Impl rule__Declar__Group__2\n {\n pushFollow(FOLLOW_4);\n rule__Declar__Group__1__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_2);\n rule__Declar__Group__2();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Declar__Group_2__3() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalSymboleoide.g:4265:1: ( rule__Declar__Group_2__3__Impl )\n // InternalSymboleoide.g:4266:2: rule__Declar__Group_2__3__Impl\n {\n pushFollow(FOLLOW_2);\n rule__Declar__Group_2__3__Impl();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Declar__Group_3__2() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalSymboleoide.g:4346:1: ( rule__Declar__Group_3__2__Impl )\n // InternalSymboleoide.g:4347:2: rule__Declar__Group_3__2__Impl\n {\n pushFollow(FOLLOW_2);\n rule__Declar__Group_3__2__Impl();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Declar__Group__0() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalSymboleoide.g:4076:1: ( rule__Declar__Group__0__Impl rule__Declar__Group__1 )\n // InternalSymboleoide.g:4077:2: rule__Declar__Group__0__Impl rule__Declar__Group__1\n {\n pushFollow(FOLLOW_20);\n rule__Declar__Group__0__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_2);\n rule__Declar__Group__1();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Declar__Group__3() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalSymboleoide.g:4157:1: ( rule__Declar__Group__3__Impl )\n // InternalSymboleoide.g:4158:2: rule__Declar__Group__3__Impl\n {\n pushFollow(FOLLOW_2);\n rule__Declar__Group__3__Impl();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__DeclarPair__Group__2() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalSymboleoide.g:4427:1: ( rule__DeclarPair__Group__2__Impl )\n // InternalSymboleoide.g:4428:2: rule__DeclarPair__Group__2__Impl\n {\n pushFollow(FOLLOW_2);\n rule__DeclarPair__Group__2__Impl();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Declar__Group_3__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalSymboleoide.g:4319:1: ( rule__Declar__Group_3__1__Impl rule__Declar__Group_3__2 )\n // InternalSymboleoide.g:4320:2: rule__Declar__Group_3__1__Impl rule__Declar__Group_3__2\n {\n pushFollow(FOLLOW_4);\n rule__Declar__Group_3__1__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_2);\n rule__Declar__Group_3__2();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Declar__Group__3__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalSymboleoide.g:4168:1: ( ( ( rule__Declar__Group_3__0 ) ) )\n // InternalSymboleoide.g:4169:1: ( ( rule__Declar__Group_3__0 ) )\n {\n // InternalSymboleoide.g:4169:1: ( ( rule__Declar__Group_3__0 ) )\n // InternalSymboleoide.g:4170:2: ( rule__Declar__Group_3__0 )\n {\n before(grammarAccess.getDeclarAccess().getGroup_3()); \n // InternalSymboleoide.g:4171:2: ( rule__Declar__Group_3__0 )\n // InternalSymboleoide.g:4171:3: rule__Declar__Group_3__0\n {\n pushFollow(FOLLOW_2);\n rule__Declar__Group_3__0();\n\n state._fsp--;\n\n\n }\n\n after(grammarAccess.getDeclarAccess().getGroup_3()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void ruleDeclar() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalSymboleoide.g:341:2: ( ( ( rule__Declar__Group__0 ) ) )\n // InternalSymboleoide.g:342:2: ( ( rule__Declar__Group__0 ) )\n {\n // InternalSymboleoide.g:342:2: ( ( rule__Declar__Group__0 ) )\n // InternalSymboleoide.g:343:3: ( rule__Declar__Group__0 )\n {\n before(grammarAccess.getDeclarAccess().getGroup()); \n // InternalSymboleoide.g:344:3: ( rule__Declar__Group__0 )\n // InternalSymboleoide.g:344:4: rule__Declar__Group__0\n {\n pushFollow(FOLLOW_2);\n rule__Declar__Group__0();\n\n state._fsp--;\n\n\n }\n\n after(grammarAccess.getDeclarAccess().getGroup()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__DeclarPair__Group__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalSymboleoide.g:4400:1: ( rule__DeclarPair__Group__1__Impl rule__DeclarPair__Group__2 )\n // InternalSymboleoide.g:4401:2: rule__DeclarPair__Group__1__Impl rule__DeclarPair__Group__2\n {\n pushFollow(FOLLOW_10);\n rule__DeclarPair__Group__1__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_2);\n rule__DeclarPair__Group__2();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Declar__Group_3__0() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalSymboleoide.g:4292:1: ( rule__Declar__Group_3__0__Impl rule__Declar__Group_3__1 )\n // InternalSymboleoide.g:4293:2: rule__Declar__Group_3__0__Impl rule__Declar__Group_3__1\n {\n pushFollow(FOLLOW_21);\n rule__Declar__Group_3__0__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_2);\n rule__Declar__Group_3__1();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Declar__Group_2__1__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalSymboleoide.g:4223:1: ( ( ':=' ) )\n // InternalSymboleoide.g:4224:1: ( ':=' )\n {\n // InternalSymboleoide.g:4224:1: ( ':=' )\n // InternalSymboleoide.g:4225:2: ':='\n {\n before(grammarAccess.getDeclarAccess().getColonEqualsSignKeyword_2_1()); \n match(input,94,FOLLOW_2); \n after(grammarAccess.getDeclarAccess().getColonEqualsSignKeyword_2_1()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Declar__Group__0__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalSymboleoide.g:4088:1: ( ( ruleDeclarPair ) )\n // InternalSymboleoide.g:4089:1: ( ruleDeclarPair )\n {\n // InternalSymboleoide.g:4089:1: ( ruleDeclarPair )\n // InternalSymboleoide.g:4090:2: ruleDeclarPair\n {\n before(grammarAccess.getDeclarAccess().getDeclarPairParserRuleCall_0()); \n pushFollow(FOLLOW_2);\n ruleDeclarPair();\n\n state._fsp--;\n\n after(grammarAccess.getDeclarAccess().getDeclarPairParserRuleCall_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Declaration__Group__2() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalBrowser.g:1325:1: ( rule__Declaration__Group__2__Impl )\n // InternalBrowser.g:1326:2: rule__Declaration__Group__2__Impl\n {\n pushFollow(FOLLOW_2);\n rule__Declaration__Group__2__Impl();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__DeclarPair__Group__0() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalSymboleoide.g:4373:1: ( rule__DeclarPair__Group__0__Impl rule__DeclarPair__Group__1 )\n // InternalSymboleoide.g:4374:2: rule__DeclarPair__Group__0__Impl rule__DeclarPair__Group__1\n {\n pushFollow(FOLLOW_22);\n rule__DeclarPair__Group__0__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_2);\n rule__DeclarPair__Group__1();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function returns a parametrized string specific to sending this message. The message is used to tell the batch worker where to look for the json versions of the metadata to compare, the startIndex for the metadata, the number of json files for this batch invocation, the className to use for the comparison and the output file name for the results. | public static String getSendHeaders(String className, String nameSpace, String params, String outputFile,
int startIndex, int count, String inputDir, long dimension) {
StringBuilder sb = new StringBuilder();
sb.append(BatchEngineMessage.NAME);
sb.append(":");
sb.append(BatchEngineMessage.CREATE_SIMILARITYMATRIXSUBSET_JAVA_BATCH_FILE);
sb.append(";");
sb.append(BatchEngineMessage.CLASS);
sb.append(":");
sb.append(className);
sb.append(";");
sb.append(BatchEngineMessage.NAME_SPACE);
sb.append(":");
sb.append(nameSpace);
sb.append(";");
sb.append(BatchEngineMessage.PARAMS);
sb.append(":");
sb.append(params);
sb.append(";");
sb.append(BatchEngineMessage.OUTPUT_FILE);
sb.append(":");
sb.append(outputFile);
sb.append(";");
sb.append(BatchEngineMessage.START_INDEX);
sb.append(":");
sb.append(startIndex);
sb.append(";");
sb.append(BatchEngineMessage.COUNT);
sb.append(":");
sb.append(count);
sb.append(";");
sb.append(BatchEngineMessage.DIMENSION);
sb.append(":");
sb.append(dimension);
sb.append(";");
sb.append(BatchEngineMessage.INPUT_DIR);
sb.append(":");
sb.append(inputDir);
return sb.toString();
} | [
"Message<String> generateFilename(Message<CelebrosExportData> incMessage);",
"public abstract String serialize(Message message, ResultFormatter resultFormatter);",
"String getMessageContentOutName();",
"java.lang.String getResultMsg();",
"@Override\n public String getNextMessage() {\n MessagePojo mess = new MessagePojo(sensorId, sensDataTypes);\n StringWriter sResult = new StringWriter();\n\n if (mess != null) {\n ObjectMapper mapper = new ObjectMapper();\n try {\n mapper.writeValue(sResult, mess);\n //System.out.println(\"Mapper toString: \" + mapper.writeValueAsString(mess));\n }\n catch (IOException ioe) {\n System.out.println(\"MessagePojo to ObjectMapper failed: \" + ioe.getMessage());\n }\n }\n\n //System.out.println(\"Message to be sent (thread #\" + threadId + \"): \" + sResult.toString());\n\n //System.out.println(\"Data through toString: \" + mess.toString());\n\n\n return sResult.toString();\n }",
"@Override\n public String getMessage() {\n String result =\"Audio Message {\\n\";\n result +=\"\\tID: \"+ID+\"\\n\";\n result +=\"\\tBuffer Size: \"+bufferSize+\"\\n\";\n result +=\"}\";\n \n return result;\n }",
"com.google.protobuf.ByteString getQueryMessage();",
"String getMessageContentInName();",
"public String getMessage() {\n String message = this.rawMessage;\n Boolean endsWithDot = false;\n Boolean endsWithQuestionMark = false;\n\n // Check if the last character is a dot\n if (message.charAt(message.length()-1) == '.') {\n message = message.substring(0, message.length()-1);\n endsWithDot = true;\n }\n\n // Check if the last character is a question mark\n if (message.charAt(message.length()-1) == '?') {\n message = message.substring(0, message.length()-1);\n endsWithQuestionMark = true;\n }\n\n if (templateName != null) {\n message += \" in \\\"\" + templateName + \"\\\"\";\n }\n\n if (lineNumber != null && lineNumber > -1) {\n message += \" at line \" + lineNumber;\n }\n\n if (endsWithDot) {\n message += \".\";\n }\n if (endsWithQuestionMark) {\n message += \"?\";\n }\n\n return message;\n }",
"public String serializeMessage();",
"public String getMessageHeaderAsString(){\n String header;\n switch(messageType){\n case DELETE:\n header = messageType + \" \" + version + \" \" + senderId + \" \" + fileId + \" \" + Utils.CRLF + Utils.CRLF;\n break;\n case PUTCHUNK:\n header = messageType + \" \" + version + \" \" + senderId + \" \" + fileId + \" \" + chunkNo + \" \" + replicationDegree + \" \" + Utils.CRLF + Utils.CRLF;\n break;\n case ENH_AWOKE:\n header = messageType + \" \" + version + \" \" + senderId + Utils.CRLF + Utils.CRLF;\n break;\n case ENH_DELETED:\n header = messageType + \" \" + fileId + \" \" + senderId + Utils.CRLF + Utils.CRLF;\n break;\n case GETCHUNK:\n if(version.equals(Utils.ENHANCEMENT_RESTORE) || version.equals(Utils.ENHANCEMENT_ALL))\n header = messageType + \" \" + version + \" \" + senderId + \" \" + fileId + \" \" + chunkNo + \" \" + sender_access + \" \"+ Utils.CRLF + Utils.CRLF;\n else header = messageType + \" \" + version + \" \" + senderId + \" \" + fileId + \" \" + chunkNo + \" \" + Utils.CRLF + Utils.CRLF;\n break;\n default:\n header = messageType + \" \" + version + \" \" + senderId + \" \" + fileId + \" \" + chunkNo + \" \" + Utils.CRLF + Utils.CRLF;\n }\n return header;\n }",
"com.cst14.im.protobuf.ProtoClass.PersonalMsg getPersonMsg(int index);",
"io.dstore.engine.Message getMessage(int index);",
"java.lang.String getTheMessage();",
"java.lang.String getMsgjson();",
"com.google.protobuf.ByteString getRequestMessage();",
"public String getInterpretedMessage() throws IOException, ClassNotFoundException, IllegalAccessException,\n InvocationTargetException, IllegalArgumentException{\n if (mReadMessage == null) {\n // we need to read a new message\n readNewMessage();\n }\n String message;\n if (mReadMessage instanceof RelayMessage || mReadMessage instanceof StatusMessage) {\n String date = getDate(); // getting the date\n String sender = getSender(); // getting the sender\n String text = getText(); // getting the actual content of the message\n message = date + \" \" + sender + \" \" + text;\n }\n else {\n message = null;\n }\n return message;\n }",
"com.google.protobuf.ByteString getResponseMessage();",
"String getBatchClassSerializableFile();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
COMMENTS This function will put the CV Path from the Book a Session form in user_cv table. | public Boolean setCV(String absoluteURL,int requestId,int userId) {
logger.info("Entered setCV method of BookASessionDAO");
Boolean isCvCommit = false;
if(!("").equals(absoluteURL)){
try {
conn =ConnectionFactory.getConnection();
conn.setAutoCommit(false);
String query = "insert into user_cv"+"(REQUEST_ID,USER_ID,CV) values" + "(?,?,?)";
PreparedStatement pstmt = conn.prepareStatement(query);
pstmt.setInt(1, requestId);
pstmt.setInt(2, userId);
pstmt.setString(3,absoluteURL);
int result = pstmt.executeUpdate();
if(result >0) {
conn.commit();
isCvCommit = true;
}
logger.info("Exit setCV method of BookASessionDAO");
} catch (SQLException e) {
logger.error("setCV method of BookASessionDAO threw error:"+e.getMessage());
e.printStackTrace();
} catch (IOException e) {
logger.error("setCV method of BookASessionDAO threw error:"+e.getMessage());
e.printStackTrace();
} catch (PropertyVetoException e) {
logger.error("setCV method of BookASessionDAO threw error:"+e.getMessage());
e.printStackTrace();
}finally{
try {
conn.close();
} catch (SQLException e) {
logger.error("setCV method of BookASessionDAO threw error:"+e.getMessage());
e.printStackTrace();
}
}
}
return isCvCommit;
} | [
"public void editCV(View view){\r\n try {\r\n View parenView = (View) view.getParent();\r\n TextView fileNameView = parenView.findViewById(R.id.cvNameText);\r\n String fileName = fileNameView.getText().toString();\r\n\r\n dbHelper.getCVInfoFromDB(db, fileName, personCV, this);\r\n MyCV.CVname = fileName;\r\n setFlags(true);\r\n startActivity(new Intent(this, CVCreatingActivity.class));\r\n }catch (Exception e){\r\n showToast(\"error edit cv\"+e.toString());\r\n Log.d(\"edit\", e.toString());\r\n }\r\n }",
"void savePicturePath(String userName, String picturePath) throws DatabaseException;",
"synchronized public static void setCurrentUserImagePath(Context context, String imagePath) {\n SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);\n SharedPreferences.Editor editor = preferences.edit();\n editor.putString(USER_IMAGE_PATH, imagePath);\n editor.apply();\n\n }",
"Path getGuestBookFilePath();",
"public void updateCopyToCs() {\n\t\tString copyToCs = \"\";\n\t\tString copyToCsName = \"\";\n\t\tif (this.selectedCsList != null) {\n\t\t\tfor (User user : selectedCsList) {\n\t\t\t\tcopyToCs += user.getEmployeeId() + \";\";\n\t\t\t\tcopyToCsName += user.getName() + \";\";\n\t\t\t}\n\t\t}\n\t\trfqHeader.setCopyToCs(copyToCs);\n\t\trfqHeader.setCopyToCsName(copyToCsName);\n\n\t\t// logger.log(Level.INFO, \"PERFORMANCE END - updateCopyToCs()\");\n\t}",
"@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}",
"Path getCardBookFilePath();",
"public void updateVenuePicture(String path) {\n String whereClause = VenueSchema.VenuesTable.Cols.ID + \" = ?\";\n String[] whereArgs = new String[] {getActiveUser().getUserID().toString()};\n mVenueDatabase.delete(VenueSchema.VenuesTable.NAME, whereClause, whereArgs);\n ((Venue)getActiveUser()).setImagePath(path);\n addVenueToDatabase();\n }",
"void ProductVOSGetParmsFrameActual(String args[]) {\n\n // get url parameter values\n String sessionCode = ec.getArgument(args,sc.SESSIONCODE);\n String productStr = ec.getArgument(args,sc.PRODUCT);\n int product = Integer.parseInt(productStr.trim());\n String fileName = ec.getArgument(args,sc.FILENAME);\n // for the top menu bar\n String userType = ec.getArgument(args, sc.USERTYPE);\n String menuNo = ec.getArgument(args, menusp.MnuConstants.MENUNO);\n String mVersion = ec.getArgument(args, menusp.MnuConstants.MVERSION);\n\n // ................ EXTRACT THE USER record from db .....................\n LogSessions session = new LogSessions();\n session.setCode(sessionCode);\n LogSessions sessions[] = session.get();\n if (dbg) System.out.println(\"<br>Session code = \" + session);\n String userId = sessions[0].getUserid();\n\n // .................PATH NAME: Get the correct........................\n String pathName = \"\";\n //if (ec.getHost().equals(\"morph\")) {\n // pathName = sc.MORPH + userId + \"/\";\n //} else {\n // pathName = sc.LOCAL;\n //} // if host\n\n if (ec.getHost().startsWith(sc.HOST)) {\n if (\"0\".equals(userType)) { // from inventory //ub01\n pathName = sc.HOSTDIR + \"inv_user\"; //ub01\n } else { //ub01\n pathName = sc.HOSTDIR + userId; //ub01\n } // if (\"0\".equals(userType)) //ub01\n //pathName = sc.HOSTDIR + userId;\n } else {\n pathName = sc.LOCALDIR;\n } // if (ec.getHost().startsWith(sc.HOST)) {\n\n // ...........OPEN THE DATA FILE AND READ FIRST LINE ................\n String line = \"\";\n try {\n RandomAccessFile ifile =\n new RandomAccessFile(pathName + \"/\" + fileName, \"r\");\n line = ifile.readLine();\n ifile.close();\n } catch (Exception e) {\n System.out.println(\"<br>\" + thisClass + \".constructor: \" +\n \"open file error: \" + e.getMessage());\n e.printStackTrace();\n } // END try\n if (dbg) System.out.println(\"<br>\" + pathName + \" / \" + fileName);\n if (dbg) System.out.println(\"<br>\" + line);\n\n //................READ DATA from FIRST LINE.............\n StringTokenizer t = new StringTokenizer (line, \" \");\n int i = 0;\n while (t.hasMoreTokens()) {\n String token = t.nextToken().trim();\n switch (i) {\n case 1: latitudeMinO = Float.valueOf(token).floatValue(); break;\n case 2: latitudeMaxO = Float.valueOf(token).floatValue(); break;\n case 3: longitudeMinO = Float.valueOf(token).floatValue(); break;\n case 4: longitudeMaxO = Float.valueOf(token).floatValue(); break;\n case 5: startDateO = token; break;\n case 6: endDateO = token; break;\n\n case 8: numRecords = Integer.valueOf(token).intValue(); break;\n default: break;\n } // switch\n i++;\n } // while\n\n //................CREATE TABLES.................\n DynamicTable leftTable = new DynamicTable(2);\n leftTable.setBorder(0).setFrame(ITableFrame.VOLD).setRules(ITableRules.NONE);\n\n DynamicTable rightTable = new DynamicTable(2);\n rightTable.setBorder(0).setFrame(ITableFrame.VOLD).setRules(ITableRules.NONE);\n\n /*\n // Enter year and month ranges\n leftTable.addRow(ec.cr2ColRow(\n chFSize(\"Start Year<i>(yyyy)</i>:\",\"-1\"), sc.STARTYEAR, 5, 5,\n startDateO.substring(0,4)));\n leftTable.addRow(ec.cr2ColRow(\n chFSize(\"End Year<i>(yyyy)</i>:\",\"-1\"), sc.ENDYEAR, 5, 5,\n endDateO.substring(0,4)));\n //enter month\n leftTable.addRow(ec.cr2ColRow(\n chFSize(\"Start Month <i>(mm)</i>:\",\"-1\"), sc.STARTMONTH, 5, 5, \"1\"));\n leftTable.addRow(ec.cr2ColRow(\n chFSize(\"End Month<i>(mm)</i>:\",\"-1\"), sc.ENDMONTH, 5, 5, \"12\"));\n\n //BREAK\n leftTable.addRow(ec.crSpanColsRow(\"<br>\",2));\n rightTable.addRow(ec.crSpanColsRow(\"<br>\",2));\n */\n\n // Enter year and month ranges\n leftTable.addRow(ec.cr2ColRow(\n chFSize(\"Year Range :\",\"-1\"),\n new TextField(sc.STARTYEAR,5,5,startDateO.substring(0,4)).toHTML() +\n chFSize(\" to \",\"-1\") +\n new TextField(sc.ENDYEAR,5,5,endDateO.substring(0,4)).toHTML()));\n\n leftTable.addRow(ec.cr2ColRow(\n chFSize(\"Month Range :\",\"-1\"),\n new TextField(sc.STARTMONTH,5,5,\"1\").toHTML() +\n chFSize(\" to \",\"-1\") +\n new TextField(sc.ENDMONTH,5,5,\"12\").toHTML()));\n\n\n //................SWITCH....................................\n switch (product){\n case(INVEN): //inventories\n parameterSelection(leftTable);\n diagramSelection(rightTable, line, product);\n\n //................PLOT TYPE SELECTION--Add DROP-DOWN MENU ....................\n Select plotTypeSelect = new Select(sc.PLOTTYPE);\n plotTypeSelect.addOption(new Option(\n \"Grid with totals in each sector\", \"1\", false));\n plotTypeSelect.addOption(new Option(\"Symbolic\", \"2\", false));\n\n //................PLOT TYPE SELECTION input box....................\n rightTable.addRow(ec.cr2ColRow(\n chFSize(\"Plot Type Selection:\",\"-1\"), plotTypeSelect));\n rightTable.addRow(ec.crSpanColsRow(\"<br>\",2));\n break;\n\n case(MEANS): //means\n parameterSelection(leftTable);\n diagramSelection(rightTable, line, product);\n multiSelection(rightTable, \"table\");\n\n //................TABLE FORMAT SELECTION--Add DROP-DOWN MENU ....................\n Select tableTypeSelect = new Select(sc.TABLETYPE);\n tableTypeSelect.addOption(new Option(\"Block Tables\",\"0\", false));\n tableTypeSelect.addOption(new Option(\"Column Tables\", \"1\", false));\n\n //................TABLE TYPE SELECTION input box....................\n rightTable.addRow(ec.cr2ColRow(\n chFSize(\"Table Selection:\",\"-1\"), tableTypeSelect));\n rightTable.addRow(ec.crSpanColsRow(\"<br>\",2));\n break;\n\n case(ROSES): //rose\n //................ROSE ELEMENT:--Add DROP-DOWN MENU ....................\n Select elementTypeSelect = new Select(sc.ELEMENTTYPE);\n elementTypeSelect.addOption(new Option(\"Wind\",\"W\", false));\n elementTypeSelect.addOption(new Option(\"Swell\", \"S\", false));\n elementTypeSelect.addOption(new Option(\"Windwave\", \"Z\", false));\n\n //................ROSE ELEMENT: input box....................\n leftTable.addRow(ec.crSpanColsRow(\"<br>\",2));\n leftTable.addRow(ec.cr2ColRow(\n chFSize(\"Rose Element:\",\"-1\"), elementTypeSelect));\n multiSelection(leftTable, \"rose\");\n\n diagramSelection(rightTable, line, product);\n rightTable.addRow(ec.crSpanColsRow(\"<br>\",2));\n break;\n\n case(HISTO): //histograms\n parameterSelectionOneOf(leftTable);\n diagramSelection(rightTable, line, product);\n rightTable.addRow(ec.crSpanColsRow(\n \"Axis range \" + chFSize(\"<i>(optional)</i>:\",\"-1.5\"),2));\n rightTable.addRow(ec.crSpanColsRow(chFSize(\"Range: \",\"-1\") +\n new TextField(sc.STARTRANGE,5,5,\"0\").toHTML() +\n chFSize(\" to \",\"-1\") +\n new TextField(sc.ENDRANGE,5,5,\"0\").toHTML() + \"<br>\",\n 2, true, \"\", IHAlign.RIGHT));\n\n rightTable.addRow(ec.crSpanColsRow(\"<br>\",2));\n rightTable.addRow(ec.crSpanColsRow(\"<br><br>\",2));\n break;\n\n case(SCATT): //scattergrams\n parameterSelectionXY(leftTable);\n diagramSelection(rightTable, line, product);\n rightTable.addRow(ec.crSpanColsRow(\n \"Axes ranges \" + chFSize(\"<i>(optional)</i>:\",\"-1.5\"),2));\n rightTable.addRow(ec.cr2ColRow(chFSize(\"X Axis Range: \",\"-1\"),\n new TextField(sc.XSTARTRANGE,5,5,\"0\").toHTML() +\n chFSize(\" to \",\"-1\") +\n new TextField(sc.XENDRANGE,5,5,\"0\").toHTML()));\n rightTable.addRow(ec.cr2ColRow(chFSize(\"Y Axis Range: \",\"-1\"),\n new TextField(sc.YSTARTRANGE,5,5,\"0\").toHTML() +\n chFSize(\" to \",\"-1\") +\n new TextField(sc.YENDRANGE,5,5,\"0\").toHTML() + \"<br><br>\"));\n multiSelection(rightTable, \"scattergram\");\n break;\n\n case(TIMES): //time series\n parameterSelectionOneOf(leftTable);\n diagramSelection(rightTable, line, product);\n\n //................ TIME UNITS:--Add DROP-DOWN MENU ....................\n Select timeTypeSelect = new Select(sc.TIMEUNITS);\n timeTypeSelect.addOption(new Option(\"Default\",\"0\", false));\n timeTypeSelect.addOption(new Option(\"Day\", \"D\", false));\n timeTypeSelect.addOption(new Option(\"Month\", \"M\", false));\n timeTypeSelect.addOption(new Option(\"Year\", \"Y\", false));\n\n //................ Std deviation:--Add DROP-DOWN MENU ....................\n Select stdTypeSelect = new Select(sc.STDDEV);\n stdTypeSelect.addOption(new Option(\"No\",\"N\", false));\n stdTypeSelect.addOption(new Option(\"Yes\", \"Y\", false));\n\n //................TIME SERIES ELEMENT:--Add DROP-DOWN MENU ....................\n rightTable.addRow(ec.cr2ColRow(\n chFSize(\"Days Range:\",\"-1\"),\n new TextField(sc.DAYRLOW,5,5,\"0\").toHTML() +\n chFSize(\"to \",\"-1\") +\n new TextField(sc.DAYRHIGH,5,5,\"31\").toHTML()));\n rightTable.addRow(ec.cr2ColRow(\n chFSize(\"Hours Range:\",\"-1\"),\n new TextField(sc.HOURRLOW,5,5,\"0\").toHTML() +\n chFSize(\"to \",\"-1\") +\n new TextField(sc.HOURRHIGH,5,5,\"23\").toHTML()));\n rightTable.addRow(ec.cr2ColRow(\n chFSize(\"Axis Range:\",\"-1\"),\n new TextField(sc.AXISRLOW,5,5,\"0\").toHTML() +\n chFSize(\"to \",\"-1\") +\n new TextField(sc.AXISRHIGH,5,5,\"0\").toHTML()));\n rightTable.addRow(ec.cr2ColRow(\n chFSize(\"Time units: \",\"-1\"), timeTypeSelect));\n rightTable.addRow(ec.cr2ColRow(\n chFSize(\"Units per cell: \",\"-1\"),sc.UNITPCELL,5,5,\"0\"));\n rightTable.addRow(ec.cr2ColRow(\n chFSize(\"Std. deviation: \",\"-1\"), stdTypeSelect));\n break;\n\n default:\n //showError();\n } // switch\n\n //................COMBINE MAIN + left + right TABLE..........\n DynamicTable mainTable = new DynamicTable(2);\n mainTable.setBorder(1).setFrame(ITableFrame.BOX);\n mainTable.addRow(ec.cr2ColRow(leftTable.toHTML(), rightTable.toHTML()));\n\n //................FORM................................\n String target = \"_top\";\n /*****************/\n if (\"\".equals(ec.getArgument(args, menusp.MnuConstants.MENUNO))) target = \"middle\";\n /*****************/\n Form form = new Form(\"POST\\\" name=\\\"myForm\", sc.VOS_APP, target);\n form.addItem (mainTable);\n form.addItem(\"<br>\");\n form.addItem(new Submit(\"\", \"Go!\").setCenter());\n form.addItem(new Hidden(sc.SCREEN, \"product\"));// parms to next page\n form.addItem(new Hidden(sc.VERSION, \"product\"));// parms to next page\n form.addItem(new Hidden(sc.PRODUCT, productStr));// parms to next page\n form.addItem(new Hidden(sc.FILENAME, fileName));// parms to next page\n form.addItem(new Hidden(sc.SESSIONCODE, sessionCode));// parms to next page\n form.addItem(new Hidden(sc.TABLE, String.valueOf(areaDifference)));\n // for the menu system\n form.addItem(new Hidden(sc.USERTYPE, userType));\n form.addItem(new Hidden(menusp.MnuConstants.MENUNO, menuNo));\n form.addItem(new Hidden(menusp.MnuConstants.MVERSION, mVersion));\n\n //................ADD JAVASCRIPT STUFF................\n if ( (product == INVEN) || (product == MEANS) ) { // inventories, means\n JSLLib.formName = \"myForm\";\n this.addItem(JSLLib.BodyOnload());\n this.addItem(JSLLib.OpenScript());\n this.addItem(moreJavaScript());\n this.addItem(JSLLib.RtnDynamicSelect(\"myForm\",sc.TABLESIZE,sc.BLOCKSIZE));\n //writeIt(plongitudewest.value,platitudenorth.value,ptablesize.value));\n this.addItem(JSLLib.CloseScript());\n } // inventories, means\n\n // ................FIRST LINE (in blue)................\n this.addItem(\"<center><font color=blue size=+2><b>\" +\n sc.VOSPRODLIST[product-1] + \"</b> for </font><font color=green size=+1> \" +\n fileName + \"</font></center>\");\n\n //mainTable.addRow(ec.crSpanColsRow(\"<br>\",2));\n\n this.addItem(\"<br><center><font color=blue size=-1><u>Date Range:</u> \" +\n startDateO + \" to \" + endDateO + \", <u>Number of Records:</u> \" +\n numRecords + \"<br> <u>Area Range</u>: \" +\n latitudeMinO + \" to \" + latitudeMaxO + \" S, \" +\n longitudeMinO + \" to \" + longitudeMaxO + \" E </font></center><br>\");\n //mainTable.addRow(ec.crSpanColsRow(\"<br>\",2));\n this.addItem(form.setCenter());\n\n }",
"void setVolantFilePath(Path volantFilePath);",
"public ModelAndView ShowUserCV(HttpServletRequest request, HttpServletResponse response) throws Exception \n\t{\n\t\tCurrentUser=(Users)request.getSession().getAttribute(\"CurrentUser\");\n\t\tif(CurrentUser==null)\n\t\t{\n\t\t\tresponse.sendRedirect(\"login.htm\");\n\t\t}\n\n\n\t\n\t\tList<UserCV> usercvlist;\n\t\tList<Users> userslist;\n\t\t\n\n\t\ttry{\n\t\t\tint studyid=Integer.parseInt(request.getParameter(\"studyid\"));\n\n\n\t\t\tList<studies> li=studiesdao.getStudyDetail(studyid);\n\t\t\tcurrentstudy=li.get(0);\n\t\t\tusercvlist = usercvdao.listusercv(currentstudy.getStudy_id());\n\t\t\tuserslist = userdao.listusers(CurrentUser);\n\t\t\tCurrentUser =(Users) request.getSession().getAttribute(\"CurrentUser\");\n\t\t\tModelMap modelMap = new ModelMap();\n\t\t\tmodelMap.addAttribute(\"currentstudy\",currentstudy);\n\t\t\tmodelMap.addAttribute(\"usercvlist\",usercvlist);\n\t\t\tmodelMap.addAttribute(\"userslist\",userslist);\n\t\t\tint form=Integer.parseInt(request.getParameter(\"user_cv_form\"));\n\t\t\tif(form == 1)\n\t\t\t\tmodelMap.addAttribute(\"CurrentFormUserCV\",\"View_UserCV_div\");\n\t\t\telse\n\t\t\t\tmodelMap.addAttribute(\"CurrentFormUserCV\",\"Create_UserCV_div\");\n\n\t\t\treturn new ModelAndView(\"usercv\",modelMap);\n\t\t}catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\te.printStackTrace();\n\t\t\tresponse.sendRedirect(\"login.htm\");\n\t\t}\n\n\t\treturn new ModelAndView(\"usercv\",new ModelMap()); \n\t}",
"public void setUserCertificatesPath(String path);",
"@Override\n\tpublic void setResumePath(java.lang.String resumePath) {\n\t\t_candidate.setResumePath(resumePath);\n\t}",
"void saveCandidate(Candidate candidate);",
"private void SaveArconPath(String path) {\n\t\tIPreferenceStore store = Activator.getDefault().getPreferenceStore();\n\t\tstore.setValue(PreferenceConstants.P_ARCON_PATH, path);\n\t}",
"private void putProfPic(Blob gbPhoto) throws SQLException, FileNotFoundException, IOException {\n if(gbPhoto == null){\n ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();\n File file = new File(externalContext.getRealPath(\"\")+\"\\\\resources\\\\images\\\\user_default.png\");\n imagePic = new OracleSerialBlob(FileUtils.getBytes(file));\n Long size = imagePic.length();\n photo_profile = new ByteArrayContent(imagePic.getBytes(1, size.intValue()));\n }else{\n imagePic = gbPhoto;\n Long size = gbPhoto.length();\n photo_profile = new ByteArrayContent(gbPhoto.getBytes(1, size.intValue()));\n }\n }",
"private void registerFileId(String fileId, String userKey, String path) {\n try {\n PreparedStatement statement = connection.prepareStatement(\n \"INSERT INTO \" + FILE_TABLE + \" (file_id, owner, file_path) VALUES (?, ?, ?)\");\n statement.setString(1, fileId);\n statement.setString(2, userKey);\n statement.setString(3, path);\n\n int rows = statement.executeUpdate();\n if (rows != 1) {\n throw new DatabaseException(500, \"Register FileId updated \" + rows + \" rows\");\n }\n } catch (SQLException e) {\n throw new DatabaseException(500, \"Register FileId failed\", e);\n }\n }",
"public void setUserRights(edu.mit.coeus.utils.CoeusVector cvUserRights) {\r\n this.cvUserRights = cvUserRights;\r\n }",
"public void setFiSoCv( String fiSoCv ) {\n this.fiSoCv = fiSoCv;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Change the appearance when the wolf turns around | private void changeAppearance() {
if (goingRight) appearance = wolfLeft;
else appearance = wolfRight;
goingRight = !goingRight;
} | [
"@Override\n public void action() {\n if (watchOutForWolf()) {\n // this.setScaredImage();\n processing.fill(0); // specify font color: black\n processing.text(\"WOLF!\", this.getX(), this.getY() - this.image.height / 2 - 6);\n }\n }",
"@Override\n public void drawWhiteMarbleConversionsLayout() {\n lastLayout = \"Choose how to convert the white marbles\";\n System.out.println(lastLayout);\n }",
"public static void drawOwl () {\n System.out.println(\" ^...^\");\n System.out.println(\" / o,o \\\\\");\n System.out.println(\" |):::(|\");\n System.out.println(\"===w=w===\");\n }",
"public void changeToStandard(){\n drawAttributeManager.toggleStandardView();\n getContentPane().setBackground(DrawAttribute.whiteblue);\n canvas.repaint();\n }",
"public abstract int bezelStyle();",
"private void applyInitialLook() {\r\n\t\tthis.control.setFont(this.initialFont);\r\n\t\tthis.control.setBackground(this.initialBackgroundColor);\r\n\t\tthis.control.setForeground(this.initialForegroundColor);\r\n\t}",
"public Swimming(){\r\n\t\tthis.setSwimmingType(SwimmingType.Freestyle);\r\n\t}",
"private void appearance()\r\n\t\t{\n\t\tgridLayout.setHgap(5);\r\n\t\tgridLayout.setVgap(5);\r\n\r\n\t\t//set the padding + external border with title inside the box\r\n\t\tBorder lineBorder = BorderFactory.createLineBorder(Color.BLACK);\r\n\t\tBorder outsideBorder = BorderFactory.createTitledBorder(lineBorder, title, TitledBorder.CENTER, TitledBorder.TOP);\r\n\t\tBorder marginBorder = BorderFactory.createEmptyBorder(5, 5, 5, 5);\r\n\t\tthis.setBorder(BorderFactory.createCompoundBorder(outsideBorder, marginBorder));\r\n\r\n\t\t//set initial value to builder\r\n\t\tdiceBuilder.setInterval(min, max);\r\n\t\t}",
"void restart () {\n octo.stop ();\n // Change bg/fg colours if neccessary\n if (!octo.lighton) {\n Color fg = getForeground ();\n Color bg = getBackground ();\n setForeground (bg);\n setBackground (fg);\n }\n // Start a new Octoours if neccessarydness)+\", Illness \"+(octo.illness)+\".\",0,200);*/\n octo =\n new octopus (this, (int) (getSize ().width / 2),\n\t\t (int) (getSize ().height * 0.64));\n }",
"public abstract void setBezelStyle(int style);",
"public void updateStyle()\n {\n this.textOutput.setForeground(new Color(null, ShellPreference.OUTPUT_COLOR_INPUT.getRGB()));\n this.textOutput.setBackground(new Color(null, ShellPreference.OUTPUT_BACKGROUND.getRGB()));\n this.textOutput.setFont(new Font(null, ShellPreference.OUTPUT_FONT.getFontData()));\n this.colorOuput = new Color(null, ShellPreference.OUTPUT_COLOR_OUTPUT.getRGB());\n this.colorError = new Color(null, ShellPreference.OUTPUT_COLOR_ERROR.getRGB());\n\n this.textInput.setForeground(new Color(null, ShellPreference.INPUT_COLOR.getRGB()));\n this.textInput.setBackground(new Color(null, ShellPreference.INPUT_BACKGROUND.getRGB()));\n this.textInput.setFont(new Font(null, ShellPreference.INPUT_FONT.getFontData()));\n\n this.historyMax = ShellPreference.MAX_HISTORY.getInt();\n }",
"public void ironSkin () {\n \n }",
"private void setStatusPaper() {\r\n\t\t\r\n\t}",
"public void visualChange();",
"public void update(){\n y -= 1; // Making the text float up\n // Making the text more transparent\n color = new Color(color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha() - 2);\n }",
"private void renderPitches() {\n List<Pitch> pitches = this.model.generateOctaves(this.model.findLowestAndHighestPitch());\n Collections.reverse(pitches);\n\n for (int a = 0;\n a < pitches.size();\n a++) {\n Pitch p = pitches.get(a);\n for (int i = 0; i < p.getNotes().size(); i++) {\n if (p.getNote(i).playing != 0) {\n if (p.getNote(i).playing == 1) {\n graphics.setColor(new Color(0, 255, 0));\n }\n else {\n graphics.setColor(new Color(0, 0, 0));\n }\n graphics.fillRect(40 + 20 * i, 25 + 20 * a, 20, 20);\n }\n }\n }\n this.buildBackground();\n }",
"protected void turnAround() {\n goingRight = !goingRight;\n if (goingRight) {\n appearance = reverseAppearance();\n } else {\n appearance = reverseAppearance();\n }\n }",
"public void drawTheLight()\n {\n NsccWindow mainWindow = new NsccWindow(10,10,140,330);\n mainWindow.setTitle(\"Traffic Light\");\n\n NsccRectangle background = new NsccRectangle(20, 20, 90, 250);\n background.setFilled(true);\n background.setBackground(Color.LIGHT_GRAY);\n background.setForeground(Color.LIGHT_GRAY);\n mainWindow.add(background);\n\n NsccEllipse stopSignal = new NsccEllipse(30,30,70,70);\n stopSignal.setFilled(true);\n stopSignal.setBackground(Color.RED);\n stopSignal.setForeground(Color.RED);\n mainWindow.add(stopSignal);\n\n NsccEllipse warningSignal = new NsccEllipse(30,110,70,70);\n warningSignal.setFilled(true);\n warningSignal.setBackground(Color.YELLOW);\n warningSignal.setForeground(Color.YELLOW);\n mainWindow.add(warningSignal);\n\n\n NsccEllipse goSignal = new NsccEllipse(30,190,70,70);\n goSignal.setFilled(true);\n Color darkGreen = new Color(0,128,0);\n goSignal.setBackground(darkGreen);\n goSignal.setForeground(darkGreen);\n mainWindow.add(goSignal);\n\n mainWindow.repaint();\n }",
"private void updateStyle() {\n int borderType;\n Color backgroundColor;\n\n if (this.isActive) {\n borderType = BevelBorder.LOWERED;\n backgroundColor = this.activeColor;\n }\n else {\n borderType = BevelBorder.RAISED;\n backgroundColor = this.inactiveColor;\n }\n\n this.setBorder(new SoftBevelBorder(borderType));\n this.setBackground(backgroundColor);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Some operator functions are given a suffix indicating the promotion type of the operands according to JLS 5.6.2. | private static String getPromotionSuffix(Assignment node) {
if (!needsPromotionSuffix(node.getOperator())) {
return "";
}
TypeKind lhsKind = node.getLeftHandSide().getTypeMirror().getKind();
TypeKind rhsKind = node.getRightHandSide().getTypeMirror().getKind();
if (lhsKind == TypeKind.DOUBLE || rhsKind == TypeKind.DOUBLE) {
return "D";
}
if (lhsKind == TypeKind.FLOAT || rhsKind == TypeKind.FLOAT) {
return "F";
}
if (lhsKind == TypeKind.LONG || rhsKind == TypeKind.LONG) {
return "J";
}
return "I";
} | [
"public Exp\nadjustTypesOfBinaryOperands( Exp pExp1, Exp pExp2 );",
"public int getOperandType() {\n if (sym == OPSYM) {\n return minor;\n }\n throw new UnsupportedOperationException(\"This method is only available to OPSYM tokens\");\n }",
"public int getOperandType(int opIndex);",
"public abstract OperatorKind getOperatorKind();",
"private boolean canGenericOperatorsBeRewrite(Expression virtExpr){\r\n\r\n\t for(GenericNames name : GenericNames.values()){\r\n\t\tif(!name.equals(GenericNames.ON_NEW_NAME))\r\n\t\t if(!this.canOperatorBeRewrittenForExpression(name, virtExpr))\r\n\t\t\treturn false;\r\n\t }\r\n\t\treturn true;\r\n\t}",
"int getOperateType();",
"private int getReductionOperator()\n {\n switch(token_.getType()) {\n case IToken.tPLUS:\n return PASTOMPPragma.OmpOpPlus;\n case IToken.tSTAR:\n return PASTOMPPragma.OmpOpMult;\n case IToken.tMINUS:\n return PASTOMPPragma.OmpOpMinus;\n case IToken.tAMPER:\n return PASTOMPPragma.OmpOpBAnd;\n case IToken.tXOR:\n return PASTOMPPragma.OmpOpBXor;\n case IToken.tBITOR:\n return PASTOMPPragma.OmpOpBOr;\n case IToken.tAND:\n return PASTOMPPragma.OmpOpLAnd;\n case IToken.tOR:\n return PASTOMPPragma.OmpOpLOr;\n default:\n return PASTOMPPragma.OmpOpUnknown;\n }\n }",
"public static Entry[] getUserDefinedConversionOperatorsOf(final TypeSpec t) {\n // Debug.WriteLine(\"getUserDefinedConversionOperatorsOf(\"+t+\")\");\n if (!t.isClass() && !t.isBuiltinClass()) {\n return new Entry[0]; // only classes have conversion operators\n }\n\n final ArrayList entries = new ArrayList();\n final Scope classScope = new ClassScope(t);\n\n // gather all constructors that take a single argument and all instance\n // or static\n // operator-> methods\n\n if (!t.isAbstractClassOrInterface()) { // t is concrete (otherwise\n // ignore constructors)\n\n final Entry[] ctors = classScope.getEntries(\".ctor\", null);\n\n for (final Entry entry : ctors) {\n Debug.Assert(entry.type.isFunc(), \".ctor isn't a func! type:\"\n + entry.type);\n if (entry.type.getFuncInfo().numRequiredArgs() == 1) {\n if (!entry.type.getFuncInfo().getParamTypes()[0].equals(t)) {\n entries.add(entry);\n }\n }\n }\n\n }\n\n // now operator->\n final Entry[] ops = classScope.getEntries(\"operator->\", null);\n // Debug.WL(\" got entries #=\"+ops.Length+\" t=\"+t);\n // //.classInfo.ToStringFull());\n for (final Entry entry : ops) {\n Debug.Assert(entry.type.isFunc(),\n \"entry for operator-> isn't a func; type:\" + entry.type);\n final FuncInfo fi = entry.type.getFuncInfo();\n // is it an instance operator-> that takes a single arg?\n final boolean isInstanceOp = (!entry.isStatic() && (fi\n .numRequiredArgs() == 0));\n // is it a static operator-> that takes a single arg where either\n // the arg type of the\n // return type is t?\n final boolean isStaticOp = (entry.isStatic()\n && (fi.numRequiredArgs() == 1) && (fi.getParamTypes()[0]\n .equals(t) || fi.getReturnType().equals(t)));\n\n // Debug.WL(\" considering \"+entry.name+\" \"+fi+\" isInstanceOp=\"+isInstanceOp+\" isStaticOp=\"+isStaticOp+\" entry.index=\"+entry.index);\n if (!entry.isAbstract() && (entry.index >= 0)) { // !!!currently,\n // methods\n // inherited from\n // Java types can't\n // be called - so\n // don't consider\n // them!!!\n if (isInstanceOp) {\n // don't bother with operator->(->self) - not useful\n if (!fi.getReturnType().equals(t)) {\n entries.add(entry);\n // Debug.WriteLine(\" got op:\"+entry.type.funcInfo+\" of \"+t);\n }\n } else if (isStaticOp) {\n // don't bother with operator->(a->a) either\n if (!fi.getParamTypes()[0].equals(fi.getReturnType())) {\n entries.add(entry);\n // Debug.WriteLine(\" got op:\"+entry.type.funcInfo+\" of \"+t);\n }\n }\n }\n }\n\n return Entry.toArray(entries);\n }",
"void typePromition(int a, long b){\n\t\tSystem.out.println(\"Method-5 (TypePromotion) Result is: \" + (a+b));\n\t}",
"private DoubleBinaryOperator chooseOperator() {\n\t\tswitch(name) {\n\t\tcase \"+\":\n\t\t\treturn ADD;\n\t\t\t\n\t\tcase \"-\":\n\t\t\treturn SUB;\n\t\t\t\n\t\tcase \"*\":\n\t\t\treturn MULTIPLY;\n\t\t\t\n\t\tcase \"/\":\n\t\t\treturn DIVIDE;\n\t\t\t\n\t\tcase \"x^n\":\n\t\t\treturn POW;\n\t\t\t\n\t\tdefault:\n\t\t\tthrow new IllegalStateException(\"Invalid binary operator\");\n\t\t}\n\t}",
"@Override\n\tpublic Type visit(UnaryCastExpression n) {\n\t\tNodeToken operator = (NodeToken) n.getF0().getF0().getChoice();\n\t\tType castExpType = n.getF1().accept(this);\n\t\tswitch (operator.getTokenImage()) {\n\t\tcase \"&\":\n\t\t\tcastExpType = ExpressionTypeGetter.performPointerDegeneration(castExpType);\n\t\t\treturn new PointerType(castExpType);\n\t\tcase \"*\":\n\t\t\tif (castExpType instanceof PointerType) {\n\t\t\t\tType pointeeType = ((PointerType) castExpType).getPointeeType();\n\t\t\t\tpointeeType = ExpressionTypeGetter.performPointerGeneration(pointeeType);\n\t\t\t\treturn pointeeType;\n\t\t\t}\n\t\t\t// assert (false);\n\t\t\treturn null;\n\t\tcase \"+\":\n\t\tcase \"-\":\n\t\tcase \"~\":\n\t\t\tif (castExpType == null) {\n\t\t\t\treturn SignedIntType.type();\n\t\t\t}\n\t\t\treturn castExpType.getIntegerPromotedType();\n\t\tcase \"!\":\n\t\t\treturn SignedIntType.type();\n\t\tdefault:\n\t\t\tassert (false);\n\t\t\treturn null;\n\t\t}\n\t}",
"public interface InheritedFrom_Number_to_Long_FunctionalOperator extends Long_FunctionalOperator {\n}",
"@Override\n\tpublic Type visit(MultiplicativeExpression n) {\n\t\tType leftExpType = n.getF0().accept(this);\n\t\tif (!n.getF1().present()) {\n\t\t\treturn leftExpType;\n\t\t}\n\t\tType rightExpType = n.getF1().accept(this);\n\n\t\treturn Conversion.getUsualArithmeticConvertedType(leftExpType, rightExpType);\n\t}",
"Object getUnaryOperatorValue (Object unaryOperatorKey, Object operand);",
"@Converted(kind = Converted.Kind.AUTO,\n source = \"${LLVM_SRC}/llvm/tools/clang/include/clang/AST/Decl.h\", line = 2093,\n FQN=\"clang::FunctionDecl::isOverloadedOperator\", NM=\"_ZNK5clang12FunctionDecl20isOverloadedOperatorEv\",\n cmd=\"jclank.sh -java-options=${SPUTNIK}/modules/org.clang.ast/llvmToClangType ${LLVM_SRC}/llvm/tools/clang/lib/AST/Decl.cpp -nm=_ZNK5clang12FunctionDecl20isOverloadedOperatorEv\")\n //</editor-fold>\n public boolean isOverloadedOperator() /*const*/ {\n return getOverloadedOperator() != OverloadedOperatorKind.OO_None;\n }",
"NumPriorityOperand2 getNumOp2();",
"public interface BinaryOperators<T> {\n\n\t/** BinaryOperator<T> extends BiFunction<T,T,T> */\n\tT apply(T t1, T t2);\n\n\t/** DoubleBinaryOperator */\n\tdouble applyAsDouble(double left, double right);\n\n\t/** IntBinaryOperator */\n\tint applyAsInt(int left, int right);\n\n\t/** LongBinaryOperator */\n\tlong applyAsLong(long left, long right);\n\n}",
"public int getOperandType(String operand) {\n\t\t// empty\n\t\tif (operand == null) {\n\t\t\treturn Op.NULL;\n\t\t}\n\t\tif (operand.equals(\"\")) {\n\t\t\treturn Op.NULL;\n\t\t}\n\t\t// comma\n\t\tif (operand.equals(\",\")) {\n\t\t\treturn Op.COMMA;\n\t\t}\n\t\t// memory address\n\t\tif (pMemory.matcher(operand).matches()) {\n\t\t\treturn Op.MU;\n\t\t}\n\t\t// register\n\t\tif (CalculatedAddress.pRegisters.matcher(operand).matches()) {\n\t\t\treturn Op.getDefinition(Op.REG, dataspace.getRegisterSize(operand));\n\t\t}\n\t\t// (decimal) immediate\n\t\tif (pDecimal.matcher(operand).matches()) {\n\t\t\ttry {\n\t\t\t\tLong.valueOf(operand);\n\t\t\t} catch (NumberFormatException e) {\n\t\t\t\treturn Op.ERROR;\n\t\t\t}\n\t\t\treturn Op.getDefinition(Op.IMM, getOperandSize(Long.parseLong(operand)));\n\t\t}\n\t\t// floating-point constant\n\t\tif (pFloat.matcher(operand).matches()) {\n\t\t\ttry {\n\t\t\t\tDouble.valueOf(operand);\n\t\t\t} catch (NumberFormatException e) {\n\t\t\t\treturn Op.ERROR;\n\t\t\t}\n\t\t\treturn Op.FLOAT;\n\t\t}\n\t\t// variable\n\t\tif (dataspace.isVariable(operand)) {\n\t\t\treturn Op.VARIABLE;\n\t\t}\n\t\t// constant (defined by EQU)\n\t\tif (dataspace.isConstant(operand)) {\n\t\t\treturn Op.CONST;\n\t\t}\n\t\t// label (target for jump-commands)\n\t\tif (doc.getLabelLine(operand) != -1) {\n\t\t\treturn Op.LABEL;\n\t\t}\n\t\t// size qualifier\n\t\tif (pSizeQuali.matcher(operand).matches()) {\n\t\t\treturn Op.SIZEQUALI;\n\t\t}\n\t\t// prefix\n\t\tif (DataSpace.prefixesMatchingPattern.matcher(operand).matches()) {\n\t\t\treturn Op.PREFIX;\n\t\t}\n\t\t// string/character constant\n\t\tif (pString.matcher(operand).matches()) {\n\t\t\t// string: up to four characters (short) or arbitrarily long\n\t\t\tif (operand.length() <= 6) {\n\t\t\t\treturn Op.CHARS;\n\t\t\t} else {\n\t\t\t\treturn Op.STRING;\n\t\t\t}\n\t\t}\n\t\t// FPU register\n\t\tif (Fpu.pRegisters.matcher(operand).matches()) {\n\t\t\treturn Op.FPUREG;\n\t\t}\n\t\t// FPU qualifier\n\t\tif (Fpu.pQualifiers.matcher(operand).matches()) {\n\t\t\treturn Op.FPUQUALI;\n\t\t}\n\t\treturn Op.ERROR;\n\t}",
"private static boolean isOperator(String token) {\n\t char ops = token.charAt(0);\n\t if(ops == '+' || ops == '-'|| ops == '*'||ops == '/'||ops == '^'||ops == 'r'||ops == '('){\n\t \treturn true;\n\t }\n\t else\n\t \treturn false;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Verifies the prepared CameraService response, to be sent to the web layer, for validity. | private void verifyImageResponse(String imageProcessResult) {
try {
if (imageProcessResult != null) {
JSONObject imageResponseJson = new JSONObject(imageProcessResult);
if ((imageResponseJson.has(SmartConstants.CAMERA_OPERATION_SUCCESSFUL_TAG)) & (imageResponseJson.getBoolean(SmartConstants.CAMERA_OPERATION_SUCCESSFUL_TAG))) {
this.smartCameraListener.onSuccessCameraOperation(imageProcessResult);
} else {
// this means there has been some error in the
// camera service operation. Need to throw the error
this.smartCameraListener.onErrorCameraOperation(imageResponseJson.getInt(SmartConstants.CAMERA_OPERATION_EXCEPTION_TYPE_TAG),
imageResponseJson.getString(SmartConstants.CAMERA_OPERATION_EXCEPTION_MESSAGE_TAG));
}
} else {
this.smartCameraListener.onErrorCameraOperation(ExceptionTypes.PROBLEM_CAPTURING_IMAGE_EXCEPTION, ExceptionTypes.PROBLEM_CAPTURING_IMAGE_EXCEPTION_MESSAGE);
}
} catch (JSONException je) {
// TODO handle this exception
}
} | [
"protected abstract boolean isResponseValid(SatelMessage response);",
"public void checkResponseValid() {\n\n if (mResponse == null) {\n\n // response invalid, login failed\n onLoginFailed();\n } else {\n\n // response valid,\n onLoginSuccess();\n }\n // remove progress dialog from screen.\n mProgressDialog.dismiss();\n }",
"boolean hasPassCardsResponse();",
"public abstract boolean verify(int turn, Challenge challenge, byte[] response) throws AuthenticationException;",
"public VerifyResponse verify(String image1FaceId, String image2FaceId) {\n\t\ttry {\n\t\t\t// build url\n\t\t\tURIBuilder baseUrl = new URIBuilder(API_URL + \"verify\");\n\t\t\tURI url = baseUrl.build();\n\n\t\t\t// build request\n\t\t\tStringEntity requestBody = new StringEntity(\"{\"\n\t\t\t\t\t+ \"\\\"faceId1\\\":\\\"\" + image1FaceId + \"\\\",\"\n\t\t\t\t\t+ \"\\\"faceId2\\\":\\\"\" + image2FaceId + \"\\\"}\");\n\t\t\tHttpPost request = new HttpPost(url);\n\t\t\trequest.setHeader(\"Ocp-Apim-Subscription-Key\", API_KEY);\n\t\t\trequest.setHeader(\"Content-Type\", \"application/json\");\n\t\t\trequest.setEntity(requestBody);\n\n\t\t\t// get response\n\t\t\tHttpResponse response = client.execute(request);\n\t\t\t// check if response was successful\n\t\t\tif (response.getStatusLine().getStatusCode() == 200) {\n\t\t\t\t// deserialize and return\n\t\t\t\tString responseJson = EntityUtils.toString(response.getEntity());\n\t\t\t\treturn gson.fromJson(responseJson, VerifyResponse.class);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}",
"@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 void receiveResultverifyCardNumber(\r\n org.tempuri.UserWcfStub.VerifyCardNumberResponse result) {\r\n }",
"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 }",
"public CompletionStage<Result> verify()\n {\n IRequestValidator requestValidator=new CertVerifyRequestValidator();\n return handleRequest(request(),requestValidator, JsonKeys.CERT_VERIFY);\n }",
"boolean verified() {\n return apkSigningKeyCertificateFingerprint().isPresent() && !errorMessage().isPresent();\n }",
"ResponseEntity<?> verifyOtp(HttpServletRequest request, HttpServletResponse response);",
"@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 isSuccessful() {\n return rawResponse != null;\n }",
"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 }",
"boolean isValid()\n {\n return isRequest() && isResponse();\n }",
"public void receiveResultverifysign(\n core.sakai.wsdl.SakaiSigningServiceStub.VerifysignResponse result\n ) {\n }",
"public static boolean verify(String gRecaptchaResponse)\n {\n if (gRecaptchaResponse == null || gRecaptchaResponse.length() == 0)\n return false;\n\n String params = \"secret=\"+Constants.SECRET_KEY+\"&response=\"+gRecaptchaResponse;\n try\n {\n // Make post request to google's recaptcha verification.\n URL verifyUrl = new URL(VERIFY_URL);\n HttpsURLConnection con = (HttpsURLConnection) verifyUrl.openConnection(); \n con.setRequestMethod(\"POST\");\n\n con.setDoOutput(true);\n OutputStream outStream = con.getOutputStream();\n outStream.write(params.getBytes());\n outStream.flush();\n outStream.close();\n\n // Read response.\n InputStream inStream = con.getInputStream();\n JsonReader jsonReader = Json.createReader(inStream);\n JsonObject jsonObject = jsonReader.readObject();\n jsonReader.close();\n return jsonObject.getBoolean(\"success\");\n }\n catch (Exception e) { return false; }\n }",
"public void verifyResponseAuth(String response) throws MessagingException {\n if (!response.startsWith(RESPONSE_AUTH_HEADER)) {\n throw new MessagingException(\"response-auth expected\");\n }\n if (!response\n .substring(RESPONSE_AUTH_HEADER.length())\n .equals(DigestMd5Utils.getResponse(this, true))) {\n throw new MessagingException(\"invalid response-auth return from the server.\");\n }\n }",
"boolean hasAuthresponse();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Instancia una Prescripcion Mueble desde un ResulSet | private PrescripcionMueble instanciarDeResultSet(ResultSet resultado) throws SQLException {
return new PrescripcionMueble(Integer.parseInt(resultado.getString("id")),
resultado.getString("tipo_pieza"),
resultado.getString("modelo_mueble"),
Integer.parseInt(resultado.getString("cantidad_pieza"))
);
} | [
"public void setPrenotazione(Set<Prenotazione> aPrenotazione) {\n prenotazione = aPrenotazione;\n }",
"public PromoSetPack(){\r\n\t\tthis.Type = type.PROMO;\r\n\t\tthis.promo = new ArrayList<\t>();\r\n\t}",
"public void addPrescription(Prescription p){\n prescriptions.add(p);\n }",
"public Politica(){\n\n prioridad = new ArrayList<Integer>();\n }",
"protected List<Prueba> getPreubasResueltas() {\r\n return (List<Prueba>) FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get(\"preubasResueltasId\");\r\n }",
"public void crearPrescripcionMueble(PrescripcionMueble receta) {\n try {\n\n PreparedStatement statement = Conexion.obtenerConexion().prepareStatement(\"INSERT INTO prescripcion_mueble \"\n + \"(tipo_pieza, modelo_mueble, cantidad_pieza) VALUES (?,?,?);\");\n statement.setString(1, receta.getTipoPieza());\n statement.setString(2, receta.getModeloMueble());\n statement.setString(3, String.valueOf(receta.getCantidad()));\n statement.executeUpdate();\n } catch (SQLException e) {\n e.printStackTrace();\n } catch (ClassNotFoundException ex) {\n Logger.getLogger(PrescripcionMuebleBD.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"public PacchettoPersonalizzato(PacchettoPredefinitoDTO pacchettoPredefinitoDTO, UserDTO cliente){\t\t\r\n\t\tluogo = pacchettoPredefinitoDTO.getLuogo();\r\n\t\tutente = Cliente.fromDTO(cliente);\r\n\t\tacquistato = false;\r\n\t\tvoliPers = new ArrayList<VoliPers>();\r\n\t\thotelsPers = new ArrayList<HotelsPers>();\r\n\t\tescursioniPers = new ArrayList<EscursioniPers>();\r\n\t\t\r\n\t\tVoliPers voloPersAndata = new VoliPers(pacchettoPredefinitoDTO.getVoloAndata(), this, false,false,false);\r\n\t\tvoliPers.add(voloPersAndata);\r\n\t\t\r\n\t\tVoliPers voloPersRitorno = new VoliPers(pacchettoPredefinitoDTO.getVoloRitorno(), this, false,false,false);\r\n\t\tvoloPersRitorno.setPacchettoPersonalizzato(this);\r\n\t\tvoliPers.add(voloPersRitorno);\r\n\t\t\r\n\t\tHotelsPers hotelPers = new HotelsPers(pacchettoPredefinitoDTO.getHotel(), this, false,false,false);\r\n\t\thotelPers.setPacchettoPersonalizzato(this);\r\n\t\thotelsPers.add(hotelPers);\r\n\t\t\r\n\t\tfor(EscursioneDTO escursioneDTO: pacchettoPredefinitoDTO.getEscursioni()){\r\n\t\t\tEscursioniPers escursionePers = new EscursioniPers(escursioneDTO, this, false, false, false);\r\n\t\t\t\r\n\t\t\tescursioniPers.add(escursionePers);\r\n\t\t}/*\r\n\t\t*/\r\n\t\t/*\r\n\t\tfor (int i=0; i< pacchettoPredefinitoDTO.getEscursioni().size();i++){\r\n\t\t\tEscursioniPers ep = new EscursioniPers(pacchettoPredefinitoDTO.getEscursioni().get(i),false,false,false);\r\n\t\t\tep.setPacchettoPersonalizzato(this);\r\n\t\t\tescursioniPers.add(ep);\r\n\t\t}\r\n\t\t*/\r\n\t}",
"public void initMonstresTranchant() {\n\t\tthis.monstresTranchants = monstresDomaineSet.tailSet(new Monstre<>(\"\", 0, null, Domaine.TRANCHANT, (Pouvoir[])null), false);\n\t}",
"public RequerimientoResource() {\r\n }",
"public Recurs(){\n i = new Identificador();\n id = i.idRecurs();\n nom = \"Recurs_\"+id;\n }",
"public List<Prescription> getPrescriptions(){\n\t\tArrayList<Prescription> prescriptions = new ArrayList<Prescription>();\n\n\t\tStringBuilder sql = new StringBuilder(200);\n\t\tsql.append(\"SELECT DauermedikationID FROM \" + PROBLEM_DAUERMEDIKATION_TABLENAME)\n\t\t\t.append(\" WHERE ProblemID = \" + getWrappedId());\n\n\t\tStm stm = j.getStatement();\n\t\tResultSet rs = stm.query(sql.toString());\n\t\ttry {\n\t\t\twhile (rs.next()) {\n\t\t\t\tString id = rs.getString(1);\n\t\t\t\tPrescription prescription = Prescription.load(id);\n\t\t\t\tif (prescription != null && prescription.exists()) {\n\t\t\t\t\tprescriptions.add(prescription);\n\t\t\t\t}\n\t\t\t}\n\t\t\trs.close();\n\t\t} catch (Exception ex) {\n\t\t\tExHandler.handle(ex);\n\t\t\tlog.error(ex.getMessage());\n\t\t} finally {\n\t\t\tj.releaseStatement(stm);\n\t\t}\n\t\treturn prescriptions;\n\t}",
"PSet createPSet();",
"public NotificacionResource() {\r\n }",
"public LinkedList<Vertice> obtenerPredecesores() {\n return predecesores;\n }",
"public void criarListaDePresencas(){\n\t\tpresencas = new ArrayList<Presenca>();\r\n\t\t//Para cada aluno desta disciplina\r\n\t\tfor (Aluno aluno : alunos) {\r\n\t\t\tPresenca p = new Presenca();\r\n\t\t\t//Verifica numero de aulas\r\n\t\t\tif(disciplina.getNumeroAulas() == 80){\r\n\t\t\t\t//Configura 4 presencas aulas como padrão\r\n\t\t\t\tp.setPresenca(4);\r\n\t\t\t}else if(disciplina.getNumeroAulas() == 40){\r\n\t\t\t\t//Configura 2 presencas aulas como padrão\r\n\t\t\t\tp.setPresenca(2);\r\n\t\t\t}\r\n\t\t\tp.setAluno(aluno);\r\n\t\t\tp.setData(presenca.getData());\r\n\t\t\tp.setDisciplina(disciplina);\r\n\t\t\tpresencas.add(p);\r\n\t\t}\r\n\t}",
"public RegraProducao() {\r\n }",
"public void preisBerechnen() {\n\t\tpreisProFlasche = alter * grundpreis;\n\t}",
"private MensagemPromocional getMensagemPromocional(ResultSet rs) throws SQLException\n\t{\n\t\tMensagemPromocional msg = new MensagemPromocional(rs.getInt(\"CO_PROMOCAO\")\n\t\t\t\t ,rs.getInt(\"CO_SERVICO\")\n\t\t\t\t ,rs.getInt(\"CO_CONTEUDO\"));\n\t\tmsg.setMensagemPromocional(rs.getString(\"DS_MENSAGEM\"));\n\n\t\t// Armazena a instancia do objeto que foi alterada ou criada no \n\t\t// cache de dados da classe DAO\n\t\tpoolMensagens.put(new Integer(msg.getCodPromocao()),msg);\n\t\treturn msg;\n\t}",
"public void setReproductor(){\n dades.setReproductor(reproductor);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Turn on the LED. | public void on() {
// Sets the LED pin state to 1 (high)
ledPin.high();
} | [
"public void turnOn() {\n this.status = true;\n update(this.redValue, this.greenValue, this.blueValue);\n }",
"public void turnOn ()\n\t{\n\t\tthis.powerState = true;\n\t}",
"public void setLED(boolean on) {\n if (!on) {\n mLimelight.getEntry(\"ledMode\").setNumber(1);\n } else {\n mLimelight.getEntry(\"ledMode\").setNumber(3);\n }\n }",
"public void turnONRadion() {\n radio.setSwitchStatus(true);\n }",
"void setShutterLEDState(boolean on);",
"public void switchOn() {\n\n\t\tinit();\n\t}",
"protected void setLED(boolean on) throws IllegalActionException {\n\t\tstateLED=on;\n\t\tif (on)\n\t\t\t_circle.fillColor.setToken(\"{1.0, 0.0, 0.0, 1.0}\"); // red\n\t\telse\n\t\t\t_circle.fillColor.setToken(\"{0.0, 0.0, 0.0, 1.0}\"); // black\n\t}",
"private static void setLight(boolean on) {\n\t\tif (connected)\n\t\t\tccw.cc.camera_settings.send_switch_light(on ? \"1\" : \"0\");\n\t}",
"public void turnOn()\n {\n master.set(ControlMode.PercentOutput, MOTOR_SPEED);\n }",
"void setLedStatus(LedStatus ledStatus);",
"public void switchOn() throws RemoteHomeConnectionException {\n m.sendCommand(parseDeviceIdForMultipleDevice(getRealDeviceId()), \"l\"+getSubDeviceNumber()+\"o\");\n setCurrentState(true);\n }",
"public void turnOnSensor(){\n this.status = true;\n }",
"public static native void setLed(int led, boolean state);",
"public void updateOn(boolean on) {\r\n\t\toutString = \"O\" + on + \"\\n\";\r\n\t\tmyPort.write(outString);\r\n\t\tSystem.out.println(outString);\r\n\t}",
"private void flashLED() {\n PavlokConnection conn = new PavlokConnection();\n if(this.token!=null && this.token!=\"\") {\n try {\n doAction(token, \"led\", 4);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }",
"public void turnOn() {\n\t\tThread thr = new Thread(new Runnable() {\n\n\t\t\t/*\n\t\t\t * (non-Javadoc)\n\t\t\t * \n\t\t\t * @see java.lang.Runnable#run()\n\t\t\t */\n\t\t\t@Override\n\t\t\tpublic void run() {\n\n\t\t\t\ttry {\n\t\t\t\t\treaderModuleManagerInterface.turnReaderOn();\n\t\t\t\t\trunning = true;\n\t\t\t\t\t// attach antenna fields to the gate\n\t\t\t\t\tfor (VisualEntity antenna : children) {\n\t\t\t\t\t\t((AntennaFieldEntity) antenna).turnOn();\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tlogger.error(\"Problem turning on gate: \" + e);\n\t\t\t\t}\n\t\t\t}\n\n\t\t});\n\t\tthr.run();\n\t}",
"public void statusLedAuto()\n {\n firmwareConfig &= 0x0C;\n sendFirmwareConfigPacket();\n }",
"public void turnOnUserLED(int id) throws IOException {\n\t\tif (id != 0 && id != 1)\n\t\t\tthrow new IOException(\"Invalid id\");\n\n\t\tgpioLED.writePin(5 + id, 0);\n\t}",
"@Override\n public void turnOn() {\n on = true;\n if (onDuration!=null) {\n onDuration = null;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method was generated by MyBatis Generator. This method returns the value of the database column S_TODO_DET.DATE_PROCESSED | public Date getDATE_PROCESSED() {
return DATE_PROCESSED;
} | [
"public void setDATE_PROCESSED(Date DATE_PROCESSED) {\r\n this.DATE_PROCESSED = DATE_PROCESSED;\r\n }",
"public Date getLAST_PROCESSED_DATE() {\r\n return LAST_PROCESSED_DATE;\r\n }",
"public Date getProcessDt() {\n return _processDt;\n }",
"public Date obtenerPrimeraFecha() {\n String sql = \"SELECT proyind_periodo_inicio\"\n + \" FROM proy_indices\"\n + \" WHERE proyind_periodo_inicio IS NOT NULL\"\n + \" ORDER BY proyind_periodo_inicio ASC\"\n + \" LIMIT 1\";\n Query query = getEm().createNativeQuery(sql);\n List result = query.getResultList();\n return (Date) DAOUtils.obtenerSingleResult(result);\n }",
"public java.lang.CharSequence getProcessedDate() {\n return processedDate;\n }",
"public Date getREP_DATE() {\r\n return REP_DATE;\r\n }",
"public java.lang.CharSequence getProcessedDate() {\n return processedDate;\n }",
"public Date getDATE_RECEIVED_FROM_PROV() {\r\n return DATE_RECEIVED_FROM_PROV;\r\n }",
"public org.exolab.castor.types.Date getDtDtTodoCompleted()\r\n {\r\n return this._dtDtTodoCompleted;\r\n }",
"public Date getDATE_SENT_TO_PROV() {\r\n return DATE_SENT_TO_PROV;\r\n }",
"public org.exolab.castor.types.Date getDtDtTodoDue()\r\n {\r\n return this._dtDtTodoDue;\r\n }",
"public Date getDOC_DATE_RECEIVED() {\r\n return DOC_DATE_RECEIVED;\r\n }",
"public void setLAST_PROCESSED_DATE(Date LAST_PROCESSED_DATE) {\r\n this.LAST_PROCESSED_DATE = LAST_PROCESSED_DATE;\r\n }",
"public Date getDateCommande() {\r\n return dateCommande;\r\n }",
"public Date getDATE_MONITORED() {\r\n return DATE_MONITORED;\r\n }",
"public Date getPROMISSORY_CANCEL_DATE()\r\n {\r\n\treturn PROMISSORY_CANCEL_DATE;\r\n }",
"public org.exolab.castor.types.Date getDtDtTodoCreated()\r\n {\r\n return this._dtDtTodoCreated;\r\n }",
"public java.sql.Timestamp getDeparturedate()\n {\n return departuredate; \n }",
"public Date getCommencDate() {\n return commencDate;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the retail price that will be included on the report. This is included for the Retail Web site. Customers may want different retails on the web site than they normally use in their store. The default value is the retail calculated by the main query. | private double calcRetail(ResultSet rs)
{
double retail = 0;
String item = null;
RetailOption opt = null;
try {
item = rs.getString("item_id");
retail = rs.getDouble("retail");
opt = getRetailOption(rs);
if ( opt != null ) {
retail = calcCustomRetail(opt, rs);
}
}
catch ( Exception e ) {
log.error("Unable to calculate retail for " + m_CustId + " " + item);
}
return retail;
} | [
"public double getRetailPrice() {\n return retailPrice;\n }",
"private double calcCustomRetail(RetailOption opt, ResultSet rs) throws Exception\n {\n \tdouble retail = 0;\n\n\t\tretail = rs.getDouble(\"retail\");\n\n\t\tif ( opt.getPriceOption().equalsIgnoreCase(\"a\") )\n\t\t\tretail = rs.getDouble(\"retail_a\");\n\n\t\tif ( opt.getPriceOption().equalsIgnoreCase(\"b\") )\n\t\t\tretail = rs.getDouble(\"retail_b\");\n\n\t\tif ( opt.getPriceOption().equalsIgnoreCase(\"c\") )\n\t\t\tretail = rs.getDouble(\"retail_c\");\n\n\t\tif ( opt.getPriceOption().equalsIgnoreCase(\"d\") )\n\t\t\tretail = rs.getDouble(\"retail_d\");\n\n\t\t//TODO other options\n\t\t//If and when other options are needed, add them here\n\n\t\treturn retail;\n }",
"public void setRetailPrice(double value) {\n this.retailPrice = value;\n }",
"public BigDecimal getRecommendedRetailPrice() { return recommendedRetailPrice; }",
"private Retail getRetail(ItemMaster itemMaster) {\n\n\t\ttry {\n\t\t\tRetail r = this.priceServiceClient.getRegularRetail(this.defaultRetailZone, itemMaster.getOrderingUpc());\n\t\t\tlogger.info(r.toString());\n\t\t\treturn r;\n\t\t} catch (CheckedSoapException e) {\n\t\t\tVendorInfoService.logger.error(String.format(VendorInfoService.RETAIL_LOOKUP_ERROR,\n\t\t\t\t\titemMaster.getKey()));\n\t\t}\n\n\t\treturn null;\n\t}",
"public double getPrice() {\n double price = BASE_PRICE;\n for (Topping topping : toppings) {\n if (topping.isPremium()) {\n price += 1.25;\n } else {\n price += 0.75;\n }\n }\n return price;\n }",
"java.lang.String getPreSettlePrice();",
"public Double getRestPrice() {\r\n return restPrice;\r\n }",
"public RetailOrder getRetailOrder() {\n return retailOrder;\n }",
"private RetailOption getRetailOption(ResultSet rs)\n\t{\n\t\tRetailOption opt = null;\n\t\tString item = null;\n\n\t\ttry {\n\t\t\titem = rs.getString(\"item_id\");\n\n\t\t\topt = getItemRetailOption(rs);\n\n\t\t\tif ( opt == null )\n\t\t\t\topt = getImageRetailOption(rs);\n\n\t\t\tif ( opt == null )\n\t\t\t\topt = getFlcRetailOption(rs);\n\n\t\t\tif ( opt == null )\n\t\t\t\topt = getNrhaRetailOption(rs);\n\n\t\t\tif ( opt == null )\n\t\t\t\topt = getStoreRetailOption(rs);\n\t\t}\n\t\tcatch ( Exception e ) {\n\t\t\tlog.error(\"Unable to get retail option for \" + m_CustId + \" \" + item);\n\t\t\tlog.error(\"exception\", e);\n\t\t}\n\n\t\treturn opt;\n\t}",
"public double getRentalPrice() {\n\t\t\n\t\treturn getDays() * aCar.getCarPrice();\n\t}",
"org.spin.grpc.util.Decimal getPriceStd();",
"public BigDecimal getPRICE() {\r\n return PRICE;\r\n }",
"public double getRealPrice() {\n return realPrice;\n }",
"public double getPrice()\n\t{\n\t\treturn this.totalPrice + this.getFlightCosts() + this.excursionSubTotal\n\t\t\t\t+ this.getLodgingCost();\n\t}",
"public float getPrice() {\n if (this.groupPrice > 0.0f) {\n return this.groupPrice;\n } else {\n return this.parkingLotPrice;\n }\n }",
"public String getReturnFlightPrice()\n\t{\n\t\tString returnprice=returnPrice.getText();\n\t\treturn returnprice;\n\n\t}",
"sigma.software.leovegas.drugstore.api.protobuf.Proto.DecimalValue getPrice();",
"public String toString () {\n return \"Retail Item: base price = \" + basePrice +\n \", discount rate = \" + discountRate +\n \", tax rate = \" + taxRate;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines what happens if an Temporary Charm tries to attack this character | public abstract boolean attack(TemporaryCharm i); | [
"public void attackTargetCharacter() {\n }",
"public int attack(Character c){\n int weapDmg=getEquippedStr();\n return -1*(weapDmg+getStrength()-c.getDefense());\n }",
"void attack(Character character);",
"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}",
"private int lightAttack() {\n return attack(9, 0);\n }",
"public void attemptAttack() {\r\n\t\tattackAttempts += 100;\r\n\t}",
"private void checkAttack()\n {\n if (usingRandomSprayAttack)\n {\n randomSprayAttack();\n }\n else if (usingFireAtPlayerAttack)\n {\n fireAtPlayerAttack();\n }\n else if (usingWaveAttack)\n {\n waveAttack();\n }\n }",
"AttackResult randomAttack();",
"void basicAttack(Character attacked);",
"public void attack();",
"public int attack(Character other){\n int damage = rand.nextInt(str) + att;\n int total;\n if(rand.nextInt(100)+(acc/2) > (other.avoid/3)){\n if(!other.defending)\n total = damage - (other.def*3/4);\n else\n total = damage - (other.incDef*3/4);\n }\n else\n total = 0;\n if(rand.nextInt(100) <= crit){\n System.out.println(\"Critical hit!\");\n total *= 2;\n }\n return total;\n }",
"@Override\n\tpublic void attack() {\n\t}",
"@Override\n public boolean canSummon() {\n return getActionsRemaining() > 0;\n }",
"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}",
"void attackedByPlayer(IPlayerCharacter character);",
"protected void resetAttacked() {\n attacked = 0;\n }",
"AttackResult userAttack();",
"public void attack() {\n //Grab an attacker.\n Territory attacker = potentialAttackers.remove(0);\n \n //Find the weakest adjacent territory\n int victimStrength = Integer.MAX_VALUE;\n Territory victim = null;\n List<Territory> adjs = gameController.getBoard().getAdjacentTerritories(attacker);\n for(Territory adj : adjs){\n \n //Verify that our odds are good enough for this attack to consider it.\n int aTroops = attacker.getNumTroops() - 1;\n int dTroops = adj.getNumTroops();\n double odds = MarkovLookupTable.getOddsOfSuccessfulAttack(aTroops, dTroops);\n boolean yes = Double.compare(odds, ACCEPTABLE_RISK) >= 0;\n \n //If we have a chance of winning this fight and its the weakest opponent.\n if(yes && adj.getNumTroops() < victimStrength && !adj.getOwner().equals(this)){\n victim = adj;\n victimStrength = adj.getNumTroops();\n }\n }\n \n //Resolve the Attack by building forces and settle the winner in Victim's land\n Force atkForce = attacker.buildForce(attacker.getNumTroops() - 1);\n Force defForce = victim.buildForce(victimStrength); //Guaranteed not null\n Force winner = atkForce.attack(defForce);\n victim.settleForce(winner);\n }",
"private int heavyAttack() {\n return attack(6, 2);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method gets a list of all the products in the database belonging to the category provided | List<Product> getProductsByCategory(String category); | [
"List<Product> getProductByCategory(String category) throws DataBaseException;",
"List<ProductCategory> getAll();",
"AttributesCollectionType listCategoryProducts(int categoryId) throws ExceptionType;",
"public List<ProductCatagory> getAllCategory() throws BusinessException;",
"public List<Product> getProCategory(int catid);",
"private List<ProductInfo> getProductsForCategory(String categoryId) {\n\t\t// Call the client stub of webservice.\n\t\tProductCatalogWSImplService productCatalogWSImplService = new ProductCatalogWSImplService();\n\t\tProductCatalogWS productCatalogService = productCatalogWSImplService\n\t\t\t\t.getProductCatalogWSImplPort();\n\n\t\tList<ProductInfo> categoryProducts = productCatalogService\n\t\t\t\t.getProductList(categoryId).getProductList();\n\n\t\treturn categoryProducts;\n\t}",
"public List<ProductA> getProducts(String category) {\n List<ProductA> productByCategory = new ArrayList<>();\n for (ProductA p : products){\n if (p.getMainCategory().equals(category) || p.getSubCategory().equals(category)){\n productByCategory.add(p);\n }\n }\n return productByCategory;\n }",
"@Override\n public List<Product> getCategory(String category, int userId) {\n\n return openSession().createNamedQuery(Product.GET_CATEGORY, Product.class)\n .setParameter(\"userId\",userId)\n .setParameter(\"category\",category)\n .getResultList();\n }",
"@RequestMapping(value = \"/category/{category}\", method = RequestMethod.GET)\n\tpublic ResponseEntity<ApiResponse<List<ProductDisplay>>> getProductsByCategory(\n\t\t\t@RequestParam(name = \"offset\", defaultValue = \"0\") int offset,\n\t\t\t@RequestParam(name = \"size\", defaultValue = \"25\") int size,\n\t\t\t@RequestParam(name = \"sort\", defaultValue = \"name\") String sort,\n\t\t\t@PathVariable(\"category\") String category) {\n\t\tApiResponse<List<ProductDisplay>> response = new ApiResponse<>();\n\t\ttry {\n\t\t\tList<ProductDisplay> products = productService.findCategoryProducts(offset, size, sort, category);\n\t\t\tresponse.setSuccess(true);\n\t\t\tresponse.setData(products);\n\t\t\treturn new ResponseEntity<>(response, HttpStatus.OK);\n\t\t} catch (Exception e) {\n\t\t\tthrow new AppException(e.getMessage());\n\t\t}\n\t}",
"public static ObservableList<productCategory> getProductCategoryList()\n {\n ObservableList<productCategory> productCategoryList = FXCollections.observableArrayList();\n\n PreparedStatement stmt = null;\n ResultSet myRst = null;\n\n try\n {\n String pstmt = \"SELECT * FROM Product_Categories;\";\n\n stmt = DBConnectionManager.con.prepareStatement(pstmt);\n myRst = stmt.executeQuery();\n\n while(myRst.next())\n {\n productCategoryList.add(extractProductCategoryFromResultSet(myRst));\n }\n\n return productCategoryList;\n\n } catch (SQLException e)\n {\n e.printStackTrace();\n }\n finally\n {\n try { if (myRst != null) myRst.close(); } catch (Exception ignored) {}\n try { if (stmt != null) stmt.close(); } catch (Exception ignored) {}\n }\n\n return null;\n }",
"@Query(\"From Product where productName =:productName and category.categoryId=:categoryId\")\r\n\tList<Product> getByNameAndCategory_CategoryId(String productName, int categoryId);",
"List<Object[]> getFeaturedProductsList(long categoryUid);",
"@Override\r\n\tpublic List<Product> listActiveProductsByCategory(int categoryId) {\r\n\t\tString selectActiveProductByCategory = \"from Product where active=:active and categoryId = :categoryId\";\r\n\t\tQuery query = sessionFactory.getCurrentSession().createQuery(selectActiveProductByCategory);\r\n\t\tquery.setParameter(\"active\", true);\r\n\t\tquery.setParameter(\"categoryId\", categoryId);\r\n\t\treturn query.getResultList();\r\n\t}",
"Page<ProductEntity> findAllByCategories(CategoryEntity category, Pageable pageable);",
"List<Product> getByCategoryIn(List<Integer> categories);",
"List<Product> getProductBySubCategory(String subCategory) throws DataBaseException;",
"@GetMapping(\"/{categoryId}/products\")\r\n @ResponseBody\r\n public DataTables<Product> getProductListByCategory(@PathVariable(\"categoryId\") Long categoryId,DataTables dt){\n return null;\r\n }",
"List<Product> getAllProducts();",
"public List<Category> getAllCategories() {\n List<Category> allCats = new ArrayList<>();\n String stat = \"SELECT * FROM Category\";\n\n try (//Get a connection to the database.\n Connection con = connectDAO.getConnection()) {\n //Create a prepared statement.\n PreparedStatement pstmt = con.prepareStatement(stat);\n ResultSet rs = pstmt.executeQuery();\n while (rs.next()) {\n //Add the categories to the list.\n int id = rs.getInt(\"id\");\n String name = rs.getString(\"name\");\n allCats.add(new Category(id, name));\n }\n return allCats;\n \n } catch (SQLServerException ex) {\n Logger.getLogger(CategoryDAO.class.getName()).log(Level.SEVERE, null, ex);\n } catch (SQLException ex) {\n Logger.getLogger(CategoryDAO.class.getName()).log(Level.SEVERE, null, ex);\n }\n return null;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method to return the Game Info Boxes , based on the width , height and GridSizeType | public static GameSizeBoxInfo generateGameGridSizes(Context context,
GridSizeValues gridSizeValues, int width,
int height) {
int grid_box_size = 0;
switch (gridSizeValues) {
case SMALL:
grid_box_size =
context.getResources().getDimensionPixelSize(R.dimen.game_size_small_box_dimen);
break;
case MEDIUM:
grid_box_size =
context.getResources().getDimensionPixelSize(R.dimen.game_size_medium_box_dimen);
break;
case LARGE:
grid_box_size =
context.getResources().getDimensionPixelSize(R.dimen.game_size_large_box_dimen);
break;
}
int y_boxes = width / grid_box_size;
int x_boxes = height / grid_box_size;
return new GameSizeBoxInfo(x_boxes, y_boxes);
} | [
"public static GameSizeBoxInfo generateGameSizeBoxInfo(Context context,\n GridSizeValues gridSizeValues) {\n WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);\n Display display = wm.getDefaultDisplay();\n Point point = new Point();\n display.getSize(point);\n\n int width =\n point.x - 2 * context.getResources().getDimensionPixelSize(R.dimen.game_screen_margin);\n int height =\n point.y - context.getResources().getDimensionPixelSize(R.dimen.game_screen_statusbar_size)\n + context.getResources().getDimensionPixelSize(R.dimen.game_screen_headerLayout);\n\n return GameInfoUtility.generateGameGridSizes(context, gridSizeValues, width, height);\n }",
"private void generateInterface() {\n\t\t\n\t\tthis.lbWidth = new JLabel (\"Width\");\n\t\tthis.lbHeight = new JLabel (\"Height\");\n\t\tthis.lbGrind = new JLabel (\"Size for the Grid\");\n\t\t\n\t\tDimensionsWindow.txWidth.setSize(100, 40);\n\t\tDimensionsWindow.txHeight.setSize(100, 40);\n\t\tDimensionsWindow.txGrindSize.setSize(100, 40);\n\t\tthis.lbWidth.setSize(100, 40);\n\t\tthis.lbHeight.setSize(100, 40);\n\t\tthis.lbGrind.setSize(100, 40);\n\t\t\n\t\tDimensionsWindow.txWidth.setBackground(Theme.background);\n\t\tDimensionsWindow.txWidth.setForeground(Theme.foreground);\n\t\tDimensionsWindow.txHeight.setBackground(Theme.background);\n\t\tDimensionsWindow.txHeight.setForeground(Theme.foreground);\n\t\tDimensionsWindow.txGrindSize.setBackground(Theme.background);\n\t\tDimensionsWindow.txGrindSize.setForeground(Theme.foreground);\n\t\t\n\t\tthis.lbWidth.setBackground(Theme.background);\n\t\tthis.lbWidth.setForeground(Theme.foreground);\n\t\tthis.lbHeight.setBackground(Theme.background);\n\t\tthis.lbHeight.setForeground(Theme.foreground);\n\t\tthis.lbGrind.setBackground(Theme.background);\n\t\tthis.lbGrind.setForeground(Theme.foreground);\n\t\t\n\t\tthis.getContentPane().add(lbWidth);\n\t\tthis.getContentPane().add(txWidth);\n\t\tthis.getContentPane().add(lbHeight);\n\t\tthis.getContentPane().add(txHeight);\n\t\tthis.getContentPane().add(lbGrind);\n\t\tthis.getContentPane().add(txGrindSize);\n\t\tthis.getContentPane().add(ok_button);\n\t\t\n\t\tok_button.addActionListener(new ActionListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tmap.newSize(Integer.parseInt(txWidth.getText()), \n\t\t\t\t\t\t\tInteger.parseInt(txHeight.getText()), \n\t\t\t\t\t\t\tInteger.parseInt(txGrindSize.getText()));\n\t\t\t\tsetVisible(false);\n\t\t\t}\n\t\t});\n\t\t\n\t}",
"private void calculateGraphicParameters() {\n\n View gameBoard = findViewById(R.id.gameBoard);\n\n width = gameBoard.getWidth();\n height = gameBoard.getHeight();\n\n // getting the minor (the board is a square)\n if (height > width) {\n height = width;\n } else {\n width = height;\n }\n\n // converting the dimensions to get them divisible by 8\n while (width % 8 != 0) {\n width--;\n height--;\n }\n\n cellWidth = (width - LEFT_MARGIN * 2) / NUMBER_OF_COLUMNS;\n cellHeight = (height - TOP_MARGIN * 2) / NUMBER_OF_ROWS;\n }",
"private GridPane emptyInfoBox() {\n\n // Initialization of the box.\n GridPane emptyBox = new GridPane();\n emptyBox.setStyle(\"-fx-background-color: #202020; -fx-hgap: 20; -fx-vgap: 20; -fx-min-height: 160; -fx-min-width: 300;\");\n emptyBox.setPadding(new Insets(5, 5, 5, 5));\n emptyBox.setBorder(new Border(new BorderStroke(Color.valueOf(\"#171717\"), BorderStrokeStyle.SOLID, null, new BorderWidths(10))));\n\n Label title = new Label(\"Celestial Object Information\");\n title.setStyle(\"-fx-text-fill: azure; -fx-font-size: 16;\");\n emptyBox.add(title, 0, 0, 3, 1);\n for (int i = 0; i < INFO_LABELS.size(); i++) {\n Label label = new Label(INFO_LABELS.get(i));\n label.setStyle(\"-fx-text-fill: azure; -fx-font-size: 14;\");\n emptyBox.add(label, 0, i + 2);\n }\n return emptyBox;\n }",
"int getGameFieldSize();",
"public JPanel playerInformation(){\r\n JFrame frame = new JFrame();\r\n JPanel allPanel = new JPanel();\r\n allPanel.setPreferredSize(new Dimension(350,1200));\r\n \r\n for(int i =0; i < maxPlayers; i++){\r\n allPanel.add(PlayerPanel(gameBoard.get_Player(i))); \r\n }\r\n return allPanel;\r\n }",
"public int getSize()\r\n\t{\r\n\t\treturn boxes.size();\r\n\t}",
"private void setSizes() {\n float arrowSize = Constants.getWeaponArrowDimension();\n leftMapArrow.setSize(arrowSize, arrowSize);\n rightMapArrow.setSize(arrowSize, arrowSize);\n\n float pickerHeight = Constants.getPickerHeight();\n\n float numberOfPlayersWidth = Constants.getNumberOfPlayerWidth();\n for(Sprite numOfPl : numberOfPlayerSprites){\n numOfPl.setSize(numberOfPlayersWidth, pickerHeight);\n }\n\n float startCustomGameWidth = Constants.getStartCustomGameWidth();\n float startCustomGameHeight = Constants.getStartCustomGameHeight();\n startGameButton.setSize(startCustomGameWidth, startCustomGameHeight);\n\n }",
"private void initGrid() {\n\t\tgridPanel.setLayout(new GridLayout(gameBoardSize, gameBoardSize));\n\t\tgridPanel.setMinimumSize(new Dimension(400, 400));\n\n\t\tfor (int row = 0; row < gameBoardSize; row++) {\n\t\t\tfor (int column = 0; column < gameBoardSize; column++) {\n\t\t\t\tSquare square = game.getGameBoard().getSquare(row, column);\n\t\t\t\tJPanel panel = new JPanel();\n\t\t\t\tJLabel label = new JLabel(getContent(square));\n\t\t\t\tlabel.setBackground(getSquareColor(square));\n\t\t\t\tpanel.setBackground(getSquareColor(square));\n\t\t\t\tif (row == 7 && column == 7)\n\t\t\t\t\tpanel.setBackground(Color.PINK);\n\t\t\t\tpanel.setSize(50, 50);\n\t\t\t\tpanel.setBorder(BorderFactory.createEtchedBorder());\n\t\t\t\tpanel.add(label);\n\t\t\t\tsquares[row][column] = panel;\n\t\t\t\tgrid[row][column] = label;\n\t\t\t\tgridPanel.add(panel);\n\t\t\t}\n\t\t}\n\n\t}",
"private JDialog createGridDialog()\n {\n final JDialog dialog = new JDialog();\n final JSlider height = new JSlider(SwingConstants.HORIZONTAL, 10, \n 30, 20);\n final JSlider width = new JSlider(SwingConstants.HORIZONTAL, 10, \n 30, 10);\n final JLabel heightLabel = new JLabel(\"Enter the height: \");\n final JLabel widthLabel = new JLabel(\"Enter the width: \");\n final JButton accept = new JButton(\"Accept\");\n \n height.setPaintLabels(true);\n height.setPaintTicks(true);\n height.setMajorTickSpacing(MAJOR_TICK_SPACING);\n height.setMinorTickSpacing(MINOR_TICK_SPACING);\n width.setPaintLabels(true);\n width.setPaintTicks(true);\n width.setMajorTickSpacing(MAJOR_TICK_SPACING);\n width.setMinorTickSpacing(MINOR_TICK_SPACING);\n \n dialog.setLayout(new BoxLayout(dialog.getContentPane(), BoxLayout.Y_AXIS));\n dialog.add(heightLabel);\n dialog.add(height);\n dialog.add(widthLabel);\n dialog.add(width);\n dialog.add(accept, Component.CENTER_ALIGNMENT);\n dialog.pack();\n dialog.setResizable(false);\n dialog.setLocationRelativeTo(null);\n \n /**\n * Adds an Action Listener for the accept button that confirms the integer choices \n * made by the user for a different grid size.\n */\n accept.addActionListener(new ActionListener() \n {\n @Override\n public void actionPerformed(final ActionEvent theEvent) \n { \n dialog.dispose();\n myBoard = new Board(width.getValue(), height.getValue());\n myDrawingPanel.setBoard(myBoard);\n myInfoPanel.setBoard(myBoard);\n myBoard.addObserver(myScoringPanel);\n myDrawingPanel.repaint();\n \n // Resets the delay.\n myDrawingPanel.getTimer().setDelay(myDrawingPanel.getTimer().\n getInitialDelay());\n pack();\n setSize(getBounds().getSize());\n repaint();\n }\n });\n \n return dialog;\n }",
"int getCraftingGridWidth();",
"public void initInfo() {\r\n\tinfoBoxHeader = lang.newText(new Coordinates(300, 50), infoText[0],\r\n\t\t\"infoBoxHeader\", null, headerProps);\r\n\r\n\tString[][] infoData = new String[][] { { \"Team:\", \"?\", \"?\" },\r\n\t\t{ infoText[1], \"?\", \"?\", }, { infoText[2], \"?\", \"?\", },\r\n\t\t{ \"S:\", \"?\", \"?\", }, { infoText[3], \"?\", \"?\", } };\r\n\tinfoBox = lang.newStringMatrix(matrix.getUpperLeft(), infoData, \"\",\r\n\t\tnull, matrixProps);\r\n\tinfoBox.moveBy(\"translate\", 200, -5, null, null);\r\n\r\n\tOffset offsetLeft = new Offset(-5, -5, infoBox,\r\n\t\tAnimalScript.DIRECTION_NW);\r\n\tOffset offsetRight = new Offset(100, 25, infoBox,\r\n\t\tAnimalScript.DIRECTION_SE);\r\n\trectProps.set(AnimationPropertiesKeys.FILLED_PROPERTY, false);\r\n\tinfoBoundingBox = lang.newRect(offsetLeft, offsetRight,\r\n\t\t\"infoBoundingBox\", null, rectProps);\r\n\tinfoBoundingBox.moveBy(\"translate\", 200, -5, null, null);\r\n }",
"public static Image getStatsBox(){\r\n return statsBox;\r\n }",
"public void createMinimap() {\n if (gameField.getFields().size() == 1024) {\n rootSize = 32;\n blockSize = 8;\n } else { //if size == 64^2 == 4096\n rootSize = 64;\n blockSize = 4;\n }\n int magnification = gameFieldController.getMagnification();\n if (AdvancedWarsApplication.getInstance().getGameScreenCon().base.getScene() != null) {\n positionBoxSizeX = blockSize *\n (AdvancedWarsApplication.getInstance().getGameScreenCon().base.getScene().getWidth() / (rootSize * magnification));\n\n positionBoxSizeY = blockSize *\n (AdvancedWarsApplication.getInstance().getGameScreenCon().base.getScene().getHeight() / (rootSize * magnification));\n } else {\n //for offline test\n positionBoxSizeX = (blockSize * 1920) / (rootSize * magnification);\n positionBoxSizeY = (blockSize * 1080) / (rootSize * magnification);\n }\n\n for (int i = 0; i < rootSize; ++i) {\n for (int j = 0; j < rootSize; ++j) {\n Field currentField = gameField.getFields().get(i * rootSize + j);\n Rectangle rectangle = new Rectangle(blockSize, blockSize);\n if (!currentField.getType().equals(\"Grass\")) {\n if (currentField.getType().equals(\"Water\")) {\n rectangle.setFill(Color.rgb(11, 89, 139));\n } else if (currentField.getType().equals(\"Forest\")) {\n rectangle.setFill(Color.rgb(38, 106, 0));\n } else { //if currentField equals Mountain\n rectangle.setFill(Color.rgb(95, 111, 54));\n }\n rectangle.relocate((i * blockSize) + 1, (j * blockSize) + 1);\n drawPane.getChildren().add(rectangle);\n }\n }\n }\n Rectangle rect = new Rectangle(positionBoxSizeX, positionBoxSizeY);\n Rectangle clip = new Rectangle(1, 1, positionBoxSizeX - 2, positionBoxSizeY - 2);\n positionBox = Shape.subtract(rect, clip);\n positionBox.setFill(Color.WHITE);\n drawPane.getChildren().add(positionBox);\n isCreated = true;\n }",
"@Override\r\n\tpublic int getSize() {\n\t\treturn gridSize;\r\n\t}",
"public abstract int getGridWidth();",
"private void initCellsSize() {\n //we need to wait until the layout is finally drawn in order to get the grid measurements\n carLayout.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {\n @Override\n public void onGlobalLayout() {\n Log.d(TAG, \"Layout drawn ! Changing cell sizes...\");\n int carLayoutWidth = carLayout.getMeasuredWidth();\n int carLayoutHeight = carLayout.getMeasuredHeight();\n\n //we want a 3x2 grid\n int cellWidth = carLayoutWidth / 3;\n int cellHeight = carLayoutHeight / 2;\n\n //apply those dimensions to all Linear in the car layout\n View subLayout;\n //each cell of the grid is filled with one image view and one text view (in this order)\n for (int i = 0; i < carLayout.getChildCount(); i++) {\n subLayout = carLayout.getChildAt(i);\n if (subLayout instanceof LinearLayout) { // security check\n ViewGroup.LayoutParams layoutParams = subLayout.getLayoutParams();\n layoutParams.width = cellWidth;\n layoutParams.height = cellHeight;\n subLayout.setLayoutParams(layoutParams);\n }\n }\n //we don't have to check this event anymore\n carLayout.getViewTreeObserver().removeOnGlobalLayoutListener(this);\n }\n });\n\n }",
"int getBoxWidth();",
"public int getSize(){\n\t\treturn(grid.length*grid.length);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the log probability assigned by this HMM to a transition from the dummy start state to the given state. | public double getLogStartProb(int state) {
// your code here
} | [
"public double getLogTransProb(int fromState, int toState) {\n\n\t// your code here\n\n }",
"public double getLogOutputProb(int state, int output) {\n\n\t// your code here\n\n }",
"double getLogProbabilityOfEstimate();",
"public double getLogProb(double x) {\n checkHasParams();\n if (x >= 0 && x <= 1) {\n double t1 = 0;\n double t2 = 0;\n if (a != 1) {\n t1 = (a - 1) * Math.log(x);\n }\n if (b != 1) {\n t2 = (b - 1) * Math.log(1 - x);\n }\n return t1 + t2 - Math.log(beta(a, b));\n } else {\n return Double.NEGATIVE_INFINITY;\n }\n }",
"public double getTransitionProbability(Integer startStateIndex, Integer endStateIndex) {\n assert startStateIndex < endStateIndex;\n double probability = 1;\n String debugStr = \"\";\n for (int i = startStateIndex; i < endStateIndex; i++) {\n int startState = states.get(i);\n int nextState = states.get(i+1);\n probability = probability * transitionProbabilityMatrix[startState][nextState];\n //debugStr += String.format(\"%s * \", transitionProbabilityMatrix[startState][nextState]);\n }\n return probability;\n }",
"public double getLogProb(double value) {\n checkHasParams();\n if (value < 0) {\n return Double.NEGATIVE_INFINITY;\n } else {\n return logLambda - lambda * value;\n }\n }",
"public abstract double getLogProbability(double value);",
"public double getObservationProbability(){\r\n double ret=0;\r\n int time=o.length;\r\n int N=hmm.stateCount;\r\n for (int t=0;t<=time;++t){\r\n for (int i=0;i<N;++i){\r\n ret+=fbManipulator.alpha[t][i]*fbManipulator.beta[t][i];\r\n }\r\n }\r\n ret/=time;\r\n return ret;\r\n }",
"double logProb(X x);",
"public double getProbability(int[] obs) {\r\n double prob = 0.0;\r\n double[][] forward = this.forwardProc(obs);\r\n // add probabilities \r\n for (int i = 0; i < this.n; i++) { // for every state \r\n prob += forward[i][forward[i].length - 1];\r\n }\r\n return prob;\r\n }",
"public double pathProb(S[] path) {\r\n\t\t// there is an equal probability to start in any state\r\n\t\tdouble prob = 1 / states.length;\r\n\t\t// loop over all state-pairs\r\n\t\tfor (int i = 0; i < path.length - 1; ++i)\r\n\t\t\t// multiply prob by this transition probability\r\n\t\t\tprob *= transProb(path[i], path[i + 1]);\r\n\t\t\r\n\t\treturn prob;\r\n\t}",
"public double getProbability(Object rootState) { return getProbability(rootState, (Object[])null); }",
"public double getLogProb(String s) {\n\t\tList<String> ngram = new LinkedList<String>();\n\t\tfor (String ss : s.split(\"\\\\s+\"))\n\t\t\tngram.add(ss);\n\t\treturn lm.getLogProb(ngram);\n\t}",
"public double getLogProbability(SparseCount obs) {\n if (this.getTopic() == null) {\n return this.content.getLogLikelihood(obs.getObservations());\n } else {\n double val = 0.0;\n for (int o : obs.getIndices()) {\n val += obs.getCount(o) * this.getLogProbability(o);\n }\n return val;\n }\n }",
"public double transition(RouteState state, RouteAction action, RouteState state0) {\r\n\t\tdouble probability = 0.0;\r\n\t\t\r\n\t\tif (state.getFromCity()==state.getToCity() || //\r\n\t\t\t\tstate.getFromCity()==state0.getFromCity() ||\r\n\t\t\t\tstate0.getFromCity()==action.getNeighborCity() || //-\r\n\t\t\t\tstate0.getToCity()!=action.getNeighborCity()|| //-\r\n\t\t\t\tstate0.getFromCity()==state0.getToCity() || //\r\n\t\t\t\tstate.getToCity() != state0.getFromCity()) {\r\n\t\t\t\tprobability = 0.0;\r\n\t\t} else {\r\n\t\t\tif (state0.hasTask()) {\r\n\t\t\t\tprobability = td.probability(state0.getFromCity(), state0.getToCity()); // delivery\r\n\t\t\t} else {\r\n\t\t\t\tprobability = 1.0/topology.cities().size();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn probability;\r\n\t}",
"abstract double leftProbability();",
"protected double transitionFunction(State currentState, Action action, State futureState){\n\n\t\t//start with 1 as the multiplicative identity\n\t\tint probability = 1;\n\n\t\t//multiples each probability\n\t\tfor (int i = 0; i < ventureManager.getNumVentures(); i++){\n\t\t\tprobability *= spec.getTransitions().get(i).get(currentState.getVenture(i) + action.getVenture(i), futureState.getVenture(i));\n\t\t}\n\n\t\treturn probability;\n\t}",
"<S> void storeInitialProbability(String hmmId, HMMInitialProbability<S> probability) throws IOException;",
"public double entropy() {\n return logp;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the system year | public static int getSystemYear() {
return Integer.parseInt(getFormattedDate("yyy", System.currentTimeMillis()));
} | [
"java.lang.String getYear();",
"public static int getYear(){\r\n\t\tint val = read(year);\r\n\t\treturn (val & 0xF) + ((val >> 4) & 0xF)* 10 + 2000;\r\n\t}",
"public int getCurrentYear(){\r\n return Calendar.getInstance().get(Calendar.YEAR);\r\n }",
"public static int getCurrentYear()\n\t{\n\t\treturn Calendar.getInstance().get(Calendar.YEAR);\n\t}",
"public int getYear() {\r\n return FormatUtils.uint16ToInt(mYear);\r\n }",
"public static int getCurrentYear() {\n return Calendar.getInstance().get(Calendar.YEAR);\n }",
"public String yearGetValue(){\r\n\t\t\r\n\t\treturn year;\r\n\t}",
"public static int getCurrentYear(){\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy\");\n Date now = new Date();\n String strDate = dateFormat.format(now);\n return Integer.parseInt(strDate);\n }",
"public int getYear(){\n\t\treturn date.getYear();\n\t}",
"public int getYear();",
"public static int getCurrentYearOnly() {\n\t\tint currYear = LocalDateTime.now().getYear();\n\t\treturn currYear;\n\t\t\n\t}",
"public Integer getDateyear() {\n return dateyear;\n }",
"public static String generateCurrentInYearString() {\n\t Calendar cal = Calendar.getInstance();\n\t cal.setTime(new Date());\n\t int currentYear = cal.get(Calendar.YEAR);\n\t return new Integer(currentYear).toString();\n\t}",
"public static String getGnssHardwareYear(Context context) {\n String year = \"\";\n LocationManager locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {\n year = String.valueOf(locationManager.getGnssYearOfHardware());\n } else {\n Method method;\n try {\n method = locationManager.getClass().getMethod(\"getGnssYearOfHardware\");\n int hwYear = (int) method.invoke(locationManager);\n if (hwYear == 0) {\n year = \"<= 2015\";\n } else {\n year = String.valueOf(hwYear);\n }\n } catch (NoSuchMethodException e) {\n Log.e(TAG, \"No such method exception: \", e);\n } catch (IllegalAccessException e) {\n Log.e(TAG, \"Illegal Access exception: \", e);\n } catch (InvocationTargetException e) {\n Log.e(TAG, \"Invocation Target Exception: \", e);\n }\n }\n return year;\n }",
"public int getCurrentYear() {\n return currentYear;\n }",
"public int getYear() {\n return date.getYear();\n }",
"int getStartYear();",
"int getSpecificationYear();",
"int getYearOfCentury();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generiert ein ReferenceImportRecordObjekt anhand der übergebenen Parameter. | public ReferenceImportRecord(String fktn, String fkcn, String pktn, String pkcn) {
super();
this.fkColumnName = fkcn;
this.fkTableName = fktn;
this.pkColumnName = pkcn;
this.pkTableName = pktn;
} | [
"public ReferenceImportRecord() {\r\n super();\r\n }",
"ImportDefinition createImportDefinition();",
"RecordDefinition createRecordDefinition();",
"private void addReference(T record) {\n addReferenceIATA(record);\n addReferenceICAO(record);\n }",
"ReferenceEmbed createReferenceEmbed();",
"Reference createReference();",
"protected abstract <T extends ReferenceAnnotation> AnnotationImporter<T> getImporter(ReferenceMetadata<T> ref);",
"private RecordRef initRecordRef(String internalId) {\r\n\t\tRecordRef recordRef = new RecordRef();\r\n\t\trecordRef.setInternalId(internalId);\r\n\t\treturn recordRef;\r\n\t}",
"ReferenceLink createReferenceLink();",
"public abstract ExternalRecord createExternalRecord()\r\n\t\t\tthrows Exception;",
"private ExternalRecord convert(int id, LayoutDetail layout, String copybookName, int system) {\n\t\tFieldDetail dtl;\n\t\tExternalField field;\n\t\tExternalRecord rec;\n\t\tRecordDetail record = layout.getRecord(id);\n\t\tString name = record.getRecordName();\n\t\tboolean embeddedCr = false;\n\t\tif (record instanceof RecordDetail) {\n\t\t\tembeddedCr =((RecordDetail) record).isEmbeddedNewLine();\n\t\t}\n\n\n\t\trec = new ExternalRecord(\n\t\t\t\tid, name, \"\", record.getRecordType(),\n\t\t\t\tsystem, \"N\", copybookName + \"_\" + name, getSeperator(record.getDelimiterDetails().jrDefinition()),\n\t\t\t\trecord.getQuoteDefinition().jrDefinition(), 0, \"default\", layout.getRecordSep(), record.getFontName(),\n\t\t\t\trecord.getRecordStyle(), fixIOType(layout.getFileStructure()), embeddedCr\n\t\t);\n\t\trec.setNew(true);\n\t\tSystem.out.println(\"Record >> \" + id + \" \" + record.getRecordName());\n\n\t\tfor (int i = 0; i < record.getFieldCount(); i++) {\n\t\t\tdtl = record.getField(i);\n\t\t\tfield = new ExternalField(dtl.getPos(), dtl.getLen(),\n\t\t\t\t\t\t\tdtl.getName(), dtl.getDescription(),\n\t\t\t\t\t\t\tdtl.getType(), dtl.getDecimal(), dtl.getFormat(), dtl.getParamater(),\n\t\t\t\t\t\t\t\"\", \"\", i\n\t\t\t);\n\n//\t\t\tif (dtl.getDefaultValue() != null\n//\t\t\t&& ! \"\".equals(dtl.getDefaultValue().toString())) {\n//\t\t\t\tfield.setDefault(dtl.getDefaultValue().toString());\n//\t\t\t}\n\t\t\trec.addRecordField(field);\n\t\t}\n\t\treturn rec;\n\t}",
"public void saveNewDependencyReference() {\r\n \tString index = getRequestParameterMap().get(ROWID);\r\n\t\tInteger record = Integer.valueOf(index).intValue();\r\n\t\tTestConditionModel hwRef = wsrdModelLists.getTestNewDepenRefType().get(record);\r\n\t\tString id = \"tcForm:tcnewrefRowID:\"+record+\":tcnewReferenceTypes1\";\r\n\t\tif(validateRefNo(hwRef,id)) {\r\n\t\t\thwRef.setInputReferenceType(false);\r\n\t\t\thwRef.setOutputReferenceType(true);\r\n\t\t\thwRef.setEditMode(false);\r\n\t\t\thwRef.setNonEditMode(true);\r\n\t\t\thwRef.setInputDisplayItem(false);\r\n\t\t\thwRef.setOutputDisplayItem(true);\r\n\t\t}\r\n }",
"public ReferenceBook() {\n\t\tsuper();\n\t\ttype = \"REFERENCE\";\n\t}",
"public RecordDefinition createRecordDefinition(String recordClassName, RecordBean recordBean) throws ERSException {\r\n\r\n\t\tlogger.info(\"Entered into createRecordDefinition method : \" + recordClassName);\r\n\r\n\t\tlogger.info(\"recordBean : \" + recordBean.toString());\r\n\r\n\t\tRecordDefinition recordDefinition = null;\r\n\r\n\t\tString objectStoreName = null;\r\n\r\n\t\tRMConnection rmConnection = null;\r\n\r\n\t\tFilePlanRepository filePlanRepository = null;\r\n\r\n\t\tString filePath = null;\r\n\r\n\t\tRecordFolderOperationsImpl folderOperationsImpl = null;\r\n\r\n\t\ttry {\r\n\r\n\t\t\tobjectStoreName = ResourceLoader.getMessageProperties().getProperty(ERSConstants.FILEPLAN_OBJECTSTORE);\r\n\r\n\t\t\trmConnection = new RMConnection();\r\n\r\n\t\t\tfolderOperationsImpl = new RecordFolderOperationsImpl();\r\n\r\n\t\t\tfilePlanRepository = rmConnection.getFilePlanRepositoryByName(ResourceLoader.getMessageProperties().getProperty(ERSConstants.FILEPLAN_OBJECTSTORE));\r\n\r\n\t\t\tRecordFolder recordFolder = RMFactory.RecordFolder.fetchInstance(filePlanRepository, recordBean.getRecordFolderId(), null);\r\n\r\n\t\t\tfilePath = recordFolder.getProperties().getStringValue(\"PathName\");\r\n\r\n\t\t\trecordDefinition = BulkDeclarationFactory.newRecordDefinition(objectStoreName, recordClassName);\r\n\r\n\t\t\tsetRecordDefinitionProperties(recordDefinition, recordBean);\r\n\r\n\t\t\tsetRecordContainer(objectStoreName, recordDefinition, recordClassName, filePath);\r\n\r\n\t\t\trecordBean.setRecordCount(recordBean.getRecordCount() + 1);\r\n\r\n\t\t\tfolderOperationsImpl.updatePropertiesToVolume(recordFolder, null, recordBean);\r\n\r\n\t\t} catch(RMRuntimeException objException) {\r\n\r\n\t\t\tlogger.error(\"RMRuntimeException occured in createRecordDefinition method \" + objException.getMessage(), objException);\r\n\r\n\t\t\tthrow new ERSException(objException.getMessage());\r\n\r\n\t\t} catch (Exception objException) {\r\n\r\n\t\t\tlogger.error(\"Exception occured in createRecordDefinition method \" + objException.getMessage(), objException);\r\n\r\n\t\t\tthrow new ERSException(objException.getMessage());\r\n\r\n\t\t} finally {\r\n\r\n\t\t\tobjectStoreName = null;\r\n\r\n\t\t\tif(filePlanRepository != null) \r\n\t\t\t\tfilePlanRepository = null;\r\n\r\n\t\t\tfilePath = null;\r\n\r\n\t\t\tif(folderOperationsImpl != null) \r\n\t\t\t\tfolderOperationsImpl = null;\r\n\t\t}\r\n\r\n\t\treturn recordDefinition;\r\n\r\n\t}",
"private ReferenceType createRef(IntuitEntity entity) {\n ReferenceType referenceType = new ReferenceType();\n referenceType.setValue(entity.getId());\n return referenceType;\n }",
"public Import createImport();",
"ReferenceProperty createReferenceProperty();",
"public TblrefTemplateRecord() {\n super(TblrefTemplate.TBLREF_TEMPLATE);\n }",
"java.lang.String getReferenceId();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
=================================================================================== Internal Main ============= Filter the date as From. It requires this method is called before getFromDateConditionKey(). | public Date filterFromDate(Date fromDate) {
if (fromDate == null) {
return null;
}
if (_compareAsDate) {
final Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(fromDate.getTime());
clearCalendarHourMinuteSecondMilli(cal);
final Date cloneDate = (Date) fromDate.clone();
cloneDate.setTime(cal.getTimeInMillis());
return cloneDate;
}
return fromDate;
} | [
"Date getValidFrom();",
"public Date getValidFrom();",
"private Predicate<ApplicationDTO> applicationInfoFilterPredicate(LocalDate applicationDateFrom, LocalDate applicationDateTo) {\n if(applicationDateFrom != null && applicationDateTo != null) {\n return applicationDTO -> !applicationDTO.getCreatedDate().toLocalDate().isBefore(applicationDateFrom)\n && !applicationDTO.getCreatedDate().toLocalDate().isAfter(applicationDateTo);\n } else if(applicationDateFrom != null) {\n return applicationDTO -> !applicationDTO.getCreatedDate().toLocalDate().isBefore(applicationDateFrom);\n } else if(applicationDateTo != null) {\n return applicationDTO -> !applicationDTO.getCreatedDate().toLocalDate().isAfter(applicationDateTo);\n } else {\n return applicationDTO -> true;\n }\n }",
"public void setDateFrom(java.util.Calendar dateFrom) {\n this.dateFrom = dateFrom;\n }",
"protected Date getFromDate() {\n\t\treturn from;\n\t}",
"public void setValidFrom(Date validFrom);",
"public boolean isSetFromDate() {\n return this.fromDate != null;\n }",
"public void setFromDate(String fromDateString) {\r\n this.fromDateString = fromDateString;\r\n }",
"public SearchFilter emailFilterCriteriaDateRange(Date fromDate, Date toDate) {\n\n\t\tSearchFilter searchFromFilter = new SearchFilter.IsGreaterThanOrEqualTo(ItemSchema.DateTimeReceived, fromDate);\n\n\t\tSearchFilter searchToFilter = new SearchFilter.IsLessThanOrEqualTo(ItemSchema.DateTimeReceived, toDate);\n\n\t\tSearchFilter unreadFilter = new SearchFilter.SearchFilterCollection(LogicalOperator.And, searchFromFilter,\n\t\t\t\tsearchToFilter);\n\n\t\treturn unreadFilter;\n\t}",
"public void setNotaryDateFromFilter(Timestamp notaryDateFromFilter) {\n\n this.notaryDateFromFilter = notaryDateFromFilter;\n }",
"public void setFROM_DATE(Date FROM_DATE)\r\n {\r\n\tthis.FROM_DATE = FROM_DATE;\r\n }",
"boolean isFilterByDate();",
"public void setValidatedFrom(Date validatedFrom);",
"private List<String> filterByDate(String[] logs, long fromDate) {\n\t\tList<String> filteredAppLogsArray = new ArrayList<String>();\n\t\tfor (String appLog : logs) {\n\n\t\t\tLong time = getLogTime(appLog);\n\t\t\tif (time != null && time >= fromDate) {\n\t\t\t\tfilteredAppLogsArray.add(appLog);\n\t\t\t}\n\n\t\t}\n\t\treturn filteredAppLogsArray;\n\t}",
"public void selectFromDate() {\n oSelUtility.waitForElementVisible(fromDateBox, 5, driver);\n oSelUtility.clickOnElement(fromDateBox, \"From Date Option\");\n oSelUtility.waitForElementVisible(fromDatesCalender, 5, driver);\n oSelUtility.clickOnElement(fromDatesCalender, \"From Date Calender\");\n oSelUtility.clickOnElement(from_date, \"From Date \");\n oActions.doubleClick().build().perform();\n }",
"public ConditionKey getFromDateConditionKey() {\r\n if (_compareAsDate) {\r\n return ConditionKey.CK_GREATER_EQUAL;\r\n }\r\n if (_fromDateGreaterThan) {\r\n return ConditionKey.CK_GREATER_THAN;// Default!\r\n } else {\r\n return ConditionKey.CK_GREATER_EQUAL;// Default!\r\n }\r\n }",
"public final void setFromDate(com.mendix.systemwideinterfaces.core.IContext context, java.util.Date fromdate)\r\n\t{\r\n\t\tgetMendixObject().setValue(context, MemberNames.FromDate.toString(), fromdate);\r\n\t}",
"public boolean isSetFromDay() {\n return this.fromDay != null;\n }",
"public void filterListTo(HiResDate start, HiResDate end);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set a new default encryptor | public static serialEncryption setDefaultEncryptor(serialEncryption cryptor) {
serialEncryption prev = defaultEncryptor ;
defaultEncryptor = cryptor ;
return prev ;
} | [
"void setEncryptionMethod(Encryptor encryptor);",
"public abstract void setEncryptMode();",
"void setCryptProvider(java.lang.String cryptProvider);",
"@Override\n protected EncryptionConfiguration createDefaultEncryptionConfiguration() {\n\n final BasicEncryptionConfiguration config = DefaultSecurityConfigurationBootstrap.buildDefaultEncryptionConfiguration();\n\n config.setDataEncryptionAlgorithms(Arrays.asList(\n EncryptionConstants.ALGO_ID_BLOCKCIPHER_AES256_GCM,\n EncryptionConstants.ALGO_ID_BLOCKCIPHER_AES192_GCM,\n EncryptionConstants.ALGO_ID_BLOCKCIPHER_AES128_GCM));\n\n config.setKeyTransportEncryptionAlgorithms(Arrays.asList(\n EncryptionConstants.ALGO_ID_KEYTRANSPORT_RSAOAEP,\n EncryptionConstants.ALGO_ID_KEYTRANSPORT_RSAOAEP11,\n\n EncryptionConstants.ALGO_ID_KEYWRAP_AES256,\n EncryptionConstants.ALGO_ID_KEYWRAP_AES128));\n\n config.setRSAOAEPParameters(new RSAOAEPParameters(\n SignatureConstants.ALGO_ID_DIGEST_SHA256,\n EncryptionConstants.ALGO_ID_MGF1_SHA1,\n null));\n\n return config;\n }",
"public void initCryptSym() {\n if (this.client.getCryptSymArt().equals(\"AES\")) {\n this.setCryptSym(new CryptAES());\n } else {\n this.setCryptSym(new CryptAES());\n }\n }",
"public void initCryptAsym() {\n if (this.client.getCryptAsymArt().equals(\"RSA\")) {\n this.setCryptAsym(new CryptRSA());\n } else {\n this.setCryptAsym(new CryptRSA());\n }\n }",
"void setEncryptionScheme(String encryptionScheme);",
"public Encryption() throws Exception\n {\n resetSalt();// sets a default SALT value\n }",
"public void useDefaultKeyPair() {\n KeyStore.PrivateKeyEntry entry = EngineEncryptionUtils.getPrivateKeyEntry();\n\n setKeyPair(\n new KeyPair(\n entry.getCertificate().getPublicKey(),\n entry.getPrivateKey()\n )\n );\n }",
"public void setEncrypt(String encrypt) {\n this.encrypt = encrypt;\n }",
"public encryption() {\n initComponents();\n }",
"public CryptCipher() {\n\t}",
"public StandardPBEByteEncryptor() {\n super();\n }",
"public void setEncryption(Encryption encryption) {\n this.encryption = encryption;\n }",
"public void setTextEncryptor(final TextEncryptor textEncryptor) {\n this.textEncryptor = textEncryptor;\n this.useTextEncryptor = Boolean.TRUE;\n }",
"public void setAsDefaultRot() {\n\t\t\n\t\t/* Update the rotation data first */\n\t\tgetRotEuler();\n\t\t\n\t\t/* Store the rotation in the variable for the default rotation */\n\t\tdefaultRot.x = rotation.x;\n\t\tdefaultRot.y = rotation.y;\n\t\tdefaultRot.z = rotation.z;\n\t}",
"protected void setProvider() {\n fs.getClient().setKeyProvider(cluster.getNameNode().getNamesystem()\n .getProvider());\n }",
"public void setEncryptionDescriptor(String descriptor) {\n encrypted = descriptor;\n }",
"protected Encryptor getEncryptor(String type)\n\t{\n\t\tEncryptorID encryptorID = EncryptorID.valueOf(type);\n\t\tif (encryptorID == null)\n\t\t{\n\t\t\tlogger.warn(\"Configured encryption engine type ('\" + type\n\t\t\t\t\t+ \"') not supported, using default (no encryption).\");\n\t\t\treturn encryptorFactory.createType(encryptorID);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tlogger.info(\"Initializing encryption engine '\" + encryptorID.getType() + \"'\");\n\t\t\treturn encryptorFactory.createType(encryptorID);\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Instantiates a NewDialog instance. | public NewDialog() {
// super((java.awt.Frame)null, "New Document");
super("JFLAP 7.0");
getContentPane().setLayout(new GridLayout(0, 1));
initMenu();
initComponents();
setResizable(false);
pack();
this.setLocation(50, 50);
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(final WindowEvent event) {
if (Universe.numberOfFrames() > 0) {
NewDialog.this.setVisible(false);
} else {
QuitAction.beginQuit();
}
}
});
} | [
"public void createAndShowDialog() {\n\t\tcreateDialog();\n\t\tgetSwingRenderer().showDialog(createdDialog, true);\n\t}",
"public abstract Dialog createDialog(DialogDescriptor descriptor);",
"public PatientDetailsDialog() {\n super();\n this.mode = Mode.NEW;\n createContent();\n\n }",
"public Dialog() {\n }",
"public static void showNew() {\n\t\tif (DIALOG == null) {\n\t\t\tDIALOG = new NewDialog();\n\t\t}\n\t\tDIALOG.setVisible(true);\n\t\tDIALOG.toFront();\n\t}",
"public NewPartDialog() {\n\t\tsetTitle(\"Add Part\");\n\t\tinit();\n\t\tconfirm.addActionListener(confirmListenerAdd);\n\t\tsetVisible(true);\n\t}",
"private DialogBox createDialogBox(String text) {\n\t DialogBox dialogBox = new DialogBox();\n\t return dialogBox;\n\t }",
"@Override\n\tprotected Dialog onCreateDialog(int id)\n\t{\n\t\tsuper.onCreateDialog(id);\n\t\treturn visitor.instantiateDialog(id);\n\t}",
"public void createDialog() {\n new AlertDialog.Builder(getContext())\n .setPositiveButton(\"MORE!\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n createDialogAgain();\n }\n })\n .setNegativeButton(\"No thanks!\", null)\n .setMessage(\"This is a standard positive/negative AlertDialog. \" +\n \"Do you want another dialog?\")\n .show();\n }",
"public JNewPersonDialog() {\n initComponents();\n \n personDetailsControl1.readDBFields();\n }",
"public void crearDialogCargar() {\n\t\tdialogoCargar= new DialogoCargar(this);\n\t\tdialogoCargar.setVisible(true);\n\t\tactualizarListaPartidas();\n\t}",
"public NewSampleDialog(ProjectExportDialog prideExportDialog, boolean modal) {\n super(prideExportDialog, modal);\n this.prideExportDialog = prideExportDialog;\n\n initComponents();\n setTitle(\"New Sample\");\n\n setUpTableAndComboBoxes();\n\n setLocationRelativeTo(prideExportDialog);\n setVisible(true);\n }",
"private void createDialog(){\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setMessage(\"Are you sure?\").setPositiveButton(\"Yes\", dialogClickListener)\n .setNegativeButton(\"No\", dialogClickListener).show();\n }",
"public DialogManager() {\n }",
"public NewFieldJDialog() \r\n {\r\n initComponents();\r\n \r\n }",
"private void jButton4NewUserActionPerformed(java.awt.event.ActionEvent evt) {\n NewClient dialog = new NewClient(new javax.swing.JFrame(), true);\n dialog.setVisible(true);\n }",
"public FiltroGirosDialog() {\n \n }",
"protected void openNewResourceTemplateDialog() {\n hide();\n try {\n NewResourceTemplateDialog newResourceTemplateDialog =\n new NewResourceTemplateDialog(getParentShell(),\n null);\n newResourceTemplateDialog.create();\n newResourceTemplateDialog.getShell().setText(NEW_RESOURCE);\n newResourceTemplateDialog.open();\n if (newResourceTemplateDialog.getReturnCode() == Window.OK) {\n setSelectedPath(newResourceTemplateDialog.getSelectedPath());\n }\n } finally {\n show();\n }\n }",
"public static void showNewRobotDialog() {\r\n\t\tRobotDialog profile = new RobotDialog(Application.getApplication( )\r\n\t\t\t\t.getShell( ));\r\n\t\tprofile.open( );\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set this sequence to hold the bases in the given String throws ReadOnlyException for CorbaSequence objects. | public void setFromString (final String new_sequence)
throws ReadOnlyException {
throw new ReadOnlyException ();
} | [
"public void fill(String[] seqInput) throws BaseException\n {\n fill(stringsToBases(seqInput));\n }",
"void setBase(java.lang.String base);",
"public void setSequence(String sequence) {\r\n\t\t this.sequence = sequence.toCharArray();\r\n\r\n\t}",
"public final void setBase(String base) {\r\n this.base = base;\r\n }",
"void setBases(Object classifierRole, Collection bases);",
"public void fill(Base[] seqInput) throws BaseException\n {\n stringRep = null;\n \n //TODO: create a variable; its value should be the minimum of seqInput's length and seq's length\n \n //TODO: copy seqInput into seq. If seqInput has more elements,\n // only copy how many will fit into seq.\n \n validate();\n }",
"public void setSequence(char[] sequence) {\r\n\t\tthis.sequence = sequence;\r\n\t}",
"void setSequence(int seq);",
"public void modifySequence(String sequence) {\n this.sequence = sequence;\n }",
"public void setCharacterSequence(String chars);",
"protected void readSequence(final LinePushBackReader in_stream)\n throws IOException \n {\n\n final int buffer_capacity = 50000;\n\n // we buffer up the sequence bases then assign them to sequence once all\n // bases are read\n StringBuffer sequence_buffer = new StringBuffer(buffer_capacity);\n String line;\n\n while((line = in_stream.readLine()) != null) \n {\n if(line.equals(\"//\")) \n {\n // end of the sequence\n in_stream.pushBack(line);\n break;\n }\n \n if(line.length() < 10) \n continue;\n\n line = line.substring(10).toLowerCase();\n\n for(int i = 0 ; i < line.length() ; ++i) \n {\n final char this_char = line.charAt(i);\n\n if(Character.isLetter(this_char) ||\n this_char == '.' ||\n this_char == '-' ||\n this_char == '*') \n sequence_buffer.append(this_char);\n else\n {\n if(Character.isSpaceChar(this_char)) {\n // just ignore it\n } \n else \n throw new ReadFormatException(\"GENBANK sequence file contains \" +\n \"a character that is not a \" +\n \"letter: \" + this_char,\n in_stream.getLineNumber());\n }\n }\n }\n \n setFromString(sequence_buffer.toString());\n }",
"public Strand(Type stype, String seqInput) throws BaseException\n {\n type = stype;\n //TODO: initialize seq with a new array of Base values of the correct length\n //Replace the next line -- it is for default compilation purposes\n seq = new Base[]{};\n fill(seqInput.split(\"\"));\n }",
"public Protein(String string) {\n super(string);\n this.aaSeq = Lists.newArrayList();\n for (Codon codon : this.sequence) {\n this.aaSeq.add(codon.getAminoAcid());\n }\n this.aaSeq = Collections.unmodifiableList(aaSeq);\n }",
"public static Base[] stringsToBases(String[] seqInput)\n {\n Base[] seqBases = new Base[seqInput.length];\n for (int i = 0; i < seqInput.length; i++)\n {\n try\n {\n seqBases[i] = Base.valueOf(seqInput[i]);\n }\n catch (IllegalArgumentException e)\n {\n seqBases[i] = Base.X;\n }\n }\n \n return seqBases;\n }",
"public Builder setTrSeq(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000004;\n trSeq_ = value;\n onChanged();\n return this;\n }",
"public Builder setTrSeq(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000008;\n trSeq_ = value;\n onChanged();\n return this;\n }",
"@Test\r\n public void testSetBaseset() {\r\n System.out.println(\"setBaseset\");\r\n String baseset = \"\";\r\n CBases instance = new CBases();\r\n instance.setBaseset(baseset);\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 Builder setNewSeq(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000080;\n newSeq_ = value;\n onChanged();\n return this;\n }",
"public void setAreabase(ListBase areabase) throws IOException\n\t{\n\t\tlong __dna__offset;\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__dna__offset = 184;\n\t\t} else {\n\t\t\t__dna__offset = 136;\n\t\t}\n\t\tif (__io__equals(areabase, __io__address + __dna__offset)) {\n\t\t\treturn;\n\t\t} else if (__io__same__encoding(this, areabase)) {\n\t\t\t__io__native__copy(__io__block, __io__address + __dna__offset, areabase);\n\t\t} else {\n\t\t\t__io__generic__copy( getAreabase(), areabase);\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Private method that given a box and a direction tells us if the next adjacent box in that direction it was already used. 0 = Up. 1 = Right. 2 = Down. 3 = Left. | private boolean isNextBoxUsed(Box box, int directionNextBox) {
if (directionNextBox < 0 || directionNextBox > 3)
throw new IllegalArgumentException("The only allowed values are between 0 and 3.");
if (box == null)
throw new IllegalArgumentException("Error. Null pointer in isNextBoxUsed().");
// [row,column] - coordinates of the box in the maze
int[] boxPosition = box.getPosition();
int row = boxPosition[0];
int column = boxPosition[1];
if (directionNextBox == 0) {
if (row == 0)
return true;
return this.grid[row - 1][column].isUsed();
}
if (directionNextBox == 1) {
if (column == this.grid[column].length - 1)
return true;
return this.grid[row][column + 1].isUsed();
}
if (directionNextBox == 2) {
if (row == this.grid.length - 1)
return true;
return this.grid[row + 1][column].isUsed();
}
if (directionNextBox == 3) {
if (column == 0)
return true;
return this.grid[row][column - 1].isUsed();
}
return false;
} | [
"private boolean allAdjacentUsed(Box box) {\n if (box == null)\n throw new IllegalArgumentException(\"Error. null pointer in allAdjacentUsed(box).\");\n return isNextBoxUsed(box, 0) && isNextBoxUsed(box, 1) && isNextBoxUsed(box, 2) && isNextBoxUsed(box, 3);\n }",
"public boolean canMoveInDirection(CursorDirection direction) {\n\n switch (direction) {\n\n case UP:\n if (y() <= Grid.PADDING) {\n return false;\n }\n return true;\n\n case DOWN:\n if (y() >= (Grid.CELLSIZE * Grid.COLUMNS + Grid.PADDING) - Grid.CELLSIZE) {\n return false;\n }\n return true;\n\n case LEFT:\n if (x() <= Grid.PADDING) {\n return false;\n }\n return true;\n\n case RIGHT:\n if (x() >= (Grid.CELLSIZE * Grid.ROWS + Grid.PADDING) - Grid.CELLSIZE) {\n return false;\n }\n return true;\n }\n return true;\n }",
"boolean isUp(Cell other){ return x == other.x && y == other.y + 1; }",
"private void testNextDirection(){\n\t\t//depending on which rectangle it intersects with at the intersection\n\t\tfor(int N = 0; N < map.getLengthRectL();N++){\n\t\t\tif(enemyRect.intersects(map.getIntersectRectR(N))){\n\t\t\t\tnextDirection[1] = true;\n\t\t\t}\n\t\t\tif(enemyRect.intersects(map.getIntersectRectL(N))){\n\t\t\t\tnextDirection[3] = true;\n\t\t\t}\n\t\t}\n\t\tfor(int N = 0; N < map.getLengthRectD();N++){\n\t\t\tif(enemyRect.intersects(map.getIntersectRectU(N))){\n\t\t\t\tnextDirection[0] = true;\n\t\t\t}\n\t\t\tif(enemyRect.intersects(map.getIntersectRectD(N))){\n\t\t\t\tnextDirection[2] = true;\n\t\t\t}\n\t\t}\n\t\t//if the ghost is alive it cannot go in the opposite direction when at an intersection\n\t\tif(isDead==false)\n\t\t\tnextDirection[oppositeDirection()] = false;\n\t}",
"private Position adjacentPosition(Direction direction, GameObject gameObject) {\n\n switch (direction) {\n case UP:\n return new Position(gameObject.getPosition().getCol(), gameObject.getPosition().getRow() - 1);\n case DOWN:\n return new Position(gameObject.getPosition().getCol(), gameObject.getPosition().getRow() + 1);\n case LEFT:\n return new Position(gameObject.getPosition().getCol() - 1, gameObject.getPosition().getRow());\n case RIGHT:\n return new Position(gameObject.getPosition().getCol() + 1, gameObject.getPosition().getRow());\n default:\n System.out.println(\"something very bad happened!\");\n return null;\n }\n }",
"private int isDeadNextDirection(){\n\t\t//if the ghost is below the spawn box\n\t\tif(level > 5){\n\t\t\t//move up if possible\n\t\t\tif(nextDirection[0] == true){\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\t//if move up is not possible and both left and right are available then move the direction that will bring it closer to the middle/spawn box X-coordinate\n\t\t\telse if(nextDirection[0] == false){\n\t\t\t\tif((nextDirection[1]==true)&&(nextDirection[3]==true)){\n\t\t\t\t\tif(enemyX < 386)\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\telse if(enemyX > 386)\n\t\t\t\t\t\treturn 3;\n\t\t\t\t}\n\t\t\t\t//if there is only one choice then move that way\n\t\t\t\telse if((nextDirection[1]==true)&&(nextDirection[3]==false))\n\t\t\t\t\treturn 1;\n\t\t\t\telse if((nextDirection[1]==false)&&(nextDirection[3]==true))\n\t\t\t\t\treturn 3;\n\t\t\t\telse if((nextDirection[1]==false)&&(nextDirection[3]==false))\n\t\t\t\t\treturn 2;\n\t\t\t}\n\t\t}\n\t\t//if the ghost is above the spawn box\n\t\telse if(level < 4){\n\t\t\t//do not allow opposite direction movement on level 2. for special case on map.\n\t\t\tif(level == 2)\n\t\t\t\tnextDirection[oppositeDirection()] = false;\n\t\t\t//if move down is possible the move down\n\t\t\tif(nextDirection[2] == true){\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t\t//if move down is not possible and both left and right are available then move the direction that will bring it closer to the middle/spawn box X-coordinate\n\t\t\telse if(nextDirection[2] == false){\n\t\t\t\tif((nextDirection[1]==true)&&(nextDirection[3]==true)){\n\t\t\t\t\tif(enemyX < 386)\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\telse if(enemyX > 386)\n\t\t\t\t\t\treturn 3;\n\t\t\t\t}\n\t\t\t\t//if there is only one choice then move that way\n\t\t\t\telse if((nextDirection[1]==true)&&(nextDirection[3]==false))\n\t\t\t\t\treturn 1;\n\t\t\t\telse if((nextDirection[1]==false)&&(nextDirection[3]==true))\n\t\t\t\t\treturn 3;\n\t\t\t\telse if((nextDirection[1]==false)&&(nextDirection[3]==false))\n\t\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t\t//if ghost is specifically on level 5.\n\t\telse if(level == 5){\n\t\t\t//if the ghost is on the right of the spawn box and it can move left then move left\n\t\t\tif(enemyX > 386){\n\t\t\t\tif(nextDirection[3]==true){\n\t\t\t\t\treturn 3;\n\t\t\t\t}\n\t\t\t\t//if it can't move left then move up.\n\t\t\t\telse if(nextDirection[3]==false){\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//if the ghost is on the left of the spawn box and it can move right then move right\n\t\t\telse if(enemyX < 386){\n\t\t\t\tif(nextDirection[1]==true){\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\t//if it can't move right then move up.\n\t\t\t\telse if(nextDirection[1]==false){\n\t\t\t\t\treturn 0;\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t\t//if the ghost is on level 4\n\t\telse if(level == 4){\n\t\t\t//move towards the center of the spawn box's X-coordinate\n\t\t\tif(enemyX < 386)\n\t\t\t\treturn 1;\n\t\t\telse if(enemyX > 386)\n\t\t\t\treturn 3;\n\t\t}\n\t\treturn 10;\n\t}",
"public boolean isAdjacent(ArrayList<Integer> blockPos, String direction){\n\t\tint row1 = blockPos.get(0);\n\t\tint column1 = blockPos.get(1);\n\t\tint row2 = blockPos.get(2);\n\t\tint column2 = blockPos.get(3);\n\t\t\n\t\tif (direction.equals(\"up\")){\n\t\t\tif (row1 <= 0){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tfor (int column = column1; column <= column2; column++){\n\t\t\t\tif (board[row1-1][column] != 0){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\telse if (direction.equals(\"down\")){\n\t\t\tif (row2 >= trayRow-1){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tfor (int column = column1; column <= column2; column++){\n\t\t\t\tif (board[row2+1][column] != 0){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\telse if (direction.equals(\"left\")){\n\t\t\tif (column1 <= 0){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tfor (int row = row1; row <= row2; row++){\n\t\t\t\tif (board[row][column1-1] != 0){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\tif (column2 >= trayColumn-1){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tfor (int row = row1; row <= row2; row++){\n\t\t\t\tif (board[row][column2+1] != 0){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t}",
"public boolean move(Direction direction) throws InvalidPuzzle {\n\t\tint[] coordinate = this.findNumber(0);\n\t\tif (direction == Direction.Up) {\n\t\t\tif (coordinate[0] == 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tint targetedNumber = this.getNumberAt(coordinate[0] - 1, coordinate[1]);\n\t\t\tthis.setNumberAt(coordinate[0] - 1, coordinate[1], 0);\n\t\t\tthis.setNumberAt(coordinate[0], coordinate[1], targetedNumber);\n\t\t}\n\t\telse if (direction == Direction.Down) {\n\t\t\tif (coordinate[0] == 3) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tint targetedNumber = this.getNumberAt(coordinate[0] + 1, coordinate[1]);\n\t\t\tthis.setNumberAt(coordinate[0] + 1, coordinate[1], 0);\n\t\t\tthis.setNumberAt(coordinate[0], coordinate[1], targetedNumber);\n\t\t}\n\t\t\n\t\telse if (direction == Direction.Left) {\n\t\t\tif (coordinate[1] == 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tint targetedNumber = this.getNumberAt(coordinate[0], coordinate[1] - 1);\n\t\t\tthis.setNumberAt(coordinate[0], coordinate[1] - 1, 0);\n\t\t\tthis.setNumberAt(coordinate[0], coordinate[1], targetedNumber);\n\t\t}\n\t\t\n\t\telse if (direction == Direction.Right) {\n\t\t\tif (coordinate[1] == 3) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tint targetedNumber = this.getNumberAt(coordinate[0], coordinate[1] + 1);\n\t\t\tthis.setNumberAt(coordinate[0], coordinate[1] + 1, 0);\n\t\t\tthis.setNumberAt(coordinate[0], coordinate[1], targetedNumber);\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"public boolean pushEdge(String direction) {\n\n\t\tthis.directionPushed = direction;\n\t\tboolean legalMove = false;\n\n\t\tsetMovedFalse(columnMoved);\n\t\tsetMovedFalse(rowMoved);\n\n\t\tif (peekNextSequence() == 0) {\n\t\t\tSystem.out.println(\"Out of Tiles!\");\n\t\t\treturn false;\n\t\t}\n\n\t\tswitch (direction) {\n\t\tcase \"U\":\n\n\t\t\tfor (int j = 0; j < 4; j++) {\n\n\t\t\t\tfor (int i = 0; i < 3; i++) {\n\n\t\t\t\t\tif ((board[i][j] == 0) && (board[i + 1][j] != 0)) {\n\n\t\t\t\t\t\tboard[i][j] = board[i][j] + board[i + 1][j];\n\t\t\t\t\t\tboard[i + 1][j] = 0;\n\t\t\t\t\t\tcolumnMoved[j] = true;\n\n\t\t\t\t\t}\n\t\t\t\t\tif ((board[i][j] == 1 && board[i + 1][j] == 2)\n\t\t\t\t\t\t\t|| (board[i][j] == 2 && board[i + 1][j] == 1)) {\n\n\t\t\t\t\t\tboard[i][j] = board[i][j] + board[i + 1][j];\n\t\t\t\t\t\tboard[i + 1][j] = 0;\n\t\t\t\t\t\tcolumnMoved[j] = true;\n\n\t\t\t\t\t}\n\t\t\t\t\tif ((board[i][j] == board[i + 1][j])\n\t\t\t\t\t\t\t&& ((board[i][j] != 0) && (board[i][j] != 1) && (board[i][j] != 2))) {\n\n\t\t\t\t\t\tboard[i][j] = board[i][j] + board[i + 1][j];\n\t\t\t\t\t\tboard[i + 1][j] = 0;\n\t\t\t\t\t\tcolumnMoved[j] = true;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tbreak;\n\t\tcase \"D\":\n\n\t\t\tfor (int j = 0; j < 4; j++) {\n\n\t\t\t\tfor (int i = 3; i > 0; i--) {\n\n\t\t\t\t\tif (((board[i][j] == 0) && (board[i - 1][j] != 0))) {\n\n\t\t\t\t\t\tboard[i][j] = board[i][j] + board[i - 1][j];\n\t\t\t\t\t\tboard[i - 1][j] = 0;\n\t\t\t\t\t\tcolumnMoved[j] = true;\n\n\t\t\t\t\t}\n\t\t\t\t\tif ((board[i][j] == 1 && board[i - 1][j] == 2)\n\t\t\t\t\t\t\t|| (board[i][j] == 2 && board[i - 1][j] == 1)) {\n\n\t\t\t\t\t\tboard[i][j] = board[i][j] + board[i - 1][j];\n\t\t\t\t\t\tboard[i - 1][j] = 0;\n\t\t\t\t\t\tcolumnMoved[j] = true;\n\n\t\t\t\t\t}\n\t\t\t\t\tif ((board[i][j] == board[i - 1][j])\n\t\t\t\t\t\t\t&& ((board[i][j] != 0) && (board[i][j] != 1) && (board[i][j] != 2))) {\n\n\t\t\t\t\t\tboard[i][j] = board[i][j] + board[i - 1][j];\n\t\t\t\t\t\tboard[i - 1][j] = 0;\n\t\t\t\t\t\tcolumnMoved[j] = true;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tbreak;\n\t\tcase \"L\":\n\n\t\t\tfor (int i = 0; i < 4; i++) {\n\n\t\t\t\tfor (int j = 0; j < 3; j++) {\n\n\t\t\t\t\tif ((board[i][j] == 0) && (board[i][j + 1] != 0)) {\n\n\t\t\t\t\t\tboard[i][j] = board[i][j] + board[i][j + 1];\n\t\t\t\t\t\tboard[i][j + 1] = 0;\n\t\t\t\t\t\trowMoved[i] = true;\n\n\t\t\t\t\t}\n\t\t\t\t\tif ((board[i][j] == 1 && board[i][j + 1] == 2)\n\t\t\t\t\t\t\t|| (board[i][j] == 2 && board[i][j + 1] == 1)) {\n\n\t\t\t\t\t\tboard[i][j] = board[i][j] + board[i][j + 1];\n\t\t\t\t\t\tboard[i][j + 1] = 0;\n\t\t\t\t\t\trowMoved[i] = true;\n\n\t\t\t\t\t}\n\t\t\t\t\tif ((board[i][j] == board[i][j + 1])\n\t\t\t\t\t\t\t&& ((board[i][j] != 0) && (board[i][j] != 1) && (board[i][j] != 2))) {\n\n\t\t\t\t\t\tboard[i][j] = board[i][j] + board[i][j + 1];\n\t\t\t\t\t\tboard[i][j + 1] = 0;\n\t\t\t\t\t\trowMoved[i] = true;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tbreak;\n\t\tcase \"R\":\n\n\t\t\tfor (int i = 0; i < 4; i++) {\n\n\t\t\t\tfor (int j = 3; j > 0; j--) {\n\n\t\t\t\t\tif ((board[i][j] == 0) && (board[i][j - 1] != 0)) {\n\n\t\t\t\t\t\tboard[i][j] = +board[i][j - 1];\n\t\t\t\t\t\tboard[i][j - 1] = 0;\n\t\t\t\t\t\trowMoved[i] = true;\n\n\t\t\t\t\t}\n\t\t\t\t\tif ((board[i][j] == 1 && board[i][j - 1] == 2)\n\t\t\t\t\t\t\t|| (board[i][j] == 2 && board[i][j - 1] == 1)) {\n\n\t\t\t\t\t\tboard[i][j] = board[i][j] + board[i][j - 1];\n\t\t\t\t\t\tboard[i][j - 1] = 0;\n\t\t\t\t\t\trowMoved[i] = true;\n\n\t\t\t\t\t}\n\t\t\t\t\tif ((board[i][j] == board[i][j - 1])\n\t\t\t\t\t\t\t&& ((board[i][j] != 0) && (board[i][j] != 1) && (board[i][j] != 2))) {\n\n\t\t\t\t\t\tboard[i][j] = board[i][j] + board[i][j - 1];\n\t\t\t\t\t\tboard[i][j - 1] = 0;\n\t\t\t\t\t\trowMoved[i] = true;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\n\t\tfor (boolean value : columnMoved) {\n\n\t\t\tif (value) {\n\t\t\t\t// System.out.println(\"Column moved true\");\n\t\t\t\tlegalMove = true;\n\t\t\t}\n\n\t\t}\n\n\t\tfor (boolean value : rowMoved) {\n\n\t\t\tif (value) {\n\t\t\t\t// System.out.println(\"Row moved true\");\n\t\t\t\tlegalMove = true;\n\t\t\t}\n\n\t\t}\n\n\t\treturn legalMove;\n\t\t// return(addTile(direction, board));\n\n\t}",
"public boolean isDirectionEmpty(int y, int x, char direction) {\r\n\t\tif (y - 1 < 3 && y - 1 > -1 && x < 3 && x > -1 && direction == 'u') {\r\n\t\t\treturn isFieldEmpty(y - 1, x);\r\n\t\t} else if (y + 1 < 3 && y + 1 > -1 && x < 3 && x > -1 && direction == 'd') {\r\n\t\t\treturn isFieldEmpty(y + 1, x);\r\n\t\t} else if (y < 3 && y > -1 && x - 1 < 3 && x - 1 > -1 && direction == 'l') {\r\n\t\t\treturn isFieldEmpty(y, x - 1);\r\n\t\t} else if (y < 3 && y > -1 && x + 1 < 3 && x + 1 > -1 && direction == 'r') {\r\n\t\t\treturn isFieldEmpty(y, x + 1);\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public int checkAdjacent(Pair p, int direction){\n\t\tint xPos = p.getFirst();\n\t\tint yPos = p.getSecond();\n\t\tint adjacentPieceState = 3; //If 3 is returned, this function was called erroneously\n\t\t\n\t\tswitch(direction){\n\t\t\t//NW\n\t\t\tcase 0:\t\n\t\t\t\tadjacentPieceState = boardGrid[yPos-1][xPos-1];\n\t\t\t\tbreak;\n\t\t\t//N\n\t\t\tcase 1:\t\n\t\t\t\tadjacentPieceState = boardGrid[yPos-1][xPos];\n\t\t\t\tbreak;\n\t\t\t//NE\n\t\t\tcase 2:\t\n\t\t\t\tadjacentPieceState = boardGrid[yPos-1][xPos+1];\n\t\t\t\tbreak;\n\t\t\t//E\n\t\t\tcase 3:\t\n\t\t\t\tadjacentPieceState = boardGrid[yPos][xPos+1];\n\t\t\t\tbreak;\n\t\t\t//SE\n\t\t\tcase 4:\t\n\t\t\t\tadjacentPieceState = boardGrid[yPos+1][xPos+1];\n\t\t\t\tbreak;\n\t\t\t//S\n\t\t\tcase 5:\t\n\t\t\t\tadjacentPieceState = boardGrid[yPos+1][xPos];\n\t\t\t\tbreak;\n\t\t\t//SW\n\t\t\tcase 6:\t\n\t\t\t\tadjacentPieceState = boardGrid[yPos+1][xPos-1];\n\t\t\t\tbreak;\n\t\t\t//W\n\t\t\tcase 7:\t\n\t\t\t\tadjacentPieceState = boardGrid[yPos][xPos-1];\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tdefault: \n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn adjacentPieceState;\n\t}",
"private int testDirection(final DirectedEdge startEdge,\n\t\tfinal int direction) {\n\n\t DirectedEdge currentDirectedEdge = startEdge;\n\t DirectedEdge nextDirectedEdge = null;\n\n\t int finalDirection = direction;\n\n\t while (!edgesAreEqual((SplitEdge) startEdge.getEdge(),\n\t\t nextDirectedEdge)) {\n\n\t\tSplitEdge currentEdge = (SplitEdge) currentDirectedEdge\n\t\t\t.getEdge();\n\n\t\t// if thats true, it means that ring already exist, so return\n\t\t// the opposite direction.\n\t\tif (currentEdge.isTwiceVisited()) {\n\t\t finalDirection = (direction == CGAlgorithms.CLOCKWISE) ? CGAlgorithms.COUNTERCLOCKWISE\n\t\t\t : CGAlgorithms.CLOCKWISE;\n\t\t break;\n\t\t}\n\t\tDirectedEdge sym = currentDirectedEdge.getSym();\n\t\tSplitGraphNode endNode = (SplitGraphNode) sym.getNode();\n\n\t\tSplitEdgeStar nodeEdges = (SplitEdgeStar) endNode.getEdges();\n\t\tnextDirectedEdge = nodeEdges.findClosestEdgeInDirection(sym,\n\t\t\tdirection);\n\n\t\tassert nextDirectedEdge != null;\n\n\t\tcurrentDirectedEdge = nextDirectedEdge;\n\t }\n\t return finalDirection;\n\t}",
"private void checkFlipDirection()\n\t{\n\t\tif (currentFloor == 0) //Are we at the bottom?\n\t\t\tcurrentDirection = Direction.UP; //Then we must go up\n\t\tif (currentFloor == (ElevatorSystem.getNumberOfFloors() - 1)) //Are we at the top?\n\t\t\tcurrentDirection = Direction.DOWN; //Then we must go down\n\t}",
"boolean isDown(Cell other){\n return x == other.x && y == other.y - 1;\n }",
"private boolean isOnEdge(final int direction, final Point currentPoint) {\n testPoint.setLocation(currentPoint);\n move(testPoint, direction);\n return testPoint.x == 0\n || testPoint.y == 0\n || testPoint.y == bufferedImage.getHeight(this)\n || testPoint.x == bufferedImage.getWidth(this)\n || isBlack(testPoint);\n }",
"public boolean isLegalStep(MoveDirection dir){\r\n GamePosition curPos = currentGame.getCurrentPosition();\n\t\tPlayer white = currentGame.getWhitePlayer();\n\t\tint[] toCheckPos = new int[2];\n\t\tint[] existingPos = new int[2];\n\t\tif(curPos.getPlayerToMove().equals(white)) {\n\t\t\ttoCheckPos[0] = curPos.getWhitePosition().getTile().getColumn();\n\t\t\ttoCheckPos[1] = curPos.getWhitePosition().getTile().getRow();\n\t\t\t\n\t\t\texistingPos[0] = curPos.getBlackPosition().getTile().getColumn();\n\t\t\texistingPos[1] = curPos.getBlackPosition().getTile().getRow();\n\t\t\t\n\t\t} else {\n\t\t\ttoCheckPos[0] = curPos.getBlackPosition().getTile().getColumn();\n\t\t\ttoCheckPos[1] = curPos.getBlackPosition().getTile().getRow();\n\t\t\t\n\t\t\texistingPos[0] = curPos.getWhitePosition().getTile().getColumn();\n\t\t\texistingPos[1] = curPos.getWhitePosition().getTile().getRow();\n\t\t}\n\t\t//0 = column, 1 = row\n\t\tif(dir == MoveDirection.North) {\n\t\t\tif(toCheckPos[1] == 1) return false;\n\t\t\tif(toCheckPos[1] - 1 == existingPos[1] && toCheckPos[0] == existingPos[0]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), -1, 0);\n\t\t} else if(dir == MoveDirection.South) {\n\t\t\tif(toCheckPos[1] == 9) return false;\n\t\t\tif(toCheckPos[1] + 1 == existingPos[1] && toCheckPos[0] == existingPos[0]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), 1, 0);\n\t\t} else if(dir == MoveDirection.East) {\n\t\t\tif(toCheckPos[0] == 9) return false;\n\t\t\tif(toCheckPos[0] + 1 == existingPos[0] && toCheckPos[1] == existingPos[1]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), 0, 1);\n\t\t} else if(dir == MoveDirection.West) {\n\t\t\tif(toCheckPos[0] == 1) return false;\n\t\t\tif(toCheckPos[0] - 1 == existingPos[0] && toCheckPos[1] == existingPos[1]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), 0, -1);\n\t\t}\n\t\t\n\t\treturn false;\r\n }",
"public boolean checkAndMove() {\r\n\r\n\t\tif(position == 0)\r\n\t\t\tdirection = true;\r\n\r\n\t\tguardMove();\r\n\r\n\t\tif((position == (guardRoute.length - 1)) && direction) {\r\n\t\t\tposition = 0;\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif(direction)\r\n\t\t\tposition++;\r\n\t\telse\r\n\t\t\tposition--;\r\n\r\n\t\treturn false;\r\n\t}",
"public boolean moveTile(int direction) {\n Coordinate movingTileCoordinate;\n //0 = up, 1 = right, 2 = down, 3 = left\n switch (direction) {\n case 0:\n movingTileCoordinate = new Coordinate(blank.row - 1, blank.col);\n return reassignValues(movingTileCoordinate);\n case 1:\n movingTileCoordinate = new Coordinate(blank.row, blank.col + 1);\n return reassignValues(movingTileCoordinate);\n case 2:\n movingTileCoordinate = new Coordinate(blank.row + 1, blank.col);\n return reassignValues(movingTileCoordinate);\n case 3:\n movingTileCoordinate = new Coordinate(blank.row, blank.col - 1);\n return reassignValues(movingTileCoordinate);\n default:\n //Wrong direction\n break;\n }\n return false;\n }",
"private boolean canMoveDown()\n {\n // runs through column first, row second\n for ( int column = 0; column < grid[0].length ; column++ ) {\n for ( int row = grid.length-2; row >=0; row-- ) {\n // looks at tile directly below the current tile\n int compare = row + 1;\n if ( grid[row][column] != 0 ) {\n if ( grid[compare][column] == 0 || grid[row][column] ==\n grid[compare][column] ) {\n return true;\n }\n }\n }\n } \n return false;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the partition in which the given element can be found, or null otherwise. | public Set<V> getPartition(V element) {
V root = find(element);
return setMap.get(root);
} | [
"public int seek(Element element) {\n Element current;\n int k = 0;\n int father = 0;\n current = heap.get(k);\n boolean foundElement = false;\n do {\n try {\n if (comparator.compare(current, element) < 0) {\n father = k;\n k = (k * 2) + 1;\n current = heap.get(k);\n } else if (comparator.compare(current, element) > 0) {\n father = k;\n k = ((2 * k) + 1) + 1;\n current = heap.get(k);\n } else {\n //achou o elemento\n foundElement = true;\n return k;\n }\n } catch (ArrayIndexOutOfBoundsException e) {\n // didn't found the element.\n return father;\n }\n } while (!foundElement);\n return father;\n }",
"public Hashable get(Hashable element){\n\t\tlocation = element.hash(size);\n\t\tresetCompares();\n\t\t\n\t\twhile (numCompares < size){ //Uses linear probing to find an element\n\t\t\tnumCompares++;\n\t\t\tif (element.equals(table[location]))\n\t\t\t\treturn table[location];\n\t\t\tlocation = (location+relativePrime) % size; \n\t\t}\n\t\treturn null;\n\t}",
"private int findElement(ComparableWithFrequency theElement)\n\t{\n\t\tint count;\n\n\t\tcount = HEAP_ROOT;\n\n\t\tfor(count = HEAP_ROOT; count < heapArray.length; count++)\n\t\t{\n\t\t\tif(theElement.compareTo(heapArray[count]) == 0)\n\n\t\t\t\treturn count;\n\t\t}\n\t\treturn -1;\n\t}",
"public Appointment find(Appointment element)\n {\n position = null;\n \n while (hasNext())\n {\n next();\n if (position.data == element)\n {\n return position.data;\n }\n }\n \n return null;\n }",
"private CAUEntry findElementWithTID(CAUList ulist, int tid){\n\t\tList<CAUEntry> list = ulist.CAUEntries;\n\t\t\n\t\t// perform a binary search to check if the subset appears in level k-1.\n int first = 0;\n int last = list.size() - 1;\n \n // the binary search\n while( first <= last )\n {\n \tint middle = ( first + last ) >>> 1; // divide by 2\n\n if(list.get(middle).tid < tid){\n \tfirst = middle + 1; // the itemset compared is larger than the subset according to the lexical order\n }\n else if(list.get(middle).tid > tid){\n \tlast = middle - 1; // the itemset compared is smaller than the subset is smaller according to the lexical order\n }\n else{\n \treturn list.get(middle);\n }\n }\n\t\treturn null;\n\t}",
"public Vertex FindSpecifedVertex(Integer element) \n {\n return this.vertices.get((element - 1));\n }",
"Optional<X> elem();",
"public String find(String element) {\n\t\t\n\t\tfor(int i = 0; i < disjointSet.size(); i++) {\t\t\t\n\t\t\tfor(String key : disjointSet.get(i).keySet()) {\t\t\t\t\n\t\t\t\tSet<String> set = disjointSet.get(i).get(key);\t\t\t\t\n\t\t\t\tif(set.contains(element))\n\t\t\t\t\treturn key;\n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\treturn null;\n\t\t\n\t}",
"public static Part findPart( Segment segment, PageParameters parameters ) {\n if ( parameters.containsKey( PART_PARM ) )\n try {\n if ( segment != null )\n return (Part) segment.getNode( parameters.getLong( PART_PARM ) );\n } catch ( StringValueConversionException ignored ) {\n LOG.warn( \"Invalid part specified in parameters. Using default.\" );\n }\n return null;\n }",
"@SuppressWarnings(\"unchecked\")\n private int findPositionForAddition(E element) {\n int position;\n int low = 0;\n int high = size - 1;\n while (true) {\n if (low > high) {\n position = low;\n break;\n }\n int middle = (low + high) / 2;\n E middleElement = (E) elements[middle];\n if (middleElement.hashCode() < element.hashCode()) {\n low = middle + 1;\n } else if (middleElement.hashCode() > element.hashCode()){\n high = middle - 1;\n } else {\n position = -1;\n break;\n }\n }\n return position;\n }",
"public Partition getMinPartition() {\n\t\tint minIndex = -1;\n\t\tint minSize = Integer.MAX_VALUE;\n\n\t\tfor (int i = 0; i < numPartitions; i++) {\n\t\t\tint size = partitions[i].getSize();\n\t\t\tif (size < minSize) {\n\t\t\t\tminIndex = i;\n\t\t\t\tminSize = size;\n\t\t\t}\n\t\t}\n\n\t\treturn partitions[minIndex];\n\t}",
"public static ComponentInstance getPartition(ComponentInstance componentInstance) {\n\t\tCollection<ComponentInstance> vprocessors = InstanceModelUtil.getBoundVirtualProcessors(componentInstance);\n\t\tfor (ComponentInstance vproc : vprocessors) {\n\t\t\tCollection<ComponentInstance> procs = InstanceModelUtil.getBoundPhysicalProcessors(vproc);\n\t\t\tfor (ComponentInstance proc : procs) {\n\t\t\t\tif (GetProperties.hasAssignedPropertyValue(proc, \"ARINC653::Module_Major_Frame\")) {\n\t\t\t\t\treturn vproc;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (GetProperties.hasAssignedPropertyValue(vproc, \"Period\")) {\n\t\t\t\treturn vproc;\n\t\t\t}\n\t\t\tif (GetProperties.hasAssignedPropertyValue(vproc, \"ARINC653::Module_Major_Frame\")) {\n\t\t\t\treturn vproc;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"private Double find_kth_element(Object arr[], int left, int right, int k) {\n\t\t\n\t\tif (k >= 0 && k <= right - left + 1) {\n\t\t\tint pos = random_partition(arr, left, right), offset = pos - left;\n\t\t\tif (offset == k - 1)\n\t\t\t\treturn (Double)arr[pos];\n\t\t\telse if (offset > k - 1)\n\t\t\t\treturn find_kth_element(arr, left, pos - 1, k);\n\t\t\treturn find_kth_element(arr, pos + 1, right, k - pos + left - 1);\n\t\t}\n\t\treturn null; // return null when k is invalid\n\t}",
"int indexOf(data element) throws ElementNotExist;",
"private IJavaElement findJavaElement(Object element) {\n\n\t\tif (element == null)\n\t\t\treturn null;\n\n\t\tIJavaElement je = null;\n\t\tif (element instanceof IAdaptable)\n\t\t\tje = (IJavaElement) ((IAdaptable) element)\n\t\t\t\t\t.getAdapter(IJavaElement.class);\n\n\t\treturn je;\n\t}",
"private int binarySearch(T element) {\n int start = 0, end = sortedArray.size(), mid = 0;\n while (start < end) {\n mid = (end + start) / 2;\n int cmp = sortedArray.get(mid).compareTo(element);\n if (cmp == 0) {\n start = end = mid;\n }\n else if (cmp < 0) {\n start = mid + 1;\n }\n else {\n end = mid;\n }\n }\n return start;\n }",
"public int findKth (ArrayList<Integer> arr, int k) {\n int start = 0;\n int end = arr.size()-1;\n int pivotIndex = 0;\n \n while (start < end) {\n pivotIndex = partition(arr, start, end);\n if (pivotIndex == k) return arr.get(k);\n else if (pivotIndex < k) {\n start = pivotIndex+1;\n } else {\n end = pivotIndex-1;\n }\n }\n \n //System.out.println(start +\" - \"+ arr.get(k));\n return arr.get(k);\n }",
"protected boolean hasPartitions()\n\t{\n\t\tboolean hasPartitions = false;\n\t\tXPath xPath = getXPathHandler();\n\t\tNodeList parentNodes;\n\t\ttry {\n\t\t\tparentNodes = (NodeList)xPath.compile(this.getParentContainerXPath()).evaluate(this.document, XPathConstants.NODESET);\n\t\t\t\n\t\t\tfor (int i = 0; i < parentNodes.getLength(); i++) \n\t\t\t{ \t\n\t\t\t\tNode parentNode = (Node)parentNodes.item(i);\n\t\t\t\t\n\t\t\t\tif (parentNode instanceof Element)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\tNodeList nodeList = parentNode.getChildNodes();\n\t\t\t\t\t\n\t\t\t\t\tNode xIntroDivNode = this.document.createElement(\"div\");\n\t\t\t\t\t((Element)xIntroDivNode).setAttribute(\"class\", this.getPartitionTypeAsString());\n\t\t\t\t\t((Element)xIntroDivNode).setAttribute(\"title\", this.getIntroPartitionTitle());\n\t\t\t\t\t\t\t \n\t\t\t\t\tfor (int j = 0; j < nodeList.getLength(); j++) \n\t\t\t\t\t{ \t\n\t\t\t \tNode xNode = nodeList.item(j);\n\t\t\t \tif (xNode instanceof Element)\n\t\t\t \t{\t\t\t \t\t\n\t\t\t \t\tString sClass = xNode.getAttributes().getNamedItem(\"class\") != null ? xNode.getAttributes().getNamedItem(this.getMatchingAttributeName()).getNodeValue() : \"\";\n\t\t\t\t \t\n\t\t\t\t \tif (sClass != null)\n\t\t\t\t \t{\t\t\t\t \t\t\n\t\t\t\t \t\tboolean match = false;\n\t\t\t\t \t\tswitch ((TaskExprType)this.getAttributeMatchExpression())\n\t\t\t\t \t\t{\n\t\t\t\t \t\tcase NOT_SET:\n\t\t\t\t \t\tcase STARTS_WITH:\n\t\t\t\t \t\t\tmatch = sClass.startsWith(this.getMatchingAttributeValue());\n\t\t\t\t \t\t\tbreak;\n\t\t\t\t \t\tcase CONTAINS:\n\t\t\t\t \t\t\tmatch = sClass.contains(this.getMatchingAttributeValue());\n\t\t\t\t \t\t\tbreak;\n\t\t\t\t \t\t}\n\t\t\t\t \t\t\n\t\t\t\t \t\t// Process the title name match condition if it exists\n\t\t\t\t \t\tString title = null;\n\t\t\t\t \t\tif (match)\n\t\t\t\t \t\t{\n\t\t\t\t \t\t\ttitle = DomUtils.extractTextChildren(xNode);\n\t\t\t\t \t\t\t\n\t\t\t\t \t\t\tif (this.isTitleNameMatchCondition())\n\t\t\t\t \t\t\t{\n\t\t\t\t\t \t\t\tif (title != null && this.getTitleNameMatchType() == TaskMatchType.EXPR)\n\t\t\t\t\t \t\t\t{\n\t\t\t\t\t \t\t\t\tswitch ((TaskExprType)this.getTitleNameMatchExprType())\n\t\t\t\t\t \t\t\t\t{\n\t\t\t\t\t \t\t\t\t\tcase STARTS_WITH:\n\t\t\t\t\t \t\t\t\t\t\tmatch = title.startsWith(this.getTitleNameMatchExprValue());\n\t\t\t\t\t \t\t\t\t\t\tbreak;\n\t\t\t\t\t \t\t\t\t\tcase CONTAINS:\n\t\t\t\t\t \t\t\t\t\t\tmatch = title.contains(this.getTitleNameMatchExprValue());\n\t\t\t\t\t \t\t\t\t\t\tbreak;\n\t\t\t\t\t \t\t\t\t\tcase NOT_SET:\n\t\t\t\t\t \t\t\t\t\t\tbreak;\n\t\t\t\t\t \t\t\t\t\tdefault:\n\t\t\t\t\t \t\t\t\t\t\tbreak;\n\t\t\t\t\t \t\t\t\t}\n\t\t\t\t\t \t\t\t\t\n\t\t\t\t\t \t\t\t} else if (this.getTitleNameMatchType() == TaskMatchType.REGEX)\n\t\t\t\t\t \t\t\t{\n\t\t\t\t\t\t \t\t\tPattern r = Pattern.compile(this.getTitleNameMatchRegexPattern());\t\t\t \t\t\t\n\t\t\t\t\t\t \t\t\tMatcher m = r.matcher(title);\t\t\t \t\t\t\n\t\t\t\t\t\t \t\t\tmatch = m.matches();\n\t\t\t\t\t \t\t\t}\n\t\t\t\t \t\t\t}\n\t\t\t\t \t\t}\n\t\t\t\t \t\t\n\t\t\t\t \t\tif (match) hasPartitions = match;\n\t\t\t\t \t}\t \t\n\t\t\t \t}\n\t\t\t } // end for j\n\t\t\t\t} // end if parentNode\n\t\t\t} // end for i\n\t\t} catch (XPathExpressionException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\t\t\t\n\t\t\n\t\tlogger.info(\">>> \" + this.getPartitionType().name() + \" Partitioner: hasPartitions()=\"+hasPartitions);\n\t\t\n\t\treturn hasPartitions;\n\t}",
"public int getPartition (Object key) { throw new RuntimeException(); }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deletes the given registrant from persistent storage. | public void deleteRegistrant(Registrant registrant) {
EntityManager em = getEntityManager();
Query registrantDeletePublicationDownloads = em.createNamedQuery( "registrantDeletePublicationDownloads" );
Query registrantDeletePublicationItemDownloads = em.createNamedQuery( "registrantDeletePublicationItemDownloads" );
registrantDeletePublicationDownloads.setParameter( "registrantId", registrant.getId() );
registrantDeletePublicationItemDownloads.setParameter( "registrantId", registrant.getId() );
registrantDeletePublicationDownloads.executeUpdate();
registrantDeletePublicationItemDownloads.executeUpdate();
getEntityManager().remove( registrant );
} | [
"public void deleteRegistration(UUID id);",
"public void deleteRegistration(String regNumber)throws Exception;",
"@Override\n public void deleteTenant(int tenantId, boolean removeFromPersistentStorage) throws UserStoreException {\n return;\n }",
"void deleteByRegNo(String regNo);",
"void deleteStorageById(Integer id);",
"public static void viewDeleteRegistrant() {\n\t\tint regNum = Integer.parseInt(getResponseTo(\"Enter registrants number to delete: \"));\r\n\t\tString choice = getResponseTo(\"You are about to delete a registrant number and all the its \"\r\n\t\t\t\t+ \"associated properties;\\nDo you wish to continue? (Enter ‘Y’ to proceed.) \");\r\n\t\tif (choice.equals(\"Y\") || choice.equals(\"y\")) {\r\n\t\t\tRegistrant deletedRegistrant = getRegControl().deleteRegistrant(regNum);\r\n\t\t\tif (deletedRegistrant == null) {\r\n\t\t\t\tSystem.out.println(\"No registrations number found.\");\r\n\t\t\t} else {\r\n\t\t\t\tArrayList<Property> prop_list = rc.listOfProperties(regNum);\r\n\t\t\t\trc.deleteProperties(prop_list);\r\n\t\t\t\tSystem.out.println(\"Registrant and related properties deleted.\");\r\n\t\t\t}\r\n\t\t} else { // if deleteRegistrant return null, the program failed to delete (no registrant\r\n\t\t\t\t\t// with given regNum exists)\r\n\t\t\tSystem.out.printf(\"The registrant with registrant number %d was not deleted.\", regNum);\r\n\t\t}\r\n\t}",
"public void delete(final Requerente entity);",
"@DELETE\n @Path(\"/{register_id}\")\n Response delete(@PathParam(\"register_id\") Long registerId);",
"void delete(Storage<?> storage);",
"public void delete(final Requerido entity);",
"public static void deleteRegistration(Player player)\n\t{\n\t\tremovePlayer(player);\n\t}",
"public void deletePatientByPrimaryKey(long id) throws PatientExn;",
"public void deleteUuid() {\n Context context = Leanplum.getContext();\n if (context == null)\n return;\n\n SharedPreferences preferences = context.getSharedPreferences(\n Constants.Defaults.LEANPLUM, Context.MODE_PRIVATE);\n\n SharedPreferences.Editor editor = preferences.edit();\n editor.remove(Constants.Defaults.UUID_KEY);\n editor.apply();\n }",
"private void delete() {\n mProductionDatabaseReference.removeValue();\n\n }",
"public void delete(final Usuario entity);",
"@RequestMapping(value = STORAGES_URI_PREFIX + \"/{storageName}\", method = RequestMethod.DELETE)\n @Secured(SecurityFunctions.FN_STORAGES_DELETE)\n public Storage deleteStorage(@PathVariable(\"storageName\") String storageName)\n {\n StorageAlternateKeyDto alternateKey = StorageAlternateKeyDto.builder().storageName(storageName).build();\n return storageService.deleteStorage(alternateKey);\n }",
"void deleteCashRegisterById(String id);",
"public void deletePatient(Patient patient) throws DAOException;",
"@Delete(\"DELETE from patients WHERE id_patient=#{patientId}\")\n void deletePatient(int patientId);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display the Video stream | private void displayVideo(Mat frame){
surfView.setDisplayFrame(frame);
Canvas c;
c = null;
try {
c = surfView.getHolder().lockCanvas(null);
synchronized (surfView.getHolder()) {
surfView.draw(c);
}
} finally {
if (c != null) {
surfView.getHolder().unlockCanvasAndPost(c);
}
}
} | [
"private void gotRemoteStream(MediaStream stream) {\n final VideoTrack videoTrack = stream.videoTracks.get(0);\n runOnUiThread(() -> {\n try {\n remoteVideoView.setVisibility(View.VISIBLE);\n videoTrack.addSink(remoteVideoView);\n } catch (Exception e) {\n Log.e(\"MainActivity\", \"gotRemoteStream: -----> \"+e.getMessage());\n e.printStackTrace();\n }\n });\n\n }",
"public void startVideoStream()\n {\n captureStream.setObserver(new MyCaptureObserver());\n try\n {\n VideoFormat format = null;\n for (int i = 0; i < captureStream.enumVideoFormats().size(); i++)\n {\n format = captureStream.enumVideoFormats().get(i);\n if (format.getWidth() == 320)\n {\n break;\n }\n }\n if (format.getWidth() != 320)\n {\n format = captureStream.enumVideoFormats().get(0);\n }\n captureStream.setVideoFormat(format);\n System.out.println(\"Current video format \" + videoFormatToString(captureStream.getVideoFormat()));\n captureStream.start();\n // Sleep for 5 seconds to give the camera time to start\n try\n {\n Thread.sleep(5000);\n }\n catch (InterruptedException e)\n {\n e.printStackTrace();\n }\n }\n catch (CaptureException e)\n {\n e.printStackTrace();\n }\n }",
"private void gotRemoteStream(MediaStream stream) {\n //we have remote video stream. add to the renderer.\n final VideoTrack videoTrack = stream.videoTracks.get(0);\n if (mEventUICallBack != null) {\n mEventUICallBack.showVideo(videoTrack);\n }\n// runOnUiThread(() -> {\n// try {\n// binding.remoteGlSurfaceView.setVisibility(View.VISIBLE);\n// videoTrack.addSink(binding.remoteGlSurfaceView);\n// } catch (Exception e) {\n// e.printStackTrace();\n// }\n// });\n }",
"private void previewVideo() {\n try {\n // hide image preview\n imgPreview.setVisibility(View.GONE);\n\n videoPreview.setVisibility(View.VISIBLE);\n if (fileUri != null) {\n videoPreview.setVideoPath(fileUri.getPath());\n // start playing\n videoPreview.start();\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"public VideoFrame() {\n initComponents();\n imagePane.setContentType(\"text/html\");\n \n new VideoLoader().start();\n \n \n }",
"public void startStreaming() {\n// phoneCam.setViewportRenderingPolicy(OpenCvCamera.ViewportRenderingPolicy.OPTIMIZE_VIEW);\n phoneCam.startStreaming(320, 240, OpenCvCameraRotation.SIDEWAYS_RIGHT);\n }",
"@Override\n public void onServerStart(String videoStreamUrl)\n {\n\n\n\n Log.d(\"Activity\",\"URL: \"+ videoStreamUrl);\n\n\n video = (VideoView)findViewById(R.id.video);\n\n Uri uri = Uri.parse(videoStreamUrl);\n video.setVideoURI(uri);\n video.start();\n\n\n\n }",
"public void display() {\n startPreview();\n }",
"Video createVideo();",
"private static void ViewVideos(List<Video> videos) {\t\t\t//VIEW DETAILS VIDEO\n\t\t\n\t\t\tfor (Video video : videos) {\n\t\t\t\tSystem.out.println(video + \"\\n\");\t\t\t\t\n\t\t\t}\t\t\n\t}",
"public void showActivityStream() throws Exception {\n\t\tthis.getControl(\"activityStreamButton\").click();\n\t\tbottomPaneState = \"activityStream\";\n\t\tVoodooUtils.pause(2000);\n\t}",
"public ABLVideo Video() {\r\n \treturn new ABLVideo(BrickFinder.getDefault().getVideo());\r\n }",
"public void verVideo(View v) {\n ViewVideo.setVideoURI(Uri.parse(getExternalFilesDir(null) + \"/\" + txtNombreArchivo.getText().toString()));\n /*Ejecutamos el video*/\n ViewVideo.start();\n }",
"private void show_fullScreenVideoView(){\r\n if (this.fullScreenVideoView != null) {\r\n this.fullScreenVideoView.setVisibility(View.VISIBLE);\r\n }else{\r\n Log.e(TAG, \"[VIDEOPLUGIN] fullScreenVideoView: remoteVideoView is null\");\r\n }\r\n }",
"public boolean videoDisplayEnabled();",
"public void run() {\r\n\t\t// This will run the video.\r\n\t\tmediaPlayerComponent.getMediaPlayer().playMedia(getMediapath());\r\n\t\t// This will get the current time of the video.\r\n\t\tfinal long time = mediaPlayerComponent.getMediaPlayer().getTime();\r\n\t\t// This will get the position of the video.\r\n\t\tfinal int position = (int) (mediaPlayerComponent.getMediaPlayer()\r\n\t\t\t\t.getPosition() * 1000.0f);\r\n\t\t// This will get the total length of the video.\r\n\t\tfinal long duration = mediaPlayerComponent.getMediaPlayer().getLength();\r\n\r\n\t\tSystem.out.println(\"hello\");\r\n\t\t\r\n\t\t// This will be used to update the GUI.\r\n\t\tSwingUtilities.invokeLater(new Runnable() {\r\n\t\t\t@Override\r\n\t\t\tpublic void run() {\r\n\t\t\t\tif (mediaPlayerComponent.getMediaPlayer().isPlaying()) {\r\n\t\t\t\t\tupdateTime(time);\r\n\t\t\t\t\tupdatePosition(position);\r\n\t\t\t\t\tupdateDuration(duration);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t// This will execute the code at a fixed rate.\r\n\t\texecutorService.scheduleAtFixedRate(new UpdateRunnable(\r\n\t\t\t\tmediaPlayerComponent), 0, 100, TimeUnit.MILLISECONDS);\r\n\t}",
"private void showVideoData() {\n GlideApp.with(getApplicationContext())\n .load(video.getThumbNailUrl())\n .thumbnail(0.5f)\n .into(videoThumbnail);\n\n payPerViewLayout.setVisibility(video.isPayPerView() ? View.VISIBLE : View.GONE);\n\n videoTitle.setText(video.getTitle());\n videoTitle.setSelected(true);\n newOrOldText.setText(MessageFormat.format(\"{0} Views\", video.getViewCount()));\n yearPublished.setText(video.getPublishTime());\n ageRestriction.setText(MessageFormat.format(\"{0}+\", video.getAge()));\n numSeasons.setText(MessageFormat.format(\"{0} likes\", video.getLikes()));\n descHeader.setText(video.getDetail());\n description.setText(video.getDescription());\n myListToggle.setCompoundDrawablesRelativeWithIntrinsicBounds(null, video.isInWishList()\n ? addedToWishListDrawable : notAddedToWishListDrawable, null, null);\n\n starringText.setText(getSpannableCastAndCrew(video.getCasts()), TextView.BufferType.SPANNABLE);\n starringText.setHighlightColor(Color.TRANSPARENT);\n starringText.setMovementMethod(LinkMovementMethod.getInstance());\n\n wishListToggle.setCompoundDrawablesRelativeWithIntrinsicBounds(null, video.isLiked()\n ? drawableLike : drawableUnlike, null, null);\n\n showDownloadStatusInViews();\n }",
"private void liveStreaming() throws IOException, InterruptedException {\n\n CamStreaming camStreaming = new CamStreaming();\n VideoDataStream vds = new VideoDataStream(true);\n byte[] frame;\n\n if (camStreaming.prepareStream(in)) {\n\n while (camStreaming.isTargetConnected()) {\n try {\n\n if (dis.available() > 0) {\n frame = vds.processFrame(dis);\n camStreaming.sendData(frame);\n }\n } catch (Exception ex) {\n ex.printStackTrace();\n break;\n }\n sleep(20);\n }\n \n dos.writeInt(END_OF_STREAM_CODE);\n dos.flush();\n \n// CamRegister.removeCamClient(camClient);\n \n RecordStorage recordStorage = new RecordStorage();\n\n recordStorage.saveVideo(vds.getBuffer(), camClient.getCamCode());\n\n vds.cleanBuffer();\n\n }\n\n }",
"public void writeVideo(){\n if(recorder != null){\n try {\n recorder.stop();\n } catch (FrameRecorder.Exception ex) {\n Logger.getLogger(VideoMakerCV.class.getName()).log(Level.SEVERE, null, ex);\n }\n System.out.println(\"Done with Video\"); \n }\n if(displayVid){\n canvasFrame.dispose();\n }\n videoWritten=true;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates new form SummaryView | public SummaryView() {
initComponents();
} | [
"public SummaryFragment newInstance()\n {\n return new SummaryFragment();\n }",
"SummaryPresenter(SummaryView view) {\n this.view = view;\n }",
"public Summary() {\n initComponents();\n \n }",
"public static Result newForm() {\n return ok(newForm.render(palletForm, setOfArticleForm));\n }",
"public TmSummary() {\r\n initComponents();\r\n updateScreenData();\r\n }",
"public View createView(ExaminationDataSet dataSet) {\n return new StatisticsView(dataSet, term);\n }",
"Views createViews();",
"public SummaryPane() {\n\t\tbuildUpGUI();\n\t\tsetDefaultValues();\n\t\t//summaryEditorPane.addHyperlinkListener( new Hyperactive() );\n\t}",
"public viewsalarydetails() {\n initComponents();\n }",
"public void showCustomSummary() {\n editSummaryFragment.show();\n }",
"@Override\n\tpublic void show() {\n\t\tthis.mainController.setSubview(new BestellijstenSummaryView(this, mainController));\n\t}",
"View createView();",
"private void createNewStoryDialog() {\n view.createNewStoryDialog();\n }",
"public AddViewUpdate() {\n initComponents();\n }",
"public ISummary<K> createSummaryOfTheSummary() throws IOException;",
"ActionCreateEventForm(Context model, CreateEventPanel view){\r\n\t\tthis.view = view;\r\n\t\tthis.model = model;\r\n\t\tthis.putValue(Action.NAME, \"Valider\");\r\n\t}",
"public StatisticView() {\n\n\t\tinitializeUI();\n\t}",
"public void newRecipe(View view){\n RecipeDBHandler dbHandler = new RecipeDBHandler(this, null,null,1);\n String newrep = newrecipename.getText().toString();\n String newrepdet = newrecipedetails.getText().toString();\n\n Recipe recipe = new Recipe(newrep, newrepdet);\n dbHandler.addRecipe(recipe);\n newrecipename.setText(\"\");\n newrecipedetails.setText(\"\");\n //save feedback\n recipefeedback.setText(\"Recipe Saved\");\n }",
"private void showCreateMilestoneForm() {\n final Dialog dialog = new Dialog(this);\n\n dialog.setContentView(R.layout.issue_create_milestone);\n dialog.setTitle(\"Create Milestone\");\n dialog.setCancelable(true);\n \n final EditText tvTitle = (EditText) dialog.findViewById(R.id.et_title);\n final EditText tvDesc = (EditText) dialog.findViewById(R.id.et_desc);\n \n Button btnCreate = (Button) dialog.findViewById(R.id.btn_create);\n btnCreate.setOnClickListener(new OnClickListener() {\n \n @Override\n public void onClick(View arg0) {\n String title = tvTitle.getText().toString();\n String desc = null;\n \n if (tvDesc.getText() != null) {\n desc = tvDesc.getText().toString(); \n }\n \n if (!StringUtils.isBlank(title)) {\n dialog.dismiss();\n new AddIssueMilestonesTask(IssueMilestoneListActivity.this).execute(title, desc);\n }\n else {\n showMessage(getResources().getString(R.string.issue_error_milestone_title), false);\n }\n }\n });\n \n dialog.show();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns record of client data from remote server Returns DNF if a record could not be found remotely | private String[] searchForUserRemotely(String username) {
String[] record = { DNF, null, null };
for (int i=0; i<RTable.length && record[0].equals(DNF); ++i)
if ( ((String)RTable[i][USERNAME]).equals(SERVER_ID) ) {
try { record = requestDataFromExternalServer((Socket)RTable[i][SOCKET], username); }
catch (IOException e) {
System.err.println("Lost connection to an external server... Closing connection. ");
RTable[i][USERNAME] = REMOVED_ENTRY;
}
}
return record;
} | [
"public Host.Record getRecord(Connection c) throws BadServerResponse,\n\t\t\tXenAPIException, XmlRpcException {\n\t\tString method_call = \"host.get_record\";\n\t\tString session = c.getSessionReference();\n\t\tObject[] method_params = { Marshalling.toXMLRPC(session),\n\t\t\t\tMarshalling.toXMLRPC(this.ref) };\n\t\tMap response = c.dispatch(method_call, method_params);\n\t\tObject result = response.get(\"Value\");\n\t\treturn Types.toHostRecord(result);\n\t}",
"public FSReturnVals ReadFirstRecord(FileHandle ofh, TinyRec rec)\n {\n FSReturnVals outcome = FSReturnVals.Fail;\n // should set ip address, port number\n Vector<IP> servers = ofh.getServersForChunk(rec.getRID().getChunkHandle());\n int numServers = servers.size();\n if (ofh == null)\n {\n return FSReturnVals.BadHandle;\n }\n if (rec == null)\n {\n return FSReturnVals.BadRecID;\n }\n for(int i = 0; i < numServers; i++)\n {\n IP ip = new IP();\n ip.setPort(servers.elementAt(i).getPort());\n ip.setAddress(servers.elementAt(i).getAddress());\n try\n {\n Socket sock = new Socket(ip.getAddress(), ip.getPort());\n ObjectOutputStream serverOutput = new ObjectOutputStream(sock.getOutputStream());\n serverOutput.flush();\n ObjectInputStream serverInput = new ObjectInputStream(sock.getInputStream());\n serverOutput.writeInt(Constants.IsClient);\n \n serverOutput.writeInt(Constants.READ_FIRST_RECORD);\n serverOutput.writeInt(rec.getRID().getChunkHandle().length());\n serverOutput.writeBytes(rec.getRID().getChunkHandle());\n serverOutput.flush();\n \n int response = serverInput.readInt();\n if (response == Constants.FALSE)\n {\n i--;\n continue;\n }\n \n //int type = serverOutput.readInt();\n //int command = serverOutput.readInt();\n //if(type == Constants.IsServer && command = Constants.READ_FIRST_RECORD)\n //{\n int sz = serverInput.readInt();\n byte[] data = new byte[sz];\n serverInput.read(data, 0, sz);\n String datastr = new String(data, \"UTF-8\");\n if(data.length > 0)\n {\n int j = serverInput.readInt();\n outcome = intToFSReturnVal(j);\n rec.setPayload(data);\n break;\n }\n else\n {\n i--;\n continue;\n }\n //}\n //else\n //{\n // int j = serverInput.readInt();\n // outcome = intToFSReturnVal(j)\n //}\n }\n catch (Exception e)\n {\n outcome = FSReturnVals.Fail;\n System.out.println(\"Unable to append records (ClientREC:65)\");\n }\n }\n \n return outcome;\n\t}",
"public String findDataServer(String remote) {\n\t\t// get all replicas.\n\t\tString replicas = metaserver.lookupF2DSTable(remote);\n\t\t// return primary only.\n\t\tif (replicas != null)\n\t\t\treturn replicas;\n\t\treturn \"file not found\";\n\t}",
"public FSReturnVals ReadNextRecord(FileHandle ofh, RID pivot, TinyRec rec)\n {\n FSReturnVals outcome = FSReturnVals.Fail;\n // should set ip address, port number\n Vector<IP> servers = ofh.getServersForChunk(pivot.getChunkHandle());\n int numServers = servers.size();\n if (ofh == null)\n {\n return FSReturnVals.BadHandle;\n }\n if (rec == null)\n {\n return FSReturnVals.RecDoesNotExist;\n }\n for(int i = 0; i < numServers; i++)\n {\n IP ip = new IP();\n ip.setPort(servers.elementAt(i).getPort());\n ip.setAddress(servers.elementAt(i).getAddress());\n try\n {\n Socket sock = new Socket(ip.getAddress(), ip.getPort());\n ObjectOutputStream serverOutput = new ObjectOutputStream(sock.getOutputStream());\n serverOutput.flush();\n ObjectInputStream serverInput = new ObjectInputStream(sock.getInputStream());\n serverOutput.writeInt(Constants.IsClient);\n \n serverOutput.writeInt(Constants.READ_NEXT_RECORD);\n serverOutput.writeInt(pivot.getChunkHandle().length());\n serverOutput.writeBytes(pivot.getChunkHandle());\n serverOutput.flush();\n serverOutput.writeInt(pivot.index);\n \n int response = serverInput.readInt();\n if (response == Constants.FALSE)\n {\n i--;\n continue;\n }\n else if (response == Constants.NOT_IN_CHUNK)\n {\n i--;\n continue;\n }\n \n //int type = serverOutput.readInt();\n //int command = serverOutput.readInt();\n //if(type == Constants.IsServer && command = Constants.READ_NEXT_RECORD)\n //{\n int sz = serverInput.readInt();\n byte[] data = new byte[sz];\n serverInput.read(data, 0, sz);\n String datastr = new String(data, \"UTF-8\");\n if(data.length > 0)\n {\n int j = serverInput.readInt();\n outcome = intToFSReturnVal(j);\n rec.setPayload(data);\n break;\n }\n else\n {\n i--;\n continue;\n }\n //}\n //else\n //{\n // int j = serverInput.readInt();\n // outcome = intToFSReturnVal(j)\n //}\n \n }\n catch (Exception e)\n {\n outcome = FSReturnVals.Fail;\n System.out.println(\"Unable to append records (ClientREC:65)\");\n }\n }\n \n return outcome;\n }",
"public ResultSet ServerData() {\n\t\tResultSet rs = null; //new resultset of default value null\r\n\t\ttry {\r\n\r\n\r\n\t\t\tString query = \"SELECT * FROM TBLSERVERS\"; //get all data in the TBLSERVERS table\r\n\t\t\tPreparedStatement pst = conn.prepareStatement(query); //prepare a new statement\r\n\t\t\trs = pst.executeQuery(); //execute statement and store result in a resultset \r\n\t\t} catch (SQLException ex) { //catches SQL exception to prevent an application crash in this case\r\n\t\t\tLogger.getLogger(DB.class.getName()).log(Level.SEVERE, null, ex);\r\n\r\n\t\t}\r\n\t\treturn rs;\r\n\t}",
"public FSReturnVals ReadPrevRecord(FileHandle ofh, RID pivot, TinyRec rec)\n {\n FSReturnVals outcome = FSReturnVals.Fail;\n // should set ip address, port number\n Vector<IP> servers = ofh.getServersForChunk(pivot.getChunkHandle());\n int numServers = servers.size();\n if (ofh == null)\n {\n return FSReturnVals.BadHandle;\n }\n if (rec == null)\n {\n return FSReturnVals.RecDoesNotExist;\n }\n for(int i = 0; i < numServers; i++)\n {\n IP ip = new IP();\n ip.setPort(servers.elementAt(i).getPort());\n ip.setAddress(servers.elementAt(i).getAddress());\n try\n {\n Socket sock = new Socket(ip.getAddress(), ip.getPort());\n ObjectOutputStream serverOutput = new ObjectOutputStream(sock.getOutputStream());\n serverOutput.flush();\n ObjectInputStream serverInput = new ObjectInputStream(sock.getInputStream());\n serverOutput.writeInt(Constants.IsClient);\n \n serverOutput.writeInt(Constants.READ_PREV_RECORD);\n serverOutput.writeInt(pivot.getChunkHandle().length());\n serverOutput.writeBytes(pivot.getChunkHandle());\n serverOutput.flush();\n serverOutput.writeInt(pivot.index);\n \n int response = serverInput.readInt();\n if (response == Constants.FALSE)\n {\n i--;\n continue;\n }\n else if (response == Constants.NOT_IN_CHUNK)\n {\n i--;\n continue;\n }\n \n //int type = serverOutput.readInt();\n //int command = serverOutput.readInt();\n //if(type == Constants.IsServer && command = Constants.READ_NEXT_RECORD)\n //{\n int sz = serverInput.readInt();\n byte[] data = new byte[sz];\n serverInput.read(data, 0, sz);\n String datastr = new String(data, \"UTF-8\");\n if(data.length > 0)\n {\n int j = serverInput.readInt();\n outcome = intToFSReturnVal(j);\n rec.setPayload(data);\n break;\n }\n else\n {\n i--;\n continue;\n }\n //}\n //else\n //{\n // int j = serverInput.readInt();\n // outcome = intToFSReturnVal(j)\n //}\n \n }\n catch (Exception e)\n {\n outcome = FSReturnVals.Fail;\n System.out.println(\"Unable to append records (ClientREC:65)\");\n }\n }\n \n return outcome;\n }",
"@Nullable\n public DomainDnsRecord get() throws ClientException {\n return send(HttpMethod.GET, null);\n }",
"public WhoisRecord query(String sDomain) throws IOException\n\t{\n\t\tString sTld = sDomain.substring(sDomain.indexOf('.') + 1);\n\t\tString sServer = aWhoisServerMap.get(sTld);\n\t\tString sParams = aWhoisParamsMap.get(sTld);\n\n\t\tif (sServer == null)\n\t\t{\n\t\t\tsServer = \"whois.geektools.com\";\n\t\t}\n\t\telse if (sParams != null)\n\t\t{\n\t\t\tsDomain = sParams + \" \" + sDomain;\n\t\t}\n\n\t\tWhoisRecord aWhoisRecord =\n\t\t\tnew WhoisRecord(queryWhoisServer(sServer, sDomain));\n\n\t\tif (aRecursiceLookupTlds.contains(sTld))\n\t\t{\n\t\t\tsServer = aWhoisRecord.findValue(\"Whois Server:\");\n\n\t\t\tif (sServer == null)\n\t\t\t{\n\t\t\t\taWhoisRecord.getLines().add(0, \"+++++++++++++++++++++++++++++\");\n\t\t\t\taWhoisRecord.getLines().add(1, \"ERROR: No Detail WHOIS server\");\n\t\t\t\taWhoisRecord.getLines().add(2, \" found in master record\");\n\t\t\t\taWhoisRecord.getLines().add(3, \"+++++++++++++++++++++++++++++\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\taWhoisRecord.getLines().add(\"\");\n\t\t\t\taWhoisRecord.getLines()\n\t\t\t\t\t\t\t.add(\"---------- Detail WHOIS from \" +\n\t\t\t\t\t\t\t\t sServer + \" -----------\");\n\t\t\t\taWhoisRecord.getLines().add(\"\");\n\t\t\t\taWhoisRecord.getLines()\n\t\t\t\t\t\t\t.addAll(queryWhoisServer(sServer, sDomain));\n\t\t\t}\n\t\t}\n\n\t\treturn aWhoisRecord;\n\t}",
"RecordResult retrieveRecord(String recordID) throws RepoxException;",
"public FSReturnVals ReadLastRecord(FileHandle ofh, byte[] payload, RID RecordID)\n {\n FSReturnVals outcome = FSReturnVals.Fail;\n // should set ip address, port number\n Vector<IP> servers = ofh.getServersForChunk(RecordID.getChunkHandle());\n int numServers = servers.size();\n if (ofh == null)\n {\n return FSReturnVals.BadHandle;\n }\n if (RecordID == null)\n {\n return FSReturnVals.BadRecID;\n }\n for(int i = 0; i < numServers; i++)\n {\n IP ip = new IP();\n ip.setPort(servers.elementAt(i).getPort());\n ip.setAddress(servers.elementAt(i).getAddress());\n try\n {\n Socket sock = new Socket(ip.getAddress(), ip.getPort());\n ObjectOutputStream serverOutput = new ObjectOutputStream(sock.getOutputStream());\n serverOutput.flush();\n ObjectInputStream serverInput = new ObjectInputStream(sock.getInputStream());\n serverOutput.writeInt(Constants.IsClient);\n \n serverOutput.writeInt(Constants.READ_LAST_RECORD);\n serverOutput.writeInt(RecordID.getChunkHandle().length());\n serverOutput.writeBytes(RecordID.getChunkHandle());\n serverOutput.flush();\n \n int response = serverInput.readInt();\n if (response == Constants.FALSE)\n {\n i--;\n continue;\n }\n \n //int type = serverOutput.readInt();\n //int command = serverOutput.readInt();\n //if(type == Constants.IsServer && command = Constants.READ_LAST_RECORD)\n //{\n int sz = serverInput.readInt();\n byte[] data = new byte[sz];\n serverInput.read(data, 0, sz);\n String datastr = new String(data, \"UTF-8\");\n if(data.length > 0)\n {\n int j = serverInput.readInt();\n outcome = intToFSReturnVal(j);\n for (int k = 0; k < data.length; k++)\n {\n payload[k] = data[k];\n }\n break;\n }\n else\n {\n i--;\n continue;\n }\n //}\n //else\n //{\n // int j = serverInput.readInt();\n // outcome = intToFSReturnVal(j)\n //}\n }\n catch (Exception e)\n {\n outcome = FSReturnVals.Fail;\n System.out.println(\"Unable to append records (ClientREC:65)\");\n }\n }\n \n return outcome;\n\t}",
"public ClientInfo getRpcClientInformation(Object sessKey, RpcPacket rpc);",
"public static List<String> getServerList() {\n List<String> serverList = null;\n byte[] response = null;\n\n final long queryStartTime = System.currentTimeMillis();\n int queryTries = 0;\n while ((response == null) && (queryTries < RETRIES)) {\n response = getInfo(getMasterAddress(), DPMASTER_PORT, REQUEST);\n queryTries++;\n }\n\n if (response == null) {\n // Notify the user since there may be a problem with their connection.\n if ((System.currentTimeMillis() - queryStartTime) < 2000) {\n JOptionPane.showMessageDialog(null, \"Could not reach master server\");\n } else {\n JOptionPane.showMessageDialog(null, \"No reply from master server\");\n }\n } else {\n serverList = new ArrayList<String>();\n int index = MESSAGE_START;\n int OFFSET = 7; // 1 delimiter + 6 bytes\n byte[] byteAddress = new byte[OFFSET];\n while (index + OFFSET < response.length) {\n System.arraycopy(response, index + 1, byteAddress, 0, OFFSET);\n serverList.add(getAddressFromBytes(byteAddress));\n index += OFFSET;\n }\n }\n return serverList;\n }",
"private void getValueFromDB(int key)\n {\n Socket s = null;\n try\n {\n // open a connection to the server\n s = new Socket(HOST, PORT);\n\n // for line-oriented output we use a PrintWriter\n PrintWriter pw = new PrintWriter(s.getOutputStream());\n pw.println(\"\" + key);\n pw.flush(); // don't forget to flush... \n \n // read response, which we expect to be line-oriented text\n Scanner scanner = new Scanner(s.getInputStream());\n String value = scanner.nextLine();\n display(key, value);\n\n // make sure it's in the local cache\n if (getLocalValue(key) == null)\n {\n cache.add(new Record(key, value));\n Collections.sort(cache);\n }\n }\n catch (IOException e)\n {\n System.out.println(e);\n }\n finally\n {\n // be sure streams are closed\n try\n {\n s.close();\n }\n catch (IOException ignore){}\n }\n\n }",
"void getFromServer();",
"public abstract ContactId getRemoteContact() throws RcsServiceException;",
"@SuppressWarnings({\"unchecked\",\"unchecked\", \"unchecked\"})\n public static void retrieveServerData ( AddEntry data_form ) throws ClassNotFoundException, SQLException, IOException \n {\n Vector data = null;\n ResultSet results = null;\n Statement stmt = null;\n String data_string = null;\n StringTokenizer t = null;\n checkProperties();\n \n stmt = getDataSourceDatabaseStatement();\n // Query to get all the nodes that the notification suppression website will be concerned with\n _log.info ( \"Obtaining list of nodes from VPO\" );\n //results = stmt.executeQuery ( \"select distinct lower(node_name) from opc_node_names\" );\n results = stmt.executeQuery ( \"select distinct lower(node_name) as nn from opc_op.opc_node_names order by nn\" );\n results = stmt.executeQuery ( \"select distinct lower(node_name) as nn from opc_op.opc_node_names order by nn\" );\n data = new Vector();\n while ( results.next() )\n {\n data_string = results.getString ( 1 );\n if ( null != data_string )\n {\n t = new StringTokenizer ( data_string, \".\" );\n if ( t.hasMoreTokens() )\n {\n data_string = t.nextToken();\n data.add ( data_string );\n \n }\n }\n }\n data_form.setNodeNames ( data );\n // unshift @groups, \"- select node here -\";\n\n // Message groups\n _log.info ( \"Obtaining message groups from VPO\");\n results = stmt.executeQuery ( \"select distinct lower(name) as n from opc_message_groups order by n\" );\n data = new Vector();\n while ( results.next() )\n {\n data_string = results.getString ( 1 );\n data_string = ( null != data_string )? data_string : \"\";\n if ( null != data_string )\n {\n data.add ( data_string );\n }\n }\n data_form.setMessageGroups ( data );\n\n stmt.close();\n\n stmt = getInstanceDatabaseConnection().createStatement();\n \n // Data servers\n //results = stmt.executeQuery ( \"select node_id, node_name FROM opc_node_names ORDER BY node_name \" );\n _log.info ( \"Obtaining data servers\" );\n results = stmt.executeQuery ( \"SELECT server_nm from t_data_servers ORDER BY server_nm\" );\n //results = stmt.executeQuery ( \"SELECT server_nm from .t_data_servers where server_type_cd in ('sql', 'mssql', 'rep', 'iq') and dba_support_grp_id != '' and dba_support_grp_id != 'XX' and dba_support_grp_id is not null\" );\n //results = stmt.executeQuery ( \"SELECT server_nm from .t_data_servers ORDER BY server_nm\" );\n // unshift @dbSrvrs, \"- select DB Server here -\";\n data = new Vector();\n while ( results.next() )\n {\n data_string = results.getString ( 1 );\n data_string = ( null != data_string )? data_string : \"\";\n data.add ( data_string );\n }\n data_form.setDataServers ( data );\n\n stmt.close();\n }",
"java.lang.String getRemoteIPAddress();",
"private void receiveAddress()\n { \n String name = (String) client_nu.read();\n Integer port = Integer.parseInt((String) client_nu.read());\n try \n {\n InetAddress address = InetAddress.getByName( (String) client_nu.read() );\n byte[] imgBytes = getProPic(name);\n server.clientsOnline.add( new onlineInfo( address, name, port, imgBytes) );\n } \n catch (UnknownHostException ex) \n {\n Logger.getLogger(centralServer.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"String getPacketServer();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Accessor for the propertyChange field. | protected java.beans.PropertyChangeSupport getPropertyChange() {
if (propertyChange == null) {
propertyChange = new java.beans.PropertyChangeSupport(this);
};
return propertyChange;
} | [
"protected java.beans.PropertyChangeSupport getPropertyChange() {\n\t\tif (propertyChange == null) {\n\t\t\tpropertyChange = new java.beans.PropertyChangeSupport(this);\n\t\t};\n\t\treturn propertyChange;\n\t}",
"protected PropertyChangeSupport getPropertyChange() {\r\n\t\tif (propertyChange == null) {\r\n\t\t\tpropertyChange = new PropertyChangeSupport(this);\r\n\t\t}\r\n\t\t;\r\n\t\treturn propertyChange;\r\n\t}",
"public PropertyChangeType propertyChangeType() {\n return this.propertyChangeType;\n }",
"public interface PropertyValueChange {\r\n\r\n /**\r\n * Returns the globally unique id of this property value change.\r\n * \r\n * Required.\r\n * \r\n * TODO: Document some strategies for GUID/Unique id generation. Should\r\n * include the max length and content of the id. Maybe UUID?\r\n * \r\n * @return a globally unique id for this property value change.\r\n */\r\n String getId();\r\n\r\n /**\r\n * The name of the property which should be unique within the scope of the\r\n * entity that declares the property.\r\n * \r\n * Required. Length less than or equal to 255;\r\n * \r\n * @return the property name.\r\n */\r\n String getPropertyName();\r\n\r\n /**\r\n * Returns the data type of the property. If not one of the reserved types,\r\n * this should return a class name like <tt>com.foobar.Foo</tt>. Reserved\r\n * types include:\r\n * \r\n * <ul>\r\n * <li>string</li>\r\n * <li>double</li>\r\n * <li>boolean</li>\r\n * <li>datetime</li>\r\n * <li>timezone</li>\r\n * <li>locale</li>\r\n * <li>reference</li>\r\n * </ul>\r\n * \r\n * Required. Length is no longer than 255 characters.\r\n * \r\n * TODO: We need to document the format of all of the above.\r\n * \r\n * @return the old type.\r\n */\r\n String getPropertyType();\r\n\r\n /**\r\n * This is the old value of the property.\r\n * \r\n * Optional. Null will mean two things based on the value returned by\r\n * {@link #isOldValueSpecified()}. Length is no longer than 1024\r\n * characters.\r\n * \r\n * \r\n * @return old value of the property.\r\n */\r\n String getOldValue();\r\n\r\n /**\r\n * Returns the new value of the property.\r\n * \r\n * Optional. Null will mean two things based on the value returned by\r\n * {@link #isOldValueSpecified()}. Length is no longer than 1024\r\n * characters.\r\n * \r\n * @return new value of the property.\r\n */\r\n String getNewValue();\r\n\r\n /**\r\n * Is there an old value actually specified or should the\r\n * {@link #getOldValue()} method be ignored?\r\n * \r\n * @return is the old value specified.\r\n */\r\n boolean isOldValueSpecified();\r\n\r\n /**\r\n * Is there an new value actually specified or should the\r\n * {@link #getNewValue()} method be ignored?\r\n * \r\n * @return is the new value specified.\r\n */\r\n boolean isNewValueSpecified();\r\n\r\n /**\r\n * Returns the required associated LifeCycleAuditEvent.\r\n * \r\n * Required.\r\n * \r\n * @return the associated life cycle audit event.\r\n */\r\n LifeCycleAuditEvent getLifeCycleAuditEvent();\r\n\r\n}",
"public PropertyChangeSupport getPropertyChangeSupport() {\n \treturn propertyChangeSupport;\n }",
"public void valueChange(Property.ValueChangeEvent event);",
"protected void PropertyChanged()\r\n { }",
"protected abstract PropertyChangeEvent computePropertyValue(T node) throws Exception;",
"public com.app.tvp.cas.cliente.PropertyChangedEventHandler getPropertyChanged() {\n return propertyChanged;\n }",
"public boolean isChanged(PropertySetting property){\r\n\t\treturn property.isChanged();\r\n\t}",
"public Object getChanged(){\n return changed;\n }",
"public void firePropertyChange(java.beans.PropertyChangeEvent evt) {\r\n\tgetPropertyChange().firePropertyChange(evt);\r\n}",
"com.google.ads.googleads.v6.resources.ChangeEvent getChangeEvent();",
"public abstract void modelPropertyChange(PropertyChangeEvent argEvent);",
"public void setPropertyChanged(com.app.tvp.cas.cliente.PropertyChangedEventHandler propertyChanged) {\n this.propertyChanged = propertyChanged;\n }",
"public Object getChangedAttribute()\r\n\t{\r\n\t\treturn changedAttribute;\r\n\t}",
"public java.lang.String getChangeOperation() {\r\n return changeOperation;\r\n }",
"public void addPropertyChangeListener(String property, PropertyChangeListener listener);",
"Property getProperty();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get pvalue for fuzzy enrichment for fuzzy input vs crisp gene set | public static double getPValue(Map<String, Double> fuzzyInput, Set<String> geneSet, Set<String> genePool) {
double actualScore = calculateOverlap(geneSet, normalizeFuzzySet(fuzzyInput));
int numOfTermGenes = geneSet.size();
int numOfBgGenes = genePool.size();
int numOfInputGenes = fuzzyInput.size();
int numOfOverlappingGenes = (int) Math.round(actualScore);
FisherExact fisherTest = new FisherExact(numOfInputGenes + numOfBgGenes);
double pValue = fisherTest.getRightTailedP(numOfOverlappingGenes, numOfInputGenes - numOfOverlappingGenes, numOfTermGenes, numOfBgGenes - numOfTermGenes);
return pValue;
} | [
"public static double getPValue(Map<String, Double> fuzzyInput, Map<String, Double> fuzzyGeneSet, Set<String> genePool) {\t\t\n\t\tdouble actualScore = calculateOverlap(normalizeFuzzySet(fuzzyInput), normalizeFuzzySet(fuzzyGeneSet));\n\t\t\n\t\tint numOfTermGenes = fuzzyGeneSet.size();\n\t\tint numOfBgGenes = genePool.size();\n\t\tint numOfInputGenes = fuzzyInput.size();\n\t\tint numOfOverlappingGenes = (int) Math.round(actualScore);\n\t\t\n\t\tFisherExact fisherTest = new FisherExact(numOfInputGenes + numOfBgGenes);\t\t\t\t\n\t\tdouble pValue = fisherTest.getRightTailedP(numOfOverlappingGenes, numOfInputGenes - numOfOverlappingGenes, numOfTermGenes, numOfBgGenes - numOfTermGenes);\n\t\t\n\t\treturn pValue;\n\t}",
"public static double getPValue(Set<String> input, Map<String, Double> fuzzyGeneSet, Set<String> genePool) {\n\t\tdouble actualScore = calculateOverlap(input, normalizeFuzzySet(fuzzyGeneSet));\n\t\t\n\t\tint numOfTermGenes = fuzzyGeneSet.size();\n\t\tint numOfBgGenes = genePool.size();\n\t\tint numOfInputGenes = input.size();\n\t\tint numOfOverlappingGenes = (int) Math.round(actualScore);\n\t\t\n\t\tFisherExact fisherTest = new FisherExact(numOfInputGenes + numOfBgGenes);\t\t\t\t\n\t\tdouble pValue = fisherTest.getRightTailedP(numOfOverlappingGenes, numOfInputGenes - numOfOverlappingGenes, numOfTermGenes, numOfBgGenes - numOfTermGenes);\n\t\t\n\t\treturn pValue;\n\t}",
"public void execFuzzySearchVariationFunc(){\n\n\n Map map = new HashMap();\n\n if(this.searchParam != null && this.searchParam.length()> 0 ){\n System.out.println(this.searchParam );\n if(this.searchParam.contains(\":\")==true || this.searchParam.startsWith(\"chr\") == true) {\n String chrom = \"\";\n int pstart = -1;\n int pend = -1;\n if (this.searchParam.indexOf(\":\") > -1) {\n int idex = this.searchParam.indexOf(\":\");\n chrom = this.searchParam.substring(0, idex );\n System.out.println(\"chrom=\" + chrom);\n map.put(\"chrom\", chrom);\n if (this.searchParam.indexOf(\"-\") > -1) {\n int idex1 = this.searchParam.indexOf(\"-\");\n pstart = Integer.parseInt(this.searchParam.substring(idex + 1, idex1 ));\n pend = Integer.parseInt(this.searchParam.substring(idex1 + 1, this.searchParam.length()));\n map.put(\"startpos\", pstart);\n map.put(\"endpos\", pend);\n } else {\n pstart = Integer.parseInt(this.searchParam.substring(idex + 1, this.searchParam.length()));\n map.put(\"startpos\", pstart);\n }\n\n } else if (this.searchParam.startsWith(\"chr\") == true) {\n map.put(\"chrom\", this.searchParam);\n }\n }\n\n map.put(\"searchParam\",this.searchParam);\n }\n\n if(this.searchSpecies!= null && this.searchSpecies.equals(\"null\") ==false && this.searchSpecies.equals(\"all\") == false){\n map.put(\"gwas\",\"gwas\") ;\n map.put(\"gwasend\",\"gwasend\") ;\n map.put(\"species\",this.searchSpecies);\n }\n\n if(this.searchTrait != null&& this.searchTrait.equals(\"null\") ==false && this.searchTrait.length()>0){\n\n map.put(\"gwas\",\"gwas\") ;\n map.put(\"gwasend\",\"gwasend\") ;\n map.put(\"searchTrait\", this.searchTrait) ;\n }\n\n if(this.pvalue != null&& this.pvalue.equals(\"null\") ==false && this.pvalue.length()>0){\n\n map.put(\"gwas\",\"gwas\") ;\n map.put(\"gwasend\",\"gwasend\") ;\n map.put(\"psitu\", this.psitu);\n map.put(\"pval\", this.pvalue) ;\n }\n\n\n //here, parse search param and get genotype information\n genotypeBeanList = (List<GenotypeBean>) baseService.findResultList(\"cn.big.gvk.dm.Genotype.selectGenotypeByPos\",map);\n if(genotypeBeanList != null && genotypeBeanList.size() > 0 ){\n for(GenotypeBean tbean :genotypeBeanList ){\n List genotypelist = new ArrayList();\n genotypelist.add(tbean.getGenotypeId()) ;\n\n Map t = new HashMap();\n t.put(\"genotypelist\",genotypelist);\n List<GenotypeAnnotateGeneView> annotateview = baseService.findResultList(\"cn.big.gvk.dm.Genotype.selectGenotypeByList\",t);\n if(annotateview != null && annotateview.size()>0 ){\n //here we need to filter the result\n Map filtermap = new HashMap();\n for(GenotypeAnnotateGeneView tview : annotateview){\n String fkey = tview.getMapGeneId()+\"_\"+tview.getConseqtype();\n if(filtermap.containsKey(fkey) == false){\n filtermap.put(fkey,tview);\n }\n }\n\n if(filtermap.size()>0){\n List<GenotypeAnnotateGeneView> alist = new ArrayList<GenotypeAnnotateGeneView>();\n Iterator it = filtermap.entrySet().iterator();\n while(it.hasNext()){\n Map.Entry entry = (Map.Entry) it.next();\n GenotypeAnnotateGeneView val = (GenotypeAnnotateGeneView) entry.getValue();\n alist.add(val);\n }\n\n tbean.setGenotypeAnnotateGeneView(alist);\n }\n\n\n }\n\n //find association count\n GwasAssociationBean gwas = (GwasAssociationBean) baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selectAssociationCountByGenotypeid\",tbean.getGenotypeId());\n if(gwas != null){\n tbean.setTraitCount(gwas.getGwasCount());\n }\n\n //find studycount\n Map cmap = new HashMap();\n cmap.put(\"genotypeId\",tbean.getGenotypeId());\n if(this.searchSpecies!= null && this.searchSpecies.equals(\"all\") == false){\n cmap.put(\"species\",this.searchSpecies);\n }\n\n\n GwasAssociationBean tg_bean1 = (GwasAssociationBean)baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selectStudyCountByGenotypeid\",cmap);\n if(tg_bean1 != null ){\n tbean.setStudyCount(tg_bean1.getGwasCount());\n }\n\n }\n\n\n\n }\n\n StringBuffer sb = new StringBuffer() ;\n\n if(genotypeBeanList != null && genotypeBeanList.size()>0){\n for(GenotypeBean genotype: genotypeBeanList){\n sb.append(genotype.getVarId()).append(\"\\t\").append(genotype.getChrom()).append(\":\")\n .append(genotype.getStartPos()).append(\"\\t\").append(genotype.getTraitCount())\n .append(\"\\t\").append(genotype.getStudyCount()).append(\"\\n\");\n }\n }\n\n if(format == 1 ){ //export txt\n this.response.reset();\n this.response.setHeader(\"Content-Disposition\",\n \"attachment;filename=export.txt\");\n this.response.setContentType(\"application/ms-txt\");\n try {\n PrintWriter pr = this.response.getWriter();\n pr.print(sb.toString());\n pr.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n }",
"@Test\n public void testPhenoMatchScore() throws IOException {\n \n System.out.println(\"phenoMatchScore\");\n HashSet<Term> terms = new HashSet<Term>();\n terms.add(phenotypeData.getTermIncludingAlternatives(\"EP:06\"));\n \n // build gene A of example data set\n ArrayList<String> genePhenotypes = new ArrayList<String>();\n genePhenotypes.add(\"EP:04\");\n genePhenotypes.add(\"EP:05\"); \n Gene geneA = new Gene(\"chr1\", 26, 32, \"geneA\", genePhenotypes);\n geneA.setPhenotypeTerms( new HashSet<Term>() );\n geneA.addPhenotypeTerm(phenotypeData.getTermIncludingAlternatives(\"EP:04\"));\n geneA.addPhenotypeTerm(phenotypeData.getTermIncludingAlternatives(\"EP:05\"));\n \n System.out.println(\"terms: \" + terms);\n System.out.println(\"gene A phenotypes: \" + geneA.getPhenotypeTerms());\n // DEBUG IC of terms in example data\n System.out.println(\"EP:00: \" + phenotypeData.getIC(phenotypeData.getTermIncludingAlternatives(\"EP:00\")));\n System.out.println(\"EP:01: \" + phenotypeData.getIC(phenotypeData.getTermIncludingAlternatives(\"EP:01\")));\n System.out.println(\"EP:02: \" + phenotypeData.getIC(phenotypeData.getTermIncludingAlternatives(\"EP:02\")));\n System.out.println(\"EP:03: \" + phenotypeData.getIC(phenotypeData.getTermIncludingAlternatives(\"EP:03\")));\n System.out.println(\"EP:04: \" + phenotypeData.getIC(phenotypeData.getTermIncludingAlternatives(\"EP:04\")));\n System.out.println(\"EP:05: \" + phenotypeData.getIC(phenotypeData.getTermIncludingAlternatives(\"EP:05\")));\n System.out.println(\"EP:06: \" + phenotypeData.getIC(phenotypeData.getTermIncludingAlternatives(\"EP:06\")));\n \n \n // expect sum IC of most specific common terms for each gene phenotype\n double expResult = phenotypeData.getIC(phenotypeData.getTermIncludingAlternatives(\"EP:04\"));\n expResult += phenotypeData.getIC(phenotypeData.getTermIncludingAlternatives(\"EP:05\"));\n double result = phenotypeData.phenoMatchScore(terms, geneA);\n \n assertEquals(expResult, result, 0.001);\n \n }",
"protected String determineNValue(Property p) {\r\n\t\tArrayList<ExecutionResult> results = MasterPlan.tree.getExecution().getResults();\r\n\t\tfor (ExecutionResult r : results) {\r\n\t\t\tPropertySummary ps = r.getProperties();\r\n\t\t\tfor (Property q : ps.getProperties()) {\r\n\t\t\t\tif (q.getName().endsWith(p.getName())) {\r\n\t\t\t\t\treturn q.getValues().get(0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn p.getValues().get(0);\r\n\t}",
"private void computePValues(){\r\n\t\t\r\n\t\tNormalDistribution normal=new NormalDistribution();\r\n\t\t\r\n\t\tasymptoticRightTail=1.0-normal.getTipifiedProbability(Zright, false);\r\n\t\tasymptoticLeftTail=normal.getTipifiedProbability(Zleft, false);\r\n\r\n\t\tasymptoticDoubleTail=Math.min(Math.min(asymptoticLeftTail,asymptoticRightTail)*2.0,1.0);\r\n\t\t\r\n\t}",
"@Override\n public double makePrediction(ParsedText text) {\n double pr = 0.0;\n\n /* FILL IN HERE */\n double productSpam = 0;\n double productNoSpam = 0;\n \n int i, tempSpam,tempNoSpam;\n int minSpam, minNoSpam ;\n \n \n for (String ng: text.ngrams) {\n \tminSpam = Integer.MAX_VALUE;\n \tminNoSpam = Integer.MAX_VALUE;\n \n\n \tfor (int h = 0;h < nbOfHashes; h++) {\n \t\ti = hash(ng,h);\n\n \t\ttempSpam = counts[1][h][i];\n \t\ttempNoSpam = counts[0][h][i];\n \t\t\n \t\t//System.out.print(tempSpam + \" \");\n\n \t\tminSpam = minSpam<tempSpam?minSpam:tempSpam; \n \t\tminNoSpam = minNoSpam<tempNoSpam?minNoSpam:tempNoSpam; \n \t\t\n \t}\n\n \t//System.out.println(minSpam + \"\\n\");\n \tproductSpam += Math.log(minSpam);\n \tproductNoSpam += Math.log(minNoSpam);\n }\n \n // size of set minus 1\n int lm1 = text.ngrams.size() - 1;\n \n //System.out.println((productNoSpam - productSpam ));\n //System.out.println((lm1*Math.log(this.classCounts[1]) - lm1*Math.log(this.classCounts[0])));\n\n //\n pr = 1 + Math.exp(productNoSpam - productSpam + lm1*(Math.log(classCounts[1]) - Math.log(classCounts[0])));\n // System.out.print(1.0/pr + \"\\n\");\n \n return 1.0 / pr;\n\n }",
"@Ignore\n// @Test\n public void testPhenoGramScore() throws IOException {\n System.out.println(\"phenoGramScore\");\n \n // build set of patient terms with only EP:06 from the example dataset\n HashSet<Term> patientTerms = new HashSet<Term>();\n patientTerms.add(phenotypeData.getTermIncludingAlternatives(\"EP:06\"));\n \n // build gene A of example data set\n ArrayList<String> genePhenotypes = new ArrayList<String>();\n genePhenotypes.add(\"EP:04\");\n genePhenotypes.add(\"EP:05\"); \n Gene geneA = new Gene(\"chr1\", 26, 32, \"geneA\", genePhenotypes);\n geneA.setPhenotypeTerms( new HashSet<Term>() );\n geneA.addPhenotypeTerm(phenotypeData.getTermIncludingAlternatives(\"EP:04\"));\n geneA.addPhenotypeTerm(phenotypeData.getTermIncludingAlternatives(\"EP:05\"));\n \n // build gene B of example data set\n ArrayList<String> geneBPhenotypes = new ArrayList<String>();\n geneBPhenotypes.add(\"EP:07\");\n Gene geneB = new Gene(\"chr1\", 26, 32, \"geneB\", geneBPhenotypes);\n geneB.setPhenotypeTerms( new HashSet<Term>() );\n geneB.addPhenotypeTerm(phenotypeData.getTermIncludingAlternatives(\"EP:07\"));\n\n // add geneA and geneB to a genomic set of genes\n GenomicSet<Gene> genes = new GenomicSet<Gene>();\n genes.put(\"geneA\", geneA);\n genes.put(\"geneB\", geneB);\n \n // since geneA have higher phenomatchScore than geneB, we expect the\n // phenomatch score of geneB here again.\n double expResult = phenotypeData.getIC(phenotypeData.getTermIncludingAlternatives(\"EP:04\"));\n expResult += phenotypeData.getIC(phenotypeData.getTermIncludingAlternatives(\"EP:05\"));\n\n // calculate phenoMatch score for the patient temrs (EP:06) and the gene phenotypes\n double result = phenotypeData.phenoGramScore(patientTerms, genes);\n\n // assert eauality with a tolerance of 0.001\n assertEquals(expResult, result, 0.001);\n \n }",
"double getPValue();",
"public double getBestFunctionValue() {\n\t\treturn bestChromosome.getFunction();\n\t}",
"public double smallesPval(){\n\n\t\t// init variable\n\t\tdouble smallestPval = 1;\n\n\t\t// for each gene; for each SNP save if pval < smallestPval\n\t\tfor (String gene : init.getReadGenes().getAllGeneNames()) {\n\t\t\t// for each SNP: if pval < threshold save data to hash\n\t\t\tif (!(gwasData.getGeneSNP().get(gene) == null)) {\n\n\n\t\t\t\tfor (SnpLine currentSNP : gwasData.getGeneSNP().get(gene)) {\n\t\t\t\t\tDouble pval = currentSNP.getpValue();\n\n\t\t\t\t\t// if pval smaller thresh mark as hit go to next gene\n\t\t\t\t\tif ( pval < smallestPval) {\n\t\t\t\t\t\tsmallestPval = pval;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn smallestPval;\n\t}",
"@Test\n public void calculatePValueScores() throws Exception {\n String fileName = BREAST_DIR + \"PloSCompBioRandomSet/CoxPHForSignatures.txt\";\n String outFileName = BREAST_DIR + \"PloSCompBioRandomSet/CoxPHForSignaturesWithScores.txt\";\n fu.setInput(fileName);\n fu.setOutput(outFileName);\n String line = fu.readLine();\n fu.printLine(line);\n line = fu.readLine();\n fu.printLine(line + \"\\tP_Value_Score\\tIs_Significant\");\n int[] indices = new int[]{2, 4, 6, 8, 10};\n // Flag to check if there is any p-value > 0.05. If p-value > 0.05,\n // the total score will be 0.\n boolean isSignficant = false;\n while ((line = fu.readLine()) != null) {\n String[] tokens = line.split(\"\\t\");\n isSignficant = true;\n double total = 0.0d;\n for (int index : indices) {\n Double pvalue = new Double(tokens[index]);\n if (pvalue > 0.05) {\n isSignficant = false;\n }\n total += -Math.log10(pvalue);\n }\n fu.printLine(line + \"\\t\" + total / indices.length + \"\\t\" + isSignficant);\n }\n fu.close();\n }",
"int getLikelihoodValue();",
"@Override\n // public double makePrediction(ParsedText text) {\n // double pr;\n // // stores the count of each ngram\n // HashMap<String, Integer> ngramCountHam = new HashMap<String, Integer>();\n // HashMap<String, Integer> ngramCountSpam = new HashMap<String, Integer>();\n // double[] labelFeatJoint = new double[2];\n // // computes the joint probability of each class and all feature\n // for (int c = 0; c < 2; c++) {\n // // class probability\n // labelFeatJoint[c] = Math.log((double) this.classCounts[c]/ this.nbExamplesProcessed);\n // for (String ngram : text.ngrams) {\n // int minCount = this.counts[c][0][this.hashFunctions[0].apply(ngram)];\n // // finds minimum count of an ngram out of all hashing functions\n // for (int d = 1; d < this.nbOfHashes; d++) {\n // int hashedNgram = this.hashFunctions[d].apply(ngram);\n // // int hashedNgram = this.hashFunctions[d](ngram);\n // int hashCount = this.counts[c][d][hashedNgram];\n // minCount = hashCount < minCount ? hashCount : minCount;\n // }\n // // add log(conditional probability) of each feature by class,\n // // using the minCount and laplace smoothing\n // labelFeatJoint[c] += Math.log((1.0 + minCount) /\n // (this.classCounts[0] + this.hashSize));\n // }\n // }\n // //log-sum trick. Log(a) = spamSum, Log(b) = hamSum\n // // pr = spamSum - (spamSum + Log(1 + e^(hamSum-spamSum))\n // pr = -Math.log(1 + Math.exp(labelFeatJoint[0] - labelFeatJoint[1]));\n // return Math.exp(pr);\n // }\n public double makePrediction(ParsedText text) {\n double pr;\n // stores the count of each ngram\n // HashMap<String, Integer> ngramCountHam = new HashMap<String, Integer>();\n // HashMap<String, Integer> ngramCountSpam = new HashMap<String, Integer>();\n double[] labelFeatJoint = new double[2];\n // computes the joint probability of each class and all feature\n // for (int c = 0; c < 2; c++) {\n // // class probability\n // labelFeatJoint[c] = Math.log((double) this.classCounts[c]/ this.nbExamplesProcessed);\n // for (String ngram : text.ngrams) {\n // int minCount = Integer.MAX_VALUE;\n // // this.counts[c][0][this.hashFunctions[0].apply(ngram)];\n // // finds minimum count of an ngram out of all hashing functions\n // for (int d = 0; d < this.nbOfHashes; d++) {\n // int hashedNgram = this.hashFunctions[d].apply(ngram);\n // // int hashedNgram = this.hashFunctions[d](ngram);\n // int hashCount = this.counts[c][d][hashedNgram];\n // minCount = hashCount < minCount ? hashCount : minCount;\n // }\n // // add log(conditional probability) of each feature by class,\n // // using the minCount and laplace smoothing\n // labelFeatJoint[c] += Math.log((1.0 + minCount) /\n // (this.classCounts[c] + this.hashSize));\n // }\n // }\n // //log-sum trick. Log(a) = spamSum, Log(b) = hamSum\n // // pr = spamSum - (spamSum + Log(1 + e^(hamSum-spamSum))\n // pr = -Math.log(1 + Math.exp(labelFeatJoint[0] - labelFeatJoint[1]));\n\n\n double prHam = (double) classCounts[0]/this.nbExamplesProcessed;\n double prSpam = 1 - prHam;\n // double prWordGivenSpam=0;\n // double prWordGivenHam=0; \n double prWordGivenSpam=Math.log(prSpam);\n double prWordGivenHam=Math.log(prHam);\n\n // for spam\n int minCount = Integer.MAX_VALUE;\n\n int [] minCountWord0 = new int [text.ngrams.size()];\n int [] minCountWord = new int [text.ngrams.size()];\n for (int i =0; i< text.ngrams.size(); i++){\n minCountWord[i]= minCount;\n minCountWord0[i]= minCount;\n }\n // System.out.println(text.ngrams.size());\n for (int d = 0; d < this.nbOfHashes; d++) {\n int i=0;\n for (String ngram: text.ngrams){\n // if (i==1){ System.out.println(ngram);}\n int hashedNgram = this.hashFunctions[d].apply(ngram);\n int hashCount = this.counts[1][d][hashedNgram];\n minCountWord[i] = hashCount < minCountWord[i] ? hashCount : minCountWord[i];\n // if (i==1){ System.out.println(minCountWord[i]);}\n i++;\n }\n // System.out.println(i);\n }\n for (int d = 0; d < this.nbOfHashes; d++) {\n int i=0;\n for (String ngram: text.ngrams){\n int hashedNgram = this.hashFunctions[d].apply(ngram);\n int hashCount = this.counts[0][d][hashedNgram];\n minCountWord0[i] = hashCount < minCountWord0[i] ? hashCount : minCountWord0[i];\n i++;\n }\n // System.out.println(i);\n }\n for (int i =0; i< text.ngrams.size(); i++){\n prWordGivenSpam += Math.log((1.0 + minCountWord[i]) / (this.classCounts[1] + this.hashSize));\n prWordGivenHam += Math.log((1.0 + minCountWord0[i]) / (this.classCounts[0] + this.hashSize));\n }\n pr = -Math.log(1 + Math.exp(prWordGivenHam - prWordGivenSpam));\n return Math.exp(pr);\n\n }",
"private FuzzyNumber getFuzzyNumber(String[] rep, int i) {\n\t\tif(i > rep.length - 1 || i < 0) return null;\n\t\treturn this.x = rep[i].equals(\"\") ? null : new FuzzyNumber(Double.parseDouble(rep[i]), Double.parseDouble(rep[i + 1]));\n\t}",
"@Override\n\tpublic double fitness() {\n\t\tdouble sum;\n\t\tdouble prod;\n\t\tdouble sumError;\n\t\tdouble prodError;\n\t\t\n\t\tsum = 0;\n\t\tprod = 1;\n\t\t\n\t\tfor (int i = 0; i < numCards; i++) {\n\t\t\tif (((representation >> i) & 1) == 0) {\n\t\t\t\tsum += (1 + i);\n\t\t\t} else {\n\t\t\t\tprod *= (1 + i);\n\t\t\t}\n\t\t}\n\t\t\n\t\tsumError = Math.abs((sum - sumTarget) / sumTarget);\n\t\tprodError = Math.abs((prod - prodTarget) / prodTarget);\n\t\t\n\t\treturn sumError + prodError;\n\t}",
"float getSpecialProb();",
"public double value() {\n\t\treturn sum + correction;\n\t}",
"@Override\n\tpublic double valuta_figli() {\n\t\treturn simple_fitness();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Send synchronous data via USB with specified timeout | public int send(byte[] buffer, int timeout) throws IllegalAccessException {
if (!mUsbConnection.claimInterface(mUsbInterface, forceClaim))
throw new IllegalAccessException("USB interface cannot be claimed");
return mUsbConnection.bulkTransfer(mUsbEndpointOut, buffer, buffer.length, timeout);
} | [
"@Override\r\n\tpublic void sendApduToSE(byte[] dataBT, int timeout) {\n writeBluetooth(dataBT, timeout);\r\n\t}",
"public void send0(){\n digitalWrite(data0, LOW);\n delayMicroseconds(34);\n digitalWrite(data0, HIGH);\n}",
"public void send1(){\n digitalWrite(data1, LOW);\n delayMicroseconds(34);\n digitalWrite(data1, HIGH);\n}",
"int libusb_control_transfer(DeviceHandle dev_handle, short bmRequestType, short bRequest, int wValue, int wIndex,\r\n String data, int wLength, int timeout);",
"public native long sendTimedPacket(byte[] packet , long sendTime) throws MeasurementException ;",
"void SendTelegram(char[] tosend, int len) throws InterruptedException, IOException\r\n \t{\r\n\t\tmyPort.setRTS(true);\r\n\t\r\n\t\tThread.sleep(20);\r\n\t\t\r\n\t for (int i=0; i<len; i++) \t\r\n\t \tout.write((int)tosend[i]);\r\n\t \t\r\n\t\tThread.sleep(20);\r\n\t \r\n\t myPort.setRTS(false);\t \r\n \t}",
"public void send(SimHost host, SimMessage message, double timeout);",
"public void sendIgnore(int bytes, int timeout_ms) throws IOException;",
"Object writeOnTimeout();",
"int serial_read(urg_serial_t serial, ByteBuffer data, int max_size, int timeout);",
"public void setReadTimeout(int time) throws DeviceException;",
"public void setSendTimeout(int sendTimeout){\n return; //TODO codavaj!!\n }",
"public void sendByteCommand(int address, byte command, boolean waitForCompletion)\n {\n final String funcName = \"sendByteCommand\";\n byte[] data = new byte[1];\n\n if (debugEnabled)\n {\n dbgTrace.traceEnter(funcName, TrcDbgTrace.TraceLevel.API, \"addr=%d,cmd=0x%x,sync=%s\",\n address, command, Boolean.toString(waitForCompletion));\n }\n\n data[0] = command;\n if (waitForCompletion)\n {\n syncWrite(address, data, data.length);\n }\n else\n {\n //\n // Fire and forget.\n //\n asyncWrite(null, address, data, data.length, null, null);\n }\n\n if (debugEnabled)\n {\n dbgTrace.traceExit(funcName, TrcDbgTrace.TraceLevel.API);\n }\n }",
"private void sendCommand(CommandItem command) {\n sendCommand(command.data, command.advTimeout);\n }",
"public void send(String data){\n //convert lines into byte array, send to transoport layer and wait for response\n byte[] byteArray = data.getBytes();\n\n // send the data\n double delay = transportLayer.send( byteArray );\n\n if(experiment){\n System.out.println(\"delay is: \" + delay + \" seconds\");\n }\n }",
"public void waitUntilCommunicatable(long timeout, TimeUnit unit) throws InterruptedException, TimeoutException;",
"public void sendAsyncStreamPacket(Packet packet) throws MicrocontrollerException {\n isStreamMode();\n if (packet == null) {\n this.usbGate.sendAsync(testStreamOutBuffer);\n } else {\n this.usbGate.sendAsync(packet.toByteArray());\n }\n }",
"public void waitForData(long timeout) {\n \t\t\n \t\tif (available())\n \t\t\treturn;\n \t\tsynchronized (this) {\n \t\t\ttry {\n \t\t\t\twait(timeout);\n \t\t\t} catch (InterruptedException e) {\n \t\t\t}\n \t\t}\n \t}",
"private void driveSimulation() {\n\n //process all data packets currently in the socket from the host\n //set timeout to 0 -- no need to wait on packets\n processDataPackets(0);\n \n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Verify Report Columns in Report | private void verifyIndividualBatchColumns() {
for (final String element : BATCH_COLUMNS) {
Log.altVerify(true, lblBatchColumnName(element).exists(),
"Check that column '" + element + "' is exist");
}
} | [
"private void verifyReportColumns() {\n for (final String element : REPORT_COLUMNS) {\n Log.altVerify(true, lblReportColumnName(element).exists(),\n \"Check that column '\" + element + \"' is exist\");\n }\n }",
"public void verifyDisbursementReportColumns() {\n Log.logBanner(\"Verifying Disbursement Report columns...\");\n Tools.waitForTableLoad(Log.giAutomationMedTO);\n verifyReportColumns();\n }",
"public boolean colDataCheck() {\r\n\t\t\r\n\t\tList<WebElement> list = driver.findElements(By.tagName(\"th\"));\r\n\t\t// String[] expected= {\"Doctor\",\"Date\",\"Appointment\",\"Time\"};\r\n\t\t\r\n\t\tString expected = \"Time\";\r\n\t\tboolean result = false;\r\n\r\n\t\tfor (WebElement webElement : list) {\r\n\t\t\tString actual = webElement.getText();\r\n\t\t\tif (actual.contains(expected)) {\r\n\t\t\t\tresult = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}",
"public void searchAndVerifyColumnHeader()\r\n\t{\r\n\t\tselectCriteriaAndSearchValue();\r\n\t\tsearchColumnHeaderValidation();\r\n\t}",
"public boolean validateColumns()\n {\n return this.validateColumns(DBAdmin.VALIDATE_DISPLAY_ERRORS | DBAdmin.VALIDATE_DISPLAY_WARNINGS);\n }",
"public boolean checkColumns(){ \n for(int i = 0; i < 9; i++){ //iterates through 9 columns\n if(!checkColumn(i)){ //checks if method returns false(contains duplicates or empty spaces)\n return false;\n }\n }\n return true;\n }",
"private void checkColumns(String[] projection) {\n\t\tString[] available = { MedTable.MED_NAME,\n\t\t\t\tMedTable.MED_DOSAGE, MedTable.MED_ID,\n\t\t\t\tMedTable.MED_DATE_FILLED, MedTable.MED_DURATION,\n\t\t\t\tMedTable.MED_WARNING, MedTable.MED_REMINDER_ON };\n\t\tif(projection != null) {\n\t\t\tHashSet<String> requestedColumns = new HashSet<String>(Arrays.asList(projection));\n\t\t\tHashSet<String> availableColumns = new HashSet<String>(Arrays.asList(available));\n\t\t\t// Check if all columns which are requested are available\n\t\t\tif(!availableColumns.containsAll(requestedColumns)) {\n\t\t\t\tthrow new IllegalArgumentException(\"Unknown columns in projection\");\n\t\t\t}\n\t\t}\n\t}",
"@Test\n public void verifyMortgageTablePreApprovalColumns(){\n\n\n List<String> expectedColumns = Arrays.asList(\"id\", \"realtor_status\", \"realtor_info\", \"loan_officer_status\", \"purpose_loan\", \"est_purchase_price\",\n \"down_payment\", \"down_payment_percent\", \"total_loan_amount\", \"src_down_payment\", \"add_fund_available\");\n\n List<String> actualColumns = DataBaseUtility.getColumnNames(\"select id, realtor_status, realtor_info, loan_officer_status, purpose_loan, est_purchase_price, down_payment, down_payment_percent, total_loan_amount, \\n\" +\n \"src_down_payment, add_fund_available from tbl_mortagage limit 1\");\n\n Assert.assertEquals(actualColumns, expectedColumns);\n }",
"public boolean verifyAccountAgingColums(){\n\t\tboolean isAgingColums=false;\n\t\tDynamicFramePage.dynamicFrameForPanchart();\n\t\tDynamicFramePage.switchtoFraFrame();\n\t\tdriver.switchTo().frame(\"panProfile_Frame\");\n\t\tString col2 =SeleniumUtil.getElementWithFluentWait(accountAgingColum2).getText();\n\t\tString col3 =SeleniumUtil.getElementWithFluentWait(accountAgingColum3).getText();\n\t\tString col4 =SeleniumUtil.getElementWithFluentWait(accountAgingColum4).getText();\n\t\tif(col2.equalsIgnoreCase(\"31-60\") && col3.equalsIgnoreCase(\"61-90\") && col4.equalsIgnoreCase(\"Over 90\")){\n\t\t\tSystem.out.println(\"All the aging colums are present\");\n\t\t\tisAgingColums=true;\n\t\t}\n\t\treturn isAgingColums;\n\t}",
"private void checkColumnsAllInChart(ColumnValuePair[] cvp)\n\t{\t\t\n\t\tfor(ColumnValuePair c: cvp)\n\t\t{\n\t\t\tboolean found = false;\n\t\t\tint i;\n\t\t\tfor(i = 0; i<firstRow.length(); i++)\n\t\t\t{\n\t\t\t\tif(c.getColumnID().getColumnName().equals(firstRow.getElementAtIndex(i).getVal().toString()))\n\t\t\t\t{\n\t\t\t\t\tfound = true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tif(!found)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"You asked to enter information into a column that doesnt Exist\");\n\t\t\t\tthrow new IllegalArgumentException();\n\t\t\t}\n\t\t}\n\t}",
"public boolean hasColumnReport(org.semanticwb.process.resources.reports.ColumnReport value)\r\n {\r\n boolean ret=false;\r\n if(value!=null)\r\n {\r\n ret=getSemanticObject().hasObjectProperty(rep_hasColumnReport,value.getSemanticObject());\r\n }\r\n return ret;\r\n }",
"@Test\n void getColumnCount() {\n int columns = bookTest.getColumnCount();\n assertEquals(columns, bookTest.getColumnCount());\n }",
"boolean isNeedColumnInfo();",
"private void checkColumns(String[] projection) {\n\t\tLog.d(\"DEB\", \"MyContentProvider - checkColumns is called\");\n\t String[] available = {MyDatabase.COLUMN_ID,MyDatabase.COLUMN_NAME,\n\t MyDatabase.COLUMN_CLASS };\n\t if (projection != null) {\n\t HashSet<String> requestedColumns = new HashSet<String>(Arrays.asList(projection));\n\t HashSet<String> availableColumns = new HashSet<String>(Arrays.asList(available));\n\t // check if all columns which are requested are available\n\t if (!availableColumns.containsAll(requestedColumns)) {\n\t throw new IllegalArgumentException(\"Unknown columns in projection\");\n\t }\n\t else {\n\t \t Log.d(\"DEB\", \"MyContentProvider->checkColumn-> all columns are valid\");\n\t }\n\t }\n\t }",
"public boolean supportsColumnCheck();",
"@Test\n public void columnsTest() {\n // TODO: test columns\n }",
"@Test\n\tpublic void assertColumnCount()\n\t{\n\t\tint expectedColumnCount = 2;\n\t\tint actualColumnCount = dashboardPage.getHeaderColumns().size();\n\t\terrorMessage = \"The table column count is incorrect\";\n\t\tAssert.assertEquals(actualColumnCount, expectedColumnCount, errorMessage);\n\t}",
"public boolean supportsColumnCheck() {\n \t\treturn true;\n \t}",
"private boolean checkHasColumns( TableMeta tmeta ) {\n boolean hasColumns = tmeta.getColumns().length > 0;\n if ( ! hasColumns ) {\n reporter_.report( ReportType.FAILURE, \"ZCOL\",\n \"No columns known for table \"\n + tmeta.getName() );\n \n }\n return hasColumns;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Methodos gia thn anazhthsh syntaghs vasei tou epwnymou tou iatrou pou thn egrapse | public void anazitisiSintagisVaseiGiatrou() {
String doctorName = null;
tmp_2 = 0;
if(numOfPrescription != 0)
{
System.out.println();
System.out.println(" STOIXEIA SYNTAGWN");
// Emfanizw oles tis syntages
for(int j = 0; j < numOfPrescription; j++)
{
System.out.print("\n " + j + ". STOIXEIA SYNTAGHS: ");
prescription[j].print();
}
doctorName = sir.readString("DWSTE TO EPWNYMO TOU GIATROU: "); // Zitaw apo ton xrhsth na mou dwsei to onoma tou giatrou pou exei grapsei thn sintagh pou epithumei
for(int i = 0; i < numOfPrescription; i++)
{
if(doctorName.equals(prescription[i].getDoctorLname())) // An vre8ei kapoia antistoixeia emfanizw thn syntagh pou exei grapsei o giatros
{
System.out.println();
System.out.println("VRETHIKE SYNTAGH!");
// Emfanizw thn/tis sintagh/sintages pou exoun graftei apo ton sygkekrimeno giatro
prescription[i].print();
System.out.println();
tmp_2++;
}
}
if(tmp_2 == 0)
{
System.out.println();
System.out.println("DEN YPARXEI SYNTAGH POU NA PERILAMVANEI TON IATRO ME EPWNYMO: " + doctorName);
System.out.println();
}
}
else
{
System.out.println();
System.out.println("DEN YPARXOUN DIATHESIMES SYNTAGES!");
System.out.println();
}
} | [
"public void anazitisiSintagisVaseiAstheni() {\n\t\tint amkaCode = 0;\n\t\ttmp_2 = 0;\n\t\tif(numOfPrescription != 0)\n\t\t{\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\" STOIXEIA SYNTAGWN\");\n\t\t\t// Emfanizw oles tis syntages\n\t\t\tfor(int j = 0; j < numOfPrescription; j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(\"\\n \" + j + \". STOIXEIA SYNTAGHS: \");\n\t \t \tprescription[j].print();\n\t\t\t}\n\t\t\tamkaCode = sir.readPositiveInt(\"EISAGETAI TO AMKA TOU ASTHENH: \"); // Zitaw apo ton xrhsth na mou dwsei ton amka tou asthenh pou thelei\n\t\t\tfor(i = 0; i < numOfPrescription; i++)\n\t\t\t{\n\t\t\t\t\tif(amkaCode == prescription[i].getPatientAmka()) // An vre8ei kapoia antistoixeia emfanizw thn syntagh pou proorizetai gia ton sygkekrimeno asthenh\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\tSystem.out.println(\"VRETHIKE SYNTAGH!\");\n\t\t\t\t\t\tprescription[i].print(); // Emfanizw thn/tis sintagh/sintages oi opoies proorizontai gia ton sigkekrimeno asthenh\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\ttmp_2++;\n\t\t\t\t\t}\n\t\t\t}\n\t\t\tif(tmp_2 == 0)\n\t\t\t{\n\t\t\t\tSystem.out.println();\n\t\t\t\tSystem.out.println(\"DEN YPARXEI SYNTAGH POU NA PERILAMVANEI TON ASTHENH ME AMKA: \" + amkaCode);\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\"DEN YPARXOUN DIATHESIMES SYNTAGES!\");\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"public void anTruongsinhtinhhe() {\n if (cuc.equalsIgnoreCase(\"Kim tu cuc\"))\n saoTruongSinh = cung[5];\n else if (cuc.equalsIgnoreCase(\"Moc tam cuc\"))\n saoTruongSinh = cung[11];\n else if (cuc.equalsIgnoreCase(\"Hoa luc cuc\"))\n saoTruongSinh = cung[2];\n else if (cuc.equalsIgnoreCase(\"Thuy nhi cuc\"))\n saoTruongSinh = cung[8];\n else\n saoTruongSinh = cung[8];\n int amhayduong = amduong(yearOfAnimal(year, month, day));\n if ((gender.equalsIgnoreCase(\"Male\") && amhayduong == R.string.duong) || (gender.equalsIgnoreCase(\"Female\") && amhayduong == R.string.am)) {\n //duong nam am nu theo chieu thuan\n int index = convertCungToNumber(saoTruongSinh);\n index = counterClockwise(index, 2);\n saoMocDuc = cung[index];\n index = convertCungToNumber(saoMocDuc);\n index = counterClockwise(index, 2);\n saoQuanDoi = cung[index];\n index = convertCungToNumber(saoQuanDoi);\n index = counterClockwise(index, 2);\n saoLamQuan = cung[index];\n index = convertCungToNumber(saoLamQuan);\n index = counterClockwise(index, 2);\n saoDeVuong = cung[index];\n index = convertCungToNumber(saoDeVuong);\n index = counterClockwise(index, 2);\n saoSuy = cung[index];\n index = convertCungToNumber(saoSuy);\n index = counterClockwise(index, 2);\n saoBenh = cung[index];\n index = convertCungToNumber(saoBenh);\n index = counterClockwise(index, 2);\n saoTu = cung[index];\n index = convertCungToNumber(saoTu);\n index = counterClockwise(index, 2);\n saoMo = cung[index];\n index = convertCungToNumber(saoMo);\n index = counterClockwise(index, 2);\n saoTuyet = cung[index];\n index = convertCungToNumber(saoTuyet);\n index = counterClockwise(index, 2);\n saoThai = cung[index];\n index = convertCungToNumber(saoThai);\n index = counterClockwise(index, 2);\n saoDuong = cung[index];\n\n } else {\n //duong nu, am nam\n int index = convertCungToNumber(saoTruongSinh);\n index = antiClockwise(index, 2);\n saoMocDuc = cung[index];\n index = convertCungToNumber(saoMocDuc);\n index = antiClockwise(index, 2);\n saoQuanDoi = cung[index];\n index = convertCungToNumber(saoQuanDoi);\n index = antiClockwise(index, 2);\n saoLamQuan = cung[index];\n index = convertCungToNumber(saoLamQuan);\n index = antiClockwise(index, 2);\n saoDeVuong = cung[index];\n index = convertCungToNumber(saoDeVuong);\n index = antiClockwise(index, 2);\n saoSuy = cung[index];\n index = convertCungToNumber(saoSuy);\n index = antiClockwise(index, 2);\n saoBenh = cung[index];\n index = convertCungToNumber(saoBenh);\n index = antiClockwise(index, 2);\n saoTu = cung[index];\n index = convertCungToNumber(saoTu);\n index = antiClockwise(index, 2);\n saoMo = cung[index];\n index = convertCungToNumber(saoMo);\n index = antiClockwise(index, 2);\n saoTuyet = cung[index];\n index = convertCungToNumber(saoTuyet);\n index = antiClockwise(index, 2);\n saoThai = cung[index];\n index = convertCungToNumber(saoThai);\n index = antiClockwise(index, 2);\n saoDuong = cung[index];\n }\n }",
"private void vypisTahy() {\n\t\tSystem.out.println(\"Vyzrebovane cisla:\");\n\t\tfor (int i = 0; i < this.velkost; i++) {\n\t\t\tSystem.out.print(this.tahy[i] + \" \");\n\t\t}\n\t\tSystem.out.println();\n\t}",
"public void xuatGVThinhGiang() {\n\t\tString output= super.xuatGiangVien();\n\t\toutput += \" - Noi cong tac: \"+ noiCT;\n\t\tSystem.out.println(output);\n\t\tsuper.xemMonHoc(); // hien thi cac mon hoc cua giang vien\n\t}",
"public void hienThi(){\r\n System.out.println(\"Dia chi nha: \"+diachi);\r\n System.out.println(\"Chu nha : \"+chunha);\r\n System.out.println(\"CMND : \"+cmnd);\r\n System.out.println(\"Dien tich dat: \"+dtdat);\r\n System.out.println(\"Dien tich su dung: \"+dtsd);\r\n System.out.println(\"Gia: \"+gia);\r\n \r\n }",
"public void kast() {\n\t\t// vaelg en tilfaeldig side\n\t\tdouble tilfaeldigtTal = Math.random();\n\t\tvaerdi = (int) (tilfaeldigtTal * 6 + 1);\n\t}",
"public void vastaaTapahtuma() {\n aseta(2, \"Peli-ilta versio:\" + rand(100, 500));\n aseta(3, \"13.05.2012\");\n aseta(4, \"17.00\");\n aseta(5, \"Pelaajankatu 26\");\n }",
"private void alustaTetriminonSijainti()\n {\n while(asettelija().kokeileSiirtaa(Suunta.YLOS));\n \n if(!asettelija().yritaPoistuaTormaamasta(Suunta.ALAS))\n paataPeli();\n }",
"public String classifyAllPOSY() {\r\n\t\r\n\t\tint count = 0;\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tString delimiters = \"\\\\W\";\r\n\t\t\tString[] tokens = text.split(delimiters);\r\n\t\t\t\r\n\t\t\tString feeling = \"\";\r\n\t\t\t\r\n\t\t\tfor (int i = 1; i < tokens.length; ++i) {\r\n\t\t\t\t\r\n\t\t\t\t// Add weights -- positive => +1, strong_positive => +2, negative => -1, strong_negative => -2\r\n\t\t\t\tif (!tokens[i].equals(\"\"))\r\n\t\t\t\t{\r\n\t\t\t\t\t// Search as adjetive\r\n\t\t\t\t\r\n\t\t\t\t\tfeeling = sentiwordnet.extract(tokens[i],\"a\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ((feeling != null) && (!feeling.equals(\"\"))) {\r\n\t\t\t\t\t\tswitch (feeling) {\r\n\t\t\t\t\t\t\tcase \"strong_positive\"\t: count += 2;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t break;\r\n\t\t\t\t\t\t\tcase \"positive\"\t\t\t: count += 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t break;\r\n\t\t\t\t\t\t\tcase \"negative\"\t\t\t: count -= 1;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t break;\r\n\t\t\t\t\t\t\tcase \"strong_negative\"\t: count -= 2;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t break;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tSystem.out.println(tokens[i]+\"#\"+feeling+\"#\"+count);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Search as noun\r\n\t\t\t\t\tfeeling = sentiwordnet.extract(tokens[i],\"n\");\r\n\t\t\t\t\tif ((feeling != null) && (!feeling.equals(\"\"))) {\r\n\t\t\t\t\t\tswitch (feeling) {\r\n\t\t\t\t\t\t\tcase \"strong_positive\"\t: count += 2;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t break;\r\n\t\t\t\t\t\t\tcase \"positive\"\t\t\t: count += 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t break;\r\n\t\t\t\t\t\t\tcase \"negative\"\t\t\t: count -= 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t break;\r\n\t\t\t\t\t\t\tcase \"strong_negative\"\t: count -= 2;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t break;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t System.out.println(tokens[i]+\"#\"+feeling+\"#\"+count);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Search as adverb\r\n\t\t\t\t\tfeeling = sentiwordnet.extract(tokens[i],\"r\");\r\n\t\t\t\t\tif ((feeling != null) && (!feeling.equals(\"\"))) {\r\n\t\t\t\t\t\tswitch (feeling) {\r\n\t\t\t\t\t\t\tcase \"strong_positive\"\t: count += 2;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t break;\r\n\t\t\t\t\t\t\tcase \"positive\"\t\t\t: count += 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t break;\r\n\t\t\t\t\t\t\tcase \"negative\"\t\t\t: count -= 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t break;\r\n\t\t\t\t\t\t\tcase \"strong_negative\"\t: count -= 2;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t break;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t System.out.println(tokens[i]+\"#\"+feeling+\"#\"+count);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Search as verb\r\n\t\t\t\t\tfeeling = sentiwordnet.extract(tokens[i],\"v\");\r\n\t\t\t\t\tif ((feeling != null) && (!feeling.equals(\"\"))) {\r\n\t\t\t\t\t\tswitch (feeling) {\r\n\t\t\t\t\t\t\tcase \"strong_positive\"\t: count += 2;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t break;\r\n\t\t\t\t\t\t\tcase \"positive\"\t\t\t: count += 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t break;\r\n\t\t\t\t\t\t\tcase \"negative\"\t\t\t: count -= 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t break;\r\n\t\t\t\t\t\t\tcase \"strong_negative\"\t: count -= 2;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t break;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t System.out.println(tokens[i]+\"#\"+feeling+\"#\"+count);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t System.out.println(count);\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\tSystem.out.println(\"Problem found when classifying the text\");\r\n\t\t}\r\n\t\t// Returns \"yes\" in case of 0\r\n\t\tif (count >= 0) \r\n\t\t\treturn \"yes\";\r\n\t\telse return \"no\";\r\n\t}",
"void testCountGenes(){\n String dna1 = \"AACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAACCCTCACCCTTCTAACTGGACTCTGACCCTGATTGTTGAGGGCTGCAAAGAGGAAGAATTTTATTTACCGTCGCTGTGGCCCCGAGTTGTCCCAAAGCGAGGTAATGCCCGCAAGGTCTGTGCTGATCAGGACGCAGCTCTGCCTTCGGGGTGCCCCTGGACTGCCCGCCCGCCCGGGTCTGTGCTGAGGAGAACGCTGCTCCGCCTCCGCGGTACTCCGGACATATGTGCAGAGAAGAACGCAGCTGCGCCCTCGCCATGCTCTGCGAGTCTCTGCTGATGAGAACACAGCTTCACTTTCGCAAAGGCGCAGCGCCGGCGCAGGCGCGGAGGGGCGCGCAGCGCCGGCGCAGGCGCGGAGGGGCGCGCCCGAACCCGAACCCTAATGCCGTCATAAGAGCCCTAGGGAGACCTTAGGGAACAAGCATTAAACTGACACTCGATTCTGTAGCCGGCTCTGCCAAGAGACATGGCGTTGCGGTGATATGAGGGCAGGGGTCATGGAAGAAAGCCTTCTGGTTTTAGACCCACAGGAAGATCTGTGACGCGCTCTTGGGTAGAGCACACGTTGCTGGGCGTGCGCTTGAAAAGAGCCTAAGAAGAGGGGGCGTCTGGAAGGAACCGCAACGCCAAGGGAGGGTGTCCAGCCTTCCCGCTTCAACACCTGGACACATTCTGGAAAGTTTCCTAAGAAAGCCAGAAAAATAATTTAAAAAAAAATCCAGAGGCCAGACGGGCTAATGGGGCTTTACTGCGACTATCTGGCTTAATCCTCCAAACAACCTTGCCATACCAGCCCATCAGTCCTCTGAGACAGGTGAAGAACCTGAGGTCGCAGGAGGACACCCAGAAGGTCCAGAGAGAGCCTCCTAGGCCCCCCACCTCCCCCCGTGGCAGCTCCAACCCCAGCTTTTTCACTAGTAAGGCAGTCGGGCCCCTGGGCCACGCCCACTCCCCCAAGCGGGGAAGGAGCTTCGCGCTGCCGCTTGGCTGGGGACTGGGCACCGCCCTCCCGCGGCTCCTGAGCCGGCTGCCACCAGGGGGCGCGCCAGCGGTGTCCGGGAGCCTAGCGGCGCGTGTGCAGCGGCCAGTGCACCTGCTCTGGCCCTCGCCGCGGTCTCTGCCAGGACCCCGACGCCCAGCCTGACCCTGCCATTCAGCGGGGCTGCGGCTCCACGGCCTGCGACAGCAGCCCCACCTGGCATTCAGCGCGCTCCCGGGGGCAGAGGTCGCGGTGTCCTCACGCTGTGGTGCCGGCCTACAACCCCCACGCCGGGCTCGGGCCCGGCGGAGGAGGGCGATGCTCCCCGGGTAGGACAAACCGGTCACCTGGGCTGCGACGGCGGCTTAGGGGCAGAAGCGGCGGTCCAGGGCCGCCTGGCGCAGCAGCCTGTCCCAGCCGCGGTCCCTGCAGTCCCTCCCTGGCGGCTGCGCAGCCGTCCCACGACAGGGGCCATAAACTCTCCAGAGCGGAAAGCCGCACCCTGGTGGCCCGGCCCCGCGCCCAGACCTGGCGGCCGCTGGCACCTGACCCGCTGCATGGGTCTCCAGGGAGCTCGCTGCCCACCCGGCGCTGCAGGCTCGGCTCCCTCGTACACTCTCTGGTAGGTGCTAGGGACGACCCTATGGGCCAGCTTGCCATGCCCAGTCCCCAGGCCGCACCCACCCTGGCTCCCTGGGCTAGGGGACTGGCTCCTCCTGTGAGTCGTGGGTCTGGGAGGCAGGGGCGTTAGGGGAGAGTGAGGGACCGAGGGCAGCCCCTGCTGTGTGCACAGCGAGGTCGTGCACAGGCGTCTGTTGCAGAGCGTGCAGCTTCAGATGAGACTGGATTGCAGGTGGAGATGACTGTGGGTGCGCACACCTGGAGGTGAAGGGGAGGCAGCCTGTCTACCTGACCCATGAAATACAGGAGACTGTACCCCAGAAGCAGCGGGTTCACTGCTCCATTGATTAAGCAAGTCTGGGACACACATGTAGCTAAGCTGTGAGTTCTGTACCAGCGATCCCAACACCCACGCCCTCAGAAAGACACTGGTGTGGGGCCTGGGTGCTTGTCAGGCCTGAAAGTGGAGAGCACGGGCCAGAGACACTGAGTAGGGGGAACCCACCCTAGGGCTCTGAGGGACGACGATGTGGGGAGCTGGTGACAGAGCCTGAGCTGGCCCAATGTTGCACGGTGGGGACAGATTCGAGGTACAGTGGGGACTGGTGACCTCAGTTCCCAGTGTCCCAGCCTGGCCTCCCAGTCCACCCAGCAATTAGTGGGTGCTGCCCTGCAAAGACTCTGGGGGTGCCTCAGCCCTCCTCATCACACGTGACTGGTGACTTCTGTGTCCACCCGCACAATAAGAGGGATCTTCTCTCACTTTCAGGCAAGCCCAAGAAAGTCAGGGGCCTATGTGAGCCAAAGAGGAGAGAAGGTGATGCCTCAGCCCAGTGTTTCTGCCCCACCTCGCTTGTGGCCTTCGGAACTTGATTTGCACCGCAGGAAAATGGGCAATGAAAACCCCTCCCTAACTGGCTTCTCAGTCCACTCTGACCAGCCCACTGCACAGCGCCCACCCTGCAGCTCCAGGTACAGAGGCTGGGATGGCTCTGGGCTGACCTAAGGGCCTTCTGATGGCTCCAACCCTCGGGATGCCTCATGCTCACCCTTTGGCACCCACCTGACAGCTCAGCATCTCTGCTCTCTGCCATCCTCAATGCCTGCTCTAGACAAGCCCAAGTCCCCCAGGAGTGGCAGAGGGAACTGAGCCGAAAACTAAGTCTCGGCTCACTGAACCCCAAGTGGGCTGTCCAGCCTCGCCCTTCAGTTCACAACCCCAGGCAGGTTCCCTCCAGGGATGTGATCCCAGGGGCCACAGCAGCACATTCTGGCCTAACCTATCCACTATTTAAACAGTTACTGAAAAGGCCAGGATGGCCGTGGGCCCTGACATTAATCCCCTTTCTCTGTGAGGGGGCTGGGTTGGGTTTGCCATCCTGATGTCTTTGTGGAAAGAGCTGGCAGGTGAAGCAAGTCTCAGGGGCCAGCCATGGGACAAGGAACCTAGGACTGGCCTCTGCTGGAACCCTCTGAGGCCCCTGCGGACAGGAGGATCCAATGGAGGTCTAGCCACCCCTCCCAGGTTGGTGCTCACAGCCCCTCCCTGGCCCACTCCCTGCACACCTGCACCTGCTGGTCTCTGGGAGAGGAGCATCCATCCATCTTGTGCGCATAGCTTTCGGCTCCATTTTCATGAGGATGGTCTCCTTGGCAGAAATGCCCATTAGGGGATCCTGAGCCTGTGCTAGCTCTTCTCTAAGTGCCAAAGCCAGTGAGAGGGACTTGAAAACTCAAGACTTATTAACAGTATTTTCTGCATTTTGTGCTTTCAGGGTTGTTTTTTCCTTAAAATGTGTAAAAACAAACATTGAGATTTCTATCTTTTATATAATTTGGATTCTGTTATCACACGGACTTTTCCTGAAATTTATTTTTATGTATGTATATCAAACATTGAATTTCTGTTTTCTTCTTTACTGGAATTGTTAACTGTTTTATAGGCCAAATCTTTTAAAAAAAACACATCTCTCTAATTTCTCTAAACATTTCTAATTACATATATATTTACTATACCTAATACACTACTTTGGAATTCCTTGAGGCCTAAATGCATCGGGGTGCTCTGGTTTTGTTGTTGTTATTTCTGAATGACATTTACTTTGGTGCTCTTTATTTTGCGTATTTAAAACTATTAGATCGTGTGATTATATTTGACAGGTCTTAATTGACGCGCTGTTCAGCCCTTTGAGTTCGGTTGAGTTTTGGGTTGGAGAATTTTCTTCCACAAGGGATTGTCTTGGATTTTTCTGTTTCTCCCTCAATATCCACCTGGAAAACATTTCAATTAATTTATATTTACTTAAATATTTCTGTGCAAAAACTGTGTACAAAAGCCCCAAAGCATAATTTGTGCAGTTGAGCGCATGTTCTGTTGTTCAGCATTTATGGTGGTTGGTAGTGGAAAAGATTTTTAGAATATGTGGATTTTCGGGATATTCCCAGAAGCCCAGATAGCGACACTTTACCTTTGGAGGAATTACTTCTCAGAATATTGCACACAATCAATCGCCTTTGGAAGGAGCATATATCCCCAGCAAAAGCTCTGGTTTTTTGAAGTCTGTATTGTGTGTTACTTCCAGGAGAATATGCAATGATGACAATGTTATTAGATGATTCAAATATGAAGTGCTGTTATGCCAAACAATGAATCTTTGTGTTATACATTATGCCTAACTATAAATCTTTGTGTTATACATTTTAATGTCATTGGAGAGTACTCCTGTCTTCTTGGCATTATTGATAATTAGATTCTAATTGCTAATAAGTCAGAAAAATTAGGAACACCAAATTTCAGTTGTCTCAAAAGCACTCCTCTTATTAAATTTGGATGTTTACCTTTATCACATCAAAAGAAATATTGTTAGAAAGGTGTTTAATGTTTTGCAGATGGATAGATTACTGTTATTAGTTCTCATTTCATTGTTAATTTTTAAAACCATAAGGTTGGAAGTATCAATATGCCTTTCAATATACCTTAGTGGAATTTATTAAATTTTCATGGATGTCCTTTAGGGGGTTCAGGAAGTTATTTCTATTGCTAGATTTCTGGAAGATTTATCAGGAATGAGTGTCAGACATTGTCAGACGTCCATTGAAATCATCATGGTCTTTTCCTTTATTCTATTAATATGATGTATTACACTGATTGATTTTTAAATTTGTATTGGTAGGATAATTCCACTTGGTTATATTGTCTAACTTTTTTCTAATTTTCTTTCATTTTTATTACAGATGAGGCCTCACTCTGTCACCCAGGTTGGGGTGGAGTGGCACAGTCACAGCTCACTATAACCTCAAGCTCCTGGGCTCAAGTGATCCTGCCACCTCAGCCTCCTAAGTAGCTGGAACTACAGATGTGCACTGCCATGCCAGGCTTGTCTAACATTTTTATGTGTTGCTTCATCCAGTTTGCTAGAGTTTTTGGAGATTTCTGTCTTCATTCATGAGGGATAATAGTCTGCACTTTTATTTTCTTGTGATACTTTTGTCTGATTTGTTATCTGGGTAATACTGGCCTTGAAAATGAATTGATGTTTTCCTGCTTCTCTGCTTTGCAAGTGTTTGTGAAGGATTGGTTATTCATTAAGTGTTTAATAGAATTCACTAGTGAAGCTATGTGAGCCAGGGCTAGACTGATGAAGAGTTTTCATTAGTCTAATCTGTTTACTTGCTGTATAAGTACGCATATATTCTCTTTCTTCTTGATTTAATTTTACACTTTGTGTATAGCAGGGAATCTGTGTCTAATTTGTAGTATTTCATGCTTCTAGGTTTTCATGGCAGTTGAGATGTAAGAATAACAATAATGTTGGGAGAAGGAAGTTGTGGACAATCCATGAATATCCCAACATCTGTTGTAGGAAGGTTAAGATTACTTTTTTTTTTTTTGCTGTACTGAACTGAATACTCTTATTTATAATGTCAGACAAATGTAATGTTGTATATAAATAGAACTAGGAAAATGTGCCATTTGTCTTAGTATTTAATCAAGATGGAAGTCTGGGCCTACCTCCTCTCTTTTATTAATATGTAGACAGGACACCAACACAAATTAGAATGAAGACAAACAAAATGTTAGCAAATGAAGAATGGTATCAATTGGTTAAAATGTGATGAAATAGAGTGGTGAATATTTACATAGAATCCATGATGTGTTAGGTGCTATTTCAAGCTATTTGCACATATAGTTTTAATACCAATGACGTTAAAATGTATAACACAAAGATTCATATAAATAAAAATTACAACATTGTAAATAATATTAGGTGACACTAAAACTGTCATAGAAATACACATTTATATAAAACATAAAGTAACATGAAGTATTAAATTTTAGAAACTTTGATTACTAATCAGATGAACAACTGATTAGCCTTTTTATCCAGTAAAAAAGGCATACATATTATTTTCAAATTCCAGAGACAAATATTTTAAATATTGAAGTTGAAGACCTAAAAATGTGTCACTGACCTCATGGAAGTAGATATTCACTAGGTGATATTTTCTAGGCTCTCTGAAATTATATCAGAAAAATGTGAATTAGAATATAACCCATAAATAATATCTGGCCACATACAAAGTAATTGAAGATCAATTTAAATGGCTATTGGATTAAGAAATAGGGACTGAGGTAAATTTGCAGTGTCAGGGAGGATCTAAGGAGGAAGCATTGACACTGGAGCCCAAGGACCTGGGATCACAGAACAGATTCTACCAGTGCTAACTTACTGCTCCACAGAAAACATCAATTCTGCTCATGCGCAGGTACAATTCATCAAGAAAGGAATTACAACTTCAGAAATGTGTTCAAAATATATCCATACTTTGACATATTAATGAAGTAATCACATTCTACACATAACTACTCCATATGGAATACTGGGGAGGAGGTGTTCCAAATAAAGAGACTGAGGATTTCTCATGAGAACTCAGTGTCTGCTAGAAAATATCTAAGTAAAATATTTTACTTATGTGGAAAGTGTGGATGTTTGTGCATCAAAAGTTTCAAGAATCCCTAAAATTTACAATGGAGATGAGGAGAAAATATCAGAATTTCCCAGCACCAGAAATAAGGCAAGAAAAAATTCAGAGGGGTTGTAAATGTGAAAAGCCAATGGCTGGTCACACAGCAACATTGATAACCTTGTGCCTGGACAACTAGAATAAATACATAAACATACACATTGAAAATATTTCCAATATTAGATCTCCCTCATGTGAGAACTAAATTATAAAGATTGAAGCATAGAAGAAAATAAGCTACCAGAATAAATTTGATTACACATAAATTTCTGATATTGAAACTGTCACAAATGTTTAAGTTGGTAGTGGAAGACAAAGGACATATAATCTTGGGAGTCCTAAGGCCCTGCCCACTGCCAGTCCCTCCACACTACTACAGCTGATGCTTTCTGGAAATCACCACCTCCTGGCAGGAGCCCAACCAGCACAAATATAGAGCATTAAACCACCAAAGCTAAGGAGGCTCACAGAGTCTATTGCACCCTTCACCACCTCCACTGGAACAGGCGCTGGTATCCATGGCTCAGAGACCCAAAGATGGTTCACATCACAGGGCTCTATGCAGACAACCCCCAGTACCAGCCCAAAGCCACGTAGACCTGCTGGGTGGCTAGACCCAGAAGAGAGACAACAATCAATGCACTTTGGCTTACAGGAAGCCATGCCCATAGGAAAAAGGGGAGAGTACTACGTCAAGGGAACACCCCGTGGGATGAAAGAGTCTGAACAACAGTCTTCAGCCCTAGACCTTTCCTCTGACAGAGTCTACCAAAATGAGAAGGAACCAGAAAACCAACCCTGGTAATCTGACAAAACAAGAATCTTCAACACCCCCCAAAAAATCACACCAGTTCATCACCAATGGATCCAAACAAAGAAGAAATCACTGATTCATCTAAAAAAAAATTCAGGTTAGTTATTAAGCTAATCAGGGAGGGGCCAGAGAAAGATGAAGCCCAATGCAAGAAAATCCAAAAAATGATACAATACGTGAAGGGAGAATTATTCAAGGAAATAGATAGCTTAAATAAAAAAATAAAAAATCAGGAAACTTTGGACGTACTTTTAGAAATGTGAAATGCTCTGGAAAGTCTCAGCAATAGAATTGAACAAGTAGAAGAAAGAAATTCAGAATTCGAAGACAAGGTCTTTGATTTAACCCAATCCAATAAAGACAAAGAAAAAAGAATAAGAAAATATGAGCAAAGTCTCCAAGGAGTCTGGCATTCTGTTAAATGATGAAACCTAACACTAATTGGTGTACCTGAGGAAGAAGTGAATTCTAAAAGCCAGGAAAACATATTTGGGAGAATAATCTAGGAAAACTTCCATGGCCTTGTGAGAGACCTAGACATCCAAATACAAGAACCACAAATAACACCTGGGAAATTCATCACAAAAAGATCTTAGCCTAGGCACATTGTCATTAGGTTATCCAAAGTTAAGACAAAGGAAAGAATCTTAAGAGCTGTGAGACAGAAGCACTAGGTAACCTATAAAGGAAAACCTGTCAAATTAACAGCAGATTTCACAGCAGGAACCTTACAAGCTAGATGGGATTGGGGCCCTTTCTTCAGCCTCCTCAAACAAAACAATTATCAGCCAAGAATTTTGTATCCAGCAAAACTAAACATCATATATGAAGGAAAGATACAGTCATTTTCAGACAAACAAATGCTGACAGAATTTGCCATTACCAAGCCAGGACTCTAAGAACTGCTAAAAGGAGCTCTAAATCATGAAACAAATCCTGGAAACACATCAAAACAGAACTTCATTAACGCATAAATCACACAGGACCTATAAAACAAAAATACAAGTTAAAAAACAAAAACAAAGTACAGAGGCAACAAAGAGCATGATGAAAGCAATGGTACCTCACTTTTTAATACTAATGTTGGTTGTAAATGGCTTAAATGCTCCACTTACAAGATACAGAACCACAGAATGGATAACAACTCACCAACTAACTATCTGCTGCCTTCAGGAGACTCACCTAACACATAACGACTTACATAAACTTAAGGAAAGTGGTAGAAAAAGGCATTTCATGCAAATGGACACCAAAAGCAAGCAGCAGTAACTATTCTCATATGAGACAAAACAAACTTTAAAGCAACAGTAGCTAAAAGAGACAAAGAGAGACAGTATATCATCTGTCACCTGACAGTCTCATCCAACAGAAAAATATGACAATCCTAAACATATGTGAACCTAACACTGGAGCTCCCAAATTTATAAAACAATTACTAGTAGACATAAGAAATAAGATAGACAGCAACACAATAATAGTGGGGGACTTCAATACTCCACTGACAGCACTAGACAGGTCATCAAGACAGAAAGTCAACAAAGAAACAATGGATTTAAACTATACTTTGGAACAAATGGACTTAACAGATATATATAGAACATTTCATCCAACAACCACAGAATACACATTCTATTCAACAGCACATGGAATTTTCTCCAAGATAGACCATATGATAGGCCATAAAATGAGTCTCAATAAATTTAAGAAAATTGAAATTGTATCACGCACTCTCTCACATCACAATGGAATAAAACTGAAAATCAACTCCAAAAGGAATCTTCGAAACCATGCAAATACATGGAAATTAAATAACCTGCTCCTGAATGAGCATTGGGTGAAAAACGAAATCAAGATGGAAATGTAAAAAATTTCTTCGAACTGGATGACACAACCTATCAAGACCTCTGGGATACAGCAAAGGCAGTGCTAAGAGGAAAGTTTATAGCACTAAACACCTACGTCGAAAAGTCTGAAAGAGCACAGACAATCTAAGTTCACATCTCAGGGAACTAGAGAAGGAGGAACAAGCCAAACCCAATCCCAGCAAACAAAGGAAATAACCAAGATCAGAGCAGAACTAAATGAAATTGACACAACAACAACAACAACAAAAATACAAAACATAAATAAAACAAAAATTTGGTTATTTGAAAAGATA\";\n System.out.println(\"The number of genes in this strand of DNA is \" + countGenes(dna1));\n }",
"public void haeVanhemmat(){\n isa = kantaja.getIsa();\n emo = kantaja.getEmo();\n }",
"private String casoNueve(String vl){\r\n @SuppressWarnings(\"UnusedAssignment\")\r\n String rt = \"\", primeraParte = \"\",segundaParte = \"\",terceraParte =\"\";\r\n if((String.valueOf(vl.charAt(0)).equals(\"1\"))&&(String.valueOf(vl.charAt(1)).equals(\"0\"))&&(String.valueOf(vl.charAt(2)).equals(\"0\"))){\r\n primeraParte = \" cien millones\";\r\n }\r\n else{\r\n primeraParte = escribirCentesimas(vl.charAt(0)+\"\"+vl.charAt(1)+\"\"+vl.charAt(2))+\" millones \";\r\n }\r\n if((String.valueOf(vl.charAt(3)).equals(\"0\"))&&(String.valueOf(vl.charAt(4)).equals(\"0\"))&&(String.valueOf(vl.charAt(5)).equals(\"0\"))){\r\n segundaParte =\" \";\r\n }\r\n else{\r\n segundaParte = colocarTerminos(String.valueOf(vl.charAt(3)),\r\n String.valueOf(vl.charAt(4)),\r\n String.valueOf(vl.charAt(5)),\r\n \" mil \"\r\n ); ;\r\n }\r\n if((String.valueOf(vl.charAt(6)).equals(\"0\"))&&(String.valueOf(vl.charAt(7)).equals(\"0\"))&&(String.valueOf(vl.charAt(8)).equals(\"0\"))){\r\n terceraParte =\" pesos moneda corriente.\";\r\n }\r\n else{\r\n terceraParte = escribirCentesimas(\"\"+vl.charAt(6)+\"\"+vl.charAt(7)+\"\"+vl.charAt(8))+\" pesos modeda corriente.\";\r\n }\r\n if((String.valueOf(vl.charAt(1)).equals(\"0\"))&&(String.valueOf(vl.charAt(2)).equals(\"0\"))\r\n &&(String.valueOf(vl.charAt(3)).equals(\"0\"))&&(String.valueOf(vl.charAt(4)).equals(\"0\"))\r\n &&(String.valueOf(vl.charAt(5)).equals(\"0\"))&&(String.valueOf(vl.charAt(6)).equals(\"0\"))\r\n &&(String.valueOf(vl.charAt(7)).equals(\"0\"))&&(String.valueOf(vl.charAt(8)).equals(\"0\")) \r\n ){\r\n terceraParte = \" de pesos moneda corriente.\";\r\n \r\n }\r\n rt = primeraParte+segundaParte+terceraParte;\r\n \r\n return rt.substring(0, 1).toUpperCase() + rt.substring(1); \r\n }",
"public void TongSL() {\n System.out.println(\"|-> Tong So Luong cua Giao Dich Vang: \" + sum1 + \" <-|\");\n System.out.println(\"|-> Tong So Luong cua Giao Dich Tien Te:\" + sum2 + \" <-|\");\n }",
"public String apavada_vriddhi(String X_anta, String X_adi)\n {\n\n Log.info(\"*******ENTERED AAPAVADA NIYAMA UNO**********\");\n Log.info(\"X_adi == \" + X_adi);\n String anta = EncodingUtil.convertSLPToUniformItrans(X_anta);\n // x.transform(X_anta); // anta is ITRANS equivalent\n String adi = EncodingUtil.convertSLPToUniformItrans(X_adi);\n // x.transform(X_adi); // adi is ITRANS equivalent\n\n Log.info(\"adi == \" + adi);\n\n String return_me = \"UNAPPLICABLE\";\n\n boolean bool1 = VowelUtil.isAkaranta(X_anta) && (adi.equals(\"eti\") || adi.equals(\"edhati\"));\n boolean bool2 = VowelUtil.isAkaranta(X_anta) && adi.equals(\"UTh\");\n\n // 203\n // **********IF****************//\n if (X_anta.endsWith(\"f\") && X_adi.startsWith(\"f\")) // watch out!!! must\n // be SLP not ITRANS\n {// checked:29-6\n String strip1 = VarnaUtil.stripAntyaVarna(X_anta);\n String strip2 = VarnaUtil.stripAdiVarna(X_adi);\n\n return_me = utsarga_sandhi(X_anta, X_adi) + \", \" + strip1 + \"f\" + strip2;\n\n comments.start_adding_notes();\n comments.setSutraNum(\"\");\n comments.setVartikaPath(\"RRiti RRi vA vacanam\");\n comments.setSutraProc(\"hrasva RRikara ekadesh\");\n comments.setSource(Comments.vartika);\n String cond1 = \"small RRi followed by small RRi merge to become small RRi.\\n\" + \"RRi + RRi = RRi\";\n comments.setConditions(cond1);\n\n } // end of main if\n // **********END OF IF****************//\n\n // 204\n // **********IF****************//\n else if (X_anta.endsWith(\"f\") && X_adi.startsWith(\"x\")) // watch out!!!\n // must be SLP\n // not ITRANS\n { // checked:29-6 // SLP x = ITRANS LLi\n String strip1 = VarnaUtil.stripAntyaVarna(X_anta);\n String strip2 = VarnaUtil.stripAdiVarna(X_adi);\n\n return_me = utsarga_sandhi(X_anta, X_adi) + \", \" + strip1 + \"x\" + strip2; // SLP\n // x =\n // ITRANS\n // LLi\n\n comments.start_adding_notes();\n comments.setSutraNum(\"\");\n comments.setVartikaPath(\"LLiti LLi vA vacanam\");\n comments.setSutraProc(\"hrasva LLikara ekadesh\");\n comments.setSource(Comments.vartika);\n String cond1 = \" RRi/RRI followed by small LLi merge to become small LLi.\\n RRi/RRI + LLi = LLi\";\n comments.setConditions(cond1);\n\n } // end of main if\n // **********END OF IF****************//\n\n // 207a-b\n // **********ELSE IF****************//\n else if (bool1 || bool2)\n {\n // checked:29-6\n return_me = vriddhi_sandhi(X_anta, X_adi);\n\n // We have to remove vriddhi_sandhi default notes\n // this is done by\n comments.decrementPointer();\n comments.start_adding_notes();\n comments.setSutraNum(\"6.1.86\");\n comments.setSutraPath(\"eti-edhati-UThsu\");\n comments.setSutraProc(\"vRRiddhi-ekadesh\");\n comments.setSource(Comments.sutra);\n\n String cond1 = \"akaara followed by declensions of 'iN', 'edha' and 'UTh\" + \"<eti/edhati/UTh> are replaced by their vRRiddhi counterpart.\\n\" + \"a/A/a3 + eti/edhati/UTha = VRRiddhi Counterpart.\\n\" + \"Pls. Note.My Program cannot handle all the declensions of given roots.\" + \"Hence will only work for one instance of Third Person Singular Form\";\n comments.setConditions(cond1);\n\n String cond2 = \"Blocks para-rupa Sandhi given by 'e~ni pararUpam' which had blocked Normal Vriddhi Sandhi\";\n\n if (bool1)\n comments.append_condition(cond2);\n else if (bool2) comments.append_condition(\"Blocks 'Ad guNaH'\");\n\n }\n\n // **********END OF ELSE IF****************//\n\n // 208\n // **********ELSE IF****************//\n else if (anta.equals(\"akSa\") && adi.equals(\"UhinI\"))\n {// checked:29-6\n return_me = \"akzOhiRI\"; // u to have give in SLP..had\n // ITRANS....fixed\n // not sending to vrridhit_sandhi becose of Na-inclusion\n // vriddhi_sandhi(X_anta,X_adi);\n // We have to remove vriddhi_sandhi default notes\n // this is done by\n // ***/vowel_notes.decrement_pointer();/***/\n\n comments.start_adding_notes();\n comments.setSutraNum(\"\");\n comments.setVartikaPath(\"akSAdUhinyAm\");\n comments.setSutraProc(\"vRRiddhi-ekadesh\");\n comments.setSource(Comments.vartika);\n String cond1 = \"akSa + UhinI = akshauhiNI.Vartika blocks guna-sandhi ato allow vRRiddhi-ekadesh\";\n comments.setConditions(cond1);\n\n }\n // **********END OF ELSE IF****************//\n\n // 209\n // **********ELSE IF****************//\n else if (anta.equals(\"pra\") && (adi.equals(\"Uha\") || adi.equals(\"UDha\") || adi.equals(\"UDhi\") || adi.equals(\"eSa\") || adi.equals(\"eSya\")))\n // checked:29-6\n {\n return_me = vriddhi_sandhi(X_anta, X_adi);\n\n // We have to remove vriddhi_sandhi default notes\n // this is done by\n /***/\n comments.decrementPointer();\n /***/\n\n comments.start_adding_notes();\n comments.setSutraNum(\"\");\n comments.setVartikaPath(\"prAd-Uha-UDha-UDhi-eSa-eSyeSu\");\n comments.setSutraProc(\"vRRiddhi-ekadesh\");\n comments.setSource(Comments.vartika);\n String cond1 = \"upasarga 'pra' + <prAd/Uha/UDha/UDhi/eSa/eSya> = vRRiddhi-ekadesha.\" + \"\\nVartika blocks para-rupa Sandhi and/or guna Sandhi to allow vRRidhi-ekadesh.\";\n\n comments.setConditions(cond1);\n\n }\n\n // **********END OF ELSE IF****************//\n\n // 210\n // **********ELSE IF****************//\n else if (anta.equals(\"sva\") && (adi.equals(\"ira\") || adi.equals(\"irin\")))\n {\n // checked:29-6\n return_me = vriddhi_sandhi(X_anta, X_adi);\n // We have to remove vriddhi_sandhi default notes\n // this is done by\n /***/\n comments.decrementPointer();\n /***/\n\n comments.start_adding_notes();\n comments.setSutraNum(\"\");\n comments.setVartikaPath(\"svaadireriNoH\");\n comments.setSutraProc(\"vRRiddhi-ekadesh\");\n comments.setSource(Comments.vartika);\n String cond1 = \"sva + <ira/irin> = vRRIddhi.\\n Blocks Guna Sandhi.\" + \"\\nPls. note. My program does not cover sandhi with declensions.\";\n comments.setConditions(cond1);\n }\n\n // **********END OF ELSE IF****************//\n\n // 211 Vik. Semantic Dependency\n // **********ELSE IF****************//\n else if (VowelUtil.isAkaranta(X_anta) && X_adi.equals(\"fta\"))// adi.equals(\"RRita\"))\n {\n // checked:29-6\n // not working for 'a' but working for 'A'. Find out why...fixed\n\n return_me = utsarga_prakruti_bhava(X_anta, X_adi) + \", \" + vriddhi_sandhi(X_anta, X_adi) + \"**\";\n\n // We have to remove vriddhi_sandhi default notes\n // this is done by\n /***/\n comments.decrementPointer();\n /***/\n\n comments.start_adding_notes();\n comments.setSutraNum(\"\");\n comments.setVartikaPath(\"RRite ca tRRitIyAsamAse\");\n comments.setSutraProc(\"Vriddhi-ekadesh\");\n comments.setSource(Comments.vartika);\n String cond1 = \"If an akaranta ('a/aa/a3'-terminating phoneme) is going to form a Tritiya Samas compound with a RRi-initial word\" + \" vRRiddhi-ekadesha takes place blocking other rules.\\n\" + \"a/A/a3 + RRi -> Tritiya Samaasa Compound -> vRRiddhi-ekadesh\" + depend;\n comments.setConditions(cond1);\n }\n // **********END OF ELSE IF****************//\n\n // 212-213\n // **********ELSE IF****************//\n else if ((anta.equals(\"pra\") || anta.equals(\"vatsatara\") || anta.equals(\"kambala\") || anta.equals(\"vasana\") || anta.equals(\"RRiNa\") || anta.equals(\"dasha\")) && adi.equals(\"RRiNa\"))\n\n // checked:29-6\n { // pra condition not working...fixed now . 5 MAR 05\n // return_me = guna_sandhi(X_anta,X_adi) + \", \" +\n // prakruti_bhava(X_anta,X_adi)\n\n return_me = vriddhi_sandhi(X_anta, X_adi);\n // We have to remove vriddhi_sandhi default notes\n // this is done by\n /***/\n comments.decrementPointer();\n /***/\n\n comments.start_adding_notes();\n // vowel_notes.set_sutra_num(\"\") ;\n comments.setVartikaPath(\"pra-vatsatara-kambala-vasanArNa dashaanAm RRiNe\");\n comments.setSutraProc(\"Vriddhi-ekadesh\");\n comments.setSource(Comments.vartika);\n String cond1 = \"If 'pra' etc are followed by the word 'RRiNa',\" + \" vRRiddhi-ekadesh takes place blocking Guna and Prakruti Bhava Sandhis.\" + \"\\n<pra/vatsatara/kambala/vasana/RRiNa/dash> + RRiNa = vRRiddhi\";\n comments.setConditions(cond1);\n }\n // ???? also implement prakruti bhava\n\n /**\n * **YEs ACCORDING TO SWAMI DS but not according to Bhaimi Bhashya else\n * if ( adi.equals(\"RRiNa\") && (anta.equals(\"RRiNa\") ||\n * anta.equals(\"dasha\")) ) { return_me = vriddhi_sandhi(X_anta,X_adi);\n * //*sandhi_notes = VE + apavada + vartika + \"'RRiNa dashAbhyAm ca'.\" +\n * \"\\nBlocks Guna and Prakruti Bhava Sandhi\";\n * \n * vowel_notes.start_adding_notes(); vowel_notes.set_sutra_num(\"\") ;\n * vowel_notes.set_vartika_path(\"RRiNa dashAbhyAm ca\") ;\n * vowel_notes.set_sutra_proc(\"Vriddhi-ekadesh\");\n * vowel_notes.set_source(tippani.vartika) ; String cond1 =depend +\n * \"Blocks Guna and Prakruti Bhava Sandhi\";\n * vowel_notes.set_conditions(cond1);\n * /* return_me = utsarga_prakruti_bhava(X_anta,X_adi) + \", \" +\n * vriddhi_sandhi(X_anta,X_adi) + \"**\"; sandhi_notes = usg1 +\n * sandhi_notes; sandhi_notes+= \"\\n\" + usg2 + VE +apavada + vartika +\n * \"'RRiNa dashAbhyAm ca'.\" + depend; // .... this was when I assumed\n * this niyama is optional with other // ???? also implement prakruti\n * bhava }\n */\n // **********END OF ELSE IF****************//\n // 214 Vik. Semantic Dependency\n // **********ELSE IF****************//\n else if (anta.equals(\"A\") && VowelUtil.isAjadi(X_adi))\n {\n // checked:29-6\n // rules is A + Vowel = VRddhi\n\n return_me = utsarga_sandhi(X_anta, X_adi) + \", \" + vriddhi_sandhi(X_anta, X_adi) + \"**\";\n /*******************************************************************\n * sandhi_notes = usg1 + sandhi_notes + \"\\n\" + usg2 ; // We have to\n * remove vriddhi_sandhi default notes // this is done by /\n ******************************************************************/\n comments.decrementPointer();\n /***/\n\n comments.start_adding_notes();\n comments.setSutraNum(\"6.1.87\");\n comments.setSutraPath(\"ATashca\");\n comments.setSutraProc(\"Vriddhi-ekadesh\");\n comments.setSource(Comments.vartika);\n String cond1 = depend + \"if String 1 equals 'aa' and implies 'AT'-Agama and \" + \"String 2 is a verbal form. E.g. A + IkSata = aikSata not ekSata.\\n\" + \" 'aa' + Verbal Form = vRRiddhi-ekadesh\";\n comments.setConditions(cond1);\n }\n // **********END OF ELSE IF****************//\n\n // **********ELSE IF****************//\n // akaranta uparga mein error....fixed 4 MAR\n // 215 Vik Semantic Dependency\n else if (is_akaranta_upsarga(X_anta) && X_adi.startsWith(\"f\")) // RRi\n // ==\n // SLP\n // 'f'USing\n // X_adi,\n // switched\n // to\n // Sharfe\n // Encoding\n { // according to Vedanga Prakash Sandhi Vishaya RRIkara is being\n // translated\n // but checked with SC Basu Trans. it is RRIta not RRikara\n // checked:29-6\n\n Log.info(\" Rules 215 applies\");\n return_me = utsarga_sandhi(X_anta, X_adi) + \", \" + vriddhi_sandhi(X_anta, X_adi) + \"**\";\n // We have to remove vriddhi_sandhi default notes\n // this is done by\n // vowel_notes.decrement_pointer();\n\n // July 14 2005.. I have removed the above line\n // vowel_notes.decrement_pointer();\n\n comments.start_adding_notes();\n comments.setSutraNum(\"6.1.88\");\n comments.setSutraPath(\"upasargAdRRiti dhAtau\");\n comments.setSutraProc(\"Vriddhi-ekadesh\");\n comments.setSource(Comments.vartika);\n String cond1 = depend + \"akaranta upsarga(preverb) followed by verbal form begining with short RRi.\\n \" + \"preverb ending in <a> + verbal form begining with RRi = vRRiddhi-ekadesha\\n\";\n\n /*\n * \"By 6.1.88 it should block all \" + \"optional forms but by 'vA\n * supyApishaleH' (6.1.89) subantas are \" + \"permitted the Guna\n * option.\";\n */\n comments.setConditions(cond1);\n }\n // **********END OF ELSE IF****************//\n\n Log.info(\"return_me == \" + return_me);\n Log.info(\"*******EXITED AAPAVADA NIYAMA UNO**********\");\n\n if (return_me.equals(\"UNAPPLICABLE\"))\n {\n return_me = apavada_para_rupa(X_anta, X_adi); // search for more\n // apavada rules\n }\n return return_me; // apavada rules formulated by Panini apply\n }",
"private void rimuovi() {\n out.println(\"Non ancora implementato\"); // Lasciato come esercizio\n }",
"private String elaboraIncipit() {\n String testo = VUOTA;\n\n if (usaHeadIncipit) {\n testo += elaboraIncipitSpecifico();\n testo += A_CAPO;\n }// fine del blocco if\n\n return testo;\n }",
"private final void step1()\n\t { if (b[k] == 's')\n\t { if (ends(\"sses\")) k -= 2; else\n\t if (ends(\"ies\")) setto(\"i\"); else\n\t if (b[k-1] != 's') k--;\n\t }\n\t if (ends(\"eed\")) { if (m() > 0) k--; } else\n\t if ((ends(\"ed\") || ends(\"ing\")) && vowelinstem())\n\t { k = j;\n\t if (ends(\"at\")) setto(\"ate\"); else\n\t if (ends(\"bl\")) setto(\"ble\"); else\n\t if (ends(\"iz\")) setto(\"ize\"); else\n\t if (doublec(k))\n\t { k--;\n\t { int ch = b[k];\n\t if (ch == 'l' || ch == 's' || ch == 'z') k++;\n\t }\n\t }\n\t else if (m() == 1 && cvc(k)) setto(\"e\");\n\t }\n\t }",
"public void evidenziaPozzo(){\n System.out.println(\" --\");\n }",
"public static void main(String[] args) {\n String frase;\n String frase2 = \"\";//debe ser inicializada\n Scanner sc = new Scanner(System.in);\n\n System.out.println(\"Ingrese una frase\");\n frase = sc.nextLine();\n\n int i = 0;\n\n while (i < frase.length()) {//ou con for et if y else, los i++ estarian solo en el for\n if (frase.charAt(i) != ' ') {\n frase2 = frase2.concat(frase.substring(i, i + 1));\n } else {//el else solo pedia tranformar los espacios en alterisco que se hace solo con\n frase2 = frase2.concat(\"*\");//esto//y esto\n while (frase.charAt(i) == ' ') {\n i++;\n }\n frase2 = frase2.concat(frase.substring(i, i + 1));\n }\n i++;\n }//faltaria una primera condicion como en los 2 ejercicios precedentes pa que no imprima asteriscos antes de la 1era letra\n System.out.println(frase2);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$ANTLR end "rule__AstExternalFunction__Group__6__Impl" $ANTLR start "rule__AstExternalFunction__Group__7" ../org.caltoopia.frontend.ui/srcgen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:9202:1: rule__AstExternalFunction__Group__7 : rule__AstExternalFunction__Group__7__Impl rule__AstExternalFunction__Group__8 ; | public final void rule__AstExternalFunction__Group__7() throws RecognitionException {
int stackSize = keepStackSize();
try {
// ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:9206:1: ( rule__AstExternalFunction__Group__7__Impl rule__AstExternalFunction__Group__8 )
// ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:9207:2: rule__AstExternalFunction__Group__7__Impl rule__AstExternalFunction__Group__8
{
pushFollow(FOLLOW_rule__AstExternalFunction__Group__7__Impl_in_rule__AstExternalFunction__Group__718887);
rule__AstExternalFunction__Group__7__Impl();
state._fsp--;
pushFollow(FOLLOW_rule__AstExternalFunction__Group__8_in_rule__AstExternalFunction__Group__718890);
rule__AstExternalFunction__Group__8();
state._fsp--;
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
restoreStackSize(stackSize);
}
return ;
} | [
"public final void rule__AstExternalFunction__Group__6() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:9177:1: ( rule__AstExternalFunction__Group__6__Impl rule__AstExternalFunction__Group__7 )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:9178:2: rule__AstExternalFunction__Group__6__Impl rule__AstExternalFunction__Group__7\n {\n pushFollow(FOLLOW_rule__AstExternalFunction__Group__6__Impl_in_rule__AstExternalFunction__Group__618826);\n rule__AstExternalFunction__Group__6__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_rule__AstExternalFunction__Group__7_in_rule__AstExternalFunction__Group__618829);\n rule__AstExternalFunction__Group__7();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__AstExternalFunction__Group__7__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:9218:1: ( ( ')' ) )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:9219:1: ( ')' )\n {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:9219:1: ( ')' )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:9220:1: ')'\n {\n before(grammarAccess.getAstExternalFunctionAccess().getRightParenthesisKeyword_7()); \n match(input,59,FOLLOW_59_in_rule__AstExternalFunction__Group__7__Impl18918); \n after(grammarAccess.getAstExternalFunctionAccess().getRightParenthesisKeyword_7()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__AstExternalFunction__Group_6__1__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:9389:1: ( ( ( rule__AstExternalFunction__Group_6_1__0 )* ) )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:9390:1: ( ( rule__AstExternalFunction__Group_6_1__0 )* )\n {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:9390:1: ( ( rule__AstExternalFunction__Group_6_1__0 )* )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:9391:1: ( rule__AstExternalFunction__Group_6_1__0 )*\n {\n before(grammarAccess.getAstExternalFunctionAccess().getGroup_6_1()); \n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:9392:1: ( rule__AstExternalFunction__Group_6_1__0 )*\n loop77:\n do {\n int alt77=2;\n int LA77_0 = input.LA(1);\n\n if ( (LA77_0==62) ) {\n alt77=1;\n }\n\n\n switch (alt77) {\n \tcase 1 :\n \t // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:9392:2: rule__AstExternalFunction__Group_6_1__0\n \t {\n \t pushFollow(FOLLOW_rule__AstExternalFunction__Group_6_1__0_in_rule__AstExternalFunction__Group_6__1__Impl19239);\n \t rule__AstExternalFunction__Group_6_1__0();\n\n \t state._fsp--;\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break loop77;\n }\n } while (true);\n\n after(grammarAccess.getAstExternalFunctionAccess().getGroup_6_1()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__AstExternalFunction__Group__6__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:9189:1: ( ( ( rule__AstExternalFunction__Group_6__0 )? ) )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:9190:1: ( ( rule__AstExternalFunction__Group_6__0 )? )\n {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:9190:1: ( ( rule__AstExternalFunction__Group_6__0 )? )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:9191:1: ( rule__AstExternalFunction__Group_6__0 )?\n {\n before(grammarAccess.getAstExternalFunctionAccess().getGroup_6()); \n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:9192:1: ( rule__AstExternalFunction__Group_6__0 )?\n int alt76=2;\n int LA76_0 = input.LA(1);\n\n if ( (LA76_0==RULE_ID||(LA76_0>=38 && LA76_0<=45)||LA76_0==58||LA76_0==81||LA76_0==91) ) {\n alt76=1;\n }\n switch (alt76) {\n case 1 :\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:9192:2: rule__AstExternalFunction__Group_6__0\n {\n pushFollow(FOLLOW_rule__AstExternalFunction__Group_6__0_in_rule__AstExternalFunction__Group__6__Impl18856);\n rule__AstExternalFunction__Group_6__0();\n\n state._fsp--;\n\n\n }\n break;\n\n }\n\n after(grammarAccess.getAstExternalFunctionAccess().getGroup_6()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__AstExternalFunction__Group_6__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:9378:1: ( rule__AstExternalFunction__Group_6__1__Impl )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:9379:2: rule__AstExternalFunction__Group_6__1__Impl\n {\n pushFollow(FOLLOW_rule__AstExternalFunction__Group_6__1__Impl_in_rule__AstExternalFunction__Group_6__119212);\n rule__AstExternalFunction__Group_6__1__Impl();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__AstExternalFunction__Group_6_1__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:9441:1: ( rule__AstExternalFunction__Group_6_1__1__Impl )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:9442:2: rule__AstExternalFunction__Group_6_1__1__Impl\n {\n pushFollow(FOLLOW_rule__AstExternalFunction__Group_6_1__1__Impl_in_rule__AstExternalFunction__Group_6_1__119336);\n rule__AstExternalFunction__Group_6_1__1__Impl();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__AstExternalFunction__Group_6__0() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:9349:1: ( rule__AstExternalFunction__Group_6__0__Impl rule__AstExternalFunction__Group_6__1 )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:9350:2: rule__AstExternalFunction__Group_6__0__Impl rule__AstExternalFunction__Group_6__1\n {\n pushFollow(FOLLOW_rule__AstExternalFunction__Group_6__0__Impl_in_rule__AstExternalFunction__Group_6__019152);\n rule__AstExternalFunction__Group_6__0__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_rule__AstExternalFunction__Group_6__1_in_rule__AstExternalFunction__Group_6__019155);\n rule__AstExternalFunction__Group_6__1();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__AstExternalFunction__Group_6_1__0() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:9410:1: ( rule__AstExternalFunction__Group_6_1__0__Impl rule__AstExternalFunction__Group_6_1__1 )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:9411:2: rule__AstExternalFunction__Group_6_1__0__Impl rule__AstExternalFunction__Group_6_1__1\n {\n pushFollow(FOLLOW_rule__AstExternalFunction__Group_6_1__0__Impl_in_rule__AstExternalFunction__Group_6_1__019274);\n rule__AstExternalFunction__Group_6_1__0__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_rule__AstExternalFunction__Group_6_1__1_in_rule__AstExternalFunction__Group_6_1__019277);\n rule__AstExternalFunction__Group_6_1__1();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__AstExternalProcedure__Group_6__1__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:10403:1: ( ( ( rule__AstExternalProcedure__Group_6_1__0 )* ) )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:10404:1: ( ( rule__AstExternalProcedure__Group_6_1__0 )* )\n {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:10404:1: ( ( rule__AstExternalProcedure__Group_6_1__0 )* )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:10405:1: ( rule__AstExternalProcedure__Group_6_1__0 )*\n {\n before(grammarAccess.getAstExternalProcedureAccess().getGroup_6_1()); \n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:10406:1: ( rule__AstExternalProcedure__Group_6_1__0 )*\n loop86:\n do {\n int alt86=2;\n int LA86_0 = input.LA(1);\n\n if ( (LA86_0==62) ) {\n alt86=1;\n }\n\n\n switch (alt86) {\n \tcase 1 :\n \t // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:10406:2: rule__AstExternalProcedure__Group_6_1__0\n \t {\n \t pushFollow(FOLLOW_rule__AstExternalProcedure__Group_6_1__0_in_rule__AstExternalProcedure__Group_6__1__Impl21237);\n \t rule__AstExternalProcedure__Group_6_1__0();\n\n \t state._fsp--;\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break loop86;\n }\n } while (true);\n\n after(grammarAccess.getAstExternalProcedureAccess().getGroup_6_1()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__AstExternalFunction__Group__8() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:9237:1: ( rule__AstExternalFunction__Group__8__Impl rule__AstExternalFunction__Group__9 )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:9238:2: rule__AstExternalFunction__Group__8__Impl rule__AstExternalFunction__Group__9\n {\n pushFollow(FOLLOW_rule__AstExternalFunction__Group__8__Impl_in_rule__AstExternalFunction__Group__818949);\n rule__AstExternalFunction__Group__8__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_rule__AstExternalFunction__Group__9_in_rule__AstExternalFunction__Group__818952);\n rule__AstExternalFunction__Group__9();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__AstExternalProcedure__Group__6__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:10267:1: ( ( ( rule__AstExternalProcedure__Group_6__0 )? ) )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:10268:1: ( ( rule__AstExternalProcedure__Group_6__0 )? )\n {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:10268:1: ( ( rule__AstExternalProcedure__Group_6__0 )? )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:10269:1: ( rule__AstExternalProcedure__Group_6__0 )?\n {\n before(grammarAccess.getAstExternalProcedureAccess().getGroup_6()); \n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:10270:1: ( rule__AstExternalProcedure__Group_6__0 )?\n int alt85=2;\n int LA85_0 = input.LA(1);\n\n if ( (LA85_0==RULE_ID||(LA85_0>=38 && LA85_0<=45)||LA85_0==58||LA85_0==81||LA85_0==91) ) {\n alt85=1;\n }\n switch (alt85) {\n case 1 :\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:10270:2: rule__AstExternalProcedure__Group_6__0\n {\n pushFollow(FOLLOW_rule__AstExternalProcedure__Group_6__0_in_rule__AstExternalProcedure__Group__6__Impl20980);\n rule__AstExternalProcedure__Group_6__0();\n\n state._fsp--;\n\n\n }\n break;\n\n }\n\n after(grammarAccess.getAstExternalProcedureAccess().getGroup_6()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__AstExternalProcedure__Group__7() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:10284:1: ( rule__AstExternalProcedure__Group__7__Impl rule__AstExternalProcedure__Group__8 )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:10285:2: rule__AstExternalProcedure__Group__7__Impl rule__AstExternalProcedure__Group__8\n {\n pushFollow(FOLLOW_rule__AstExternalProcedure__Group__7__Impl_in_rule__AstExternalProcedure__Group__721011);\n rule__AstExternalProcedure__Group__7__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_rule__AstExternalProcedure__Group__8_in_rule__AstExternalProcedure__Group__721014);\n rule__AstExternalProcedure__Group__8();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__AstExternalActor__Group__7__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:11023:1: ( ( ( rule__AstExternalActor__Group_7__0 )? ) )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:11024:1: ( ( rule__AstExternalActor__Group_7__0 )? )\n {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:11024:1: ( ( rule__AstExternalActor__Group_7__0 )? )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:11025:1: ( rule__AstExternalActor__Group_7__0 )?\n {\n before(grammarAccess.getAstExternalActorAccess().getGroup_7()); \n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:11026:1: ( rule__AstExternalActor__Group_7__0 )?\n int alt90=2;\n int LA90_0 = input.LA(1);\n\n if ( (LA90_0==RULE_ID||(LA90_0>=38 && LA90_0<=45)||LA90_0==58||LA90_0==81||LA90_0==91) ) {\n alt90=1;\n }\n switch (alt90) {\n case 1 :\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:11026:2: rule__AstExternalActor__Group_7__0\n {\n pushFollow(FOLLOW_rule__AstExternalActor__Group_7__0_in_rule__AstExternalActor__Group__7__Impl22466);\n rule__AstExternalActor__Group_7__0();\n\n state._fsp--;\n\n\n }\n break;\n\n }\n\n after(grammarAccess.getAstExternalActorAccess().getGroup_7()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__AstExternalFunction__Group__10() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:9297:1: ( rule__AstExternalFunction__Group__10__Impl )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:9298:2: rule__AstExternalFunction__Group__10__Impl\n {\n pushFollow(FOLLOW_rule__AstExternalFunction__Group__10__Impl_in_rule__AstExternalFunction__Group__1019071);\n rule__AstExternalFunction__Group__10__Impl();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__AstExternalFunction__Group__5() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:9146:1: ( rule__AstExternalFunction__Group__5__Impl rule__AstExternalFunction__Group__6 )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:9147:2: rule__AstExternalFunction__Group__5__Impl rule__AstExternalFunction__Group__6\n {\n pushFollow(FOLLOW_rule__AstExternalFunction__Group__5__Impl_in_rule__AstExternalFunction__Group__518764);\n rule__AstExternalFunction__Group__5__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_rule__AstExternalFunction__Group__6_in_rule__AstExternalFunction__Group__518767);\n rule__AstExternalFunction__Group__6();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__AstExternalProcedure__Group_6__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:10392:1: ( rule__AstExternalProcedure__Group_6__1__Impl )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:10393:2: rule__AstExternalProcedure__Group_6__1__Impl\n {\n pushFollow(FOLLOW_rule__AstExternalProcedure__Group_6__1__Impl_in_rule__AstExternalProcedure__Group_6__121210);\n rule__AstExternalProcedure__Group_6__1__Impl();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__AstExternalProcedure__Group_6_1__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:10455:1: ( rule__AstExternalProcedure__Group_6_1__1__Impl )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:10456:2: rule__AstExternalProcedure__Group_6_1__1__Impl\n {\n pushFollow(FOLLOW_rule__AstExternalProcedure__Group_6_1__1__Impl_in_rule__AstExternalProcedure__Group_6_1__121334);\n rule__AstExternalProcedure__Group_6_1__1__Impl();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__AstExternalFunction__Group__4() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:9117:1: ( rule__AstExternalFunction__Group__4__Impl rule__AstExternalFunction__Group__5 )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:9118:2: rule__AstExternalFunction__Group__4__Impl rule__AstExternalFunction__Group__5\n {\n pushFollow(FOLLOW_rule__AstExternalFunction__Group__4__Impl_in_rule__AstExternalFunction__Group__418704);\n rule__AstExternalFunction__Group__4__Impl();\n\n state._fsp--;\n\n pushFollow(FOLLOW_rule__AstExternalFunction__Group__5_in_rule__AstExternalFunction__Group__418707);\n rule__AstExternalFunction__Group__5();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__AstExternalProcedure__Group__7__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:10296:1: ( ( ')' ) )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:10297:1: ( ')' )\n {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:10297:1: ( ')' )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:10298:1: ')'\n {\n before(grammarAccess.getAstExternalProcedureAccess().getRightParenthesisKeyword_7()); \n match(input,59,FOLLOW_59_in_rule__AstExternalProcedure__Group__7__Impl21042); \n after(grammarAccess.getAstExternalProcedureAccess().getRightParenthesisKeyword_7()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Process the facsimile section of a TEI document. This code is based on the structure from Jeffrey Witt's Petrus Plaoul manuscripts. Jeffrey defines a separate surface for each paragraph on a page. Tradamus treats each graphic as a canvas, and notes the coordinates of the paragraphs. We will likely need additional work to support all flavours of TEI. | private void processFacsimile(String imageBase) throws XMLStreamException, URISyntaxException {
surfaces = new ArrayList<>();
Map<String, List<SurfaceDef>> graphicSurfaces = new LinkedHashMap<>();
String curGraphic = null;
SurfaceDef curSurf = null;
while (reader.hasNext()) {
switch (reader.next()) {
case XMLStreamConstants.START_ELEMENT:
switch (reader.getLocalName()) {
case "graphic":
curGraphic = imageBase + reader.getAttributeValue(null, "url");
if (!graphicSurfaces.containsKey(curGraphic)) {
graphicSurfaces.put(curGraphic, new ArrayList<SurfaceDef>());
}
break;
case "surface":
curSurf = new SurfaceDef(reader);
break;
}
break;
case XMLStreamConstants.END_ELEMENT:
switch (reader.getLocalName()) {
case "surface":
List<SurfaceDef> curSurfaces = graphicSurfaces.get(curGraphic);
if (curSurfaces != null) {
curSurfaces.add(curSurf);
} else {
throw new XMLStreamException("XML input error: <surface> tag without matching <graphic>.");
}
break;
case "facsimile":
// We're done. Interpret the graphics we've encountered as canvasses.
for (Map.Entry<String, List<SurfaceDef>> entry: graphicSurfaces.entrySet()) {
Dimension canvSize = getCanvasSize(entry.getValue());
Canvas canv = new Canvas(manifest, canvSize.width, canvSize.height);
canv.setTitle(entry.getKey());
manifest.addCanvas(canv);
// The Petrus Plaoul files don't include image dimensions, so we'll go out
// on a limb and guess that they're the same size as the images.
canv.addImage(new Image(canv, new URI(entry.getKey()), Image.Format.fromExtension(entry.getKey()), canvSize.width, canvSize.height));
// Make sure the surfaces know which canvas they belong to.
for (SurfaceDef surf: entry.getValue()) {
surf.canvas = canv;
}
surfaces.addAll(entry.getValue());
}
return;
}
break;
}
}
} | [
"protected void visualizeCharacters(Document pdf, PdfDrawer drawer)\n throws PdfActVisualizeException {\n for (Paragraph paragraph : pdf.getParagraphs()) {\n // Ignore the paragraph if its role should not be extracted.\n if (!hasRelevantRole(paragraph)) {\n continue;\n }\n\n for (Word word : paragraph.getWords()) {\n if (word == null) {\n continue;\n }\n\n for (Character character : word.getCharacters()) {\n visualizeCharacter(character, drawer);\n }\n }\n }\n\n // try {\n // System.out.println(\"Visualize\");\n // Rectangle rect = this.rectangleFactory.create(323.2,881.3,328.7,886.8);\n // drawer.drawRectangle(rect, 1, Color.BLUE, Color.BLUE);\n // rect = this.rectangleFactory.create(323.2, 600, 328.7, 610);\n // drawer.drawRectangle(rect, 1, Color.BLUE, Color.BLUE);\n // } catch (Exception e) {\n // System.out.println(\"ERROR\");\n // }\n }",
"protected void visualizeParagraphs(Document pdf, PdfDrawer drawer)\n throws PdfActVisualizeException {\n // Visualize the textual elements.\n for (Paragraph paragraph : pdf.getParagraphs()) {\n // Ignore the paragraph if its role should not be extracted.\n if (!hasRelevantRole(paragraph)) {\n continue;\n }\n\n visualizeParagraph(paragraph, drawer);\n }\n }",
"private void extractFiguresFromAPage(ArrayList<TextPiece> linesOfAPage,\r\n\t ArrayList<TextPiece> wordsOfAPage, int i, File pdfFile,\r\n\t ArrayList<ArrayList<TextPiece>> linesByPage) {\r\n\tif (linesOfAPage.size() > 30) { // if this page is very short, it\r\n\t\t\t\t\t// usually does not contain tables\r\n\t /*\r\n\t * Checks for table keyword\r\n\t */\r\n\t boolean figureKwdExist = false;\r\n\t int prevTableEndIndex = 0;\r\n\t int k = -1;\r\n\t for (TextPiece t : linesOfAPage) {\r\n\t\tk++;\r\n\t\tString textWithoutSpace = t.getText().replace(\" \", \"\");\r\n\t\tTextPiece prevLine = (k == 0) ? null : linesOfAPage.get(k - 1);\r\n\t\tif (getMatchedFigureKeyword(textWithoutSpace) != null) {\r\n\t\t figureKwdExist = true;\r\n\t\t String figKwd = getMatchedFigureKeyword(textWithoutSpace);\r\n\t\t System.out.println(\"In page \" + (i + 1) + \": \"\r\n\t\t\t + textWithoutSpace);\r\n\t\t}\r\n\t }\r\n\t} else {\r\n\t /*\r\n\t * Impossible to contain tables because of few texts in the page\r\n\t */\r\n\t}\r\n }",
"public FigAssociation() {\r\n super();\r\n\r\n // let's use groups to construct the different text sections at\r\n // the association\r\n middleGroup.addFig(getNameFig());\r\n middleGroup.addFig(getStereotypeFig());\r\n addPathItem(middleGroup,\r\n new PathConvPercent2(this, middleGroup, 50, 25));\r\n\r\n srcMult = new FigText(10, 10, 90, 20);\r\n srcMult.setFont(getLabelFont());\r\n srcMult.setTextColor(Color.black);\r\n srcMult.setTextFilled(false);\r\n srcMult.setFilled(false);\r\n srcMult.setLineWidth(0);\r\n srcMult.setReturnAction(FigText.END_EDITING);\r\n srcMult.setJustification(FigText.JUSTIFY_CENTER);\r\n\r\n srcRole = new FigText(10, 10, 90, 20);\r\n srcRole.setFont(getLabelFont());\r\n srcRole.setTextColor(Color.black);\r\n srcRole.setTextFilled(false);\r\n srcRole.setFilled(false);\r\n srcRole.setLineWidth(0);\r\n srcRole.setReturnAction(FigText.END_EDITING);\r\n srcRole.setJustification(FigText.JUSTIFY_CENTER);\r\n\r\n srcOrdering = new FigText(10, 10, 90, 20);\r\n srcOrdering.setFont(getLabelFont());\r\n srcOrdering.setTextColor(Color.black);\r\n srcOrdering.setTextFilled(false);\r\n srcOrdering.setFilled(false);\r\n srcOrdering.setLineWidth(0);\r\n srcOrdering.setReturnAction(FigText.END_EDITING);\r\n srcOrdering.setJustification(FigText.JUSTIFY_CENTER);\r\n srcOrdering.setEditable(false); // parsing not (yet) implemented\r\n\r\n srcGroup.addFig(srcRole);\r\n srcGroup.addFig(srcOrdering);\r\n addPathItem(srcMult, new PathConvPercentPlusConst(this, 0, 15, 15));\r\n addPathItem(srcGroup, new PathConvPercentPlusConst(this, 0, 35, -15));\r\n\r\n destMult = new FigText(10, 10, 90, 20);\r\n destMult.setFont(getLabelFont());\r\n destMult.setTextColor(Color.black);\r\n destMult.setTextFilled(false);\r\n destMult.setFilled(false);\r\n destMult.setLineWidth(0);\r\n destMult.setReturnAction(FigText.END_EDITING);\r\n destMult.setJustification(FigText.JUSTIFY_CENTER);\r\n\r\n destRole = new FigText(0, 0, 90, 20);\r\n destRole.setFont(getLabelFont());\r\n destRole.setTextColor(Color.black);\r\n destRole.setTextFilled(false);\r\n destRole.setFilled(false);\r\n destRole.setLineWidth(0);\r\n destRole.setReturnAction(FigText.END_EDITING);\r\n destRole.setJustification(FigText.JUSTIFY_CENTER);\r\n\r\n destOrdering = new FigText(0, 0, 90, 20);\r\n destOrdering.setFont(getLabelFont());\r\n destOrdering.setTextColor(Color.black);\r\n destOrdering.setTextFilled(false);\r\n destOrdering.setFilled(false);\r\n destOrdering.setLineWidth(0);\r\n destOrdering.setReturnAction(FigText.END_EDITING);\r\n destOrdering.setJustification(FigText.JUSTIFY_CENTER);\r\n destOrdering.setEditable(false); // parsing not (yet) implemented\r\n\r\n destGroup.addFig(destRole);\r\n destGroup.addFig(destOrdering);\r\n addPathItem(destMult,\r\n\t\t new PathConvPercentPlusConst(this, 100, -15, 15));\r\n addPathItem(destGroup,\r\n\t\t new PathConvPercentPlusConst(this, 100, -35, -15));\r\n\r\n setBetweenNearestPoints(true);\r\n // next line necessary for loading\r\n setLayer(ProjectManager.getManager().getCurrentProject()\r\n\t\t .getActiveDiagram().getLayer());\r\n }",
"@Test\r\n\tpublic void ExtractSlideInfo()\r\n\t{\r\n\t\tPresentationParser parser = new PresentationParser();\r\n\t\tPresentationEntry presentation = new PresentationEntry();\t\t\r\n\t\tpresentation = parser.parsePresention(\"src/test_file.xml\", \"src\");\r\n\t\t\r\n\t\tSlideEntry currentSlide;\r\n\t\tTextEntry currentText;\r\n\t\tShapeEntry currentShape;\r\n\t\tVideoEntry currentVideo;\r\n\t\tImageEntry currentImage;\r\n\t\tPolygonEntry currentPolygon;\r\n\t\tAudioEntry currentAudio;\r\n\t\t\r\n\t\tcurrentSlide = presentation.getSlideList().get(0);\r\n\t\t\r\n\t\tassertEquals(0, currentSlide.getSlideID());\r\n\t\tassertEquals(5, currentSlide.getSlideDuration());\r\n\t\tassertEquals(2, currentSlide.getSlideNext());\r\n\t\tassertEquals(\"DDFFDD\", currentSlide.getSlideBackgroundColour());\r\n\t\t\r\n\t\tcurrentText = currentSlide.getTextList().get(0);\r\n\t\t\r\n\t\tassertEquals(0, currentText.getTextStartTime());\r\n\t\tassertEquals(-1, currentText.getTextDuration());\r\n\t\tassertEquals(0.1f, currentText.getTextXStart(), 0.0f);\r\n\t\tassertEquals(1, currentText.getTextYStart(), 0.0f);\r\n\t\tassertEquals(\"Impact\", currentText.getTextFont());\r\n\t\tassertEquals(30, currentText.getTextFontSize());\r\n\t\tassertEquals(\"000000\", currentText.getTextFontColour());\t\t\r\n\t\tassertEquals(\"I am so happy, the <b>Bold</b> text is finaly working. And so is the <i>Italic one</i>.\", currentText.getTextContent());\r\n\t\t\r\n\t\t// TODO BROKEN\r\n//\t\tassertEquals(true, currentText.getTextInteractable());\r\n\t\t\r\n\t\tassertEquals(43, currentText.getTextTargetSlide());\r\n\t\t\r\n\t\tcurrentShape = currentSlide.getShapeList().get(0);\r\n\t\t\r\n\t\tassertEquals(2, currentShape.getShapeStartTime());\r\n\t\tassertEquals(-1, currentShape.getShapeDuration());\r\n\t\tassertEquals(0.55f, currentShape.getShapeXStart(), 0.0f);\r\n\t\tassertEquals(0.6f, currentShape.getShapeYStart(), 0.0f);\r\n\t\tassertEquals(\"circle\", currentShape.getShapeType());\r\n\t\tassertEquals(0.4f, currentShape.getShapeWidth(), 0.0f);\r\n\t\tassertEquals(0.3f, currentShape.getShapeHeight(), 0.0f);\r\n\t\tassertEquals(\"FF0000\", currentShape.getShapeLineColour());\r\n\t\tassertEquals(\"225533\", currentShape.getShapeFillColour());\r\n\t\t\r\n\t\t// TODO BROKEN\r\n//\t\tassertEquals(false, currentShape.getShapeInteractable());\r\n\t\t\r\n\t\tassertEquals(-10, currentShape.getShapeTargetSlide());\r\n\t\tassertEquals(0.6f, currentShape.getShapeShadeX1(), 0.0f);\r\n\t\tassertEquals(0.9f, currentShape.getShapeShadeY1(), 0.0f);\r\n\t\tassertEquals(\"00FF00\", currentShape.getShapeShadeColour1());\r\n\t\tassertEquals(0.8f, currentShape.getShapeShadeX2(), 0.0f);\r\n\t\tassertEquals(0.65f, currentShape.getShapeShadeY2(), 0.0f);\r\n\t\tassertEquals(\"FF0000\", currentShape.getShapeShadeColour2());\r\n\t\t\r\n\t\tcurrentText = currentSlide.getTextList().get(1);\r\n\t\t\r\n\t\tassertEquals(3, currentText.getTextStartTime());\r\n\t\tassertEquals(1, currentText.getTextDuration());\r\n\t\tassertEquals(0.55f, currentText.getTextXStart(), 0.0f);\r\n\t\tassertEquals(0.55f, currentText.getTextYStart(), 0.0f);\r\n\t\tassertEquals(\"Arial\", currentText.getTextFont());\r\n\t\tassertEquals(12, currentText.getTextFontSize());\r\n\t\tassertEquals(\"000000\", currentText.getTextFontColour());\t\t\r\n\t\tassertEquals(\"Click <i>here</i> to show the module choices\", currentText.getTextContent());\r\n\t\t\r\n\t\t// TODO BROKEN\r\n//\t\tassertEquals(false, currentText.getTextInteractable());\r\n\t\t\r\n\t\tassertEquals(-10, currentText.getTextTargetSlide());\r\n\t\t\r\n\t\tcurrentSlide = presentation.getSlideList().get(1);\r\n\t\t\r\n\t\tassertEquals(1, currentSlide.getSlideID());\r\n\t\tassertEquals(-10, currentSlide.getSlideDuration());\r\n\t\tassertEquals(-10, currentSlide.getSlideNext());\r\n\t\tassertEquals(\"DDFFDD\", currentSlide.getSlideBackgroundColour());\r\n\t\t\r\n\t\tcurrentVideo = currentSlide.getVideoList().get(0);\r\n\t\t\r\n\t\tassertEquals(0, currentVideo.getVideoStartTime());\r\n\t\tassertEquals(-1, currentVideo.getVideoDuration());\r\n\t\tassertEquals(0.3f, currentVideo.getVideoXStart(), 0.0f);\r\n\t\tassertEquals(0.2f, currentVideo.getVideoYStart(), 0.0f);\r\n\t\tassertEquals(\"video\\\\Film.mp4\", currentVideo.getVideoSourceFile());\r\n\t\tassertEquals(true, currentVideo.getVideoLoop());\r\n\t\t\r\n\t\tcurrentSlide = presentation.getSlideList().get(2);\r\n\t\t\r\n\t\tassertEquals(2, currentSlide.getSlideID());\r\n\t\tassertEquals(-10, currentSlide.getSlideDuration());\r\n\t\tassertEquals(-10, currentSlide.getSlideNext());\r\n\t\tassertEquals(\"DDFFDD\", currentSlide.getSlideBackgroundColour());\r\n\t\t\r\n\t\tcurrentText = currentSlide.getTextList().get(0);\r\n\t\t\r\n\t\tassertEquals(0, currentText.getTextStartTime());\r\n\t\tassertEquals(-1, currentText.getTextDuration());\r\n\t\tassertEquals(0.3f, currentText.getTextXStart(), 0.0f);\r\n\t\tassertEquals(0.4f, currentText.getTextYStart(), 0.0f);\r\n\t\tassertEquals(\"Arial\", currentText.getTextFont());\r\n\t\tassertEquals(12, currentText.getTextFontSize());\r\n\t\tassertEquals(\"000000\", currentText.getTextFontColour());\t\t\r\n\t\tassertEquals(\"This Andy Marvin module was rated 5 stars!\", currentText.getTextContent());\r\n\r\n\t\tcurrentImage = currentSlide.getImageList().get(0);\r\n\t\t\r\n\t\tassertEquals(0, currentImage.getImageStartTime());\r\n\t\tassertEquals(\"imgs\\\\companyLogo.jpg\", currentImage.getImageSourceFile());\r\n\t\tassertEquals(-1, currentImage.getImageDuration());\r\n\t\tassertEquals(0.2f, currentImage.getImageXStart(), 0.0f);\r\n\t\tassertEquals(0.2f, currentImage.getImageYStart(), 0.0f);\r\n\t\tassertEquals(0.6f, currentImage.getImageWidth(), 0.0f);\r\n\t\tassertEquals(0.6f, currentImage.getImageHeight(), 0.0f);\r\n\t\t\r\n\t\tcurrentPolygon = currentSlide.getPolygonList().get(0);\r\n\t\t\r\n\t\tassertEquals(0, currentPolygon.getPolygonStartTime());\r\n\t\tassertEquals(\"starShape.csv\", currentPolygon.getPolygonSourceFile());\r\n\t\tassertEquals(-1, currentPolygon.getPolygonDuration());\r\n\t\tassertEquals(\"FF5500\", currentPolygon.getPolygonLineColour());\r\n\t\tassertEquals(\"007766\", currentPolygon.getPolygonFillColour());\r\n\t\tassertEquals(0.6f, currentPolygon.getPolygonShadeX1(), 0.0f);\r\n\t\tassertEquals(0.9f, currentPolygon.getPolygonShadeY1(), 0.0f);\r\n\t\tassertEquals(\"00FF00\", currentPolygon.getPolygonShadeColour1());\r\n\t\tassertEquals(0.8f, currentPolygon.getPolygonShadeX2(), 0.0f);\r\n\t\tassertEquals(0.65f, currentPolygon.getPolygonShadeY2(), 0.0f);\r\n\t\tassertEquals(\"FF0000\", currentPolygon.getPolygonShadeColour2());\r\n\t\t\r\n\t\tcurrentSlide = presentation.getSlideList().get(3);\r\n\t\t\r\n\t\tassertEquals(3, currentSlide.getSlideID());\r\n\t\tassertEquals(8, currentSlide.getSlideDuration());\r\n\t\tassertEquals(-1, currentSlide.getSlideNext());\r\n\t\tassertEquals(\"DDFFDD\", currentSlide.getSlideBackgroundColour());\r\n\t\t\r\n\t\tcurrentAudio = currentSlide.getAudioList().get(0);\r\n\t\t\r\n\t\tassertEquals(2, currentAudio.getAudioStartTime());\r\n\t\tassertEquals(6, currentAudio.getAudioDuration());\r\n\t\tassertEquals(\"ping.wav\", currentAudio.getAudioSourceFile());\r\n\t\tassertEquals(false, currentAudio.getAudioLoop());\r\n\t\t\r\n\t\tcurrentPolygon = currentSlide.getPolygonList().get(0);\r\n\t\t\r\n\t\tassertEquals(23, currentPolygon.getPolygonStartTime());\r\n\t\tassertEquals(\"iceShape.csv\", currentPolygon.getPolygonSourceFile());\r\n\t\tassertEquals(2, currentPolygon.getPolygonDuration());\r\n\t\tassertEquals(\"F5F6F7\", currentPolygon.getPolygonLineColour());\r\n\t\tassertEquals(\"696969\", currentPolygon.getPolygonFillColour());\r\n\t\tassertEquals(-10, currentPolygon.getPolygonShadeX1(), 0.0f);\r\n\t\tassertEquals(-10, currentPolygon.getPolygonShadeY1(), 0.0f);\r\n\t\tassertEquals(null, currentPolygon.getPolygonShadeColour1());\r\n\t\tassertEquals(-10, currentPolygon.getPolygonShadeX2(), 0.0f);\r\n\t\tassertEquals(-10, currentPolygon.getPolygonShadeY2(), 0.0f);\r\n\t\tassertEquals(null, currentPolygon.getPolygonShadeColour2());\r\n\t}",
"public void draw( AbstractCompoundFeature af ) {\n\n // Print local and global coordinates of anchor point ....\n\n double flatmatrix[] = new double[6];\n model.CompositeHierarchy.at.getMatrix( flatmatrix );\n double dGlobalX = flatmatrix[0]*af.getX() + flatmatrix[2]*af.getY() + flatmatrix[4];\n double dGlobalY = flatmatrix[1]*af.getX() + flatmatrix[3]*af.getY() + flatmatrix[5];\n\n if(DEBUG == true) {\n System.out.println(\"*** Enter PlanViewVisitor.draw( AbstractCompoundFeature af )...\");\n }\n\n // Highlight compound feature shape when \"cursor over shape\" ....\n\n if (af.getShapeActive() == false)\n g2D.setColor( af.getColor() );\n else \n g2D.setColor( Color.red );\n \n // ==================================================\n // Draw primitive feature items ordered by name ....\n // ==================================================\n\n TreeMap icopy = new TreeMap( af.items );\n Set st = icopy.keySet();\n Iterator itr = st.iterator();\n while (itr.hasNext()) {\n String key = (String) itr.next();\n Feature fm = (Feature) icopy.get(key);\n\n g2D.translate( fm.getX(), fm.getY() );\n\n if(fm instanceof model.primitive.Circle) {\n model.primitive.Circle c = (model.primitive.Circle) fm;\n CompoundShape ps = new CircleShape( (int) 0, (int) 0, (int) c.getRadius() );\n\n // Draw either a filled shape of shape boundary ...\n\n if (af.getFilledShape() == false)\n g2D.draw( ps.getPath() );\n else\n g2D.fill( ps.getPath() );\n }\n \n if(fm instanceof model.primitive.Arc) {\n model.primitive.Arc c = (model.primitive.Arc) fm;\n CompoundShape ps = new ArcShape( (int) 0, (int) 0, (int) c.getRadius(), (int) c.getstartA(), (int)c.getextA() );\n\n // Draw either a filled shape of shape boundary ...\n\n if (af.getFilledShape() == false)\n g2D.draw( ps.getPath() );\n else\n g2D.fill( ps.getPath() );\n }\n\n if(fm instanceof model.primitive.Point) {\n model.primitive.Point p = (model.primitive.Point) fm;\n CompoundShape ps = new PointShape( (int) (-p.getWidth()/2.0),\n (int) (-p.getHeight()/2.0),\n (int) p.getWidth(),\n (int) p.getHeight() );\n\n // Draw either a filled shape of shape boundary ...\n\n if (af.getFilledShape() == false)\n g2D.draw( ps.getPath() );\n else\n g2D.fill( ps.getPath() );\n }\n\n if(fm instanceof model.primitive.Edge) {\n model.primitive.Edge e = (model.primitive.Edge) fm;\n CompoundShape ps = new LineShape( e.getX1(), e.getY1(), e.getX2(), e.getY2(), e.getThickness() );\n\n // Draw either a filled shape of shape boundary ...\n\n if (af.getFilledShape() == false)\n g2D.draw( ps.getPath() );\n else\n g2D.fill( ps.getPath() );\n }\n\n if(fm instanceof model.primitive.SimplePolygon) {\n model.primitive.SimplePolygon sp = (model.primitive.SimplePolygon) fm;\n double x[] = sp.getXcoord();\n double y[] = sp.getYcoord();\n\n int xcoord[] = new int [ x.length ];\n int ycoord[] = new int [ y.length ];\n for (int i = 0; i < x.length; i = i + 1 ) {\n xcoord[i] = (int) x[i];\n ycoord[i] = (int) y[i];\n }\n\n CompoundShape ps = new PolygonShape( xcoord, ycoord );\n\n // Draw either a filled shape of shape boundary ...\n\n if (af.getFilledShape() == false)\n g2D.draw( ps.getPath() );\n else\n g2D.fill( ps.getPath() );\n }\n\n g2D.translate( -fm.getX(), -fm.getY() );\n }\n\n // Add label to shape ....\n\n g2D.translate( af.getX(), af.getY() );\n if (af.getName() != null && af.getDisplayName() == true && displayTag ) {\n g2D.translate( af.getTextOffSetX(), af.getTextOffSetY() );\n g2D.scale( 1, -1 );\n g2D.drawString( af.getName(), 0, 0 );\n g2D.scale( 1, -1 );\n g2D.translate( -af.getTextOffSetX(), -af.getTextOffSetY() );\n }\n\n g2D.translate( -af.getX(), -af.getY() );\n\n if(DEBUG == true) {\n System.out.printf(\"Name = %s\\n\", af.getName() );\n System.out.printf(\"Local (x,y) = ( %7.1f, %7.1f )\\n\", af.getX(), af.getY() );\n System.out.printf(\"Global (x,y) = ( %7.1f, %7.1f )\\n\", dGlobalX, dGlobalY );\n }\n }",
"private static XmlObject convertFeatureToFocalMechanismSection(\n final IQuakeMLEvent event) {\n final XmlObject result = XmlObject.Factory.newInstance();\n final XmlCursor cursor = result.newCursor();\n\n cursor.toFirstContentToken();\n\n cursor.beginElement(FOCAL_MECHANISM);\n final Optional<String> publicID = event.getFocalMechanismPublicID();\n publicID.ifPresent(new InsertAttributeWithText(cursor, PUBLIC_ID));\n\n cursor.beginElement(NODAL_PLANES);\n final Optional<String> preferredPlane =\n event.getFocalMechanismNodalPlanesPreferredNodalPlane();\n if (preferredPlane.isPresent()) {\n final String preferredPlaneValue = preferredPlane.get();\n final String preferredPlaneJustIntegerValue =\n removeNodalPlaneTextBefore(preferredPlaneValue);\n new InsertAttributeWithText(cursor, PREFERRED_PLANE)\n .accept(preferredPlaneJustIntegerValue);\n }\n\n\n\n cursor.beginElement(NODAL_PLANE_1);\n cursor.beginElement(STRIKE);\n\n final Optional<String> strikeValue =\n event.getFocalMechanismNodalPlanesNodalPlane1StrikeValue();\n strikeValue.ifPresent(new InsertElementWithText(cursor, VALUE));\n final String strikeUncertainty =\n event.getFocalMechanismNodalPlanesNodalPlane1StrikeUncertainty()\n .filter(QuakeMLValidatedXmlImpl::notNaN).orElse(NAN);\n new InsertElementWithText(cursor, UNCERTAINTY)\n .accept(strikeUncertainty);\n\n cursor.toNextToken();\n\n cursor.beginElement(DIP);\n final Optional<String> dipValue =\n event.getFocalMechanismNodalPlanesNodalPlane1DipValue();\n dipValue.ifPresent(new InsertElementWithText(cursor, VALUE));\n final String dipUncertainty =\n event.getFocalMechanismNodalPlanesNodalPlane1DipUncertainty()\n .filter(QuakeMLValidatedXmlImpl::notNaN).orElse(NAN);\n new InsertElementWithText(cursor, UNCERTAINTY).accept(dipUncertainty);\n\n cursor.toNextToken();\n\n cursor.beginElement(RAKE);\n final Optional<String> rakeValue =\n event.getFocalMechanismNodalPlanesNodalPlane1RakeValue();\n rakeValue.ifPresent(new InsertElementWithText(cursor, VALUE));\n final String rakeUncertainty =\n event.getFocalMechanismNodalPlanesNodalPlane1RakeUncertainty()\n .filter(QuakeMLValidatedXmlImpl::notNaN).orElse(NAN);\n new InsertElementWithText(cursor, UNCERTAINTY).accept(rakeUncertainty);\n\n cursor.toNextToken();\n\n cursor.toNextToken();\n\n cursor.dispose();\n\n return result;\n }",
"public ArrayList<ArrayList<String>> getSectionsInformation() {\n // If there is no composite medication information\n if (indiceCompositeMedication == -1){\n return null;\n }\n\n // Declare and Initialize variables\n ArrayList<ArrayList<String>> sections = new ArrayList<>();\n\n // Get information from third Child\n NodeList nList_sectionsFirstLevel = documentsEntrys.get(indiceCompositeMedication).getElementsByTagName(SECTION);\n\n // First level <section>\n for (int i = 0; i < nList_sectionsFirstLevel.getLength(); i++) {\n Element element_sectionFirstLevel = (Element) nList_sectionsFirstLevel.item(i);\n\n // Generate NodeList with second level <section><section>\n NodeList nodeList = element_sectionFirstLevel.getElementsByTagName(SECTION);\n\n\n // determinate if additional information exist. If it exist the last section will be hilarious\n int additionalInformation = 0;\n //if (indiceAdditionalNotes != -1) {\n // additionalInformation = 1;\n //}\n\n // Go through all sections\n for(int j = 0; j < (nodeList.getLength() - additionalInformation); j++) {\n // Initialize variables\n ArrayList<String> reference = new ArrayList<>();\n\n // Get Tags with 'title'\n Element elementTitle = (Element) nodeList.item(j);\n NodeList nList_title = elementTitle.getElementsByTagName(TITLE);\n if (nList_title.getLength() != 0){\n Element elementTitleTag = (Element) nList_title.item(0);\n reference.add(0, elementTitleTag.getAttribute(VALUE));\n } else {\n reference.add(0, EMPTYSTRING);\n }\n\n // Get Tags with 'reference'\n Element elementReference = (Element) nodeList.item(j);\n NodeList nList_reference = elementReference.getElementsByTagName(REFERENCE);\n // Go through all references\n for(int k = 0; k < nList_reference.getLength(); k++){\n Element elementReferenceTag = (Element) nList_reference.item(k);\n reference.add(k + 1, elementReferenceTag.getAttribute(VALUE));\n }\n\n // Get free text with tag 'display'\n Element elementText = (Element) nodeList.item(j);\n NodeList nList_text = elementText.getElementsByTagName(\"div\");\n\n if(nList_text.getLength() != 0) {\n String freeText = nList_text.item(0).getTextContent();\n reference.add(nList_reference.getLength() + 1, freeText);\n }\n\n sections.add(reference);\n }\n }\n\n return sections;\n }",
"public void visualiserPartie(){\n \n }",
"protected void buildPage() {\n // lay out page 2\n String pattern = getGroupText();\n \n // parse file pattern\n fp = new FilePattern(pattern);\n if (!fp.isValid()) {\n SwingUtil.setWaitCursor(dialog, false);\n enableButtons();\n JOptionPane.showMessageDialog(dialog, fp.getErrorMessage(),\n \"VisBio\", JOptionPane.ERROR_MESSAGE);\n return;\n }\n int index = pattern.lastIndexOf(File.separator);\n String path = index < 0 ? \"\" : pattern.substring(0, index);\n pattern = pattern.substring(index + 1);\n \n // guess at a good name for the dataset\n String prefix = fp.getPrefix();\n \n // strip off endings, if any, from name\n int tLen = T_CODES.length, zLen = Z_CODES.length, cLen = C_CODES.length;\n String[] endings = new String[tLen + zLen + cLen];\n System.arraycopy(T_CODES, 0, endings, 0, tLen);\n System.arraycopy(Z_CODES, 0, endings, tLen, zLen);\n System.arraycopy(C_CODES, 0, endings, tLen + zLen, cLen);\n prefix = strip(prefix, endings);\n \n // display image onscreen\n nameField.setText(prefix.equals(\"\") ? \"data\" + ++nameId : prefix);\n \n // check for matching files\n BigInteger[] min = fp.getFirst();\n BigInteger[] max = fp.getLast();\n BigInteger[] step = fp.getStep();\n ids = fp.getFiles();\n if (ids.length < 1) {\n SwingUtil.setWaitCursor(dialog, false);\n enableButtons();\n JOptionPane.showMessageDialog(dialog, \"No files match the pattern.\",\n \"VisBio\", JOptionPane.ERROR_MESSAGE);\n return;\n }\n int blocks = min.length;\n \n // check that pattern is not empty\n if (ids[0].trim().equals(\"\")) {\n SwingUtil.setWaitCursor(dialog, false);\n enableButtons();\n JOptionPane.showMessageDialog(dialog, \"Please enter a file pattern, \" +\n \"or click \\\"Select file\\\" to choose a file.\", \"VisBio\",\n JOptionPane.INFORMATION_MESSAGE);\n return;\n }\n \n // check that first file really exists\n File file = new File(ids[0]);\n String filename = \"\\\"\" + file.getName() + \"\\\"\";\n if (!file.exists()) {\n SwingUtil.setWaitCursor(dialog, false);\n enableButtons();\n JOptionPane.showMessageDialog(dialog, \"File \" + filename +\n \" does not exist.\", \"VisBio\", JOptionPane.ERROR_MESSAGE);\n return;\n }\n \n // get number of images and OME-XML metadata from the first file\n int numImages = 0;\n ImageReader reader = new ImageReader();\n OMEXMLMetadataStore store = new OMEXMLMetadataStore();\n reader.setMetadataStore(store);\n try {\n reader.setId(ids[0]);\n numImages = reader.getImageCount();\n }\n catch (IOException exc) {\n if (VisBioFrame.DEBUG) exc.printStackTrace();\n }\n catch (FormatException exc) {\n if (VisBioFrame.DEBUG) exc.printStackTrace();\n }\n if (numImages < 1) {\n SwingUtil.setWaitCursor(dialog, false);\n enableButtons();\n JOptionPane.showMessageDialog(dialog,\n \"Cannot determine number of images per file.\\n\" + filename +\n \" may be corrupt or invalid.\", \"VisBio\", JOptionPane.ERROR_MESSAGE);\n return;\n }\n \n // get physical pixel sizes (if any)\n Float pixX = store.getPixelSizeX(null);\n Float pixY = store.getPixelSizeY(null);\n Float pixZ = store.getPixelSizeZ(null);\n \n // get dimensional axis lengths\n int sizeX = reader.getSizeX();\n int sizeY = reader.getSizeY();\n int sizeZ = reader.getSizeZ();\n int sizeT = reader.getSizeT();\n int sizeC = reader.getSizeC();\n String dimOrder = reader.getDimensionOrder();\n \n // autodetect dimensional types\n String[] kind = new String[blocks];\n int other = 1;\n boolean timeOk = true, sliceOk = true, channelOk = true, otherOk = true;\n for (int i=0; i<blocks; i++) {\n String p = fp.getPrefix(i).toLowerCase();\n \n // look for labels indicating dimensional type\n if (sliceOk && p.endsWith(\"focalplane\")) {\n kind[i] = \"Slice\";\n sliceOk = false;\n continue;\n }\n \n // strip off trailing non-letters\n int q;\n char[] c = p.toCharArray();\n for (q=c.length; q>0; q--) if (c[q-1] >= 'a' && c[q-1] <= 'z') break;\n p = p.substring(0, q);\n \n // strip off leading letters\n c = p.toCharArray();\n for (q=c.length; q>0; q--) if (c[q-1] < 'a' || c[q-1] > 'z') break;\n p = p.substring(q);\n \n // look for short letter code indicating dimensional type\n if (timeOk && isElement(p, T_CODES)) {\n kind[i] = \"Time\";\n timeOk = false;\n }\n else if (sliceOk && isElement(p, Z_CODES)) {\n kind[i] = \"Slice\";\n sliceOk = false;\n }\n else if (channelOk && isElement(p, C_CODES)) {\n kind[i] = \"Channel\";\n channelOk = false;\n }\n else if (timeOk) {\n kind[i] = \"Time\";\n timeOk = false;\n }\n else if (sliceOk) {\n kind[i] = \"Slice\";\n sliceOk = false;\n }\n else if (channelOk) {\n kind[i] = \"Channel\";\n channelOk = false;\n }\n else if (otherOk) {\n kind[i] = \"Other\";\n otherOk = false;\n }\n else kind[i] = \"Other\" + ++other;\n }\n if (timeOk) dimBox.setSelectedIndex(0);\n else if (sliceOk) dimBox.setSelectedIndex(1);\n else if (channelOk) dimBox.setSelectedIndex(2);\n else if (otherOk) dimBox.setSelectedItem(\"Other\");\n else dimBox.setSelectedItem(\"Other\" + ++other);\n \n // construct dimensional widgets\n widgets = new BioComboBox[blocks];\n for (int i=0; i<blocks; i++) {\n widgets[i] = new BioComboBox(DIM_TYPES);\n widgets[i].setEditable(true);\n widgets[i].setSelectedItem(kind[i]);\n }\n \n // HACK - ignore buggy dimensional axis counts\n if (sizeZ * sizeT * sizeC != numImages) dimOrder = null;\n \n // lay out dimensions panel\n JPanel dimPanel = null;\n boolean multiFiles = dimOrder != null &&\n (sizeZ > 1 || sizeT > 1 || sizeC > 1);\n if (multiFiles || numImages > 1 || blocks > 0) {\n StringBuffer sb = new StringBuffer(\"pref\");\n if (multiFiles) {\n if (sizeZ > 1) sb.append(\", 3dlu, pref\");\n if (sizeT > 1) sb.append(\", 3dlu, pref\");\n if (sizeC > 1) sb.append(\", 3dlu, pref\");\n }\n else if (numImages > 1) sb.append(\", 3dlu, pref\");\n for (int i=0; i<blocks; i++) sb.append(\", 3dlu, pref\");\n sb.append(\", 9dlu\");\n PanelBuilder builder = new PanelBuilder(new FormLayout(\n \"pref, 12dlu, pref, 12dlu, pref:grow\", sb.toString()));\n CellConstraints cc = new CellConstraints();\n builder.addSeparator(\"Dimensions\", cc.xyw(1, 1, 5));\n int count = 0;\n if (multiFiles) {\n StringBuffer dimCross = new StringBuffer();\n for (int i=2; i<5; i++) {\n char c = dimOrder.charAt(i);\n switch (c) {\n case 'Z':\n if (sizeZ > 1) {\n int y = 2 * count + 3;\n builder.addLabel((count + 1) + \".\",\n cc.xy(1, y, \"right, center\"));\n builder.addLabel(\"Slice\", cc.xy(3, y, \"left, center\"));\n builder.addLabel(sizeZ + \" focal planes per file\",\n cc.xy(5, y, \"left, center\"));\n if (dimCross.length() > 0) dimCross.append(\" x \");\n dimCross.append(\"Slice\");\n count++;\n }\n break;\n case 'T':\n if (sizeT > 1) {\n int y = 2 * count + 3;\n builder.addLabel((count + 1) + \".\",\n cc.xy(1, y, \"right, center\"));\n builder.addLabel(\"Time\", cc.xy(3, y, \"left, center\"));\n builder.addLabel(sizeT + \" time points per file\",\n cc.xy(5, y, \"left, center\"));\n if (dimCross.length() > 0) dimCross.append(\" x \");\n dimCross.append(\"Time\");\n count++;\n }\n break;\n case 'C':\n if (sizeC > 1) {\n int y = 2 * count + 3;\n builder.addLabel((count + 1) + \".\",\n cc.xy(1, y, \"right, center\"));\n builder.addLabel(\"Channel\", cc.xy(3, y, \"left, center\"));\n builder.addLabel(sizeC + \" pixel channels per file\",\n cc.xy(5, y, \"left, center\"));\n if (dimCross.length() > 0) dimCross.append(\" x \");\n dimCross.append(\"Channel\");\n count++;\n }\n break;\n }\n }\n dimBox.setEnabled(true);\n dimBox.setSelectedItem(dimCross.toString());\n }\n else if (numImages > 1) {\n String num = (count + 1) + \".\";\n if (count < 9) num = \"&\" + num;\n int y = 2 * count + 3;\n builder.addLabel(num,\n cc.xy(1, y, \"right, center\")).setLabelFor(dimBox);\n dimBox.setEnabled(true);\n builder.add(dimBox, cc.xy(3, y, \"left, center\"));\n builder.addLabel(numImages + \" images per file\",\n cc.xy(5, y, \"left, center\"));\n count++;\n }\n else dimBox.setEnabled(false);\n for (int i=0; i<blocks; i++) {\n String num = (count + 1) + \".\";\n if (count < 9) num = \"&\" + num;\n int y = 2 * count + 3;\n builder.addLabel(num,\n cc.xy(1, y, \"right, center\")).setLabelFor(widgets[i]);\n builder.add(widgets[i], cc.xy(3, y, \"left, center\"));\n builder.addLabel(fp.getBlock(i), cc.xy(5, y, \"left, center\"));\n count++;\n }\n dimPanel = builder.getPanel();\n }\n else dimBox.setEnabled(false);\n \n // lay out widget panel\n StringBuffer sb = new StringBuffer();\n sb.append(\"pref, 3dlu, pref, 3dlu, pref, 3dlu, pref\");\n if (dimPanel != null) sb.append(\", 9dlu, pref\");\n \n PanelBuilder builder = new PanelBuilder(new FormLayout(\n \"pref, 3dlu, pref:grow\", sb.toString()));\n CellConstraints cc = new CellConstraints();\n JLabel pathLabel = new JLabel(\"Directory\");\n pathLabel.setFont(pathLabel.getFont().deriveFont(Font.BOLD));\n builder.add(pathLabel, cc.xy(1, 1, \"right, center\"));\n builder.addLabel(path, cc.xy(3, 1, \"left, center\"));\n JLabel patternLabel = new JLabel(\"File pattern\");\n patternLabel.setFont(patternLabel.getFont().deriveFont(Font.BOLD));\n builder.add(patternLabel, cc.xy(1, 3, \"right, center\"));\n builder.addLabel(pattern, cc.xy(3, 3, \"left, center\"));\n JLabel nameLabel = new JLabel(\"Dataset name\");\n nameLabel.setFont(nameLabel.getFont().deriveFont(Font.BOLD));\n nameLabel.setDisplayedMnemonic('n');\n nameLabel.setLabelFor(nameField);\n builder.add(nameLabel, cc.xy(1, 5, \"right, center\"));\n builder.add(nameField, cc.xy(3, 5));\n builder.add(micronPanel, cc.xyw(1, 7, 3));\n if (dimPanel != null) builder.add(dimPanel, cc.xyw(1, 9, 3));\n \n second.removeAll();\n second.add(builder.getPanel());\n \n // populate micron information\n float mx = pixX == null ? Float.NaN : sizeX * pixX.floatValue();\n float my = pixY == null ? Float.NaN : sizeY * pixY.floatValue();\n float mz = pixZ == null ? Float.NaN : pixZ.floatValue();\n micronWidth.setText(mx == mx ? \"\" + mx : \"\");\n micronHeight.setText(my == my ? \"\" + my : \"\");\n micronStep.setText(mz == mz ? \"\" + mz : \"\");\n boolean enabled = mx == mx || my == my || mz == mz;\n useMicrons.setSelected(enabled);\n toggleMicronPanel(enabled);\n \n Util.invoke(false, new Runnable() {\n public void run() {\n setPage(1);\n repack();\n SwingUtil.setWaitCursor(dialog, false);\n enableButtons();\n }\n });\n }",
"@Override\n public void renderShapeToScreen(){\n Iterator i=shapeParts.iterator();\n while(i.hasNext()){\n Shape shape=(Shape) i.next();\n shape.renderShapeToScreen(); \n }\n }",
"void separateOut() {\n for (int i = 0; i < files.size(); i++) {\n Process p;\n String line;\n try {\n if (files.get(i).startsWith(\"pdf\")) {\n String[] images = files.get(i).split(\"\\n\");\n if (outputType.equals(\"Text\")) {\n FileWriter writer = new FileWriter(outputDir\n + flist.get(i).getName().substring(0,\n flist.get(i).getName().lastIndexOf(\".\")) + \".txt\", false);\n BufferedWriter bWriter = new BufferedWriter(writer);\n for (int j = 1; j < images.length; j++) {\n p = Runtime.getRuntime().exec(SCRIPT + images[j]);\n BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream()));\n while ((line = r.readLine()) != null) {\n bWriter.write(line);\n bWriter.newLine();\n //textArea.setText(textArea.getText() + line + \"\\n\");\n }\n }\n bWriter.close();\n } else if (outputType.equals(\"PDF\")) {\n PDDocument document = new PDDocument();\n for (int j = 1; j < images.length; j++) {\n PDPage page = new PDPage();\n document.addPage(page);\n PDPageContentStream contentStream = new PDPageContentStream(document, page);\n contentStream.beginText();\n contentStream.setFont(PDType1Font.TIMES_ROMAN, 12);\n contentStream.setLeading(14.5f);\n contentStream.newLineAtOffset(25, 700);\n p = Runtime.getRuntime().exec(SCRIPT + images[j]);\n BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream()));\n while ((line = r.readLine()) != null) {\n contentStream.showText(line);\n contentStream.newLine();\n //textArea.setText(textArea.getText() + line + \"\\n\");\n }\n contentStream.endText();\n contentStream.close();\n }\n document.save(outputDir + flist.get(i).getName().substring(0,\n flist.get(i).getName().lastIndexOf(\".\")) + \".pdf\");\n document.close();\n }\n //cleanTempImages(images);\n } else if (files.get(i).startsWith(\"err\")) {\n System.out.println(\"Error with reading pdf.\");\n //cleanTempImages(files.get(i).split(\"\\n\"));\n } else {\n p = Runtime.getRuntime().exec(SCRIPT + files.get(i));\n BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream()));\n if (outputType.equals(\"Text\")) {\n FileWriter writer = new FileWriter(outputDir + flist.get(i).getName().substring(0,\n flist.get(i).getName().lastIndexOf(\".\")) + \".txt\", false);\n BufferedWriter bWriter = new BufferedWriter(writer);\n while ((line = r.readLine()) != null) {\n bWriter.write(line);\n bWriter.newLine();\n //textArea.setText(textArea.getText() + line + \"\\n\");\n }\n bWriter.close();\n } else if (outputType.equals(\"PDF\")) {\n PDDocument document = new PDDocument();\n PDPage page = new PDPage();\n document.addPage(page);\n PDPageContentStream contentStream = new PDPageContentStream(document, page);\n contentStream.beginText();\n contentStream.setFont(PDType1Font.TIMES_ROMAN, 12);\n contentStream.setLeading(14.5f);\n contentStream.newLineAtOffset(25, 700);\n while ((line = r.readLine()) != null) {\n contentStream.showText(line);\n contentStream.newLine();\n //textArea.setText(textArea.getText() + line + \"\\n\");\n }\n contentStream.endText();\n contentStream.close();\n document.save(outputDir + flist.get(i).getName().substring(0,\n flist.get(i).getName().lastIndexOf(\".\")) + \".pdf\");\n document.close();\n }\n }\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n }\n }",
"static void drawText(PDDocument document, PDPage page, PDRectangle box, PDFont font, Color color, String[] lines, ALIGNMENT alignment, ROTATION rotation, float fontLeading, float fontSize, boolean autoScale, boolean drawBoundingBox) throws IOException {\n\n\n /* Prepare the content stream */\n PDPageContentStream stream = new PDPageContentStream(document, page, true, true);\n\n\n /* Define the working boundary for the text being inserted */\n float boundaryX = box.getLowerLeftX();\n float boundaryY = box.getUpperRightY();\n float boundaryWidth = box.getUpperRightX() - box.getLowerLeftX();\n float boundaryHeight = box.getUpperRightY() - box.getLowerLeftY();\n\n /* Define font attributes */\n if (fontSize <= 0)\n fontSize = 12.0f;\n\n stream.setFont(font, fontSize);\n\n if (fontLeading > 0)\n stream.setLeading(fontLeading);\n\n /* Get the size of the page in printer DPI */\n PDRectangle pageSize = page.getMediaBox();\n float pageWidth = pageSize.getWidth();\n float pageHeight = pageSize.getHeight();\n\n /* Draw the outline of the bounding box */\n if (drawBoundingBox == true) {\n stream.setNonStrokingColor(Color.BLUE);\n stream.addRect(box.getLowerLeftX(), box.getLowerLeftY(), box.getWidth(), box.getHeight());\n stream.fill();\n stream.setNonStrokingColor(Color.WHITE);\n stream.addRect(box.getLowerLeftX() + 1, box.getLowerLeftY() + 1, box.getWidth() - 2, box.getHeight() - 2);\n stream.fill();\n }\n\n\n /* Enter into text drawing mode */\n stream.beginText();\n stream.setNonStrokingColor(color);\n\n /* Create a TextMatrix object */\n // The text matrix allows drawing text normally without consideration for where it is located,\n // how big it is, or what direction it is facing\n Matrix matrix = new Matrix();\n\n /* Determine the value to scale the text to fit the boundary box, taking into account optional rotation */\n\n // Get the widths of each line\n float[] lineWidths = new float[lines.length];\n for (int i = 0; i < (lines.length); i++) {\n lineWidths[i] = font.getStringWidth(lines[i])/1000f*fontSize;\n }\n\n // Get the width of the longest line\n Arrays.sort(lineWidths);\n float maxlineWidth = lineWidths[(lines.length-1)];\n\n // Calculate autoScaleFactor based on the type of rotation\n float autoScaleFactor = 1.0f;\n if (rotation == ROTATION.RIGHT) {\n //The boundaryWidth and boundaryHeight variables are swapped for the rotate right and left cases\n\n // Calculate the scale factor to fit the longest line in the bounding box\n float fitWidthScaleFactor = boundaryHeight / maxlineWidth;\n\n // Determine the value to scale the combined height of text to fit the boundary box\n float fitHeightScaleFactor = boundaryWidth / (lines.length*fontLeading);\n\n // Go with the smaller of the calculated width and height scale values\n if (fitHeightScaleFactor < fitWidthScaleFactor)\n autoScaleFactor = fitHeightScaleFactor;\n else\n autoScaleFactor = fitWidthScaleFactor;\n\n matrix.translate(boundaryX+boundaryWidth, boundaryY);\n matrix.rotate(-Math.PI/2);\n } else if (rotation == ROTATION.LEFT){\n //The boundaryWidth and boundaryHeight variables are swapped for the rotate right and left cases\n\n // Calculate the scale factor to fit the longest line in the bounding box\n float fitWidthScaleFactor = boundaryHeight / maxlineWidth;\n\n // Determine the value to scale the combined height of text to fit the boundary box\n float fitHeightScaleFactor = boundaryWidth / (lines.length*fontLeading);\n\n // Go with the smaller of the calculated width and height scale values\n if (fitHeightScaleFactor < fitWidthScaleFactor)\n autoScaleFactor = fitHeightScaleFactor;\n else\n autoScaleFactor = fitWidthScaleFactor;\n\n matrix.translate(boundaryX,boundaryY-boundaryHeight);\n matrix.rotate(Math.PI/2);\n } else {\n // Calculate the scale factor to fit the longest line in the bounding box\n float fitWidthScaleFactor = boundaryWidth / maxlineWidth;\n\n // Determine the value to scale the combined height of text to fit the boundary box\n float fitHeightScaleFactor = boundaryHeight / (lines.length*fontLeading);\n\n // Go with the smaller of the calculated width and height scale values\n if (fitHeightScaleFactor < fitWidthScaleFactor)\n autoScaleFactor = fitHeightScaleFactor;\n else\n autoScaleFactor = fitWidthScaleFactor;\n\n // Determine the Y offset for the starting point of the text\n float textYOffset = 0.0f;\n if (autoScaleFactor == fitWidthScaleFactor)\n textYOffset = (boundaryHeight-(lines.length)*fontSize)/2;\n else {\n if (autoScale)\n textYOffset = (fontLeading - fontSize) * lines.length / 2;\n else\n textYOffset = 0.0f;\n }\n matrix.translate(boundaryX,boundaryY-textYOffset);\n }\n\n\n /* Scale the text if desired */\n if (autoScale)\n matrix.scale(autoScaleFactor,autoScaleFactor);\n else\n autoScaleFactor = 1.0f;\n\n\n /* Apply the text matrix to the content stream */\n stream.setTextMatrix(matrix);\n\n\n /* Draw the lines of text */\n for (int i = 0; i < lines.length; i++)\n {\n // Default the line offset to zero for ALIGNMENT.LEFT and adjust for other types of alignment\n float lineOffset = 0f;\n\n if (alignment == ALIGNMENT.CENTER) {\n if (rotation == ROTATION.RIGHT || rotation == ROTATION.LEFT)\n lineOffset = (boundaryHeight / autoScaleFactor / 2) - (font.getStringWidth(lines[i]) / 1000f * fontSize / 2);\n if (rotation == ROTATION.NONE)\n lineOffset = (boundaryWidth / autoScaleFactor / 2) - (font.getStringWidth(lines[i]) / 1000f * fontSize / 2);\n }\n\n if (alignment == ALIGNMENT.RIGHT) {\n if (rotation == ROTATION.RIGHT || rotation == ROTATION.LEFT)\n lineOffset = (boundaryHeight / autoScaleFactor) - (font.getStringWidth(lines[i]) / 1000f * fontSize);\n if (rotation == ROTATION.NONE)\n lineOffset = (boundaryWidth / autoScaleFactor) - (font.getStringWidth(lines[i]) / 1000f * fontSize);\n }\n\n // Move the cursor to the appropriate new location relative to its current old location\n stream.newLineAtOffset(lineOffset, -fontLeading);\n\n // Draw the text\n stream.showText(lines[i]);\n\n // Reset the cursor to a predictable state for the next loop iteration\n stream.moveTextPositionByAmount(-lineOffset,0);\n }\n\n\n stream.endText();\n stream.close();\n }",
"@Override\n\t\tpublic void run() {\n\t\t\tGraphics2D g2 = ((BufferedImage) image).createGraphics();\n\t\t\tg2.setColor(Color.LIGHT_GRAY);\n\t\t\tg2.fillRect(0, 0, image.getWidth(null), image.getHeight(null));\n\t\t\tfor (model.AbstractInsect a : spField.getList()) {\n\t\t\t\tg2.drawImage(a.getImage(), a.getPosx()-a.getImage().getWidth(null)/2, a.getPosy()-a.getImage().getHeight(null)/2, null);\n\t\t\t}\n\t\t\tg2.dispose();\t\t\t\n\t\t\trepaint();\n\t\t\t\n\t\t}",
"private void split( Document doc, Element elem ) throws Exception\n {\n Node child = elem.getFirstChild();\n // the TEI element of each poem\n Element tei = null;\n // the text node of each XML poem\n Element text = null;\n String title = null;\n String hVersion = null;\n String hWork = null;\n while ( child != null )\n {\n if ( child.getNodeType()==Node.COMMENT_NODE \n && child.getTextContent().trim().startsWith(\"***\") )\n {\n if ( tei != null&&title!=null&&hWork !=null&&hVersion!=null )\n {\n String srcName = src.getName();\n if ( hWork != null && works.containsKey(hWork) )\n title = works.get( hWork );\n addPoem(title,srcName,hWork,hVersion,tei); \n hVersion = hWork = null;\n }\n tei = doc.createElement(\"TEI\");\n Element body = doc.createElement(\"body\");\n tei.appendChild( body );\n text = doc.createElement(\"text\");\n body.appendChild( text );\n String content = child.getTextContent().substring(4).trim();\n content = content.replace(\"/\",\"_\");\n title = normaliseName( content );\n }\n else if ( text != null )\n {\n Node clone = child.cloneNode(true);\n if ( clone.getNodeType()==Node.ELEMENT_NODE )\n {\n if ( clone.getNodeName().equals(\"div\") )\n {\n String type = ((Element)clone).getAttribute(\"type\");\n String attr = ((Element)clone).getAttribute(\"xml:id\");\n if ( type != null && type.toLowerCase().equals(\"hversion\") \n && attr != null && attr.startsWith(\"H\") )\n {\n hVersion = attr;\n hWork = hGetWork( hVersion );\n }\n String desc = extractDescription( clone );\n if ( desc != null )\n {\n String sName = simpleName(src.getName());\n Anthology anth = anthologies.get(sName);\n if ( anth != null )\n {\n if ( !anth.descriptionSet() )\n anth.setDescription( desc );\n if ( !anth.titleSet() )\n anth.setTitle( sName );\n if ( !versions.containsKey(sName) )\n versions.addVersion( sName, desc );\n }\n }\n }\n }\n text.appendChild( clone );\n }\n else if ( child.getNodeType()==Node.ELEMENT_NODE )\n {\n Element e = (Element) child;\n String name = e.getNodeName();\n if ( name.equals(\"body\")||name.equals(\"text\") )\n {\n child = e.getFirstChild();\n continue;\n }\n }\n child = child.getNextSibling();\n }\n if ( tei != null&&title!=null )\n {\n String srcName = src.getName();\n if ( hWork != null && works.containsKey(hWork) )\n title = works.get( hWork );\n addPoem(title,srcName,hWork,hVersion,tei); \n }\n }",
"@Override\n public void exitSection(BodyParser.SectionContext ctx) {\n List<SectionElement> elements = new ArrayList<>();\n List<VoicePartElement> voicePartElements = new ArrayList<>();\n //for (BodyParser.VoicepartelementContext s : ctx.voicepartelement()) {\n Map<Voice, List<VoicePartElement>> sortedVoiceParts = new HashMap<>();\n List<Voice> voices = new ArrayList<>();\n //if the section contains voiceparts, add them to sortedVoiceParts\n if (ctx.voicepart() != null) {\n for (BodyParser.VoicepartContext vpc : ctx.voicepart()) {\n assert stack.peek().getType().equals(Music.Components.VOICEPART);\n VoicePart voicePart = (VoicePart) stack.pop();\n if (!voices.contains(voicePart.getVoice())) {\n voices.add(voicePart.getVoice());\n sortedVoiceParts.put(voicePart.getVoice(), new ArrayList<>());\n }\n sortedVoiceParts.get(voicePart.getVoice()).addAll(voicePart.getElements());\n }\n }\n //if the section contains voicepartelements (rather than voiceparts), add them to elements\n if (ctx.sectionelement() != null && !ctx.sectionelement().isEmpty()) {\n for (BodyParser.SectionelementContext sec : ctx.sectionelement()) {\n for (BodyParser.VoicepartelementContext vpec : sec.voicepartelement()) {\n assert (stack.peek().getType().equals(Music.Components.LINE) || stack.peek().getType().equals\n (Music.Components.REPEAT) || stack.peek().getType().equals(Music.Components\n .PARTIALREPEAT));\n VoicePartElement element = (VoicePartElement) stack.pop();\n voicePartElements.add(0, element);\n }\n }\n elements.addAll(simplifyVoicePartElements(voicePartElements));\n }\n //either all elements should be VoiceParts or all elements should be VoicePartElements in a given Section\n assert (sortedVoiceParts.isEmpty() || elements.isEmpty());\n if (!sortedVoiceParts.isEmpty()) {\n for (Voice v : voices) {\n elements.add(0, new VoicePart(v, simplifyVoicePartElements(sortedVoiceParts.get(v))));\n }\n }\n //}\n stack.push(new Section(elements));\n }",
"protected void visualizeTextAreas(Document pdf, PdfDrawer drawer)\n throws PdfActVisualizeException {\n for (Page page : pdf.getPages()) {\n for (TextArea area : page.getTextAreas()) {\n visualizeTextArea(area, drawer);\n }\n }\n }",
"void ReadFiducials(Sequence seq) {\n\t\tthis.sequence=seq;\n\t\tArrayList<ROI> listfiducials = seq.getROIs();\n\n\t\tfiducials = new double[listfiducials.size()][3];\n\t\t// fiducials=new double[10][3];\n\t\tint i = -1;\n\t\tfor (ROI roi : listfiducials) {\n\n\t\t\t// if (roi instanceof ROI3DArea) //ROID2D marche pas\n\t\t\t// {\n\t\t\t// i++;\n\t\t\t// Point5D p3D=new ROIUtil().getMassCenter(roi);\n\t\t\t// //if nan (mass center point ne pas rajouter\n\t\t\t// fiducials[i][0]=p3D.getX();\n\t\t\t// fiducials[i][1]=p3D.getY();\n\t\t\t// // Attendre le feu vert Stephane dans prochaine version ICY >\n\t\t\t// 1.5.0\n\t\t\t// fiducials[i][2]=p3D.getZ()-roi.getPosition5D().getZ();\n\t\t\t// }\n\t\t\t// else//if (roi instanceof ROI3DArea) ROID2D marche pas\n\t\t\t// {\n\t\t\ti++;\n\n\t\t\tPoint5D p3D = ROIMassCenterDescriptorsPlugin.computeMassCenter(roi);\n\t\t\tif (roi.getClassName() == \"plugins.kernel.roi.roi3d.ROI3DPoint\")\n\t\t\t\tp3D = roi.getPosition5D();\n\t\t\tif (Double.isNaN(p3D.getX()))\n\t\t\t\tp3D = roi.getPosition5D(); // some Roi does not have gravity\n\t\t\t\t\t\t\t\t\t\t\t// center such as points\n\t\t\tfiducials[i][0] = p3D.getX()*seq.getPixelSizeX()*1000;// in nm\n\t\t\tfiducials[i][1] = p3D.getY()*seq.getPixelSizeY()*1000;\n\n\t\t\tfiducials[i][2] = p3D.getZ()*seq.getPixelSizeZ()*1000;\n\t\t\t// }\n\n\t\t}\n\t}",
"public void createCompositionSheet() {\n Line staffLine;\n for(int i=0; i<127; i++) {\n staffLine = new Line(0,i*10,2000,i*10);\n this.composition.getChildren().add(staffLine);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates an attribute of the given qualified name and namespace URI. Per [XML Namespaces], applications must use the value null as the namespaceURI parameter for methods if they wish to have no namespace. | @DOMSupport(DomLevel.TWO)
@BrowserSupport({BrowserType.FIREFOX_2P, BrowserType.OPERA_9P})
@Function Attr createAttributeNS(String namespaceURI, String qualifiedName); | [
"public Attr createAttributeNS(String namespaceURI, \n String qualifiedName)\n throws DOMException;",
"public XmlAttribute CreateAttribute( String qualifiedName, String namespaceURI ) { \r\n String prefix = String.Empty;\r\n String localName = String.Empty; \r\n \r\n SplitName( qualifiedName, out prefix, out localName );\r\n return CreateAttribute( prefix, localName, namespaceURI ); \r\n }",
"public /*virtual*/ XmlAttribute CreateAttribute( String prefix, String localName, String namespaceURI ) {\r\n return new XmlAttribute( AddAttrXmlName( prefix, localName, namespaceURI, null ), this ); \r\n }",
"XMLAttribute addAttribute(String namespace, String name, String value);",
"@DOMSupport(DomLevel.TWO)\r\n @BrowserSupport({BrowserType.FIREFOX_2P, BrowserType.OPERA_9P})\r\n @Function Element createElementNS(String namespaceURI, String qualifiedName);",
"public Element createElementNS(String namespaceURI, \n String qualifiedName)\n throws DOMException;",
"public XmlAttribute CreateAttribute( String name ) { \r\n String prefix = String.Empty;\r\n String localName = String.Empty;\r\n String namespaceURI = String.Empty;\r\n \r\n SplitName( name, out prefix, out localName );\r\n \r\n SetDefaultNamespace( prefix, localName, ref namespaceURI ); \r\n\r\n return CreateAttribute( prefix, localName, namespaceURI ); \r\n }",
"public void setAttributeNS(final String namespaceURI, final String qualifiedName,\n final String attributeValue) {\n final String value = attributeValue;\n final DomAttr newAttr = new DomAttr(getPage(), namespaceURI, qualifiedName, value, true);\n newAttr.setParentNode(this);\n attributes_.put(qualifiedName, newAttr);\n\n if (namespaceURI != null) {\n namespaces().put(namespaceURI, newAttr.getPrefix());\n }\n }",
"String getAttributeNamespaceUri(Object attr);",
"private void writeAttribute(java.lang.String namespace,java.lang.String attName,\r\n java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{\r\n if (namespace.equals(\"\"))\r\n {\r\n xmlWriter.writeAttribute(attName,attValue);\r\n }\r\n else\r\n {\r\n registerPrefix(xmlWriter, namespace);\r\n xmlWriter.writeAttribute(namespace,attName,attValue);\r\n }\r\n }",
"protected AttributesImpl addNamespaceAttribute(AttributesImpl attrs,\n Namespace namespace) {\n if (declareNamespaceAttributes) {\n if (attrs == null) {\n attrs = new AttributesImpl();\n }\n\n String prefix = namespace.getPrefix();\n String qualifiedName = \"xmlns\";\n\n if ((prefix != null) && (prefix.length() > 0)) {\n qualifiedName = \"xmlns:\" + prefix;\n }\n\n String uri = \"\";\n String localName = prefix;\n String type = \"CDATA\";\n String value = namespace.getURI();\n\n attrs.addAttribute(uri, localName, qualifiedName, type, value);\n }\n\n return attrs;\n }",
"public XmlElement CreateElement( String qualifiedName, String namespaceURI ) {\r\n String prefix = String.Empty; \r\n String localName = String.Empty; \r\n SplitName( qualifiedName, out prefix, out localName );\r\n return CreateElement( prefix, localName, namespaceURI ); \r\n }",
"public abstract SOAPElement addNamespaceDeclaration(String prefix,\n String uri) throws SOAPException;",
"private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName,\r\n java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{\r\n if (xmlWriter.getPrefix(namespace) == null) {\r\n xmlWriter.writeNamespace(prefix, namespace);\r\n xmlWriter.setPrefix(prefix, namespace);\r\n\r\n }\r\n\r\n xmlWriter.writeAttribute(namespace,attName,attValue);\r\n\r\n }",
"@Test\n\tpublic void test_TCM__String_getQualifiedName() {\n final String prefix = \"prefx\";\n final String uri = \"http://some.other.place\";\n\n final Namespace namespace = Namespace.getNamespace(prefix, uri);\n\n final String attributeName = \"test\";\n final String attributeQName = prefix + ':' + attributeName;\n final String attributeValue = \"value\";\n\n final Attribute qulifiedAttribute = new Attribute(attributeName, attributeValue, namespace);\n assertEquals(\"incorrect qualified name\", qulifiedAttribute.getQualifiedName(), attributeQName);\n\n final Attribute attribute = new Attribute(attributeName, attributeValue);\n assertEquals(\"incorrect qualified name\", attribute.getQualifiedName(), attributeName);\n\n\t}",
"@Test\n\tpublic void test_TCM__String_getNamespaceURI() {\n\t\tfinal Namespace namespace = Namespace.getNamespace(\"prefx\", \"http://some.other.place\");\n\n\t\tfinal Attribute attribute = new Attribute(\"test\", \"value\", namespace);\n\t\tassertTrue(\"incorrect URI\", attribute.getNamespaceURI().equals(\"http://some.other.place\"));\n\n\t}",
"public static void declareNamespace(final Element declarationElement, final String prefix, String namespaceURI) {\n\t\tif(XMLNS_NAMESPACE_PREFIX.equals(prefix) && XMLNS_NAMESPACE_URI_STRING.equals(namespaceURI)) { //we don't need to define the `xmlns` prefix\n\t\t\treturn;\n\t\t}\n\t\tif(prefix == null && XMLNS_NAMESPACE_URI_STRING.equals(namespaceURI)) { //we don't need to define the `xmlns` name\n\t\t\treturn;\n\t\t}\n\t\tif(XML_NAMESPACE_PREFIX.equals(prefix) && XML_NAMESPACE_URI_STRING.equals(namespaceURI)) { //we don't need to define the `xml` prefix\n\t\t\treturn;\n\t\t}\n\t\tif(namespaceURI == null) { //if no namespace URI was given\n\t\t\tnamespaceURI = \"\"; //we'll declare an empty namespace URI\n\t\t}\n\t\tif(prefix != null) { //if we were given a prefix\n\t\t\t//create an attribute in the form `xmlns:prefix=\"namespaceURI\"` TODO fix for attributes that may use the same prefix for different namespace URIs\n\t\t\tdeclarationElement.setAttributeNS(XMLNS_NAMESPACE_URI_STRING, createQualifiedName(XMLNS_NAMESPACE_PREFIX, prefix), namespaceURI);\n\t\t} else { //if we weren't given a prefix\n\t\t\t//create an attribute in the form `xmlns=\"namespaceURI\"` TODO fix for attributes that may use the same prefix for different namespace URIs\n\t\t\tdeclarationElement.setAttributeNS(ATTRIBUTE_XMLNS.getNamespaceString(), ATTRIBUTE_XMLNS.getLocalName(), namespaceURI);\n\t\t}\n\t}",
"public Attr setAttributeNodeNS(Attr newAttr)\n throws DOMException;",
"public Attr getAttributeNodeNS(String namespaceURI, \n String localName);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A predicate checking if the given table should be backed up based on the given configuration | private boolean filterTable(Map.Entry<CorfuStoreMetadata.TableName,
CorfuRecord<CorfuStoreMetadata.TableDescriptors, CorfuStoreMetadata.TableMetadata>> table) {
return (namespace == null || table.getKey().getNamespace().equals(namespace)) &&
(!taggedTables || table.getValue().getMetadata().getTableOptions().getRequiresBackupSupport());
} | [
"boolean getTableExists(String table);",
"protected abstract boolean existsByTable(String table);",
"boolean hasDeleteBackUp();",
"boolean supportsRollbackAfterDDL();",
"public boolean updateTableFromTap(String fullTableName, TableConfig config);",
"public boolean supportsTableCheck();",
"boolean supportsRollback(Database database);",
"private boolean isTableNameSelected(final String tableName) {\n \n final DataSource tableDataSource = DataSourceFactory.createDataSource();\n tableDataSource.addTable(ProjectUpdateWizardConstants.AFM_FLDS_TRANS);\n tableDataSource.addField(\"autonumbered_id\");\n tableDataSource.addRestriction(Restrictions.in(ProjectUpdateWizardConstants.AFM_FLDS_TRANS,\n CHANGE_TYPE, DifferenceMessage.TBL_IS_NEW.name()));\n tableDataSource.addRestriction(Restrictions.eq(ProjectUpdateWizardConstants.AFM_FLDS_TRANS,\n CHOSEN_ACTION, Actions.APPLY_CHANGE.getMessage()));\n tableDataSource.addRestriction(Restrictions.eq(ProjectUpdateWizardConstants.AFM_FLDS_TRANS,\n TABLE_NAME, tableName));\n\n return tableDataSource.getRecords().size() > 0;\n }",
"private boolean excludeTable(String tableName) {\n\t\tif (tableName.trim().startsWith(\"~TMP\"))\n\t\t\treturn true;\n\t\tif (tableName.contains(\"_Conflict\"))\n\t\t\treturn true;\n\t\tif (tableName.equals(\"Switchboard Items\"))\n\t\t\treturn true;\n\t\treturn false;\n\t}",
"boolean isRollbackOnlyLast();",
"abstract boolean tableExist() throws SQLException;",
"boolean hasNeedsBackup();",
"boolean isTableAvailable(String table);",
"Boolean getHasTable();",
"public boolean existsByTableName(String tableName);",
"public abstract boolean convertTable(Table table);",
"public boolean isCreatedTable(String tableName)\r\n {\r\n return createdTables.contains(tableName.toUpperCase());\r\n }",
"public boolean backupAllTablesToCsv(Context ctx, SQLiteDatabase db, String suffix) {\n\t\tboolean allSucceeded = true;\n\t\tfor (TableHelper table : getTableHelpers()) {\n\t\t\tallSucceeded &= table.backup(db, ctx, suffix);\n\t\t}\n\t\treturn allSucceeded;\n\t}",
"public boolean isShardingTable(String tableName) {\n return sharding ? shardingAlgorithm.isShardingTable(this, tableName) : false;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the radio power on/off state for all phones. | static final void setRadioPower(boolean enabled) {
for (Phone phone : PhoneFactory.getPhones()) {
phone.setRadioPower(enabled);
}
} | [
"boolean setRadioPower(boolean turnOn);",
"public void turnONRadion() {\n radio.setSwitchStatus(true);\n }",
"void toggleRadioOnOff();",
"public void power() {\r\n\t\tpowerOn = !powerOn;\r\n\t}",
"public void turnOn ()\n\t{\n\t\tthis.powerState = true;\n\t}",
"private void enableRadioButtons(){\n\n this.acOffRadioButton.setEnabled(true);\n\n this.heatOffRadioButton.setEnabled(true);\n\n this.lightsOnRadioButton.setEnabled(true);\n this.lightsOffRadioButton.setEnabled(true);\n\n this.leftDoorsOpenRadioButton.setEnabled(true);\n this.leftDoorsCloseRadioButton.setEnabled(true);\n\n this.rightDoorsOpenRadioButton.setEnabled(true);\n this.rightDoorsCloseRadioButton.setEnabled(true);\n }",
"public void power()\r\n\t{\r\n\t\tpowerOn = !powerOn;\r\n\t}",
"boolean setRadio(boolean turnOn);",
"public void power(){\n \n powerOn = !powerOn; \n }",
"public void turnOFFRadion() {\n radio.setSwitchStatus(false);\n }",
"void powerOnSystem() {\n this.operatingStatus = \"on\";\n }",
"protected void setRadioState(int newState, boolean forceNotifyRegistrants) {\n int oldState;\n\n synchronized (mStateMonitor) {\n oldState = mState;\n mState = newState;\n\n if (oldState == mState && !forceNotifyRegistrants) {\n // no state transition\n return;\n }\n\n mRadioStateChangedRegistrants.notifyRegistrants();\n\n if (mState != TelephonyManager.RADIO_POWER_UNAVAILABLE\n && oldState == TelephonyManager.RADIO_POWER_UNAVAILABLE) {\n mAvailRegistrants.notifyRegistrants();\n }\n\n if (mState == TelephonyManager.RADIO_POWER_UNAVAILABLE\n && oldState != TelephonyManager.RADIO_POWER_UNAVAILABLE) {\n mNotAvailRegistrants.notifyRegistrants();\n }\n\n if (mState == TelephonyManager.RADIO_POWER_ON\n && oldState != TelephonyManager.RADIO_POWER_ON) {\n mOnRegistrants.notifyRegistrants();\n }\n\n if ((mState == TelephonyManager.RADIO_POWER_OFF\n || mState == TelephonyManager.RADIO_POWER_UNAVAILABLE)\n && (oldState == TelephonyManager.RADIO_POWER_ON)) {\n mOffOrNotAvailRegistrants.notifyRegistrants();\n }\n }\n }",
"boolean needMobileRadioShutdown();",
"void setRadioCapability(RadioAccessFamily[] rafs);",
"void pauseRadio();",
"public synchronized void power_on_reset()\n {\n // Flush data memory\n for(int i=0;i<=DATA_MEMORY_SIZE;i++)\n this.setDataMemory(i,0x00);\n\n mPC = 0;\n mMBR = mMBR2 = 0;\n for(int i=0;i<=PROGRAM_MEMORY_SIZE;i++) \n this.setProgramMemory(i,0xFFFF);\n // Power on reset sets the PORF bit of the MCUSR\n try { set_ioreg(MCUSR,get_ioreg(MCUSR) | 0x01); }\n catch (RuntimeException e) { }\n mClockCycles = 0;\n mSleeping = false;\n }",
"void setShutterLEDState(boolean on);",
"public static int setWifiPowerStatus(boolean state) {\n\t\tif(getDeviceNum() < 1) {\n\t\t\tSlog.i(TAG, \" **** no wifi device, so disable **** \");\n\t\t\t//mWifiManager.setWifiEnabled(false);\n\t\t}\n\t\tif(state == true) {\n\t\t\treturn setWifiSwitch_1(true);\n\t\t} else {\n\t\t\t//mWifiManager.setWifiEnabled(false);\n\t\t\treturn setWifiSwitch_1(false);\n\t\t}\n\t}",
"private void turnOnSpeakerPhone() {\n mAudioManager.setMode(AudioManager.MODE_IN_CALL);\n mAudioManager.setSpeakerphoneOn(true);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The buildCustomerTable method creates the Customer table and adds some rows to it. | public static void buildCustomerTable(Connection conn)
{
try
{
// Get a Statement object.
Statement stmt = conn.createStatement();
// Create the table.
stmt.execute("CREATE TABLE Customer" +
"( CustomerNumber INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), " +
" CustomerName CHAR(25)," +
" Address CHAR(25)," +
" City CHAR(12)," +
" State CHAR(2)," +
" Zip CHAR(5) )");
// Add some rows to the new table.
stmt.execute("INSERT INTO Customer (CustomerName, Address, City, State, Zip) VALUES " +
"('.', '13400 Commons Dr.'," +
" 'Brookfield', 'WI', '53005')");
stmt.execute("INSERT INTO Customer (CustomerName, Address, City, State, Zip) VALUES " +
"('Best Buy.'," +
" '19555 W Bluemound Rd.'," +
" 'Brookfield', 'WI', '53045')");
stmt.execute("INSERT INTO Customer (CustomerName, Address, City, State, Zip) VALUES " +
"('.', '1615 Tallgrass Circle.'," +
" 'Waukesha', 'WI', '53188')");
System.out.println("Customer table created.");
} catch (SQLException ex)
{
System.out.println("ERROR: " + ex.getMessage());
}
} | [
"public static void buildCustomerTable(Connection conn) {\n try {\n // Get a Statement object.\n Statement stmt = conn.createStatement();\n\n // Create the table.\n stmt.execute(\n \"CREATE TABLE Customer\"\n + \"( CustomerNumber CHAR(10) NOT NULL PRIMARY KEY, \"\n + \" Name CHAR(25),\"\n + \" RegistrationDate DATE,\"\n + \" Address CHAR(25),\"\n + \" City CHAR(12),\"\n + \" State CHAR(2),\"\n + \" Zip CHAR(5) )\");\n\n // Add some rows to the new table.\n stmt.executeUpdate(\n \"INSERT INTO Customer VALUES\"\n + \"('101', 'Downtown Cafe', '2004-01-29', '17 N. Main Street',\"\n + \" 'Asheville', 'NC', '55515')\");\n\n stmt.executeUpdate(\n \"INSERT INTO Customer VALUES\"\n + \"('102', 'Main Street Grocery', '2005-02-10',\"\n + \" '110 E. Main Street',\"\n + \" 'Canton', 'NC', '55555')\");\n\n stmt.executeUpdate(\n \"INSERT INTO Customer VALUES\"\n + \"('103', 'The Coffee Place', '2006-08-31', '101 Center Plaza',\"\n + \" 'Waynesville', 'NC', '55516')\");\n } catch (SQLException ex) {\n System.out.println(\"ERROR: \" + ex.getMessage());\n }\n }",
"public void populateCustomerTable() throws SQLException {\n\n try {\n\n PreparedStatement populateCustomerTableview = DBConnection.getConnection().prepareStatement(\"SELECT * from customers\");\n ResultSet resultSet = populateCustomerTableview.executeQuery();\n allCustomers.removeAll();\n\n while (resultSet.next()) {\n\n int customerID = resultSet.getInt(\"Customer_ID\");\n String name = resultSet.getString(\"Customer_Name\");\n String address = resultSet.getString(\"Address\");\n String postal = resultSet.getString(\"Postal_Code\");\n String phone = resultSet.getString(\"Phone\");\n String created = resultSet.getString(\"Create_Date\");\n String createdBy = resultSet.getString(\"Created_By\");\n String lastUpdate = resultSet.getString(\"Last_Update\");\n String updatedBy = resultSet.getString(\"Last_Updated_By\");\n String divisionID = resultSet.getString(\"Division_ID\");\n\n Customer newCustomer = new Customer(customerID, name, address, postal, phone, created, createdBy, lastUpdate,\n updatedBy, divisionID);\n\n allCustomers.add(newCustomer);\n }\n\n } catch (SQLException sqlException) {\n sqlException.printStackTrace();\n } catch (Exception exception) {\n exception.printStackTrace();\n }\n }",
"private void createCustomersTable() {\n\t\ttry {\n\t\t\tStatement stmt = this.conn.createStatement();\n\t\t\tstmt.executeUpdate(\"CREATE TABLE customers \"\n\t\t\t\t\t+ \"(id INT GENERATED ALWAYS AS IDENTITY, \"\n\t\t\t\t\t+ \"name VARCHAR(40), \" + \"email VARCHAR(40), \"\n\t\t\t\t\t+ \"pass VARCHAR(40), \" + \"ssn VARCHAR(9), \"\n\t\t\t\t\t+ \"address VARCHAR(255), \" + \"hphone VARCHAR(10), \"\n\t\t\t\t\t+ \"cphone VARCHAR(10), \" + \"signuptime BIGINT, \"\n\t\t\t\t\t+ \"chkacct BIGINT, \" + \"savacct BIGINT, \" + \"cdacct BIGINT, \"\n\t\t\t\t\t+ \"hasStock VARCHAR(6))\");\n\t\t\tconn.commit();\n\t\t\tSystem.out.println(\"Created table users\");\n\t\t} catch (SQLException sqle) {\n\t\t\tSystem.err.println(\"Creation of user table FAILED\");\n\t\t\tSystem.err.println(sqle);\n\t\t}\n\t}",
"private void buildTable() {\n\t\tObservableList<Record> data;\r\n\t\tdata = FXCollections.observableArrayList();\r\n\r\n\t\t// get records from the database\r\n\t\tArrayList<Record> list = new ArrayList<Record>();\r\n\t\tlist = getItemsToAdd();\r\n\r\n\t\t// add records to the table\r\n\t\tfor (Record i : list) {\r\n\t\t\tSystem.out.println(\"Add row: \" + i);\r\n\t\t\tdata.add(i);\r\n\t\t}\r\n\t\ttableView.setItems(data);\r\n\t}",
"public void updateCustomersTable() {\n customersTable.setItems(DBCustomer.getAllCustomers());\n }",
"@FXML void populateTable()\n {\n try\n {\n customerList.clear();\n PreparedStatement ps = conn.prepareStatement(\n \"SELECT * FROM customers, first_level_divisions, countries \"\n + \"WHERE customers.Division_ID = first_level_divisions.Division_ID \"\n + \"AND first_level_divisions.COUNTRY_ID = countries.Country_ID \"\n + \"ORDER BY Customer_ID\"); \n \n ResultSet rs = ps.executeQuery();\n \n while(rs.next())\n {\n int customerId = rs.getInt(\"Customer_ID\");\n String customerName = rs.getString(\"Customer_Name\");\n String address = rs.getString(\"Address\");\n String postalCode = rs.getString(\"Postal_Code\");\n String phone = rs.getString(\"Phone\");\n LocalDateTime createDate = rs.getTimestamp(\"Create_Date\").toLocalDateTime();\n String createdBy = rs.getString(\"Created_By\");\n Timestamp lastUpdate = rs.getTimestamp(\"Last_Update\");\n String lastUpdatedBy = rs.getString(\"Last_Updated_By\");\n int divisionId = rs.getInt(\"Division_ID\");\n String divisionName = rs.getString(\"Division\");\n int countryId = rs.getInt(\"Country_ID\");\n String countryName = rs.getString(\"Country\");\n \n customerList.add(new Customers(customerId, customerName, address, \n postalCode, phone, createDate, createdBy, lastUpdate,\n lastUpdatedBy, divisionId, divisionName, countryId, countryName)); \n }\n \n customerTable.setItems(customerList);\n } catch (SQLException ex) {\n Logger.getLogger(CustomersController.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"private void BuildTable() {\n\n dbHandler.open();\n Cursor c = dbHandler.readEntry();\n\n int rows = c.getCount();\n int cols = c.getColumnCount();\n\n c.moveToFirst();\n\n // outer for loop\n for (int i = 0; i < rows; i++) {\n\n TableRow row = new TableRow(this);\n row.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT,\n TableRow.LayoutParams.WRAP_CONTENT));\n\n // inner for loop\n for (int j = 0; j < cols; j++) {\n\n TextView tv = new TextView(this);\n tv.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT,\n TableRow.LayoutParams.WRAP_CONTENT));\n tv.setBackgroundResource(R.drawable.cell_shape);\n tv.setGravity(Gravity.CENTER);\n tv.setTextSize(18);\n tv.setPadding(0, 5, 0, 5);\n\n tv.setText(c.getString(j));\n\n row.addView(tv);\n\n }\n\n c.moveToNext();\n\n table_layout.addView(row);\n\n }\n\n // close the database\n dbHandler.close();\n }",
"public void Put_The_Order_Of_Specific_Customer_In_Table()\n\t{\n\t\tArrayList<CustomerOrderDetailsRow> Temp_Orders = new ArrayList<CustomerOrderDetailsRow>();\n\t\t\n\t\tfor(int i = 0 ; i < CustomerUI.Order_Of_Specific_Customer.size() ; i++)\n\t\t{ \n\t\t\tCustomerOrderDetailsRow Specific_Order = new CustomerOrderDetailsRow();\n\t\t\tSpecific_Order.setOrder_Address(CustomerUI.Order_Of_Specific_Customer.get(i).getRecipientAddress());\n\t\t\tSpecific_Order.setOrder_Date(CustomerUI.Order_Of_Specific_Customer.get(i).getOrderDate());\n\t\t\tSpecific_Order.setOrder_ID(CustomerUI.Order_Of_Specific_Customer.get(i).getOrderID());\n\t\t\tSpecific_Order.setOrder_PayMent(CustomerUI.Order_Of_Specific_Customer.get(i).getPaymentMethod());\n\t\t\tSpecific_Order.setOrder_Status(CustomerUI.Order_Of_Specific_Customer.get(i).getoStatus());\n\t\t\tSpecific_Order.setRefund(CustomerUI.Order_Of_Specific_Customer.get(i).getRefund());\n\t\t\tSpecific_Order.setStore_ID(CustomerUI.Order_Of_Specific_Customer.get(i).getStoreID());\n\t\t\tSpecific_Order.setSupply(CustomerUI.Order_Of_Specific_Customer.get(i).getSupply());\n\t\t\tSpecific_Order.setTotal_Price(CustomerUI.Order_Of_Specific_Customer.get(i).getOrderTotalPrice());\n\t\t\tTemp_Orders.add(Specific_Order);\n\t\t}\n\t\t\n\t\tTable_Column_Order_ID.setCellValueFactory(new PropertyValueFactory<CustomerOrderDetailsRow, Integer>(\"Order_ID\"));\n\t\tTable_Column_Store_ID.setCellValueFactory(new PropertyValueFactory<CustomerOrderDetailsRow, Integer>(\"Store_ID\"));\n\t\tTable_Column_Order_Date.setCellValueFactory(new PropertyValueFactory<CustomerOrderDetailsRow, Date>(\"Order_Date\"));\n\t\tTable_Column_Total_Price.setCellValueFactory(new PropertyValueFactory<CustomerOrderDetailsRow, Double>(\"Total_Price\"));\n\t\tTable_Column_Address.setCellValueFactory(new PropertyValueFactory<CustomerOrderDetailsRow, String>(\"Order_Address\"));\n\t\tTable_Column_Order_Status.setCellValueFactory(new PropertyValueFactory<CustomerOrderDetailsRow, Order.orderStatus>(\"Order_Status\"));\n\t\tTable_Column_Supply_Option.setCellValueFactory(new PropertyValueFactory<CustomerOrderDetailsRow, Order.SupplyOption>(\"Supply\"));\n\t\tTable_Column_Payment_Method.setCellValueFactory(new PropertyValueFactory<CustomerOrderDetailsRow, Account.PaymentMethod>(\"Order_PayMent\"));\n\t\tTable_Column_Refund.setCellValueFactory(new PropertyValueFactory<CustomerOrderDetailsRow, Double>(\"Refund\"));\n\t\t\n\t\tProfile_Customer_Order = FXCollections.observableArrayList(Temp_Orders);\t\n\t\n\t\tTable_Order_Details.setItems(Profile_Customer_Order);\n\t\t\n\t}",
"public void displayCustomerRecords() throws SQLException {\r\n customerRecordsTable.setItems(DBCustomers.getCustomerList());\r\n customerRecordsIdCol.setCellValueFactory(new PropertyValueFactory<>(\"custId\"));\r\n customerRecordsNameCol.setCellValueFactory(new PropertyValueFactory<>(\"custName\"));\r\n customerRecordsAddressCol.setCellValueFactory(new PropertyValueFactory<>(\"custAddress\"));\r\n customerRecordsPostCodeCol.setCellValueFactory(new PropertyValueFactory<>(\"custPostCode\"));\r\n customerRecordsPhoneCol.setCellValueFactory(new PropertyValueFactory<>(\"custPhone\"));\r\n customerRecordsDivCol.setCellValueFactory(new PropertyValueFactory<>(\"custDiv\"));\r\n }",
"public CustomerData(){\r\n \r\n try{\r\n \r\n data.DbConCustomer();\r\n dba = \"CREATE TABLE IF NOT EXISTS customers(\"\r\n + \"ID INT (6),\"\r\n + \"Name STRING (20),\"\r\n + \"Email STRING (50),\"\r\n + \"Username STRING (10),\"\r\n + \"Salt BLOB (20),\"\r\n + \"Hash STRING (10));\";\r\n \r\n ps = data.DbConCustomer().prepareStatement(dba);\r\n \r\n ps.executeUpdate();\r\n \r\n }catch (SQLException ex) {\r\n \r\n Logger.getLogger(CustomerData.class.getName()).log(Level.SEVERE, null, ex);\r\n \r\n }finally{\r\n \r\n try {\r\n \r\n data.DbConCustomer().close();\r\n \r\n } catch (SQLException ex) {\r\n \r\n Logger.getLogger(CustomerData.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }\r\n }",
"public static void buildUnpaidOrderTable(Connection conn) {\n try {\n // Get a Statement object.\n Statement stmt = conn.createStatement();\n\n // Create the table.\n stmt.execute(\n \"CREATE TABLE UnpaidOrder \"\n + \"( CustomerNumber CHAR(10) NOT NULL REFERENCES Customer(CustomerNumber), \"\n + \" ProdNum CHAR(10) NOT NULL REFERENCES Coffee(ProdNum),\"\n + \" OrderDate CHAR(10),\"\n + \" Quantity DOUBLE,\"\n + \" Cost DOUBLE )\");\n } catch (SQLException ex) {\n System.out.println(\"ERROR: \" + ex.getMessage());\n }\n }",
"public static void buildCoffeeTable(Connection conn) {\n try {\n // Get a Statement object.\n Statement stmt = conn.createStatement();\n\n // Create the table.\n stmt.execute(\n \"CREATE TABLE Coffee (\"\n + \"Description CHAR(25), \"\n + \"ProdNum CHAR(10) NOT NULL PRIMARY KEY, \"\n + \"Price DOUBLE, \"\n + \"Imported BOOLEAN\"\n + \")\");\n\n // Insert row #1.\n stmt.execute(\n \"INSERT INTO Coffee VALUES ( \"\n + \"'Bolivian Dark', \"\n + \"'14-001', \"\n + \"8.95, \"\n + \"TRUE )\");\n\n // Insert row #2.\n stmt.execute(\n \"INSERT INTO Coffee VALUES ( \"\n + \"'Bolivian Medium', \"\n + \"'14-002', \"\n + \"8.95, \"\n + \"TRUE )\");\n\n // Insert row #3.\n stmt.execute(\n \"INSERT INTO Coffee VALUES ( \"\n + \"'Brazilian Dark', \"\n + \"'15-001', \"\n + \"7.95, \"\n + \"TRUE )\");\n\n // Insert row #4.\n stmt.execute(\n \"INSERT INTO Coffee VALUES ( \"\n + \"'Brazilian Medium', \"\n + \"'15-002', \"\n + \"7.95, \"\n + \"TRUE )\");\n\n // Insert row #5.\n stmt.execute(\n \"INSERT INTO Coffee VALUES ( \"\n + \"'Brazilian Decaf', \"\n + \"'15-003', \"\n + \"8.55, \"\n + \"TRUE )\");\n\n // Insert row #6.\n stmt.execute(\n \"INSERT INTO Coffee VALUES ( \"\n + \"'Central American Dark', \"\n + \"'16-001', \"\n + \"9.95, \"\n + \"FALSE )\");\n\n // Insert row #7.\n stmt.execute(\n \"INSERT INTO Coffee VALUES ( \"\n + \"'Central American Medium', \"\n + \"'16-002', \"\n + \"9.95, \"\n + \"FALSE )\");\n\n // Insert row #8.\n stmt.execute(\n \"INSERT INTO Coffee VALUES ( \" + \"'Sumatra Dark', \" + \"'17-001', \" + \"7.95, \" + \"TRUE )\");\n\n // Insert row #9.\n stmt.execute(\n \"INSERT INTO Coffee VALUES ( \"\n + \"'Sumatra Decaf', \"\n + \"'17-002', \"\n + \"8.95, \"\n + \"TRUE )\");\n\n // Insert row #10.\n stmt.execute(\n \"INSERT INTO Coffee VALUES ( \"\n + \"'Sumatra Medium', \"\n + \"'17-003', \"\n + \"7.95, \"\n + \"TRUE )\");\n\n // Insert row #11.\n stmt.execute(\n \"INSERT INTO Coffee VALUES ( \"\n + \"'Sumatra Organic Dark', \"\n + \"'17-004', \"\n + \"11.95, \"\n + \"TRUE )\");\n\n // Insert row #12.\n stmt.execute(\n \"INSERT INTO Coffee VALUES ( \" + \"'Kona Medium', \" + \"'18-001', \" + \"18.45, \" + \"TRUE )\");\n\n // Insert row #13.\n stmt.execute(\n \"INSERT INTO Coffee VALUES ( \" + \"'Kona Dark', \" + \"'18-002', \" + \"18.45, \" + \"TRUE )\");\n\n // Insert row #14.\n stmt.execute(\n \"INSERT INTO Coffee VALUES ( \"\n + \"'French Roast Dark', \"\n + \"'19-001', \"\n + \"9.65, \"\n + \"TRUE )\");\n\n // Insert row #15.\n stmt.execute(\n \"INSERT INTO Coffee VALUES ( \"\n + \"'Galapagos Medium', \"\n + \"'20-001', \"\n + \"6.85, \"\n + \"TRUE )\");\n\n // Insert row #16.\n stmt.execute(\n \"INSERT INTO Coffee VALUES ( \"\n + \"'Guatemalan Dark', \"\n + \"'21-001', \"\n + \"9.95, \"\n + \"TRUE )\");\n\n // Insert row #17.\n stmt.execute(\n \"INSERT INTO Coffee VALUES ( \"\n + \"'Guatemalan Decaf', \"\n + \"'21-002', \"\n + \"10.45, \"\n + \"TRUE )\");\n\n // Insert row #18.\n stmt.execute(\n \"INSERT INTO Coffee VALUES ( \"\n + \"'Guatemalan Medium', \"\n + \"'21-003', \"\n + \"9.95, \"\n + \"TRUE )\");\n } catch (SQLException ex) {\n System.out.println(\"ERROR: \" + ex.getMessage());\n }\n }",
"private void generateTable() {\r\n\t\tpackages = modelAdaptor.getPackages(buildFilter(), \r\n\t\t\t\t\"check_in_date=DESCENDING\");\r\n\t\t\r\n\t\t// create headers\r\n\t\tVector<String> dataHeaders = new Vector<String>();\r\n\t\tdataHeaders.add(\"Last Name\");\r\n\t\tdataHeaders.add(\"First Name\");\r\n\t\tdataHeaders.add(\"NetID\");\r\n\t\tdataHeaders.add(\"Check In Date\");\r\n\t\tdataHeaders.add(\"Check Out Date\");\r\n\t\tdataHeaders.add(\"Package ID\");\r\n\t\tdataHeaders.add(\"Email\");\r\n\r\n\t\t// collect data\r\n\t\tSimpleDateFormat ft = new SimpleDateFormat(\"yyyy/MM/dd HH:mm\");\r\n\t\tVector<Vector<String>> data = new Vector<Vector<String>>();\r\n\t\tfor (Pair<Person,Package> dbEntry : packages) {\r\n\t\t\tVector<String> dataEntry = new Vector<String>();\r\n\t\t\tdataEntry.add(dbEntry.first.getLastName());\r\n\t\t\tdataEntry.add(dbEntry.first.getFirstName());\r\n\t\t\tdataEntry.add(dbEntry.first.getPersonID());\r\n\t\t\tdataEntry.add(ft.format(dbEntry.second.getCheckInDate()));\r\n\t\t\t\r\n\t\t\tif(dbEntry.second.getCheckOutDate() != null) {\r\n\t\t\t\tdataEntry.add(ft.format(dbEntry.second.getCheckOutDate()));\r\n\t\t\t} else {\r\n\t\t\t\tdataEntry.add(\"\");\r\n\t\t\t}\r\n\t\t\tdataEntry.add(Long.valueOf(dbEntry.second.getPackageID()).toString());\r\n\t\t\t\r\n\t\t\tif(dbEntry.second.getCheckOutDate() != null) {\r\n\t\t\t\tdataEntry.add(\"\");\r\n\t\t\t}\r\n\t\t\telse if(dbEntry.second.isNotificationSent()) {\r\n\t\t\t\tdataEntry.add(\"Yes\");\r\n\t\t\t} else {\r\n\t\t\t\tdataEntry.add(\"No\");\r\n\t\t\t}\r\n\t\t\tdata.add(dataEntry);\r\n\t\t}\r\n\t\t\r\n\t\t// get the sort and filter keys for setting the sorter after the model is set\r\n\t\tList<? extends SortKey> sortKeys = sorter.getSortKeys();\r\n\t\tRowFilter<? super DefaultTableModel, ? super Integer> rowFilter = sorter.getRowFilter();\r\n\t\t\r\n\t\t// set model for table\r\n\t\ttableModel.setDataVector(data, dataHeaders);\r\n\t\t\r\n\t\t// Set column sizes\r\n\t\ttableActivePackages.getColumnModel().getColumn(0).setPreferredWidth(100);\r\n\t\ttableActivePackages.getColumnModel().getColumn(1).setPreferredWidth(100);\r\n\t\ttableActivePackages.getColumnModel().getColumn(2).setPreferredWidth(30);\r\n\t\ttableActivePackages.getColumnModel().getColumn(3).setPreferredWidth(100);\r\n\t\ttableActivePackages.getColumnModel().getColumn(4).setPreferredWidth(100);\r\n\t\ttableActivePackages.getColumnModel().getColumn(5).setPreferredWidth(100);\r\n\t\ttableActivePackages.getColumnModel().getColumn(6).setPreferredWidth(30);\r\n\t\t\r\n\t\t// Center align\r\n\t\tDefaultTableCellRenderer centerRenderer = new DefaultTableCellRenderer();\r\n\t\tcenterRenderer.setHorizontalAlignment( JLabel.CENTER );\r\n\t\ttableActivePackages.getColumnModel().getColumn(2).setCellRenderer( centerRenderer );\r\n\t\ttableActivePackages.getColumnModel().getColumn(3).setCellRenderer( centerRenderer );\r\n\t\ttableActivePackages.getColumnModel().getColumn(4).setCellRenderer( centerRenderer );\r\n\t\ttableActivePackages.getColumnModel().getColumn(5).setCellRenderer( centerRenderer );\r\n\t\t\r\n\t\t// render email column\r\n\t\tDefaultTableCellRenderer emailRenderer = new DefaultTableCellRenderer() {\r\n\t\t\tprivate static final long serialVersionUID = 1435774334371903319L;\r\n\t\t\tpublic Component getTableCellRendererComponent(JTable table, Object value, \r\n\t\t\t\t\tboolean isSelected, boolean hasFocus, int row, int col) {\r\n\t\t\t\tJLabel cell = (JLabel) super.getTableCellRendererComponent(table, \r\n\t\t\t\t\t\tvalue, isSelected, hasFocus, row, col);\r\n\t\t\t\r\n\t\t\t\tsetHorizontalAlignment( JLabel.CENTER );\r\n\t\t\t\t\r\n\t\t\t\tint modelRow = table.convertRowIndexToModel(row);\r\n\t\t\t\t\r\n\t\t\t\tif((String) tableModel.getValueAt(modelRow, col) == \"No\") {\r\n\t\t\t\t\tcell.setBackground(Color.PINK);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcell.setBackground(Color.WHITE);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn cell;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t};\r\n\t\ttableActivePackages.getColumnModel().getColumn(6).setCellRenderer( emailRenderer );\r\n\t\t\r\n\t\t// sort table\r\n\t\tsorter.setModel(tableModel);\r\n\t\tsorter.setSortKeys(sortKeys);\r\n\t\tsorter.setRowFilter(rowFilter);\r\n\t}",
"void buildAllCustPanel() {\r\n // this method builds the customer panel.\r\n allCustPan.setLayout(new BorderLayout());\r\n allCustPan.add(allCustLb, BorderLayout.NORTH);\r\n //** 1 Create a DefaultTableModel and assign it to\r\n //** tableModel. Hint - see TableExample class\r\n tableModel = new DefaultTableModel(tableHeaders, 10);\r\n //** 2 Create a JTable and assign it to\r\n //** table. Hint - see TableExample class\r\n table = new JTable(tableModel);\r\n //** 3 Create a JScrollPane object to scroll the table\r\n //** and assign it to tablePane;\r\n tablePane = new JScrollPane(table);\r\n //** 4 Add the tablePan to CENTER region of allCustPan\r\n allCustPan.add(tablePane, BorderLayout.CENTER);\r\n //set table view port properties\r\n Dimension dim = new Dimension(500, 150);\r\n table.setPreferredScrollableViewportSize(dim);\r\n allCustPan.add(refreshButton, BorderLayout.SOUTH);\r\n \r\n }",
"public MovieTable() {\n movieTable = new ArrayList<MovieRecord>();\n buildTable();\n }",
"@SuppressWarnings(\"deprecation\")\n private void initDataTable() {\n dataTable = DataTable.create();\n \n // Columns have explicit ids so that they can addressed by Rhizosphere code\n // (see metamodel definition below).\n dataTable.addColumn(ColumnType.STRING, \"Name\", \"name\");\n dataTable.addColumn(ColumnType.NUMBER, \"Weight\", \"weight\");\n dataTable.addColumn(ColumnType.NUMBER, \"Height\", \"height\");\n dataTable.addColumn(ColumnType.DATE, \"Date Of Birth\", \"dob\");\n dataTable.addRows(5);\n dataTable.setValue(0, 0, \"Bob\");\n dataTable.setValue(0, 1, 8);\n dataTable.setValue(0, 2, 65);\n dataTable.setValue(0, 3, new Date(109, 9, 16));\n \n dataTable.setValue(1, 0, \"Alice\");\n dataTable.setValue(1, 1, 4);\n dataTable.setValue(1, 2, 56);\n dataTable.setValue(1, 3, new Date(110, 11, 4));\n \n dataTable.setValue(2, 0, \"Mary\");\n dataTable.setValue(2, 1, 11);\n dataTable.setValue(2, 2, 72);\n dataTable.setValue(2, 3, new Date(109, 6, 21));\n \n dataTable.setValue(3, 0, \"Victoria\");\n dataTable.setValue(3, 1, 3);\n dataTable.setValue(3, 2, 51);\n dataTable.setValue(3, 3, new Date(110, 3, 28));\n \n dataTable.setValue(4, 0, \"Robert\");\n dataTable.setValue(4, 1, 6);\n dataTable.setValue(4, 2, 60);\n dataTable.setValue(4, 3, new Date(108, 2, 3));\n }",
"private JTable buildTable() {\n JTable table = new JTable(\n createSampleTableData(),\n new String[] { \"Key\", \"Value\" });\n\n //table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);\n table.getColumnModel().getColumn(0).setPreferredWidth(95);\n table.getColumnModel().getColumn(1).setPreferredWidth(95);\n table.setRowSelectionInterval(2, 2);\n return table;\n }",
"private TableView<Order> createTableView() {\n\t\t// setting up tableview to fill table up with data\n\t\tTableView<Order> table = new TableView<Order>();\n\t\ttable.setMaxHeight(190 / scaleHeight);\n\t\ttable.setEditable(false);\n\n\t\t// setting up all columns and location of data in OrderTable class\n\t\tTableColumn instrumentsOrders = new TableColumn(\"Instrument\");\n\t\tinstrumentsOrders.setMinWidth(100 / scaleWidth);\n\t\tinstrumentsOrders.setCellValueFactory(new PropertyValueFactory<Order, String>(\"companyColumn\"));\n\n\t\tTableColumn quantityOrders = new TableColumn(\"Quantity\");\n\t\tquantityOrders.setMinWidth(100 / scaleWidth);\n\t\tquantityOrders.setCellValueFactory(new PropertyValueFactory<Order, String>(\"quantityColumn\"));\n\n\t\tTableColumn buyOrSellOrders = new TableColumn(\"Buy/Sell\");\n\t\tbuyOrSellOrders.setMinWidth(100 / scaleWidth);\n\t\tbuyOrSellOrders.setCellValueFactory(new PropertyValueFactory<Order, String>(\"orderTypeColumn\"));\n\n\t\tTableColumn priceOrders = new TableColumn(\"Price\");\n\t\tpriceOrders.setMinWidth(100 / scaleWidth);\n\t\tpriceOrders.setCellValueFactory(new PropertyValueFactory<Order, String>(\"priceColumn\"));\n\n\t\tTableColumn typeOrders = new TableColumn(\"Risk\");\n\t\ttypeOrders.setMinWidth(100 / scaleWidth);\n\t\ttypeOrders.setCellValueFactory(new PropertyValueFactory<Order, String>(\"riskColumn\"));\n\n\t\tTableColumn clientOrders = new TableColumn(\"Client\");\n\t\tclientOrders.setMinWidth(110 / scaleWidth);\n\t\tclientOrders.setCellValueFactory(new PropertyValueFactory<Order, String>(\"clientColumn\"));\n\n\t\ttable.setItems(orders);\n\t\ttable.getColumns().addAll(instrumentsOrders, quantityOrders, buyOrSellOrders, priceOrders, typeOrders,\n\t\t\t\tclientOrders);\n\n\t\treturn table;\n\t}",
"public CaloricTableEntry createEntryCaloricTable(CaloricTableEntry caloricEntry);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the funding curve requirement. | private static ValueRequirement getFundingCurveRequirement(final Currency ccy, final String curveName, final String curveCalculationConfig) {
final ValueProperties fundingProperties = ValueProperties.builder()
.with(ValuePropertyNames.CURVE, curveName)
.with(ValuePropertyNames.CURVE_CALCULATION_CONFIG, curveCalculationConfig)
.get();
return new ValueRequirement(ValueRequirementNames.YIELD_CURVE, ComputationTargetSpecification.of(ccy), fundingProperties);
} | [
"public java.math.BigDecimal getPurchaseRequirement()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(PURCHASEREQUIREMENT$10, 0);\n if (target == null)\n {\n return null;\n }\n return target.getBigDecimalValue();\n }\n }",
"private static ValueRequirement getForwardCurveRequirement(final String forwardCurveName, final String forwardCurveCalculationMethod,\n final ExternalId underlyingBuid, final ValueProperties additionalConstraints) {\n final ValueProperties properties = ValueProperties.builder() // TODO: Update to this => additionalConstraints.copy() [PLAT-5524]\n .with(ValuePropertyNames.CURVE, forwardCurveName)\n .with(ForwardCurveValuePropertyNames.PROPERTY_FORWARD_CURVE_CALCULATION_METHOD, forwardCurveCalculationMethod)\n .get();\n // REVIEW Andrew 2012-01-17 -- Why can't we just use the underlyingBuid external identifier directly here, with a target type of SECURITY, and shift the\n // logic into the reference resolver?\n return new ValueRequirement(ValueRequirementNames.FORWARD_CURVE, ComputationTargetType.PRIMITIVE, underlyingBuid, properties);\n }",
"private static ValueRequirement getDiscountCurveRequirement(final String fundingCurveName, final String curveCalculationConfigName, final Security security,\n final ValueProperties additionalConstraints) {\n final ValueProperties properties = ValueProperties.builder() // TODO: Update to this => additionalConstraints.copy() [PLAT-5524]\n .with(ValuePropertyNames.CURVE, fundingCurveName)\n .with(ValuePropertyNames.CURVE_CALCULATION_CONFIG, curveCalculationConfigName)\n .get();\n return new ValueRequirement(ValueRequirementNames.YIELD_CURVE, ComputationTargetSpecification.of(FinancialSecurityUtils.getCurrency(security)), properties);\n }",
"public org.apache.xmlbeans.XmlDecimal xgetPurchaseRequirement()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlDecimal target = null;\n target = (org.apache.xmlbeans.XmlDecimal)get_store().find_element_user(PURCHASEREQUIREMENT$10, 0);\n return target;\n }\n }",
"public net.morimekta.providence.model.FieldRequirement getRequirement() {\n return isSetRequirement() ? mRequirement : kDefaultRequirement;\n }",
"public synchronized double getStockRequired() {\n\t\treturn (restockLevel - (stock + restocking));\n\t}",
"public double getFund() {\r\n return fund;\r\n }",
"@gw.internal.gosu.parser.ExtendedProperty\n public java.lang.String getProductWithdrawalPremiumBasis();",
"public BigDecimal getRateProfit() {\n return rateProfit;\n }",
"double getStockCost(double commissionFee);",
"float getBudget();",
"public BigDecimal getPROFIT_RATE() {\r\n return PROFIT_RATE;\r\n }",
"io.grpc.user.task.PriceCondition getCondition();",
"public String getProFund() {\r\n\t\treturn proFund;\r\n\t}",
"public BigDecimal getPROFITPAYABLE_FC() {\r\n return PROFITPAYABLE_FC;\r\n }",
"public double getRoyalty_cost();",
"String getProfitRatio();",
"BigDecimal getFare();",
"double getStockCostBasis(String date);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the id estatus objeto. | public int getIdEstatusObjeto() {
return idEstatusObjeto;
} | [
"public long getIdEstatusObjeto() {\r\n\t\treturn idEstatusObjeto;\r\n\t}",
"public int getIdStatus() {\r\n return idStatus;\r\n }",
"public int getStatusId() {\n return statusId;\n }",
"public int getStatusId() {\n return statusId_;\n }",
"public String getStatusId() {\n return getProperty(Property.STATUS_ID);\n }",
"public String getIdStatus() {\n return idStatus;\n }",
"public Integer getStatusId()\n {\n return this.statusId;\n }",
"public long getStatusId() {\n return _app.getStatusId();\n }",
"public long getDossierStatusId();",
"public String getStatusId() {\r\n return this.issue.getStatus();\r\n }",
"String getOldStatusId();",
"@Override\n\tpublic long getId() {\n\t\treturn _dmGtStatus.getId();\n\t}",
"public void setIdEstatusObjeto(long idEstatusObjeto) {\r\n\t\tthis.idEstatusObjeto = idEstatusObjeto;\r\n\t}",
"public BigDecimal getIdEstatusEmpleado() {\n return idEstatusEmpleado;\n }",
"public void setIdEstatusObjeto(int idEstatusObjeto) {\r\n\t\tthis.idEstatusObjeto = idEstatusObjeto;\r\n\t}",
"Integer obtenerEstatusPolizaGeneral(int idEstatusPolizaPago);",
"public Long getESTATUS_ENT() {\n return ESTATUS_ENT;\n }",
"public java.lang.String getEntregaEstatus() {\n return entregaEstatus;\n }",
"public int getEntitystatus();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
todo: notify last not reported tick here | @Override public void notifyNoMoreTicks() {
super.notifyNoMoreTicks();
log("TickJoinerTs[" + m_size + "ms]: reportedCount=" + m_reportedCount + "; joinedCount=" + m_joinedCount + "; rate=" + (((float) m_joinedCount) / m_reportedCount));
} | [
"public boolean tick() {\r\n \t\treturn false;\r\n \t}",
"public void tick() {}",
"@Override\n\tpublic boolean tick() {\n\t\treturn false;\n\t}",
"private void tick() {\n Log.enter();\n Log.write(\"[:Timer].tick()\");\n Log.exit();\n }",
"int getLastTick();",
"void tick(long tickSinceStart);",
"private void onPingingTimerTick()\r\n {\r\n EneterTrace aTrace = EneterTrace.entering();\r\n try\r\n {\r\n try\r\n {\r\n myConnectionManipulatorLock.lock();\r\n try\r\n {\r\n // Send the ping message.\r\n myUnderlyingOutputChannel.sendMessage(myPreserializedPingMessage);\r\n\r\n // Schedule the next ping.\r\n myPingingTimer.change(myPingFrequency);\r\n }\r\n finally\r\n {\r\n myConnectionManipulatorLock.unlock();\r\n }\r\n }\r\n catch (Exception err)\r\n {\r\n // The sending of the ping message failed - the connection is broken.\r\n cleanAfterConnection(true, true);\r\n }\r\n }\r\n finally\r\n {\r\n EneterTrace.leaving(aTrace);\r\n }\r\n }",
"private void tick(){\n time++;\n }",
"public void invalidateTickerHeartbeat() {\n\t\t// Invalidate last tick timetamps\n\t\tsynchronized (lastTick) {\n\t\t\tlastTickTimestamp.clear();\t\n\t\t}\n\t}",
"public void onTimeTick() {\n tick++;\n try {\n sendBeaconLog(10);\n } catch (InterruptedException e) {\n }\n if (tick % 10 == 0) {\n sendDirectedPresence();\n }\n }",
"public abstract boolean ticksRunning();",
"public abstract void tick();",
"int getFinalTick();",
"public synchronized void setTicks() {\n tickFlag = (OldTick < NewTick || (NewTick < 0 && 0 < OldTick));\n /*\n System.out.println(Scalar + \" -> \" + DisplayScalar +\n \" set tickFlag = \" + tickFlag);\n */\n OldTick = NewTick;\n if (control != null) control.setTicks();\n }",
"public void rescheduleTicks() {\n if (this.blocksToBeTicked instanceof ChunkPrimerTickList) {\n ((ChunkPrimerTickList<Block>)this.blocksToBeTicked).postProcess(this.world.getPendingBlockTicks(), (pos) -> {\n return this.getBlockState(pos).getBlock();\n });\n this.blocksToBeTicked = EmptyTickList.get();\n } else if (this.blocksToBeTicked instanceof SerializableTickList) {\n ((SerializableTickList)this.blocksToBeTicked).func_234855_a_(this.world.getPendingBlockTicks());\n this.blocksToBeTicked = EmptyTickList.get();\n }\n\n if (this.fluidsToBeTicked instanceof ChunkPrimerTickList) {\n ((ChunkPrimerTickList<Fluid>)this.fluidsToBeTicked).postProcess(this.world.getPendingFluidTicks(), (pos) -> {\n return this.getFluidState(pos).getFluid();\n });\n this.fluidsToBeTicked = EmptyTickList.get();\n } else if (this.fluidsToBeTicked instanceof SerializableTickList) {\n ((SerializableTickList)this.fluidsToBeTicked).func_234855_a_(this.world.getPendingFluidTicks());\n this.fluidsToBeTicked = EmptyTickList.get();\n }\n\n }",
"public boolean tick()\n\t{\n\t\tif(timer > 0)\n\t\t{\n\t\t\ttimer = timer - 1;\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t\treturn true;\n\t}",
"void applyTick(int tick);",
"public void onTimerTick();",
"private void skipIt()\n {\n shouldNotify_ = false;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the Boolean value of an argument if it exists. | public Boolean getBoolean(String key)
{
if (!arguments.containsKey(key))
{
return null;
}
else
{
try
{
return Boolean.parseBoolean(arguments.get(key));
}
catch (Exception e)
{
return true;
}
}
} | [
"protected boolean getBoolArg(GraphQLAppliedDirective directive, String argName) {\n GraphQLAppliedDirectiveArgument argument = directive.getArgument(argName);\n if (argument == null) {\n return assertExpectedArgType(argName, \"Boolean\");\n }\n Object value = argument.getValue();\n if (value == null) {\n return assertExpectedArgType(argName, \"Boolean\");\n }\n return Boolean.parseBoolean(String.valueOf(value));\n }",
"boolean hasArgument();",
"boolean getArgOptional();",
"public static boolean getBoolean(Map<String, String> args, String argName) {\n if (args.containsKey(argName)) {\n return Boolean.parseBoolean(args.get(argName)); \n }\n throw new IllegalArgumentException();\n }",
"public Boolean getBooleanParameter(String argname) {\n\t\tparams = getParameterTree();\n\t\tBoolean ret = null;\n\t\ttry {\n\t\t\tret = params.getBoolean(robotName + \"/\" + argname);\t\t\t\n\t\t} catch (ParameterNotFoundException e) {\n\t\t}\n\n\t\treturn ret;\n\t}",
"private boolean getBooleanValue(String key) {\n return Boolean.valueOf(Macro.getValue(arg, key, \"false\"));\n }",
"public boolean hasArgument() {\n return arg != null;\n }",
"@Nullable\n Pair<Boolean, Argument> getArgument(int argumentPosition);",
"public boolean isSetArg1() {\n return this.arg1 != null;\n }",
"boolean getBoolValue();",
"@Override\n\tpublic boolean getParameterAsBoolean(String key) {\n\t\ttry {\n\t\t\treturn Boolean.valueOf(getParameter(key));\n\t\t} catch (UndefinedParameterError e) {\n\t\t}\n\t\treturn false; // cannot happen\n\t}",
"public boolean booleanValue();",
"public boolean isSetArg0() {\n return this.arg0 != null;\n }",
"String booleanAttributeToGetter(String arg0);",
"public static Boolean parseBoolean(CommandSender sender, String arg, String argName) {\n String lowerArg = arg.toLowerCase();\n if (TRUE_STRINGS.contains(lowerArg)) {\n return true;\n } else if (FALSE_STRINGS.contains(lowerArg)) {\n return false;\n } else {\n sender.sendMessage(ChatColor.RED + \"\\\"\" + arg + \"\\\" is not a valid \" + argName + \" argument.\");\n sender.sendMessage(ChatColor.RED + \"Valid values are: yes/no/y/n/true/false/t/f/on/off\");\n return null;\n }\n }",
"@java.lang.Override\n public boolean getArgOptional() {\n return argOptional_;\n }",
"private boolean isSpecialFlagSet(OptionSet parsedArguments, String flagName){\n if (parsedArguments.has(flagName)){\n Object value = parsedArguments.valueOf(flagName);\n return (value == null || !value.equals(\"false\"));\n } else{\n return false;\n }\n\n }",
"private BoolConstant evalBooleanArg(AST arg, BinOp b) {\n JamVal val = arg.accept(Evaluator.this);\n if (val instanceof BoolConstant) return (BoolConstant)val;\n throw new EvalException(\"Binary operator `\" + b + \"' applied to non-boolean \" + val);\n }",
"public static Boolean getBArgumentValue(String listEntry, String argName, Logger logger) {\n Boolean retVal = null;\n String sVal;\n\n if (!listEntry.toLowerCase().startsWith(argName))\n return null;\n\n if (argName.equals((listEntry.trim()).toLowerCase())) {\n retVal = new Boolean(true);\n } else {\n try {\n sVal = listEntry.split(\"(\\\\s)*=(\\\\s)*\")[1].trim();\n if (sVal.toLowerCase().equals(\"on\"))\n retVal = new Boolean(true);\n else\n retVal = new Boolean(false);\n } catch (Throwable t) {\n logger.log(Level.INFO, \" Got exception parsing module argument \" + listEntry + \": \", t);\n return null;\n }\n }\n logger.info(\"Set module parameter \" + argName + \"to \" + retVal);\n return retVal;\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a Google User login class. | public GoogleUser(Social social, Person person, Integer sessionTimeoutInSec) {
super("Google", social, person, sessionTimeoutInSec);
} | [
"GoogleAuthenticatorKey createCredentials(String userName);",
"public GoogleAuthenticatorAccount() {\n }",
"public GoogleOAuthProvider(){}",
"private JwtUserFactory() {\n\t}",
"private void RegisterGoogleSignup() {\n\n\t\ttry {\n\t\t\tLocalData data = new LocalData(SplashActivity.this);\n\n\t\t\tArrayList<String> asName = new ArrayList<String>();\n\t\t\tArrayList<String> asValue = new ArrayList<String>();\n\n\t\t\tasName.add(\"email\");\n\t\t\tasName.add(\"firstname\");\n\t\t\tasName.add(\"gender\");\n\t\t\tasName.add(\"id\");\n\t\t\tasName.add(\"lastname\");\n\t\t\tasName.add(\"name\");\n\t\t\t// asName.add(\"link\");\n\n\t\t\tasName.add(\"device_type\");\n\t\t\tasName.add(\"device_id\");\n\t\t\tasName.add(\"gcm_id\");\n\t\t\tasName.add(\"timezone\");\n\n\t\t\tasValue.add(data.GetS(LocalData.EMAIL));\n\t\t\tasValue.add(data.GetS(LocalData.FIRST_NAME));\n\t\t\tasValue.add(data.GetS(LocalData.GENDER));\n\t\t\tasValue.add(data.GetS(LocalData.ID));\n\t\t\tasValue.add(data.GetS(LocalData.LAST_NAME));\n\t\t\tasValue.add(data.GetS(LocalData.NAME));\n\t\t\t// asValue.add(data.GetS(LocalData.LINK));\n\n\t\t\tasValue.add(\"A\");\n\n\t\t\tString android_id = Secure\n\t\t\t\t\t.getString(SplashActivity.this.getContentResolver(),\n\t\t\t\t\t\t\tSecure.ANDROID_ID);\n\n\t\t\tasValue.add(android_id);\n\n\t\t\tLocalData data1 = new LocalData(SplashActivity.this);\n\t\t\tasValue.add(data1.GetS(\"gcmId\"));\n\t\t\tasValue.add(Main.GetTimeZone());\n\t\t\tString sURL = StringURLs.getQuery(StringURLs.GOOGLE_LOGIN, asName,\n\t\t\t\t\tasValue);\n\n\t\t\tConnectServer connectServer = new ConnectServer();\n\t\t\tconnectServer.setMode(ConnectServer.MODE_POST);\n\t\t\tconnectServer.setContext(SplashActivity.this);\n\t\t\tconnectServer.setListener(new ConnectServerListener() {\n\n\t\t\t\t@Override\n\t\t\t\tpublic void onServerResponse(String sJSON, JSONObject jsonObject) {\n\t\t\t\t\t// TODO Auto-generated method stub\n\n\t\t\t\t\tLog.d(\"JSON DATA\", sJSON);\n\n\t\t\t\t\ttry {\n\n\t\t\t\t\t\tif (sJSON.length() != 0) {\n\t\t\t\t\t\t\tJSONObject object = new JSONObject(sJSON);\n\t\t\t\t\t\t\tJSONObject response = object\n\t\t\t\t\t\t\t\t\t.getJSONObject(JSONStrings.JSON_RESPONSE);\n\t\t\t\t\t\t\tString sResult = response\n\t\t\t\t\t\t\t\t\t.getString(JSONStrings.JSON_SUCCESS);\n\n\t\t\t\t\t\t\tif (sResult.equalsIgnoreCase(\"1\") == true) {\n\n\t\t\t\t\t\t\t\tString user_id = response.getString(\"userid\");\n\n\t\t\t\t\t\t\t\tLocalData data = new LocalData(\n\t\t\t\t\t\t\t\t\t\tSplashActivity.this);\n\t\t\t\t\t\t\t\tdata.Update(\"userid\", user_id);\n\t\t\t\t\t\t\t\tdata.Update(\"name\", response.getString(\"name\"));\n\n\t\t\t\t\t\t\t\tGetNotificationCount();\n\n\t\t\t\t\t\t\t} else if (sResult.equalsIgnoreCase(\"0\") == true) {\n\n\t\t\t\t\t\t\t\tString msgcode = jsonObject.getJSONObject(\n\t\t\t\t\t\t\t\t\t\t\"response\").getString(\"msgcode\");\n\n\t\t\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\t\t\tSplashActivity.this,\n\t\t\t\t\t\t\t\t\t\tMain.getStringResourceByName(\n\t\t\t\t\t\t\t\t\t\t\t\tSplashActivity.this, msgcode),\n\t\t\t\t\t\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\t\tSplashActivity.this,\n\t\t\t\t\t\t\t\t\tMain.getStringResourceByName(\n\t\t\t\t\t\t\t\t\t\t\tSplashActivity.this, \"c100\"),\n\t\t\t\t\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} catch (Exception exp) {\n\n\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\tSplashActivity.this,\n\t\t\t\t\t\t\t\tMain.getStringResourceByName(\n\t\t\t\t\t\t\t\t\t\tSplashActivity.this, \"c100\"),\n\t\t\t\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tconnectServer.execute(sURL);\n\n\t\t} catch (Exception exp) {\n\n\t\t\tToast.makeText(SplashActivity.this,\n\t\t\t\t\tMain.getStringResourceByName(SplashActivity.this, \"c100\"),\n\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t}\n\t}",
"public static User fromGoogleUser(Person googleUser, String email) {\n User result = new User();\n result.setGoogleId(googleUser.getId());\n result.setDisplayName(googleUser.getDisplayName());\n result.setEmail(email);\n // TODO birthday/age interval\n if (googleUser.getGender() == Person.Gender.MALE) {\n result.setGender(GENDER_MALE);\n } else {\n result.setGender(GENDER_FEMALE);\n }\n return result;\n }",
"public User validateLogInGoogle(String idTokenString) {\n\t\ttry {\n\t\t\tGoogleIdToken idToken = verifier.verify(idTokenString);\n\t\t\tif (idToken != null) {\n\t\t\t\tPayload payload = idToken.getPayload();\n\n\t\t\t\tString userId = payload.getSubject();\n\t\t\t\tString email = payload.getEmail();\n\t\t\t\tLong expirationTime = payload.getExpirationTimeSeconds();\n\n\t\t\t\t// TODO: sacar las validacinoes de usuario a otra funcion\n\t\t\t\tUser user = repo.getUserByEmail(email, true);\n\t\t\t\tif (user == null) {\n\t\t\t\t\t// Si no existe el usuario, se crea en base de datos\n\t\t\t\t\tuser = new User();\n\n\t\t\t\t\tuser.setEmail(email);\n\t\t\t\t\tuser.setFullName(email);\n\t\t\t\t\tuser.setRoles(Arrays.asList(Constants.ROLE_USER));\n\n\t\t\t\t\tAuthUser authUser = new AuthUser();\n\t\t\t\t\tauthUser.setLastIdToken(idTokenString);\n\t\t\t\t\tauthUser.setProvider(Constants.OAUTH_PROVIDER_GOOGLE);\n\t\t\t\t\tauthUser.setUserId(userId);\n\t\t\t\t\tauthUser.setExpirationLastIdToken(expirationTime);\n\n\t\t\t\t\tuser.setAuth(authUser);\n\n\t\t\t\t\t// Se guarda el usuario con el auth puesto\n\t\t\t\t\trepo.createUser(user);\n\t\t\t\t} else {\n\t\t\t\t\t//Verificamos que no este desactivado el usuario\n\t\t\t\t\tif(!user.isActive()) {\n\t\t\t\t\t\tthrow new ResponseStatusException(HttpStatus.NOT_ACCEPTABLE,\n\t\t\t\t\t\t\t\t\"El usuario esta desactivado.\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Si el usuario existe, verifica que inicia sesion con Auth\n\t\t\t\t\tif (user.getAuth() != null) {\n\t\t\t\t\t\t// Verificamos los datos\n\t\t\t\t\t\tif (!user.getAuth().getProvider().equals(Constants.OAUTH_PROVIDER_GOOGLE)) {\n\t\t\t\t\t\t\tthrow new ResponseStatusException(HttpStatus.BAD_REQUEST,\n\t\t\t\t\t\t\t\t\t\"El usuario no tiene asociado este metodo de inicio de sesion.\");\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!user.getAuth().getUserId().equals(userId)) {\n\t\t\t\t\t\t\tthrow new ResponseStatusException(HttpStatus.BAD_REQUEST,\n\t\t\t\t\t\t\t\t\t\"El inicio de sesion de Google no corresponde al usuario.\");\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Si sale todo bien, actualizamos los datos\n\t\t\t\t\t\tuser.getAuth().setExpirationLastIdToken(expirationTime);\n\t\t\t\t\t\tuser.getAuth().setLastIdToken(idTokenString);\n\t\t\t\t\t\trepo.createUser(user);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Si no tiene el Auth, no se dejara iniciar sesion.\n\t\t\t\t\t\tthrow new ResponseStatusException(HttpStatus.BAD_REQUEST,\n\t\t\t\t\t\t\t\t\"El usuario no tiene asociado este metodo de inicio de sesion.\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn user;\n\n\t\t\t} else {\n\t\t\t\t// El token es invalido, nos e pude verificar con el proveedor\n\t\t\t\tthrow new ResponseStatusException(HttpStatus.BAD_REQUEST, \"Token invalido.\");\n\t\t\t}\n\n\t\t} catch (GeneralSecurityException | IOException e) {\n\t\t\te.printStackTrace();\n\t\t\tthrow new ResponseStatusException(HttpStatus.BAD_REQUEST);\n\t\t}\n\n\t}",
"void authenticateGoogle(String googleUserId, String googleAuthToken, boolean forceCreate, IServerCallback callback);",
"public GoogleAuthHelper() {\n\t\t\n\t\tLoadType<ClientCredentials> credentials = ofy().load().type(ClientCredentials.class);\n\t\t\n\t\tfor(ClientCredentials credential : credentials) {\n\t\t\t// static ClientCredentials credentials = new ClientCredentials();\n\t\t\tCALLBACK_URI = credential.getCallBackUri();\n\t\t\tCLIENT_ID = credential.getclientId();\n\t\t\tCLIENT_SECRET = credential.getClientSecret();\n\t\t}\n\t\t\n\t\tflow = new GoogleAuthorizationCodeFlow.Builder(HTTP_TRANSPORT,\n\t\t\t\tJSON_FACTORY, CLIENT_ID, CLIENT_SECRET, SCOPE).setAccessType(\n\t\t\t\t\"offline\").build();\n\t\tgenerateStateToken();\n\t}",
"public UserCredential()\r\n\t{\r\n\t}",
"public void createLoginSession(\n String name, String lastName, String sLastName, String username,\n String email, String password, String country, String state, String city,\n String address) {\n\n // validate information before storing in Shared Preferences\n\n // Store all data in Shared Preferences\n editor.putBoolean(IS_LOGIN, true);\n\n editor.putString(KEY_USERNAME, username);\n editor.putString(KEY_EMAIL, email);\n editor.putString(KEY_PASSWORD, password);\n editor.putInt(KEY_RANK, 0);\n editor.putInt(KEY_COMPLETED_MISSIONS, 0);\n editor.commit();\n\n createUserAccount(name, lastName, sLastName, username, email, password, country, state, city, address, 0);\n\n\n }",
"public User createAccount (String email, String password);",
"public UserService() {\n createAccount(\"admin\", \"admin\", \"admin\", \"admin\", \"0\",\n \"Male\", \"Rice University\", \"CS\", \"CS\", \"CS\");\n createAccount(\"test\", \"test\", \"test\", \"test\", \"0\",\n \"Male\", \"Rice University\", \"CS\", \"CS\", \"CS\");\n }",
"private CSLogin() {}",
"public void GoogleAuthenticate(){\n model.AuthenticateWithGMail(this);\n }",
"public void createUser() {\r\n /*\r\n need to add to the loader list.\r\n */\r\n User u = new User();\r\n UserAccManager accM = new UserAccManager(u.getId());\r\n u.setAccManager(accM);\r\n PasswordManager passM = new PasswordManager(u.getId());\r\n passM.setPassword(\"1234\");\r\n u.setPassManager(passM);\r\n System.out.println(\"New user created! user ID: \" + u.getId()\r\n + \" initial Password: \" + \"1234\");\r\n InfoManager.getInfoManager().add(u);\r\n passM.addObserver(InfoManager.getInfoManager());\r\n createNewChequingAccount(u.getId());\r\n\r\n\r\n }",
"@POST\n @Path(\"/google\")\n @Consumes(\"application/x-www-form-urlencoded\")\n @Deprecated\n public RegistrationResult createGoogleUser(@FormParam(\"googleAuthToken\") String googleAuthToken,\n @FormParam(\"deviceRegId\") String deviceRegId) {\n\n return registerGoogle(googleAuthToken, deviceRegId);\n\n }",
"public GoogleOAuthAction() { }",
"public interface GmailClientFactory {\n /**\n * Creates a GmailClient instance\n *\n * @param credential a valid Google credential object\n * @return a GmailClient instance that contains the user's credentials\n */\n GmailClient getGmailClient(Credential credential);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a value to property OriginalTextWriter from an instance of Contact [Generated from RDFReactor template rule add4dynamic] | public void addOriginalTextWriter(Contact value) {
Base.add(this.model, this.getResource(), ORIGINALTEXTWRITER, value);
} | [
"public static void addOriginalTextWriter(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, Contact value) {\r\n\t\tBase.add(model, instanceResource, ORIGINALTEXTWRITER, value);\r\n\t}",
"public void setOriginalTextWriter(Contact value) {\r\n\t\tBase.set(this.model, this.getResource(), ORIGINALTEXTWRITER, value);\r\n\t}",
"public void addTextWriter(Contact value) {\r\n\t\tBase.add(this.model, this.getResource(), TEXTWRITER, value);\r\n\t}",
"public static void setOriginalTextWriter(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, Contact value) {\r\n\t\tBase.set(model, instanceResource, ORIGINALTEXTWRITER, value);\r\n\t}",
"public void addOriginalTextWriter( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.add(this.model, this.getResource(), ORIGINALTEXTWRITER, value);\r\n\t}",
"public static void addTextWriter(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, Contact value) {\r\n\t\tBase.add(model, instanceResource, TEXTWRITER, value);\r\n\t}",
"public static void addOriginalTextWriter( Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.add(model, instanceResource, ORIGINALTEXTWRITER, value);\r\n\t}",
"public void setTextWriter(Contact value) {\r\n\t\tBase.set(this.model, this.getResource(), TEXTWRITER, value);\r\n\t}",
"public void setOriginalTextWriter( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.set(this.model, this.getResource(), ORIGINALTEXTWRITER, value);\r\n\t}",
"public static void setOriginalTextWriter( Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.set(model, instanceResource, ORIGINALTEXTWRITER, value);\r\n\t}",
"public void removeOriginalTextWriter(Contact value) {\r\n\t\tBase.remove(this.model, this.getResource(), ORIGINALTEXTWRITER, value);\r\n\t}",
"public static ReactorResult<Contact> getAllOriginalTextWriter_as(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource) {\r\n\t\treturn Base.getAll_as(model, instanceResource, ORIGINALTEXTWRITER, Contact.class);\r\n\t}",
"public ReactorResult<Contact> getAllOriginalTextWriter_as() {\r\n\t\treturn Base.getAll_as(this.model, this.getResource(), ORIGINALTEXTWRITER, Contact.class);\r\n\t}",
"public static void removeOriginalTextWriter(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, Contact value) {\r\n\t\tBase.remove(model, instanceResource, ORIGINALTEXTWRITER, value);\r\n\t}",
"public void addTextWriter( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.add(this.model, this.getResource(), TEXTWRITER, value);\r\n\t}",
"public void removeTextWriter(Contact value) {\r\n\t\tBase.remove(this.model, this.getResource(), TEXTWRITER, value);\r\n\t}",
"public ReactorResult<Contact> getAllTextWriter_as() {\r\n\t\treturn Base.getAll_as(this.model, this.getResource(), TEXTWRITER, Contact.class);\r\n\t}",
"public static void addTextWriter( Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.add(model, instanceResource, TEXTWRITER, value);\r\n\t}",
"public static void removeTextWriter(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, Contact value) {\r\n\t\tBase.remove(model, instanceResource, TEXTWRITER, value);\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Setter for domain vnc connection autoport | public void setAutoport(String autoport) {
this.autoport = autoport;
} | [
"public void setAutoConnect(boolean v) {\n agentConfig.setAutoConnect(v);\n }",
"public void setConnectDhcp() {\r\n\t\tif (dummyMode) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif(mDevReceiver == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tString devName = getDevName();\r\n\t\t\r\n\t\tmDevReceiver.setConnectDhcp(devName);\r\n\t}",
"public void setVncConnection(VncConnection vncConnection) {\n this.vncConnection = vncConnection;\n }",
"protected void setKVMVncAccess(long hostId, List<VMInstanceVO> vms) {\n for (VMInstanceVO vm : vms) {\n GetVncPortAnswer vmVncPortAnswer = (GetVncPortAnswer) _agentMgr.easySend(hostId, new GetVncPortCommand(vm.getId(), vm.getInstanceName()));\n if (vmVncPortAnswer != null) {\n userVmDetailsDao.addDetail(vm.getId(), VmDetailConstants.KVM_VNC_ADDRESS, vmVncPortAnswer.getAddress(), true);\n userVmDetailsDao.addDetail(vm.getId(), VmDetailConstants.KVM_VNC_PORT, String.valueOf(vmVncPortAnswer.getPort()), true);\n }\n }\n }",
"private void setRemoteDataPort(int value) {\n\n remoteDataPort_ = value;\n }",
"public boolean setVncViewer(Frame frame){\n\t\tlocalVncViewer = new VncViewer();\n\t\t//localVncViewer.setBackground(Color.RED);\n\t\tString hostIp;\n\t\tVMTreeObjectHost host = (VMTreeObjectHost)this.getParent();\n\t\thostIp = host.getIpAddress();\n\t\tString [] args=new String [4];\n\t\t args[0]=\"HOST\";\n\t\t args[1]=hostIp;\n\t\t args[2]=\"PORT\";\n//\t\t int port=Integer.MAX_VALUE;\n\t\t VM instance=(VM)this.getApiObject();\n\t\t try{\n\t\t\t String location = instance.getVNCLocation(connection);\n\t\t\t args[3] = location.substring(location.indexOf(\":\")+1);\n\t\t\t System.out.println(\"vnclocation:\"+args[3]);\n\t\t }catch(Exception e){\n\t\t\t e.printStackTrace();\n\t\t\t return false;\n\t\t }\n//\t\t Iterator<Console> cIt=null;\n//\t\t try{\n//\t\t\t cIt = instance.getConsoles(connection).iterator();\n//\t\t }catch(Exception e){\n//\t\t\t e.printStackTrace();\n//\t\t\t return false;\n//\t\t }\n//\t\t String location=\"\";\n//\t\t\twhile (cIt.hasNext()){\n//\t\t\t\ttry{\n//\t\t\t\t\tlocation=cIt.next().getLocation(connection);\n//\t\t\t\t}catch(Exception e){\n//\t\t\t\t\te.printStackTrace();\n//\t\t\t\t\tcontinue;\n//\t\t\t\t}\n//\t\t\t\t//System.out.println(location);\n//\t\t\t\t//break;\n//\t\t\t\t//System.out.println(cIt.next().getRecord(connection));\n//\t\t\t\tint len=location.length();\n//\t\t\t\tif( len>5&&location.charAt(len-5)==':'){\n//\t\t\t\t\tport=Integer.parseInt(location.substring(len-4));\n//\t\t\t\t\tbreak;\n//\t\t\t\t}\n//\t\t\t} \n//\t\t\tif(port==Integer.MAX_VALUE)\n//\t\t\t\treturn false;\n//\t\t\targs[3]=port+\"\";\n//\t\t args[4]=\"Show Controls\";\n//\t\t args[5]=\"No\";\n\t\t localVncViewer.mainArgs=args;\n\t\t localVncViewer.inAnApplet = false;\n\t\t localVncViewer.inSeparateFrame = true;\n\t\t localVncViewer.vncFrame=frame;\n\t\t \n\t\t localVncViewer.init();\n\t\t \n//\t\t localVncViewer.readParameters();\n//\t\t localVncViewer.showControls = false;\n//\t\t \n//\t\t frame.add(\"Center\", localVncViewer);\n//\t\t localVncViewer.vncContainer = localVncViewer.vncFrame;\n//\t\t \n//\t\t localVncViewer.recordingSync = new Object();\n//\n//\t\t localVncViewer.options = new OptionsFrame(localVncViewer);\n//\t\t localVncViewer.clipboard = new ClipboardFrame(localVncViewer);\n//\t\t if (RecordingFrame.checkSecurity()) {\n//\t\t \tlocalVncViewer.rec = new RecordingFrame(localVncViewer);\n//\t\t }\n//\t\t localVncViewer.sessionFileName = null;\n//\t\t localVncViewer.recordingActive = false;\n//\t\t localVncViewer.recordingStatusChanged = false;\n//\t\t localVncViewer.cursorUpdatesDef = null;\n//\t\t localVncViewer.eightBitColorsDef = null;\n//\n//\t\t localVncViewer.vncFrame.addWindowListener(localVncViewer);\n//\t\t localVncViewer.rfbThread = new Thread(localVncViewer);\n//\t\t localVncViewer.rfbThread.start();\n//\t\t \n\t\t localVncViewer.start();\n\t\t \n\t\t return true;\n\t}",
"private void setAutopilotConfig(AutopilotConfig autopilotConfig) {\n\t\tthis.autopilotConfig = autopilotConfig;\n\t}",
"public String getAutoport() {\n return autoport;\n }",
"private void setRemoteProxyPort(int value) {\n\n remoteProxyPort_ = value;\n }",
"public void setAp_port(int Ap_port) {\r\n this.Ap_port = Ap_port;\r\n }",
"public void setActive(InetSocketAddress address) {\n unbindPassive();\n remoteAddress = address;\n passiveMode = false;\n isBind = false;\n remotePort = remoteAddress.getPort();\n }",
"private void activateOwnPortControlls() {\n this.portField.setDisable(false);\n this.portField.setVisible(true);\n this.setStatusLabel(\"Please Type in port Number\");\n this.search.setVisible(true);\n this.search.setDisable(false);\n }",
"public void setHost(com.vmware.converter.DistributedVirtualSwitchHostMemberConfigSpec[] host) {\r\n this.host = host;\r\n }",
"void setNetworkSelectionModeAutomatic(int subId);",
"public void setConnection(IRemoteConnection connection) {\n \t\tfSelectionListernersEnabled = false;\n \t\thandleRemoteServiceSelected(connection);\n \t\thandleConnectionSelected();\n \t\tfSelectionListernersEnabled = true;\n \t}",
"public void setDo_portc(int Do_portc) {\r\n this.Do_portc = Do_portc;\r\n }",
"public void setAutorSeleccionado(Autor autorSeleccionado) {\r\n this.autorSeleccionado = autorSeleccionado;\r\n }",
"public void setHttpProxyHost(String host);",
"public void setComPort(String comPort){\r\n\t\tthis.comPort = comPort;\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ This method is used to update the status of the customer. The update details are obtained from the request and the response is returned to the front end. | public Response<Boolean> updateCustomerStatus(CustomerStatusReqDto requestDto) {
Response<Boolean> responseDto = new Response<>();
Optional<Customer> getCustomer = customerRepo.findByCustomerId(requestDto.getCustomerId());
if (!getCustomer.isPresent())
throw new NoDataFoundException(CustomerConstants.CUSTOMER_NOT_FOUND);
Customer updateStatus = getCustomer.get();
updateStatus.setCustomerStatus(requestDto.getCustomerStatus());
updateStatus.setModifiedBy(requestDto.getUserId());
updateStatus.setModifiedDate(new Date());
customerRepo.save(updateStatus);
Optional<User> user = userRepo.findByCustomer(updateStatus);
if (!user.isPresent())
throw new NoDataFoundException(CustomerConstants.CUSTOMER_NOT_FOUND);
User userStatus = user.get();
userStatus.setUserStatus(requestDto.getCustomerStatus());
userStatus.setModifiedBy(requestDto.getUserId());
userStatus.setModifiedDate(new Date());
userRepo.save(userStatus);
responseDto.setError(false);
responseDto.setMessage(CustomerConstants.CUSTOMER_STATUS);
responseDto.setStatus(HttpServletResponse.SC_OK);
return responseDto;
} | [
"public Response<CustomerUpdateResponseDto> updateCustomer(CustomerUpdateReqDto requestDto) {\n\t\tResponse<CustomerUpdateResponseDto> responseDto = new Response<>();\n\t\tCustomerUpdateResponseDto response = null;\n\t\tOptional<Customer> customer = customerRepo.findByCustomerId(requestDto.getCustomerId());\n\t\tif (customer.isPresent()) {\n\t\t\tCustomer customerDetail = customer.get();\n\t\t\tcustomerDetail.setAddress(requestDto.getAddress());\n\t\t\tcustomerDetail.setBillingType(requestDto.getBillingType());\n\t\t\tcustomerDetail.setBusinessType(requestDto.getBusinessType());\n\t\t\tcustomerDetail.setCustomerColourConfig(requestDto.getCustomerColourConfig());\n\t\t\tcustomerDetail.setCustomerDescription(requestDto.getCustomerDescription());\n\t\t\tcustomerDetail.setCustomerEmailId(requestDto.getCustomerEmailId());\n\t\t\tcustomerDetail.setCustomerGroupEmailId(requestDto.getCustomerGroupEmailId());\n\t\t\tcustomerDetail.setCustomerLogo(requestDto.getCustomerLogo());\n\t\t\tcustomerDetail.setCustomerMobileNumber(requestDto.getCustomerMobileNumber());\n\t\t\tcustomerDetail.setCustomerName(requestDto.getCustomerName());\n\t\t\tcustomerDetail.setCustomerPhoneNumber(requestDto.getCustomerPhoneNumber());\n\t\t\tcustomerDetail.setCustomerStatus(requestDto.getCustomerStatus());\n\t\t\tcustomerDetail.setUtilityId(requestDto.getCustomerUtilityId());\n\t\t\tcustomerDetail.setModifiedBy(requestDto.getCustomerId());\n\t\t\tcustomerDetail.setModifiedDate(new Date());\n\t\t\tcustomerRepo.save(customerDetail);\n\t\t\tOptional<User> user = userRepo.findByCustomer(customer.get());\n\t\t\tif (!user.isPresent())\n\t\t\t\tthrow new NoDataFoundException(CustomerConstants.CUSTOMER_NOT_FOUND);\n\t\t\tUser userStatus = user.get();\n\t\t\tuserStatus.setUserStatus(requestDto.getCustomerStatus());\n\t\t\tuserStatus.setModifiedBy(requestDto.getCustomerId());\n\t\t\tuserStatus.setModifiedDate(new Date());\n\t\t\tuserRepo.save(userStatus);\n\t\t\tresponse = new CustomerUpdateResponseDto();\n\t\t\tresponse.setCustomerId(customerDetail.getCustomerId());\n\t\t\tresponseDto.setData(response);\n\t\t\tresponseDto.setMessage(CustomerConstants.CUSTOMER_UPDATED_SUCCESSFULLY);\n\t\t\tresponseDto.setStatus(HttpServletResponse.SC_OK);\n\t\t\tresponseDto.setError(false);\n\n\t\t} else {\n\t\t\tresponseDto.setStatus(HttpServletResponse.SC_NO_CONTENT);\n\t\t\tresponseDto.setError(true);\n\t\t\tresponseDto.setMessage(CustomerConstants.CUSTOMER_NOT_FOUND);\n\t\t}\n\t\treturn responseDto;\n\n\t}",
"@PUT\n public synchronized Response updateCustomer(String customer) {\n\n //customer = Encryption.encryptDecrypt(customer);\n\n Customer customer1 = new Gson().fromJson(customer, Customer.class);\n\n Customer cc = customerRepository.updateCustomer(customer1);\n\n if(cc == null){\n\n return Response\n .status(400)\n .type(\"application/json\")\n .entity(\"\\\"You have entered something invalid. Check if the account number you entered is valid\\\":\\\"failed\\\"}\")\n .build();\n }\n\n // customer = Encryption.encryptDecrypt(customer);\n\n //Clearer cache\n cache.clear();\n\n\n return Response\n .status(200)\n .type(\"application/json\")\n .entity(\"{\\\"userUpdated\\\":\\\"true\\\"}\")\n .build();\n }",
"OperationOutcome updateOrCreateCustomerStatus(final Long id, final Status status);",
"public void update(Customer customer);",
"void updateCustomer(Customer customer);",
"public void updateCustomer(Customer customer);",
"public static int editCustomerStatus(int customerId, boolean active) {\n try (Connection connection = Database.getConnection()) {\n try (PreparedStatement statement = connection.prepareStatement(\"UPDATE customer SET active = ? WHERE customer.customer_id = ?\")) {\n\n statement.setBoolean(1, active);\n statement.setInt(2, customerId);\n\n statement.execute();\n return customerId;\n\n }\n } catch (SQLException e) {\n e.printStackTrace();\n return -1;\n }\n }",
"@PutMapping(\"/update/status/{id}\")\n public BillingDetailsResponse updateTransactionStatus(@RequestBody @Valid UpdateTransactionStatusRequest requestData,\n \t\t\t\t\t\t\t\t\t\t\t\t@PathVariable(\"id\") @Min(1) int id) {\n BillingDetails bill = billingService.viewBill(id);\n bill.setTransactionStatus(requestData.getTransactionStatus());\n BillingDetails updatedBill = billingService.updateBill(bill);\n return billUtil.toDetails(updatedBill);\n }",
"public boolean updateCustomer(String customerJSON);",
"Customer update(Customer customer) throws Exception {\n log.info(\"CustomerService.update() - Updating \" + customer.getName());\n\n // Check to make sure the data fits with the parameters in the Customer model and passes validation.\n validator.validateCustomer(customer);\n\n // Write the customer to the database.\n return crud.update(customer);\n }",
"@Override\r\n\tpublic int updateAppStatus(int custID, String appStatus) throws DBConnException {\r\n\t\t\r\n\t\tint updtCount = 0;\r\n\t\ttry (Connection conn = ConnUtil.getConnection()){\r\n\t\t\t\r\n\t\t\tString updtSQL = \"UPDATE project_banking.customer_tbl SET acct_status = ? WHERE cust_id = ?\";\r\n\t\t\tPreparedStatement updtPStmt = conn.prepareStatement(updtSQL);\t\r\n\t\t\t\r\n\t\t\tupdtPStmt.setString(1, appStatus);\r\n\t\t\tupdtPStmt.setInt(2, custID);\r\n\t\t\t\r\n\t\t\tupdtCount = updtPStmt.executeUpdate();\r\n\t\t\t\r\n\t\t\tSystem.out.println(updtCount + \" record(s) were updated for '\" + custID + \"'\");\r\n\t\t\t\r\n\t\t} catch (SQLException e) {\r\n\t\t\tthrow new DBConnException(\"Connection error when updating application status.\");\r\n\t\t}\r\n\t\treturn updtCount;\t\r\n\t}",
"@RequestMapping(value = \"/customerComplaintss\", method = RequestMethod.PUT, produces = MediaType.APPLICATION_JSON_VALUE)\n\t@Timed\n\t@Transactional\n\tpublic ResponseEntity<CustomerComplaints> updateCustomerComplaints(HttpServletRequest request,\n\t\t\t@RequestBody CustomerComplaints customerComplaints) throws URISyntaxException, Exception {\n\t\tlog.debug(\"REST request to update CustomerComplaints : {}\", customerComplaints);\n\t\t\n\t\tif (customerComplaints.getId() == null) {\n\t\t\treturn createCustomerComplaints(request, customerComplaints);\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tCustomerComplaints customerComplaints1 = customerComplaintsRepository.findOne(customerComplaints.getId());\n\t\tcustomerComplaints1.setStatus(customerComplaints1.getStatus() + 1);\n\t\tcustomerComplaints1.setAdjustmentAmt(customerComplaints.getAdjustmentAmt());\n\t\tcustomerComplaints1.setAdjustmentBillId(customerComplaints.getAdjustmentBillId());\n\t\tCustomerComplaints result = customerComplaintsRepository.save(customerComplaints1);\n\t\tapproveApplication(customerComplaints.getId(), customerComplaints.getRemarks());\n\t\t\n\t\tif (CPSConstants.UPDATE.equals(workflowService.getMessage()) && customerComplaints.getComplaintTypeMaster().getId() ==1) {\n\t\t\tCustDetails custDetails = custDetailsRepository.findByCanForUpdate(customerComplaints.getCan());\n\n\t\t\tAdjustments adjustments = new Adjustments();\n\t\t\tTransactionTypeMaster ttm = null;\n\t\t\tBigDecimal amount = new BigDecimal(customerComplaints.getAdjustmentAmt().toString());\n\t\t\tadjustments.setBillFullDetails(null);\n\t\t\tadjustments.setCan(customerComplaints.getCan());\n\n\t\t\tadjustments.setRemarks(customerComplaints.getRemarks());\n\t\t\tadjustments.setTxnTime(ZonedDateTime.now());\n\t\t\tadjustments.setStatus(TxnStatus.INITIATED);\n\t\t\tadjustments.setCustDetails(custDetails);\n\t\t\tadjustments.setAmount(amount.abs());\n\t\t\t\n\t\t\t/*Float amt = customerComplaints.getAdjustmentAmt(); //commented by mohib after changing float to bigdecimal\n\n\t\t\tif (amt < 0) { //Debit\n\t\t\t\tttm = transactionTypeMasterRepository.findOne(2L);\n\t\t\t} else if (amt > 0) { //Credit\n\t\t\t\tttm = transactionTypeMasterRepository.findOne(1L);\n\t\t\t}*/\n\t\t\tBigDecimal amt = customerComplaints.getAdjustmentAmt();\n\n\t\t\tint res = amt.compareTo(new BigDecimal(\"0\"));\n\t\t\tif (res == -1) { //Debit\n\t\t\t\tttm = transactionTypeMasterRepository.findOne(2L);\n\t\t\t} else if (res == 1) { //Credit\n\t\t\t\tttm = transactionTypeMasterRepository.findOne(1L);\n\t\t\t}\n\n\t\t\tadjustments.setTransactionTypeMaster(ttm);\n\t\t\tadjustments.setCustomerComplaints(customerComplaints);\n\t\t\tadjustmentsRepository.save(adjustments);\n\t\t}\n\t\t\n\t\treturn ResponseEntity.ok()\n\t\t\t\t.headers(\n\t\t\t\t\t\tHeaderUtil.createEntityUpdateAlert(\"customerComplaints\", customerComplaints.getId().toString()))\n\t\t\t\t.body(result);\n\t}",
"@PutMapping(\"/customers\")\n\tpublic Customer updatecustomer(@RequestBody Customer thecustomer) {\n\t\t\n\t\tthecustomerService.saveCustomer(thecustomer); //as received JSON object already has id,the saveorupdate() DAO method will update details of existing customer who has this id\n\t\treturn thecustomer;\n\t}",
"@RequestMapping(value = \"/customerOrders\",\n method = RequestMethod.PUT,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public ResponseEntity<CustomerOrder> updateCustomerOrder(@Valid @RequestBody CustomerOrder customerOrder) throws URISyntaxException {\n log.debug(\"REST request to update CustomerOrder : {}\", customerOrder);\n if (customerOrder.getId() == null) {\n return createCustomerOrder(customerOrder);\n }\n CustomerOrder result = customerOrderRepository.save(customerOrder);\n customerOrderSearchRepository.save(result);\n return ResponseEntity.ok()\n .headers(HeaderUtil.createEntityUpdateAlert(\"customerOrder\", customerOrder.getId().toString()))\n .body(result);\n }",
"@POST(\"/booking/set_status\")\n Call<ResponseViews.UpdateBookingStatusResponse> updateBookingStatusOfCurrentBooking(@Query(\"id\") int ownerId, @Query(\"token\") String token, @Query(\"booking_id\") long bookingId, @Query(\"status\") int statusVal,@Query(\"reason\") String message, @Query(\"who\") int who);",
"@RequestMapping(method = RequestMethod.PUT,\n consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)\n public ResponseEntity<UpdateCustomerResponse> updateCustomerDetails(@RequestHeader(\"authorization\") final String authorization,\n @RequestBody(required = false) final UpdateCustomerRequest updateCustomerRequest)\n throws AuthorizationFailedException, UpdateCustomerException {\n\n // Throw exception if first name is not present\n if (FoodAppUtil.isEmptyField(updateCustomerRequest.getFirstName())) {\n throw new UpdateCustomerException(UCR_002.getCode(), UCR_002.getDefaultMessage());\n }\n final String accessToken = getAccessToken(authorization);\n final CustomerEntity customerEntity = customerService.getCustomer(accessToken);\n customerEntity.setFirstName(updateCustomerRequest.getFirstName());\n customerEntity.setLastName(updateCustomerRequest.getLastName());\n CustomerEntity updatedCustomerEntity = customerService.updateCustomer(customerEntity);\n\n final UpdateCustomerResponse updateCustomerResponse = new UpdateCustomerResponse()\n .id(updatedCustomerEntity.getUuid())\n .status(Constants.UPDATE_CUSTOMER_MESSAGE)\n .firstName(updatedCustomerEntity.getFirstName())\n .lastName(updatedCustomerEntity.getLastName());\n\n return new ResponseEntity<UpdateCustomerResponse>(updateCustomerResponse, HttpStatus.OK);\n }",
"public void updateSoldToCustomerNumber() {\n\n\t\trfqHeader\n\t\t\t\t.setSoldToCustomerNumber(extractCustomerNumberFromCustomerNameLabel(rfqHeader.getSoldToCustomerName()));\n\t\trfqHeader.setSoldToCustomerName(extractCustomerNameFromCustomerNameLabel(rfqHeader.getSoldToCustomerName()));\n\t\tCustomer customer = customerSB.findByPK(rfqHeader.getSoldToCustomerNumber());\n\n\t\tif (customer.getDeleteFlag() != null && customer.getDeleteFlag().booleanValue()) {\n\t\t\tdeleteCustomer = true;\n\t\t\tFacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_WARN,\n\t\t\t\t\tResourceMB.getText(\"wq.message.deltdCust\") + \" :\", ResourceMB.getText(\"wq.label.soldToCodeCustomer\")\n\t\t\t\t\t\t\t+ \" : \" + getCustomerFullName(customer) + \"(\" + rfqHeader.getSoldToCustomerNumber() + \")\");\n\t\t\tFacesContext.getCurrentInstance().addMessage(\"RfqSubmissionGrowl\", msg);\n\t\t} else {\n\t\t\tboolean isInvalidCustomer = customerSB.isInvalidCustomer(rfqHeader.getSoldToCustomerNumber());\n\t\t\tif (isInvalidCustomer) {\n\t\t\t\tlogInfo(\"Invalid Special Customer : \" + rfqHeader.getSoldToCustomerNumber());\n\t\t\t\tFacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_WARN,\n\t\t\t\t\t\tResourceMB.getText(\"wq.label.invalidCust\") + \" :\",\n\t\t\t\t\t\tResourceMB.getText(\"wq.label.soldToCodeCustomer\") + \" : \"\n\t\t\t\t\t\t\t\t+ rfqHeader.getSoldToCustomerNumber());\n\t\t\t\tFacesContext.getCurrentInstance().addMessage(\"RfqSubmissionGrowl_1\", msg);\n\t\t\t\tRequestContext requestContext = RequestContext.getCurrentInstance();\n\t\t\t\trequestContext.update(\"form_rfqSubmission:RfqSubmissionGrowl\");\n\t\t\t}\n\t\t\tdeleteCustomer = false;\n\t\t}\n\n\t\trfqHeader.setCustomerType(customer.getCustomerType());\n\n\t\trfqHeader.setChineseSoldToCustomerName(null);\n\t\tList<CustomerAddress> customerAddresses = customer.getCustomerAddresss();\n\n\t\tupdateSoldToCode(customerAddresses);\n\n\t\tif (updateDataTable) {\n\t\t\tfor (RfqItemVO rfqItem : rfqItems) {\n\t\t\t\tif (rfqItem != null) {\n\t\t\t\t\t// if(QuoteUtil.isEmpty(rfqItem.getSoldToCustomerName()) &&\n\t\t\t\t\t// QuoteUtil.isEmpty(rfqItem.getSoldToCustomerNumber())){\n\t\t\t\t\tif (QuoteUtil.isEmpty(rfqItem.getRequiredPartNumber())) {\n\t\t\t\t\t\trfqItem.setSoldToCustomerName(rfqHeader.getSoldToCustomerName());\n\t\t\t\t\t\trfqItem.setSoldToCustomerNumber(rfqHeader.getSoldToCustomerNumber());\n\t\t\t\t\t\trfqItem.setCustomerType(rfqHeader.getCustomerType());\n\t\t\t\t\t\trfqItems.set(rfqItem.getItemNumber() - 1, rfqItem);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tupdateEndCustomerSelectListBySoldToCustomer();\n\n\t\t// logger.log(Level.INFO,\n\t\t// \"PERFORMANCE END - updateSoldToCustomerNumber()\");\n\t}",
"public void update(Customer customerToUpdate) throws RecordNotFoundException;",
"@RequestMapping(method=RequestMethod.POST, value=\"/updatestatusApproved\")\n\t\t\t \tpublic boolean updatestatus(@RequestBody LocoUncleansedDataElectric unapproved) {\n\t\t\t \t\tSystem.out.println(\"locono\"+unapproved.getElec_locoNo());\n\t\t\t \t\tSystem.out.println(\"status\"+unapproved.getElec_Status());\n\t\t\t \t\tSystem.out.println(\"dieselremarks\"+unapproved.getElec_Remarks());\t\t\t \t\t\n\t\t\t \t\t\t\tboolean flag=obj_uncleasedservice.updatestatus(unapproved);\n\t\t\t \t\t\t\t\treturn flag;\n\t\t\t \t\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
LengthAreaStreamSource Creates an indicator grid (1,0) that evaluates A >= (M)(L^y) based on upslope path length, | public static ExecResult LengthAreaStreamSource(@NotBlank String Input_Length_Grid,
@NotBlank String Input_Contributing_Area_Grid,
String Output_Stream_Source_Grid, String inputDir,
String outputDir)
{
return LengthAreaStreamSource(Input_Length_Grid, Input_Contributing_Area_Grid, 0.03,
1.3, Output_Stream_Source_Grid, inputDir,
outputDir);
} | [
"public static ExecResult LengthAreaStreamSource(@NotBlank String Input_Length_Grid,\n @NotBlank String Input_Contributing_Area_Grid, Double Threshold_M,\n Double Exponent_y, String Output_Stream_Source_Grid,\n String inputDir,\n String outputDir)\n {\n\n Map files = new LinkedHashMap(2);\n Map outFiles = new LinkedHashMap();\n Map params = new LinkedHashMap();\n\n // A grid of the maximum upslope length for each cell.\n files.put(\"-plen\", Input_Length_Grid);\n // A grid of contributing area values for each cell that were calculated using the D8 algorithm.\n files.put(\"-ad8\", Input_Contributing_Area_Grid);\n // The multiplier threshold (M) parameter which is used in the formula: A > (M)(L^y), to identify the beginning of streams.\n // The exponent (y) parameter which is used in the formula: A > (M)(L^y), to identify the beginning of streams.\n if (Threshold_M == null) {\n Threshold_M = 0.03;\n }\n if (Exponent_y == null) {\n Exponent_y = 1.3;\n }\n params.put(\"-par\", Threshold_M + \" \" + Exponent_y);\n // An indicator grid (1,0) that evaluates A >= (M)(L^y), based on the maximum upslope path length, the D8 contributing area grid inputs, and parameters M and y.\n if (StringUtils.isBlank(Output_Stream_Source_Grid)) {\n Output_Stream_Source_Grid = outputNaming(Input_Length_Grid, Output_Stream_Source_Grid,\n \"Output_Stream_Source_Grid\", \"Raster Dataset\");\n }\n outFiles.put(\"-ss\", Output_Stream_Source_Grid);\n return ourInstance.runCommand(TauDEMCommands.LENGTH_AREA_STREAM_SOURCE, files, outFiles, params, inputDir,\n outputDir);\n }",
"public static ExecResult LengthAreaStreamSource(@NotBlank String Input_Length_Grid,\n @NotBlank String Input_Contributing_Area_Grid, String outputDir)\n {\n return LengthAreaStreamSource(Input_Length_Grid, Input_Contributing_Area_Grid, null, null,\n outputDir);\n }",
"public double getArea()\n {\n return length * width;\n }",
"Double getYLength();",
"public double calculateAreawalls(int roomLength, int roomWidth, int roomHeight) {\n double temp1 = 2 * roomLength * roomHeight; // area of 2 longer walls\r\n double temp2 = 2 * roomWidth * roomHeight; // area of the other 2 shorter walls \r\n wallArea = wallArea + temp1 + temp2;\r\n\r\n return wallArea; //returns the area of walls\r\n }",
"double getYLength();",
"public double area(double topLen, double botLen, double height) {\r\n //find area of square in the middle of a trapazoid\r\n double sqArea;\r\n if (botLen > topLen) sqArea = topLen * height; else sqArea = botLen * height;\r\n \r\n //find triangles area using triangle formula with the height and the difference between the lengths\r\n double trArea = (Math.abs(topLen - botLen) * height / 2);\r\n //return 2 areas together\r\n return sqArea + trArea;\r\n}",
"private AreaFlow(AreaFlow source) {\n\t\tsuper(source);\n\n\t\tconstructionPhase = source.constructionPhase;\n\t\tbeginTime = source.beginTime;\n\t\tendTime = source.endTime;\n\t\tnumberOfVehicles = source.numberOfVehicles;\n\t\tcolor = new Color(source.color.getRGB());\n\t\t\n\t\tstartArea = new Ellipse2DExt(source.startArea);\n\t\tstartAreaCenter = new Point2DExt(source.startAreaCenter);\n\t\tstartAreaRadiusX = source.startAreaRadiusX;\n\t\tstartAreaRadiusY = source.startAreaRadiusY;\n\t\t\n\t\tendArea = new Ellipse2DExt(source.endArea);\n\t\tendAreaCenter = new Point2DExt(source.endAreaCenter);\n\t\tendAreaRadiusX = source.endAreaRadiusX;\n\t\tendAreaRadiusY = source.endAreaRadiusY;\n\t\t\n\t\tarrow = new Line2DExt(source.arrow);\n\n\t\tvehicleSelection = new TypeSelection<VehicleType>(source.vehicleSelection);\n\t}",
"double getXLength();",
"Double getXLength();",
"public void calcLength() {\n\t\tif (points == null || points.length == 0) {\n\t\t\tsetUndefined();\n\t\t\tlength = Double.NaN;\n\t\t\treturn;\n\t\t}\n\n\t\tlength = 0;\n\n\t\tfor (int i = 0; i < points.length - 1; i++) {\n\t\t\tif (!points[i].isDefined() || !points[i + 1].isDefined()) {\n\t\t\t\t// (?,?) makes a hole in the polyline\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tlength += points[i].distance(points[i + 1]);\n\t\t}\n\t\tsetDefined();\n\t}",
"public static double caculateWallArea(double height, double length, double width){\n double areaOfWall1 = length * height * 2;\n double areaOfWall2 = width * height * 2; \n double totalSpace = areaOfWall1 + areaOfWall2; \n return totalSpace;\n }",
"public double getLength() {\r\n \tif (this.x2 >= this.x1) {\r\n \t\tif (this.y1 >= this.y2) {\r\n \t\t\tlength = Math.sqrt(Math.pow((this.x2 - this.x1), 2) + Math.pow((this.y1 - this.y2), 2));\r\n \t\t} else {\r\n \t\t\tlength = Math.sqrt(Math.pow((this.x2 - this.x1), 2) + Math.pow((this.y2 - this.y1), 2));\r\n \t\t}\r\n \t} else if(this.x2 < this.x1) {\r\n \t\tif (this.y1 < this.y2) {\r\n \t\t\tlength = Math.sqrt(Math.pow((this.x1 - this.x2), 2) + Math.pow((this.y2 - this.y1), 2));\r\n \t\t} else {\r\n \t\t\tlength = Math.sqrt(Math.pow((this.x1 - this.x2), 2) + Math.pow((this.y2 - this.y1), 2));\r\n \t\t}\r\n \t}\r\n \treturn(length);\r\n }",
"public double getArea() {\n /*\n * area = base (1o lado ou 3o lado) x altura (2o lado ou 4o lado)\n */\n\n return this.getLado(1) * this.getLado(2);\n }",
"public double getAreaBase(){\n LOGGER.info(\"PARALLELEPIPED_GET_BASE_AREA_INFO\");\n return this.lengthA * this.widthB;\n }",
"public void calArea()\n {\n //Start of the formula\n for(int i = 0; i < sides-1; i++)\n {\n area += (poly[i].getX()*poly[i+1].getY())-(poly[i].getY()*poly[i+1].getX());\n }\n\n //half the total calculation\n area = area/2;\n\n //if area is negative times by -1\n if(area <= 0)\n {\n area = area*-1;\n }\n }",
"private double calculateAreaOfPressure() {\n double height = heightOfAreaInPressure.stream().mapToDouble( h -> h).average().getAsDouble();\n return height * silo.getWidth();\n }",
"public double getLandArea();",
"public double area() { return Math.PI * radius * radius; }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clears the value of the 'kGSuperPopCategory' field | public Gel_BioInf_Models.ChiSquare1KGenomesPhase3Pop.Builder clearKGSuperPopCategory() {
kGSuperPopCategory = null;
fieldSetFlags()[0] = false;
return this;
} | [
"public void setKGSuperPopCategory(Gel_BioInf_Models.KGSuperPopCategory value) {\n this.kGSuperPopCategory = value;\n }",
"public Gel_BioInf_Models.ChiSquare1KGenomesPhase3Pop.Builder clearKGPopCategory() {\n kGPopCategory = null;\n fieldSetFlags()[1] = false;\n return this;\n }",
"@Override\n public void clearCategoryOtherEditTextField() {\n mEditTextProductCategoryOther.setText(\"\");\n }",
"public void unsetCategory()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(CATEGORY$2, 0);\n }\n }",
"void unsetCategory();",
"public void clearForm()\n {\n this.category = new Category();\n }",
"public Gel_BioInf_Models.ChiSquare1KGenomesPhase3Pop.Builder setKGSuperPopCategory(Gel_BioInf_Models.KGSuperPopCategory value) {\n validate(fields()[0], value);\n this.kGSuperPopCategory = value;\n fieldSetFlags()[0] = true;\n return this; \n }",
"public Gel_BioInf_Models.KGSuperPopCategory getKGSuperPopCategory() {\n return kGSuperPopCategory;\n }",
"public void setKGPopCategory(Gel_BioInf_Models.KGPopCategory value) {\n this.kGPopCategory = value;\n }",
"public void ClearAdd(){\n \n PID.setText(\"\");\n MN.setText(\"\");\n PN.setText(\"\");\n price.setText(\"\");\n category.setSelectedIndex(0);\n buttonGroup1.clearSelection();\n }",
"public Gel_BioInf_Models.KGSuperPopCategory getKGSuperPopCategory() {\n return kGSuperPopCategory;\n }",
"public void setClear()\n\t{\n\t\tsbm_consignCom1.db.remove(text_BookingID.getSelectedItem());\n\t\tsbm_consignCom1.cb.setSelectedItem(\"\");\n\t\ttext_advance.setText(\"\");\n\t\ttext_adults.setText(\"\");\n\t\ttext_children.setText(\"\");\n\t}",
"public boolean hasKGSuperPopCategory() {\n return fieldSetFlags()[0];\n }",
"@Override\n\tpublic void clearDBCategorie() {\n\t\tDB db = getDB();\n\t\tMap<Long, Risposta> risposte = db.getTreeMap(\"categorie\");\n\t\trisposte.clear();\n\t\tdb.commit();\n\t\t\n\t}",
"public Gel_BioInf_Models.KGPopCategory getKGPopCategory() {\n return kGPopCategory;\n }",
"void removeCategory(GwtCategory gwtCategory)throws SquareException;",
"public void removeAllCategories()\n {\n businessService.setCategoryBag(null);\n }",
"public Gel_BioInf_Models.KGPopCategory getKGPopCategory() {\n return kGPopCategory;\n }",
"public void unsetCurrentCategoria() {\n this.currentCategoria = null;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
update place address on location text | private void updateLocationUI() {
mCurrentLocationStr = mCurrentPlace.getAddress().toString();
mCurrentLatLng = mCurrentPlace.getLatLng();
if(mCurrentLocationStr.isEmpty())
mCurrentLocationStr = String.format("(%.2f, %.2f)",mCurrentLatLng.latitude, mCurrentLatLng.longitude);
mAddLocation.setText(mCurrentLocationStr);
mAddLocation.setTextColor(mSecondaryTextColor);
mClearLocation.setVisibility(View.VISIBLE);
} | [
"public void updateAddress(Address address);",
"private void updateAddress() {\n\t\t_updateAddress(selectionMarker);\n\t}",
"public void editLocation(){\n\t\t\n\t}",
"private void _updateAddress(Marker marker) {\n\t\ttry {\n\t\t\tLatLng markerPos = marker.getPosition();\n\t\t\tAddress address = geocoder.getFromLocation(\n\t\t\t\t\tmarkerPos.latitude, markerPos.longitude, 1).get(0);\n\n\t\t\tString fullAddress = address.getAddressLine(0);\n\t\t\taddressInput.setText(fullAddress);\n\t\t} catch (IOException exception) {\n\t\t\texception.printStackTrace();\n\t\t}\n\t}",
"public void updateLocation();",
"private void onLocationEdittextClicked() {\n\n if (ActivityCompat.checkSelfPermission(getActivity(),\n Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &&\n ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_COARSE_LOCATION) !=\n PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(getActivity(), permissionsToRequest.toArray(new String[0]), ALL_PERMISSIONS_RESULT);\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n locationManager.requestSingleUpdate(criteria, locationListener, null);\n\n }",
"public void updateLocationInfo(Location locations){\n String lat , lon, accu, alt,address = \"Address \\n \";\n lat = \"Latitude: \"+ String.valueOf(locations.getLatitude());\n lon = \"Longitude: \" + String.valueOf(locations.getLongitude());\n accu = \"Accuracy: \" + String.valueOf(locations.getAccuracy());\n alt = \"Altitude: \" + String.valueOf(locations.getAltitude());\n Geocoder geocoder = new Geocoder(getApplicationContext(), Locale.getDefault());\n try {\n\n // if for any reason we don't get any address then we need to post the appropriate message\n address += \"Could not find Address\";\n List<Address> addressList = geocoder.getFromLocation(locations.getLatitude(), locations.getLongitude() , 1);\n\n // only append the address text if we have an address\n if(addressList != null && addressList.size() > 0) {\n address = \"\\nAddress \\n \";\n if (addressList.get(0).getSubThoroughfare() != null)\n address += addressList.get(0).getSubThoroughfare() + \" \";\n if (addressList.get(0).getThoroughfare() != null)\n address += addressList.get(0).getThoroughfare() + \"\\n\";\n if (addressList.get(0).getLocality() != null)\n address += addressList.get(0).getLocality() + \"\\n\";\n if (addressList.get(0).getPostalCode() != null)\n address += addressList.get(0).getPostalCode() + \"\\n\";\n if (addressList.get(0).getCountryName() != null)\n address += addressList.get(0).getCountryName();\n }\n // either print the address or the no address message\n addressView.setText(address);\n\n } catch (IOException e) {\n\n e.printStackTrace();\n\n }\n // Updating the rest of the views with the right information\n longitudeView.setText(lon);\n latitudeView.setText(lat);\n accuracyView.setText(accu);\n altitudeView.setText(alt);\n }",
"@org.jdesktop.application.Action\r\n public void editAct() throws HttpException, IOException, XPathException {\r\n \t//modify by chen jian hui for the feather to get lat/lng from geo-google api by the name of address;\r\n \tString saddress = locationEdit.getText();\r\n \tif(saddress.isEmpty())\r\n \t\tsaddress = locationEdit.getSelectedText();\r\n GoogleMapGeocoding gmg = new GoogleMapGeocoding();\r\n gmg.InitRequestCommand();\r\n if (gmg.Geocoding(saddress) && gmg.IsOkey())\r\n {\r\n gmg.GetAddressInfo();\r\n jXMapKit1.setAddressLocation(new GeoPosition(gmg.GetLat(),gmg.GetLng()));\r\n jXMapKit1.setZoom(9);\r\n locationList.insertItemAt(saddress, 0);//add by chen jian hui for collecting the data to combox list.2012.03.27\r\n //gmg.QuitGoogle();// modify by chen jian hui: Don't need to disconnect to google anymore, \r\n \t\t\t\t // it automatically disconnect by itself when the task is done well.\r\n } \r\n }",
"public final void setLocationFieldText(final String text) {\n\t\tlocationField.setText(text);\n\t}",
"private void updateLocation() {\n locationLabel.setText(getString(R.string.delhi));\n }",
"void updateServiceLocation();",
"void setText(String address, String text);",
"void addLocation(String location);",
"public void addLocation(View view){\n\t\tEditText ET = (EditText) findViewById(R.id.enterLocation);\n\t\tString locationString = ET.getText().toString();\n\t\tET.setText(\"\");\n\t\tint ulen = locationString.length();\n\t\tif (ulen <= 0 ){\n\t\t\tToast.makeText(getApplicationContext(), \"Location can't be empty.\", Toast.LENGTH_LONG).show();\n\t\t}else{\n\t\t\tUserName nameOfUser= UserName.getInstance();\n\t\t\tif (nameOfUser.getLocation() == null){\n\t\t\t\tnameOfUser.makeAddress(locationString);\n\t\t\t\tToast.makeText(getApplicationContext(), nameOfUser.getFormattedAddress(), Toast.LENGTH_LONG).show();\n\t\t\t\ttoMain();\n\t\t\t} else {\n\t\t\t\tnameOfUser.makeAddress(locationString);\n\t\t\t\ttoMain();\n\t\t\t}\n\t\t}\t\n\t}",
"public void addAddress(String Address, Coord coord);",
"void setLocation(Object modelElement, TextLocation location);",
"public void UpdateCurrentLocation(){\n thisContext=getActivity();\n String strCurrentLatitude, strCurrentLongitude;\n strCurrentLatitude = GlobalVar.getMyStringPref(thisContext, Constant.CurrentLatitude);\n strCurrentLongitude = GlobalVar.getMyStringPref(thisContext, Constant.CurrentLongitude);\n\n if (strCurrentLatitude == null || Generalfunction.isEmptyCheck(strCurrentLatitude)) {\n GPSTracker gpsTracker = new GPSTracker(thisContext);\n\n if (gpsTracker.getIsGPSTrackingEnabled()) {\n strCurrentLatitude = String.valueOf(gpsTracker.getLatitude());\n strCurrentLongitude = String.valueOf(gpsTracker.getLongitude());\n }\n }\n Generalfunction.SetsearchLocationParameter(thisContext, strCurrentLatitude, strCurrentLongitude);\n try {\n LocationAddress locationAddress = new LocationAddress();\n // tvCurrentLoc.setText(\"Current latitude: \"+strCurrentLatitude+\"\\nCurrent longitude: \"+strCurrentLongitude);\n locationAddress.getAddressFromLocation(Double.parseDouble(strCurrentLatitude), Double.parseDouble(strCurrentLongitude),\n thisContext, new GeocoderHandler());\n\n } catch (Exception e) {\n tvSuburb.setText(thisContext.getResources().getString(R.string.location));\n e.printStackTrace();\n }\n }",
"private void updateAddressUsingMarker(Marker marker) {\n\t\t_updateAddress(marker);\n\t}",
"private void setLocationText(Location location) {\n StringBuilder builder = new StringBuilder();\n builder.append(\"Latitude:\\t\" + location.getLatitude()+\"\\n\");\n builder.append(\"Longitude:\\t\" + location.getLongitude()+\"\\n\");\n builder.append(\"Speed:\\t\" + location.getSpeed()+\"\\n\");\n builder.append(\"Bearing:\\t\" + location.getBearing()+\"\\n\");\n builder.append(\"Provider:\\t\" + location.getProvider()+\"\\n\");\n builder.append(\"Accuracy:\\t\" + location.getAccuracy()+\"\\n\");\n builder.append(\"Altitude:\\t\" + location.getAltitude()+\"\\n\");\n String time = new SimpleDateFormat(TIME_PATTERN).format(new Date(location.getTime()));\n builder.append(\"Time:\\t\" + time +\"\\n\");\n\n gpsTextView.setText(builder.toString());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The MetaData interface defines attribute/value couples used to describe a Message or Resource. Values can either be Complex numbers or a String objects. The same attribute name can be use for both a Complex value or a String value. Attribute names (keys) are caseinsensitive, while values are casesensitive. It's to be noticed that a MedaData object of a published Resource cannot be modified. | public interface MetaData {
/**
* Add a Complex number attribute.
*
* @param key attribute name (not null/empty).
* @param val Complex number (not null).
*/
public void addComplex(String key, Complex val);
/**
* Add a character string attribute, insignificant spaces will be removed.
*
* @param key attribute name (not null/empty).
* @param val attribute value.
*/
public void addString(String key, String val);
/**
* Retrieve the complex number value of the given attribute, if it exists.
*
* @param key attribute name.
* @return Complex object or null if key not found.
*/
public Complex getComplex(String key);
/**
* @return the collection of the Complex numbers attributes of this MetaData object.
*/
public Collection<ComplexMetaEntry> getComplexEntries();
/**
* Retrieve the value of the given attribute, if it exists.
*
* @param key attribute name.
* @return value or null if key not found.
*/
public String getString(String key);
/**
* @return the collection of the String attributes of this MetaData object.
*/
public Collection<StringMetaEntry> getStringEntries();
/**
* Remove a Complex number attribute.
*
* @param key the key of the attribute to be removed.
*/
public void removeComplexEntry(String key);
/**
* Remove a String attribute.
*
* @param key the key of the attribute to be removed.
*/
public void removeStringEntry(String key);
} | [
"public interface MetaDataValue\n extends MetaDataObject {\n\n /**\n * Get a String representation of this value.\n *\n * <p>\n * For simple types the value is returned as is e.g Boolean values are\n * represented by the strings \"true\" and \"false\"\n * </p>\n * <p>\n * For composite types an attempt is made to represent the value in as\n * sensible manner as is possible, no guarantee is made that it will be\n * possible to reconstruct the original value from the string\n * representation.\n * </p>\n * <p>\n * List types are returned space separated e.g \"item1 item2 item3\".\n * </p>\n * <p>\n * Structure types are returned as \"[fieldname1=value1] [fieldname2=value2]\"\n * where the values follow the rules above.\n * </p>\n *\n * @return an unmodifiable String value\n */\n public String getAsString();\n}",
"ResourcePropertyMetaData<T> getMetaData();",
"public interface Metadata extends DataValue {\n\n\t\tpublic void setMetadata(DataValue value, HashAlgorithm hashAlg);\n\t}",
"BasicMetaData getBasicMetaData();",
"public String getMetaDataString() {\n\t\treturn this.metadata;\n\t}",
"public interface ColumnMetaData {\n\n\t/**\n\t * The uniqueness level of a column data type.\n\t */\n\tenum Uniqueness {\n\t\t/**\n\t\t * No limitations. Multiple instances of a single column meta data type can be attached to a table or even a\n\t\t * single column.\n\t\t */\n\t\tNONE,\n\n\t\t/**\n\t\t * Multiple instances of a single column meta data type can be attached to a table but at most one per column.\n\t\t */\n\t\tCOLUMN,\n\n\t\t/**\n\t\t * At most one instance of the column meta data type can be attached to a table.\n\t\t */\n\t\tTABLE\n\t}\n\n\t/**\n\t * The unique type id of the column meta data.\n\t *\n\t * @return the type id\n\t */\n\tString type();\n\n\t/**\n\t * The uniqueness level of the meta data. Defaults to {@link Uniqueness#NONE} (no restrictions).\n\t *\n\t * @return the uniqueness level\n\t */\n\tdefault Uniqueness uniqueness() {\n\t\treturn Uniqueness.NONE;\n\t}\n\n}",
"public void setMetaData(MediaMetaData MetaData) {\n this.MetaData = MetaData;\n }",
"@ApiModelProperty(required = true, value = \"List of metadata key-value pairs used by the consumer to associate meaningful metadata to the related virtualised resource.\")\n public MetaData getMetadata() {\n return metadata;\n }",
"public void setMetaDataString(String data) {\n\t\tthis.metadata = data;\n\t}",
"public MediaMetaData getMetaData() {\n return this.MetaData;\n }",
"@javax.annotation.Nullable\n @ApiModelProperty(example = \"{\\\"jira\\\":{\\\"issue_id\\\":\\\"value\\\"}}\", value = \"Metadata attached to the incident. Top level values must be objects.\")\n\n public Object getMetadata() {\n return metadata;\n }",
"public Map<String, Object> getMetaDataMap() {\n Map<String, Object> map = new HashMap<>();\n map.put(\"type\", getType());\n map.put(\"date\", getDate());\n map.put(\"user\", getUser().toString());\n map.put(\"id\", getIdentifier());\n return map;\n }",
"Serializable getExtraMetaData();",
"public interface SqlResourceMetaData {\r\n\r\n\tpublic List<ColumnMetaData> getAllReadColumns();\r\n\r\n\tpublic TableMetaData getChild();\r\n\r\n\tpublic List<TableMetaData> getChildPlusExtTables();\r\n\r\n\tpublic List<ColumnMetaData> getChildReadColumns();\r\n\r\n\tpublic TableMetaData getJoin();\r\n\r\n\tpublic List<TableMetaData> getJoinList();\r\n\r\n\tpublic int getNumberTables();\r\n\r\n\tpublic TableMetaData getParent();\r\n\r\n\tpublic List<TableMetaData> getParentPlusExtTables();\r\n\r\n\tpublic List<ColumnMetaData> getParentReadColumns();\r\n\r\n\tpublic Map<String, TableMetaData> getTableMap();\r\n\r\n\tpublic List<TableMetaData> getTables();\r\n\r\n\tpublic List<TableMetaData> getWriteTables(final Type requestType, final boolean doParent);\r\n\r\n\tpublic boolean hasJoinTable();\r\n\r\n\tpublic boolean hasMultipleDatabases();\r\n\r\n\tpublic boolean isHierarchical();\r\n\r\n\tpublic void init(final String sqlResourceName, final SqlResourceDefinition definition, final SqlBuilder sqlBuilder)\r\n\t\t\tthrows SqlResourceException;\r\n\r\n\tpublic String toHtml();\r\n\r\n\tpublic String toXml();\r\n}",
"com.cmpe275.grpcComm.MetaDataOrBuilder getMetaDataOrBuilder();",
"public edu.ustb.sei.mde.morel.resource.morel.IMorelMetaInformation getMetaInformation();",
"Map<String, Object> getMetadata();",
"com.cmpe275.grpcComm.MetaData getMetaData();",
"public MREML_pkg.ResourceEntityResourceMetaDataInfo getResourceMetaDataInfo() {\n return resourceMetaDataInfo;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Wraps the given array of longs in a bit vector. | public static LongArrayBitVector wrap( final long[] array ) {
return wrap( array, (long)array.length * Long.SIZE );
} | [
"public static LongArrayBitVector wrap( final long[] array, final long size ) {\n\t\tif ( size > (long)array.length << LOG2_BITS_PER_WORD ) throw new IllegalArgumentException( \"The provided array is too short (\" + array.length + \" elements) for the given size (\" + size + \")\" );\n\t\tfinal LongArrayBitVector result = new LongArrayBitVector( 0 );\n\t\tresult.length = size;\n\t\tresult.bits = array;\n\t\t\n\t\tfinal int arrayLength = array.length;\n\t\tfinal int lastWord = (int)( size / Long.SIZE ); \n\t\tif ( lastWord < arrayLength && ( array[ lastWord ] & ~ ( ( 1L << size % Long.SIZE ) - 1 ) ) != 0 ) throw new IllegalArgumentException( \"Garbage beyond size in bit array\" );\n\t\tfor( int i = lastWord + 1; i < arrayLength; i++ ) if ( array[ i ] != 0 ) throw new IllegalArgumentException( \"Garbage beyond size in bit array\" );\n\t\treturn result;\n\t}",
"public static LongArrayBitVector of( final int... bit ) {\n\t\tfinal LongArrayBitVector bitVector = new LongArrayBitVector( bit.length );\n\t\tfor( int b : bit ) {\n\t\t\tif ( b != 0 && b != 1 ) throw new IllegalArgumentException( \"Illegal bit value: \" + b );\n\t\t\tbitVector.add( b );\n\t\t}\n\t\treturn bitVector;\n\t}",
"public static LongArrayBitVector ofLength( final long length ) {\n\t\treturn new LongArrayBitVector( length ).length( length );\n\t}",
"public static LongArrayBitVector getInstance() {\n\t\treturn new LongArrayBitVector( 0 );\n\t}",
"public TLongArray(long[] array) {\n\t\tthis.array = array;\n\t}",
"void appendLongArray(long[] longs);",
"BitvectorFormula makeBitvector(int length, long pI);",
"public native long[] __longArrayMethod( long __swiftObject, long[] arg );",
"public static void putLong(long value, byte[] array, int offset) {\n\t\tarray[offset] = (byte) (0xff & (value >>> 56));\n\t\tarray[offset + 1] = (byte) (0xff & (value >>> 48));\n\t\tarray[offset + 2] = (byte) (0xff & (value >>> 40));\n\t\tarray[offset + 3] = (byte) (0xff & (value >>> 32));\n\t\tarray[offset + 4] = (byte) (0xff & (value >>> 24));\n\t\tarray[offset + 5] = (byte) (0xff & (value >>> 16));\n\t\tarray[offset + 6] = (byte) (0xff & (value >>> 8));\n\t\tarray[offset + 7] = (byte) (0xff & value);\n\t}",
"public abstract long[] toLongArray();",
"BigByteBuffer putLong(long[] src);",
"public void writeLongs(long[] l) throws IOException;",
"void writeLongs(long[] l, int off, int len) throws IOException;",
"public abstract void read_ulonglong_array(long[] value, int offset, int\nlength);",
"public static Queriable<Long> array(long[] array) {\n\t\treturn new QueriableImpl<Long>(new LongArrayIterable(array));\n\t}",
"public ArraySetLong(long[] numbers, int n) {\n\t\tnumElements = n;\n\t\ttheElements = new long[n*2];\n\t\tfor (int i=0; i<n; i++) {\n\t\t\ttheElements[i] = numbers[i];\n\t\t}\n\t}",
"public void writeLongs(long[] l, int length) throws IOException;",
"public LongArrayBitVector fast() {\n\t\treturn this;\n\t}",
"public abstract void read_longlong_array(long[] value, int offset, int\nlength);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TC002 Verifies left video alignment on editor, 'left' string on source mode, left alignment on preview modal and left alignment on article | @Test(groups = { "VetModalTests002", "VetModalTests" })
public void Vet_Tests_002_VerifyLeftAlignmentOnEditorSourcePreviewModalAndArticle() {
CommonFunctions.logOut(driver);
WikiBasePageObject wiki = new WikiBasePageObject(driver, Global.DOMAIN);
wiki.openWikiPage();
CommonFunctions.logInCookie(Properties.userName, Properties.password,
driver);
pageName = PageContent.articleNamePrefix + wiki.getTimeStamp();
WikiArticleEditMode edit = wiki.createNewArticle(pageName, 1);
edit.deleteArticleContent();
VetAddVideoComponentObject vetAddingVideo = edit.clickVideoButton();
VetOptionsComponentObject vetOptions = vetAddingVideo
.addVideoByUrl(VideoContent.youtubeVideoURL);
vetOptions.adjustPosition(1);
vetOptions.submit();
edit.verifyLeftVideoInEditMode();
edit.clickOnSourceButton();
edit.verifyWikiTextInSourceMode("left");
edit.clickOnVisualButton();
edit.clickOnPreviewButton();
edit.verifyVideoOnTheLeftInPreview();
edit.clickClosePreviewModalButton();
wiki = edit.clickOnPublishButton();
wiki.verifyVideoOnTheLeftOnAritcle();
} | [
"@Test(groups = { \"VetModalTests001\", \"VetModalTests\" })\n \tpublic void Vet_Tests_001_VerifyLeftAlignmentOnEditorSourceAndArticle() {\n \t\tWikiBasePageObject wiki = new WikiBasePageObject(driver, Global.DOMAIN);\n\t\twiki.openWikiPage();\n \t\tCommonFunctions.logInCookie(Properties.userName, Properties.password);\n \t\tpageName = PageContent.articleNamePrefix + wiki.getTimeStamp();\n \t\tWikiArticleEditMode edit = wiki.createNewArticle(pageName, 1);\n \t\tedit.deleteArticleContent();\n \t\tVetAddVideoComponentObject vetAddingVideo = edit.clickVideoButton();\n \t\tVetOptionsComponentObject vetOptions = vetAddingVideo\n \t\t\t\t.addVideoByUrl(VideoContent.youtubeVideoURL);\n \t\tvetOptions.adjustPosition(1);\n \t\tvetOptions.submit();\n \t\tedit.verifyLeftVideoInEditMode();\n \t\tedit.clickOnSourceButton();\n \t\tedit.verifyWikiTextInSourceMode(\"left\");\n \t\twiki = edit.clickOnPublishButton();\n \t\twiki.verifyVideoOnTheLeftOnAritcle();\n \t}",
"@Test(groups = { \"VetModalTests004\", \"VetModalTests\" })\n \tpublic void Vet_Tests_004_VerifyRightAlignmentOnEditorSourceAndArticle() {\n \t\tCommonFunctions.logOut(driver);\n \t\tWikiBasePageObject wiki = new WikiBasePageObject(driver, Global.DOMAIN);\n \t\twiki.openWikiPage();\n \t\tString cookieName = CommonFunctions.logInCookie(Properties.userName,\n \t\t\t\tProperties.password, driver);\n \t\tpageName = PageContent.articleNamePrefix + wiki.getTimeStamp();\n \t\tWikiArticleEditMode edit = wiki.createNewArticle(pageName, 1);\n \t\tedit.deleteArticleContent();\n \t\tVetAddVideoComponentObject vetAddingVideo = edit.clickVideoButton();\n \t\tVetOptionsComponentObject vetOptions = vetAddingVideo\n \t\t\t\t.addVideoByUrl(VideoContent.youtubeVideoURL);\n \t\tvetOptions.adjustPosition(3);\n \t\tvetOptions.submit();\n \t\tedit.verifyRightVideoInEditMode();\n \t\tedit.clickOnSourceButton();\n \t\tedit.verifyWikiTextInSourceMode(\"right\");\n \t\twiki = edit.clickOnPublishButton();\n \t\twiki.verifyVideoOnTheRightOnAritcle();\n \t\tCommonFunctions.logoutCookie(cookieName);\n \t}",
"@Test(groups = { \"VetModalTests003\", \"VetModalTests\" })\n \tpublic void Vet_Tests_003_VerifyLeftAlignmentOnEditorArticleAndVETOptions() {\n \t\tCommonFunctions.logOut(driver);\n \t\tWikiBasePageObject wiki = new WikiBasePageObject(driver, Global.DOMAIN);\n \t\twiki.openWikiPage();\n \t\tString cookieName = CommonFunctions.logInCookie(Properties.userName,\n \t\t\t\tProperties.password, driver);\n \t\tpageName = PageContent.articleNamePrefix + wiki.getTimeStamp();\n \t\tWikiArticleEditMode edit = wiki.createNewArticle(pageName, 1);\n \t\tedit.deleteArticleContent();\n \t\tVetAddVideoComponentObject vetAddingVideo = edit.clickVideoButton();\n \t\tVetOptionsComponentObject vetOptions = vetAddingVideo\n \t\t\t\t.addVideoByUrl(VideoContent.youtubeVideoURL);\n \t\tvetOptions.adjustPosition(1);\n \t\tvetOptions.submit();\n \t\tedit.verifyLeftVideoInEditMode();\n \t\twiki = edit.clickOnPublishButton();\n \t\twiki.verifyVideoOnTheLeftOnAritcle();\n \t\tedit = wiki.clickEditButton(pageName);\n \t\tedit.clickModifyButtonVideo();\n \t\tvetOptions.verifyAlignmentOptionIsSelected(1);\n \t\tvetOptions.clickUpdateVideo();\n \t\twiki = edit.clickOnPublishButton();\n \t\tCommonFunctions.logoutCookie(cookieName);\n \t}",
"@Test(groups = { \"VetModalTests007\", \"VetModalTests\" })\n \tpublic void Vet_Tests_007_VerifyCenterAlignmentOnEditorSourceAndArticle() {\n \t\tCommonFunctions.logOut(driver);\n \t\tWikiBasePageObject wiki = new WikiBasePageObject(driver, Global.DOMAIN);\n \t\twiki.openWikiPage();\n \t\tString cookieName = CommonFunctions.logInCookie(Properties.userName,\n \t\t\t\tProperties.password, driver);\n \t\tpageName = PageContent.articleNamePrefix + wiki.getTimeStamp();\n \t\tWikiArticleEditMode edit = wiki.createNewArticle(pageName, 1);\n \t\tedit.deleteArticleContent();\n \t\tVetAddVideoComponentObject vetAddingVideo = edit.clickVideoButton();\n \t\tVetOptionsComponentObject vetOptions = vetAddingVideo\n \t\t\t\t.addVideoByUrl(VideoContent.youtubeVideoURL);\n \t\tvetOptions.adjustPosition(2);\n \t\tvetOptions.submit();\n \t\tedit.verifyCenterVideoInEditMode();\n \t\tedit.clickOnSourceButton();\n \t\tedit.verifyWikiTextInSourceMode(\"center\");\n \t\twiki = edit.clickOnPublishButton();\n \t\twiki.verifyVideoOnTheCenterOnArticle();\n \t\tCommonFunctions.logoutCookie(cookieName);\n \t}",
"@Test(groups = { \"VetModalTests005\", \"VetModalTests\" })\n \tpublic void Vet_Tests_005_VerifyRightAlignmentOnEditorSourcePreviewModalAndArticle() {\n \t\tCommonFunctions.logOut(driver);\n \t\tWikiBasePageObject wiki = new WikiBasePageObject(driver, Global.DOMAIN);\n \t\twiki.openWikiPage();\n \t\tString cookieName = CommonFunctions.logInCookie(Properties.userName,\n \t\t\t\tProperties.password, driver);\n \t\tpageName = PageContent.articleNamePrefix + wiki.getTimeStamp();\n \t\tWikiArticleEditMode edit = wiki.createNewArticle(pageName, 1);\n \t\tedit.deleteArticleContent();\n \t\tVetAddVideoComponentObject vetAddingVideo = edit.clickVideoButton();\n \t\tVetOptionsComponentObject vetOptions = vetAddingVideo\n \t\t\t\t.addVideoByUrl(VideoContent.youtubeVideoURL);\n \t\tvetOptions.adjustPosition(3);\n \t\tvetOptions.submit();\n \t\tedit.verifyRightVideoInEditMode();\n \t\tedit.clickOnSourceButton();\n \t\tedit.verifyWikiTextInSourceMode(\"right\");\n \t\tedit.clickOnVisualButton();\n \t\tedit.clickOnPreviewButton();\n \t\tedit.verifyVideoOnTheRightInPreview();\n \t\tedit.clickClosePreviewModalButton();\n \t\twiki = edit.clickOnPublishButton();\n \t\twiki.verifyVideoOnTheRightOnAritcle();\n \t\tCommonFunctions.logoutCookie(cookieName);\n \t}",
"@Test(groups = { \"VetModalTests006\", \"VetModalTests\" })\n \tpublic void Vet_Tests_006_VerifyRightAlignmentOnEditorArticleAndVETOptions() {\n \t\tCommonFunctions.logOut(driver);\n \t\tWikiBasePageObject wiki = new WikiBasePageObject(driver, Global.DOMAIN);\n \t\twiki.openWikiPage();\n \t\tString cookieName = CommonFunctions.logInCookie(Properties.userName,\n \t\t\t\tProperties.password, driver);\n \t\tpageName = PageContent.articleNamePrefix + wiki.getTimeStamp();\n \t\tWikiArticleEditMode edit = wiki.createNewArticle(pageName, 1);\n \t\tedit.deleteArticleContent();\n \t\tVetAddVideoComponentObject vetAddingVideo = edit.clickVideoButton();\n \t\tVetOptionsComponentObject vetOptions = vetAddingVideo\n \t\t\t\t.addVideoByUrl(VideoContent.youtubeVideoURL);\n \t\tvetOptions.adjustPosition(3);\n \t\tvetOptions.submit();\n \t\tedit.verifyRightVideoInEditMode();\n \t\twiki = edit.clickOnPublishButton();\n \t\twiki.verifyVideoOnTheRightOnAritcle();\n \t\tedit = wiki.clickEditButton(pageName);\n \t\tedit.clickModifyButtonVideo();\n \t\tvetOptions.verifyAlignmentOptionIsSelected(3);\n \t\tvetOptions.clickUpdateVideo();\n \t\twiki = edit.clickOnPublishButton();\n \t\tCommonFunctions.logoutCookie(cookieName);\n \t}",
"@Test(groups = { \"VetModalTests008\", \"VetModalTests\" })\n \tpublic void Vet_Tests_008_VerifyCenterAlignmentOnEditorSourcePreviewModalAndArticle() {\n \t\tCommonFunctions.logOut(driver);\n \t\tWikiBasePageObject wiki = new WikiBasePageObject(driver, Global.DOMAIN);\n \t\twiki.openWikiPage();\n \t\tString cookieName = CommonFunctions.logInCookie(Properties.userName,\n \t\t\t\tProperties.password, driver);\n \t\tpageName = PageContent.articleNamePrefix + wiki.getTimeStamp();\n \t\tWikiArticleEditMode edit = wiki.createNewArticle(pageName, 1);\n \t\tedit.deleteArticleContent();\n \t\tVetAddVideoComponentObject vetAddingVideo = edit.clickVideoButton();\n \t\tVetOptionsComponentObject vetOptions = vetAddingVideo\n \t\t\t\t.addVideoByUrl(VideoContent.youtubeVideoURL);\n \t\tvetOptions.adjustPosition(2);\n \t\tvetOptions.submit();\n \t\tedit.verifyCenterVideoInEditMode();\n \t\tedit.clickOnSourceButton();\n \t\tedit.verifyWikiTextInSourceMode(\"center\");\n \t\tedit.clickOnVisualButton();\n \t\tedit.clickOnPreviewButton();\n \t\tedit.verifyVideoOnTheCenterInPreview();\n \t\tedit.clickClosePreviewModalButton();\n \t\twiki = edit.clickOnPublishButton();\n \t\twiki.verifyVideoOnTheCenterOnArticle();\n \t\tCommonFunctions.logoutCookie(cookieName);\n \t}",
"@Test(groups = { \"VetModalTests009\", \"VetModalTests\" })\n \tpublic void Vet_Tests_009_VerifyCenterAlignmentOnEditorArticleAndVETOptions() {\n \t\tCommonFunctions.logOut(driver);\n \t\tWikiBasePageObject wiki = new WikiBasePageObject(driver, Global.DOMAIN);\n \t\twiki.openWikiPage();\n \t\tString cookieName = CommonFunctions.logInCookie(Properties.userName,\n \t\t\t\tProperties.password, driver);\n \t\tpageName = PageContent.articleNamePrefix + wiki.getTimeStamp();\n \t\tWikiArticleEditMode edit = wiki.createNewArticle(pageName, 1);\n \t\tedit.deleteArticleContent();\n \t\tVetAddVideoComponentObject vetAddingVideo = edit.clickVideoButton();\n \t\tVetOptionsComponentObject vetOptions = vetAddingVideo\n \t\t\t\t.addVideoByUrl(VideoContent.youtubeVideoURL);\n \t\tvetOptions.adjustPosition(2);\n \t\tvetOptions.submit();\n \t\tedit.verifyCenterVideoInEditMode();\n \t\twiki = edit.clickOnPublishButton();\n \t\twiki.verifyVideoOnTheCenterOnArticle();\n \t\tedit = wiki.clickEditButton(pageName);\n \t\tedit.clickModifyButtonVideo();\n \t\tvetOptions.verifyAlignmentOptionIsSelected(2);\n \t\tvetOptions.clickUpdateVideo();\n \t\twiki = edit.clickOnPublishButton();\n \t\tCommonFunctions.logoutCookie(cookieName);\n \t}",
"@Test(groups = { \"VetModalTests010\", \"VetModalTests\" })\n \tpublic void Vet_Tests_010_VerifyVideoWidthOnEditorSourceAndArticle() {\n \t\tCommonFunctions.logOut(driver);\n \t\tWikiBasePageObject wiki = new WikiBasePageObject(driver, Global.DOMAIN);\n \t\twiki.openWikiPage();\n \t\tString cookieName = CommonFunctions.logInCookie(Properties.userName,\n \t\t\t\tProperties.password, driver);\n \t\tpageName = PageContent.articleNamePrefix + wiki.getTimeStamp();\n \t\tWikiArticleEditMode edit = wiki.createNewArticle(pageName, 1);\n \t\tedit.deleteArticleContent();\n \t\tVetAddVideoComponentObject vetAddingVideo = edit.clickVideoButton();\n \t\tVetOptionsComponentObject vetOptions = vetAddingVideo\n \t\t\t\t.addVideoByUrl(VideoContent.youtubeVideoURL);\n \t\tvetOptions.adjustWith(250);\n \t\tvetOptions.submit();\n \t\tedit.verifyVideoWidthInEditMode();\n \t\tedit.clickOnSourceButton();\n \t\tedit.verifyWikiTextInSourceMode(\"250\");\n \t\twiki = edit.clickOnPublishButton();\n \t\twiki.verifyVideoWidthOnAritcle();\n \t\tCommonFunctions.logoutCookie(cookieName);\n \n \t}",
"public boolean canResolveTextAlignment() { throw new RuntimeException(\"Stub!\"); }",
"@Test(groups = { \"VetModalTests011\", \"VetModalTests\" })\n \tpublic void Vet_Tests_011_VerifyVideoWidthOnEditorSourcePreviewModalAndArticle() {\n \n \t\tCommonFunctions.logOut(driver);\n \t\tWikiBasePageObject wiki = new WikiBasePageObject(driver, Global.DOMAIN);\n \t\twiki.openWikiPage();\n \t\tString cookieName = CommonFunctions.logInCookie(Properties.userName,\n \t\t\t\tProperties.password, driver);\n \t\tpageName = PageContent.articleNamePrefix + wiki.getTimeStamp();\n \t\tWikiArticleEditMode edit = wiki.createNewArticle(pageName, 1);\n \t\tedit.deleteArticleContent();\n \t\tVetAddVideoComponentObject vetAddingVideo = edit.clickVideoButton();\n \t\tVetOptionsComponentObject vetOptions = vetAddingVideo\n \t\t\t\t.addVideoByUrl(VideoContent.youtubeVideoURL);\n \t\tvetOptions.adjustWith(250);\n \t\tvetOptions.submit();\n \t\tedit.verifyVideoWidthInEditMode();\n \t\tedit.clickOnSourceButton();\n \t\tedit.verifyWikiTextInSourceMode(\"250\");\n \t\tedit.clickOnVisualButton();\n \t\tedit.clickOnPreviewButton();\n \t\tedit.verifyVideoWidthOnPreview();\n \t\tedit.clickClosePreviewModalButton();\n \t\twiki = edit.clickOnPublishButton();\n \t\twiki.verifyVideoWidthOnAritcle();\n \t\tCommonFunctions.logoutCookie(cookieName);\n \n \t}",
"public void cke_AlignLeft() {\n\t\tinfo(\"Align left a text\");\n\t\tclick(ELEMENT_CKEDITOR_ALIGNLEFT);\n\t\tUtils.pause(1000);\n\t}",
"@Test(groups = { \"VetModalTests012\", \"VetModalTests\" })\n \tpublic void Vet_Tests_012_VerifyVideoWidthOnEditorArticleAndVETOptions() {\n \t\tCommonFunctions.logOut(driver);\n \t\tWikiBasePageObject wiki = new WikiBasePageObject(driver, Global.DOMAIN);\n \t\twiki.openWikiPage();\n \t\tString cookieName = CommonFunctions.logInCookie(Properties.userName,\n \t\t\t\tProperties.password, driver);\n \t\tpageName = PageContent.articleNamePrefix + wiki.getTimeStamp();\n \t\tWikiArticleEditMode edit = wiki.createNewArticle(pageName, 1);\n \t\tedit.deleteArticleContent();\n \t\tVetAddVideoComponentObject vetAddingVideo = edit.clickVideoButton();\n \t\tVetOptionsComponentObject vetOptions = vetAddingVideo\n \t\t\t\t.addVideoByUrl(VideoContent.youtubeVideoURL);\n \t\tvetOptions.adjustWith(250);\n \t\tvetOptions.submit();\n \t\tedit.verifyVideoWidthInEditMode();\n \t\twiki = edit.clickOnPublishButton();\n \t\twiki.verifyVideoWidthOnAritcle();\n \t\tedit = wiki.clickEditButton(pageName);\n \t\tedit.clickModifyButtonVideo();\n \t\tvetOptions.verifyVideoWidthInVETOptionsModal();\n \t\tvetOptions.clickUpdateVideo();\n \t\twiki = edit.clickOnPublishButton();\n \t\tCommonFunctions.logoutCookie(cookieName);\n \n \t}",
"@Test(groups = { \"VetModalTests013\", \"VetModalTests\" })\n \tpublic void Vet_Tests_013_VerifyVideoCaptionOnEditorSourceAndArticle() {\n \t\tCommonFunctions.logOut(driver);\n \t\tWikiBasePageObject wiki = new WikiBasePageObject(driver, Global.DOMAIN);\n \t\twiki.openWikiPage();\n \t\tString cookieName = CommonFunctions.logInCookie(Properties.userName,\n \t\t\t\tProperties.password, driver);\n \t\tpageName = PageContent.articleNamePrefix + wiki.getTimeStamp();\n \t\tWikiArticleEditMode edit = wiki.createNewArticle(pageName, 1);\n \t\tedit.deleteArticleContent();\n \t\tVetAddVideoComponentObject vetAddingVideo = edit.clickVideoButton();\n \t\tVetOptionsComponentObject vetOptions = vetAddingVideo\n \t\t\t\t.addVideoByUrl(VideoContent.youtubeVideoURL);\n \t\tvetOptions.setCaption(PageContent.caption);\n \t\tvetOptions.submit();\n \t\tedit.verifyCaptionInEditMode();\n \t\tedit.clickOnSourceButton();\n \t\tedit.verifyWikiTextInSourceMode(PageContent.caption);\n \t\twiki = edit.clickOnPublishButton();\n \t\twiki.verifyVideoCaptionOnAritcle();\n \t\tCommonFunctions.logoutCookie(cookieName);\n \t}",
"String validateAlignment() {\n\t\treturn null;\n\t}",
"public void testHorizontalAlign()\n {\n doValuesTest(hAlignValues, new ValueAccess()\n {\n public int get()\n {\n return dvbtlm.getHorizontalAlign();\n }\n\n public void set(int value)\n {\n dvbtlm.setHorizontalAlign(value);\n }\n });\n }",
"@Test(groups = { \"VetModalTests014\", \"VetModalTests\" })\n \tpublic void Vet_Tests_014_VerifyVideoCaptionOnEditorSourcePreviewModalAndArticle() {\n \n \t\tCommonFunctions.logOut(driver);\n \t\tWikiBasePageObject wiki = new WikiBasePageObject(driver, Global.DOMAIN);\n \t\twiki.openWikiPage();\n \t\tString cookieName = CommonFunctions.logInCookie(Properties.userName,\n \t\t\t\tProperties.password, driver);\n \t\tpageName = PageContent.articleNamePrefix + wiki.getTimeStamp();\n \t\tWikiArticleEditMode edit = wiki.createNewArticle(pageName, 1);\n \t\tedit.deleteArticleContent();\n \t\tVetAddVideoComponentObject vetAddingVideo = edit.clickVideoButton();\n \t\tVetOptionsComponentObject vetOptions = vetAddingVideo\n \t\t\t\t.addVideoByUrl(VideoContent.youtubeVideoURL);\n \t\tvetOptions.setCaption(PageContent.caption);\n \t\tvetOptions.submit();\n \t\tedit.verifyCaptionInEditMode();\n \t\tedit.clickOnSourceButton();\n \t\tedit.verifyWikiTextInSourceMode(PageContent.caption);\n \t\tedit.clickOnPreviewButton();\n \t\tedit.verifyTheCaptionOnThePreview(PageContent.caption);\n \t\tedit.clickClosePreviewModalButton();\n \t\twiki = edit.clickOnPublishButton();\n \t\twiki.verifyVideoCaptionOnAritcle();\n \t\tCommonFunctions.logoutCookie(cookieName);\n \t}",
"private static void assertHorizontalAlign(int expected, ETextAlign align) {\n assertHorizontalAlign(expected, align, true);\n assertHorizontalAlign(expected, align, false);\n }",
"@Test(groups = { \"VetModalTests015\", \"VetModalTests\" })\n \tpublic void Vet_Tests_015_VerifyVideoCaptionOnEditorArticleAndVETOptions() {\n \t\tCommonFunctions.logOut(driver);\n \t\tWikiBasePageObject wiki = new WikiBasePageObject(driver, Global.DOMAIN);\n \t\twiki.openWikiPage();\n \t\tString cookieName = CommonFunctions.logInCookie(Properties.userName,\n \t\t\t\tProperties.password, driver);\n \t\tpageName = PageContent.articleNamePrefix + wiki.getTimeStamp();\n \t\tWikiArticleEditMode edit = wiki.createNewArticle(pageName, 1);\n \t\tedit.deleteArticleContent();\n \t\tVetAddVideoComponentObject vetAddingVideo = edit.clickVideoButton();\n \t\tVetOptionsComponentObject vetOptions = vetAddingVideo\n \t\t\t\t.addVideoByUrl(VideoContent.youtubeVideoURL);\n \t\tvetOptions.setCaption(PageContent.caption);\n \t\tvetOptions.submit();\n \t\tedit.verifyCaptionInEditMode();\n \t\twiki = edit.clickOnPublishButton();\n \t\twiki.verifyVideoCaptionOnAritcle();\n \t\tedit = wiki.clickEditButton(pageName);\n \t\tedit.clickModifyButtonVideo();\n \t\tvetOptions.verifyCaptionInVETModal(PageContent.caption);\n \t\tvetOptions.clickUpdateVideo();\n \t\twiki = edit.clickOnPublishButton();\n \t\tCommonFunctions.logoutCookie(cookieName);\n \n \t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the company ID of this room. | public void setCompanyId(long companyId) {
_room.setCompanyId(companyId);
} | [
"@Override\n public void setCompanyId(long companyId);",
"public void setCompanyId(long value) {\n this.companyId = value;\n }",
"@Override\n public void setCompanyId(long companyId) {\n _person.setCompanyId(companyId);\n }",
"@Override\n public void setCompanyId(long companyId) {\n _partido.setCompanyId(companyId);\n }",
"@Override\n public void setCompanyId(long companyId) {\n _manager.setCompanyId(companyId);\n }",
"@Override\n public void setCompanyId(long companyId) {\n _leagueDay.setCompanyId(companyId);\n }",
"public void setCompanyId(long companyId) {\r\n this.companyId = companyId;\r\n }",
"public void setCompanyId(String value) {\n setAttributeInternal(COMPANYID, value);\n }",
"@Override\n public void setCompanyId(long companyId) {\n _contactInfo.setCompanyId(companyId);\n }",
"@Override\r\n public void setCompanyId(long companyId) {\r\n _contentHolder.setCompanyId(companyId);\r\n }",
"@Override\n\tpublic void setCompanyId(long companyId) {\n\t\t_activityCoursePlace.setCompanyId(companyId);\n\t}",
"@Override\n\tpublic void setCompanyId(long companyId) {\n\t\t_modelo.setCompanyId(companyId);\n\t}",
"public void setCompanyid(Long newVal) {\n if ((newVal != null && this.companyid != null && (newVal.compareTo(this.companyid) == 0)) || \n (newVal == null && this.companyid == null && companyid_is_initialized)) {\n return; \n } \n this.companyid = newVal; \n companyid_is_modified = true; \n companyid_is_initialized = true; \n }",
"@Override\n\tpublic void setCompanyId(long companyId) {\n\t\t_scienceApp.setCompanyId(companyId);\n\t}",
"@Override\n\tpublic void setCompanyId(long companyId) {\n\t\t_paper.setCompanyId(companyId);\n\t}",
"@Override\n\tpublic void setCompanyId(long companyId) {\n\t\t_commitment.setCompanyId(companyId);\n\t}",
"@Override\n\tpublic void setCompanyId(long companyId) {\n\t\t_changesetEntry.setCompanyId(companyId);\n\t}",
"@Override\n\tpublic void setCompanyId(long companyId) {\n\t\t_unit.setCompanyId(companyId);\n\t}",
"@Override\n public void setCompanyId(long companyId) {\n _gameScore.setCompanyId(companyId);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Date of the claim when the regular claim was finalized. Value required when claim is adjusted | @ApiModelProperty(value = "Date of the claim when the regular claim was finalized. Value required when claim is adjusted")
public Long getAdjustmentSoruceDate() {
return adjustmentSoruceDate;
} | [
"java.lang.String getDateOfClaim();",
"public Date getFINAL_MATURITY_DATE()\r\n {\r\n\treturn FINAL_MATURITY_DATE;\r\n }",
"public int finalMaturityDate()\n\t{\n\t\treturn _iFinalMaturityDate;\n\t}",
"public Date getFINAL_MATURITY_DATE() {\r\n return FINAL_MATURITY_DATE;\r\n }",
"public abstract void calculateExpirationDate();",
"public Date getLastRenewDate();",
"public void setFINAL_MATURITY_DATE(Date FINAL_MATURITY_DATE)\r\n {\r\n\tthis.FINAL_MATURITY_DATE = FINAL_MATURITY_DATE;\r\n }",
"public Date\n getLicenseEnd()\n {\n return (Date) pProfile.get(\"LicenseEnd\");\n }",
"Date getBredDateEstimate();",
"public void setFINAL_MATURITY_DATE(Date FINAL_MATURITY_DATE) {\r\n this.FINAL_MATURITY_DATE = FINAL_MATURITY_DATE;\r\n }",
"@Test\n public void testClaimCurrTranDtCymd() {\n new ClaimFieldTester()\n .verifyDateStringFieldTransformedCorrectly(\n FissClaim.Builder::setCurrTranDtCymd,\n RdaFissClaim::getCurrTranDate,\n RdaFissClaim.Fields.currTranDate);\n }",
"public Date getActualFinish()\r\n {\r\n return (m_actualFinish);\r\n }",
"public Date getPaidDate(){\n //return paid date\n return new Date(this.paidDate);\n }",
"public Date getLAST_CHARGE_ACCRUED_DATE()\r\n {\r\n\treturn LAST_CHARGE_ACCRUED_DATE;\r\n }",
"@Override\n public BigDecimal getPredictedRetentionTime() {\n return null;\n }",
"public String getFinal_purchase_date() {\n return final_purchase_date;\n }",
"@Transient\r\n public Date getExpectedDueDate(){\r\n \treturn getExpectedDueDate(new Date());\r\n }",
"public java.sql.Date getActual_contract_end_date() {\r\n return (java.sql.Date) get(\"actual_contract_end_date\");\r\n }",
"public Date getInsuranceEndDate() {\n return insuranceEndDate;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The same as new BasicCache(context, classes, false); | protected BasicCache(Context context, Class[] classes) {
this(context, classes, false);
} | [
"Cache createCache();",
"<V> CrossBuildInMemoryCache<Class<?>, V> newClassCache();",
"CacheWrapper create(Context context, CacheType type, String shareName);",
"<K, V> CrossBuildInMemoryCache<K, V> newCache();",
"Object cached(Class<?> api, ComponentContext context);",
"public Cache() {\n data = new HashMap<T, S>();\n }",
"public AbstractCache() {\n }",
"public ImcacheCacheManager() {\n this(CacheBuilder.heapCache());\n }",
"<V> CrossBuildInMemoryCache<Class<?>, V> newClassMap();",
"public void setClassCaching( boolean cc )\r\n {\r\n useClassCaching = cc;\r\n }",
"public ImcacheCacheManager() {\n this(CacheBuilder.concurrentHeapCache());\n }",
"public ImageCache() {}",
"public CacheService()\n {\n }",
"private CacheCompass(Context context){\n\t\t\n\t\t//Get the memory limit of the application\n\t\tActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);\n\t\tint memoryClassBytes = am.getMemoryClass() * 1024 * 1024;\n\t\t// create a BitmapCahce with a 6th of available memory\n\t\tbitmapCache = new BitmapCache(memoryClassBytes / 6);\n\t\t\n\t}",
"private UtilsCache() {\n\t\tsuper();\n\t}",
"Cache mountNewCache();",
"private airlift.CachingContext getCachingContext() { return cachingContext; }",
"public CacheDao() {\n super(Cache.CACHE, com.scratch.database.mysql.jv.tables.pojos.Cache.class);\n }",
"Goliath.ObjectCache getObjectCache();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructs and initializes a Tuple2f to (0,0). | public Tuple2f()
{
x = 0.0F;
y = 0.0F;
} | [
"public Tuple2f(float x, float y)\n {\n this.x = x;\n this.y = y;\n }",
"public Tuple2f(Tuple2f t)\n {\n x = t.x;\n y = t.y;\n }",
"public Vec2f() {\n\t\tthis(0, 0);\n\t}",
"public Tuple2f(float t[])\n {\n x = t[0];\n y = t[1];\n }",
"public Tuple(X item1, Y item2) {\n this.item1 = item1;\n this.item2 = item2;\n }",
"public Tuple3ifx() {\n\t\tthis(0, 0, 0);\n\t}",
"public Vector2() {\n\t\tthis(0.0f, 0.0f);\n\t}",
"public Vector2f() {\n\t\t//\n\t}",
"public Point2(final ITuple2<T> tuple) {\n\n this(tuple, tuple.getType());\n }",
"public Tuple()\n {\n // Creat a new tuple\n data = new byte[max_size];\n tuple_offset = 0;\n tuple_length = max_size;\n }",
"public Tuple3i() {\n\t\tthis(false, 0, 0, 0);\n\t}",
"public Tuple4i() {\n\t\tthis(false, 0, 0, 0, 0);\n\t}",
"TupleExpr createTupleExpr();",
"public Point2D()\n {\n this.x = this.y = 0f;\n }",
"public Tuple() {\n this(new ArrayList<Object>());\n }",
"TupleFieldRef createTupleFieldRef();",
"public Point2(final ITuple2<? extends Number> tuple,\n final Class<? extends T> returnType) {\n\n super(tuple, returnType);\n if (!tuple.isPoint()) {\n\n throw new IllegalArgumentException(\"Tuple to copy is not a point!\");\n }\n }",
"public T caseTuple2(Tuple2 object)\n {\n return null;\n }",
"public Tuple3b() {\n this.x = (byte) 0;\n this.y = (byte) 0;\n this.z = (byte) 0;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create method to print number list | public void PrintList() {
// Print number list
System.out.println(number_list);
} | [
"private void printNumbers()\n {\n System.out.print(\" \" + \" \" + \" 1 \");\n for (int i = 2; i <= size; i++)\n {\n System.out.print(i + \" \");\n }\n System.out.println();\n }",
"void printList();",
"public void PrintNewList() {\n\t\t// Print new list\n\t\tSystem.out.println(number_list);\n\t}",
"public static <T> void printAsNumberedList(Collection<T> list) {\r\n\t\tint index = 1;\r\n\r\n\t\tfor (T item : list)\r\n\t\t\tSystem.out.println(index++ + \":\\t\" + item);\r\n\t}",
"public void printByNumber() { //print the list of books by number (ascending)\n\t\tif(numBooks>0) {\n\t\t\tSystem.out.println(\"**List of books by the book numbers.\");\n\t\t\t\n\t\t\tmergeSortNum(books,0,numBooks-1);\n\t\t\tfor(int i=0;i<numBooks;i++) {\n\t\t\t\tSystem.out.println(books[i].toString());\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"**End of list\");\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"Library catalog is empty!\");\n\t\t}\n\t}",
"public void printList(){\n\t\tString answer = \"\";\n\t\tfor(int i = 0; i < this.size(); i++){\n\t\t\tanswer += this.portAssignments[i].getNumber() + \" \";\n\t\t}\n\t\tSystem.out.println(answer);\n\t}",
"public void printIntegerList(List<Integer> numberlist) {\n\t\tfor (Integer element : numberlist)\n\t\t\tSystem.out.print(element + \" \");\n\t}",
"private static void printNumber(){\r\n\t\tfor(int i = 1;i <= 10; i++)\r\n\t\t\tSystem.out.println(i);\r\n\t}",
"public static void printList(List<Long> x) {\r\n\t\t//doest attempt if there is elements in the list\r\n\t\tif(x == null)\r\n\t\t\treturn;\r\n\t\t\r\n\t\tIterator<Long> it = x.iterator();\r\n\t\tlong count = 0;\r\n\t\t//while there are number in list\r\n\t\twhile (it.hasNext()) {\r\n\t\t\t//makes a new line ever 5 numbers printed\r\n\t\t\tif (count % 5 == 0)\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t//prints the prime without making a new line\r\n\t\t\tSystem.out.print(it.next() + \"\\t\");\r\n\t\t\tcount++;\r\n\t\t}\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 static void printDigitListContents(ListNode head){\n while(head != null){\n System.out.print(head.val + \" -> \");\n head = head.next;\n }\n System.out.println();\n }",
"public void print() {\n\n\t\tfor (int i = 0; i < guestsList.size(); i++) {\n\n\t\t\tSystem.out.println(i + 1 + \".\" + guestsList.get(i).toString());\n\n\t\t}\n\t\tSystem.out.println();\n\t\tSystem.out.println();\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 }",
"public void print() {\r\n\t\tif (this.filledToIndex > 50) {\r\n\t\t\tSystem.out.println(\"Size: \" + this.filledToIndex);\r\n\t\t\tfor (int i = 0; i < 15; i++) {\r\n\t\t\t\tSystem.out.printf(\"%d\\t%d\\n\", i, numberArray[i]);\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"...\");\r\n\t\t\tfor (int i = filledToIndex - 15; i <= filledToIndex; i++) {\r\n\t\t\t\tSystem.out.printf(\"%d\\t%d\\n\", i, numberArray[i]);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"Size: \" + this.filledToIndex);\r\n\t\t\tfor (int i = 0; i <= filledToIndex; i++) {\r\n\t\t\t\tSystem.out.printf(\"%d\\t%d\\n\", i, numberArray[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void print() {\n\t\tSystem.out.format(\"%11d\", new Integer(value));\n\t}",
"public static void print(LinkedList<Integer> aList)\r\n {\r\n\tIterator<Integer> listIterator = aList.iterator();\r\n\twhile(listIterator.hasNext())\r\n\t{\r\n\t\tSystem.out.print(listIterator.next() + \" \");\r\n\t}\r\n\tSystem.out.print('\\n');\r\n }",
"protected void writeListNumbers(final OutputStream result) throws IOException {\r\n\r\n if(listLevel > 0) {\r\n result.write(RtfList.LIST_LEVEL_NUMBER);\r\n result.write(intToByteArray(listLevel));\r\n }\r\n }",
"public static void print(int[] num, NumberFormatter f){\n \n String printAll = \"\";\n \n \n for(int i = 0; i < num.length; ++i){\n \n System.out.printf(\"%-10s %10s %n\", f.format(num[i]), num[i]);\n printAll += String.format(\"%-10s %10s %n\", f.format(num[i]), num[i]);\n \n }\n \n System.out.println(\"\");\n JOptionPane.showMessageDialog(null,printAll);\n \n }",
"public void print() {\n int n = getSeq().size();\n int m = n / printLength;\n for (int i = 0; i < m; i++) {\n printLine(i * printLength, printLength);\n }\n printLine(n - n % printLength, n % printLength);\n System.out.println();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the logger with the specified name. This creates a new logger if one did not already exist. | public static synchronized Logger getLogger(String name) {
Logger logger;
if (loggers == null) {
loggers = new Hashtable();
logger = null;
} else {
logger = (Logger)loggers.get(name);
}
// Create a new logger if one doesn't already exist
if (logger == null) {
logger = new Logger(name);
loggers.put(name, logger);
}
return logger;
} | [
"public static Logger getLogger(String name) { return loggerRegistry.get(name); }",
"public synchronized static Logger getLogger( final String name ) {\r\n if ( name != null ) {\r\n return LogKernel.nameToLogger.get( name );\r\n } else {\r\n return null;\r\n }\r\n }",
"public static Logger getInstance(String name) {\n return getDefaultFactory().newInstance(name);\n }",
"public Optional<Logger> getLogger(String name) {\n\t\tif (name == null)\n\t\t\tthrow new IllegalArgumentException();\n\n\t\treturn Optional.ofNullable(this.loggers.get(name));\n\t}",
"public static InternalLogger getInstance(String name) {\n return getDefaultFactory().newInstance(name);\n }",
"public static synchronized HeraLogger getLogger(String name) {\n return loggers.computeIfAbsent(name, key -> new HeraLogger(createUniversalLogger(key)));\n }",
"public static Logger getLogger(String name, String logPath) {\n\n Logger newLogger = _loggers.get(name);\n if(newLogger==null) {\n try {\n newLogger = Logger.getLogger(name);\n FileHandler fh;\n int limit = 1000000; // 1 Mb\n int numLogFiles = 3;\n String pattern = name + \"%g\" + \".log\";\n fh = new FileHandler(logPath + pattern, limit, numLogFiles, true);\n fh.setFormatter(new SingleLineFormatter());\n newLogger.addHandler(fh);\n newLogger.setUseParentHandlers(false);\n\n _loggers.put(name, newLogger);\n } catch (SecurityException | IOException e) {\n\n e.printStackTrace();\n }\n }\n return newLogger;\n\t}",
"public static WikiLogger getLogger(String name) {\n \t\tLogger logger = Logger.getLogger(name);\n \t\tif (WikiLogger.DEFAULT_LOG_HANDLER != null) {\n \t\t\tlogger.addHandler(WikiLogger.DEFAULT_LOG_HANDLER);\n \t\t\tlogger.setLevel(DEFAULT_LOG_LEVEL);\n \t\t}\n \t\treturn new WikiLogger(logger);\n \t}",
"public static final LogHelper getLogHelper(final String name) {\n if (LOG_HELPERS_MAP.containsKey(name)) {\n return LOG_HELPERS_MAP.get(name);\n }\n final LogHelper newLogHelper = new LogHelper(name);\n LogHelper logHelper = LOG_HELPERS_MAP.putIfAbsent(name, newLogHelper);\n if (logHelper == null) {\n logHelper = newLogHelper;\n }\n return logHelper;\n }",
"Object createLogger(String name);",
"public Logger getLogger(String loggerId);",
"private static Logger getLogger() {\n if (logger == null) {\n new LoggerWrapper();\n }\n return logger;\n }",
"public static Log getLogger(final String key) {\r\n Log l = null;\r\n if (isRunning()) {\r\n l = getInstance().getLog(key);\r\n }\r\n return l;\r\n }",
"public static Logger getInstance() {\r\n if(logger == null) {\r\n logger = new Logger(false, false);\r\n }\r\n return logger;\r\n }",
"public final Logger getLogger( final String categoryName )\n {\n final Logger logger = (Logger)m_loggers.get( categoryName );\n\n if( null != logger )\n {\n if( getLogger().isDebugEnabled() )\n {\n getLogger().debug( \"Logger for category \" + categoryName + \" returned\" );\n }\n return logger;\n }\n\n if( getLogger().isDebugEnabled() )\n {\n getLogger().debug( \"Logger for category \" + categoryName\n + \" not defined in configuration. New Logger created and returned\" );\n }\n\n return m_hierarchy.getLoggerFor( categoryName );\n }",
"public Log getInstance(String name)\r\n\t\tthrows LogConfigurationException \r\n\t{\r\n\t\tif (logConstructor == null)\r\n\t\t{\r\n\t\t\t// Force to log4j\r\n\t\t\tsetAttribute(LOG_PROPERTY, \"org.apache.commons.logging.impl.Log4JLogger\");\r\n\t\t}\r\n\t\treturn super.getInstance(name);\r\n\t}",
"static TCLogger getCustomerLogger(String name) {\n if (name == null) { throw new IllegalArgumentException(\"name cannot be null\"); }\n\n name = CUSTOMER_LOGGER_NAMESPACE_WITH_DOT + name;\n\n if (CONSOLE_LOGGER_NAME.equals(name)) { throw new IllegalArgumentException(\"Illegal name: \" + name); }\n\n return new TCLoggerImpl(name);\n }",
"private Log getLog(final String key) {\r\n Log l = this.logs.get(key);\r\n\r\n if (l == null) {\r\n l = LogFactory.getLog(key);\r\n\r\n if (l != null) {\r\n this.addLog(key, l);\r\n } else {\r\n throw new IllegalStateException(\"LogUtil : Log4J is not initialized correctly : missing logger [\" + key + \"] = check the log4j configuration file (log4j.xml) !\");\r\n }\r\n }\r\n\r\n return l;\r\n }",
"public static synchronized Logger getLogger() {\n return logger;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ This exitDone method is called when the user leaves the current screen. I a screen such as the play screen one will normally close the level or remove all spatials and controls and lights, etc from the rootNode | @Override
protected void exit() {
touchPickListener.unregisterInput();
cameraJointNode.removeFromParent();
game.close();
marker.removeFromParent();
log("close game");
} | [
"public void exit()\n {\n gameStatus = GameStatus.RETURN_MENU;\n map.stopAllSeeds();\n map.stopAllTrees();\n }",
"public void end()\n\t{\n\t\tStateManager.setState(StateManager.GameState.MAINMENU);\n\t\tStateManager.setGame(null);\n\t}",
"public void onSceneExit() {\r\n update();\r\n }",
"public void finishGame() {\n isSolitaireLoaded = false;\n stats.endTimer();\n main.openFinishedWindow(new View(getContext()));\n }",
"public static void EndGame() {\n\t\tMouse.destroy();\n\t\tisRunning = false;\n\t\tterrainChunks.clear();\n\t\tusedPositions.clear();\n\t\tterrainEntities.clear();\n\t\tentities.clear();\n\t\tfor(int i = 0; i < particleEmitters.size(); i++) {\n\t\t\tparticleEmitters.get(i).CleanUp();\n\t\t}\n\t\tparticleEmitters.clear();\n\t\trenderer.CleanUp();\n\t\tloader.CleanUp();\n\t\tDisplayManager.CloseDisplay();\n\t}",
"public void finishedWindow() {\r\n\t\tgame.closeBattleSCREEN(this);\r\n\t}",
"public void closeScreen(){\r\n Platform.exit();\r\n }",
"public void finishedWindow() {\n\t\tgameE.closeBosslair(this);\n\t}",
"public static void exitGame() {\n exitGame = true;\n }",
"public void exit() {\n\t\tnextPlace = exitName;\n\t\tOrganizer.getOrganizer().deleteSuspended();\n\t\texit(Values.LANDSCAPE);\n\t}",
"public void exitOverlay() {\n\t\tdeRegister(); \n\t}",
"void exitActor();",
"public static void quit() {\n\t\tcurrentScene.close();\n\t\tNetworkManager.stopThread();\n\t\twindow.dispose();\n\t\taudio.dispose();\n\t\tSystem.exit(0);\n\t}",
"private void quitGame() {\n this.primaryStage.close();\n }",
"public void finish(){\n this.player.stop();\n this.painting.stopTimer();\n this.manager.stop();\n this.setVisible(false);\n this.dispose();\n Menue menue = new Menue();\n menue.setVisible(true);\n }",
"@Override\n public void exit() {\n model.exit();\n }",
"public void exitArena(){\n System.out.println(\"WOOLIE: \" + getWinner().getName() + \" leaves arena victorious!\");\n sportsComplex.leaveArena();\n }",
"@FXML\n public void quitGame() throws RemoteException {\n fillProfileData();\n chatClient.enterChatroom();\n if (animationTimer != null) {\n animationTimer.stop();\n }\n if (waitTimer != null) {\n waitTimer.cancel();\n }\n if (serverThread != null && serverThread.isAlive()) {\n serverThread.interrupt();\n }\n updateRoomList(ms.sendGameRoomData());\n setWindows(2);\n gs = null;\n }",
"public void endGame() {\n if (numShots == 0) {\n Window.close();\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ability ability = random.get(position); Name name = ability.getAbility(); String name = name.getName(); | @Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
String Abilityname=random.get(position).getAbility().getName();
// String Typename=random2.get(position).getType().getName();
holder.abilities.setText(Abilityname);
// holder.types.setText(Typename);
// holder.text.setText(Abilityname);
} | [
"public Ability findAbility(String name);",
"@Override\n public String randomReward() {\n return ITEM.getRandomItem().name();\n }",
"void pickName() {\n\t\tString[] names = {\"Spider-Man\",\"Captain America\",\"Thor\",\"The Incredible Hulk\",\"Black Widow\",\"Iron Man\",\"Deadpool\"};\n\t\tint choice = (int) (Math.random() * names.length);\n\t\t\n\t\tthis.name = names[choice];\n\t}",
"public String getAbilityName(int i)\r\n\t{\r\n\t\treturn selectedAbilites.getAbility(i).getName();\r\n\t}",
"int getSlotFromAbility(AbilityBase ability);",
"public Ability getAbility() {\n return (Ability)getValue(\"Effect.ABILITY\");\n }",
"private Astronaut getRandomAstronaut() {\n\t\twhile(roamingAstronauts > 0) {\n\t\t\tint i = random.nextInt(gameObject.size());\n\t\t\tif (gameObject.get(i) instanceof Astronaut)\n\t\t\t\treturn (Astronaut) gameObject.get(i);\n\t\t}\n\t\treturn null;\n\t}",
"public short getAbility();",
"public String getRandomName(){\n Random rand = new Random();\n return data.get(rand.nextInt(data.size()));\n }",
"public String getAbilityType() {\n return abilityType;\n }",
"String getRandomPlayer1Name(){\n return gameBoard.randomPlayer1GetName();\n }",
"private void givaAIRandomName() {\n\t\tRandom rand = new Random();\n\t\tint aiNameID = rand.nextInt(10);\n\n\t\tswitch (aiNameID) {\n\n\t\tcase 0:\n\t\t\tplayerAI.setName(\"Japaneese Naval Marshal General Isoroku Yamamoto\");\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tplayerAI.setName(\"German General Erich von Manstein\");\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tplayerAI.setName(\"US General Omar Bradley\");\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tplayerAI.setName(\"US General Henry Arnold\");\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tplayerAI.setName(\"Soviet General Georgy Zhukov\");\n\t\t\tbreak;\n\t\tcase 5:\n\t\t\tplayerAI.setName(\"Brittish General Bernard Montgomery\");\n\t\t\tbreak;\n\t\tcase 6:\n\t\t\tplayerAI.setName(\"US General Douglas MacArthur\");\n\t\t\tbreak;\n\t\tcase 7:\n\t\t\tplayerAI.setName(\"General Dwight D. Eisenhower\");\n\t\t\tbreak;\n\t\tcase 8:\n\t\t\tplayerAI.setName(\"German Field Marshal Erwin Rommel\");\n\t\t\tbreak;\n\t\tcase 9:\n\t\t\tplayerAI.setName(\"US General George S. Patton\");\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t}",
"public void abilityOne() {\n ability(map.getCurrentTurnHero().getAbilities().get(0));\n }",
"@Override\n\tpublic String getFortune() {\n\t\tint index = random.nextInt(data.length);\n\t\t\n\t\tString fortune = data[index];\n\t\t\n\t\treturn fortune;\n\t}",
"AbilityDamage getAbilityDamage();",
"public static String randomName()\n\t{\n\t\treturn names[random.nextInt(names.length)];\n\t}",
"public T getRandomElement() {\n\t\treturn this.itemList.get(this.getRandomIndex());\n\t}",
"public String getAbilityID() {\n return abilityID;\n }",
"public interface AbilityType {\r\n\t\r\n\t/** When an ability is used, all its components will call this method. \r\n\t * From here they can exert their effect on the battle. */\r\n\tpublic void use(BattleCreature cr, BattleModel bm, float arg0, float arg1, float arg2);\r\n\tpublic abstract String getAbilityName();\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
.yandex.cloud.ai.stt.v2.RecognitionConfig config = 1; | @java.lang.Override
public yandex.cloud.api.ai.stt.v2.SttServiceOuterClass.RecognitionConfigOrBuilder getConfigOrBuilder() {
return getConfig();
} | [
"yandex.cloud.api.ai.stt.v2.SttServiceOuterClass.RecognitionConfig getConfig();",
"yandex.cloud.api.ai.stt.v2.SttServiceOuterClass.RecognitionConfigOrBuilder getConfigOrBuilder();",
"PredictionConfig prediction();",
"public Builder setConfig(yandex.cloud.api.ai.stt.v2.SttServiceOuterClass.RecognitionConfig value) {\n if (configBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n config_ = value;\n onChanged();\n } else {\n configBuilder_.setMessage(value);\n }\n\n return this;\n }",
"com.google.cloud.speech.v2.Recognizer getRecognizer();",
"private RecognitionConfig(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }",
"speech.multilang.Params.ScoringControllerParams.Type getType();",
"speech.multilang.Params.DecisionPointParams.Type getType();",
"com.czht.face.recognition.Czhtdev.Response getResponse();",
"speech.multilang.Params.ForwardingControllerParams.Type getType();",
"com.czht.face.recognition.Czhtdev.Request getRequest();",
"speech.multilang.Params.OutputControllerParams.Type getType();",
"com.google.cloud.speech.v2.RecognizerOrBuilder getRecognizerOrBuilder();",
"yandex.cloud.api.ai.stt.v2.SttServiceOuterClass.RecognitionAudio getAudio();",
"@Override\n\tpublic void configureGAN() {\n\t\tGANProcess.type = GANProcess.GAN_TYPE.LODE_RUNNER;\n\t}",
"yandex.cloud.api.ai.stt.v2.SttServiceOuterClass.RecognitionSpec getSpecification();",
"com.google.cloud.videointelligence.v1p3beta1.TextDetectionConfig getTextDetectionConfig();",
"yandex.cloud.api.ai.stt.v2.SttServiceOuterClass.SpeechRecognitionAlternative getAlternatives(int index);",
"private void initPockerSphinx() {\n\n new AsyncTask<Void, Void, Exception>() {\n @Override\n protected Exception doInBackground(Void... params) {\n try {\n\n Assets assets = new Assets(mContext);\n File assetDir = assets.syncAssets();\n\n //Creates a new speech recognizer builder with default configuration\n SpeechRecognizerSetup speechRecognizerSetup = SpeechRecognizerSetup.defaultSetup();\n\n // For Setting The Language\n speechRecognizerSetup.setAcousticModel(new File(assetDir, \"en-us-ptm\"));\n speechRecognizerSetup.setDictionary(new File(assetDir, \"cmudict-en-us.dict\"));\n\n // For Sensivity\n speechRecognizerSetup.setKeywordThreshold(1e-20f);\n\n //Creates a new SpeechRecognizer object\n mPocketSphinxRecognizer = speechRecognizerSetup.getRecognizer();\n\n // Adds KEYWORD and Listener\n mPocketSphinxRecognizer.addKeyphraseSearch(KWS_SEARCH, KEYPHRASE);\n mPocketSphinxRecognizer.addListener(new PocketSphinxRecognitionListener());\n } catch (IOException e) {\n return e;\n }\n return null;\n }\n\n @Override\n protected void onPostExecute(Exception result) {\n if (result != null) {\n Toast.makeText(mContext, \"Failed to init pocketSphinxRecognizer \", Toast.LENGTH_SHORT).show();\n } else {\n restartSearch(KWS_SEARCH);\n }\n }\n }.execute();\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the pub associated with the view | public void setPub(Pub pub) {
this.pub = pub;
} | [
"public void setPubAt(Date pubAt) {\n this.pubAt = pubAt;\n }",
"public void setPubDate(Date pubDate) {\n this.pubDate = pubDate;\n }",
"public void setPublish(java.lang.Object publish) {\n this.publish = publish;\n }",
"public void setPublish(String publish) {\n this.publish = publish;\n }",
"public Pub getPub() {\n return pub;\n }",
"public void setPubId(long value) {\r\n this.pubId = value;\r\n }",
"public void setPub(String pubID) throws NotFoundInBackendException, NoBackendAccessException, BackendNotInitializedException;",
"public void setPublishDate(Date publishDate);",
"public void setPubid (java.lang.Integer pubid) {\r\n\t\tthis.pubid = pubid;\r\n\t}",
"public trans.encoders.relayVote.RelayVote.Builder setPublished(java.lang.Long value) {\n validate(fields()[5], value);\n this.published = value;\n fieldSetFlags()[5] = true;\n return this; \n }",
"public void setPublisher(String publisher);",
"public void setPublication(Publication publication) {\n this.publication = publication;\n }",
"public void setPublishDate(Date publishDate) {\r\n this.publishDate = publishDate;\r\n }",
"public String getPublish() {\n return publish;\n }",
"public void setPublication(String publication) {\n this.publication = publication;\n }",
"void setPublic(boolean view, boolean edit);",
"public void setPublish_tm(Date publish_tm) {\n this.publish_tm = publish_tm;\n }",
"public void setPublishAt(Date publishAt) {\n this.publishAt = publishAt;\n }",
"void setPublishedDate(Date publishedDate);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method sets a bead in a given position on the grid, creating an instance of Bead and adding it to the list of beads. It first makes some controls on the validity of the position given, in particular if the bead is placed in a hole, which is illegal by the game rules, and if a grid cell has already another bead. Each coordinate of the position of the bead is given in a number starting from 0 up to 6, while the number of the player is a number from 1 to 4. | public GridHole placeBeadOnGrid(int x, int y, int playerNumber) throws GameException {
// must check validity of the coordinate
if ((x < 0 || x >= Utility.GRID_SIDE) || (y < 0 || y >= Utility.GRID_SIDE)) {
throw new GameException("error: the cell on which you want to place your bead is outside the boundaries of the grid. Pick another position.");
}
if (gridHoles[x][y] == GridHole.HOLE) {
throw new GameException("error: you can't put a bead in a hole. Put it either on a vertical bar or on a horizontal bar.");
}
else if (gridHoles[x][y] == GridHole.VERTICAL) {
for (Bead bead : beads) {
if (bead == null)
break;
if (bead.getXCoordinate() == x && bead.getYCoordinate() == y)
throw new GameException("bead: " + bead + "; grid hole: " + gridHoles[x][y] + "; error: the cell on which you want to place your bead has already another bead. Pick another cell.");
}
Bead bead = new Bead(playerNumber, players[playerNumber].getName(), x, y);
bead.setOnVertical(true);
bead.setHasFallen(false);
beads[beadCounter] = bead;
beadCounter++;
}
else if (gridHoles[x][y] == GridHole.HORIZONTAL) {
for (Bead bead : beads) {
if (bead == null)
break;
if (bead.getXCoordinate() == x && bead.getYCoordinate() == y)
throw new GameException("bead: " + bead + "; grid hole: " + gridHoles[x][y] + "; error: the cell on which you want to place your bead has already another bead. Pick another cell.");
}
Bead bead = new Bead(playerNumber, players[playerNumber].getName(), x, y);
bead.setOnVertical(false);
bead.setHasFallen(false);
beads[beadCounter] = bead;
beadCounter++;
}
return gridHoles[x][y];
} | [
"public void addBeesToMatrix() {\r\n int i;\r\n int j;\r\n int k;\r\n for (int b = 0; b < this.numberOfBees; b++) {\r\n Bee3D bee = this.beesArray[b];\r\n i = (int) (Math.abs(Math.abs(bee.getLongitude()) - Math.abs(minLO)) * distanceLongi / precission) + offset + 1;\r\n j = (int) (Math.abs(Math.abs(bee.getLatitude()) - Math.abs(minLA)) * distanceLat / precission) + offset + 1;\r\n k = (int) (Math.abs(Math.abs(bee.getHeight()) - Math.abs(minH)) / precission) + offset + 1;\r\n bee.setI(i);\r\n bee.setJ(j);\r\n bee.setK(k);\r\n if (BeesCollision[i][j][k] == null) {\r\n BeesCollision[i][j][k] = new LinkedList<>();\r\n BeesCollision[i][j][k].add(bee);\r\n } else {\r\n BeesCollision[i][j][k].add(bee);\r\n bee.setCollision(true);\r\n BeesCollision[i][j][k].getFirst().setCollision(true);\r\n }\r\n }\r\n }",
"private void generateBearPosition(){\n Random random = new Random();\n int x;\n int y;\n\n do{\n x = random.nextInt(Constants.FIELD_SIZE);\n y = random.nextInt(Constants.FIELD_SIZE);\n } while((field[x][y].isCharacter()) || ((x == 0) && (y == 1))\n || ((x == 1) && (y == 0)) || ((x == 0) && (y == 0)));\n\n field[x][y].addStatus(Status.BEAR);\n if(x > 0)\n field[x - 1][y].addStatus(Status.BEAR_RANGE);\n\n\n if(x < Constants.FIELD_SIZE - 1)\n field[x + 1][y].addStatus(Status.BEAR_RANGE);\n\n\n if(y > 0)\n field[x][y - 1].addStatus(Status.BEAR_RANGE);\n\n\n if(y < Constants.FIELD_SIZE - 1)\n field[x][y + 1].addStatus(Status.BEAR_RANGE);\n\n if((x > 0) && (y > 0))\n field[x - 1][y - 1].addStatus(Status.BEAR_RANGE);\n if((x > 0) && (y < Constants.FIELD_SIZE - 1))\n field[x - 1][y + 1].addStatus(Status.BEAR_RANGE);\n if((x < Constants.FIELD_SIZE - 1) && (y > 0))\n field[x + 1][y - 1].addStatus(Status.BEAR_RANGE);\n if((x < Constants.FIELD_SIZE - 1) && (y < Constants.FIELD_SIZE - 1))\n field[x + 1][y + 1].addStatus(Status.BEAR_RANGE);\n }",
"void setBattleFieldElement(int x, int y, BattleFieldElement b) throws IllegalElementException, IllegalPositionException{\n \t \t\n if ((x == rows-1) && (!b.toString().equals(\"G\")) && (!b.toString().equals(\"-\"))) \n \t\t\t\tthrow new IllegalElementException(\"Only a Gun can be placed in row \"+(rows-1)+\" (bottom)\");\n \t \telse \n \t\t\t\tbattlefield[x][y]= b;\n \t \t\n \n \t if(b.toString().equals(\"G\") && x != rows-1)\n throw new IllegalPositionException(\"The Gun must be placed in the bottom line of the BattleField\");\n else \n if(b.toString().equals(\"G\") && gunCounter>0)\n throw new IllegalElementException(\"Only one Gun per BattleField\");\n else{\n \t\t battlefield[x][y]= b;\n \t\t gunCounter++; \n }\n \n \n \n \n \t\t\n \t}",
"private void createBrickElements() {\n this.settings.setGameOver(false);\n topBricks = new BrickCollection(this.settings.getDifficulty(), this.settings.isArcade(), Orientation.TOP);\n leftBricks = new BrickCollection(this.settings.getDifficulty(), this.settings.isArcade(), Orientation.LEFT);\n rightBricks = new BrickCollection(this.settings.getDifficulty(), this.settings.isArcade(), Orientation.RIGHT);\n bottomBricks = new BrickCollection(this.settings.getDifficulty(), this.settings.isArcade(), Orientation.BOTTOM);\n field = new Field(this.settings.getDifficulty(), this.settings.getLevel() - 1, \n leftBricks, rightBricks, topBricks, bottomBricks);\n }",
"public void placeBoat(int boatIndex, int startX, int startY, int endX, int endY) throws InvalidPlacementException {\n System.out.println(\"placeBoat(): boatNum \" + boatIndex);\n Boat toPlace = getBoatAt(boatIndex);\n //checking if coordinates are within GRID_DIMENSIONS\n if (!withinGridDimensions(startX, startY, endX, endY)) {\n throw new InvalidPlacementException(\"Your boat isn't on the grid. \");\n }\n \n //checking for any boat overlapping\n if (doesBoatOverlap((startX-1), (startY-1), (endX-1), (endY-1))) {\n throw new InvalidPlacementException(\"There is already a boat in the area you selected. \");\n }\n \n //checking that the coordinates match boat's length\n if (((startX==endX) && (Math.abs(endY-startY)!=toPlace.getLength()-1)) || ((startY==endY) && (Math.abs(endX-startX)!=toPlace.getLength()-1))) {\n System.out.println(startX +\" \" + endX + \"diff in Y: \" + (endY-startY));\n System.out.println(startY +\" \" + endY + \"diff in X: \" + (endX-startX));\n throw new InvalidPlacementException(\"Your boat isn't the right length.\");\n }\n \n //ensures boat is vertical/horizontal\n if ((startX != endX) && (startY != endY)) {\n throw new InvalidPlacementException(\"You need to make your boat either vertical or horizontal.\");\n }\n \n //setting boat's start and end coordinates\n toPlace.setStartX(startX);\n toPlace.setStartY(startY);\n System.out.println(\"placeBoat(): StartX, Y = \" + toPlace.getStartX()+\" \"+\n toPlace.getStartY());\n toPlace.setEndX(endX);\n toPlace.setEndY(endY);\n System.out.println(\"placeBoat(): EndX, Y = \" + toPlace.getEndX()+\" \"+\n toPlace.getEndY());\n \n //setting all checked coordinates of boat to have a boat\n int gridStartX = Math.min(startX, endX);\n int gridEndX = Math.max(startX, endX);\n int gridStartY = Math.min(startY, endY);\n int gridEndY = Math.max(startY, endY);\n if (gridStartX==gridEndX) {\n for (int j = gridStartY; j <= gridEndY; j++) {\n grid[gridStartX-1][j-1].setHasBoat(true); //0indexing\n System.out.println(\"grid[\"+(gridStartX-1)+\"][\"+(j-1)+\"] hasBoat: \"+grid[gridStartX-1][j-1].getHasBoat());\n }\n } else if (gridStartY==gridEndY) {\n for (int i = gridStartX; i <= gridEndX; i++) {\n grid[i-1][gridStartY-1].setHasBoat(true); //o-indexing\n System.out.println(\"grid[\"+(i-1)+\"][\"+(gridStartY-1)+\"] hasBoat: \"+grid[i-1][gridStartY-1].getHasBoat());\n }\n }\n System.out.println(\"Boat \" + (boatIndex+1) + \"'s coordinates have successfully been set!~*~!~*~!*~!~*~!\");\n }",
"public void spawnBomb(Context context, Grid grid, Int2 cellSize) {\n Int2 spawnpos = gridPosition;\n // switch based on position you're facing\n switch (heading) {\n case UP:\n spawnpos = gridPosition.addReturn(new Int2(0, -1));\n break;\n\n case DOWN:\n spawnpos = gridPosition.addReturn(new Int2(0, 1));\n break;\n\n case LEFT:\n spawnpos = gridPosition.addReturn(new Int2(-1, 0));\n break;\n\n case RIGHT:\n spawnpos = gridPosition.addReturn(new Int2(1, 0));\n break;\n }\n\n if (grid.getCellStatus(spawnpos) == (CellStatus.EMPTY)) {\n bomb = new Bomb(context, spawnpos, cellSize);\n grid.setCell(spawnpos, CellStatus.BOMB);\n }\n }",
"public Coordinates[] placeBoats(int size) {\n Coordinates[] cell = new Coordinates[size]; // an array of coordinate objects that is later going to be used as a parameter for the boat object\n boolean is_placed = false; // boolean that checks if a boat has been placed on a give location on the board.\n int Random_x = (int) Math.floor(Math.random() * this.nrows); // picks a random x coordinate to place a boat\n int Random_y = (int) Math.floor(Math.random() * this.ncols); // picks a random y coordinate to place a boat\n while (is_placed == false) {\n Boolean is_empty = true; // a boolean that is used to check whether the space on the right side of the random x,y coordinate is empty\n Boolean is_empty2 = true; // a boolean that is used to check whether the space on the left side of the random x,y coordinate is empty\n Boolean is_empty3 = true; // a boolean that is used to check whether the space on the upper side of the random x,y coordinate is empty\n Boolean is_empty4 = true; // a boolean that is used to check whether the space on the bottom side of the random x,y coordinate is empty\n /* checks if the location of the right side of the random x,y is empty*/\n if (Random_y + size <= this.nrows) {\n for (int i = 0; i < size; i++) {\n if (!this.board[Random_x][Random_y + i].equals(\"0\")) {\n is_empty = false;\n break;\n }\n\n }\n }\n /* checks if the location of the left side of the random x,y is empty*/\n if (Random_y - size >= 0) {\n for (int i = 0; i < size; i++) {\n if (!this.board[Random_x][Random_y - i].equals(\"0\")) {\n is_empty2 = false;\n break;\n }\n }\n }\n /* checks if the location of the upper side of the random x,y is empty*/\n if (Random_x + size <= this.nrows) {\n for (int i = 0; i < size; i++) {\n if (!this.board[Random_x + i][Random_y].equals(\"0\")) {\n is_empty3 = false;\n break;\n }\n }\n }\n /* checks if the location of the lower side of the random x,y is empty*/\n if (Random_x - size >= 0) {\n for (int i = 0; i < size; i++) {\n if (!this.board[Random_x - i][Random_y].equals(\"0\")) {\n is_empty4 = false;\n break;\n }\n }\n }\n /*checks is the right side of the random x,y location is both empty and there is enough room to place a boat of a given size there.\n if both those conditions are true that it places a boat there*/\n if ((int) Math.floor(Math.random() * 10) % 2 == 0) {\n if (Random_y + size <= this.nrows && is_empty == true) {\n for (int i = 0; i < size; i++) {\n this.board[Random_x][Random_y + i] = String.valueOf(size);\n cell[i] = new Coordinates(Random_x, Random_y + i); // fills the cell array with coordinate objects\n }\n is_placed = true;\n }\n /*checks is the left side of the random x,y location is both empty and there is enough room to place a boat of a given size there.\n if both those conditions are true that it places a boat there*/\n else if ((Random_y - size >= 0 && is_empty2 == true)) {\n for (int i = 0; i < size; i++) {\n this.board[Random_x][Random_y - i] = String.valueOf(size);\n cell[i] = new Coordinates(Random_x, Random_y - i); // fills the cell array with coordinate objects\n }\n is_placed = true;\n }\n }\n /*checks is the upper side of the random x,y location is both empty and there is enough room to place a boat of a given size there.\n if both those conditions are true that it places a boat there*/\n else {\n if ((Random_x + size <= this.nrows && is_empty3 == true)) {\n for (int i = 0; i < size; i++) {\n this.board[Random_x + i][Random_y] = String.valueOf(size);\n cell[i] = new Coordinates(Random_x + i, Random_y); // fills the cell array with coordinate objects\n }\n is_placed = true;\n }\n /*checks is the bottom side of the random x,y location is both empty and there is enough room to place a boat of a given size there.\n if both those conditions are true that it places a boat there*/\n else if ((Random_x - size >= 0 && is_empty4 == true)) {\n for (int i = 0; i < size; i++) {\n this.board[Random_x - i][Random_y] = String.valueOf(size);\n cell[i] = new Coordinates(Random_x - i, Random_y ); // fills the cell array with coordinate objects\n }\n is_placed = true;\n }\n }\n if (is_placed == false) {\n Random_x = (int) Math.floor(Math.random() * this.nrows); // if all directions of the x,y do not work this picks a new random x location\n Random_y = (int) Math.floor(Math.random() * this.ncols); // if all directions of the x,y do not work this picks a new random y location\n }\n }\n return cell; // returns the cell array\n }",
"private void placeBomb() {\n\t\tint x = ran.nextInt(worldWidth);\n\t\tint y = ran.nextInt(worldHeight);\n\n\t\tif (!tileArr[x][y].hasBomb()) {\n\t\t\ttileArr[x][y].setBomb(true);\n\n\t\t\tindex.add(\"Index\" + x + \",\" + y); // ADDED COMPONENT\n\t\t\trevealed.put(index, true);\n\t\t\tindex.removeFirst();\n\n\t\t} else {\n\t\t\tindex.add(\"Index\" + x + \",\" + y); // ADDED COMPONENT\n\t\t\trevealed.put(index, false);\n\t\t\tindex.removeFirst();\n\t\t\tplaceBomb();\n\t\t}\n\n\t}",
"public void Populate(int bombs) {\n\t\tint row = 0,col = 0,randnumber = 0;\n\t\tRandom rnd = new Random();\n\t\t\n\t\t// array list of every position on grid\n\t\tcoordinate = new ArrayList<Integer>(height*width);\n\t\tfor(int i = 0;i<height*width;i++) {\n\t\t\tcoordinate.add(i);\n\t\t}\n\t\t\n\t\tfor(int i = 0;i<bombs;i++) {\n\t\t\t// randomly chooses a position to put a bomb in\n\t\t\trandnumber = rnd.nextInt(coordinate.size());\n\t\t\tbomblocate[i] = coordinate.get(randnumber);\n\t\t\trow = coordinate.get(randnumber)/width;\n\t\t\tcol = coordinate.get(randnumber)%width;\n\t\t\tgrid[row][col] = 9;\n\t\t\t\n\t\t\tUpdateSurround(row,col);\n\t\t\t\n\t\t\t// removes the possible position from array list\n\t\t\tcoordinate.remove(randnumber);\n\t\t}\n\t}",
"private void placeBomb(int x, int y, int newValue) {\n setCell(x, y, newValue); // a: Turns this cell into a bomb\n ++bombsPlaced; // b: increments bombs placed\n GridHelper.oneUpAll(x, y, hiddenGrid); // b: Increments all cells surrounding the new bomb\n }",
"public void setBoard() {\n\t\tboard= new Cell[LEVELS][SIZE][SIZE];\t//we define the board as an 3D array of cells, one that will get the level and the other the X and Y coordinate.\n\t\tfor(int level=0;level<board.length;level++) {\t//for loop changing the level creating (not initializing or adding the images)\n\t\t\tfor(int ii=0;ii<board[level].length;ii++){\t//X coordinates\n\t\t\t\tfor(int jj=0;jj<board[level][ii].length;jj++){\t//Y coordinates\n\t\t\t\t\tif((ii==0)||(ii==board[level].length -1)||(jj==0)||(jj==board[level][ii].length -1) || ((ii%2==0) && (jj%2==0))){\n\t\t\t\t\t\tboard[level][jj][ii] = new Cell (\"wall\"); //this puts walls on the framework of the board and alternated on the regular cells\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tboard[level][jj][ii]= new Cell(\"regular\"); //this avoid nullpointers and set the regular cells\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tnBricks=50; //there will be 50 bricks on each level.\n\t\t\twhile(nBricks>0) { //Setting the 50 bricks\n\t\t\t\tint x=(int)(Math.random()*17); //coordinates chosen randomly \n\t\t\t\tint y=(int)(Math.random()*17); //17 coordinates because we got from 0 to 16, in x and y\n\t\t\t\tif(!getCell(level,y, x).getType().equals(\"wall\")&&!getCell(level,y, x).getType().equals(\"brick\")&&!(x==1&&y==1)&&!(x==1&&y==2)&&!(x==2&&y==1)){ //we verify that the brick wont go to a cell which already has a wall or a brick, and that no bricks appear at the cell next to the player (upper right corner) so you dont get stucked.\n\t\t\t\t\tboard[level][x][y]=new Cell (\"brick\");\t//create a new cell of type brick at the coordinates that verified the conditions.\n\t\t\t\t\tnBricks--;\t\n\t\t\t\t}\t\t\t\n\t\t\t}\n\n\t\t\tfor(int ii=0;ii<board[level].length;ii++){\t//by defect every cell will have \"regular\" bonus (with no effect).\n\t\t\t\tfor(int jj=0;jj<board[level][ii].length;jj++){\n\t\t\t\t\tsetRegularBonus(level, ii, jj);\n\t\t\t\t}\n\t\t\t}\n\t\t\tsetnBonus(level);\t//in this method we choose the numbers of bonus of each type depending on the level we are.\n\t\t\tsetBonus(level);\t//here we set them at their correct position.\n\n\t\t}\n\t}",
"protected Vector3 generateBaboPosition() {\n \tVector3 position = new Vector3();\n \tVector3 bp = new Vector3();\n \tfloat max = 0;\n \tfor( int i = 0; i < map.getCells().size; i++ ) {\n \t if( map.getCells().get(i).getType().equals(Map.TYPE_GROUND) ) {\n \t Vector3 cp = map.getCells().get(i).getPosition();\n \t float sumTmp = 0;\n \t for( int j = 0; j < babos.size; j++ ) {\n \t if( babos.get(j).getState() == Babo.STATE_ALIVE ) {\n \t bp = babos.get(j).getPosition();\n \t sumTmp += Vector3.dst(cp.x, cp.y, cp.z, bp.x, bp.y, bp.z);\n \t }\n \t }\n \t \n \t if( sumTmp > max ) {\n \t \tmax = sumTmp;\n \t position.set(cp);\n \t }\n \t }\n \t}\n \t\n \tposition.y = BaboViolentGame.BABO_DIAMETER + 0.001f;\n \t\n \treturn position;\n }",
"void initializeGrid() {\n int maxBombs = GridHelper.getMaxBombs((int)Math.pow(hiddenGrid.length, 2.0)); // A: How many bombs CAN this have?\n bombsPlaced = 0; // B: How many bombs DOES this have?\n int cycleCap = randomCycleCap(); // C: Sets cycleCap to a randomly generated number between 0 and 15,\n int cycleCellCount = 0; // D: cycleCap starts at zero and goes up\n\n for (int i = 0; i < hiddenGrid.length; i++) {\n for (int j = 0; j < hiddenGrid[i].length; j++) {\n\n if (hiddenGrid[i][j] == null) {\n setCell(i, j, 0); // a: initializes the null value to 0\n }\n if((cycleCellCount == cycleCap) && (bombsPlaced < maxBombs)){\n placeBomb(i, j, -1); // a: turns this cell into a bomb, increments cells around it\n cycleCellCount = 0; // b: Restarts the 'cycle counter'\n cycleCap = randomCycleCap(); // c: Gives us a new number to 'count down' to, to place the next bomb\n } else{\n ++cycleCellCount; // a. Moves to the next cell in the 'cycle' having done nothing\n }\n }\n }\n System.out.println(\"Bombs placed: \" + bombsPlaced);\n }",
"public void setBlocks() {\n for (int i = 0; i < positions.length; i++) {\n do {\n positions[i] = board.getRandomPosition();\n } while (board.getLockCell(positions[i]).isLocked());\n board.lock(positions[i]);\n LOG.info(String.format(\"Block №%d is mounted on the coordinates x=%d y=%d\",\n i,\n positions[i].getX(),\n positions[i].getY())\n );\n }\n }",
"public void create(){\n\t\t//creating board to keep track of player postion with 1 or 0. 0 if not there 1 if they are there\n\t\tfor(int i = 0; i <this.position.length; i++){\n\t\t\tfor(int p = 0; p < this.position.length; p++){\n\t\t\t\tthis.position[i][p] = 0;//filling with zero\n\t\t\t}\n\t\t}//end of position making board\n\t\tthis.position[1][1] = 1;//putting player in this position\n\n\t\t//creating door in the rooms\n\t\tfor(int i = 0; i <this.Door.length; i++){\n\t\t\tfor(int p = 0; p < this.Door.length; p++){\n\t\t\t\tthis.Door[i][p] = 0;//filling with zero\n\t\t\t}\n\t\t}//end of Door making board\n\t\tthis.Door[9][13] = 1;//puts the door here \n\n\t\t//makes board that tells if item is there\n\t\tfor(int i = 0; i <this.Items.length; i++){\n\t\t\tfor(int p = 0; p < this.Items.length; p++){\n\t\t\t\tthis.Items[i][p] = null;//filling with null\n\t\t\t}\n\t\t}//end of filling board that has items\n\n\t\t//makes border of room\n\t\tfor(int i = 0; i < this.area.length; i++){\n\t\t\tfor(int p = 0; p<this.area.length; p++){\n\t\t\t\tif(i==0){\n\t\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t\t}\n\t\t\t\telse if (p==0 || p==19){\n\t\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t\t}\n\t\t\t\telse if(i==19){\n\t\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tthis.area[i][p] = \" \";\n\t\t\t\t}\n\t\t\t}//end of innner for\n\t\t}//end of outter for\n\t\tfor(int i = 4; i< 5 ; i++){\n\t\t\tfor(int p = 4; p < 7; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 4; i< 5 ; i++){\n\t\t\tfor(int p = 4; p < 7; p++){\n\t\t\t\tthis.area[p][i] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 7; i< 8 ; i++){\n\t\t\tfor(int p = 2; p < 7; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 17; i< 18 ; i++){\n\t\t\tfor(int p = 13; p < 17; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\t\n\t\t}\n\t\tfor(int i = 14; i< 15 ; i++){\n\t\t\tfor(int p = 13; p < 17; p++){\n\t\t\t\tthis.area[p][i] = \"[ ]\";\n\t\t\t}\t\n\t\t}\t\n\t\tfor(int i = 11; i< 12 ; i++){\n\t\t\tfor(int p = 10; p < 17; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 15; i< 16 ; i++){\n\t\t\tfor(int p = 3; p < 6; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 16; i< 17 ; i++){\n\t\t\tfor(int p = 6; p < 13; p++){\n\t\t\t\tthis.area[p][i] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 12; i< 13 ; i++){\n\t\t\tfor(int p = 5; p < 10; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t\tSystem.out.println(\" \");\n\t\t}//end of for that creates walls\t\n\n\t\t//for loop that distributes items\n\t\tint y = 0;\n\t\tint x = 0;\n\t\tfor(int i = 0;i<10;i++){\n\t\t\tItem thing = ItemGenerator.generate();//making an item\n\t\t\tboolean good = false;\n\t\t\twhile(!good){//makes coordates until there is nothing in the way\n\t\t\t\ty = fate.nextInt(20);//getting coordiantaes \n\t\t\t\tx = fate.nextInt(20);\n\t\t\t\tif(this.Items[y][x]==null && this.area[y][x] != \"[ ]\"){\n\t\t\t\t\tgood = true;\n\t\t\t\t}//end of if\n\t\t\t\telse{ \n\t\t\t\t\tgood = false;\n\t\t\t\t}\n\t\t\t}//end of while\n\t\t\tItems[y][x] = thing;\n\t\t}//end of for that distributes items on board\n\n\t}",
"public void spawn(int bees) {\r\n this.numBees += bees;\r\n }",
"public void setPieces(){\r\n Pawn[] arrwPawn = new Pawn[8];\r\n for (int i=0 ; i<8 ; i++){\r\n pos.setPosition(6,i);\r\n arrwPawn[i] = new Pawn (pos , piece.Colour.WHITE);\r\n GameBoard.putPiece(arrwPawn[i]);\r\n }\r\n\r\n Pawn[] arrbPawn = new Pawn[8];\r\n for(int i=0 ; i<8 ; i++){\r\n pos.setPosition(0,i);\r\n arrbPawn[i] = new Pawn(pos , piece.Colour.BLACK);\r\n GameBoard.putPiece(arrbPawn[i]);\r\n }\r\n\r\n\r\n //set black pieces in the board\r\n\r\n pos.setPosition(0,0);\r\n Rook bRook1 = new Rook(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bRook1);;\r\n\r\n pos.setPosition(0,7);\r\n Rook bRook2 = new Rook(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bRook2);\r\n\r\n\r\n pos.setPosition(0,1);\r\n Knight bKnight1 = new Knight(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bKnight1);\r\n\r\n pos.setPosition(0,6);\r\n Knight bKnight2 = new Knight(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bKnight1);\r\n\r\n pos.setPosition(0,2);\r\n Bishop bBishop1 = new Bishop(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bBishop1);\r\n\r\n pos.setPosition(0,5);\r\n Bishop bBishop2 = new Bishop(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bBishop2);\r\n\r\n pos.setPosition(0,3);\r\n Queen bQueen = new Queen(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bQueen);\r\n\r\n pos.setPosition(0,4);\r\n King bKing = new King(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bKing);\r\n\r\n //set white pieces in the board\r\n\r\n pos.setPosition(7,0);\r\n Rook wRook1 = new Rook(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wRook1);\r\n\r\n pos.setPosition(7,7);\r\n Rook wRook2 = new Rook(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wRook2);\r\n\r\n pos.setPosition(7,1);\r\n Knight wKnight1 = new Knight(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wKnight1);\r\n\r\n pos.setPosition(7,6);\r\n Knight wKnight2 = new Knight(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wKnight1);\r\n\r\n pos.setPosition(7,2);\r\n Bishop wBishop1 = new Bishop(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wBishop1);\r\n\r\n pos.setPosition(7,5);\r\n Bishop wBishop2 = new Bishop(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wBishop2);\r\n\r\n pos.setPosition(7,3);\r\n Queen wQueen = new Queen(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wQueen);\r\n\r\n pos.setPosition(7,4);\r\n King wKing = new King(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wKing);\r\n\r\n\r\n\r\n Rook arrwRook[] = {wRook1,wRook2};\r\n Rook arrbRook[] = {bRook1,bRook2};\r\n Queen arrwQueen[] = {wQueen};\r\n Queen arrbQueen[] = {bQueen};\r\n Knight arrwKnight[] = {wKnight1,wKnight2};\r\n Knight arrbKnight[] = {bKnight1,bKnight2};\r\n King arrwKing[] = {wKing};\r\n King arrbKing[] = {bKing};\r\n Bishop arrwBishop[] = {wBishop1,wBishop2};\r\n Bishop arrbBishop[] = {bBishop1,bBishop2};\r\n }",
"void assignBeefHeads() {\n beefHeads = 1;\n if (faceValue % 5 == 0) { beefHeads++; }\n if (faceValue % 10 == 0) { beefHeads++; }\n if (faceValue % 11 == 0) { beefHeads = beefHeads + 4; }\n if (faceValue == 55) { beefHeads++; }\n }",
"private void setBearing()\n {\n // Check if the bearing array doesn't exist or have any contents\n if(bearings == null || bearings.isEmpty())\n {\n Logger.error(TAG, \"No bearings to iterate through\");\n\n // If there is a model, set it to use the no texture material\n if(model != null)\n {\n model.setMaterial(noTexture);\n }\n }\n else\n {\n // Check if the bearing index is within range of the array\n if(bearingArrayIndex >= bearings.size())\n {\n bearingArrayIndex = 0;\n }\n else if(bearingArrayIndex < 0)\n {\n bearingArrayIndex = bearings.size() - 1;\n }\n\n // Set the new current bearing\n currentBearing = bearings.get(bearingArrayIndex);\n\n // Set the selected object text to display the name of the new bearing\n selectedObjectText.setText(currentBearing.name);\n\n Logger.info(\"Switching bearing to ID[\" + currentBearing.id + \"]: \" +\n currentBearing.name);\n\n // If the model exists, set the material to the new bearing\n if(model == null)\n {\n Logger.error(TAG, \"Model does not exist. Cannot set material.\");\n }\n else\n {\n model.setMaterial(bearingMaterials.get(currentBearing.id));\n }\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
MS Level 2: We have commented the below part of return statement, since it will not support timeouts issue return new RestTemplate(); // restTemplates will be obsolete after sometime, so using the WebClient functionality listed below | @Bean // @Bean - One and only one instance will be created and be used by multiple services
@LoadBalanced // Load Balanced annotation is used in Service Discovery model, which indicates that does service discovery in load balanced way
public RestTemplate getRestTemplate(){
HttpComponentsClientHttpRequestFactory clientHttpRequestFactory =
new HttpComponentsClientHttpRequestFactory(); // This class will allow us to create timeouts for HTTP requests and pass
// it to HTTP client
clientHttpRequestFactory.setConnectTimeout(3000);// Connection timeout set
return new RestTemplate(clientHttpRequestFactory); // This statement will indicate that if the request comes back within 3 seconds
// then it is fine, else it will throw an error
} | [
"public RestTemplate getRestTemplate();",
"public static RestTemplate getRestTemplate()\n\t{\n\t\treturn new RestTemplate();\n\t}",
"private RestTemplate getRestTemplate() {\n ObjectMapper mapper = new ObjectMapper();\n mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);\n mapper.registerModule(new Jackson2HalModule());\n\n MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();\n converter.setSupportedMediaTypes(MediaType.parseMediaTypes(\"application/haljson,*/*\"));\n converter.setObjectMapper(mapper);\n\n return new RestTemplate(Collections.<HttpMessageConverter<?>>singletonList(converter));\n }",
"@LoadBalanced\n\t@Bean\n\tRestTemplate restTemplate() {\n\t\treturn new RestTemplate();\n\t}",
"private RestTemplate getRestTemplateForPatch() {\n HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory();\n return new RestTemplate(requestFactory);\n }",
"private RestTemplate getRestTemplate() {\n ObjectMapper mapper = new ObjectMapper();\n mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);\n mapper.registerModule(new Jackson2HalModule());\n\n MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();\n converter.setSupportedMediaTypes(MediaType.parseMediaTypes(\"application/hal+json\"));\n // converter.setSupportedMediaTypes(ImmutableList.of(MediaTypes.HAL_JSON));\n converter.setObjectMapper(mapper);\n\n RestTemplate template = new RestTemplate(Collections.<HttpMessageConverter<?>>singletonList(converter));\n return template;\n }",
"@Override\n\tpublic RestTemplate getRestTemplate(String ip, int port) {\n\t\tSimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();\n\t\tInetSocketAddress address = new InetSocketAddress(ip, port);\n\t\tProxy proxy = new Proxy(Proxy.Type.HTTP, address);\n\n\t\tfactory.setProxy(proxy);\n\n\t\treturn new RestTemplate(factory);\n\t}",
"@Bean\n public RestTemplate restTemplate() {\n return new RestTemplate();\n }",
"@Bean\n @ConditionalOnMissingBean\n public RestTemplate restTemplate() {\n return new RestTemplate();\n }",
"public RestClient(RestTemplate template) {\n super();\n rest = template;\n }",
"@Bean(value = \"qualysRestTemplate\")\r\n\tpublic RestTemplate qualysRestTemplate(@Autowired RestTemplateBuilder builder) {\r\n\r\n\t\tLOGGER.info(\"[POINT]Created RestTemplate Bean for Qualys :\");\r\n\t\treturn builder\r\n\t\t\t\t.setConnectTimeout(Duration.ofSeconds(7))\r\n\t\t\t\t.setReadTimeout(Duration.ofSeconds(7))\r\n\t\t\t\t.interceptors(List.of(new qualysRestTemplateInterceptor()))\r\n\t\t\t\t.build();\r\n\r\n\t}",
"@Autowired\r\n public RestClientService(RestTemplate restTemplate){\r\n this.restTemplate = restTemplate;\r\n }",
"private RestTemplate enrichRestTemplate(final RestTemplate restTemplate)\n\t{\n\t\trestTemplate.setRequestFactory(pacoshopRequestFactory);\n\t\trestTemplate.getMessageConverters().add(new MappingJacksonHttpMessageConverter());\n\t\treturn restTemplate;\n\t}",
"private OkHttpClient Create() {\n final OkHttpClient.Builder baseClient = new OkHttpClient().newBuilder()\n .connectTimeout(CONNECTION_TIMEOUT, TimeUnit.SECONDS)\n .writeTimeout(WRITE_TIMEOUT, TimeUnit.SECONDS)\n .readTimeout(READ_TIMEOUT, TimeUnit.SECONDS);\n\n // If there's no proxy just create a normal client\n if (appProps.getProxyHost().isEmpty()) {\n return baseClient.build();\n }\n\n final OkHttpClient.Builder proxyClient = baseClient\n .proxy(new java.net.Proxy(java.net.Proxy.Type.HTTP, new InetSocketAddress(appProps.getProxyHost(), Integer.parseInt(appProps.getProxyPort()))));\n\n if (!appProps.getProxyUsername().isEmpty() && !appProps.getProxyPassword().isEmpty()) {\n\n Authenticator proxyAuthenticator;\n String credentials;\n\n credentials = Credentials.basic(appProps.getProxyUsername(), appProps.getProxyPassword());\n\n // authenticate the proxy\n proxyAuthenticator = (route, response) -> response.request().newBuilder()\n .header(\"Proxy-Authorization\", credentials)\n .build();\n proxyClient.proxyAuthenticator(proxyAuthenticator);\n }\n return proxyClient.build();\n\n }",
"@Autowired\n public RestClientService(RestTemplate restTemplate){\n this.restTemplate = restTemplate;\n }",
"private void initialize()\n\t{\n\t\tRestTemplate restTemplate = getRestTemplate();\n\t\tList<ClientHttpRequestInterceptor> interceptors = restTemplate.getInterceptors();\n\t\tinterceptors.add(new ApiRequestInterceptor(this));\n\t\trestTemplate.setInterceptors(interceptors);\n\n\t\tapiOperations = new ApiTemplate(this, restTemplate);\n\t\tchatterOperations = new ChatterTemplate(this, restTemplate);\n\t\tqueryOperations = new QueryTemplate(this, restTemplate);\n\t\trecentOperations = new RecentTemplate(this, restTemplate);\n\t\tsearchOperations = new SearchTemplate(this, restTemplate);\n\t\tsObjectsOperations = new SObjectsTemplate(this, restTemplate);\n\t\tuserOperations = new UserOperationsTemplate(this, restTemplate);\n\t\tlimitsOperations = new LimitsOperationsTemplate(this, restTemplate);\n\t\tconnectOperations = new ConnectTemplate(this, restTemplate);\n\t\tcustomApiOperatinos = new CustomApiTemplate(this, restTemplate);\n\t}",
"private static OkHttpClient getOkHttpClient() {\n OkHttpClient.Builder okHttpClientBuilder = new OkHttpClient.Builder()\n .addInterceptor(new Interceptor() {\n @Override\n public Response intercept(Chain chain) throws IOException {\n Request original = chain.request();\n\n Request.Builder requestBuilder = original.newBuilder()\n .method(original.method(), original.body());\n\n addAdditionalHttpHeaders(requestBuilder);\n addParleyHttpHeaders(requestBuilder);\n\n Request request = requestBuilder.build();\n return chain.proceed(request);\n }\n })\n .connectTimeout(30, TimeUnit.SECONDS)\n .readTimeout(30, TimeUnit.SECONDS)\n .writeTimeout(30, TimeUnit.SECONDS);\n\n applySslPinning(okHttpClientBuilder);\n\n return okHttpClientBuilder.build();\n }",
"public OkHttpClient client() {\n final OkHttpClient.Builder clientBuilder = new OkHttpClient.Builder();\n clientBuilder.connectTimeout(this.config.getConnectTimeout(), TimeUnit.SECONDS);\n clientBuilder.readTimeout(this.config.getReadTimeout(), TimeUnit.SECONDS);\n clientBuilder.writeTimeout(this.config.getWriteTimeout(), TimeUnit.SECONDS);\n clientBuilder.retryOnConnectionFailure(this.config.isRetryOnConnectionFailure());\n clientBuilder.addInterceptor((Interceptor.Chain chain) -> {\n final Request.Builder requestBuilder = chain.request().newBuilder();\n final String timestamp = DateUtils.getUnixTime();\n System.out.println(\"timestamp={\" + timestamp + \"}\");\n requestBuilder.headers(this.headers(chain.request(), timestamp));\n final Request request = requestBuilder.build();\n if (this.config.isPrint()) {\n this.printRequest(request, timestamp);\n }\n return chain.proceed(request);\n });\n return clientBuilder.build();\n }",
"private static OkHttpClient initOkHttp(){\n\n OkHttpClient.Builder httpClient = new OkHttpClient.Builder()\n .connectTimeout(5, TimeUnit.SECONDS)\n .readTimeout(5, TimeUnit.SECONDS)\n .writeTimeout(5, TimeUnit.SECONDS);\n\n httpClient.addInterceptor(new Interceptor() {\n @Override\n public Response intercept(Chain chain) throws IOException {\n Request original = chain.request();\n Request.Builder builder = original.newBuilder();\n\n Request request = builder.build();\n\n return chain.proceed(request);\n }\n });\n\n return httpClient.build();\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Copy rows from mail_item, appointment and revision table to the corresponding dumpster tables. | private static void copyToDumpster(DbConnection conn, Mailbox mbox, List<Integer> ids, int offset, int count)
throws SQLException, ServiceException {
String miTableName = getMailItemTableName(mbox, false);
String dumpsterMiTableName = getMailItemTableName(mbox, true);
String ciTableName = getCalendarItemTableName(mbox, false);
String dumpsterCiTableName = getCalendarItemTableName(mbox, true);
String revTableName = getRevisionTableName(mbox, false);
String dumpsterRevTableName = getRevisionTableName(mbox, true);
// Copy the mail_item rows being deleted to dumpster_mail_item. Copy the corresponding rows
// from appointment and revision tables to their dumpster counterparts. They are copied here,
// just before cascaded deletes following mail_item deletion.
String command = Db.supports(Db.Capability.REPLACE_INTO) ? "REPLACE" : "INSERT";
String miWhere = DbUtil.whereIn("id", count) +
" AND type IN " + DUMPSTER_TYPES +
(!mbox.useDumpsterForSpam() ? " AND folder_id != " + Mailbox.ID_FOLDER_SPAM : "") +
" AND folder_id != " + Mailbox.ID_FOLDER_DRAFTS;
PreparedStatement miCopyStmt = null;
try {
miCopyStmt = conn.prepareStatement(command + " INTO " + dumpsterMiTableName +
" (" + MAIL_ITEM_DUMPSTER_COPY_DEST_FIELDS + ")" +
" SELECT " + MAIL_ITEM_DUMPSTER_COPY_SRC_FIELDS + " FROM " + miTableName +
" WHERE " + IN_THIS_MAILBOX_AND + miWhere);
int pos = 1;
miCopyStmt.setInt(pos++, mbox.getOperationTimestamp());
pos = setMailboxId(miCopyStmt, mbox, pos);
for (int i = offset; i < offset + count; ++i)
miCopyStmt.setInt(pos++, ids.get(i));
miCopyStmt.executeUpdate();
} finally {
DbPool.closeStatement(miCopyStmt);
}
PreparedStatement ciCopyStmt = null;
try {
ciCopyStmt = conn.prepareStatement(command + " INTO " + dumpsterCiTableName +
" SELECT * FROM " + ciTableName +
" WHERE " + IN_THIS_MAILBOX_AND + "item_id IN" +
" (SELECT id FROM " + miTableName + " WHERE " + IN_THIS_MAILBOX_AND + miWhere + ")");
int pos = 1;
pos = setMailboxId(ciCopyStmt, mbox, pos);
pos = setMailboxId(ciCopyStmt, mbox, pos);
for (int i = offset; i < offset + count; ++i)
ciCopyStmt.setInt(pos++, ids.get(i));
ciCopyStmt.executeUpdate();
} finally {
DbPool.closeStatement(ciCopyStmt);
}
PreparedStatement revCopyStmt = null;
try {
revCopyStmt = conn.prepareStatement(command + " INTO " + dumpsterRevTableName +
" SELECT * FROM " + revTableName +
" WHERE " + IN_THIS_MAILBOX_AND + "item_id IN" +
" (SELECT id FROM " + miTableName + " WHERE " + IN_THIS_MAILBOX_AND + miWhere + ")");
int pos = 1;
pos = setMailboxId(revCopyStmt, mbox, pos);
pos = setMailboxId(revCopyStmt, mbox, pos);
for (int i = offset; i < offset + count; ++i)
revCopyStmt.setInt(pos++, ids.get(i));
revCopyStmt.executeUpdate();
} finally {
DbPool.closeStatement(revCopyStmt);
}
} | [
"private static void copyToDumpster(Connection conn, Mailbox mbox, List<Integer> ids, int offset, int count)\n throws SQLException, ServiceException {\n String miTableName = getMailItemTableName(mbox, false);\n String dumpsterMiTableName = getMailItemTableName(mbox, true);\n String ciTableName = getCalendarItemTableName(mbox, false);\n String dumpsterCiTableName = getCalendarItemTableName(mbox, true);\n String revTableName = getRevisionTableName(mbox, false);\n String dumpsterRevTableName = getRevisionTableName(mbox, true);\n\n // Copy the mail_item rows being deleted to dumpster_mail_item. Copy the corresponding rows\n // from appointment and revision tables to their dumpster counterparts. They are copied here,\n // just before cascaded deletes following mail_item deletion.\n String command = Db.supports(Db.Capability.REPLACE_INTO) ? \"REPLACE\" : \"INSERT\";\n String miWhere = DbUtil.whereIn(\"id\", count) +\n \" AND type IN \" + DUMPSTER_TYPES +\n (!mbox.useDumpsterForSpam() ? \" AND folder_id != \" + Mailbox.ID_FOLDER_SPAM : \"\") +\n \" AND folder_id != \" + Mailbox.ID_FOLDER_DRAFTS;\n PreparedStatement miCopyStmt = null;\n try {\n miCopyStmt = conn.prepareStatement(command + \" INTO \" + dumpsterMiTableName +\n \" (\" + MAIL_ITEM_DUMPSTER_COPY_DEST_FIELDS + \")\" +\n \" SELECT \" + MAIL_ITEM_DUMPSTER_COPY_SRC_FIELDS + \" FROM \" + miTableName +\n \" WHERE \" + IN_THIS_MAILBOX_AND + miWhere);\n int pos = 1;\n miCopyStmt.setInt(pos++, mbox.getOperationTimestamp());\n pos = setMailboxId(miCopyStmt, mbox, pos);\n for (int i = offset; i < offset + count; ++i)\n miCopyStmt.setInt(pos++, ids.get(i));\n miCopyStmt.executeUpdate();\n } finally {\n DbPool.closeStatement(miCopyStmt);\n }\n\n PreparedStatement ciCopyStmt = null;\n try {\n ciCopyStmt = conn.prepareStatement(command + \" INTO \" + dumpsterCiTableName +\n \" SELECT * FROM \" + ciTableName +\n \" WHERE \" + IN_THIS_MAILBOX_AND + \"item_id IN\" +\n \" (SELECT id FROM \" + miTableName + \" WHERE \" + IN_THIS_MAILBOX_AND + miWhere + \")\");\n int pos = 1;\n pos = setMailboxId(ciCopyStmt, mbox, pos);\n pos = setMailboxId(ciCopyStmt, mbox, pos);\n for (int i = offset; i < offset + count; ++i)\n ciCopyStmt.setInt(pos++, ids.get(i));\n ciCopyStmt.executeUpdate();\n } finally {\n DbPool.closeStatement(ciCopyStmt);\n }\n\n PreparedStatement revCopyStmt = null;\n try {\n revCopyStmt = conn.prepareStatement(command + \" INTO \" + dumpsterRevTableName +\n \" SELECT * FROM \" + revTableName +\n \" WHERE \" + IN_THIS_MAILBOX_AND + \"item_id IN\" +\n \" (SELECT id FROM \" + miTableName + \" WHERE \" + IN_THIS_MAILBOX_AND + miWhere + \")\");\n int pos = 1;\n pos = setMailboxId(revCopyStmt, mbox, pos);\n pos = setMailboxId(revCopyStmt, mbox, pos);\n for (int i = offset; i < offset + count; ++i)\n revCopyStmt.setInt(pos++, ids.get(i));\n revCopyStmt.executeUpdate();\n } finally {\n DbPool.closeStatement(revCopyStmt);\n }\n }",
"private void prepare_ob_data() \n\t\t{\n\t\t\tint i;\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-DD hh:mm:ss\");\n\t\t\tdelete_data(1, 7);\n for(i = 0; i < count; i++)\n\t\t\t{\n\t\t\t\ttry{\n\t\t\t\t\tdtCollectTime[i] = sdf.parse(sDate[i]);\n\t\t\t\t}catch (Exception e ) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//prepare collect info data, non join field, str2col\n\t\t\tfor (i = 0; i < count; i++) \n\t\t\t{\n\t\t\t\tRKey rkey = new RKey(new CollectInfoKeyRule(2, (byte) '0', i+1));\n\t\t\t\tInsertMutator im = new InsertMutator(collectInfoTable.getTableName(), rkey);\n\t\n\t\t\t\tValue value00 = new Value();\n\t\t\t\tif( i != 6 )\n \t\t\tvalue00.setString(sUserNick[i]);\n\t\n\t\t\t\tValue value02 = new Value();\n\t\t\t\tvalue02.setSecond(dtCollectTime[i].getTime());\n\n\t\t\t\tValue value03= new Value();\n\t\t\t\tvalue03.setMicrosecond(lCollecTimePrecise[i]);\n\t\n\t\t\t\tim.addColumn(sColumns[0], value00);\n\t\t\t\tim.addColumn(sColumns[2], value02);\n\t\t\t\tim.addColumn(sColumns[3], value03);\n\t\n\t\t\t\tAssert.assertTrue(\"Insert fail!\", obClient.insert(im).getResult());\n\t\t\t}\n\t\t\t//prepare item info date, jstr2col\n\t\t\tfor (i = 0; i < count; i++) \n\t\t\t{\n\t\t\t\tRKey rkey = new RKey(new ItemInfoKeyRule((byte) '0', i+1));\n\t\t\t\tInsertMutator im = new InsertMutator(itemInfoTable.getTableName(), rkey);\n\t\n\t\t\t\tValue value01 = new Value();\n\t\t\t\tvalue01.setNumber(lOwnerId[i]);\n\t\n\t\t\t\tim.addColumn(sColumns[1], value01);\n\t\n\t\t\t\tAssert.assertTrue(\"Insert fail!\", obClient.insert(im).getResult());\n\t\t\t}\n\t\t\tverify_insert_data();\n\t\t}",
"@Transactional\n public void copyDataConvPhysXwalkToEQMR(List<DataConvPhysXwalk> dataConvPhysXwalks) {\n PhysXwalk xwalk = null;\n PhysXwalk xwalkDb = null;\n\n LOGGER.info(\"copying the xwalk records from AE to EQMR db:\" + dataConvPhysXwalks.size());\n Date createDate = null;\n\n List<PhysXwalk> physXwalkList = null;\n for (DataConvPhysXwalk xwalkAe : dataConvPhysXwalks) {\n xwalk = new PhysXwalk();\n PhysXwalkId id = new PhysXwalkId();\n id.setBatchID(xwalkAe.getDataConvPhysXwalkId().getBatchID());\n id.setFunctionType(xwalkAe.getDataConvPhysXwalkId().getFunctionType());\n id.setFileLinePos(xwalkAe.getDataConvPhysXwalkId().getFileLinePos());\n xwalkDb = getPhysXwalkRepository().findOne(id);\n if (xwalkDb != null) {\n continue;\n }\n\n xwalk.setPhysXwalkId(id);\n xwalk.setStatus(\"00\");\n xwalk.setCommentText(\"Row Pending.\");\n\n if (createDate == null) {\n createDate = new Date();\n }\n\n xwalk.setCreateDateTime(createDate);\n xwalk.setLastUpdateDateTime(createDate);\n xwalk.setCurrStaffId(xwalkAe.getCurrPhysCode() != null ? xwalkAe.getCurrPhysCode().trim()\n : null);\n xwalk.setNewStaffId(xwalkAe.getNewPhysCode() != null ? xwalkAe.getNewPhysCode().trim()\n : null);\n xwalk\n .setActionCode(xwalkAe.getActionCode() != null ? xwalkAe.getActionCode().trim() : null);\n\n if (physXwalkList == null) {\n physXwalkList = new ArrayList<PhysXwalk>();\n }\n physXwalkList.add(xwalk);\n\n }\n\n if (physXwalkList != null && physXwalkList.size() > 0) {\n getPhysXwalkRepository().save(physXwalkList);\n }\n }",
"static void copyTable(String table) throws SQLException {\n\n // query the table\n sourceDB.executeQuery(\"SELECT * FROM \"+table);\n\n // get the metadata\n ResultSetMetaData sourceMD = sourceDB.rs.getMetaData();\n int sourceColumns = sourceMD.getColumnCount();\n\n // loop over the records\n while (sourceDB.rs.next()) {\n\n // build the INSERT query for this record\n String query = \"INSERT INTO \"+table+\" VALUES (\";\n for (int col=1; col<=sourceColumns; col++) {\n\tif (col>1) query += \",\";\n\tif (sourceMD.getColumnName(col).equals(\"refid\")) {\n\t query += \"DEFAULT\";\n\t} else if (isInteger(sourceMD.getColumnType(col))) {\n\t int val = sourceDB.rs.getInt(col);\n\t if (sourceDB.rs.wasNull()) {\n\t query += \"NULL\";\n\t } else {\n\t query += val;\n\t }\n\t} else if (isString(sourceMD.getColumnType(col))) {\n\t String val = sourceDB.rs.getString(col);\n\t if (sourceDB.rs.wasNull()) {\n\t query += \"NULL\";\n\t } else {\n\t query += \"'\"+Util.escapeQuotes(val)+\"'\";\n\t }\n\t} else if (isBoolean(sourceMD.getColumnType(col))) {\n\t boolean val = sourceDB.rs.getBoolean(col);\n\t if (sourceDB.rs.wasNull()) {\n\t query += \"NULL\";\n\t } else {\n\t query += val;\n\t }\n\t} else if (isTimestamp(sourceMD.getColumnType(col))) {\n\t Timestamp val = sourceDB.rs.getTimestamp(col);\n\t if (sourceDB.rs.wasNull()) {\n\t query += \"NULL\";\n\t } else {\n\t query += \"'\"+val+\"'\";\n\t }\n\t} else {\n\t throw new SQLException(\"Data type \"+sourceMD.getColumnType(col)+\" (\"+sourceMD.getColumnTypeName(col)+\") is not supported.\");\n\t}\n }\n query += \")\";\n\n // run the INSERT query against the target database; continue past errors\n try {\n\ttargetDB.executeUpdate(query);\n } catch (Exception ex) {\n\tSystem.out.println(ex.toString());\n\tSystem.out.println(query);\n }\n\n }\n\n }",
"public void copyApprovedPendingLedgerEntries();",
"private void deployFromScratch(DAO dao) {\n\t\tdao.createPollsTable();\n\t\tdao.createPollOptionsTable();\n\t\tdao.insertPoll(PollDataFactory.newBandPoll());\n\t\tdao.insertPoll(PollDataFactory.newMoviePoll());\n\t}",
"public static void doPasteitems ( RunData data)\n\t{\n\t\tParameterParser params = data.getParameters ();\n\n\t\tSessionState state = ((JetspeedRunData)data).getPortletSessionState (((JetspeedRunData)data).getJs_peid ());\n\n\t\tList items = (List) state.getAttribute(STATE_COPIED_IDS);\n\n\t\tString collectionId = params.getString (\"collectionId\");\n\n\t\tIterator itemIter = items.iterator();\n\t\twhile (itemIter.hasNext())\n\t\t{\n\t\t\t// get the copied item to be pasted\n\t\t\tString itemId = (String) itemIter.next();\n\n\t\t\tString originalDisplayName = NULL_STRING;\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tString id = ContentHostingService.copyIntoFolder(itemId, collectionId);\n\t\t\t\tString mode = (String) state.getAttribute(STATE_MODE);\n\t\t\t\tif(MODE_HELPER.equals(mode))\n\t\t\t\t{\n\t\t\t\t\tString helper_mode = (String) state.getAttribute(STATE_RESOURCES_HELPER_MODE);\n\t\t\t\t\tif(helper_mode != null && MODE_ATTACHMENT_NEW_ITEM.equals(helper_mode))\n\t\t\t\t\t{\n\t\t\t\t\t\t// add to the attachments vector\n\t\t\t\t\t\tList attachments = EntityManager.newReferenceList();\n\t\t\t\t\t\tReference ref = EntityManager.newReference(ContentHostingService.getReference(id));\n\t\t\t\t\t\tattachments.add(ref);\n\t\t\t\t\t\tcleanupState(state);\n\t\t\t\t\t\tstate.setAttribute(STATE_ATTACHMENTS, attachments);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif(state.getAttribute(STATE_ATTACH_LINKS) == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tattachItem(id, state);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tattachLink(id, state);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (PermissionException e)\n\t\t\t{\n\t\t\t\taddAlert(state, rb.getString(\"notpermis8\") + \" \" + originalDisplayName + \". \");\n\t\t\t}\n\t\t\tcatch (IdUnusedException e)\n\t\t\t{\n\t\t\t\taddAlert(state,RESOURCE_NOT_EXIST_STRING);\n\t\t\t}\n\t\t\tcatch (InUseException e)\n\t\t\t{\n\t\t\t\taddAlert(state, rb.getString(\"someone\") + \" \" + originalDisplayName);\n\t\t\t}\n\t\t\tcatch (TypeException e)\n\t\t\t{\n\t\t\t\taddAlert(state, rb.getString(\"pasteitem\") + \" \" + originalDisplayName + \" \" + rb.getString(\"mismatch\"));\n\t\t\t}\n\t\t\tcatch(IdUsedException e)\n\t\t\t{\n\t\t\t\taddAlert(state, rb.getString(\"toomany\"));\n\t\t\t}\n\t\t\tcatch(IdLengthException e)\n\t\t\t{\n\t\t\t\taddAlert(state, rb.getString(\"toolong\") + \" \" + e.getMessage());\n\t\t\t}\n\t\t\tcatch(IdUniquenessException e)\n\t\t\t{\n\t\t\t\taddAlert(state, \"Could not add this item to this folder\");\n\t\t\t}\n\t\t\tcatch(ServerOverloadException e)\n\t\t\t{\n\t\t\t\taddAlert(state, rb.getString(\"failed\"));\n\t\t\t}\n\t\t\tcatch(InconsistentException e)\n\t\t\t{\n\t\t\t\taddAlert(state, rb.getString(\"recursive\") + \" \" + itemId);\n\t\t\t}\n\t\t\tcatch (OverQuotaException e)\n\t\t\t{\n\t\t\t\taddAlert(state, rb.getString(\"overquota\"));\n\t\t\t}\t// try-catch\n\t\t\tcatch(RuntimeException e)\n\t\t\t{\n\t\t\t\tlogger.debug(\"ResourcesAction.doPasteitems ***** Unknown Exception ***** \" + e.getMessage());\n\t\t\t\taddAlert(state, rb.getString(\"failed\"));\n\t\t\t}\n\n\t\t\tif (state.getAttribute(STATE_MESSAGE) == null)\n\t\t\t{\n\t\t\t\t// delete sucessful\n\t\t\t\tString mode = (String) state.getAttribute(STATE_MODE);\n\t\t\t\tif(MODE_HELPER.equals(mode))\n\t\t\t\t{\n\t\t\t\t\tstate.setAttribute(STATE_RESOURCES_HELPER_MODE, MODE_ATTACHMENT_SELECT);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tstate.setAttribute (STATE_MODE, MODE_LIST);\n\t\t\t\t}\n\n\t\t\t\t// try to expand the collection\n\t\t\t\tSortedSet expandedCollections = (SortedSet) state.getAttribute(STATE_EXPANDED_COLLECTIONS);\n\t\t\t\tif(! expandedCollections.contains(collectionId))\n\t\t\t\t{\n\t\t\t\t\texpandedCollections.add(collectionId);\n\t\t\t\t}\n\n\t\t\t\t// reset the copy flag\n\t\t\t\tif (((String)state.getAttribute (STATE_COPY_FLAG)).equals (Boolean.TRUE.toString()))\n\t\t\t\t{\n\t\t\t\t\tstate.setAttribute (STATE_COPY_FLAG, Boolean.FALSE.toString());\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t}",
"@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n\tpublic void migrateDataByBatch() {\n\t\tpool = new HTablePool(conf, 1024);\n\t\tSQLExporter sqlExporter = \n\t\t\tnew SQLExporter(url, username, password, catalog);\n\t\twhile(sqlExporter.hasNextDataTable()) {\n\t\t\tEntry entry = sqlExporter.next();\n\t\t\tString tableName = REGION + \".\" + (String) entry.getKey();\n\t\t\tList<Map<String, Object>> list = (List<Map<String, Object>>) entry.getValue();\n\t\t\t/**\n\t\t\t * table to migrate data.\n\t\t\t */\n\t\t\tHTable table = (HTable) pool.getTable(tableName);\n\t\t\t\n\t\t\t/**\n\t\t\t * set write buffer size.\n\t\t\t */\n\t\t\ttry {\n\t\t\t\ttable.setWriteBufferSize(WRITE_BUFFER_SIZE);\n\t\t\t\ttable.setAutoFlush(false);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\tint counter = 0;\n\t\t\tList<Put> puts = new ArrayList<Put>();\n\t\t\tint size = list.size();\n\t\t\tfor (int i = 0; i < size; i++) {\n\t\t\t\t\n\t\t\t\tPut put = new Put((new Integer(i)).toString().getBytes());\n\t\t\t\t\n\t\t\t\tMap<String, Object> map = list.get(i);\n\t\t\t\tcounter ++;\n\t\t\t\t/**\n\t\t\t\t * add one row to be put.\n\t\t\t\t */\n\t\t\t\tfor (Map.Entry<String, Object> m : map.entrySet()) {\t\n\t\t\t\t\tput.add(FAMILY.getBytes(), m.getKey().getBytes(), \n\t\t\t\t\t\t\tm.getValue().toString().getBytes());\t\n\t\n\t\t\t\t}\n\t\t\t\t/**\n\t\t\t\t * add `put` to list puts. \n\t\t\t\t */\n\t\t\t\tputs.add(put);\n\t\t\t\t\n\t\t\t\tif ((counter % LIST_PUTS_COUNTER == 0) || (i == size - 1)) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\ttable.put(puts);\n\t\t\t\t\t\ttable.flushCommits();\n\t\t\t\t\t\tputs.clear();\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t} else continue;\n\t\t\t}\n\t\t}\n\t}",
"private void upgradeToDataApprovalWorkflows()\r\n {\r\n if ( executeSql( \"update dataset set approvedata = approvedata where datasetid < 0\" ) < 0 )\r\n {\r\n return; // Already converted because dataset.approvedata no longer exists.\r\n }\r\n\r\n executeSql( \"insert into dataapprovalworkflow ( workflowid, uid, created, lastupdated, name, periodtypeid, userid, publicaccess ) \"\r\n + \"select \" + statementBuilder.getAutoIncrementValue() + \", \" + statementBuilder.getUid() + \", now(), now(), ds.name, ds.periodtypeid, ds.userid, ds.publicaccess \"\r\n + \"from (select datasetid from dataset where approvedata = true union select distinct datasetid from dataapproval) as a \"\r\n + \"join dataset ds on ds.datasetid = a.datasetid\" );\r\n\r\n executeSql( \"insert into dataapprovalworkflowlevels (workflowid, dataapprovallevelid) \"\r\n + \"select w.workflowid, l.dataapprovallevelid from dataapprovalworkflow w \"\r\n + \"cross join dataapprovallevel l\" );\r\n\r\n executeSql( \"update dataset set workflowid = ( select w.workflowid from dataapprovalworkflow w where w.name = dataset.name)\" );\r\n executeSql( \"alter table dataset drop column approvedata cascade\" ); // Cascade to SQL Views, if any.\r\n\r\n executeSql( \"update dataapproval set workflowid = ( select ds.workflowid from dataset ds where ds.datasetid = dataapproval.datasetid)\" );\r\n executeSql( \"alter table dataapproval drop constraint dataapproval_unique_key\" );\r\n executeSql( \"alter table dataapproval drop column datasetid cascade\" ); // Cascade to SQL Views, if any.\r\n\r\n log.info( \"Added any workflows needed for approvble datasets and/or approved data.\" );\r\n }",
"public void importCodeplug(MD380Codeplug codeplug) {\n //First we grab the codeplug object.\n this.codeplug=codeplug;\n\n Log.d(\"CodeplugDB\", \"Dropping and recreating the old tables for the newly imported codeplug.\");\n //Wipe the old tables and begin new ones.\n db.execSQL(SQL_DELETE_CONTACTS);\n db.execSQL(SQL_DELETE_MESSAGES);\n db.execSQL(SQL_DELETE_LISTENGROUPS);\n db.execSQL(SQL_DELETE_LISTENGROUPITEMS);\n db.execSQL(SQL_DELETE_ZONES);\n db.execSQL(SQL_DELETE_ZONEITEMS);\n db.execSQL(SQL_CREATE_CONTACTS);\n db.execSQL(SQL_CREATE_MESSAGES);\n db.execSQL(SQL_CREATE_LISTENGROUPS);\n db.execSQL(SQL_CREATE_LISTENGROUPITEMS);\n db.execSQL(SQL_CREATE_ZONES);\n db.execSQL(SQL_CREATE_ZONEITEMS);\n\n //Populate the tables.\n Log.d(\"CodeplugDB\", \"Inserting Contacts\");\n for(int i=1;i<=1000;i++){\n MD380Contact c=codeplug.getContact(i);\n if(c!=null){\n ContentValues values=new ContentValues(3);\n values.put(\"id\",c.id);\n values.put(\"llid\",c.llid);\n values.put(\"flag\",c.flags);\n values.put(\"name\",c.nom);\n db.insert(\"contacts\",\n null,\n values);\n }\n }\n Log.d(\"CodeplugDB\", \"Inserting Messages\");\n for(int i=1;i<=50;i++){\n MD380Message m =codeplug.getMessage(i);\n if(m!=null){\n ContentValues values=new ContentValues(1);\n values.put(\"id\",i);\n values.put(\"message\", m.message);\n db.insert(\"messages\",\n null,\n values);\n }\n }\n Log.d(\"CodeplugDB\", \"Inserting ListenGroups\");\n for(int i=1;i<=100;i++){\n MD380ListenGroup l=codeplug.getListenGroup(i);\n if(l!=null){\n //First we insert the group itself.\n ContentValues values=new ContentValues(1);\n values.put(\"id\",i);\n values.put(\"name\", l.nom);\n db.insert(\"listengroups\",\n null,\n values);\n\n //Then we insert the members of the group.\n for(int j=0;j<l.contacts.length;j++) {\n values = new ContentValues(1);\n values.put(\"groupid\", i);\n values.put(\"contactid\", l.contacts[j]);\n if(l.contacts[j]!=0)\n db.insert(\"listengroupitems\",\n null,\n values);\n }\n }\n }\n Log.d(\"CodeplugDB\", \"Inserting Zones\");\n for(int i=1;i<=100;i++){\n MD380Zone z=codeplug.getZone(i);\n if(z!=null){\n //First we insert the group itself.\n ContentValues values=new ContentValues(1);\n values.put(\"id\",i);\n values.put(\"name\", z.nom);\n db.insert(\"zones\",\n null,\n values);\n\n //Then we insert the members of the group.\n for(int j=0;j<z.channels.length;j++) {\n values = new ContentValues(1);\n values.put(\"zoneid\", i);\n values.put(\"channelid\", z.channels[j]);\n if(z.channels[j]!=0)\n db.insert(\"zoneitems\",\n null,\n values);\n }\n }\n }\n\n Log.d(\"CodeplugDB\",\"Inserted \"+getContactCount()+\" rows of contacts.\");\n Log.d(\"CodeplugDB\",\"Inserted \"+getMessageCount()+\" rows of messages.\");\n Log.d(\"CodeplugDB\",\"Inserted \"+getListenGroupCount()+\" rows of listen groups.\");\n Log.d(\"CodeplugDB\",\"Inserted \"+getZoneCount()+\" rows of zones.\");\n\n\n //Write the codeplug image to disk, so it's consistent for the next load.\n writeCodeplug();\n }",
"void copyFromDynamo(String fullDynamoTableName, String fullDwTableName);",
"public void importGuests() {\n int j = 0;\n allGuests = guestDAO.getAllGuest();\n while (allGuests.size() > j) {\n data.add(allGuests.get(j));\n j++;\n }\n }",
"protected void copyTableDataToClipboard() {\n OSPLog.finest(\"copying table data from \"+getName()); //$NON-NLS-1$\n DataTool.copy(getSelectedTableData());\n }",
"private void inserts() {\n DBPeer.fetchTableRows();\n DBPeer.fetchTableIndexes();\n \n Map<Number160, Data> tabRows = DBPeer.getTabRows();\n\t\tMap<Number160, Data> tabIndexes = DBPeer.getTabIndexes();\n\t\t\n String tabName = null;\n Number160 tabKey = null;\n FreeBlocksHandler freeBlocks = null;\n Map<String, IndexHandler> indexHandlers = new HashMap<>();\n TableRows tr = null;\n TableIndexes ti = null;\n \n logger.trace(\"INSERT-WHOLE\", \"BEGIN\", Statement.experiment);\n \n for (Insert ins: inserts) {\n \n if (tabName == null) {\n \ttabName = ins.getTabName();\n \ttabKey = Number160.createHash(tabName);\n \tfreeBlocks = new FreeBlocksHandler(tabName);\n \ttry {\n \t\t\t\ttr = (TableRows) tabRows.get(tabKey).getObject();\n \t\t\t\tti = (TableIndexes) tabIndexes.get(tabKey).getObject();\n \t\t\t} catch (ClassNotFoundException | IOException e) {\n \t\t\t\tlogger.error(\"Data error\", e);\n \t\t\t}\n \tfor (String index: ti.getIndexes()) {\n \t\tindexHandlers.put(index, new IndexHandler(ins.getPeer()));\n \t}\n \tfor (String index: ti.getUnivocalIndexes()) {\n \t\tindexHandlers.put(index, new IndexHandler(ins.getPeer()));\n \t}\n } else if (!tabName.equals(ins.getTabName())) {\n \t\t\ttry {\n \t\t\t\ttabRows.put(tabKey, new Data(tr));\n \t\t\ttabIndexes.put(tabKey, new Data(ti));\n \t\t\ttabName = ins.getTabName();\n \ttabKey = Number160.createHash(tabName);\n \t\t\t\ttr = (TableRows) tabRows.get(tabKey).getObject();\n \t\t\t\tti = (TableIndexes) tabIndexes.get(tabKey).getObject();\n \t\t\t\tfreeBlocks.update();\n \tfreeBlocks = new FreeBlocksHandler(tabName);\n \tindexHandlers.clear();\n \tfor (String index: ti.getIndexes()) {\n \t\tindexHandlers.put(index, new IndexHandler(ins.getPeer()));\n \t}\n \tfor (String index: ti.getUnivocalIndexes()) {\n \t\tindexHandlers.put(index, new IndexHandler(ins.getPeer()));\n \t}\n \t\t\t} catch (ClassNotFoundException | IOException e) {\n \t\t\t\tlogger.error(\"Data error\", e);\n \t\t\t}\n } \n \n ins.init(freeBlocks, indexHandlers, tr, ti);\n \n }\n \n boolean done = false;\n while (!done) {\n \tint countTrue = 0;\n \tfor (Insert ins: inserts) {\n \t\tif (ins.getDone()) {\n \t\t\tcountTrue++;\n \t\t}\n \t}\n \tif (countTrue == inserts.size()) {\n \t\tdone = true;\n \t}\n }\n \n freeBlocks.update();\n\n try {\n\t\t\ttabRows.put(tabKey, new Data(tr));\n\t\t\ttabIndexes.put(tabKey, new Data(ti));\n\t\t} catch (IOException e) {\n\t\t\tlogger.error(\"Data error\", e);\n\t\t}\n \n DBPeer.updateTableRows();\n DBPeer.updateTableIndexes();\n \n logger.trace(\"INSERT-WHOLE\", \"END\", Statement.experiment);\n }",
"protected void migrate() {\r\n java.util.Date dateNow = new java.util.Date();\r\n SQLiteBuilder builder = createBuilder();\r\n for (AbstractTable<?, ?, ?> table : tables) {\r\n if (table.migrated() < table.migrations()) {\r\n //FIXME this doesn't yet implement table updates.\r\n builder.createMigration(table).up(this);\r\n VersionRecord<DBT> v = _versions.create();\r\n v.table.set(table.helper.getTable().getRecordSource().tableName);\r\n v.version.set(1);\r\n v.updated.set(dateNow);\r\n v.insert();\r\n }\r\n }\r\n }",
"private void backUp() {\n\t\tcollectItemsInDevice();\n\n\t\tlogFileInApprovalSet(recordings, false, false, approvalKey, approvedRecordingSet, \n\t\t\t\tuploadedRecordingSet, uploadedRecordingSet);\n\t\tlogFileInApprovalSet(speakers, false, false, approvalSpKey, approvedSpeakerSet, \n\t\t\t\tuploadedSpeakerSet, uploadedSpeakerSet);\n\t\tlogFileInApprovalSet(others, true, false, approvalOtherKey, approvedOtherSet, \n\t\t\t\tuploadedOtherSet, uploadedOtherSet);\n\t\t\n\t\tprefsEditor.commit();\n\t}",
"public void copyDBTemplate(int i) {\n\t}",
"public static void setupAppointments() {\n for (Appointment appt : allAppointments) {\n for (User user : allUsers) {\n if (user.getUserId() == appt.getUserId()) {\n appt.setUser(user);\n }\n }\n for (Contact contact : allContacts) {\n if (contact.getContactId() == appt.getContactId()) {\n appt.setContact(contact);\n }\n }\n for (Customer customer : allCustomers) {\n //If ID's Match and Customer doesn't already have the appointment on their list.\n if (customer.getCustomerId() == appt.getCustomerId() && !customer.getAppointments().contains(appt)) {\n appt.setCustomer(customer);\n customer.getAppointments().add(appt);\n }\n }\n }\n }",
"@Test\n public void testCopyTileTable() throws SQLException, IOException {\n AlterTableUtils.testCopyTileTable(activity, geoPackage);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Make sure that when the job wasn't archived the method doesn't retry. | @Test
void testNoRetryOnJobNotArchived() throws Exception {
Mockito
.when(this.persistenceService.getJobArchiveLocation(JOB_ID))
.thenReturn(Optional.empty());
try {
this.archivedJobService.getArchivedJobMetadata(JOB_ID);
} catch (final JobNotArchivedException ignored) {
Mockito
.verify(this.persistenceService, Mockito.times(1))
.getJobArchiveLocation(JOB_ID);
}
} | [
"@Test\n void testNoRetryOnJobNotFound() throws Exception {\n Mockito\n .when(this.persistenceService.getJobArchiveLocation(JOB_ID))\n .thenThrow(new NotFoundException(\"blah\"));\n\n try {\n this.archivedJobService.getArchivedJobMetadata(JOB_ID);\n } catch (final JobNotFoundException ignored) {\n Mockito\n .verify(this.persistenceService, Mockito.times(1))\n .getJobArchiveLocation(JOB_ID);\n }\n }",
"private void retryBackup() {\n\t\tif(googleAuthToken == null || !Aikuma.isDeviceOnline())\n\t\t\treturn;\n\t\tDataStore gd;\n\t\ttry {\n\t\t\tgd = new GoogleDriveStorage(googleAuthToken, \n\t\t\t\t\tAikumaSettings.ROOT_FOLDER_ID, AikumaSettings.CENTRAL_USER_ID, initializeCache);\n\t\t\tinitializeCache = false;\n\t\t} catch (DataStore.StorageException e) {\n\t\t\tLog.e(TAG, \"Failed to initialize GoogleDriveStorage\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tIndex fi = new FusionIndex2(AikumaSettings.getIndexServerUrl(), googleIdToken, googleAuthToken);\n\t\t\n\t\t// Others\n\t\tretryBackup(gd, fi, approvalOtherKey, approvedOtherSet, \n\t\t\t\tuploadOtherKey, uploadedOtherSet, archiveOtherKey, archivedOtherSet);\n\n\t\t// Speakers\n\t\tretryBackup(gd, fi, approvalSpKey, approvedSpeakerSet,\n\t\t\t\tuploadSpKey, uploadedSpeakerSet, archiveSpKey, archivedSpeakerSet);\n\t\t\n\t\t// Recordings\n\t\tretryBackup(gd, fi, approvalKey, approvedRecordingSet, \n\t\t\t\tuploadKey, uploadedRecordingSet, archiveKey, archivedRecordingSet);\n\t\t\n\t}",
"boolean hasUnfinishedBackup();",
"public void run() {\n \t\tlong curtime = System.currentTimeMillis();\n \t\tfor (int i=0; i<_archiveType.getRepeat(); i++) {\n \t\t\tif ((System.currentTimeMillis() - curtime) > _archiveType._parent.getCycleTime()) {\n \t\t\t\t//don't want to double archive stuff...so we to check and make sure\n\t\t\t\treturn;\n \t\t\t}\n \t\t\ttry {\n \t\t\t\tsynchronized (_archiveType._parent) {\n \t\t\t\t\tif (_archiveType.getDirectory() == null) {\n \t\t\t\t\t\t_archiveType.setDirectory(_archiveType.getOldestNonArchivedDir());\n \t\t\t\t\t}\n \t\n \t\t\t\t\tif (_archiveType.getDirectory() == null) {\n \t\t\t\t\t\treturn; // all done\n \t\t\t\t\t}\n \t\t\t\t\ttry {\n \t\t\t\t\t\t_archiveType._parent.addArchiveHandler(this);\n \t\t\t\t\t} catch (DuplicateArchiveException e) {\n \t\t\t\t\t\tlogger.warn(\"Directory -- \" + _archiveType.getDirectory() + \" -- is already being archived \");\n \t\t\t\t\t\treturn;\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\tif (!_archiveType.moveReleaseOnly()) {\n \t\t\t\t\tif (_archiveType.getRSlaves() == null) {\n \t\t\t\t\t\tSet<RemoteSlave> destSlaves = _archiveType.findDestinationSlaves();\n \t\t\n \t\t\t\t\t\tif (destSlaves == null) {\n \t\t\t\t\t\t\t_archiveType.setDirectory(null);\n \t\t\t\t\t\t\treturn; // no available slaves to use\n \t\t\t\t\t\t}\n \t\t\t\t\t\t_archiveType.setRSlaves(Collections.unmodifiableSet(destSlaves));\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\t_jobs = _archiveType.send();\n \t\t\t\t}\n \t\n \t\t\t\tGlobalContext.getEventService().publish(new ArchiveStartEvent(_archiveType,_jobs));\n \t\t\t\tlong starttime = System.currentTimeMillis();\n \t\t\t\tif (_jobs != null) {\n \t\t\t\t\t_archiveType.waitForSendOfFiles(_jobs);\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tif (!_archiveType.moveRelease(getArchiveType().getDirectory())) {\n \t\t\t\t\t_archiveType.addFailedDir(getArchiveType().getDirectory().getPath());\n \t\t\t\t\tGlobalContext.getEventService().publish(new ArchiveFailedEvent(_archiveType,starttime,\"Failed To Move Directory\"));\n \t\t\t\t\tlogger.info(\"Failed to Archiving \" + getArchiveType().getDirectory().getPath() + \" (Failed To Move Directory)\");\n \t\t\t\t} else {\n \t\t\t\t\tlogger.info(\"Done archiving \" + getArchiveType().getDirectory().getPath());\n \t\t\t\t\tGlobalContext.getEventService().publish(new ArchiveFinishEvent(_archiveType,starttime));\n \t\t\t\t}\n \t\t\t} catch (Exception e) {\n \t\t\t\tlogger.warn(\"\", e);\n \t\t\t} finally {\n \t\t\t\t_archiveType._parent.removeArchiveHandler(this);\n \t\t\t\t_archiveType.setDirectory(null);\t\t\t\t\n \t\t\t}\n \t\t}\n \t}",
"@Test\n public void testExportRetry() throws Exception {\n Path copyDir = TestExportSnapshot.getLocalDestinationDir(TEST_UTIL);\n Configuration conf = new Configuration(TEST_UTIL.getConfiguration());\n conf.setBoolean(ExportSnapshot.Testing.CONF_TEST_FAILURE, true);\n conf.setInt(ExportSnapshot.Testing.CONF_TEST_FAILURE_COUNT, 2);\n conf.setInt(\"mapreduce.map.maxattempts\", 3);\n TestExportSnapshot.testExportFileSystemState(conf, tableName, snapshotName, snapshotName,\n tableNumFiles, TEST_UTIL.getDefaultRootDirPath(), copyDir, true, false, null, true);\n }",
"@Test\n\tpublic void testMotorCycleArchiveQueueFailures() throws SimulationException, VehicleException {\n\t\tcp.enterQueue(m);\n\t\tcp.archiveQueueFailures(ARRIVALTIME + MAX_STAY + 1);\n\t\tassertFalse(m.isQueued());\n\t}",
"@Override public void rollover() throws RolloverFailure {\n\n TimeBasedFileNamingAndTriggeringPolicy timeBasedFileNamingAndTriggeringPolicy = getTimeBasedFileNamingAndTriggeringPolicy();\n String elapsedPeriodsFileName =\n timeBasedFileNamingAndTriggeringPolicy.getElapsedPeriodsFileName();\n\n String elapsedPeriodStem = FileFilterUtil.afterLastSlash(elapsedPeriodsFileName);\n\n if (compressionMode == CompressionMode.NONE) {\n String src = getParentsRawFileProperty();\n if (src != null) {\n if (!isFileEmpty(src)) {\n renameByCopying(src, elapsedPeriodsFileName);\n } else {\n addInfo(\"File '\"+src+\"' exists and is zero-length; avoiding copy\");\n }\n } // else { nothing to do if CompressionMode == NONE and parentsRawFileProperty == null }\n } else {\n if (getParentsRawFileProperty() == null) {\n future = asyncCompress(elapsedPeriodsFileName, elapsedPeriodsFileName, elapsedPeriodStem);\n } else {\n future = renamedRawAndAsyncCompress(elapsedPeriodsFileName, elapsedPeriodStem);\n }\n }\n\n ArchiveRemover archiveRemover = getTimeBasedFileNamingAndTriggeringPolicy().getArchiveRemover();\n\n if (archiveRemover != null) {\n archiveRemover.clean(new Date(timeBasedFileNamingAndTriggeringPolicy.getCurrentTime()));\n }\n }",
"boolean getUnfinishedBackup();",
"private void reassignStaleJobs() {\n if ( caps.isActive() ) {\n this.logger.debug(\"Checking for stale jobs...\");\n final ResourceResolver resolver = this.configuration.createResourceResolver();\n if ( resolver != null ) {\n try {\n final Resource jobsRoot = resolver.getResource(this.configuration.getLocalJobsPath());\n\n // this resource should exist, but we check anyway\n if ( jobsRoot != null ) {\n final Iterator<Resource> topicIter = jobsRoot.listChildren();\n while ( caps.isActive() && topicIter.hasNext() ) {\n final Resource topicResource = topicIter.next();\n\n final String topicName = topicResource.getName().replace('.', '/');\n this.logger.debug(\"Checking topic {}...\" , topicName);\n final List<InstanceDescription> potentialTargets = caps.getPotentialTargets(topicName);\n boolean reassign = true;\n for(final InstanceDescription desc : potentialTargets) {\n if ( desc.isLocal() ) {\n reassign = false;\n break;\n }\n }\n if ( reassign ) {\n final QueueConfigurationManager qcm = this.configuration.getQueueConfigurationManager();\n if ( qcm == null ) {\n break;\n }\n final QueueInfo info = qcm.getQueueInfo(topicName);\n\t\t\t\tlogger.info (\"Start reassigning stale jobs\");\n JobTopicTraverser.traverse(this.logger, topicResource, new JobTopicTraverser.ResourceCallback() {\n\n @Override\n public boolean handle(final Resource rsrc) {\n try {\n final ValueMap vm = ResourceHelper.getValueMap(rsrc);\n final String targetId = caps.detectTarget(topicName, vm, info);\n\n final Map<String, Object> props = new HashMap<>(vm);\n props.remove(Job.PROPERTY_JOB_STARTED_TIME);\n\n final String newPath;\n if ( targetId != null ) {\n newPath = configuration.getAssginedJobsPath() + '/' + targetId + '/' + topicResource.getName() + rsrc.getPath().substring(topicResource.getPath().length());\n props.put(Job.PROPERTY_JOB_QUEUE_NAME, info.queueName);\n props.put(Job.PROPERTY_JOB_TARGET_INSTANCE, targetId);\n } else {\n newPath = configuration.getUnassignedJobsPath() + '/' + topicResource.getName() + rsrc.getPath().substring(topicResource.getPath().length());\n props.remove(Job.PROPERTY_JOB_QUEUE_NAME);\n props.remove(Job.PROPERTY_JOB_TARGET_INSTANCE);\n }\n try {\n ResourceHelper.getOrCreateResource(resolver, newPath, props);\n resolver.delete(rsrc);\n resolver.commit();\n final String jobId = vm.get(ResourceHelper.PROPERTY_JOB_ID, String.class);\n if ( targetId != null ) {\n configuration.getAuditLogger().debug(\"REASSIGN OK {} : {}\", targetId, jobId);\n } else {\n configuration.getAuditLogger().debug(\"REUNASSIGN OK : {}\", jobId);\n }\n } catch ( final PersistenceException pe ) {\n logger.warn(\"Unable to move stale job from \" + rsrc.getPath() + \" to \" + newPath, pe);\n resolver.refresh();\n resolver.revert();\n }\n } catch (final InstantiationException ie) {\n // something happened with the resource in the meantime\n logger.warn(\"Unable to move stale job from \" + rsrc.getPath(), ie);\n resolver.refresh();\n resolver.revert();\n }\n return caps.isActive();\n }\n });\n\n }\n }\n }\n } finally {\n resolver.close();\n }\n }\n }\n }",
"default boolean isRetryable(Throwable t) {\n return false;\n }",
"@Test\n\tpublic void testSmallCarArchiveQueueFailures() throws SimulationException, VehicleException {\n\t\tcp.enterQueue(sc);\n\t\tcp.archiveQueueFailures(ARRIVALTIME + MAX_STAY + 1);\n\t\tassertFalse(sc.isQueued());\n\t}",
"@Override\n\t\tpublic boolean isRetry() { return true; }",
"@Test\n\tpublic void testCarArchiveQueueFailures() throws SimulationException, VehicleException {\n\t\tcp.enterQueue(c);\n\t\tcp.archiveQueueFailures(ARRIVALTIME + MAX_STAY + 1);\n\t\tassertFalse(c.isQueued());\n\t}",
"protected abstract void jobKeepalive(int jobId) throws TaskException;",
"public void cleanOrphanedArchiveRecords() {\n try {\n List<String> allJobIDs = getJDBCJobService().getJobIDs();\n List<String> archiveJobIDs = getJDBCArchiveService().getJobIDs();\n if (archiveJobIDs != null) {\n archiveJobIDs.removeAll(allJobIDs);\n if ((archiveJobIDs != null) && (archiveJobIDs.size() > 0)) {\n for (String jobID : archiveJobIDs) {\n if (LOGGER.isDebugEnabled()) {\n LOGGER.debug(\"Found orphaned ARCHIVE_JOBS records \"\n + \"for job [ \"\n + jobID\n + \" ]. Removing...\");\n }\n getJDBCArchiveService().deepDeleteArchive(jobID);\n }\n }\n }\n }\n catch (EJBLookupException ele) {\n LOGGER.error(\"Unexpected EJBLookupException raised while \"\n + \"attempting to look up [ \"\n + ele.getEJBName()\n + \" ]. Exception message [ \"\n + ele.getMessage()\n + \" ]. Any potential orphaned archive records will not be \"\n + \"cleaned up.\");\n }\n }",
"public abstract void updateBackup() throws OperationInterruptedException;",
"public void scheduleIfRestored() {\n if(getState() == State.RESTORED) {\n if(schedulerId != null) {\n Scheduler scheduler = Scheduler.getScheduler(schedulerId);\n if(scheduler != null) {\n try\n {\n scheduler.schedule(this);\n }\n catch(Exception ie) {\n ie.printStackTrace();\n }\n }\n }\n }\n \n \n }",
"@Override\r\n public Object invoke(final Invocation invocation) throws Throwable {\r\n\r\n wsFilePackagerFactory.putQuartzJobHistory(UUID.randomUUID(), new QuartzJobHistory());\r\n return new JobDetail();\r\n }",
"void purgeFailed();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a new object of class 'Service Method Return Type'. | ServiceMethodReturnType createServiceMethodReturnType(); | [
"Parameter createReturnResult(String name, Type type);",
"Return createReturn();",
"public Type getReturnType();",
"ServiceMethod createServiceMethod();",
"Return getReturnType ();",
"Type getReturnType();",
"Type getReturnType () { return return_type; }",
"ResponsesType createResponsesType();",
"public ITypeInfo getReturnType();",
"TypeUse getReturnType();",
"String getReturnType();",
"@Override\n\tpublic MethodReturnManufacturer<?, ?> createService(ServiceContext context) throws Throwable {\n\t\treturn this;\n\t}",
"protected abstract TYPE getReturnType(String operation);",
"java.lang.String getReturnType();",
"public Type getReturn() {\n return type;\n }",
"InboundServicesType createInboundServicesType();",
"APIServiceT createAPIServiceT();",
"TypedResponse createTypedResponse();",
"public com.vodafone.global.er.decoupling.binding.request.GetServiceRequestType createGetServiceRequestType()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.GetServiceRequestTypeImpl();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert a serialized Hashtable object to a CSV file. The CSV file is written in the same directory as the original serialized object. | public static void convertHashtableIntScoreCountToCSV(String serializedObj) {
// Deserialize the dataset
Hashtable<Integer, ScoreCount<Integer>> dataset = deserializeHastableIntScoreCount(serializedObj);
String dir = getDirname(serializedObj);
String resultFilename = getResultFilename(serializedObj);
logger.debug("The resulting CSV file '{}' will be written to '{}'", resultFilename, dir);
writeHashtableIntScoreCountToCSV(dataset, dir+resultFilename);
} | [
"public void outputToCSV() throws FileNotFoundException, UnsupportedEncodingException {\n PrintWriter writer = new PrintWriter(\"test_data.csv\", \"UTF-8\");\n\n //For every object in array, print surname, initials and extension, separated by commmas\n for (int i=0; i<toArrayList().size(); i++) {\n writer.println(toArrayList().get(i).getSurname() + \",\" + toArrayList().get(i).getInitials() + \",\" +\n toArrayList().get(i).getExtension());\n }\n writer.close();\n }",
"public void exportToCSV();",
"public void outputToCSV() throws FileNotFoundException, UnsupportedEncodingException {\n PrintWriter writer = new PrintWriter(\"test_data.csv\", \"UTF-8\");\n\n //For every object in array list, print surname, initials and extension, separated by commmas\n for (int i=0; i<toArrayList().size(); i++) {\n writer.println(toArrayList().get(i).getSurname() + \",\" + toArrayList().get(i).getInitials() + \",\" +\n toArrayList().get(i).getExtension());\n }\n writer.close();\n }",
"public boolean convertToCSV (Table table) {\n HashMap <Integer, String []> content = table.getContent();\n String title = table.getTitle();\n String extractionType = table.getExtractionType();\n String nbTable = Integer.toString(table.getNumTable());\n String folderName;\n\n if (extractionType.equals(\"html\")) {\n folderName = File.separator+\"output\"+File.separator+\"html\"+File.separator;\n }else {\n folderName = File.separator+\"output\"+File.separator+\"wikitext\"+File.separator;\n }\n\n csvConvertFile = new File (System.getProperty(\"user.dir\")+folderName+title.trim()+\"_\"+nbTable+\".csv\");\n\n try {\n FileWriter fileWriter = new FileWriter(csvConvertFile);\n for (Map.Entry entry : content.entrySet()) {\n String [] tableContent = (String []) entry.getValue();\n\n for (int i = 0; i < tableContent.length; i++) {\n if (i == tableContent.length-1) {\n fileWriter.write(tableContent[i].trim());\n }\n else {\n fileWriter.write(tableContent[i].trim() +\",\");\n }\n }\n fileWriter.write(\"\\n\");\n }\n fileWriter.flush();\n fileWriter.close();\n }\n catch (Exception e) {\n System.out.println(\"Impossible to write in the CSV file\"+ e.getMessage());\n }\n\n return this.fileIsFilled(csvConvertFile);\n }",
"String convertToCSV() {\n int len = gtfsValues.size();\n String[] toCsv = new String[len];\n\n gtfsValues.forEach((key, value) -> {\n int index = this.getHeader().indexOf(key);\n try {\n toCsv[index] = value;\n } catch (IndexOutOfBoundsException iob) {\n LOGGER.log(Level.SEVERE, \"This key was not found: \" + key);\n iob.printStackTrace();\n }\n\n });\n\n return String.join(CSVSEPARATOR, toCsv);\n }",
"void writeCsv(Table table, String file_name, Database d) {\n File f = new File(d.getName() + \"/\" + file_name);\n FileWriter out = null;\n\n try {\n out = new FileWriter(f);\n\n writeFields(table.selectFieldNames(), out);\n for (ArrayList<String> key : table.getKeys()) {\n writeFields(table.selectRecord(key), out);\n }\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n if (out != null) try { out.close(); } catch (IOException ignore) {}\n }\n }",
"@Override\n public void csvExport(String filename) {\n PrintWriter out = null;\n try {\n out = new PrintWriter(filename);\n\n for (Student key : map.keySet()) {\n out.println(key.getFirst() + \", \" + key.getLast() + \", \" + key.getID() + \", \" + map.get(key).getLetter());\n }\n } catch (FileNotFoundException ex) {\n System.out.println(\"File was not found\");\n } finally {\n out.close();\n }\n }",
"private static void writeHashtableIntScoreCountToCSV(Hashtable<Integer, ScoreCount<Integer>> dataset, String path) {\n\t\tCSVWriter writer = new CSVWriter(new BufferedWriter(ExceptHandler.createFileWriter(path)));\n\t\tlogger.trace(\"Content of the CSV file\");\n\t\tlong nbLines = 0;\n\t\tboolean quoteElements = false;\n\t\tfor(Iterator<Integer> it=dataset.keySet().iterator(); it.hasNext();) {\n\t\t\tInteger userID = it.next();\n\t\t\tScoreCount<Integer> profile = dataset.get(userID);\n\t\t\tfor(Iterator<Integer> iter=profile.getItems().iterator(); iter.hasNext();) {\n\t\t\t\tInteger itemID = iter.next();\n\t\t\t\tDouble rating = profile.getValue(itemID);\n\n\t\t\t\tString[] csvLine = {userID.toString(), itemID.toString(), rating.toString()};\n\t\t\t\tlogger.trace(\"csvLine: {},{},{}\", userID, itemID, rating);\n\t\t\t\twriter.writeNext(csvLine, quoteElements);\n\t\t\t\tnbLines++;\n\t\t\t}\n\t\t}\n\t\tExceptHandler.closeCSVWriter(writer);\n\t\tlogger.info(\"{} lines written\", nbLines);\n\t}",
"private void outputAsCSV(String[] header, ArrayList<String[]> data, File f)\n\t{\n\t\ttry {\n\t\t\tCSVWriter writer = new CSVWriter(new FileWriter(f.getAbsolutePath(), false), ';');\n\t\t\t\n\t\t\twriter.writeNext(header);\n\t\t\tfor (String[] row : data) {\n\t\t\t\tfor (int i = 0; i < row.length; i++) {\n\t\t\t\t\trow[i] = row[i].replace(\".\", \",\");\n\t\t\t\t}\n\t\t\t\twriter.writeNext(row);\n\t\t\t}\n\t\t\t\n//\t\t\tfor (String eventClass : model.getEventClasses()) {\n//\t\t\t\tfor (String attrName : model.getEventAttributes(eventClass)) {\n//\t\t\t\t\tList<Object> vals = model.getAttributeValues(eventClass, attrName);\n//\t\t\t\t\tString[] line = new String[vals.size() + 2];\n//\t\t\t\t\tline[0] = eventClass;\n//\t\t\t\t\tline[1] = attrName;\n//\t\t\t\t\tfor (int i = 0; i < vals.size(); i++) {\n//\t\t\t\t\t\tline[i + 2] = String.valueOf(vals.get(i));\n//\t\t\t\t\t}\n//\t\t\t\t\twriter.writeNext(line);\n//\t\t\t\t}\n//\t\t\t}\n\t\t\twriter.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//\t\tDataFile write = new DataFileWriter(\"8859_1\");\n//\t\twrite.setDataFormat(new CSVFormat());\n//\t\ttry {\n//\t\t\twrite.open(f);\n//\n//\t\t\tDataRow row = write.next();\n//\t\t\tfor (int i=0;i<header.length;i++) row.add(header[i]);\n//\t\t\tfor (int i=0;i<data.size();i++)\n//\t\t\t{\n//\t\t\t\trow = write.next();\n//\t\t\t\tString rRow[] = data.get(i);\n//\t\t\t\tfor (int j=0;j<rRow.length;j++) row.add(rRow[j]);\n//\t\t\t}\n//\t\t\twrite.close();\n//\t\t} catch (IOException e) {\n//\t\t\te.printStackTrace();\n//\t\t}\n\t}",
"public static void writeCSV(Collection<? extends CSVable> src, File to) throws IOException {\r\n\t\tfinal String SYSTEM_LINE_END = System.getProperty(\"line.separator\");\r\n\t\t\r\n\t\tFileWriter fw = null;\r\n\t\tBufferedWriter bw = null;\r\n\t\t\r\n\t\ttry {\r\n\t\t\t// Create the file if it doesn't exist yet\r\n\t\t\tif ( ! to.exists() ) {\r\n\t\t\t\tto.createNewFile();\r\n\t\t\t}\r\n\r\n\t\t\tfw = new FileWriter(to.getAbsoluteFile(), false);\r\n\t\t\tbw = new BufferedWriter(fw);\r\n\r\n\t\t\tsynchronized (src) {\r\n\t\t\t\tfor ( CSVable obj : src ) {\r\n\t\t\t\t\tbw.write(obj.toCSVRow() + SYSTEM_LINE_END);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\ttry {\r\n\t\t\t\tif (bw != null) {\r\n\t\t\t\t\tbw.close();\r\n\t\t\t\t}\r\n\t\t\t\tif (fw != null) {\r\n\t\t\t\t\tfw.close();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcatch (IOException e) {\r\n\t\t\t\tSystem.err.println(\"I'm having really bad luck today - I couldn't even close the CSV file!\");\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void exportTableToCsv() {\n\n }",
"public static void writeHashtable(String filename, Map<String, String> hash) {\r\n try {\r\n FileWriter fw = new FileWriter(filename);\r\n\r\n Set<Entry<String, String>> entries = hash.entrySet();\r\n for (Entry<String, String> entry : entries) {\r\n String key = entry.getKey();\r\n String value = entry.getValue();\r\n String str = key + \"=\" + value;\r\n\r\n // if (value instanceof String) {\r\n // str += (String) value;\r\n // } else {\r\n // Vector v = (Vector) value;\r\n // int count = v.size();\r\n // for (int i = 0; i < count; i++) {\r\n // // str += (String)v.elementAt(i);\r\n // str += v.elementAt(i).toString();\r\n // if (i < count - 1) {\r\n // str += \",\";\r\n // }\r\n // } // endfor\r\n // } // endif\r\n fw.write(str);\r\n fw.write(\"\\r\\n\");\r\n } // endfor\r\n fw.close();\r\n } catch (Exception ex) {\r\n System.out.println(ex);\r\n // ex.printStackTrace();\r\n } // endtry\r\n }",
"CSV createCSV();",
"public static void outputToCSV(){\n Student.printToCSV(studentList); \n }",
"public void exportCSV() {\n\t\tFileWriter fileWriter = null;\n\t\ttry {\n\t\t\tfileWriter = new FileWriter(\"../data/graph.csv\");\n\t\t\tfor (Map.Entry<String, LinkedList<Node>> mapElement : map.entrySet()) {\n\t\t\t\tString locationName = (String) mapElement.getKey();\n\t\t\t\tLinkedList<Node> list = (LinkedList<Node>) mapElement.getValue();\n\t\t\t\tfor (Node node : list) {\n\t\t\t\t\tfileWriter.append(locationName + \",\" + node.getName() + \",\" + node.getDistance() + \"\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tfileWriter.flush();\n\t\t\t\tfileWriter.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"private void writeKeePassCSVFile() {\n StringBuilder output = new StringBuilder();\n\n output.append(\"title, url, password, note\\n\");\n\n try {\n File externStoragePubDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);\n FileOutputStream fileos = new FileOutputStream(new File(externStoragePubDir, \"passwords.csv\"));\n\n for (int p = 0; p < mSerializedPasswords.size(); p++) {\n Password curPass = mSerializedPasswords.get(p);\n\n output.append(curPass.name == null ? \"\" : curPass.name.replace('\\n', ' ').replace(\"\\\"\", \"\\\\\\\"\")).append(',')\n .append(curPass.url == null ? \"\" : curPass.url.replace('\\n', ' ').replace(\"\\\"\", \"\\\\\\\"\")).append(',')\n .append(curPass.password == null ? \"\" : curPass.password.replace('\\n', ' ').replace(\"\\\"\", \"\\\\\\\"\")).append(',')\n .append(curPass.note == null ? \"\" : curPass.note.replace('\\n', ' ').replace(\"\\\"\", \"\\\\\\\"\")).append('\\n');\n }\n fileos.write(output.toString().getBytes());\n fileos.close();\n Toast.makeText(mContext, \"Passwords have been exported to \" + externStoragePubDir.getPath() + \"/passwords.csv\", Toast.LENGTH_LONG).show();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public static void writeToCSV(File file, Trajectory trajectory) \n {\n \tUtil.consoleLog(\"Trajectory saved to file %s\", file.getName());\n \t\n PathfinderJNI.trajectorySerializeCSV(trajectory.segments, file.getAbsolutePath());\n }",
"public static void writeEntriesToCsvFile(List<Entry> entryList, String fileName) throws FileNotFoundException, IOException {\n\n try (FileOutputStream fos = new FileOutputStream(fileName);\n OutputStreamWriter osw = new OutputStreamWriter(fos,\n StandardCharsets.UTF_8);\n CSVWriter writer = new CSVWriter(osw)) {\n\n List<String[]> entries = new ArrayList<String[]>();\n String[] header = {\"ID\", \"Class\"};\n entries.add(header);\n\n for (Entry entry : entryList) {\n String[] entryArr = new String[2];\n entryArr[0] = entry.getId().toString();\n entryArr[1] = entry.getCategory().name();\n entries.add(entryArr);\n }\n\n writer.writeAll(entries);\n }\n }",
"private void exportToCSV() {\n\t\tint noCSVFiles = csvFilesPerTable();\n\t\tprepareDirectory();\n\t\tint lowerLimit = 0;\n System.out.println(\"Creating \" + noCSVFiles + \" CSV files for [ \" + tableName + \" ]\");\n for (int i = 0; i < noCSVFiles; i++) {\n\t\t\tFile file = new File(this.migrationFolder + \"\\\\\" + tableName,\n\t\t\t\t\ttableName + i + \".csv\");\n\t\t\ttry {\n System.out.println(\"Processing export for [ \" + tableName + \" ] - \" + (i + 1) + \"/\" + noCSVFiles + \" CSV files\");\n\t\t\t\tif (file.createNewFile()) {\n PrintWriter pw = new PrintWriter(file);\n String fileContentsToWrite = getFileContentToWrite(lowerLimit);\n pw.write(fileContentsToWrite);\n pw.flush();\n pw.close();\n lowerLimit = lowerLimit + fetchSize;\n } else {\n System.out.println(\"Could not create file: \" + file.getAbsolutePath());\n }\n\t\t\t} catch (IOException e2) {\n\t\t\t\te2.printStackTrace();\n\t\t\t}\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
I tried to activate Retribution of the Ancients while I only controlled Nantuko Husk and Willbreaker without +1/+1 counters on them. The program didn't let me activate the RotA, even though the creature you choose doesn't need to have any counters on it (X can be 0, doesn't say otherwise on the card and it isn't a target requirement). It asked me to pay B, then choose a creature I controlled, which I did... and then nothing happened. | @Test
public void testRetributionOfTheAncientsZeroCounter() {
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1);
// {B}, Remove X +1/+1 counters from among creatures you control: Target creature gets -X/-X until end of turn.
addCard(Zone.BATTLEFIELD, playerA, "Retribution of the Ancients", 1); // Enchantment {B}
// Whenever a creature an opponent controls becomes the target of a spell or ability you control, gain control of that creature for as long as you control Willbreaker.
addCard(Zone.BATTLEFIELD, playerA, "Willbreaker", 1);
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion");
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{B}, Remove", "Silvercoat Lion");
setChoice(playerA, "X=0");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Willbreaker", 1);
assertPermanentCount(playerA, "Silvercoat Lion", 1);
} | [
"@Test\n public void conniveDiscardCreature() {\n // P/T : 1/2\n // {3}: Hypnotic Grifter connives\n addCard(Zone.BATTLEFIELD, playerA, \"Hypnotic Grifter\");\n addCard(Zone.BATTLEFIELD, playerA, \"Swamp\", 3);\n addCard(Zone.HAND, playerA, \"Ledger Shredder\", 1); // To discard\n\n setStrictChooseMode(true);\n\n activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, \"{3}\");\n setChoice(playerA, \"Ledger Shredder\");\n\n setStopAt(1, PhaseStep.BEGIN_COMBAT);\n execute();\n\n assertPowerToughness(playerA, \"Hypnotic Grifter\", 2, 3); // Discarded a non-land\n assertHandCount(playerA, 1); // 1 from drawing at start of turn\n assertGraveyardCount(playerA, \"Ledger Shredder\", 1);\n }",
"@Test\n public void conniveNonControlledCreature() {\n // Choose three. You may choose the same mode more than once.\n //• Until end of turn, target creature loses all abilities and has base power and toughness 1/1.\n //• Target creature connives. (Draw a card, then discard a card. If you discarded a nonland card, put a +1/+1 counter on that creature.)\n //• Target player returns a creature card from their graveyard to their hand.\n addCard(Zone.HAND, playerA, \"Obscura Confluence\"); // {1}{W}{U}{B}\n addCard(Zone.BATTLEFIELD, playerA, \"Plains\", 1);\n addCard(Zone.BATTLEFIELD, playerA, \"Island\", 1);\n addCard(Zone.BATTLEFIELD, playerA, \"Swamp\", 2);\n\n addCard(Zone.HAND, playerB, \"Plains\", 3); // 3 land cards for conniving\n addCard(Zone.BATTLEFIELD, playerB, \"Crazed Goblin\"); // 1/1 creature that is made to connive\n\n setStrictChooseMode(true);\n\n castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, \"Obscura Confluence\");\n setModeChoice(playerA, \"2\");\n setModeChoice(playerA, \"2\");\n setModeChoice(playerA, \"2\");\n addTarget(playerA, \"Crazed Goblin\");\n addTarget(playerA, \"Crazed Goblin\");\n addTarget(playerA, \"Crazed Goblin\");\n setChoice(playerB, \"Plains\");\n setChoice(playerB, \"Plains\");\n setChoice(playerB, \"Plains\");\n\n setStopAt(1, PhaseStep.BEGIN_COMBAT);\n\n execute();\n\n assertPowerToughness(playerB, \"Crazed Goblin\", 1, 1); // Discarded only lands\n assertGraveyardCount(playerB, \"Plains\", 3);\n }",
"@Test\n public void conniveMadness() {\n // P/T : 1/2\n // {3}: Hypnotic Grifter connives\n addCard(Zone.BATTLEFIELD, playerA, \"Hypnotic Grifter\");\n addCard(Zone.BATTLEFIELD, playerA, \"Swamp\", 4);\n // Target opponent loses 3 life and you gain 3 life.\n // Madness {B}\n addCard(Zone.HAND, playerA, \"Alms of the Vein\", 1); // To discard and use mad\n\n setStrictChooseMode(true);\n\n activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, \"{3}\");\n setChoice(playerA, \"Alms of the Vein\");\n setChoice(playerA, \"Yes\"); // Cast for Madness\n addTarget(playerA, playerB); // Target for Alms of the Vein\n\n setStopAt(1, PhaseStep.BEGIN_COMBAT);\n execute();\n\n assertPowerToughness(playerA, \"Hypnotic Grifter\", 2, 3); // Discarded a non-land\n assertHandCount(playerA, 1); // 1 from drawing at start of turn\n assertGraveyardCount(playerA, \"Alms of the Vein\", 1);\n\n assertLife(playerA, 23); // 3 life gained from Alms of the Vein\n assertLife(playerB, 17); // 3 life lost from Alms of the Vein\n }",
"@Test\n public void conniveDiscardLand() {\n // P/T : 1/2\n // {3}: Hypnotic Grifter connives\n addCard(Zone.BATTLEFIELD, playerA, \"Hypnotic Grifter\");\n addCard(Zone.BATTLEFIELD, playerA, \"Swamp\", 3);\n addCard(Zone.HAND, playerA, \"Plains\", 1); // To discard\n\n setStrictChooseMode(true);\n\n activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, \"{3}\");\n setChoice(playerA, \"Plains\");\n\n setStopAt(1, PhaseStep.BEGIN_COMBAT);\n execute();\n\n assertPowerToughness(playerA, \"Hypnotic Grifter\", 1, 2); // Discarded a land card\n assertHandCount(playerA, 1); // 1 from drawing at start of turn\n assertGraveyardCount(playerA, \"Plains\", 1);\n }",
"public void attack() {\n\t\tint attack = (random.nextInt(20) + 1) + attackModifier;\n\n\t\tif (attack > Player.currentAC) {\n\t\t\tPlayer.getHurt(damage);\n\t\t\tSystem.out.println(\"The minotaur hit and dealt \" + damage + \" damage.\");\n\t\t\t\n\t\t\tif (Player.isDead() == true) {\n\t\t\t\tSystem.out.println(\"You die.\");\n\t\t\t\tCombat.playerAlive = false;\n\t\t\t}\n\t\t} else {\n\t\t\tSystem.out.println(\"The minotaur missed.\");\n\t\t}\n\t}",
"@Test\n public void testUnpayableCost() {\n // You can't get poison counters.\n // Creatures you control can't have -1/-1 counters placed on them.\n // Creatures your opponents control lose infect.\n addCard(Zone.BATTLEFIELD, playerA, \"Melira, Sylvok Outcast\", 2); // 2/2\n // {T}: Add {G}.\n // Put a -1/-1 counter on Devoted Druid: Untap Devoted Druid.\n addCard(Zone.BATTLEFIELD, playerA, \"Devoted Druid\", 1); // 0/2\n\n activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, \"{T}: Add {G}\");\n activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, \"Put a -1/-1 counter on\");\n\n setStopAt(1, PhaseStep.BEGIN_COMBAT);\n\n // TODO: Needed since Melira's ability isn't been caught by the is playable check\n try {\n execute();\n Assert.fail(\"must throw exception on execute\");\n } catch (Throwable e) {\n if (!e.getMessage().contains(\"Put a -1/-1 counter on\")) {\n Assert.fail(\"Needed error about not being able to use the Devoted Druid's -1/-1 ability, but got:\\n\" + e.getMessage());\n }\n }\n\n assertPowerToughness(playerA, \"Devoted Druid\", 0, 2);\n assertCounterCount(\"Devoted Druid\", CounterType.M1M1, 0);\n assertTapped(\"Devoted Druid\", true); // Because untapping can't be paid\n }",
"@Test\n public void testStolenIdentity() {\n addCard(Zone.BATTLEFIELD, playerA, \"Island\", 6);\n addCard(Zone.HAND, playerA, \"Mountain\", 1);\n\n // Create a token that's a copy of target artifact or creature.\n // Cipher (Then you may exile this spell card encoded on a creature you control. Whenever that creature deals combat damage to a player, its controller may cast a copy of the encoded card without paying its mana cost.)\n addCard(Zone.HAND, playerA, \"Stolen Identity\"); // Sorcery {4}{U}{U}\n\n // Flying\n // Landfall - Whenever a land enters the battlefield under your control, you may gain control of target creature for as long as you control Roil Elemental.\n addCard(Zone.BATTLEFIELD, playerB, \"Roil Elemental\");\n addCard(Zone.BATTLEFIELD, playerB, \"Pillarfield Ox\");\n addCard(Zone.BATTLEFIELD, playerB, \"Silvercoat Lion\");\n\n // cast spell, create copy token, exile spell card and encode it to that token of Roil Elemental\n castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, \"Stolen Identity\", \"Roil Elemental\");\n setChoice(playerA, true); // Cipher activate\n addTarget(playerA, \"Roil Elemental\"); // Cipher target for encode\n checkPermanentCount(\"playerA must have Roil Elemental\", 2, PhaseStep.PRECOMBAT_MAIN, playerA, \"Roil Elemental\", 1);\n checkPermanentCount(\"playerB must have Roil Elemental\", 2, PhaseStep.PRECOMBAT_MAIN, playerB, \"Roil Elemental\", 1);\n checkExileCount(\"Stolen Identity must be in exile zone\", 2, PhaseStep.PRECOMBAT_MAIN, playerA, \"Stolen Identity\", 1);\n\n // Roil Elemental must activated on new land\n playLand(3, PhaseStep.PRECOMBAT_MAIN, playerA, \"Mountain\");\n setChoice(playerA, true); // activate landfall to control opponent creature\n addTarget(playerA, \"Silvercoat Lion\"); // Triggered ability of copied Roil Elemental to gain control\n checkPermanentCount(\"must gain control of Lion\", 3, PhaseStep.POSTCOMBAT_MAIN, playerA, \"Silvercoat Lion\", 1);\n checkPermanentCount(\"must lose control of Lion\", 3, PhaseStep.POSTCOMBAT_MAIN, playerB, \"Silvercoat Lion\", 0);\n\n // on attack must activated ability to free cast\n attack(5, playerA, \"Roil Elemental\");\n setChoice(playerA, true); // activate free cast of encoded card\n checkPermanentCount(\"playerA must have 2 Roil Elemental\", 5, PhaseStep.POSTCOMBAT_MAIN, playerA, \"Roil Elemental\", 2);\n checkPermanentCount(\"playerB must have Roil Elemental\", 5, PhaseStep.POSTCOMBAT_MAIN, playerB, \"Roil Elemental\", 1);\n\n setStopAt(5, PhaseStep.POSTCOMBAT_MAIN);\n execute();\n\n assertLife(playerB, 17); // -3 by Roil\n }",
"public boolean acknowledgeCardAbility(Card card){\n if(card.isNoble){\n switch(card.getId()){\n\n //add noble from deck to end of card line after collecting this noble\n case \"Capt_Guard\":\n gameState.actionCardPlayed = true;\n dealNoble();\n gameState.actionCardPlayed = false;\n break;\n//\n// case \"Count\":\n// //needs to go in special calculate points\n// if(gameState.playerTurn == 0){\n// p0Count = true;\n// }\n// else{\n// p1Count = true;\n// }\n// break;\n//\n// case \"Countess\":\n// //need to go in calculate points statement\n// if(gameState.playerTurn == 0){\n// p0Countess = true;\n// }\n// else{\n// p1Countess = true;\n// }\n// break;\n//\n// case \"Fast_Noble\":\n// gameState.actionCardPlayed = true;\n// if(gameState.playerTurn == 0){\n// getNoble(gameState.p0Field);\n// }\n// else{\n// getNoble(gameState.p1Field);\n// }\n// gameState.actionCardPlayed = false;\n//\n// break;\n//\n// case \"General\":\n// gameState.actionCardPlayed = true;\n//\n// dealNoble();\n//\n// gameState.actionCardPlayed = false;\n//\n// break;\n//\n// //user selects a card in their action card and the click\n// //gets the location and then it uses the location to discard the card\n// case \"Innocent\":\n// gameState.actionCardPlayed = true;\n// if(gameState.playerTurn == 0){\n// discardActionCard(gameState.p0Field, loc);\n// }\n// else{\n// discardActionCard(gameState.p1Field, loc);\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// case \"Lady\":\n// gameState.actionCardPlayed = true;\n// if(gameState.playerTurn == 0){\n// dealActionCard(gameState.p0Field);\n// }\n// else{\n// dealActionCard(gameState.p1Field);\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// case \"Lady_Waiting\":\n// gameState.actionCardPlayed = true;\n// if(gameState.playerTurn == 0){\n// dealActionCard(gameState.p0Field);\n// }\n// else{\n// dealActionCard(gameState.p1Field);\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// case \"Lord\":\n// gameState.actionCardPlayed = true;\n// if(gameState.playerTurn == 0){\n// dealActionCard(gameState.p0Field);\n// }\n// else{\n// dealActionCard(gameState.p1Field);\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// case \"Spy\":\n// gameState.actionCardPlayed = true;\n// //need to add method and checks\n// gameState.actionCardPlayed = false;\n// break;\n//\n// case \"Palace_Guard1\":\n// //ability is in calculate point method\n// if(gameState.playerTurn == 0){\n// p0PalaceGuard++;\n// }\n// else{\n// p1PalaceGuard++;\n// }\n// break;\n//\n// case \"Palace_Guard2\":\n// //ability is in calculate point method\n// if(gameState.playerTurn == 0){\n// p0PalaceGuard++;\n// }\n// else{\n// p1PalaceGuard++;\n// }\n// break;\n//\n// case \"Palace_Guard3\":\n// //ability is in calculate point method\n// if(gameState.playerTurn == 0){\n// p0PalaceGuard++;\n// }\n// else{\n// p1PalaceGuard++;\n// }\n// break;\n//\n// case \"Palace_Guard4\":\n// //ability is in calculate point method\n// if(gameState.playerTurn == 0){\n// p0PalaceGuard++;\n// }\n// else{\n// p1PalaceGuard++;\n// }\n// break;\n//\n// case \"Palace_Guard5\":\n// //ability is in calculate point method\n// if(gameState.playerTurn == 0){\n// p0PalaceGuard++;\n// }\n// else{\n// p1PalaceGuard++;\n// }\n// break;\n//\n// case \"Rival1\":\n// gameState.actionCardPlayed = true;\n// if(gameState.playerTurn == 0){\n// gameState.p0Field.add(gameState.deckNoble.get(0));\n// gameState.deckNoble.remove(0);\n// }\n// else{\n// gameState.p1Field.add(gameState.deckNoble.get(0));\n// gameState.deckNoble.remove(0);\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// case \"Rival2\":\n// gameState.actionCardPlayed = true;\n// if(gameState.playerTurn == 0){\n// gameState.p0Field.add(gameState.deckNoble.get(0));\n// gameState.deckNoble.remove(0);\n// }\n// else{\n// gameState.p1Field.add(gameState.deckNoble.get(0));\n// gameState.deckNoble.remove(0);\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// case \"Robespierre\":\n// gameState.actionCardPlayed = true;\n// discardRemainingNobles();\n// gameState.actionCardPlayed = false;\n// break;\n//\n// case \"Clown\":\n// gameState.actionCardPlayed = true;\n// if(gameState.playerTurn == 0){\n// placeClown(gameState.p1Field, gameState.p0Field.get(gameState.p0Field.size()-1));\n// gameState.p0Field.remove(gameState.p0Field.size()-1);\n// }\n// else{\n// placeClown(gameState.p0Field, gameState.p1Field.get(gameState.p1Field.size()-1));\n// gameState.p1Field.remove(gameState.p1Field.size()-1);\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// case \"Tragic_Figure\":\n// //action is in calculate points method\n// break;\n//\n//\n }\n }\n else{\n switch(card.getId()){\n//\n// // put noble at front of line into other players field\n// case \"After_You\":\n// if(gameState.p1Field.contains(card.id.equals(\"Callous\")) || gameState.p0Field.contains(card.id.equals(\"Callous\")) ){\n// break;\n// }\n//\n// gameState.actionCardPlayed = true;\n// if(gameState.playerTurn == 0){\n// getNoble(gameState.p1Field);\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"After_You\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// getNoble(gameState.p0Field);\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"After_You\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //move noble at front of line to end of line\n// case \"Bribed\":\n// if(gameState.p1Field.contains(card.id.equals(\"Callous\")) || gameState.p0Field.contains(card.id.equals(\"Callous\")) ){\n// break;\n// }\n// gameState.actionCardPlayed = true;\n// moveNoble(0, gameState.nobleLine.size()-1);\n// if(gameState.playerTurn == 0){\n//\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Bribed\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Bribed\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// case \"Callous\":\n// gameState.actionCardPlayed = true;\n// if(gameState.playerTurn == 0){\n//\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Callous\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Callous\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //card goes to field and is used for the pointer counter\n// case \"Church_Support\":\n// gameState.actionCardPlayed = true;\n//\n// if(gameState.playerTurn == 0){\n//\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Church_Support\")){\n// gameState.p0Field.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Church_Support\")){\n// gameState.p1Field.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n//\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //moves one green card to a different spot in the line\n// //gets the locations from the onclick, so i cant implement this\n// case \"Civic_Pride\":\n// if(gameState.p1Field.contains(card.id.equals(\"Callous\")) || gameState.p0Field.contains(card.id.equals(\"Callous\")) ){\n// break;\n// }\n// gameState.actionCardPlayed = true;\n// if(gameState.nobleLine.get(loc1).cardColor.equals(\"Green\")) {\n// moveNoble(loc1, loc2);\n// }\n//\n//\n// if(gameState.playerTurn == 0){\n//\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Civic_Pride\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Civic_Pride\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //increases point values in field. Will be calculated in a points method\n// case \"Civic_Support\":\n// gameState.actionCardPlayed = true;\n// if(gameState.playerTurn == 0){\n//\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Civic_Support\")){\n// gameState.p0Field.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Civic_Support\")){\n// gameState.p1Field.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //lets players swap nobles (cant swap same noble)\n// //need locations that both players choose using onclick\n// case \"Clerical_Error\":\n// gameState.actionCardPlayed = true;\n// //will write method later\n//\n//\n// if(gameState.playerTurn == 0){\n//\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Clerical_Error\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Clerical_Error\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //discard any noble in nobleline and replace it with card in Ndeck\n// case \"Clothing_Swap\":\n// if(gameState.p1Field.contains(card.id.equals(\"Callous\")) || gameState.p0Field.contains(card.id.equals(\"Callous\")) ){\n// break;\n// }\n// gameState.actionCardPlayed = true;\n// gameState.deckDiscard.add(gameState.nobleLine.get(touchloc));\n// gameState.nobleLine.remove(touchLoc);\n// gameState.nobleLine.add(touchloc, gameState.deckNoble.get(0));\n// gameState.deckNoble.remove(0);\n// gameState.actionCardPlayed = false;\n//\n//\n// if(gameState.playerTurn == 0){\n//\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Clothing_Swap\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Clothing_Swap\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// break;\n//\n// //shuffles noble line right before other player draws a noble\n// case \"Confusion\":\n// if(gameState.p1Field.contains(card.id.equals(\"Callous\")) || gameState.p0Field.contains(card.id.equals(\"Callous\")) ){\n// break;\n// }\n// gameState.actionCardPlayed = true;\n//\n// if(gameState.playerTurn == 0){\n//\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Confusion\")){\n// this.shuffle1 = true;\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Confusion\")){\n// this.shuffle0 = true;\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //lets user collect additional noble from noble line\n// case \"Double_Feature1\":\n// if(gameState.p1Field.contains(card.id.equals(\"Callous\")) || gameState.p0Field.contains(card.id.equals(\"Callous\")) ){\n// break;\n// }\n// gameState.actionCardPlayed = true;\n// if(gameState.playerTurn == 0){\n// getNoble(gameState.p0Hand);\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Double_Feature1\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// getNoble(gameState.p1Hand);\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Double_Feature1\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //lets user collect additional noble from noble line\n// case \"Double_Feature2\":\n// if(gameState.p1Field.contains(card.id.equals(\"Callous\")) || gameState.p0Field.contains(card.id.equals(\"Callous\")) ){\n// break;\n// }\n// gameState.actionCardPlayed = true;\n// if(gameState.playerTurn == 0){\n// getNoble(gameState.p0Hand);\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Double_Feature2\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// getNoble(gameState.p1Hand);\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Double_Feature2\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n// //discard two nobleline cards and then shuffle the nobleline deck\n// case \"Escape\":\n// if(gameState.p1Field.contains(card.id.equals(\"Callous\")) || gameState.p0Field.contains(card.id.equals(\"Callous\")) ){\n// break;\n// }\n// gameState.actionCardPlayed = true;\n// if(gameState.playerTurn == 0) {\n// int rand1 = (int) (Math.random() * gameState.nobleLine.size());\n// gameState.deckDiscard.add(gameState.nobleLine.get(rand1));\n// gameState.nobleLine.remove(rand1);\n//\n// int rand2 = (int) (Math.random() * gameState.nobleLine.size());\n// gameState.deckDiscard.add(gameState.nobleLine.get(rand2));\n// gameState.nobleLine.remove(rand2);\n// Collections.shuffle(gameState.nobleLine);\n//\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Escape\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Escape\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //add 3 nobles from noble deck to noble line\n// case \"Extra_Cart1\":\n// if(gameState.p1Field.contains(card.id.equals(\"Callous\")) || gameState.p0Field.contains(card.id.equals(\"Callous\")) ){\n// break;\n// }\n// gameState.actionCardPlayed = true;\n// for(int i = 0; i < 3; i++){\n// dealNoble();\n// }\n//\n//\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Extra_Cart1\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Extra_Cart1\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //add 3 nobles from noble deck to noble line\n// case \"Extra_Cart2\":\n// if(gameState.p1Field.contains(card.id.equals(\"Callous\")) || gameState.p0Field.contains(card.id.equals(\"Callous\")) ){\n// break;\n// }\n// gameState.actionCardPlayed = true;\n// for(int i = 0; i < 3; i++){\n// dealNoble();\n// }/\n//\n//\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Extra_Cart2\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Extra_Cart2\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //move noble up to 3 card positions back\n// //locs from onclick\n// case \"Fainting\":\n// if(gameState.p1Field.contains(card.id.equals(\"Callous\")) || gameState.p0Field.contains(card.id.equals(\"Callous\")) ){\n// break;\n// }\n// gameState.actionCardPlayed = true;\n// if(newPos - origPos > 3){\n// gameState.nobleLine.add(newPost, gameState.nobleLine.get(origPost));\n// gameState.nobleLine.remove(origPost);\n// }\n//\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Fainting\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Fainting\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //discard any noble in line\n// //needs onclick to select the noble\n// case \"Fled\":\n// if(gameState.p1Field.contains(card.id.equals(\"Callous\")) || gameState.p0Field.contains(card.id.equals(\"Callous\")) ){\n// break;\n// }\n// gameState.actionCardPlayed = true;\n//\n// gameState.nobleLine.remove(cardPos);\n//\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Fled\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Fled\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //randomly removes action card from other player\n// case \"Forced_Break\":\n// gameState.actionCardPlayed = true;\n//\n// int rand = 0;\n//\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Forced_Break\")){\n// if(!gameState.p1Hand.isEmpty()) {\n// rand = (int) (Math.random() * gameState.p1Hand.size());\n// gameState.deckDiscard.add(gameState.p1Hand.get(rand));\n// gameState.p1Hand.remove(rand);\n// }\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Forced_Break\")){\n// if(!gameState.p0Hand.isEmpty()) {\n// rand = (int) (Math.random() * gameState.p0Hand.size());\n// gameState.deckDiscard.add(gameState.p0Hand.get(rand));\n// gameState.p0Hand.remove(rand);\n// }\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //put card in field and draw an actioncard when you get purple noble\n// case \"Foreign_Support\":\n// gameState.actionCardPlayed = true;\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Foreign_Support\")){\n// gameState.p0Field.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// FS0 = true;\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Foreign_Support\")){\n// gameState.p1Field.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// FS0 = true;\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //grabs the first palace guard in noble line and puts it at position 0\n// case \"Forward_March\":\n// if(gameState.p1Field.contains(card.id.equals(\"Callous\")) || gameState.p0Field.contains(card.id.equals(\"Callous\")) ){\n// break;\n// }\n// gameState.actionCardPlayed = true;\n//\n//\n// //going through line to find the first palace guard. Putting in discard\n// //so then I could get the card when readding it.\n// for(int k = 0; k < gameState.nobleLine.size(); k++){\n// if(gameState.nobleLine.get(k).getId().contains(\"Palace_Guard\")){\n// gameState.deckDiscard.add(0,gameState.nobleLine.get(k));\n// gameState.nobleLine.remove(k);\n// gameState.nobleLine.add(0, gameState.deckDiscard.get(0));\n// gameState.deckDiscard.remove(0);\n// k = gameState.nobleLine.size();\n// }\n// }\n//\n//\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Forward_March\")){\n// gameState.p0Field.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Forward_March\")){\n// gameState.p1Field.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //card is in field and worth 2 points\n// //actiond one in points method\n// case \"Fountain\":\n// gameState.actionCardPlayed = true;\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Fountain\")){\n// gameState.p0Field.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Fountain\")){\n// gameState.p1Field.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //move noble backwards up to 2 spaces\n// case \"Friend_Queen1\":\n// if(gameState.p1Field.contains(card.id.equals(\"Callous\")) || gameState.p0Field.contains(card.id.equals(\"Callous\")) ){\n// break;\n// }\n// gameState.actionCardPlayed = true;\n// if(newLoc - oldLoc < 3){\n// moveNoble(oldLoc, newLoc);\n// }\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Friend_Queen1\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Friend_Queen1\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //move noble card 2 spaces back\n// case \"Friend_Queen2\":\n// if(gameState.p1Field.contains(card.id.equals(\"Callous\")) || gameState.p0Field.contains(card.id.equals(\"Callous\")) ){\n// break;\n// }\n// gameState.actionCardPlayed = true;\n// if(newLoc - oldLoc < 3){\n// moveNoble(oldLoc, newLoc);\n// }\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Friend_Queen2\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Friend_Queen2\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //move noble up to two spaces\n// case \"Idiot1\":\n// if(gameState.p1Field.contains(card.id.equals(\"Callous\")) || gameState.p0Field.contains(card.id.equals(\"Callous\")) ){\n// break;\n// }\n// gameState.actionCardPlayed = true;\n//\n// if(oldLoc - newLoc < 3 && oldLoc - newLoc >=0){\n// moveNoble(oldLoc, newLoc);\n// }\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Idiot1\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Idiot1\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //move noble card up to 2 spaces\n// case \"Idiot2\":\n// if(gameState.p1Field.contains(card.id.equals(\"Callous\")) || gameState.p0Field.contains(card.id.equals(\"Callous\")) ){\n// break;\n// }\n// gameState.actionCardPlayed = true;\n// if(oldLoc - newLoc < 3 && oldLoc - newLoc >=0){\n// moveNoble(oldLoc, newLoc);\n// }\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Idiot2\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Idiot2\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //move noble exactly four spaces\n// //need onclick location of card they choose\n// case \"Ignoble1\":\n// if(gameState.p1Field.contains(card.id.equals(\"Callous\")) || gameState.p0Field.contains(card.id.equals(\"Callous\")) ){\n// break;\n// }\n// gameState.actionCardPlayed = true;\n// if(oldLoc - 4 >= 0){\n// moveNoble(oldLoc, oldLoc-4);\n// }\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Ignoble1\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Ignoble1\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //move noble exactly four spaces\n// //need onclick location of card they choose\n// case \"Ignoble2\":\n// if(gameState.p1Field.contains(card.id.equals(\"Callous\")) || gameState.p0Field.contains(card.id.equals(\"Callous\")) ){\n// break;\n// }\n// gameState.actionCardPlayed = true;\n// if(oldLoc - 4 >= 0){\n// moveNoble(oldLoc, oldLoc-4);\n// }\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Ignoble2\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Ignoble2\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //makes all gray cards in user field worth 1 point\n// //implemented more in point method\n// case \"Indifferent\":\n// gameState.actionCardPlayed = true;\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Indifferent\")){\n// gameState.p0Field.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Indifferent\")){\n// gameState.p0Field.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //other player discards two action cards\n// //uses onclick for user choice\n// case \"Infighting\":\n// gameState.actionCardPlayed = true;\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Infighting\")){\n// for(int k = 0; k < 2; k ++) {\n// if(gameState.p1Hand.size() != 0) {\n// discardActionCard(gameState.p1Hand, userLoc);\n// }\n// }\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Infighting\")){\n// for(int k = 0; k < 2; k ++) {\n// if(gameState.p0Hand.size() != 0) {\n// discardActionCard(gameState.p0Hand, userLoc);\n// }\n// }\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //trade user hands\n// case \"Info_Exchange\":\n// gameState.actionCardPlayed = true;\n// tradeHands(gameState.p0Hand, gameState.p1Hand);\n//\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Info_Exchange\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Info_Exchange\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //move nearest blue noble to front of line\n// case \"Lack_Faith\":\n// if(gameState.p1Field.contains(card.id.equals(\"Callous\")) || gameState.p0Field.contains(card.id.equals(\"Callous\")) ){\n// break;\n// }\n// gameState.actionCardPlayed = true;\n//\n// for(int k = 0; k < gameState.nobleLine.size(); k++){\n// if(gameState.nobleLine.get(k).cardColor.equals(\"Blue\")){\n// moveNoble(k, 0);\n// }\n// }\n//\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Lack_Faith\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Lack_Faith\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //look at enemy player hand and discard one card\n// //cannot do as of right now\n// case \"Lack_Support\":\n// gameState.actionCardPlayed = true;\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Lack_Support\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Lack_Support\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n//\n// //look at top three cards of noble deck and add one to nobleLine\n// case \"Late_Arrival\":\n// if(gameState.p1Field.contains(card.id.equals(\"Callous\")) || gameState.p0Field.contains(card.id.equals(\"Callous\")) ){\n// break;\n// }\n// gameState.actionCardPlayed = true;\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Late_Arrival\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// topThreeCards(gameState.p0Field);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Late_Arrival\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// topThreeCards(gameState.p1Field);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //if marie is in line, move her to front\n// case \"Let_Cake\":\n// if(gameState.p1Field.contains(card.id.equals(\"Callous\")) || gameState.p0Field.contains(card.id.equals(\"Callous\")) ){\n// break;\n// }\n// gameState.actionCardPlayed = true;\n//\n// for(int k = 0; k < gameState.nobleLine.size(); k++){\n// if(gameState.nobleLine.get(k).id.equals(\"Antoinette\")){\n// moveNoble(k, 0);\n// }\n// }\n//\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Let_Cake\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Let_Cake\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //move purple noble up to 2 spaces ahead\n// //needs onclick\n// case \"Majesty\":\n// if(gameState.p1Field.contains(card.id.equals(\"Callous\")) || gameState.p0Field.contains(card.id.equals(\"Callous\")) ){\n// break;\n// }\n// gameState.actionCardPlayed = true;\n//\n// if(gameState.nobleLine.get(userLoc).cardColor.equals(\"Purple\")){\n// if(userLoc - newLoc < 3){\n// moveNoble(userLoc, newLoc);\n// }\n// }\n//\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Majesty\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Majesty\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //put all noble cards in noble line back in noble deck, shuffle noble deck\n// //and redeal the same amount of noble cards that used to be in line\n// case \"Mass_Confusion\":\n// if(gameState.p1Field.contains(card.id.equals(\"Callous\")) || gameState.p0Field.contains(card.id.equals(\"Callous\")) ){\n// break;\n// }\n// gameState.actionCardPlayed = true;\n// int var = gameState.nobleLine.size();\n// for(int k = 0; k < gameState.nobleLine.size(); k++){\n// gameState.deckNoble.add(gameState.nobleLine.get(k));\n// gameState.nobleLine.remove(k);\n// }\n// shuffleDecks();\n// for(int l = 0; l < var; l++){\n// dealNoble();\n// }\n//\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Mass_Confusion\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Mass_Confusion\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //move red card up to two spaces forward\n// case \"Military_Might\":\n// if(gameState.p1Field.contains(card.id.equals(\"Callous\")) || gameState.p0Field.contains(card.id.equals(\"Callous\")) ){\n// break;\n// }\n// gameState.actionCardPlayed = true;\n//\n// if(gameState.nobleLine.get(userLoc).cardColor.equals(\"Red\")){\n// if(userLoc - newLoc < 3){\n// moveNoble(userLoc, newLoc);\n// }\n// }\n//\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Military_Might\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Military_Might\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //if this card is in your field, then you get +1 points for all red cards you have\n// //is implemented in point method\n// case \"Military_Support\":\n// gameState.actionCardPlayed = true;\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Military_Support\")){\n// gameState.p0Field.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Military_Support\")){\n// gameState.p1Field.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //randomly shuffle first 5 nobles in line\n// case \"Milling1\":\n// if(gameState.p1Field.contains(card.id.equals(\"Callous\")) || gameState.p0Field.contains(card.id.equals(\"Callous\")) ){\n// break;\n// }\n// gameState.actionCardPlayed = true;\n//\n// rearrangeFives();\n//\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Milling1\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Milling1\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //randomly shuffle first five nobles in line\n// case \"Milling2\":\n// if(gameState.p1Field.contains(card.id.equals(\"Callous\")) || gameState.p0Field.contains(card.id.equals(\"Callous\")) ){\n// break;\n// }\n// gameState.actionCardPlayed = true;\n//\n// rearrangeFives();\n//\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Milling2\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Milling2\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //other player places their last collected noble back in noble line\n// case \"Missed\":\n// if(gameState.p1Field.contains(card.id.equals(\"Callous\")) || gameState.p0Field.contains(card.id.equals(\"Callous\")) ){\n// break;\n// }\n// boolean notFound = true;\n// int length;\n// gameState.actionCardPlayed = true;\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Missed\")){\n// length = gameState.p1Field.size()-1;\n// while(notFound){\n// if(gameState.p1Field.get(length).isNoble){\n// gameState.nobleLine.add(gameState.p1Field.get(length));\n// gameState.p1Field.remove(length);\n// notFound = false;\n// }\n// length--;\n// }\n//\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Missed\")){\n// length = gameState.p0Field.size()-1\n// while(notFound){\n// if(gameState.p0Field.get(length).isNoble){\n// gameState.nobleLine.add(gameState.p0Field.get(length));\n// gameState.p0Field.remove(length);\n// notFound = false;\n// }\n// length--;\n// }\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //removes random noble from enemy player noble field\n// case \"Missing_Heads\":\n// gameState.actionCardPlayed = true;\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Missing_Heads\")){\n// gameState.p1Field.remove((int)(Math.random()*gameState.p1Field.size()));\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Missing_Heads\")){\n// gameState.p0Field.remove((int)(Math.random()*gameState.p0Field.size()));\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //user rearranges the first four nobles however they want\n// case \"Opinionated\":\n// if(gameState.p1Field.contains(card.id.equals(\"Callous\")) || gameState.p0Field.contains(card.id.equals(\"Callous\")) ){\n// break;\n// }\n// gameState.actionCardPlayed = true;\n//\n// if(gameState.nobleLine.size() > 3) {\n// moveNoble(0, newLoc);\n// moveNoble(1, newLoc);\n// moveNoble(2, newLoc);\n// moveNoble(3, newLoc);\n// }\n// else{\n// for(int k = 0; k < gameState.nobleLine.size(); k++){\n// moveNoble(k, newLoc);\n// }\n// }\n//\n//\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Opinionated\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Opinionated\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //get 3 action cards and skip collect noble phase\n// case \"Political_Influence1\":\n// gameState.actionCardPlayed = true;\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Political_Influence1\")){\n// dealActionCard(gameState.p0Hand);\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Political_Influence1\")){\n// dealActionCard(gameState.p1Hand);\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.turnPhase++;\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //get 3 action cards and skip noble draw phase\n// case \"Political_Influence2\":\n// gameState.actionCardPlayed = true;\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Political_Influence2\")){\n// dealActionCard(gameState.p0Hand);\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Political_Influence2\")){\n// dealActionCard(gameState.p1Hand);\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.turnPhase++;\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //move anynoble in line to front\n// //requires on click\n// case \"Public_Demand\":\n// gameState.actionCardPlayed = true;\n// moveNoble(userLoc, 0);\n//\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Public_Demand\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Public_Demand\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //move noble card exactly 2 spaces in line\n// //need on click listener\n// case \"Pushed1\":\n// if(gameState.p1Field.contains(card.id.equals(\"Callous\")) || gameState.p0Field.contains(card.id.equals(\"Callous\")) ){\n// break;\n// }\n// gameState.actionCardPlayed = true;\n//\n// if(userLoc - 2 >=0){\n// moveNoble(userLoc, userLoc-2);\n// }\n// else{\n// moveNoble(userLoc, 0);\n// }\n//\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Pushed1\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Pushed1\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //move noble card exactly 2 spaces in line\n// //need on click listener\n// case \"Pushed2\":\n// if(gameState.p1Field.contains(card.id.equals(\"Callous\")) || gameState.p0Field.contains(card.id.equals(\"Callous\")) ){\n// break;\n// }\n// gameState.actionCardPlayed = true;\n// if(userLoc - 2 >=0){\n// moveNoble(userLoc, userLoc-2);\n// }\n// else{\n// moveNoble(userLoc, 0);\n// }\n//\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Pushed2\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Pushed2\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //put players action cards back in action deck, shuffle action deck and give each player 5 cards\n// case \"Rain_Delay\":\n// gameState.actionCardPlayed = true;\n//\n// while(!gameState.p0Hand.isEmpty()){\n// gameState.deckAction.add(gameState.p0Hand.get(0));\n// gameState.p0Hand.remove(0);\n// }\n// while(!gameState.p1Hand.isEmpty()){\n// gameState.deckAction.add(gameState.p1Hand.get(0));\n// gameState.p1Hand.remove(0);\n// }\n// shuffleDecks();\n// for(int k = 0; k < 5; k++){\n// dealActionCard(gameState.p0Hand);\n// dealActionCard(gameState.p1Hand);\n// }\n//\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Rain_Delay\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Rain_Delay\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //put action card in discard pile into your hand\n// //need onclick\n// case \"Rat_Break\":\n// gameState.actionCardPlayed = true;\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Rat_Break\")){\n// if(!gameState.deckDiscard.get(userLoc).isNoble) {\n// gameState.p0Hand.add(gameState.deckDiscard.get(userLoc));\n// gameState.deckDiscard.remove(userLoc);\n// }\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Rat_Break\")){\n// if(!gameState.deckDiscard.get(userLoc).isNoble) {\n// gameState.p1Hand.add(gameState.deckDiscard.get(userLoc));\n// gameState.deckDiscard.remove(userLoc);\n// }\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //other player cant play action on their next turn\n// case \"Rush_Job\":\n// gameState.actionCardPlayed = true;\n// noAction = true;\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Rush_Job\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Rush_Job\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //day ends after player finishes turn, discards all noble line\n// case \"Scarlet\":\n// if(gameState.p1Field.contains(card.id.equals(\"Callous\")) || gameState.p0Field.contains(card.id.equals(\"Callous\")) ){\n// break;\n// }\n// gameState.actionCardPlayed = true;\n// scarletInPlay = true;\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Scarlet\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Scarlet\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //move one noble card one spot forward\n// case \"Stumble1\":\n// if(gameState.p1Field.contains(card.id.equals(\"Callous\")) || gameState.p0Field.contains(card.id.equals(\"Callous\")) ){\n// break;\n// }\n// gameState.actionCardPlayed = true;\n//\n// if(userLoc != 0){\n// moveNoble(userLoc, userLoc -1);\n// }\n//\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Stumble1\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Stumble1\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //move one noble card one spot forward\n// case \"Stumble2\":\n// if(gameState.p1Field.contains(card.id.equals(\"Callous\")) || gameState.p0Field.contains(card.id.equals(\"Callous\")) ){\n// break;\n// }\n// gameState.actionCardPlayed = true;\n// if(userLoc != 0){\n// moveNoble(userLoc, userLoc -1);\n// }\n//\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Stumble2\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Stumble2\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n //reverse nobleline order\n case \"Long_Walk\":\n if(gameState.p1Field.contains(card.id.equals(\"Callous\")) || gameState.p0Field.contains(card.id.equals(\"Callous\")) ){\n break;\n }\n gameState.actionCardPlayed = true;\n reverseLineOrder();\n if(gameState.playerTurn == 0){\n for(int i = 0; i < gameState.p0Hand.size(); i++){\n if(gameState.p0Hand.get(i).getId().equals(\"Long_Walk\")){\n gameState.deckDiscard.add(gameState.p0Hand.get(i));\n gameState.p0Hand.remove(i);\n }\n }\n }\n else{\n for(int i = 0; i < gameState.p1Hand.size(); i++){\n if(gameState.p1Hand.get(i).getId().equals(\"Long_Walk\")){\n gameState.deckDiscard.add(gameState.p1Hand.get(i));\n gameState.p1Hand.remove(i);\n }\n }\n\n }\n gameState.actionCardPlayed = false;\n break;\n//\n// //move noble forward exactly 3 places\n// case \"Better_Thing\":\n// if(gameState.p1Field.contains(card.id.equals(\"Callous\")) || gameState.p0Field.contains(card.id.equals(\"Callous\")) ){\n// break;\n// }\n// gameState.actionCardPlayed = true;\n// if(userLoc - 3 >=0){\n// moveNoble(userLoc, userLoc-3);\n// }\n// else{\n// moveNoble(userLoc, 0);\n// }\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Better_Thing\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Better_Thing\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n//\n// //add card to other player field, it is worth -2\n// //will be done in point method\n// case \"Tough_Crowd\":\n//\n// gameState.actionCardPlayed = true;\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Tough_Crowd\")){\n// gameState.p1Field.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Tough_Crowd\")){\n// gameState.p0Field.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //move noble card back one spot let user play another action\n// //i have no idea how to let the user play another action\n// case \"Trip1\":\n// if(gameState.p1Field.contains(card.id.equals(\"Callous\")) || gameState.p0Field.contains(card.id.equals(\"Callous\")) ){\n// break;\n// }\n// gameState.actionCardPlayed = true;\n// gameState.turnPhase --;\n//\n// if(userLoc != gameState.nobleLine.size()-1){\n// moveNoble(userLoc, userLoc +1);\n// }\n//\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Trip1\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Trip1\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //move noble card back one spot let user play another action\n// //i have no idea how to let the user play another action\n// case \"Trip2\":\n// if(gameState.p1Field.contains(card.id.equals(\"Callous\")) || gameState.p0Field.contains(card.id.equals(\"Callous\")) ){\n// break;\n// }\n// gameState.actionCardPlayed = true;\n// gameState.turnPhase --;\n//\n// if(userLoc != gameState.nobleLine.size()-1){\n// moveNoble(userLoc, userLoc +1);\n// }\n//\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Trip2\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Trip2\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //put any action card in player field into discard\n// //need onclick user loc\n// case \"Twist_Fate\":\n// gameState.actionCardPlayed = true;\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Twist_Fate\")){\n// if(!gameState.p1Field.get(userLoc).isNoble){\n// gameState.deckDiscard.add(gameState.p1Field.get(userLoc));\n// gameState.p1Field.remove(userLoc);\n// }\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Twist_Fate\")){\n// if(!gameState.p0Field.get(userLoc).isNoble){\n// gameState.deckDiscard.add(gameState.p0Field.get(userLoc));\n// gameState.p0Field.remove(userLoc);\n// }\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n// //move any noble up to 3 spaces forward\n// //need onclick user loc and the new location\n// case \"Was_Name\":\n// if(gameState.p1Field.contains(card.id.equals(\"Callous\")) || gameState.p0Field.contains(card.id.equals(\"Callous\")) ){\n// break;\n// }\n// gameState.actionCardPlayed = true;\n//\n// if(userLoc - newLoc >=0){\n// moveNoble(userLoc, newLoc);\n// }\n// else{\n// moveNoble(userLoc, 0);\n// }\n//\n// if(gameState.playerTurn == 0){\n// for(int i = 0; i < gameState.p0Hand.size(); i++){\n// if(gameState.p0Hand.get(i).getId().equals(\"Was_Name\")){\n// gameState.deckDiscard.add(gameState.p0Hand.get(i));\n// gameState.p0Hand.remove(i);\n// }\n// }\n// }\n// else{\n// for(int i = 0; i < gameState.p1Hand.size(); i++){\n// if(gameState.p1Hand.get(i).getId().equals(\"Was_Name\")){\n// gameState.deckDiscard.add(gameState.p1Hand.get(i));\n// gameState.p1Hand.remove(i);\n// }\n// }\n//\n// }\n// gameState.actionCardPlayed = false;\n// break;\n//\n }\n }\n return false;\n }",
"public int combatSequenceForOneEnemy(BorderPane bP, Sword weapon1, MagicSword mS1, Enemy enemy, Club weapon2, Character player, int sAC, Text roomI, Text eH, Text pH, Text pE, Text cL, Text cG, Text cons, Text optA, Text optB, Text optC, Text optD, Text optE, Text optF){\r\n \r\n do{\r\n ChoicePrompt prompt11 = new ChoicePrompt(bP.getScene().getWindow());\r\n String choice11 = prompt11.getResult();\r\n\r\n \r\n if (choice11.compareToIgnoreCase(\"slash\")== 0) \r\n { \r\n \r\n //getting value for attack factoring hit chance\r\n attackDamage = weapon1.use();\r\n //displaying message about damage done\r\n optD.setText(\"You attack the enemy and do \"+attackDamage+\" slashing damage.\");\r\n //lowering enemy health\r\n enemy.setHealth(enemy.getHealth()-attackDamage); \r\n eH.setText(\"HP: \"+ enemy.getHealth());\r\n //enemy attack\r\n enemyAttackDamage = weapon2.use();\r\n optE.setText(\"Goblin attacks you for \"+enemyAttackDamage+ \" bludgeoning damage!\");\r\n //lowering character health\r\n health = player.getHealth() - enemyAttackDamage;\r\n player.setHealth(health);\r\n //Yaxin for every attack, the experience increase enemyAttackDamage\r\n expLevel = player.getExperienceLevel();\r\n experience = player.getExperience() + enemyAttackDamage; \r\n /*if (player.getExperienceLevel() - expLevel >= 1)\r\n {\r\n this.levelUp(bP, player, cL, cG, optB, optC, optD, optE, optF );\r\n player.setHealth(maxHealth);\r\n }*/ \r\n player.setExperience(experience);\r\n this.levelUp(bP, player, cL, cG, optB, optC, optD, optE, optF);\r\n pH.setText(\"HP: \"+ player.getHealth());\r\n pE.setText(\"Exp: \"+player.getExperience()+\" out of \"+player.getExpNeeded()); \r\n //pH.setText(\"HP: \"+ player.getHealth());\r\n this.characterDeath(player, bP, roomI, cons, optA, optB, optC, optD, optE);\r\n }\r\n else if( choice11.compareToIgnoreCase(\"stab\") == 0)\r\n {\r\n if(mS1.getHasMagicSword() == true)\r\n {\r\n //getting value for attack factoring hit chance\r\n attackDamage = weapon1.stabAttack();\r\n if(mS1.getHasFireDamage()==true)\r\n {\r\n if(attackDamage==(mS1.getAttackM()*1.5+mS1.getFireDamage())){\r\n //displaying message about damage done\r\n optD.setText(\"You attack the goblin and do \"+mS1.getAttackM()+\" piercing damage\\n and \"+mS1.getFireDamage()+\" fire damage.\");\r\n //lowering enemy health\r\n enemy.setHealth(enemy.getHealth()-attackDamage); \r\n eH.setText(\"HP: \" + enemy.getHealth());\r\n }\r\n else{\r\n //display message about damage done\r\n optD.setText(\"You attack the goblina and do 2 piercing damage.\");\r\n enemy.setHealth(enemy.getHealth()-attackDamage); \r\n eH.setText(\"HP: \" + enemy.getHealth());\r\n }\r\n }\r\n else\r\n {\r\n if(attackDamage==(mS1.getAttackM()*1.5+mS1.getIceDamage())){\r\n //displaying message about damage done\r\n optD.setText(\"You attack the goblin and do \"+mS1.getAttackM()+\" piercing damage\\n and \"+mS1.getIceDamage()+\" ice damage.\");\r\n //lowering enemy health\r\n enemy.setHealth(enemy.getHealth()-attackDamage); \r\n eH.setText(\"HP: \" + enemy.getHealth());\r\n }\r\n else{\r\n //display message about damage done\r\n optD.setText(\"You attack the goblina and do 2 piercing damage.\");\r\n enemy.setHealth(enemy.getHealth()-attackDamage); \r\n eH.setText(\"HP: \" + enemy.getHealth());\r\n }\r\n }\r\n }\r\n else{\r\n {\r\n //getting value for attack factoring hit chance\r\n attackDamage = weapon1.stabAttack();\r\n //displaying message about damage done\r\n optD.setText(\"You attack the goblin and do \"+attackDamage+\" piercing damage.\");\r\n //lowering enemy health\r\n enemy.setHealth(enemy.getHealth()-attackDamage); \r\n eH.setText(\"HP: \" + enemy.getHealth()); \r\n }\r\n //enemy attack\r\n enemyAttackDamage = (weapon2.use());\r\n optE.setText(\"Goblin attacks you for \"+enemyAttackDamage+ \" bludgeoning damage!\");\r\n health = player.getHealth() - enemyAttackDamage;\r\n player.setHealth(health);\r\n //lowering character health\r\n expLevel = player.getExperienceLevel();\r\n experience = player.getExperience() + enemyAttackDamage; \r\n /*if (player.getExperienceLevel() - expLevel >= 1)\r\n {\r\n this.levelUp(bP, player, cL, cG, optB, optC, optD, optE, optF );\r\n player.setHealth(maxHealth);\r\n } */\r\n this.levelUp(bP, player, cL, cG, optB, optC, optD, optE, optF); \r\n pH.setText(\"HP: \"+player.getHealth() );\r\n pE.setText(\"Exp: \"+player.getExperience()+\" out of \"+player.getExpNeeded());\r\n //tracking stab attacks for character improvement\r\n sAC++;\r\n weapon1.setCritHitChance(player.improvedCritChance(sAC), player.getHasImprovedCritChance());\r\n this.characterDeath(player, bP, roomI, cons, optA, optB, optC, optD, optE);\r\n }\r\n }\r\n //code to exit the program\r\n else if(choice11.compareToIgnoreCase(\"quit\") == 0)\r\n {\r\n System.exit(1);\r\n }\r\n }while(enemy.getHealth() > 0);\r\n return sAC;\r\n }",
"public void aceChanger() {\n\t\t// Two aces in hand before move has been made\n\t\tif (hand.numOfCards() == 2 && isBusted()) {\n\t\t\thandIterator = new HandIterator(hand.getCards());\n\t\t\tCard c = hand.getCards().get(0);\n\t\t\tCard newAce = new Card(1, \"A\", c.getCardSuit());\n\t\t\thand.addCard(newAce);\n\t\t\thand.remove(c);\n\t\t// Ace in hand and set to 11, and hand has busted\n\t\t} else if (checkForAce() && isBusted() && hand.numOfCards() > 2) {\n\t\t\thandIterator = new HandIterator(hand.getCards());\n\t\t\twhile (handIterator.hasNext()) {\n\t\t\t\tCard c = (Card) handIterator.next();\n\t\t\t\tif (c.getCardValue() == 11) {\n\t\t\t\t\thand.addCard(new Card(1, \"A\", c.getCardSuit()));\n\t\t\t\t\thand.remove(c);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t// Ace in hand and total hand value is < 21\n//\t\t} else if (checkForAce() && !isBusted()) {\n//\t\t\tprintHand();\n//\t\t\tif (hand.numOfAces() == 1) {\n//\t\t\t\thandIterator = new HandIterator(hand.getCards());\n//\t\t\t\tSystem.out.println(\"You have an Ace card in your hand. Do you \"\n//\t\t\t\t\t\t+ \"want to set the value to 1 or 11?\");\n//\t\t\t\tint ans = scan.nextInt();\n//\t\t\t\twhile (handIterator.hasNext()) {\n//\t\t\t\t\tCard c = (Card) handIterator.next();\n//\t\t\t\t\tif (c.getCardName().equals(\"A\")) {\n//\t\t\t\t\t\twhile (ans != 1 && ans != 11) {\n//\t\t\t\t\t\t\tSystem.out.println(\"Invalid input. Try again.\");\n//\t\t\t\t\t\t\tans = scan.nextInt();\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\thand.addCard(new Card(ans, \"A\", c.getCardSuit()));\n//\t\t\t\t\t\thand.remove(c);\n//\t\t\t\t\t\treturn;\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t} else {\n//\t\t\t\thandIterator = new HandIterator(hand.getCards());\n//\t\t\t\tSystem.out.println(\"You have multiple Ace cards in your hand.\"\n//\t\t\t\t\t\t+ \" Which card do you want to set the value for?\"\n//\t\t\t\t\t\t+ \" (Select by appropriate card suit.) Type exit to\"\n//\t\t\t\t\t\t+ \" make no changes.\");\n//\t\t\t\tString suit = scan.next();\n//\t\t\t\tif (suit.equalsIgnoreCase(\"exit\")) {\n//\t\t\t\t\treturn;\n//\t\t\t\t}\n//\t\t\t\twhile (handIterator.hasNext()) {\n//\t\t\t\t\tCard c = (Card) handIterator.next();\n//\t\t\t\t\tif (c.getCardName().equals(\"A\") && \n//\t\t\t\t\t\t\tc.getCardSuit().equalsIgnoreCase(suit)) {\n//\t\t\t\t\t\tSystem.out.println(\"Do you want to set the value to 1\"\n//\t\t\t\t\t\t\t\t+ \" or 11?\");\n//\t\t\t\t\t\tint ans = scan.nextInt();\n//\t\t\t\t\t\thand.addCard(new Card(ans, \"A\", c.getCardSuit()));\n//\t\t\t\t\t\thand.remove(c);\n//\t\t\t\t\t\treturn;\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t}\n\t\t}\n\t}",
"@Test\n public void testConditionlManaWorksIfCavernIsReplayed() {\n addCard(Zone.HAND, playerA, \"Cavern of Souls\");\n addCard(Zone.HAND, playerA, \"Gladecover Scout\"); // Elf costing {G}\n addCard(Zone.HAND, playerA, \"Fume Spitter\"); // Horror costing {B}\n\n // Instant - {U}{U} - Return target permanent to its owner's hand.\n addCard(Zone.HAND, playerB, \"Boomerang\");\n addCard(Zone.BATTLEFIELD, playerB, \"Island\", 2);\n\n setStrictChooseMode(true);\n\n playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, \"Cavern of Souls\");\n setChoice(playerA, \"Elf\");\n\n // getting green mana for Elf into pool\n activateManaAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, \"{T}: Add one mana of \");\n setChoice(playerA, \"Green\");\n\n // return cavern to hand\n castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerB, \"Boomerang\", \"Cavern of Souls\");\n waitStackResolved(3, PhaseStep.PRECOMBAT_MAIN);\n\n // the green mana usable for Elf should be in the mana pool\n castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, \"Gladecover Scout\");\n\n // playing the cavern again choose different creature type\n playLand(3, PhaseStep.POSTCOMBAT_MAIN, playerA, \"Cavern of Souls\");\n setChoice(playerA, \"Horror\");\n\n // the black mana usable for Horror should be in the mana pool\n activateManaAbility(3, PhaseStep.POSTCOMBAT_MAIN, playerA, \"{T}: Add one mana of \");\n setChoice(playerA, \"Black\");\n castSpell(3, PhaseStep.POSTCOMBAT_MAIN, playerA, \"Fume Spitter\");\n\n setStopAt(3, PhaseStep.END_TURN);\n execute();\n\n assertGraveyardCount(playerB, \"Boomerang\", 1);\n assertPermanentCount(playerA, \"Cavern of Souls\", 1);\n\n // Check the elf was cast\n assertPermanentCount(playerA, \"Gladecover Scout\", 1);\n // Check Horror on the Battlefield\n assertPermanentCount(playerA, \"Fume Spitter\", 1);\n }",
"public void Attackstrategy(){\r\n\t\t\r\n\t\tfor(int i = 0; i < player.gethandlength(); i+=1){\r\n\t\t\tplayer.gethandcard(i).onplay();\r\n\t\t}\r\n\t\t\r\n\t\tfor(int i = 0; i < player.getBanklength(); i+=1){\r\n\t\t\tif(player.getbankcard(i).getName().equalsIgnoreCase(\"Militia\"))\r\n\t\t\t\tplayer.getbankcard(i).buy();\r\n\t\t\telse if(player.getbankcard(i).getName().equalsIgnoreCase(\"Mercernary\"))\r\n\t\t\t\tplayer.getbankcard(i).buy();\r\n\t\t\telse if(player.getbankcard(i).getName().equalsIgnoreCase(\"Courtesan\"))\r\n\t\t\t\tplayer.getbankcard(i).buy();\r\n\t\t}\r\n\t\t\r\n\t\tif(player.getApplesAmount() > 0){\r\n\t\t\tfor(int i = 0; i < player.getfieldlength(); i+=1){\r\n\t\t\t\t\r\n\t\t\t\tif(player.getfieldcard(i).getName().equalsIgnoreCase(\"Courtesan\")){\r\n\t\t\t\t\twhile(player.getApplesAmount() > 0){\r\n\t\t\t\t\t\tplayer.getfieldcard(i).consumeApples();}\r\n\t\t\t\t\t}\r\n\t\t\t\telse if(player.getfieldcard(i).getName().equalsIgnoreCase(\"Mercernary\")){\r\n\t\t\t\t\twhile(player.getApplesAmount() > 0){\r\n\t\t\t\t\t\tplayer.getfieldcard(i).consumeApples();}\r\n\t\t\t\t\t}\r\n\t\t\t\telse if(player.getfieldcard(i).getName().equalsIgnoreCase(\"Militia\")){\r\n\t\t\t\t\twhile(player.getApplesAmount() > 0){\r\n\t\t\t\t\t\tplayer.getfieldcard(i).consumeApples();}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(player.getMagicAmount() > 0){\r\n\t\t\tfor(int i = 0; i < player.getfieldlength(); i+=1){\r\n\t\t\t\t\r\n\t\t\t\tif(player.getfieldcard(i).getName().equalsIgnoreCase(\"Courtesan\")){\r\n\t\t\t\t\twhile(player.getApplesAmount() > 0){\r\n\t\t\t\t\t\tplayer.getfieldcard(i).consumeMagic();}\r\n\t\t\t\t\t}\r\n\t\t\t\telse if(player.getfieldcard(i).getName().equalsIgnoreCase(\"Mercernary\")){\r\n\t\t\t\t\twhile(player.getApplesAmount() > 0){\r\n\t\t\t\t\t\tplayer.getfieldcard(i).consumeMagic();}\r\n\t\t\t\t\t}\r\n\t\t\t\telse if(player.getfieldcard(i).getName().equalsIgnoreCase(\"Militia\")){\r\n\t\t\t\t\twhile(player.getApplesAmount() > 0){\r\n\t\t\t\t\t\tplayer.getfieldcard(i).consumeMagic();}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t}\r\n\t}",
"@Test\n public void insectileAbberationRepealXis1Test() {\n \n skipInitShuffling();\n addCard(Zone.BATTLEFIELD, playerA, delver);\n addCard(Zone.LIBRARY, playerA, \"Lightning Bolt\"); // to transform Delver of Secrets\n // Instant - {X}{U}\n // Return target nonland permanent with converted mana cost X to its owner's hand. Draw a card.\n addCard(Zone.HAND, playerB, \"Repeal\");\n addCard(Zone.BATTLEFIELD, playerB, \"Island\", 2);\n\n castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, \"Repeal\");\n setChoice(playerB, \"X=1\");\n // Insectile Aberration is auto-chosen since only target\n\n setStopAt(1, PhaseStep.BEGIN_COMBAT);\n execute();\n\n assertGraveyardCount(playerB, \"Repeal\", 1);\n assertPermanentCount(playerA, insect, 0);\n assertHandCount(playerA, delver, 1); // day-side of Insectile Abberation returned to hand\n }",
"private void checkForAccident(double time) {\n\n\t\tdouble chance = .005D;\n\n\t\t// Materials science skill modification.\n\t\tint skill = getEffectiveSkillLevel();\n\t\tif (skill <= 3) {\n\t\t\tchance *= (4 - skill);\n\t\t} else {\n\t\t\tchance /= (skill - 2);\n\t\t}\n\n\t\t// Modify based on the workshop building's wear condition.\n\t\tchance *= workshop.getBuilding().getMalfunctionManager().getWearConditionAccidentModifier();\n\n\t\tif (RandomUtil.lessThanRandPercent(chance * time)) {\n\n\t\t\tif (person != null) {\n//\t\t\t\tlogger.info(\"[\" + person.getLocationTag().getShortLocationName() + \"] \" + person.getName() + \" has accident while manufacturing good.\");\n\t\t\t\tworkshop.getBuilding().getMalfunctionManager().createASeriesOfMalfunctions(person);\n\t\t\t} else if (robot != null) {\n//\t\t\t\tlogger.info(\"[\" + robot.getLocationTag().getShortLocationName() + \"] \" + robot.getName() + \" has accident while manufacturing godd.\");\n\t\t\t\tworkshop.getBuilding().getMalfunctionManager().createASeriesOfMalfunctions(robot);\n\t\t\t}\n\t\t}\n\t}",
"public static void curar(){\n int aleatorio; //variables locales a utilizar\n Random numeroAleatorio = new Random(); //declarando variables tipo random para aleatoriedad\n int curador;\n //condicion de puntos de mana para ejecutar la curacion del jugador\n if(puntosDeMana>=1){\n //acciones de la funcion curar en el jugador\n aleatorio = (numeroAleatorio.nextInt(25-15+1)+15);\n curador= ((nivel+1)*5)+aleatorio;\n puntosDeVida= puntosDeVida+curador;\n puntosDeMana=puntosDeMana-1;\n }\n else{//imprimiendo el mensaje de curacion fallada\n System.out.println(\"no cuentas con Puntos De mana (MP) para curarte\");\n }\n }",
"public int combatSequenceForTwoEnemy(BorderPane bP, Sword weapon1, MagicSword mS1, Enemy enemy, Enemy enemy2, Club weapon2, Club weapon3, Character player, int sAC, Text roomI, Text eH, Text eH2, Text pH, Text pE, Text cL, Text cG, Text cons, Text optA, Text optB, Text optC, Text optD, Text optE, Text optF){\r\n \r\n do{\r\n ChoicePrompt fightPrompt = new ChoicePrompt(bP.getScene().getWindow());\r\n String fightPrompt2 = fightPrompt.getResult();\r\n\r\n \r\n if (fightPrompt2.compareToIgnoreCase(\"slash\")== 0) \r\n { \r\n if(enemy.getHealth()>= 0&&enemy2.getHealth()>=0)\r\n {\r\n //getting value for attack factoring hit chance\r\n attackDamage = weapon1.use();\r\n //displaying message about damage done\r\n optC.setText(\"You attack the \"+enemy.getName()+\" and do \"+attackDamage+\" slashing damage.\");\r\n //lowering enemy health\r\n enemy.setHealth(enemy.getHealth()-attackDamage); \r\n eH.setText(\"HP: \"+ enemy.getHealth());\r\n //enemy attack\r\n enemyAttackDamage = (weapon2.use());\r\n optD.setText(enemy.getName()+\" attacks you for \"+enemyAttackDamage+ \" bludgeoning damage!\");\r\n //lowering character health\r\n player.setHealth(player.getHealth()-enemyAttackDamage);\r\n expLevel = player.getExperienceLevel();\r\n experience = player.getExperience() + enemyAttackDamage; \r\n player.setExperience(player.getExperience()+enemyAttackDamage);\r\n /*if (player.getExperienceLevel() - expLevel >= 1)\r\n {\r\n this.levelUp(bP, player, cL, cG, optB, optC, optD, optE, optF );\r\n player.setHealth(maxHealth);\r\n } */ \r\n pH.setText(\"HP: \"+player.getHealth());\r\n pE.setText(\"Exp: \"+player.getExperience()+\" out of \"+player.getExpNeeded());\r\n //pH.setText(\"HP: \"+player.getHealth()); \r\n enemyAttackDamage2 = weapon3.use();\r\n optE.setText(enemy2.getName()+\" attacks you for \"+enemyAttackDamage2+ \" bludgeoning damage!\");\r\n //lowering character health\r\n health = player.getHealth() - enemyAttackDamage2; \r\n expLevel = player.getExperienceLevel();\r\n player.setExperience(player.getExperience()+enemyAttackDamage2);\r\n /*if (player.getExperienceLevel() - expLevel >= 1)\r\n {\r\n this.levelUp(bP, player, cL, cG, optB, optC, optD, optE, optF );\r\n player.setHealth(maxHealth);\r\n } */\r\n this.levelUp(bP, player, cL, cG, optB, optC, optD, optE, optF);\r\n pH.setText(\"HP: \"+player.getHealth());\r\n pE.setText(\"Exp: \"+player.getExperience()+\" out of \"+player.getExpNeeded()); \r\n this.characterDeath(player, bP, cons, roomI, optA, optB, optC, optD, optE);\r\n }\r\n else{\r\n optE.setText(\" \");\r\n //getting value for attack factoring hit chance\r\n attackDamage = weapon1.use();\r\n //displaying message about damage done\r\n optC.setText(\"You attack the \"+enemy2.getName()+\" and do \"+attackDamage+\" slashing damage.\");\r\n //lowering enemy health\r\n enemy2.setHealth(enemy2.getHealth()-attackDamage); \r\n eH2.setText(\"HP: \"+ enemy2.getHealth());\r\n enemyAttackDamage2 = weapon3.use();\r\n optD.setText(enemy2.getName()+\" attacks you for \"+enemyAttackDamage2+ \" bludgeoning damage!\");\r\n //lowering character health\r\n health = player.getHealth() - enemyAttackDamage2; \r\n player.setHealth(health);\r\n expLevel = player.getExperienceLevel();\r\n player.setExperience(player.getExperience()+enemyAttackDamage2);\r\n /* if (player.getExperienceLevel() - expLevel >= 1)\r\n {\r\n this.levelUp(bP, player, cL, cG, optB, optC, optD, optE, optF );\r\n player.setHealth(maxHealth);\r\n } */\r\n this.levelUp(bP, player, cL, cG, optB, optC, optD, optE, optF);\r\n pH.setText(\"HP: \"+player.getHealth());\r\n pE.setText(\"Exp: \"+player.getExperience()+\" out of \"+player.getExpNeeded());\r\n player.setExperience(player.getExperience()+enemyAttackDamage2);\r\n this.characterDeath(player, bP, roomI, cons, optA, optB, optC, optD, optE);\r\n }\r\n }\r\n else if(fightPrompt2.compareToIgnoreCase(\"stab\") == 0)\r\n {\r\n \r\n if(enemy.getHealth()>= 0&&enemy2.getHealth()>=0){\r\n if(mS1.getHasMagicSword() == true)\r\n {\r\n //getting value for attack factoring hit chance\r\n attackDamage = weapon1.stabAttack();\r\n if(mS1.getHasFireDamage()==true)\r\n {\r\n if(attackDamage==(mS1.getAttackM()*1.5+mS1.getFireDamage())){\r\n //displaying message about damage done\r\n optD.setText(\"You attack \"+enemy.getName()+\" and do \"+mS1.getAttackM()+\" piercing damage\\n and \"+mS1.getFireDamage()+\" fire damage.\");\r\n //lowering enemy health\r\n enemy.setHealth(enemy.getHealth()-attackDamage); \r\n eH.setText(\"HP: \" + enemy.getHealth());\r\n }\r\n else{\r\n //display message about damage done\r\n optD.setText(\"You attack the \"+enemy.getName()+\" and do 2 piercing damage.\");\r\n enemy.setHealth(enemy.getHealth()-attackDamage); \r\n eH.setText(\"HP: \" + enemy.getHealth());\r\n }\r\n }\r\n else\r\n {\r\n if(attackDamage==(mS1.getAttackM()*1.5+mS1.getIceDamage())){\r\n //displaying message about damage done\r\n optD.setText(\"You attack \"+enemy.getName()+\" and do \"+mS1.getAttackM()+\" piercing damage\\n and \"+mS1.getIceDamage()+\" ice damage.\");\r\n //lowering enemy health\r\n enemy.setHealth(enemy.getHealth()-attackDamage); \r\n eH.setText(\"HP: \" + enemy.getHealth());\r\n }\r\n else{\r\n //display message about damage done\r\n optD.setText(\"You attack \"+enemy.getName()+\" and do 2 piercing damage.\");\r\n enemy.setHealth(enemy.getHealth()-attackDamage); \r\n eH.setText(\"HP: \" + enemy.getHealth());\r\n }\r\n }\r\n }\r\n else{\r\n if(mS1.getHasMagicSword() == true)\r\n {\r\n //getting value for attack factoring hit chance\r\n attackDamage = weapon1.stabAttack();\r\n if(mS1.getHasFireDamage()==true)\r\n {\r\n if(attackDamage==(mS1.getAttackM()*1.5+mS1.getFireDamage())){\r\n //displaying message about damage done\r\n optD.setText(\"You attack \"+enemy.getName()+\" and do \"+mS1.getAttackM()+\" piercing damage\\n and \"+mS1.getFireDamage()+\" fire damage.\");\r\n //lowering enemy health\r\n enemy.setHealth(enemy.getHealth()-attackDamage); \r\n eH.setText(\"HP: \" + enemy.getHealth());\r\n }\r\n else{\r\n //display message about damage done\r\n optD.setText(\"You attack the \"+enemy.getName()+\" and do 2 piercing damage.\");\r\n enemy.setHealth(enemy.getHealth()-attackDamage); \r\n eH.setText(\"HP: \" + enemy.getHealth());\r\n }\r\n }\r\n else{\r\n if(attackDamage==(mS1.getAttackM()*1.5+mS1.getIceDamage())){\r\n //displaying message about damage done\r\n optD.setText(\"You attack \"+enemy.getName()+\" and do \"+mS1.getAttackM()+\" piercing damage\\n and \"+mS1.getIceDamage()+\" ice damage.\");\r\n //lowering enemy health\r\n enemy.setHealth(enemy.getHealth()-attackDamage); \r\n eH.setText(\"HP: \" + enemy.getHealth());\r\n }\r\n else{\r\n //display message about damage done\r\n optD.setText(\"You attack \"+enemy.getName()+\" and do 2 piercing damage.\");\r\n enemy.setHealth(enemy.getHealth()-attackDamage); \r\n eH.setText(\"HP: \" + enemy.getHealth());\r\n }\r\n }\r\n }\r\n else{ \r\n //getting value for attack factoring hit chance\r\n attackDamage = weapon1.stabAttack();\r\n //displaying message about damage done\r\n optC.setText(\"You attack the \"+enemy.getName()+\" and do \"+attackDamage+\" piercing damage.\");\r\n //lowering enemy health\r\n enemy.setHealth(enemy.getHealth()-attackDamage); \r\n eH.setText(\"HP: \"+ enemy.getHealth());\r\n //enemy attack\r\n enemyAttackDamage = (weapon2.use());\r\n optD.setText(enemy.getName()+\" attacks you for \"+enemyAttackDamage+ \" bludgeoning damage!\");\r\n //lowering character health\r\n player.setHealth(player.getHealth()-enemyAttackDamage);\r\n expLevel = player.getExperienceLevel();\r\n player.setExperience(player.getExperience()+enemyAttackDamage); \r\n /*if (player.getExperienceLevel() - expLevel >= 1)\r\n {\r\n this.levelUp(bP, player, cL, cG, optB, optC, optD, optE, optF );\r\n player.setHealth(maxHealth);\r\n } */\r\n pH.setText(\"HP: \"+player.getHealth());\r\n pE.setText(\"Exp: \"+player.getExperience()+\" out of \"+player.getExpNeeded()); \r\n enemyAttackDamage2 = weapon3.use();\r\n optE.setText(enemy2.getName()+\" attacks you for \"+enemyAttackDamage2+ \" bludgeoning damage!\");\r\n //lowering character health\r\n health = player.getHealth() - enemyAttackDamage2; \r\n player.setHealth(health);\r\n pH.setText(\"HP: \"+ player.getHealth()); \r\n expLevel = player.getExperienceLevel();\r\n player.setExperience(player.getExperience()+enemyAttackDamage2); \r\n pE.setText(\"Exp: \"+player.getExperience()+\" out of \"+player.getExpNeeded());\r\n /*if (player.getExperienceLevel() - expLevel >= 1)\r\n {\r\n this.levelUp(bP, player, cL, cG, optB, optC, optD, optE, optF );\r\n player.setHealth(maxHealth);\r\n } */\r\n this.levelUp(bP, player, cL, cG, optB, optC, optD, optE, optF); \r\n sAC++;\r\n weapon1.setCritHitChance(player.improvedCritChance(sAC), player.getHasImprovedCritChance());\r\n this.characterDeath(player, bP, roomI, cons, optA, optB, optC, optD, optE);\r\n }\r\n } \r\n } \r\n else{\r\n if(mS1.getHasMagicSword() == true){\r\n //getting value for attack factoring hit chance\r\n attackDamage = weapon1.stabAttack();\r\n if(mS1.getHasFireDamage()==true)\r\n {\r\n if(attackDamage==(mS1.getAttackM()*1.5+mS1.getFireDamage())){\r\n //displaying message about damage done\r\n optD.setText(\"You attack \"+enemy2.getName()+\" and do \"+mS1.getAttackM()+\" piercing damage\\n and \"+mS1.getFireDamage()+\" fire damage.\");\r\n //lowering enemy health\r\n enemy.setHealth(enemy2.getHealth()-attackDamage); \r\n eH.setText(\"HP: \" + enemy2.getHealth());\r\n }\r\n else{\r\n //display message about damage done\r\n optD.setText(\"You attack the \"+enemy2.getName()+\" and do 2 piercing damage.\");\r\n enemy.setHealth(enemy2.getHealth()-attackDamage); \r\n eH.setText(\"HP: \" + enemy2.getHealth());\r\n }\r\n }\r\n else\r\n {\r\n if(attackDamage==(mS1.getAttackM()*1.5+mS1.getIceDamage())){\r\n //displaying message about damage done\r\n optD.setText(\"You attack \"+enemy2.getName()+\" and do \"+mS1.getAttackM()+\" piercing damage\\n and \"+mS1.getIceDamage()+\" ice damage.\");\r\n //lowering enemy health\r\n enemy.setHealth(enemy2.getHealth()-attackDamage); \r\n eH.setText(\"HP: \" + enemy2.getHealth());\r\n }\r\n else{\r\n //display message about damage done\r\n optD.setText(\"You attack \"+enemy2.getName()+\" and do 2 piercing damage.\");\r\n enemy.setHealth(enemy2.getHealth()-attackDamage); \r\n eH.setText(\"HP: \" + enemy2.getHealth());\r\n }\r\n }\r\n }\r\n else{ \r\n //getting value for attack factoring hit chance\r\n attackDamage = weapon1.stabAttack();\r\n //displaying message about damage done\r\n optC.setText(\"You attack the \"+enemy2.getName()+\" and do \"+attackDamage+\" slashing damage.\");\r\n //lowering enemy health\r\n enemy2.setHealth(enemy2.getHealth()-attackDamage); \r\n eH2.setText(\"HP: \"+ enemy2.getHealth());\r\n enemyAttackDamage2 = weapon3.use();\r\n optD.setText(enemy2.getName()+\" attacks you for \"+enemyAttackDamage2+ \" bludgeoning damage!\");\r\n optE.setText(\" \");\r\n //lowering character health\r\n health = player.getHealth() - enemyAttackDamage2; \r\n player.setHealth(health);\r\n expLevel = player.getExperienceLevel();\r\n player.setExperience(player.getExperience()+enemyAttackDamage2); \r\n /* if (player.getExperienceLevel() - expLevel >= 1)\r\n {\r\n this.levelUp(bP, player, cL, cG, optB, optC, optD, optE, optF );\r\n player.setHealth(maxHealth);\r\n } */\r\n this.levelUp(bP, player, cL, cG, optB, optC, optD, optE, optF);\r\n pH.setText(\"HP: \"+player.getHealth() + \"\\nExp: \" + player.getExperience());\r\n pE.setText(\"Exp: \"+player.getExperience()+\" out of \"+player.getExpNeeded()); \r\n this.characterDeath(player, bP, roomI, cons, optA, optB, optC, optD, optE);\r\n //tracking stab attacks for character improvement\r\n sAC++;\r\n weapon1.setCritHitChance(player.improvedCritChance(sAC), player.getHasImprovedCritChance());\r\n this.characterDeath(player, bP, roomI, cons, optA, optB, optC, optD, optE);\r\n } \r\n }\r\n }\r\n //code to exit the program\r\n else if(fightPrompt2.compareToIgnoreCase(\"quit\") == 0)\r\n {\r\n System.exit(1);\r\n }\r\n }while(enemy2.getHealth() > 0);\r\n return sAC;\r\n }",
"@Test\n public void attack1() {\n\n // original totalStrength = 5\n // china = 4, thailand = 1\n defender.attack(null, \"0\", null, \"0\", true);\n assertEquals(defender, singapore.getOwner());\n assertEquals(1, defender.getTotalCards());\n assertEquals(Action.Show_Next_Phase_Button, Phase.getInstance().getActionResult());\n\n }",
"@Test\n public void test_UnpreventableCombatDamage() {\n addCard(Zone.BATTLEFIELD, playerB, \"Questing Beast\", 1);\n //\n // Prevent all damage that would be dealt to creatures.\n addCard(Zone.BATTLEFIELD, playerA, \"Bubble Matrix\", 1);\n addCard(Zone.BATTLEFIELD, playerA, \"Balduvian Bears\", 1);\n //\n addCard(Zone.BATTLEFIELD, playerB, \"Balduvian Bears\", 1);\n\n // player A must do damage\n attack(1, playerA, \"Balduvian Bears\", playerB);\n\n // player B must be prevented by Bubble Matrix, but can't (Questing Beast)\n // a -> b -- can't do damage (matrix)\n // b -> a -- can do damage (matrix -> quest)\n attack(4, playerB, \"Balduvian Bears\", playerA);\n block(4, playerA, \"Balduvian Bears\", \"Balduvian Bears\");\n\n setStrictChooseMode(true);\n setStopAt(4, PhaseStep.END_TURN);\n execute();\n assertAllCommandsUsed();\n\n assertPermanentCount(playerA, \"Balduvian Bears\", 0);\n assertPermanentCount(playerB, \"Balduvian Bears\", 1);\n assertLife(playerA, 20);\n assertLife(playerB, 20 - 2);\n }",
"public void roam(){\r\n Random rand = new Random();\r\n String aniName = this.getName();\r\n String aniType = this.getAniType();\r\n //Chance will be a number between 1 and 100\r\n int chance = rand.nextInt(100) + 1;\r\n //25% chance that the pachyderm will charge\r\n if (chance <= 25){\r\n System.out.println(aniName + \" the \" + aniType + \" charges.\");\r\n }\r\n //75% chance the method works as originally intended.\r\n else{\r\n System.out.println(aniName + \" the \" + aniType + \" roams.\");\r\n }\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Should we recover from the unsupported data sets, default is true. | public void setRecoverFromUnsupportedDataSet(boolean recoverFromUnsupportedDataSet) {
this.recoverFromUnsupportedDataSet = recoverFromUnsupportedDataSet;
} | [
"public void checkDataSet()\n\t{\n\t\treturn;\n\n\t}",
"@JsonIgnore\n public boolean isFallbackToOdSet() {\n return isSet.contains(\"fallbackToOd\");\n }",
"public boolean supportSets()\n {\n return true;\n }",
"public boolean checkIfApplicable(Dataset dataset){\n if(dataset.properties.isNominal && this.properties.numericToNominal){\n return false;\n }\n if(dataset.properties.isNumeric && this.properties.nominalToBinary){\n return false;\n } \n if(dataset.properties.hasMissingValues == false && this.properties.replaceMissingValuesMeanMode){\n return false;\n }\n if(dataset.properties.attributesSelectedForCorrelation \n && this.properties.attributesCorrelationSelection){\n return false;\n }\n return true;\n }",
"boolean canLoadData();",
"public void setRecoverFromInvalidDataSet(boolean recoverFromInvalidDataSet) {\r\n\t\tthis.recoverFromInvalidDataSet = recoverFromInvalidDataSet;\r\n\t}",
"boolean isSetInterpretation();",
"boolean isSetValueSampledData();",
"private void checkNotUnknown() {\n if (isUnknown())\n throw new AnalysisException(\"Unexpected 'unknown' value!\");\n }",
"protected abstract boolean isSingleDataset();",
"public boolean hasDataSets()\n {\n return dataSets != null && dataSets.size() > 0;\n }",
"public boolean isSetDataInfo() {\n return this.dataInfo != null;\n }",
"private boolean tryByteArrayInputStream(){\n return true;\n }",
"boolean requiresDataSchema();",
"public boolean supportsDataDefinitionAndDataManipulationTransactions()\n throws SQLException\n {\n return false;\n }",
"protected void beforeDataSetLookup() {\n }",
"public boolean isSetDataMap() {\n return this.dataMap != null;\n }",
"public boolean dataDefinitionIgnoredInTransactions() throws SQLException {\n return false;\n }",
"public void ignoreMissingDataOptionRequests(){\n this.ignoreNoResponseRequests = true;\n this.allNoResponseOptionsSet = true;\n this.itemDeletionPercentageSet = true;\n this.personDeletionPercentageSet = true;\n this.allNoResponseOptionsSet = true;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$ANTLR end "bb" $ANTLR start "blocks2" C:\\Users\\Cavicchio\\workspace\\InterDepAdjStructure\\newgrammar\\JCB_tree.g:520:1: blocks2 returns [JCBlock bBlock] : (sblk2= sb2 (b= blocks2 )? |cblk2= cb2 (b= blocks2 )? |cfunctioncall2= functioncall2 (b= blocks2 )? |cloop2= loop2 (b= blocks2 )? ); | public final JCBlock blocks2() throws RecognitionException {
JCBlock bBlock = null;
JCSectionBlock sblk2 =null;
JCBlock b =null;
JCConditionalBlock cblk2 =null;
JCFunctionCallBlock cfunctioncall2 =null;
JCLoopBlock cloop2 =null;
try {
// C:\\Users\\Cavicchio\\workspace\\InterDepAdjStructure\\newgrammar\\JCB_tree.g:520:34: (sblk2= sb2 (b= blocks2 )? |cblk2= cb2 (b= blocks2 )? |cfunctioncall2= functioncall2 (b= blocks2 )? |cloop2= loop2 (b= blocks2 )? )
int alt15=4;
switch ( input.LA(1) ) {
case OPEN_BRACKET:
{
alt15=1;
}
break;
case OPEN_CURLY_BRACE:
{
alt15=2;
}
break;
case OPEN_FUNCTION_CALL:
{
alt15=3;
}
break;
case OPEN_LOOP:
{
alt15=4;
}
break;
default:
NoViableAltException nvae =
new NoViableAltException("", 15, 0, input);
throw nvae;
}
switch (alt15) {
case 1 :
// C:\\Users\\Cavicchio\\workspace\\InterDepAdjStructure\\newgrammar\\JCB_tree.g:522:6: sblk2= sb2 (b= blocks2 )?
{
pushFollow(FOLLOW_sb2_in_blocks2577);
sblk2=sb2();
state._fsp--;
if (displayProductions == true)
{
System.out.println("Production: blocks2: sblk2=sb2");
}
bBlock = problem.processConditionalSectionBlock(sblk2);
// C:\\Users\\Cavicchio\\workspace\\InterDepAdjStructure\\newgrammar\\JCB_tree.g:531:2: (b= blocks2 )?
int alt11=2;
int LA11_0 = input.LA(1);
if ( (LA11_0==OPEN_BRACKET||LA11_0==OPEN_CURLY_BRACE||(LA11_0 >= OPEN_FUNCTION_CALL && LA11_0 <= OPEN_LOOP)) ) {
alt11=1;
}
switch (alt11) {
case 1 :
// C:\\Users\\Cavicchio\\workspace\\InterDepAdjStructure\\newgrammar\\JCB_tree.g:531:2: b= blocks2
{
pushFollow(FOLLOW_blocks2_in_blocks2587);
b=blocks2();
state._fsp--;
}
break;
}
if (displayProductions == true)
{
System.out.println("Production: blocks2: sblk2=sb2 (b=blocks2)?");
}
}
break;
case 2 :
// C:\\Users\\Cavicchio\\workspace\\InterDepAdjStructure\\newgrammar\\JCB_tree.g:541:6: cblk2= cb2 (b= blocks2 )?
{
pushFollow(FOLLOW_cb2_in_blocks2600);
cblk2=cb2();
state._fsp--;
if (displayProductions == true)
{
System.out.println("Production: blocks2: cblk2=cb2");
}
// C:\\Users\\Cavicchio\\workspace\\InterDepAdjStructure\\newgrammar\\JCB_tree.g:549:2: (b= blocks2 )?
int alt12=2;
int LA12_0 = input.LA(1);
if ( (LA12_0==OPEN_BRACKET||LA12_0==OPEN_CURLY_BRACE||(LA12_0 >= OPEN_FUNCTION_CALL && LA12_0 <= OPEN_LOOP)) ) {
alt12=1;
}
switch (alt12) {
case 1 :
// C:\\Users\\Cavicchio\\workspace\\InterDepAdjStructure\\newgrammar\\JCB_tree.g:549:2: b= blocks2
{
pushFollow(FOLLOW_blocks2_in_blocks2609);
b=blocks2();
state._fsp--;
}
break;
}
if (displayProductions == true)
{
System.out.println("Production: blocks2: cblk2=cb2 (b=blocks2)");
}
}
break;
case 3 :
// C:\\Users\\Cavicchio\\workspace\\InterDepAdjStructure\\newgrammar\\JCB_tree.g:559:15: cfunctioncall2= functioncall2 (b= blocks2 )?
{
pushFollow(FOLLOW_functioncall2_in_blocks2623);
cfunctioncall2=functioncall2();
state._fsp--;
if (displayProductions == true)
{
System.out.println("Production: blocks2: cfunctioncall2=functioncall2");
}
bBlock = problem.processFunctionCallBlock(cfunctioncall2);
// C:\\Users\\Cavicchio\\workspace\\InterDepAdjStructure\\newgrammar\\JCB_tree.g:568:2: (b= blocks2 )?
int alt13=2;
int LA13_0 = input.LA(1);
if ( (LA13_0==OPEN_BRACKET||LA13_0==OPEN_CURLY_BRACE||(LA13_0 >= OPEN_FUNCTION_CALL && LA13_0 <= OPEN_LOOP)) ) {
alt13=1;
}
switch (alt13) {
case 1 :
// C:\\Users\\Cavicchio\\workspace\\InterDepAdjStructure\\newgrammar\\JCB_tree.g:568:2: b= blocks2
{
pushFollow(FOLLOW_blocks2_in_blocks2632);
b=blocks2();
state._fsp--;
}
break;
}
if (displayProductions == true)
{
System.out.println("Production: blocks2: cfunctioncall2=functioncall2 (b=blocks2)?");
}
}
break;
case 4 :
// C:\\Users\\Cavicchio\\workspace\\InterDepAdjStructure\\newgrammar\\JCB_tree.g:578:7: cloop2= loop2 (b= blocks2 )?
{
pushFollow(FOLLOW_loop2_in_blocks2645);
cloop2=loop2();
state._fsp--;
if (displayProductions == true)
{
System.out.println("Production: blocks2: cloop2=loop2");
}
bBlock = problem.processLoopBlock(cloop2);
// C:\\Users\\Cavicchio\\workspace\\InterDepAdjStructure\\newgrammar\\JCB_tree.g:587:2: (b= blocks2 )?
int alt14=2;
int LA14_0 = input.LA(1);
if ( (LA14_0==OPEN_BRACKET||LA14_0==OPEN_CURLY_BRACE||(LA14_0 >= OPEN_FUNCTION_CALL && LA14_0 <= OPEN_LOOP)) ) {
alt14=1;
}
switch (alt14) {
case 1 :
// C:\\Users\\Cavicchio\\workspace\\InterDepAdjStructure\\newgrammar\\JCB_tree.g:587:2: b= blocks2
{
pushFollow(FOLLOW_blocks2_in_blocks2654);
b=blocks2();
state._fsp--;
}
break;
}
if (displayProductions == true)
{
System.out.println("Production: blocks2: cloop2=loop2 (b=blocks2)");
}
}
break;
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return bBlock;
} | [
"public final void cblocks2() throws RecognitionException {\n JCConditionalSection csblks2 =null;\n\n\n try {\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:681:10: (csblks2= csb2 (csblk2= cblocks2 )? )\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:683:8: csblks2= csb2 (csblk2= cblocks2 )?\n {\n pushFollow(FOLLOW_csb2_in_cblocks2787);\n csblks2=csb2();\n\n state._fsp--;\n\n\n\n if (displayProductions == true)\n {\n System.out.println(\"Production: cblocks2: csblks2=csb2\");\n }\n\n\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:691:2: (csblk2= cblocks2 )?\n int alt17=2;\n int LA17_0 = input.LA(1);\n\n if ( (LA17_0==OPEN_CONDSECT) ) {\n alt17=1;\n }\n switch (alt17) {\n case 1 :\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:691:2: csblk2= cblocks2\n {\n pushFollow(FOLLOW_cblocks2_in_cblocks2796);\n cblocks2();\n\n state._fsp--;\n\n\n }\n break;\n\n }\n\n\n\n if (displayProductions == true)\n {\n System.out.println(\"Production: cblocks2: csb2 (csblk2=cblocks2)\");\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n\n finally {\n \t// do for sure before leaving\n }\n return ;\n }",
"public final JCFunctionBlock function2() throws RecognitionException {\n JCFunctionBlock function2 = null;\n\n\n JCBlock bl2 =null;\n\n\n try {\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:704:47: ( OPEN_FUNCTION bl2= blocks2 functionname2 CLOSE_FUNCTION )\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:704:49: OPEN_FUNCTION bl2= blocks2 functionname2 CLOSE_FUNCTION\n {\n match(input,OPEN_FUNCTION,FOLLOW_OPEN_FUNCTION_in_function2818); \n\n\n if (displayProductions == true)\n {\n System.out.println(\"Production: function2: #? \");\n }\n \n function2 = problem.accessFunctionBlock();\n bl2 = problem.accessBlock();\n\n\n pushFollow(FOLLOW_blocks2_in_function2825);\n bl2=blocks2();\n\n state._fsp--;\n\n\n\n if (displayProductions == true)\n {\n System.out.println(\"Production: function2: #? bl2=blocks2\");\n }\n\n\n pushFollow(FOLLOW_functionname2_in_function2831);\n functionname2();\n\n state._fsp--;\n\n\n \n if (displayProductions == true)\n {\n System.out.println(\"Production: function2: #? bl2=blocks2 functionname2\");\n }\n\n\n match(input,CLOSE_FUNCTION,FOLLOW_CLOSE_FUNCTION_in_function2836); \n\n\n if (displayProductions == true)\n {\n System.out.println(\"Production: function2: #? bl2=blocks2 functionname2 ?#\");\n }\n problem.computeFunctionBlockSolution(function2);\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n\n finally {\n \t// do for sure before leaving\n }\n return function2;\n }",
"public final JCBasicBlock bb2() throws RecognitionException {\n JCBasicBlock basicBlock = null;\n\n\n Token ID12=null;\n Token INT13=null;\n\n try {\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:854:39: ( OPEN_PARENTHESIS ID COMMA INT CLOSE_PARENTHESIS )\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:856:1: OPEN_PARENTHESIS ID COMMA INT CLOSE_PARENTHESIS\n {\n match(input,OPEN_PARENTHESIS,FOLLOW_OPEN_PARENTHESIS_in_bb2970); \n\n ID12=(Token)match(input,ID,FOLLOW_ID_in_bb2972); \n\n match(input,COMMA,FOLLOW_COMMA_in_bb2974); \n\n INT13=(Token)match(input,INT,FOLLOW_INT_in_bb2976); \n\n match(input,CLOSE_PARENTHESIS,FOLLOW_CLOSE_PARENTHESIS_in_bb2978); \n\n\n if (displayProductions == true)\n {\n System.out.println(\"Production: bb2 : (ID,INT) = (\" + (ID12!=null?ID12.getText():null) + \",\" + (INT13!=null?INT13.getText():null) + \")\");\n }\n int bbWCET = Integer.parseInt((INT13!=null?INT13.getText():null));\n basicBlock = problem.accessBasicBlock((ID12!=null?ID12.getText():null), bbWCET);\t\t\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n\n finally {\n \t// do for sure before leaving\n }\n return basicBlock;\n }",
"public final JCFunctionCallBlock functioncall2() throws RecognitionException {\n JCFunctionCallBlock functioncall2 = null;\n\n\n JCBlock bl2 =null;\n\n\n try {\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:754:59: ( OPEN_FUNCTION_CALL bl2= blocks2 functioncallname2 CLOSE_FUNCTION_CALL )\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:754:61: OPEN_FUNCTION_CALL bl2= blocks2 functioncallname2 CLOSE_FUNCTION_CALL\n {\n match(input,OPEN_FUNCTION_CALL,FOLLOW_OPEN_FUNCTION_CALL_in_functioncall2868); \n\n\n if (displayProductions == true)\n {\n System.out.println(\"Production: functioncall2: #! \");\n }\n \n functioncall2 = problem.accessFunctionCallBlock();\n bl2 = problem.accessBlock();\n\n\n pushFollow(FOLLOW_blocks2_in_functioncall2875);\n bl2=blocks2();\n\n state._fsp--;\n\n\n\n if (displayProductions == true)\n {\n System.out.println(\"Production: functioncall2: #! bl2=blocks2\");\n }\n\n\n pushFollow(FOLLOW_functioncallname2_in_functioncall2881);\n functioncallname2();\n\n state._fsp--;\n\n\n \n if (displayProductions == true)\n {\n System.out.println(\"Production: functioncall2: #! bl2=blocks2 functioncallname2\");\n }\n\n\n match(input,CLOSE_FUNCTION_CALL,FOLLOW_CLOSE_FUNCTION_CALL_in_functioncall2886); \n\n\n if (displayProductions == true)\n {\n System.out.println(\"Production: functioncall2: #! bl2=blocks2 functioncallname2 !#\");\n }\n problem.computeFunctionCallBlockSolution(functioncall2);\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n\n finally {\n \t// do for sure before leaving\n }\n return functioncall2;\n }",
"public final JCBlock blocks() throws RecognitionException {\n JCBlock bBlock = null;\n\n\n JCSectionBlock sblk =null;\n\n JCBlock b =null;\n\n JCConditionalBlock cblk =null;\n\n JCFunctionCallBlock cfunctioncall =null;\n\n JCLoopBlock cloop =null;\n\n\n try {\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:155:33: (sblk= sb (b= blocks )? |cblk= cb (b= blocks )? |cfunctioncall= functioncall (b= blocks )? |cloop= loop (b= blocks )? )\n int alt8=4;\n switch ( input.LA(1) ) {\n case OPEN_BRACKET:\n {\n alt8=1;\n }\n break;\n case OPEN_CURLY_BRACE:\n {\n alt8=2;\n }\n break;\n case OPEN_FUNCTION_CALL:\n {\n alt8=3;\n }\n break;\n case OPEN_LOOP:\n {\n alt8=4;\n }\n break;\n default:\n NoViableAltException nvae =\n new NoViableAltException(\"\", 8, 0, input);\n\n throw nvae;\n\n }\n\n switch (alt8) {\n case 1 :\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:157:5: sblk= sb (b= blocks )?\n {\n pushFollow(FOLLOW_sb_in_blocks144);\n sblk=sb();\n\n state._fsp--;\n\n\n\n if (displayProductions == true)\n {\n System.out.println(\"Production: blocks: sblk=sb\");\n }\n bBlock = problem.addSectionToBlocks(sblk);\n\n\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:166:2: (b= blocks )?\n int alt4=2;\n int LA4_0 = input.LA(1);\n\n if ( (LA4_0==OPEN_BRACKET||LA4_0==OPEN_CURLY_BRACE||(LA4_0 >= OPEN_FUNCTION_CALL && LA4_0 <= OPEN_LOOP)) ) {\n alt4=1;\n }\n switch (alt4) {\n case 1 :\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:166:2: b= blocks\n {\n pushFollow(FOLLOW_blocks_in_blocks153);\n b=blocks();\n\n state._fsp--;\n\n\n }\n break;\n\n }\n\n\n\n if (displayProductions == true)\n {\n System.out.println(\"Production: blocks: sblk=sb (b=blocks)?\");\n }\n\n\n }\n break;\n case 2 :\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:176:5: cblk= cb (b= blocks )?\n {\n pushFollow(FOLLOW_cb_in_blocks167);\n cblk=cb();\n\n state._fsp--;\n\n\n\n if (displayProductions == true)\n {\n System.out.println(\"Production: blocks: cblk=cb\");\n }\n bBlock = problem.addConditionalToBlocks(cblk);\n\n\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:185:2: (b= blocks )?\n int alt5=2;\n int LA5_0 = input.LA(1);\n\n if ( (LA5_0==OPEN_BRACKET||LA5_0==OPEN_CURLY_BRACE||(LA5_0 >= OPEN_FUNCTION_CALL && LA5_0 <= OPEN_LOOP)) ) {\n alt5=1;\n }\n switch (alt5) {\n case 1 :\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:185:2: b= blocks\n {\n pushFollow(FOLLOW_blocks_in_blocks175);\n b=blocks();\n\n state._fsp--;\n\n\n }\n break;\n\n }\n\n\n\n if (displayProductions == true)\n {\n System.out.println(\"Production: blocks: cblk=cb (b=blocks)?\");\n }\n\n\n }\n break;\n case 3 :\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:195:14: cfunctioncall= functioncall (b= blocks )?\n {\n pushFollow(FOLLOW_functioncall_in_blocks187);\n cfunctioncall=functioncall();\n\n state._fsp--;\n\n\n\n if (displayProductions == true)\n {\n System.out.println(\"Production: blocks: cfunctioncall=functioncall\");\n }\n bBlock = problem.addFunctionCallBlockToBlocks(cfunctioncall);\n\n\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:204:2: (b= blocks )?\n int alt6=2;\n int LA6_0 = input.LA(1);\n\n if ( (LA6_0==OPEN_BRACKET||LA6_0==OPEN_CURLY_BRACE||(LA6_0 >= OPEN_FUNCTION_CALL && LA6_0 <= OPEN_LOOP)) ) {\n alt6=1;\n }\n switch (alt6) {\n case 1 :\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:204:2: b= blocks\n {\n pushFollow(FOLLOW_blocks_in_blocks196);\n b=blocks();\n\n state._fsp--;\n\n\n }\n break;\n\n }\n\n\n\n if (displayProductions == true)\n {\n System.out.println(\"Production: blocks: cfunctioncall=functioncall (b=blocks)?\");\n }\n\n\n }\n break;\n case 4 :\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:214:6: cloop= loop (b= blocks )?\n {\n pushFollow(FOLLOW_loop_in_blocks209);\n cloop=loop();\n\n state._fsp--;\n\n\n\n if (displayProductions == true)\n {\n System.out.println(\"Production: blocks: cloop=loop\");\n }\n bBlock = problem.addLoopToBlocks(cloop);\n\n\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:223:2: (b= blocks )?\n int alt7=2;\n int LA7_0 = input.LA(1);\n\n if ( (LA7_0==OPEN_BRACKET||LA7_0==OPEN_CURLY_BRACE||(LA7_0 >= OPEN_FUNCTION_CALL && LA7_0 <= OPEN_LOOP)) ) {\n alt7=1;\n }\n switch (alt7) {\n case 1 :\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:223:2: b= blocks\n {\n pushFollow(FOLLOW_blocks_in_blocks218);\n b=blocks();\n\n state._fsp--;\n\n\n }\n break;\n\n }\n\n\n\n if (displayProductions == true)\n {\n System.out.println(\"Production: blocks: cloop=loop (b=blocks)?\");\n }\n\n\n }\n break;\n\n }\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n\n finally {\n \t// do for sure before leaving\n }\n return bBlock;\n }",
"public final void lb2() throws RecognitionException {\n JCBasicBlock lbb2 =null;\n\n\n try {\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:624:5: (lbb2= bb2 (rb2= lb2 )? )\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:624:7: lbb2= bb2 (rb2= lb2 )?\n {\n pushFollow(FOLLOW_bb2_in_lb2706);\n lbb2=bb2();\n\n state._fsp--;\n\n\n\n if (displayProductions == true)\n {\n System.out.println(\"Production: lb2: lbb2=bb2\");\n }\n\n\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:632:2: (rb2= lb2 )?\n int alt16=2;\n int LA16_0 = input.LA(1);\n\n if ( (LA16_0==OPEN_PARENTHESIS) ) {\n alt16=1;\n }\n switch (alt16) {\n case 1 :\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:632:2: rb2= lb2\n {\n pushFollow(FOLLOW_lb2_in_lb2714);\n lb2();\n\n state._fsp--;\n\n\n }\n break;\n\n }\n\n\n\n if (displayProductions == true)\n {\n System.out.println(\"Production: lb2: (rb2=lb2)?\");\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n\n finally {\n \t// do for sure before leaving\n }\n return ;\n }",
"public final JCConditionalBlock cb2() throws RecognitionException {\n JCConditionalBlock conditionalBlock = null;\n\n\n try {\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:600:51: ( OPEN_CURLY_BRACE cib= cblocks2 CLOSE_CURLY_BRACE )\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:602:1: OPEN_CURLY_BRACE cib= cblocks2 CLOSE_CURLY_BRACE\n {\n match(input,OPEN_CURLY_BRACE,FOLLOW_OPEN_CURLY_BRACE_in_cb2680); \n\n\n if (displayProductions == true)\n {\n System.out.println(\"Production: cb2: {\");\n }\n conditionalBlock = problem.accessConditionalBlock();\n\n\n pushFollow(FOLLOW_cblocks2_in_cb2687);\n cblocks2();\n\n state._fsp--;\n\n\n match(input,CLOSE_CURLY_BRACE,FOLLOW_CLOSE_CURLY_BRACE_in_cb2689); \n\n\n if (displayProductions == true)\n {\n System.out.println(\"Production: cb2: { (cib=cblocks2) }\");\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n\n finally {\n \t// do for sure before leaving\n }\n return conditionalBlock;\n }",
"public final GremlinEvaluator.block_return block() throws RecognitionException {\n GremlinEvaluator.block_return retval = new GremlinEvaluator.block_return();\n retval.start = input.LT(1);\n\n CommonTree root_0 = null;\n\n CommonTree _first_0 = null;\n CommonTree _last = null;\n\n CommonTree BLOCK50=null;\n GremlinEvaluator.statement_return statement51 = null;\n\n\n CommonTree BLOCK50_tree=null;\n\n\n List<Tree> statements = new LinkedList<Tree>();\n \n try {\n // src/main/java/com/tinkerpop/gremlin/compiler/GremlinEvaluator.g:436:5: ( ^( BLOCK ( statement )+ ) )\n // src/main/java/com/tinkerpop/gremlin/compiler/GremlinEvaluator.g:436:7: ^( BLOCK ( statement )+ )\n {\n root_0 = (CommonTree)adaptor.nil();\n\n _last = (CommonTree)input.LT(1);\n {\n CommonTree _save_last_1 = _last;\n CommonTree _first_1 = null;\n CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);\n BLOCK50=(CommonTree)match(input,BLOCK,FOLLOW_BLOCK_in_block1005); \n BLOCK50_tree = (CommonTree)adaptor.dupNode(BLOCK50);\n\n root_1 = (CommonTree)adaptor.becomeRoot(BLOCK50_tree, root_1);\n\n\n\n match(input, Token.DOWN, null); \n // src/main/java/com/tinkerpop/gremlin/compiler/GremlinEvaluator.g:436:15: ( statement )+\n int cnt9=0;\n loop9:\n do {\n int alt9=2;\n int LA9_0 = input.LA(1);\n\n if ( (LA9_0==VAR||LA9_0==FUNC||(LA9_0>=PATH && LA9_0<=GPATH)||LA9_0==IF||(LA9_0>=FOREACH && LA9_0<=DOUBLE)||(LA9_0>=BOOL && LA9_0<=NULL)||(LA9_0>=69 && LA9_0<=70)||LA9_0==82||(LA9_0>=85 && LA9_0<=95)) ) {\n alt9=1;\n }\n\n\n switch (alt9) {\n \tcase 1 :\n \t // src/main/java/com/tinkerpop/gremlin/compiler/GremlinEvaluator.g:436:17: statement\n \t {\n \t _last = (CommonTree)input.LT(1);\n \t pushFollow(FOLLOW_statement_in_block1009);\n \t statement51=statement();\n\n \t state._fsp--;\n\n \t adaptor.addChild(root_1, statement51.getTree());\n \t statements.add((statement51!=null?((CommonTree)statement51.tree):null)); \n\n \t }\n \t break;\n\n \tdefault :\n \t if ( cnt9 >= 1 ) break loop9;\n EarlyExitException eee =\n new EarlyExitException(9, input);\n throw eee;\n }\n cnt9++;\n } while (true);\n\n\n match(input, Token.UP, null); adaptor.addChild(root_0, root_1);_last = _save_last_1;\n }\n\n retval.cb = new CodeBlock(statements, this.context); \n\n }\n\n retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n }\n return retval;\n }",
"public final JCSectionBlock sb2() throws RecognitionException {\n JCSectionBlock sectionBlock = null;\n\n\n try {\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:645:43: ( OPEN_BRACKET lblk2= lb2 CLOSE_BRACKET )\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:645:45: OPEN_BRACKET lblk2= lb2 CLOSE_BRACKET\n {\n match(input,OPEN_BRACKET,FOLLOW_OPEN_BRACKET_in_sb2735); \n\n pushFollow(FOLLOW_lb2_in_sb2739);\n lb2();\n\n state._fsp--;\n\n\n match(input,CLOSE_BRACKET,FOLLOW_CLOSE_BRACKET_in_sb2741); \n\n\n if (displayProductions == true)\n {\n System.out.println(\"Production: sb2: [ lblk2=bb2 ]\");\n }\n sectionBlock = problem.accessLinearSection();\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n\n finally {\n \t// do for sure before leaving\n }\n return sectionBlock;\n }",
"public final void cblocks() throws RecognitionException {\n JCConditionalSection csblks =null;\n\n\n try {\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:321:9: (csblks= csb (csblk= cblocks )? )\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:323:7: csblks= csb (csblk= cblocks )?\n {\n pushFollow(FOLLOW_csb_in_cblocks353);\n csblks=csb();\n\n state._fsp--;\n\n\n\n if (displayProductions == true)\n {\n System.out.println(\"Production: cblocks: csblks=csb\");\n }\n problem.addConditionalSectionToConditional(csblks);\n\n\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:332:2: (csblk= cblocks )?\n int alt10=2;\n int LA10_0 = input.LA(1);\n\n if ( (LA10_0==OPEN_CONDSECT) ) {\n alt10=1;\n }\n switch (alt10) {\n case 1 :\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:332:2: csblk= cblocks\n {\n pushFollow(FOLLOW_cblocks_in_cblocks362);\n cblocks();\n\n state._fsp--;\n\n\n }\n break;\n\n }\n\n\n\n if (displayProductions == true)\n {\n System.out.println(\"Production: cblocks: csb (csblk=cblocks)\");\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n\n finally {\n \t// do for sure before leaving\n }\n return ;\n }",
"public final JCBasicBlock bb() throws RecognitionException {\n JCBasicBlock basicBlock = null;\n\n\n Token ID7=null;\n Token INT8=null;\n\n try {\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:504:38: ( OPEN_PARENTHESIS ID COMMA INT CLOSE_PARENTHESIS )\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:506:1: OPEN_PARENTHESIS ID COMMA INT CLOSE_PARENTHESIS\n {\n match(input,OPEN_PARENTHESIS,FOLLOW_OPEN_PARENTHESIS_in_bb535); \n\n ID7=(Token)match(input,ID,FOLLOW_ID_in_bb537); \n\n match(input,COMMA,FOLLOW_COMMA_in_bb539); \n\n INT8=(Token)match(input,INT,FOLLOW_INT_in_bb541); \n\n match(input,CLOSE_PARENTHESIS,FOLLOW_CLOSE_PARENTHESIS_in_bb543); \n\n\n if (displayProductions == true)\n {\n System.out.println(\"Production: bb : (ID,INT) = (\" + (ID7!=null?ID7.getText():null) + \",\" + (INT8!=null?INT8.getText():null) + \")\");\n }\n int bbWCET = Integer.parseInt((INT8!=null?INT8.getText():null));\n basicBlock = problem.createBasicBlock((ID7!=null?ID7.getText():null), bbWCET);\t\t\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n\n finally {\n \t// do for sure before leaving\n }\n return basicBlock;\n }",
"private NodeBlock parseBlock() throws SyntaxException {\n\t\tNodeStmt stmt = parseStmt();\n\t\tif (!curr().equals((new Token(\";\")))) {\n\t\t\tif (curr().equals(new Token(\"\")) || curr().equals(new Token(\"end\"))) {\n\t\t\t\treturn new NodeBlock(stmt,null);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new SyntaxException(pos(), new Token(\"block end\"), curr());\n\t\t\t}\n\t\t}\n\t\tmatch(\";\");\n\t\tNodeBlock block = new NodeBlock(stmt,null);\n\t\tblock.append(parseBlock());\n\t\treturn block;\n\t}",
"public final void prog() throws RecognitionException {\n JCBlock b =null;\n\n\n try {\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:22:6: ( q nb nm pcm ( pcmids )? ( function )? OPEN_PROGRAM blocks CLOSE_PROGRAM NEWLINE ( function2 )? OPEN_PROGRAM b= blocks2 CLOSE_PROGRAM NEWLINE )\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:22:8: q nb nm pcm ( pcmids )? ( function )? OPEN_PROGRAM blocks CLOSE_PROGRAM NEWLINE ( function2 )? OPEN_PROGRAM b= blocks2 CLOSE_PROGRAM NEWLINE\n {\n pushFollow(FOLLOW_q_in_prog27);\n q();\n\n state._fsp--;\n\n\n pushFollow(FOLLOW_nb_in_prog29);\n nb();\n\n state._fsp--;\n\n\n pushFollow(FOLLOW_nm_in_prog31);\n nm();\n\n state._fsp--;\n\n\n\n if (displayProductions == true)\n {\n System.out.println(\"Production: prog : q n\");\n }\n JCSelectOptimalPP.setSelectOptimalPP(problem.getSelectOptimalPPID(), problem);\n\n\n pushFollow(FOLLOW_pcm_in_prog37);\n pcm();\n\n state._fsp--;\n\n\n\n if (displayProductions == true)\n {\n System.out.println(\"Production: prog : q n pcm\");\n }\n\n\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:39:1: ( pcmids )?\n int alt1=2;\n int LA1_0 = input.LA(1);\n\n if ( (LA1_0==OPEN_MATRIX_ID) ) {\n alt1=1;\n }\n switch (alt1) {\n case 1 :\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:39:1: pcmids\n {\n pushFollow(FOLLOW_pcmids_in_prog42);\n pcmids();\n\n state._fsp--;\n\n\n }\n break;\n\n }\n\n\n\n if (displayProductions == true)\n {\n System.out.println(\"Production: prog : q n pcm pcmids?\");\n }\n\n\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:47:1: ( function )?\n int alt2=2;\n int LA2_0 = input.LA(1);\n\n if ( (LA2_0==OPEN_FUNCTION) ) {\n alt2=1;\n }\n switch (alt2) {\n case 1 :\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:47:1: function\n {\n pushFollow(FOLLOW_function_in_prog48);\n function();\n\n state._fsp--;\n\n\n }\n break;\n\n }\n\n\n\n if (displayProductions == true)\n {\n System.out.println(\"Production: prog : q n pcm pcmids? function?\");\n }\n\n\n match(input,OPEN_PROGRAM,FOLLOW_OPEN_PROGRAM_in_prog54); \n\n\n if (displayProductions == true)\n {\n System.out.println(\"Production: prog : q n pcm pcmids? function? OPEN_PROGRAM\");\n }\n problem.createCostMatrices();\n problem.createBlock();\n problem.markProgramBlock();\n problem.setProgramStarted();\n\n\n pushFollow(FOLLOW_blocks_in_prog60);\n blocks();\n\n state._fsp--;\n\n\n match(input,CLOSE_PROGRAM,FOLLOW_CLOSE_PROGRAM_in_prog62); \n\n match(input,NEWLINE,FOLLOW_NEWLINE_in_prog64); \n\n\n if (displayProductions == true)\n {\n System.out.println(\"Production: prog : q n pcm pcmids? function? OPEN_PROGRAM blocks CLOSE_PROGRAM NEWLINE\");\n }\n \n problem.storeBlock();\n problem.programProduction();\n \n if (displayBruteForceSolution == true)\n {\n problem.traversePaths();\n problem.bruteForceSolution();\n }\n\n\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:84:1: ( function2 )?\n int alt3=2;\n int LA3_0 = input.LA(1);\n\n if ( (LA3_0==OPEN_FUNCTION) ) {\n alt3=1;\n }\n switch (alt3) {\n case 1 :\n // C:\\\\Users\\\\Cavicchio\\\\workspace\\\\InterDepAdjStructure\\\\newgrammar\\\\JCB_tree.g:84:1: function2\n {\n pushFollow(FOLLOW_function2_in_prog69);\n function2();\n\n state._fsp--;\n\n\n }\n break;\n\n }\n\n\n\n if (displayProductions == true)\n {\n System.out.println(\"Production: prog : q n pcm pcmids? function? OPEN_PROGRAM blocks CLOSE_PROGRAM NEWLINE function2?\");\n }\n\n\n match(input,OPEN_PROGRAM,FOLLOW_OPEN_PROGRAM_in_prog75); \n\n\n if (displayProductions == true)\n {\n System.out.println(\"Production: prog : q n pcm pcmids? function? OPEN_PROGRAM blocks CLOSE_PROGRAM NEWLINE function2? OPEN_PROGRAM\");\n }\n problem.accessBlock();\n\n\n pushFollow(FOLLOW_blocks2_in_prog83);\n b=blocks2();\n\n state._fsp--;\n\n\n match(input,CLOSE_PROGRAM,FOLLOW_CLOSE_PROGRAM_in_prog85); \n\n match(input,NEWLINE,FOLLOW_NEWLINE_in_prog87); \n\n\n if (displayProductions == true)\n {\n System.out.println(\"Production: prog : q n pcm pcmids? function? OPEN_PROGRAM blocks CLOSE_PROGRAM NEWLINE function2? OPEN_PROGRAM b=blocks2 CLOSE_PROGRAM NEWLINE\");\n }\n \n if (displayProgramSolution == true)\n {\n problem.displayProgramSolution();\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n\n finally {\n \t// do for sure before leaving\n }\n return ;\n }",
"public final ANTLRv3Parser.block_return block() throws RecognitionException {\r\n ANTLRv3Parser.block_return retval = new ANTLRv3Parser.block_return();\r\n retval.start = input.LT(1);\r\n\r\n\r\n CommonTree root_0 = null;\r\n\r\n Token lp=null;\r\n Token rp=null;\r\n Token char_literal76=null;\r\n Token char_literal78=null;\r\n ANTLRv3Parser.optionsSpec_return opts =null;\r\n\r\n ANTLRv3Parser.altpair_return altpair77 =null;\r\n\r\n ANTLRv3Parser.altpair_return altpair79 =null;\r\n\r\n\r\n CommonTree lp_tree=null;\r\n CommonTree rp_tree=null;\r\n CommonTree char_literal76_tree=null;\r\n CommonTree char_literal78_tree=null;\r\n RewriteRuleTokenStream stream_69=new RewriteRuleTokenStream(adaptor,\"token 69\");\r\n RewriteRuleTokenStream stream_68=new RewriteRuleTokenStream(adaptor,\"token 68\");\r\n RewriteRuleTokenStream stream_91=new RewriteRuleTokenStream(adaptor,\"token 91\");\r\n RewriteRuleTokenStream stream_74=new RewriteRuleTokenStream(adaptor,\"token 74\");\r\n RewriteRuleSubtreeStream stream_altpair=new RewriteRuleSubtreeStream(adaptor,\"rule altpair\");\r\n RewriteRuleSubtreeStream stream_optionsSpec=new RewriteRuleSubtreeStream(adaptor,\"rule optionsSpec\");\r\n try {\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:192:5: (lp= '(' ( (opts= optionsSpec )? ':' )? altpair ( '|' altpair )* rp= ')' -> ^( BLOCK[$lp,\\\"BLOCK\\\"] ( optionsSpec )? ( altpair )+ EOB[$rp,\\\"EOB\\\"] ) )\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:192:9: lp= '(' ( (opts= optionsSpec )? ':' )? altpair ( '|' altpair )* rp= ')'\r\n {\r\n lp=(Token)match(input,68,FOLLOW_68_in_block1203); if (state.failed) return retval; \r\n if ( state.backtracking==0 ) stream_68.add(lp);\r\n\r\n\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:193:3: ( (opts= optionsSpec )? ':' )?\r\n int alt31=2;\r\n int LA31_0 = input.LA(1);\r\n\r\n if ( (LA31_0==OPTIONS||LA31_0==74) ) {\r\n alt31=1;\r\n }\r\n switch (alt31) {\r\n case 1 :\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:193:5: (opts= optionsSpec )? ':'\r\n {\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:193:5: (opts= optionsSpec )?\r\n int alt30=2;\r\n int LA30_0 = input.LA(1);\r\n\r\n if ( (LA30_0==OPTIONS) ) {\r\n alt30=1;\r\n }\r\n switch (alt30) {\r\n case 1 :\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:193:6: opts= optionsSpec\r\n {\r\n pushFollow(FOLLOW_optionsSpec_in_block1212);\r\n opts=optionsSpec();\r\n\r\n state._fsp--;\r\n if (state.failed) return retval;\r\n if ( state.backtracking==0 ) stream_optionsSpec.add(opts.getTree());\r\n\r\n }\r\n break;\r\n\r\n }\r\n\r\n\r\n char_literal76=(Token)match(input,74,FOLLOW_74_in_block1216); if (state.failed) return retval; \r\n if ( state.backtracking==0 ) stream_74.add(char_literal76);\r\n\r\n\r\n }\r\n break;\r\n\r\n }\r\n\r\n\r\n pushFollow(FOLLOW_altpair_in_block1223);\r\n altpair77=altpair();\r\n\r\n state._fsp--;\r\n if (state.failed) return retval;\r\n if ( state.backtracking==0 ) stream_altpair.add(altpair77.getTree());\r\n\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:194:11: ( '|' altpair )*\r\n loop32:\r\n do {\r\n int alt32=2;\r\n int LA32_0 = input.LA(1);\r\n\r\n if ( (LA32_0==91) ) {\r\n alt32=1;\r\n }\r\n\r\n\r\n switch (alt32) {\r\n \tcase 1 :\r\n \t // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:194:13: '|' altpair\r\n \t {\r\n \t char_literal78=(Token)match(input,91,FOLLOW_91_in_block1227); if (state.failed) return retval; \r\n \t if ( state.backtracking==0 ) stream_91.add(char_literal78);\r\n\r\n\r\n \t pushFollow(FOLLOW_altpair_in_block1229);\r\n \t altpair79=altpair();\r\n\r\n \t state._fsp--;\r\n \t if (state.failed) return retval;\r\n \t if ( state.backtracking==0 ) stream_altpair.add(altpair79.getTree());\r\n\r\n \t }\r\n \t break;\r\n\r\n \tdefault :\r\n \t break loop32;\r\n }\r\n } while (true);\r\n\r\n\r\n rp=(Token)match(input,69,FOLLOW_69_in_block1244); if (state.failed) return retval; \r\n if ( state.backtracking==0 ) stream_69.add(rp);\r\n\r\n\r\n // AST REWRITE\r\n // elements: optionsSpec, altpair\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 // 196:9: -> ^( BLOCK[$lp,\\\"BLOCK\\\"] ( optionsSpec )? ( altpair )+ EOB[$rp,\\\"EOB\\\"] )\r\n {\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:196:12: ^( BLOCK[$lp,\\\"BLOCK\\\"] ( optionsSpec )? ( altpair )+ EOB[$rp,\\\"EOB\\\"] )\r\n {\r\n CommonTree root_1 = (CommonTree)adaptor.nil();\r\n root_1 = (CommonTree)adaptor.becomeRoot(\r\n (CommonTree)adaptor.create(BLOCK, lp, \"BLOCK\")\r\n , root_1);\r\n\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:196:34: ( optionsSpec )?\r\n if ( stream_optionsSpec.hasNext() ) {\r\n adaptor.addChild(root_1, stream_optionsSpec.nextTree());\r\n\r\n }\r\n stream_optionsSpec.reset();\r\n\r\n if ( !(stream_altpair.hasNext()) ) {\r\n throw new RewriteEarlyExitException();\r\n }\r\n while ( stream_altpair.hasNext() ) {\r\n adaptor.addChild(root_1, stream_altpair.nextTree());\r\n\r\n }\r\n stream_altpair.reset();\r\n\r\n adaptor.addChild(root_1, \r\n (CommonTree)adaptor.create(EOB, rp, \"EOB\")\r\n );\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\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 }",
"BAnyBlock createBAnyBlock();",
"BlockExpression createBlockExpression();",
"public final SiDLParser.block_return block() throws RecognitionException {\n SiDLParser.block_return retval = new SiDLParser.block_return();\n retval.start = input.LT(1);\n\n\n Object root_0 = null;\n\n Token NL22=null;\n SiDLParser.statement_return statement21 =null;\n\n\n Object NL22_tree=null;\n RewriteRuleTokenStream stream_NL=new RewriteRuleTokenStream(adaptor,\"token NL\");\n RewriteRuleSubtreeStream stream_statement=new RewriteRuleSubtreeStream(adaptor,\"rule statement\");\n try {\n // /Users/enrico/Documents/Workspace/SiDL/src/sidl/grammar/SiDL.g:85:2: ( ( statement | NL )+ -> ^( BLOCK ( statement )+ ) )\n // /Users/enrico/Documents/Workspace/SiDL/src/sidl/grammar/SiDL.g:85:4: ( statement | NL )+\n {\n // /Users/enrico/Documents/Workspace/SiDL/src/sidl/grammar/SiDL.g:85:4: ( statement | NL )+\n int cnt5=0;\n loop5:\n do {\n int alt5=3;\n int LA5_0 = input.LA(1);\n\n if ( (LA5_0==CALL||(LA5_0 >= DO && LA5_0 <= DROP)||LA5_0==FROM||(LA5_0 >= ID && LA5_0 <= IF)||LA5_0==MOVE||LA5_0==PULL||LA5_0==TURN||LA5_0==WITH) ) {\n alt5=1;\n }\n else if ( (LA5_0==NL) ) {\n alt5=2;\n }\n\n\n switch (alt5) {\n \tcase 1 :\n \t // /Users/enrico/Documents/Workspace/SiDL/src/sidl/grammar/SiDL.g:85:5: statement\n \t {\n \t pushFollow(FOLLOW_statement_in_block419);\n \t statement21=statement();\n\n \t state._fsp--;\n\n \t stream_statement.add(statement21.getTree());\n\n \t }\n \t break;\n \tcase 2 :\n \t // /Users/enrico/Documents/Workspace/SiDL/src/sidl/grammar/SiDL.g:85:17: NL\n \t {\n \t NL22=(Token)match(input,NL,FOLLOW_NL_in_block423); \n \t stream_NL.add(NL22);\n\n\n \t }\n \t break;\n\n \tdefault :\n \t if ( cnt5 >= 1 ) break loop5;\n EarlyExitException eee =\n new EarlyExitException(5, input);\n throw eee;\n }\n cnt5++;\n } while (true);\n\n\n // AST REWRITE\n // elements: statement\n // token labels: \n // rule labels: retval\n // token list labels: \n // rule list labels: \n // wildcard labels: \n retval.tree = root_0;\n RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.tree:null);\n\n root_0 = (Object)adaptor.nil();\n // 85:23: -> ^( BLOCK ( statement )+ )\n {\n // /Users/enrico/Documents/Workspace/SiDL/src/sidl/grammar/SiDL.g:85:26: ^( BLOCK ( statement )+ )\n {\n Object root_1 = (Object)adaptor.nil();\n root_1 = (Object)adaptor.becomeRoot(\n new BlockNode(BLOCK)\n , root_1);\n\n if ( !(stream_statement.hasNext()) ) {\n throw new RewriteEarlyExitException();\n }\n while ( stream_statement.hasNext() ) {\n adaptor.addChild(root_1, stream_statement.nextTree());\n\n }\n stream_statement.reset();\n\n adaptor.addChild(root_0, root_1);\n }\n\n }\n\n\n retval.tree = root_0;\n\n }\n\n retval.stop = input.LT(-1);\n\n\n retval.tree = (Object)adaptor.rulePostProcessing(root_0);\n adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n \tretval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);\n\n }\n\n finally {\n \t// do for sure before leaving\n }\n return retval;\n }",
"public final StormParser.block_return block() throws RecognitionException {\n StormParser.block_return retval = new StormParser.block_return();\n retval.start = input.LT(1);\n\n\n CommonTree root_0 = null;\n\n Token LCURLY9=null;\n Token RCURLY11=null;\n StormParser.sentence_return sentence10 =null;\n\n\n CommonTree LCURLY9_tree=null;\n CommonTree RCURLY11_tree=null;\n\n try {\n // /home/ablecao/workspace/Storm.g:79:6: ( LCURLY ( sentence )+ RCURLY )\n // /home/ablecao/workspace/Storm.g:79:8: LCURLY ( sentence )+ RCURLY\n {\n root_0 = (CommonTree)adaptor.nil();\n\n\n LCURLY9=(Token)match(input,LCURLY,FOLLOW_LCURLY_in_block288); \n LCURLY9_tree = \n (CommonTree)adaptor.create(LCURLY9)\n ;\n adaptor.addChild(root_0, LCURLY9_tree);\n\n\n // /home/ablecao/workspace/Storm.g:79:15: ( sentence )+\n int cnt2=0;\n loop2:\n do {\n int alt2=2;\n int LA2_0 = input.LA(1);\n\n if ( (LA2_0==KW_REGISTER) ) {\n alt2=1;\n }\n\n\n switch (alt2) {\n \tcase 1 :\n \t // /home/ablecao/workspace/Storm.g:79:15: sentence\n \t {\n \t pushFollow(FOLLOW_sentence_in_block290);\n \t sentence10=sentence();\n\n \t state._fsp--;\n\n \t adaptor.addChild(root_0, sentence10.getTree());\n\n \t }\n \t break;\n\n \tdefault :\n \t if ( cnt2 >= 1 ) break loop2;\n EarlyExitException eee =\n new EarlyExitException(2, input);\n throw eee;\n }\n cnt2++;\n } while (true);\n\n\n RCURLY11=(Token)match(input,RCURLY,FOLLOW_RCURLY_in_block293); \n RCURLY11_tree = \n (CommonTree)adaptor.create(RCURLY11)\n ;\n adaptor.addChild(root_0, RCURLY11_tree);\n\n\n }\n\n retval.stop = input.LT(-1);\n\n\n retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);\n adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);\n\n }\n\n catch (RecognitionException e) {\n reportError(e);\n throw e;\n }\n\n finally {\n \t// do for sure before leaving\n }\n return retval;\n }",
"private void createNewBlock(NodeBlock block) {\n \t\t// adds a new block after the if node created\n \t\t// the index is not incremented so the created block will be visited too\n \t\tNodeBlock targetBlock = IrFactoryImpl.eINSTANCE.createNodeBlock();\n \t\tList<Node> nodes = EcoreHelper.getContainingList(block);\n \t\tnodes.add(indexNode + 2, targetBlock);\n \n \t\t// moves instructions\n \t\tList<Instruction> instructions = block.getInstructions();\n \t\ttargetBlock.getInstructions().addAll(\n \t\t\t\tinstructions.subList(indexInst, instructions.size()));\n \t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a TraceBuf from a Wave. This is useful for putting non Earthworm data in a Winston database. | public TraceBuf(String code, Wave sw) {
data = sw.buffer;
samplingPeriod = Math.round(TO_USEC / sw.getSamplingRate());
firstSampleTime = Math.round(Util.j2KToEW(sw.getStartTime()) * TO_USEC);
pin = -1;
numSamples = data.length;
dataType = "s4";
quality = "";
pad = "";
String[] cc = code.split("\\$");
station = cc[0];
channel = cc[1];
network = cc[2];
// TODO: remove
location = null;
if (cc.length >= 4) {
isTraceBuf2 = true;
location = cc[3];
}
} | [
"public static Wave traceBufToWave(List<TraceBuf> traceBufs) {\n\n\t\t// Nothing in, nothing out\n\t\tif (traceBufs == null || traceBufs.size() <= 0)\n\t\t\treturn null;\n\n\t\t// get rid of all the bad stuff, except gaps\n\t\tnormalize(traceBufs);\n\n\t\tfinal TraceBuf firstTraceBuf = traceBufs.get(0);\n\t\tfinal TraceBuf lastTraceBuf = traceBufs.get(traceBufs.size() - 1);\n\n\t\tlong samplingPeriod = firstTraceBuf.samplingPeriod;\n\t\tlong lastSampleTime = lastTraceBuf.firstSampleTime + ((lastTraceBuf.numSamples - 1) * samplingPeriod);\n\n\t\tint numSamples = (int) ((lastSampleTime - firstTraceBuf.firstSampleTime) / samplingPeriod + 1);\n\t\tint[] buffer = new int[numSamples];\n\t\tArrays.fill(buffer, Wave.NO_DATA);\n\t\t\n\t\tint sampleIndex = 0;\n\t\tlong lastSampleTimeSeen = firstTraceBuf.firstSampleTime - samplingPeriod;\n\n\t\tlong lastStart = 0;\n\t\tint lastCount = 0;\n\t\tfor (TraceBuf tb : traceBufs) {\n\t\t\t\n\t\t\t// assume more recent samples are more correct samples\n\t\t\tif (tb.firstSampleTime <= lastSampleTimeSeen) {\n\t\t\t\tint overlap = (int) ((lastSampleTimeSeen - tb.firstSampleTime) / samplingPeriod + 1);\n\t\t\t\tSystem.err.println(\"Overlapping tracebuf found in \" + tb.toWinstonString() + \". Overlap count=\" + overlap);\n\t\t\t\tSystem.err.println(lastStart + \" + (\" + lastCount + \" - 1) * \" + samplingPeriod + \" - \" + tb.firstSampleTime + \" = \" + (lastStart + (lastCount -1) * samplingPeriod - tb.firstSampleTime));\n\t\t\t\tSystem.err.println(\"count \" + tb.numSamples + \" : rate \" + tb.samplingRate() + \" : duration \" + ((tb.samplingPeriod * tb.numSamples)));\n\t\t\t\tsampleIndex -= overlap;\n\t\t\t}\n\n\t\t\t// this shouldn't happen\n\t\t\tif (sampleIndex + tb.numSamples > buffer.length) {\n\t\t\t\tSystem.err.println(\"Too many samples in \" + tb.toWinstonString() + \". Variable sampling rate no supported.\");\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tfor (int j = 0; j < tb.numSamples; j++)\n\t\t\t\tbuffer[sampleIndex++] = tb.data[j];\n\n\t\t\tlastSampleTimeSeen = tb.firstSampleTime + ((tb.numSamples - 1) * samplingPeriod);\n\t\t\tlastStart = tb.firstSampleTime;\n\t\t\tlastCount = tb.numSamples;\n\t\t}\n\t\t\n\t\tWave wave = new Wave(buffer, (firstTraceBuf.firstSampleTime * FROM_USEC), firstTraceBuf.samplingRate());\n\t\twave.setRegistrationOffset(firstTraceBuf.registrationOffset);\n\n\t\treturn wave;\n\t}",
"private static ObservableWaveView createSampleWave(\n SilentOperationSink<? super WaveletOperation> sink) {\n\n final WaveViewDataImpl waveData = WaveViewDataImpl.create(fakeIdGenerator.newWaveId());\n final DocumentFactory<?> docFactory = BasicFactories.fakeDocumentFactory();\n final ObservableWaveletData.Factory<?> waveletDataFactory =\n new ObservableWaveletData.Factory<WaveletDataImpl>() {\n private final ObservableWaveletData.Factory<WaveletDataImpl> inner =\n WaveletDataImpl.Factory.create(docFactory);\n\n @Override\n public WaveletDataImpl create(ReadableWaveletData data) {\n WaveletDataImpl wavelet = inner.create(data);\n waveData.addWavelet(wavelet);\n return wavelet;\n }\n };\n WaveletFactory<OpBasedWavelet> waveletFactory =\n BasicFactories.opBasedWaveletFactoryBuilder().with(fakeAuthor).with(waveletDataFactory)\n .with(sink)\n .build();\n\n WaveViewImpl<?> wave =\n WaveViewImpl.create(waveletFactory, waveData.getWaveId(), fakeIdGenerator, fakeAuthor,\n WaveletConfigurator.ADD_CREATOR);\n\n return wave;\n\n }",
"CPTP_fixedbuf CPRC_riff_buffer(Pointer wav);",
"public interface Wave {\n\n /**\n * Get the next single, unformatted sample and return it as a double.\n *\n * <p>The next call to any of the get or insert methods will return samples\n * following the samples returned by this call.\n *\n * @return the next unformatted sample\n */\n public double getNextRawSample();\n\n /**\n * <p>Get the next (single) sample and store it at the given offset\n * in the supplied buffer.\n *\n * <p>The next call to any of the get or insert methods will return samples\n * following the samples returned by this call.\n *\n * @param buffer to put the sample in\n * @param byteOffset starting index for the sample\n *\n * @throws IndexOutOfBoundsException if the sample extends past the\n * end of the buffer\n */\n public void insertNextSample( byte[] buffer, int byteOffset );\n\n /**\n * <p>Get the next specified number of unformatted samples from the wave\n * and store them in the supplied double array at the given offset.\n *\n * <p>The next call to any of the get or insert methods will return samples\n * following the samples returned by this call.\n *\n * @param rawBuffer storage for the unformatted samples\n * @param offset starting index for the samples\n * @param nSamples number of samples to provide\n *\n * @throws IndexOutOfBoundsException if the samples would extend past the\n * end of the buffer\n */\n public void getNextRawSamples( double[] rawBuffer, int offset, int nSamples )\n throws IndexOutOfBoundsException;\n\n /**\n * <p>Fill the supplied buffer with unformatted samples from the wave.\n *\n * <p>The next call to any of the get or insert methods will return samples\n * following the samples returned by this call.\n *\n * @param rawBuffer buffer to fill\n */\n public void getNextRawSamples( double[] rawBuffer );\n\n /**\n * <p>Get the next specified number of samples (note: samples, not bytes)\n * from the wave, format them, and store them in the supplied byte array at\n * the given offset.\n *\n * <p>The starting offset is in bytes, and there is no requirement that the\n * offset be aligned on a sampleBytes boundary, nor that the buffer length\n * be an integral number of samples, as the caller may have other information\n * stored in the buffer (e.g. a header for the audio format). For the same\n * reason, this does not wrap if the number of samples will not fit in the\n * tail of the buffer.\n *\n * <p>The next call to any of the get or insert methods will return samples\n * following the samples returned by this call.\n *\n * @param buffer storage for the samples\n * @param byteOffset starting index in buffer at which to store the\n * samples\n * @param nSamples number of samples to insert\n *\n * @throws IndexOutOfBoundsException if the samples would extend past the\n * end of the buffer\n */\n public void insertNextSamples( byte[] buffer, int byteOffset, int nSamples )\n throws IndexOutOfBoundsException;\n\n /**\n * <p>Get the next specified number of bytes worth of samples, format the\n * samples, and store them in the supplied byte array at the given offset.\n * If the number of bytes is not a multiple of the sample size, the number\n * of bytes provided will be rounded down to the nearest whole sample.\n * (This is for the benefit of callers that don't know about the audio format,\n * mainly MockTargetDataLine.)\n *\n * <p>The starting offset is in bytes, and there is no requirement that the\n * offset be aligned on a sampleBytes boundary, nor that the buffer length\n * be an integral number of samples, as the caller may have other information\n * stored in the buffer (e.g. a header for the audio format). For the same\n * reason, this does not wrap if the number of samples will not fit in the\n * tail of the buffer.\n *\n * <p>The next call to any of the get or insert methods will return samples\n * following the samples returned by this call.\n *\n * @param buffer storage for the samples\n * @param byteOffset starting index in buffer at which to store the\n * samples\n * @param nBytes number of bytes to insert\n */\n public void insertNextBytes( byte[] buffer, int byteOffset, int nBytes )\n throws IndexOutOfBoundsException;\n\n /**\n * <p>Fill the supplied buffer with formatted samples from the wave.\n * \n * <p>This version of insertNextSamples is not intended for buffers that\n * include non-sample data such as headers, as it will insert samples\n * starting at index 0. Instead, use\n * {@link insertNextSamples(byte[], int, int)}.\n *\n * <p>If the buffer is not an integral multiple of the sample size, this\n * will fill in as many samples as it can, leaving the remaining bytes\n * unmodified.\n *\n * <p>The next call to any of the get or insert methods will return samples\n * following the samples returned by this call.\n * \n * @param buffer storage for samples\n * \n * @throws IllegalArgumentException if the buffer size is not an integral\n * multiple of the audio format's sample size\n */\n public void insertNextSamples( byte[] buffer )\n throws IllegalArgumentException;\n\n /**\n * Reset phase for next sample to originally-specified initial phase(s).\n */\n public void resetPhase();\n}",
"public static iodine.avro.TapRecord.Builder newBuilder(iodine.avro.TapRecord other) {\n return new iodine.avro.TapRecord.Builder(other);\n }",
"public void createWave(){\n\t\t\n\t}",
"public SimpleBufferingTraceSink(TraceSink traceSink) {\n this.traceSink = traceSink;\n this.traceBuffer = new TraceBuffer();\n }",
"private SocketBufferedTrace(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }",
"protected byte createWave(double t) {\n\t\treturn sineWave(t, DEFAULT_SINE_CONSTANT);\n\t}",
"protected TraceBuf(byte[] b, int i, int seq) throws IOException {\n\t\tsuper(b, i, seq);\n\t}",
"public static iodine.avro.TapRecord.Builder newBuilder() {\n return new iodine.avro.TapRecord.Builder();\n }",
"public void recordWaveform () {\n try {\n sendHeader (PLAYER_MSGTYPE_REQ, PLAYER_AUDIO_REQ_WAV_REC, 0);\n os.flush ();\n } catch (IOException e) {\n throw new PlayerException\n (\"[Audio] : Couldn't send request: \" +\n e.toString(), e);\n }\n }",
"public void addWave(Wave wave)\n\t{\n\t\twaveList.add(wave);\n\t}",
"public static iodine.avro.TapRecord.Builder newBuilder(iodine.avro.TapRecord.Builder other) {\n return new iodine.avro.TapRecord.Builder(other);\n }",
"public WavePlayer(AudioContext context, UGen frequencyEnvelope, Buffer buffer) {\n super(context, 1);\n this.frequencyEnvelope = frequencyEnvelope;\n this.buffer = buffer;\n }",
"private Trace convertTraceSpanDataToTrace(TraceSpanData spanData) {\n Trace trace = new Trace();\n trace.setProjectId(projectId);\n trace.setTraceId(spanData.getContext().getTraceId());\n \n TraceSpan span = convertTraceSpanDataToSpan(spanData);\n trace.setSpans(ImmutableList.<TraceSpan>of(span));\n return trace;\n }",
"public WAVFileWriter() {\n }",
"public static void record(StringBuffer sb, String dataset, double[] parameters, Williamson3bin w3b) {\n\t\tif(parameters.length==3) {\n\t\t\tdouble t = parameters[0];\n\t\t\tdouble d = parameters[1];\n\t\t\tdouble index = parameters[2];\n\n\t\t\tdouble r = 0; double s = 0; double nns = 0; //replacement, silentProb, non-neutral substitutions;\n\t\t\tif(index==0) {\n\n\t\t\t\tr = w3b.getLowR();\n\t\t\t\ts = w3b.getLowS();\n\t\t\t\tnns = w3b.getLowA();\n\t\t\t}\n\t\t\telse if(index==1) {\n\t\t\t\tr = w3b.getMidR();\n\t\t\t\ts = w3b.getMidS();\n\t\t\t\tnns = w3b.getMidA();\n\t\t\t}\n\t\t\telse if(index==2) {\n\t\t\t\tr = w3b.getHighR();\n\t\t\t\ts = w3b.getHighS();\n\t\t\t\tnns = w3b.getAdaptiveMutations(); //adaptive mutations in high-freq and fixn\n\n\t\t\t}\n\n\t\t\tdouble ratio = r/s;\n\t\t\tsb.append(dataset + \",\" + d + \",\" + (r + s) + \",\" + s + \",\" + r + \",\" + ratio + \",\" +nns + \"\\n\");\n\t\t}\n\t\telse{\n//\t\t\tdouble t = parameters[0];\n//\t\t\tdouble window = parameters[1];\n//\t\t\tdouble d = parameters[2];\n//\t\t\tdouble index = parameters[3];\n//\n//\t\t\tsb.append(dataset + \",\" + d + \",\" + window + \",\" + (bm.ReplacementCountArray[(int) index] + bm.SilentCountArray[(int) index]) + \",\" +\n//\t\t\t\t\tbm.SilentCountArray[(int) index] + \",\" + bm.ReplacementCountArray[(int) index] + \",\" + bm.ReplacementSilentRatio[(int) index] + \",\" + bm.NonNeutralSubstitutions[(int) index] + \"\\n\");\n//\n\t\t}\n\t}",
"public static TraceTelemetry convertTraceTelemetry(twogapplicationinsights.proxies.TraceTelemetry trace)\n\t\t\tthrows CoreException\n\t{\n\t\tTraceTelemetry tt = new TraceTelemetry();\n\n\t\ttt.setMessage(trace.getMessage());\n\t\ttt.setTimestamp(trace.getTimestamp());\n\n\t\ttt.setSeverityLevel(DataHelper.convert(trace.getLevel()));\n\n\t\tDataHelper.addToTelemetry(tt, trace.getCustomProperties());\n\n\t\treturn tt;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method was generated by MyBatis Generator. This method returns the value of the database column sys_contentmain.vipFlag | public Integer getVipflag() {
return vipflag;
} | [
"public void setVipflag(Integer vipflag) {\r\n\t\tthis.vipflag = vipflag;\r\n\t}",
"public Integer getFLAG() {\n return FLAG;\n }",
"public Integer getFlag() {\r\n return flag;\r\n }",
"public Integer getFlag() {\n return flag;\n }",
"public String getFlag() {\n return (String) getAttributeInternal(FLAG);\n }",
"java.lang.String getFlag();",
"public String getIvaFlag() {\n return (String) getAttributeInternal(IVAFLAG);\n }",
"public String getApprovedflag() {\n return (String) getAttributeInternal(APPROVEDFLAG);\n }",
"java.lang.String getBsFlag();",
"public boolean getVIP();",
"public String getApprovedFlag() {\r\n return (String) getAttributeInternal(APPROVEDFLAG);\r\n }",
"public String getDbVip() {\n return dbVip;\n }",
"public String getIsVip() {\r\n return isVip;\r\n }",
"public Boolean getFlag() {\n return flag;\n }",
"public Integer getPrimaryflag() {\n return primaryflag;\n }",
"public String getIsFlag() {\r\n return isFlag;\r\n }",
"public int getPlanFlag() {\n\treturn planFlag;\n }",
"io.opencannabis.schema.product.EdibleProduct.EdibleFlag getFlags(int index);",
"public Byte getShowFlag() {\n return showFlag;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check a personal deck to see if contains any card that is activable | private boolean hasUsableCards(List<ItemCard> itemdeck){
boolean hasUsables = false;
for (ItemCard ic : itemdeck){
if(ic.isActivable()){
hasUsables = true;
break;
}
}
return hasUsables;
} | [
"boolean hasDebtCard();",
"protected abstract boolean isCardActivatable(Card card);",
"boolean hasCreCard();",
"boolean hasAlreadShowCard();",
"boolean hasAlreadCheckCard();",
"boolean hasAlreadFoldCard();",
"private boolean isAllCardsExsit() {\n TelephonyManager mTm = (TelephonyManager) mContext.getSystemService(\n Context.TELEPHONY_SERVICE);\n int i = 0;\n int count = 0;\n\n for (i = 0; i < mSimCount; i++) {\n if (mTm.hasIccCard(i)) {\n count++;\n }\n }\n\n if (count > 1) {\n return true;\n } else {\n return false;\n }\n }",
"boolean hasTestFlashCard();",
"@Test\n\tpublic void testAllCards() {\n\t\tDeck deck = new Deck();\n\t\tArrayList<Card> cards = new ArrayList<Card>(Arrays.asList(deck.getDeck()));\n\t\tboolean isCardThere = true;\n\t\tfor(int i = 3; i >= 0; i--)\n\t\t\tfor(int j = 13; j > 0; j--)\n\t\t\t\tif(!cards.contains(new Card(j, i)) )\n\t\t\t\t{\n\t\t\t\t\tisCardThere = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\tassertEquals(true, isCardThere);\n\t}",
"boolean haveSuit(char suit){\n for (int i=0; i<6; i++)\n if (hand.get(i).suit != suit)\n return false;\n return true;\n }",
"public boolean canUseCard() {\n \t\tif (usedCard)\n \t\t\treturn false;\n \n \t\tfor (int i = 0; i < cards.length; i++) {\n \t\t\tif (cards[i] > 0)\n \t\t\t\treturn true;\n \t\t}\n \n \t\treturn false;\n \t}",
"private boolean hasAce(ArrayList<Card> cards) {\r\n\t\tfor(Card card: cards) {\r\n\t\t\tif(card.getValue() == 1) {\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 isDeckExist(Deck deck);",
"public boolean hasCards(){\n //TO-DO\n //if len(cards)<1:return 0\n //else:return 1\n \n if (this.cards.size()<1){return false;}\n else{return true;}}",
"public boolean hasCard(){\t\t\n\t\treturn card != null;\n\t\t\n\t}",
"private Boolean CanPlayCard(Player Attacker){\r\n\tfor(Card c: Attacker.getHand()){\r\n\t\tif(c.getCost()<Attacker.getResources())\r\n\t\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}",
"public boolean cardExchangePossible() {\n\n\t\tint infantryNum = (int) cards.stream().filter(card -> card.contains(\"infantry\")).count();\n\t\tint cavalryNum = (int) cards.stream().filter(card -> card.contains(\"cavalry\")).count();\n\t\tint artilleryNum = (int) cards.stream().filter(card -> card.contains(\"artillery\")).count();\n\t\tif (infantryNum >= 3) {\n\t\t\treturn true;\n\t\t} else if (cavalryNum >= 3) {\n\t\t\treturn true;\n\t\t} else if (artilleryNum >= 3) {\n\t\t\treturn true;\n\t\t} else if (infantryNum >= 1 && cavalryNum >= 1 && artilleryNum >= 1) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public void checkDeck(){\n\t\tfor(int i: deck)\n\t\t\tSystem.out.println(Integer.toString(i));\n\t}",
"private boolean spotsHaveCards() {\n\t\tfor (Spot s : spots)\n\t\t\tif (s.isActive())\n\t\t\t\treturn true;\n\t\treturn false;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check card all place of China | public static boolean isValidCard(String card) {
if (card == null || "".equals(card)) return false;
if (card.length() == 10 || card.length() == 15) {
return true;
} else if (card.length() == 18) {
return isValidChinaCard(card);
}
return false;
} | [
"static boolean isCardPlacementWellFormed(String cardPlacement) {\n // FIXME Task 2: determine whether a card placement is well-formed\n char[] arr = cardPlacement.toCharArray(); //converts the cardPlacement set into an array of characters\n //if the third element in the char array is A and Z or 0 and 9.\n if ((arr[2] >= 'A' && arr[2] <= 'Z') || (arr[2] >= '0' && arr[2] <= '9')) //checks if the characters are in range\n if (arr[0] == 'a' && arr[1] >= '0' && arr[1] <= '7') {//checks if the kingdom is a and character number is valid (0 and 7)\n return true;// returns true if the above statement is true.\n } else if (arr[0] == 'b' && arr[1] >= '0' && arr[1] <= '6') {\n return true;\n } else if (arr[0] == 'c' && arr[1] >= '0' && arr[1] <= '5') {\n return true;\n } else if (arr[0] == 'd' && arr[1] >= '0' && arr[1] <= '4') {\n return true;\n } else if (arr[0] == 'e' && arr[1] >= '0' && arr[1] <= '3') {\n return true;\n } else if (arr[0] == 'f' && arr[1] >= '0' && arr[1] <= '2') {\n return true;\n } else if (arr[0] == 'g' && arr[1] >= '0' && arr[1] <= '1') {\n return true;\n } else if (arr[0] == 'z' && arr[1] == '9') {\n return true;\n } else {\n return false;\n }\n else {\n return false;\n }\n\n }",
"boolean hasSteamChinaOnly();",
"boolean hasAlreadFoldCard();",
"static boolean isPlacementWellFormed(String placement) {\n // FIXME Task 3: determine whether a placement is well-formed\n //need to check if all cards are placed on the board once\n //need to check if the locations are all different (0-9 numbers no repeats)\n //can use if statements\n //can create an array of string (3char)\n // or\n //create two arrays\n // one with the location values and the other with the card type\n if (placement == null || placement == \"\") {\n return false;\n }\n String[] ar = placementArray(placement);\n if ((placement.length()) % 3 != 0) { //checks if there are three pairs of char for each char\n return false;\n }\n for (int i = 0; i < ar.length; i++) { //goes through the array of cards looking at each char\n if (isCardPlacementWellFormed(ar[i]) == false) {//if the card placement is not well formed\n return false;\n }\n }\n for (int j = 0; j < ar.length - 1; j++) {//goes through each char in the array\n for (int i = j + 1; i < ar.length; i++) {//goes through each char in array (one after j)\n if (ar[j] == ar[i]) { //if the two chars are equal false is returned\n return false;\n }\n }\n }\n for (int m = 0; m < ar.length - 1; m++) {//goes through each char in the array\n for (int n = m + 1; n < ar.length; n++) {//goes through each char in the array (one after m)\n if (ar[m].charAt(2) == ar[n].charAt(2)) {//checks if there are duplicates of locations in the card\n return false;\n }\n }\n }\n for (int m = 0; m < ar.length - 1; m++) {//does through each char in the array\n for (int n = m + 1; n < ar.length; n++) {//goes through each char in the array (one after m)\n if ((ar[m].charAt(0) == ar[n].charAt(0)) && (ar[m].charAt(1) == ar[n].charAt(1))) {//checks if there are duplicates of the card in the array\n return false;\n }\n }\n }\n return true;\n }",
"@Test\n\tpublic void testAllCards() {\n\t\tDeck deck = new Deck();\n\t\tArrayList<Card> cards = new ArrayList<Card>(Arrays.asList(deck.getDeck()));\n\t\tboolean isCardThere = true;\n\t\tfor(int i = 3; i >= 0; i--)\n\t\t\tfor(int j = 13; j > 0; j--)\n\t\t\t\tif(!cards.contains(new Card(j, i)) )\n\t\t\t\t{\n\t\t\t\t\tisCardThere = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\tassertEquals(true, isCardThere);\n\t}",
"private boolean faceCard(ArrayList<Card> cards) {\r\n\t\tfor (Card card: cards) {\r\n\t\t\tif (card.getValue() >= 11 && card.getValue() <= 13) \r\n\t\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"@Test\n\tpublic void testgetCountriesByContinent() {\n\t\tcountry = game_map.getCountriesByContinent(\"Quebec\");\n\t\tassertEquals(8,country.size());\n\t}",
"boolean hasAlreadShowCard();",
"public boolean isWin_DragonKingOfArms(){\r\n // player got LordSelachii card\r\n /*Player playerHoldCard = null;\r\n for (Player player : discWorld.getPlayer_HASH().values()) {\r\n if (player.getPersonalityCardID() == 5) {\r\n playerHoldCard = player;\r\n break;\r\n }\r\n }*/\r\n int count = 0;\r\n for(TroubleMarker troubleMarker : discWorld.getTroubleMarker_HASH().values()){\r\n if(troubleMarker.getAreaNumber() != ConstantField.DEFAULT_PIECE_AREA_NUMBER){\r\n count++;\r\n }\r\n }\r\n \r\n if(count >= 8){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n \r\n }",
"private boolean hasSecurePlace() {\n\t\tfor(int i = 0; i < cities(); i++)\n\t\t\tif(secure[i]) return true;\n\t\treturn false;\n\t}",
"boolean hasAlreadCheckCard();",
"boolean hasCreCard();",
"public static void country() {\n\n\t\tString countryname = \"Paris \";\n\n\t\tif (countryname == \"India\") {\n\t\t\tSystem.out.println(\"india isfriendly\");\n\t\t}\n\n\t\telse if (countryname == \"Pakistan\") {\n\t\t\tSystem.out.println(\"Pakistna is not friendly\");\n\t\t}\n\n\t\telse if (countryname == \"America\" && countryname == \"Russia\") {\n\t\t\tSystem.out.println(\"America and russia is friendly\"); //if one condition is false it doesn't check the other condition\n\t\t} //both condition needs to be true\n\n\t\telse if (countryname == \"Paris\" || countryname == \"France\") {\n\t\t\tSystem.out.println(\"Paris and France is friendly\"); //one condition need to be true\n\t\t} \n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"all other countries are far away from race\");\n\t\t}\n\t}",
"boolean hasCountriesAllowed();",
"public boolean cardExchangePossible() {\n\n\t\tint infantryNum = (int) cards.stream().filter(card -> card.contains(\"infantry\")).count();\n\t\tint cavalryNum = (int) cards.stream().filter(card -> card.contains(\"cavalry\")).count();\n\t\tint artilleryNum = (int) cards.stream().filter(card -> card.contains(\"artillery\")).count();\n\t\tif (infantryNum >= 3) {\n\t\t\treturn true;\n\t\t} else if (cavalryNum >= 3) {\n\t\t\treturn true;\n\t\t} else if (artilleryNum >= 3) {\n\t\t\treturn true;\n\t\t} else if (infantryNum >= 1 && cavalryNum >= 1 && artilleryNum >= 1) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"private boolean isValid(char value, Suit suit)\n {\n char upper = Character.toUpperCase(value);\n for (int i = 0; i < cards.length; i++)\n {\n if (upper == cards[i])\n {\n return true;\n }\n }\n return false;\n }",
"public boolean VerifyHumanChoice(int value){\n String card = handHuman.get(value);\n System.out.print(\"CARD IN VERIFY HUMAN\" + card);\n\n String firstLetter = Character.toString(card.charAt(0));\n String topFirstLetter = Character.toString(topCard.charAt(0));\n\n if(topCard.contains(\"8\")){\n //Can play any card ontop to determine suite\n topCard = card;\n return true;\n }\n\n if(card.contains(\"8\")){\n //valid because 8s are wild cards, human can place it\n topCard = card;\n return true;\n }\n\n //the cards match in suite, doesn't matter what it is\n else if(firstLetter.equals(topFirstLetter)){\n topCard = card;\n return true;\n }\n\n else{\n if(topFirstLetter.equals(\"c\")){\n String temp = topCard.substring(5, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n\n else if(topFirstLetter.equals(\"h\")){\n String temp = topCard.substring(6, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n\n else if(topFirstLetter.equals(\"d\")){\n String temp = topCard.substring(8, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n\n else if(topFirstLetter.equals(\"s\")){\n String temp = topCard.substring(6, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n }\n\n //You can't play this card\n return false;\n }",
"@Test\n\tpublic void validateSpecificCountries() {\n\t\tRestAssured.given()\n\t\t\t\t .get(\"/all\")\n\t\t\t\t .then()\n\t\t\t\t .statusCode(200)\n\t\t\t\t .body(\"RestResponse.result.alpha2_code\", hasItems(\"US\", \"DE\", \"GB\"));\n\t}",
"boolean getSteamChinaOnly();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructs a DeclInfo for the given decl. | DeclInfo(Decl decl) {
this.decl = decl;
this.upperBound = null;
} | [
"Declaration createDeclaration();",
"DeclRule createDeclRule();",
"public LocalDecl createLocalDecl(Position pos, LocalDef def, Expr init) {\n return xnf.LocalDecl( pos.markCompilerGenerated(), \n xnf.FlagsNode(pos, def.flags()),\n xnf.CanonicalTypeNode(pos, def.type().get()), \n xnf.Id(pos, def.name()),\n init ).localDef(def);\n }",
"FunctionDecl createFunctionDecl();",
"InputDecl createInputDecl();",
"OutputDecl createOutputDecl();",
"@Converted(kind = Converted.Kind.MANUAL_COMPILATION,\n source = \"${LLVM_SRC}/llvm/tools/clang/lib/AST/Decl.cpp\", line = 3716,\n FQN=\"clang::RecordDecl::RecordDecl\", NM=\"_ZN5clang10RecordDeclC1ENS_4Decl4KindENS_11TagTypeKindERKNS_10ASTContextEPNS_11DeclContextENS_14SourceLocationES9_PNS_14IdentifierInfoEPS0_\",\n cmd=\"jclank.sh -java-options=${SPUTNIK}/modules/org.clang.ast/llvmToClangType ${LLVM_SRC}/llvm/tools/clang/lib/AST/Decl.cpp -nm=_ZN5clang10RecordDeclC1ENS_4Decl4KindENS_11TagTypeKindERKNS_10ASTContextEPNS_11DeclContextENS_14SourceLocationES9_PNS_14IdentifierInfoEPS0_\")\n //</editor-fold>\n protected RecordDecl(Kind DK, TagTypeKind TK, final /*const*/ ASTContext /*&*/ C, \n DeclContext /*P*/ DC, SourceLocation StartLoc, \n SourceLocation IdLoc, IdentifierInfo /*P*/ Id, \n RecordDecl /*P*/ PrevDecl) {\n // : TagDecl(DK, TK, C, DC, IdLoc, Id, PrevDecl, StartLoc) \n //START JInit\n super(DK, TK, C, DC, new SourceLocation(IdLoc), Id, PrevDecl, new SourceLocation(StartLoc));\n //END JInit\n HasFlexibleArrayMember = false;\n AnonymousStructOrUnion = false;\n HasObjectMember = false;\n HasVolatileMember = false;\n LoadedFieldsFromExternalStorage = false;\n assert (classof((Decl)this)) : \"Invalid Kind!\";\n }",
"declaration getDeclaration();",
"Declarator createDeclarator();",
"public AttributeSet getDeclaration(String decl) {\n\tif (decl == null) {\n\t return SimpleAttributeSet.EMPTY;\n\t}\n\tCssParser parser = new CssParser();\n\treturn parser.parseDeclaration(decl);\n }",
"FuncDecl createFuncDecl();",
"private static ClassInfo createClassInfo(Ast.ClassDecl n) throws Exception {\n\t \n\t ClassInfo cinfo = (n.pnm != null) ?\n new ClassInfo(n, classEnv.get(n.pnm)) : new ClassInfo(n);\n \n for (Ast.MethodDecl m : n.mthds) {\n\t\t if (!cinfo.vtable.contains(m.nm)) {\n\t\t cinfo.vtable.add(m.nm);\n\t\t }\n }\n \n\t int offsetCounter = cinfo.objSize;\n\t for (Ast.VarDecl v : n.flds) {\n\t\t if(!cinfo.fdecls.contains(v)) {\n\t\t\t cinfo.fdecls.add(v);\n\t\t }\n\t cinfo.offsets.add(offsetCounter);\n\t offsetCounter += gen(v.t).size;\n\t }\n\t \n\t cinfo.objSize = offsetCounter;\n\t return cinfo;\n }",
"public Statement makeDeclaration(Variable var)\n\t{\n\t\treturn new Declaration(var);\n\t}",
"public Object visit(DeclStmt node)\n {\n if (this.declared) {\n String nodeName = node.getName();\n// String ref = node.getRefName();\n\n Location loc = this.getLocation(null, nodeName);\n node.getInit().accept(this);\n\n support.genStoreWord(\"$v0\", loc.getOffset(), loc.getBaseReg());\n support.setLastInstrComment(\"Assign \" + loc.getOffset() + \"(\" + loc.getBaseReg() + \") = $v0\");\n\n return null;\n }\n\n support.genComment(\"Declaration statement begin\", 1);\n node.getInit().accept(this);\n\n // store the variable's value in the stack\n int offset = this.support.getNextAvailStackOffset();\n this.support.genStoreWord(\"$v0\", offset, \"$fp\");\n this.support.setLastInstrComment(\"Store the variable \\\"\" + node.getName() + \"\\\"\");\n // store variable's location in symbol table\n this.support.setNextAvailStackOffset(offset + this.support.getWordSize());\n this.currentClass.getVarSymbolTable().add(node.getName(), new Location(\"$fp\", offset));\n\n support.genComment(\"Declaration statement end\", 1);\n return null;\n }",
"public final X_Reference_Counter.decllist_return decllist() throws RecognitionException {\n\t\tX_Reference_Counter.decllist_return retval = new X_Reference_Counter.decllist_return();\n\t\tretval.start = input.LT(1);\n\n\t\tCommonTree root_0 = null;\n\n\t\tCommonTree _first_0 = null;\n\t\tCommonTree _last = null;\n\n\n\t\tCommonTree DECLARE5=null;\n\t\tTreeRuleReturnScope decl6 =null;\n\n\t\tCommonTree DECLARE5_tree=null;\n\n\t\ttry {\n\t\t\t// /home/dominik/dev/java/AntlrX/src/dhbw/compilerbau/xparser/X_Reference_Counter.g:20:9: ( ^( DECLARE decl ) )\n\t\t\t// /home/dominik/dev/java/AntlrX/src/dhbw/compilerbau/xparser/X_Reference_Counter.g:20:17: ^( DECLARE decl )\n\t\t\t{\n\t\t\troot_0 = (CommonTree)adaptor.nil();\n\n\n\t\t\t_last = (CommonTree)input.LT(1);\n\t\t\t{\n\t\t\tCommonTree _save_last_1 = _last;\n\t\t\tCommonTree _first_1 = null;\n\t\t\tCommonTree root_1 = (CommonTree)adaptor.nil();\n\t\t\t_last = (CommonTree)input.LT(1);\n\t\t\tDECLARE5=(CommonTree)match(input,DECLARE,FOLLOW_DECLARE_in_decllist103); \n\t\t\tDECLARE5_tree = (CommonTree)adaptor.dupNode(DECLARE5);\n\n\n\t\t\troot_1 = (CommonTree)adaptor.becomeRoot(DECLARE5_tree, root_1);\n\n\t\t\tmatch(input, Token.DOWN, null); \n\t\t\t_last = (CommonTree)input.LT(1);\n\t\t\tpushFollow(FOLLOW_decl_in_decllist105);\n\t\t\tdecl6=decl();\n\t\t\tstate._fsp--;\n\n\t\t\tadaptor.addChild(root_1, decl6.getTree());\n\n\t\t\tmatch(input, Token.UP, null); \n\t\t\tadaptor.addChild(root_0, root_1);\n\t\t\t_last = _save_last_1;\n\t\t\t}\n\n\n\t\t\t}\n\n\t\t\tretval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);\n\n\t\t}\n\t\tcatch (RecognitionException re) {\n\t\t\treportError(re);\n\t\t\trecover(input,re);\n\t\t}\n\t\tfinally {\n\t\t\t// do for sure before leaving\n\t\t}\n\t\treturn retval;\n\t}",
"IDDeclaration createIDDeclaration();",
"InitDeclRule createInitDeclRule();",
"private void decl(LexicalAnalyzer.Token declToken) throws IOException {\n appendLMD(\"5,\"); // rule 5: decl --> IDTOK ':' rest \n match(declToken,1); // match IDTOK\n match(currentToken,24); // ':'\n rest(declToken);\n }",
"public static JCTree declarationFor(final Symbol sym, final JCTree tree) {\n \tclass DeclScanner extends JavafxTreeScanner {\n JCTree result = null;\n public void scan(JCTree tree) {\n if (tree!=null && result==null)\n tree.accept(this);\n }\n \t public void visitTopLevel(JCCompilationUnit that) {\n \t\tif (that.packge == sym) result = that;\n \t\telse super.visitTopLevel(that);\n \t }\n \t public void visitClassDef(JCClassDecl that) {\n \t\tif (that.sym == sym) result = that;\n \t\telse super.visitClassDef(that);\n \t }\n \t public void visitMethodDef(JCMethodDecl that) {\n \t\tif (that.sym == sym) result = that;\n \t\telse super.visitMethodDef(that);\n \t }\n \t public void visitVarDef(JCVariableDecl that) {\n \t\tif (that.sym == sym) result = that;\n \t\telse super.visitVarDef(that);\n \t }\n \t}\n \tDeclScanner s = new DeclScanner();\n \ttree.accept(s);\n \treturn s.result;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests the unwrap method. | @Test
public void testUnwrap() {
assertEquals(FudgeResponse.unwrap(VALUE), VALUE);
assertEquals(FudgeResponse.unwrap(RESPONSE), VALUE);
} | [
"private static Object unwrap(final Object object, final boolean inverse) {\n return inverse ? ((Inverse) object).inverse() : object;\n }",
"public boolean unwrap() {\n // Pico input file.\n try {\n\n PicoInputStream pis = new PicoInputStream(new FileInputStream(this.infile));\n // Unwrapped output file.\n FileOutputStream fos = new FileOutputStream(this.outfile);\n return transfer(pis, fos);\n\n } catch (Exception e) {\n System.err.println(e.getMessage());\n return false;\n }\n\n }",
"public void unwrap() throws Exception {\n throw getCause();\n }",
"public static Object unwrap(Object object) {\n if (object == null)\n return null;\n\n if (object instanceof Wrapper)\n object = ((Wrapper) object).unwrap();\n\n if (object == Scriptable.NOT_FOUND)\n return null;\n return object;\n }",
"private void unwrap(Object wrappedDocument) {\n String methodSig = \"UnWrappedMessage$RPCStyleUnwrapper :: \" +\n \"unwrap(Object, String, String, ServiceEngineEndpoint) : \";\n try {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n XMLStreamWriter writer = XOF.createXMLStreamWriter(baos, \"UTF-8\");\n /**\n * Extract the payLoad content from wrappedDocument and write it\n * to writer. This does not involve creating or importing a DOM node.\n */\n writer.writeStartElement(DEFAULT_OPERATION_PREFIX + \":\" + wsdlMessageType.getLocalPart());\n writer.writeAttribute(DEFAULT_XML_NS_SCHEME + \":\" + DEFAULT_OPERATION_PREFIX,\n wsdlMessageType.getNamespaceURI());\n if(wrappedDocument instanceof Node) {\n writeJBIParts((Node)wrappedDocument, writer);\n } else if(wrappedDocument instanceof XMLStreamReader) {\n writeJBIParts((XMLStreamReader)wrappedDocument, writer);\n }\n writer.writeEndElement();\n writer.flush();\n /**\n * Create payLoadAsStreamReader and payLoadAsSource from the\n * content available in ByteArrayOutputStream.\n */\n ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());\n payLoadAsBaos = baos;\n payloadLocalName = wsdlMessageType.getLocalPart();\n payloadNamespaceURI = wsdlMessageType.getNamespaceURI();\n payLoadAsStreamReader = XIF.createXMLStreamReader(bais);\n payLoadAsStreamReader.next(); // skip the <?xml ...?> node.\n payLoadAsSource = new StAXSource(payLoadAsStreamReader, true);\n \n printPayLoad(\"Unwrapped message = \" + baos.toString());\n } catch(Exception ex) {\n logger.log(Level.SEVERE, ex.getMessage(), ex);\n }\n }",
"@Override\n public Object unwrap() {\n return node;\n }",
"@Test\n public void testUnwrapInvocationTargetExceptionWithOtherException() {\n RuntimeException rte = new RuntimeException();\n assertTrue(rte == ExceptionUtil.unwrapInvocationTargetException(rte));\n }",
"private void checkUnwrappedMethod(@NotNull MethodDeclaration method) {\n\t}",
"public static Object unwrap(final Class<?> type, final Object object) throws Exception {\n if (object == null) {\n return null;\n }\n if (type == null) {\n return object;\n }\n if (Callable.class.equals(type)) {\n assert (object instanceof Callable);\n return ((Callable<?>) object).call();\n }\n\n if (\"java.util.function.Supplier\".equals(type.getName())) {\n return findMethodByName(type, \"get\").invoke(object, (Object[]) null);\n }\n\n return object;\n }",
"byte unwrap(byte[] keyHandle, short keyHandleOffset, short keyHandleLength, byte[] applicationParameter, short applicationParameterOffset, ECPrivateKey unwrappedPrivateKey);",
"@Test\n public void testUnwrapInvocationTargetExceptionWithoutCause() {\n InvocationTargetException iteWithoutCause = new InvocationTargetException(null);\n assertTrue(iteWithoutCause == ExceptionUtil.unwrapInvocationTargetException(iteWithoutCause));\n }",
"public void testIsInverse() {\n // Same as:\n testSetInverse();\n }",
"@Test\n public void testUnwrapInvocationTargetExceptionWithCause() {\n RuntimeException rte = new RuntimeException();\n InvocationTargetException iteWithCause = new InvocationTargetException(rte);\n assertTrue(rte == ExceptionUtil.unwrapInvocationTargetException(iteWithCause));\n }",
"@NonNull\n OutputStream unwrap() throws IOException;",
"public static Expression unwrap( Expression expr ) {\n\tType etype = ExpressionInternal.class.cast(expr).type() ;\n\n\tif (etype.equals( _t(\"java.lang.Boolean\")))\n\t return _call( expr, \"booleanValue\", _s(_boolean()) ) ;\n\telse if (etype.equals( _t(\"java.lang.Byte\") ))\n\t return _call( expr, \"byteValue\", _s(_byte()) ) ;\n\telse if (etype.equals( _t(\"java.lang.Character\") ))\n\t return _call( expr, \"charValue\", _s(_char()) ) ;\n\telse if (etype.equals( _t(\"java.lang.Short\") ))\n\t return _call( expr, \"shortValue\", _s(_short()) ) ;\n\telse if (etype.equals( _t(\"java.lang.Integer\") ))\n\t return _call( expr, \"intValue\", _s(_int()) ) ;\n\telse if (etype.equals( _t(\"java.lang.Long\") ))\n\t return _call( expr, \"longValue\", _s(_long()) ) ;\n\telse if (etype.equals( _t(\"java.lang.Float\") ))\n\t return _call( expr, \"floatValue\", _s(_float()) ) ;\n\telse if (etype.equals( _t(\"java.lang.Double\") ))\n\t return _call( expr, \"doubleValue\", _s(_double()) ) ;\n\telse return expr ;\n }",
"private Object unwrapComponent(Component wrapper) {\n return wrapper.instance == NULL_COMPONENT ? null : wrapper.instance;\n }",
"public static <T> T unwrap(final Future<T> future) {\n try {\n return future.get();\n }\n catch (final InterruptedException e) {\n e.fillInStackTrace();\n throw new MongoDbException(e);\n }\n catch (final ExecutionException e) {\n final Throwable cause = e.getCause();\n cause.fillInStackTrace();\n if (cause instanceof MongoDbException) {\n throw (MongoDbException) cause;\n }\n throw new MongoDbException(cause);\n }\n }",
"@Test\n public void canonicalTestWithStub() {\n TestedObject tested = new TestedObject(new CollaboratorStub());\n assertEquals(420, tested.computeSomething());\n }",
"public static Connection unwrapConnection(Connection connection) {\n try {\n if (c3poField != null) {\n if (connection.getClass().getName().equals(\"com.mchange.v2.c3p0.impl.NewProxyConnection\")) {\n return (Connection) c3poField.get(connection);\n }\n }\n\n try {\n // unwrap the connection to cache the underlying actual connection and to not cache proxy\n // objects\n if (connection.isWrapperFor(Connection.class)) {\n connection = connection.unwrap(Connection.class);\n }\n } catch (Exception | AbstractMethodError e) {\n if (connection != null) {\n // Attempt to work around c3po delegating to an connection that doesn't support\n // unwrapping.\n Class<? extends Connection> connectionClass = connection.getClass();\n if (connectionClass.getName().equals(\"com.mchange.v2.c3p0.impl.NewProxyConnection\")) {\n Field inner = connectionClass.getDeclaredField(\"inner\");\n inner.setAccessible(true);\n c3poField = inner;\n return (Connection) c3poField.get(connection);\n }\n }\n\n // perhaps wrapping isn't supported?\n // ex: org.h2.jdbc.JdbcConnection v1.3.175\n // or: jdts.jdbc which always throws `AbstractMethodError` (at least up to version 1.3)\n // Stick with original connection.\n }\n } catch (Throwable e) {\n // Had some problem getting the connection.\n logger.log(FINE, \"Could not unwrap connection\", e);\n return null;\n }\n return connection;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Populate the room spinner | private void populateRooms() {
ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this,
android.R.layout.simple_spinner_item, roomList);
dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
rooms.setAdapter(dataAdapter);
} | [
"private void setSpinnerRoom() {\r\n List<String> ids = new ArrayList<>();\r\n for (Room room : roomsSelected) { //On parcourt les pièces sélectionnées\r\n ids.add(room.getName()); //On récupère le nom des pièces\r\n }\r\n ArrayAdapter<String> arrayAdapter = new ArrayAdapter<>(this,R.layout.spinner_item, ids);// On remplit le spinner avec les noms\r\n spinnerRoom.setAdapter(arrayAdapter);\r\n\r\n }",
"private void populateInroom() {\r\n\t\tArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this,\r\n\t\t\t\tandroid.R.layout.simple_spinner_item, inRoomList);\r\n\t\tdataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\r\n\t\tinrooms.setAdapter(dataAdapter);\r\n\t}",
"private void fillLeagueSpinner() {\n\t\tCursor cursor = dbHelper.fetchLeaguesForBowler(bowler);\n\t\tstartManagingCursor(cursor);\n\t\t\n\t\tString[] from = new String[] {BowlerDatabaseAdapter.KEY_LEAGUE_NAME};\n\t\tint[] to = new int[] {android.R.id.text1};\n\t\t\n\t\tSimpleCursorAdapter leagues = new SimpleCursorAdapter(this, R.layout.spinnertext, cursor, from, to);\n\t\tleagues.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n\t\t\n\t\tleagueSpinner.setAdapter(leagues);\n\t}",
"private void loadSpinnerData() {\n\n Log.i(TAG, \"esta a loudar o spinner\");\n // Chamar o building da spinnerbuilding para aqui\n Intent intent = getIntent();\n Log.i(TAG, \"intent room \"+ intent);\n //Bundle extras = intent.getExtras();\n String buildingName = intent.getStringExtra(ROOM_EXTRA);\n Log.i(TAG, \"Room Activity - \" + buildingName);\n\n // Spinner Drop down elements - fazer o bundle no spinnerbuilding para passar a string para aqui\n\n List<String> lables = RoomController.loadAllRooms(buildingName);\n\n\n // Creating adapter for spinner\n ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this,\n android.R.layout.simple_spinner_item, lables);\n\n // Drop down layout style - list view with radio button\n dataAdapter\n .setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n\n // attaching data adapter to spinner\n spinner.setAdapter(dataAdapter);\n\n Log.i(TAG,\"loadSpinner\");\n }",
"private void populateSpinners(){\n Spinner Race_spinner = (Spinner) findViewById(R.id.spinner_search_race);\n ArrayAdapter<CharSequence> RaceAdapter = ArrayAdapter\n .createFromResource(this, R.array.Races,\n android.R.layout.simple_spinner_item);\n RaceAdapter.setDropDownViewResource(R.layout.spinner_layout_dropdown);\n Race_spinner.setAdapter(RaceAdapter);\n\n //Populate Race Spinner\n Spinner Alignment_spinner = (Spinner) findViewById(R.id.spinner_search_alignment);\n ArrayAdapter<CharSequence> AlignmentAdapter = ArrayAdapter\n .createFromResource(this, R.array.Alignments,\n android.R.layout.simple_spinner_item);\n AlignmentAdapter.setDropDownViewResource(R.layout.spinner_layout_dropdown);\n Alignment_spinner.setAdapter(AlignmentAdapter);\n }",
"private void floorSet() {\n chooseFloor.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {\n roomName.setVisibility(View.INVISIBLE);\n\n //set floor choice\n floorNumber = ((TextView) view).getText().toString();\n\n //Clearing room variable\n rmName = \"\";\n\n if (floorNumber.equals(\"Choose a floor\")) {\n floorplanname.setText(fpname);\n //Disable Room spinner\n chooseRoom.setSelection(0,true);\n chooseRoom.setEnabled(false);\n chooseRoom.setClickable(false);\n return;\n }\n\n chooseRoom.setEnabled(true);\n chooseRoom.setClickable(true);\n\n floorselected = Integer.parseInt(floorNumber);\n\n //Flag reset for setup function\n fromSearch = 0;\n setRoomfromSearch = 0;\n //Sets new floorplan name\n imageName = fpname.toLowerCase().replaceAll(\"\\\\s\", \"\") + floorNumber;\n //Creates new layout based on new floor #\n setup();\n\n chooseFloor.setSelection(floorselected,true);\n chooseFloor.setSelected(true);\n\n spinner2drop.setVisibility(View.VISIBLE);\n chooseRoom.setVisibility(View.VISIBLE);\n roomspinnerprompt.setVisibility(View.VISIBLE);\n\n List<String> spinnerArray = new ArrayList<String>();\n spinnerArray.add(\"Choose a room\");\n for(int j = 0; j < data.numberofBuildings; ++j) {\n for(int k = 0; k < data.buildings.get(j).floors.size(); ++k) {\n if(buildingselected == (j + 1) && data.buildings.get(j).floors.get(k).level == floorselected) {\n for(int m = 0; m < data.buildings.get(j).floors.get(k).rooms.size(); ++m) {\n spinnerArray.add(data.buildings.get(j).floors.get(k).rooms.get(m).roomName);\n }\n ArrayAdapter<String> adapter = new ArrayAdapter<String>(floorplan.this, R.layout.spinner_layout, spinnerArray);\n adapter.setDropDownViewResource(R.layout.spinner_dropdown_layout);\n chooseRoom.setAdapter(adapter);\n break;\n }\n }\n }\n chooseRoom.setSelected(false);\n chooseRoom.setSelection(0,true);\n\n select();\n\n //Resets floor spinner listener\n floorSet();\n }\n @Override\n public void onNothingSelected(AdapterView<?> adapterView) {}\n });\n }",
"private void spinnerSet() {\n List<String> gen_algo = new ArrayList<String>();\n gen_algo.add(DFS);\n gen_algo.add(Prim);\n gen_algo.add(Eller);\n ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.spinner_item, gen_algo);\n adapter.setDropDownViewResource(R.layout.spinner_item);\n gen_spinner.setAdapter(adapter);\n List<String> drv_algo = new ArrayList<String>();\n drv_algo.add(Manual);\n drv_algo.add(WallF);\n drv_algo.add(Wiz);\n drv_algo.add(Expl);\n drv_algo.add(Pledge);\n ArrayAdapter<String> adapter1 = new ArrayAdapter<String>(this, R.layout.spinner_item, drv_algo);\n adapter1.setDropDownViewResource(R.layout.spinner_item);\n driver_spinner.setAdapter(adapter1);\n }",
"public void populateSpinner() {\r\n ArrayList<String> ary = new ArrayList<>();\r\n\r\n ary.add(\"Male\");\r\n ary.add(\"Female\");\r\n\r\n ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.support_simple_spinner_dropdown_item, ary);\r\n\r\n adapter.setDropDownViewResource(R.layout.support_simple_spinner_dropdown_item);\r\n Gender.setAdapter(adapter);\r\n }",
"private void loadAMPMSpinner(){\n List<String> ampm = new ArrayList<String>();\n ampm.add(\"AM\");\n ampm.add(\"PM\");\n ArrayAdapter<String> a = new ArrayAdapter<String>(\n this, android.R.layout.simple_spinner_item, ampm);\n a.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n ampmSpinner.setAdapter(a);\n }",
"private void loadSpinnerData() {\n\n // Spinner Drop down elements\n areas = dbHendler.getAllAreas();\n for (Area area : areas) {\n String singleitem = area.get_areaName();\n items.add(singleitem);\n }\n\n // Creating adapter for spinnerArea\n ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, items);\n\n // Drop down layout style - list view with radio button\n dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n\n // attaching data adapter to spinnerArea\n spinner.setAdapter(dataAdapter);\n }",
"private void populateSpinner() {\n mSpinner = (Spinner) view.findViewById(R.id.device_spinner);\n mSpinner.setOnItemSelectedListener(new OnItemSelectedListener() {\n\n /*\n * Selects\n */\n @Override\n public void onItemSelected(AdapterView<?> parent, View view,\n int pos, long id) {\n String selection = (String) parent.getItemAtPosition(pos);\n if (DEBUG_MODE)\n Log.i(\"DATA_VALIDATION\", \"The value of selection in \"\n + \"setOnItemSelectedListener is: \" + selection);\n String[] info = selection.split(\"\\\\r?\\\\n\");\n deviceMAC = info[1];\n Toast.makeText(getActivity(), \"You chose \" + deviceMAC,\n Toast.LENGTH_SHORT).show();\n }\n\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n // nothing to see here!\n }\n });\n ArrayAdapter<String> adapter = this.getPairedDevices();\n adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n mSpinner.setAdapter(adapter);\n }",
"private void loadSpinnerData() {\n // database handler\n DatabaseHandler db = new DatabaseHandler(getApplicationContext());\n db.addDefaultUnit();\n // Spinner Drop down elements\n List<String> lables = db.getAllUnits();\n \n // Creating adapter for spinner\n ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this,\n android.R.layout.simple_spinner_item, lables);\n \n // Drop down layout style - list view with radio button\n dataAdapter\n .setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n \n // attaching data adapter to spinner\n spinner.setAdapter(dataAdapter);\n }",
"public void fillSpinner() {\n Call<List<GenereData>> call = ApiController.getInstance(apiBaseUrl.getBaseUrlJava()).getapi().allGeners();\n call.enqueue(new Callback<List<GenereData>>() {\n @Override\n public void onResponse(Call<List<GenereData>> call, Response<List<GenereData>> response) {\n if (response.code() != 200 || !(response.isSuccessful())) {\n Intent i = new Intent(SearchActivity.this, ErrorHandled.class);\n i.putExtra(\"activity\", \"Srcact\");\n i.putExtra(\"cd\", String.valueOf(response.code()));\n startActivity(i);\n } else {\n List<GenereData> obj = response.body();\n genereAr.add(\"All\");\n for (GenereData name : obj)\n genereAr.add(StringUtils.capitalize(name.getName()));\n spinneradapter = new ArrayAdapter(SearchActivity.this, android.R.layout.simple_list_item_1, genereAr);\n spinneradapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n spinner.setAdapter(spinneradapter);\n }\n }\n\n @Override\n public void onFailure(Call<List<GenereData>> call, Throwable t) {\n Toast.makeText(SearchActivity.this, \"Sorry, something went wrong\", Toast.LENGTH_LONG).show();\n }\n });\n try {\n Thread.sleep(3000);\n } catch (InterruptedException ex) {\n Thread.currentThread().interrupt();\n }\n spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n genereSelected = genereAr.get(position);\n }\n\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n\n }\n });\n }",
"private void fillNameSpinner() {\n\t\tCursor cursor = dbHelper.fetchAllNames();\n\t\tstartManagingCursor(cursor);\n\t\t\n\t\tString[] from = new String[] {BowlerDatabaseAdapter.KEY_NAME};\n\t\tint[] to = new int[] {android.R.id.text1};\n\t\t\n\t\tSimpleCursorAdapter names = new SimpleCursorAdapter(this, R.layout.spinnertext, cursor, from, to);\n\t\tnames.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n\t\t\n\t\tnameSpinner.setAdapter(names);\n\t}",
"private void populateSpinner() {\n // setup spinner configurations\n spinner.setAdapter(null); // make sure spinner is empty\n alSpinnerItems.clear(); // make sure arrayList is empty\n\n alSpinnerItems.add(\"0%\");\n alSpinnerItems.add(\"1%\");\n alSpinnerItems.add(\"2%\");\n alSpinnerItems.add(\"3%\");\n alSpinnerItems.add(\"4%\");\n alSpinnerItems.add(\"5% Poor\");\n alSpinnerItems.add(\"6%\");\n alSpinnerItems.add(\"7%\");\n alSpinnerItems.add(\"8%\");\n alSpinnerItems.add(\"9%\");\n alSpinnerItems.add(\"10% Fair\");\n alSpinnerItems.add(\"11%\");\n alSpinnerItems.add(\"12%\");\n alSpinnerItems.add(\"13%\");\n alSpinnerItems.add(\"14%\");\n alSpinnerItems.add(\"15% Good!\");\n alSpinnerItems.add(\"16%\");\n alSpinnerItems.add(\"17%\");\n alSpinnerItems.add(\"18%\");\n alSpinnerItems.add(\"19%\");\n alSpinnerItems.add(\"20% Great!\");\n alSpinnerItems.add(\"21%\");\n alSpinnerItems.add(\"22%\");\n alSpinnerItems.add(\"23%\");\n alSpinnerItems.add(\"24%\");\n alSpinnerItems.add(\"25% Royal!\");\n alSpinnerItems.add(\"26%\");\n alSpinnerItems.add(\"27%\");\n alSpinnerItems.add(\"28%\");\n alSpinnerItems.add(\"29%\");\n alSpinnerItems.add(\"30%\");\n\n // create ArrayAdapter\n ArrayAdapter<String> arrayAdapter = new ArrayAdapter<>(\n MainActivity.this, android.R.layout.simple_spinner_item,\n alSpinnerItems);\n // set array adapter\n arrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n\n // setup adapter\n spinner.setAdapter(arrayAdapter);\n spinner.setSelection(mSharedPref.getIntPref(Constants.KEY_DEFAULT_TIP, 15));\n spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n\n @SuppressLint({\"StringFormatInvalid\", \"StringFormatMatches\"})\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {\n mTipPercent = spinner.getSelectedItemPosition();\n if (mTipPercent >= 0 && mTipPercent <= 2) {\n setRating(1, true);\n tvService.setTextColor(ContextCompat.getColor(MainActivity.this, R.color.material_red_400_color_code));\n Crouton.showText(MainActivity.this, getResources().getString(R.string.txt_poor_tip_service), Style.ALERT);\n } else if (mTipPercent >= 3 && mTipPercent <= 4) {\n setRating(1, true);\n tvService.setTextColor(ContextCompat.getColor(MainActivity.this, R.color.material_red_400_color_code));\n Crouton.showText(MainActivity.this, getResources().getString(R.string.txt_poor_tip_service), Style.ALERT);\n } else if (mTipPercent >= 5 && mTipPercent <= 7) {\n setRating(1, true);\n tvService.setTextColor(ContextCompat.getColor(MainActivity.this, R.color.material_red_400_color_code));\n Crouton.showText(MainActivity.this, getResources().getString(R.string.txt_poor_tip_service), Style.ALERT);\n } else if (mTipPercent >= 8 && mTipPercent <= 9) {\n setRating(1, true);\n tvService.setTextColor(ContextCompat.getColor(MainActivity.this, R.color.material_red_400_color_code));\n Crouton.showText(MainActivity.this, getResources().getString(R.string.txt_poor_tip_service), Style.ALERT);\n } else if (mTipPercent >= 10 && mTipPercent <= 12) {\n setRating(2, true);\n tvService.setTextColor(ContextCompat.getColor(MainActivity.this, R.color.white));\n Crouton.showText(MainActivity.this, getResources().getString(R.string.txt_fair_tip_service), Style.CONFIRM);\n } else if (mTipPercent >= 13 && mTipPercent <= 14) {\n setRating(2, true);\n tvService.setTextColor(ContextCompat.getColor(MainActivity.this, R.color.white));\n Crouton.showText(MainActivity.this, getResources().getString(R.string.txt_fair_tip_service), Style.CONFIRM);\n } else if (mTipPercent >= 15 && mTipPercent <= 17) {\n setRating(3, true);\n tvService.setTextColor(ContextCompat.getColor(MainActivity.this, R.color.white));\n Crouton.showText(MainActivity.this, getResources().getString(R.string.txt_good_tip_service), Style.CONFIRM);\n } else if (mTipPercent >= 18 && mTipPercent <= 19) {\n setRating(3, true);\n tvService.setTextColor(ContextCompat.getColor(MainActivity.this, R.color.white));\n Crouton.showText(MainActivity.this, getResources().getString(R.string.txt_good_tip_service), Style.CONFIRM);\n } else if (mTipPercent >= 20 && mTipPercent <= 22) {\n setRating(4, true);\n tvService.setTextColor(ContextCompat.getColor(MainActivity.this, R.color.white));\n Crouton.showText(MainActivity.this, getResources().getString(R.string.txt_great_tip_service), Style.CONFIRM);\n } else if (mTipPercent >= 23 && mTipPercent <= 24) {\n setRating(4, true);\n tvService.setTextColor(ContextCompat.getColor(MainActivity.this, R.color.white));\n Crouton.showText(MainActivity.this, getResources().getString(R.string.txt_great_tip_service), Style.CONFIRM);\n } else if (mTipPercent >= 25) {\n setRating(5, true);\n tvService.setTextColor(ContextCompat.getColor(MainActivity.this, R.color.material_purple_500_color_code));\n Crouton.showText(MainActivity.this, getResources().getString(R.string.txt_royal_tip_service), Style.INFO);\n }\n tvService.setText(Utils.getTipQuality(MainActivity.this, mTipPercent));\n tvPercent.setText(getResources().getString(R.string.txt_percent, mTipPercent));\n calculate();\n }\n\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n // do nothing\n }\n });\n }",
"public void addItemsOnSpinner() {\n Data dataset = new Data(getApplicationContext());\n List<String> list = new ArrayList<String>();\n list = dataset.getClasses();\n ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, list);\n dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n spinner.setAdapter(dataAdapter);\n }",
"public void initCourseSpinner(){\n courseSpinner.setPrompt(\"Choose course\");\n List<String> coursesInSpinner = new ArrayList<>();\n for(Course c : CourseRepository.getCourseRepository().getAllCourses()) {\n allCourses.add(c);\n coursesInSpinner.add(c.getCourseID());\n }\n ArrayAdapter<String> adapter = new ArrayAdapter<String>(mRootView.getContext(), android.R.layout.simple_spinner_item, coursesInSpinner);\n courseSpinner.setAdapter(adapter);\n }",
"private void makeSpinner() {\n Spinner spinner = (Spinner) findViewById(R.id.locations_spinner);\n\n // Create an ArrayAdapter using the string array and a default spinner layout\n ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this,\n R.array.locations_array, android.R.layout.simple_spinner_item);\n\n // Specify the layout to use when the list of choices appears\n adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n\n // Apply the adapter to the spinner\n spinner.setAdapter(adapter);\n\n spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n String[] locations = getResources().getStringArray(R.array.locations_array);\n currentLocation = locations[position];\n }\n\n @Override\n public void onNothingSelected(AdapterView<?> parent) {}\n });\n }",
"private void spinnerSetup() {\n // Sex Spinner\n Spinner sexSpinner = (Spinner) findViewById(R.id.sexSpinner);\n ArrayAdapter<CharSequence> sexAdapter = ArrayAdapter.createFromResource(this,\n R.array.sexes, android.R.layout.simple_spinner_item);\n sexAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n sexSpinner.setAdapter(sexAdapter);\n sexSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n currentSex = parent.getItemAtPosition(position).toString();\n Toast.makeText(DetailedShoeDisplay.this, \"Sex: \" + currentSex, Toast.LENGTH_SHORT).show();\n availabilityUpdate();\n }\n\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n\n }\n });\n\n // Country Spinner\n Spinner countrySpinner = (Spinner) findViewById(R.id.countrySpinner);\n ArrayAdapter<CharSequence> countryAdapter = ArrayAdapter.createFromResource(this,\n R.array.countries, android.R.layout.simple_spinner_item);\n countryAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n countrySpinner.setAdapter(countryAdapter);\n countrySpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n currentCountry = parent.getItemAtPosition(position).toString();\n currentCountryIndex = position;\n Toast.makeText(DetailedShoeDisplay.this, \"Country: \" + currentCountry, Toast.LENGTH_SHORT).show();\n availabilityUpdate();\n }\n\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n\n }\n });\n\n // Size Spinner\n Spinner sizeSpinner = (Spinner) findViewById(R.id.sizeSpinner);\n ArrayAdapter<CharSequence> sizeAdapter = ArrayAdapter.createFromResource(this,\n R.array.sizes, android.R.layout.simple_spinner_item);\n sizeAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n sizeSpinner.setAdapter(sizeAdapter);\n sizeSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n currentSize = parent.getItemAtPosition(position).toString();\n Toast.makeText(DetailedShoeDisplay.this, \"Size: \" + currentSize, Toast.LENGTH_SHORT).show();\n availabilityUpdate();\n }\n\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n\n }\n });\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
POST /merchants : Create a new merchant. | @PostMapping("/merchants")
@Timed
public ResponseEntity<Merchant> createMerchant(@Valid @RequestBody MerchantDTO merchantDTO) throws URISyntaxException {
log.debug("REST request to save Merchant : {}", merchantDTO);
Merchant result = merchantRepository.save(merchantDTO.toMerchant());
merchantSearchRepository.save(result);
return ResponseEntity.created(new URI("/api/merchants/" + result.getId()))
.headers(HeaderUtil.createEntityCreationAlert("merchant", result.getId().toString()))
.body(result);
} | [
"@RequestMapping(value = \"/provideMerchants\",\n method = RequestMethod.POST,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public ResponseEntity<ProvideMerchant> createProvideMerchant(@RequestBody ProvideMerchant provideMerchant) throws URISyntaxException {\n log.debug(\"REST request to save ProvideMerchant : {}\", provideMerchant);\n if (provideMerchant.getId() != null) {\n return ResponseEntity.badRequest().headers(HeaderUtil.createFailureAlert(\"provideMerchant\", \"idexists\", \"A new provideMerchant cannot already have an ID\")).body(null);\n }\n ProvideMerchant result = provideMerchantRepository.save(provideMerchant);\n return ResponseEntity.created(new URI(\"/api/provideMerchants/\" + result.getId()))\n .headers(HeaderUtil.createEntityCreationAlert(\"provideMerchant\", result.getId().toString()))\n .body(result);\n }",
"@PostMapping(value= \"/saveAll\")\n\tpublic String saveMerchant(@RequestBody List<Merchant> merchants) {\n\t\tmerchantService.saveAllMerchants(merchants);\n\t\treturn \"Records saved in the db.\";\n\t}",
"public MerchantType addMerchant(LscUserContext userContext, String merchantTypeId, String name, String platformId, String description , String [] tokensExpr) throws Exception;",
"public ObjectNode addMerchantService(int uniqueID){\n OntClass merchant = ontReasoned.getOntClass(NS + \"Merchant\");\n Individual merchant1 = ontReasoned.createIndividual(NS + uniqueID, merchant);\n ObjectMapper mapper = new ObjectMapper();\n ObjectNode objectNode1 = mapper.createObjectNode();\n objectNode1.put(\"status:\", \"success\");\n return objectNode1;\n }",
"@RequestMapping(value = \"\", method = RequestMethod.POST)\n public Seller addSeller(@RequestParam(value = \"name\") String name,\n @RequestParam(value = \"email\") String email,\n @RequestParam(value = \"phoneNumber\") String phoneNumber,\n @RequestParam(value = \"province\") String province,\n @RequestParam(value = \"description\") String description,\n @RequestParam(value = \"city\") String city)\n {\n Location location = new Location(city, province, description);\n Seller newseller = new Seller(DatabaseSeller.getLastid()+1, name, email, phoneNumber, location);\n DatabaseSeller.addSeller(newseller);\n return newseller;\n }",
"@GetMapping(\"/merchants/{merchantId}\")\n public Optional<Merchant> getMerchant(@PathVariable String merchantId) {\n return merchantRepository.findById(merchantId);\n }",
"public SiloCreateMerchantGenerator()\n {\n m_pciMerchant = new SiloConfigPCIMerchant();\n }",
"@POST\n @Path(\"create/mandate\")\n @Consumes(MediaType.APPLICATION_JSON)\n @Produces(MediaType.APPLICATION_JSON) \n public Mock createMandate(MandateCreationObject payload) throws SOAPException, IOException, MalformedURLException, JSONException, NoSuchAlgorithmException, KeyManagementException{\n return mock;\n }",
"public Long getMerchantId()\n {\n return merchantId;\n }",
"@GetMapping(\"/merchants/{id}\")\n @Timed\n public ResponseEntity<Merchant> getMerchant(@PathVariable Long id) {\n log.debug(\"REST request to get Merchant : {}\", id);\n Merchant merchant = merchantRepository.findOne(id);\n return Optional.ofNullable(merchant)\n .map(result -> new ResponseEntity<>(\n result,\n HttpStatus.OK))\n .orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND));\n }",
"public String getMerchantId() {\r\n return merchantId;\r\n }",
"public String getMerchantId() {\n return merchantId;\n }",
"public String getMerchant() {\n return merchant;\n }",
"@Test\n public void createOrUpdateFattMerchantPaymentMethodTest() throws ApiException {\n FattMerchantPaymentMethodRequest request = null;\n PaymentMethodResource response = api.createOrUpdateFattMerchantPaymentMethod(request);\n\n // TODO: test validations\n }",
"@POST\n @Path(\"payments/create\")\n @Consumes(MediaType.APPLICATION_FORM_URLENCODED)\n Payment createPayment(\n @HeaderParam(\"X-Auth-Token\") String authToken,\n @HeaderParam(\"User-Agent\") String userAgent,\n @FormParam(\"currency\") String currency,\n @FormParam(\"beneficiary_id\") String beneficiaryId,\n @FormParam(\"amount\") BigDecimal amount,\n @FormParam(\"reason\") String reason,\n @FormParam(\"reference\") String reference,\n @Nullable @FormParam(\"on_behalf_of\") String onBehalfOf,\n @Nullable @FormParam(\"payment_date\") java.sql.Date paymentDate,\n @Nullable @FormParam(\"payment_type\") String paymentType,\n @Nullable @FormParam(\"conversion_id\") String conversionId,\n @Nullable @FormParam(\"payer_entity_type\") String payerEntityType,\n @Nullable @FormParam(\"payer_company_name\") String payerCompanyName,\n @Nullable @FormParam(\"payer_first_name\") String payerFirstName,\n @Nullable @FormParam(\"payer_last_name\") String payerLastName,\n @Nullable @FormParam(\"payer_address\") String payerAddress,\n @Nullable @FormParam(\"payer_city\") String payerCity,\n @Nullable @FormParam(\"payer_country\") String payerCountry,\n @Nullable @FormParam(\"payer_postcode\") String payerPostcode,\n @Nullable @FormParam(\"payer_state_or_province\") String payerStateOrProvince,\n @Nullable @FormParam(\"payer_date_of_birth\") java.sql.Date payerDateOfBirth,\n @Nullable @FormParam(\"payer_identification_type\") String payerIdentificationType,\n @Nullable @FormParam(\"payer_identification_value\") String payerIdentificationValue,\n @Nullable @FormParam(\"unique_request_id\") String uniqueRequestId,\n @Nullable @FormParam(\"ultimate_beneficiary_name\") String ultimateBeneficiaryName,\n @Nullable @FormParam(\"purpose_code\") String purposeCode,\n @Nullable @FormParam(\"charge_type\") String chargeType,\n @Nullable @FormParam(\"fee_amount\") BigDecimal feeAmount,\n @Nullable @FormParam(\"fee_currency\") String feeCurrency,\n @Nullable @FormParam(\"invoice_date\") java.sql.Date invoiceDate,\n @Nullable @FormParam(\"invoice_number\") String invoiceNumber\n ) throws ResponseException;",
"public Long getMerchantId() {\n return merchantId;\n }",
"public void create(CreateTenant ct) {\n // TODO\n }",
"@RequestMapping(value = \"/plantmcs\",\n method = RequestMethod.POST,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public ResponseEntity<Void> create(@Valid @RequestBody Plantmc plantmc) throws URISyntaxException {\n log.debug(\"REST request to save Plantmc : {}\", plantmc);\n if (plantmc.getId() != null) {\n return ResponseEntity.badRequest().header(\"Failure\", \"A new plantmc cannot already have an ID\").build();\n }\n plantmcRepository.save(plantmc);\n return ResponseEntity.created(new URI(\"/api/plantmcs/\" + plantmc.getId())).build();\n }",
"@RequestMapping(value = \"/provideMerchants\",\n method = RequestMethod.PUT,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public ResponseEntity<ProvideMerchant> updateProvideMerchant(@RequestBody ProvideMerchant provideMerchant) throws URISyntaxException {\n log.debug(\"REST request to update ProvideMerchant : {}\", provideMerchant);\n if (provideMerchant.getId() == null) {\n return createProvideMerchant(provideMerchant);\n }\n ProvideMerchant result = provideMerchantRepository.save(provideMerchant);\n return ResponseEntity.ok()\n .headers(HeaderUtil.createEntityUpdateAlert(\"provideMerchant\", provideMerchant.getId().toString()))\n .body(result);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes the ith "Userfield" element | public void removeUserField(int i)
{
synchronized (monitor())
{
check_orphaned();
get_store().remove_element(USERFIELD$0, i);
}
} | [
"public Object removeField( Object n );",
"void removeField(String name) throws JSONException;",
"public void removeAllField()\n {\n _fieldList.removeAllElements();\n }",
"private UserRemove() {\n initFields();\n }",
"public void unsetFields()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_element(FIELDS$20, 0);\r\n }\r\n }",
"public void removeUserObj()\n\t{\n\t\tuserObj = null;\n\t}",
"public void unsetFieldValue()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(FIELDVALUE$2, 0);\n }\n }",
"public void removeUserObject(int i)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_element(USEROBJECT$0, i);\r\n }\r\n }",
"public void removePointsUser()\r\n {\r\n getSemanticObject().removeProperty(forumCat_pointsUser);\r\n }",
"public void removeUser(TList selectedUser);",
"public void removeFirstUser()\n\t{\n\t\tusers.remove(0);\n\t}",
"public final void removeField(String name) {\n Iterator<IndexableField> it = fields.iterator();\n while (it.hasNext()) {\n IndexableField field = it.next();\n if (field.name().equals(name)) {\n it.remove();\n return;\n }\n }\n }",
"public void unsetUsername()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(USERNAME$0, 0);\n }\n }",
"public void unsetUsername()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(USERNAME$0, 0);\n }\n }",
"Object removeUserObject (Object key);",
"public AutomationRulesFindingFieldsUpdate clearUserDefinedFieldsEntries() {\n this.userDefinedFields = null;\n return this;\n }",
"@Override\n public void remove(String name) {\n List<FudgeField> list = super.getAllFields();\n\n for(int i = list.size(); i >= 0 ; i--)\n {\n if (list.get(i).getName() == name)\n super.getAllFields().remove(list.get(i));\n }\n }",
"void removeUser(User user);",
"public void removeField(String name) {\n fields.remove(name.toLowerCase());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CM11672 Total Obtain the allocatable case qty. | public long getTotalAllocateCaseQty()
{
return wTotalAllocateCaseQty;
} | [
"public long getAllocationCaseQty()\n\t{\n\t\treturn getBigDecimal(StockControlStock.ALLOCATION_CASE_QTY).longValue();\n\t}",
"public void setTotalAllocateCaseQty(long arg)\n\t{\n\t\twTotalAllocateCaseQty = arg;\n\t}",
"public long getTotalAllocatePieceQty()\n\t{\n\t\treturn wTotalAllocatePieceQty;\n\t}",
"public double totalQuantity() {\r\n\t\tdouble t = 0;\r\n\t\tfor(int i=0;i<boxes[0];i++)\r\n\t\t\tfor(int j=0;j<boxes[1];j++)\r\n\t\t\t\tfor(int k=0;k<boxes[2];k++) t += quantity[i][j][k];\r\n\t\treturn t;\r\n\t}",
"public int getAllocateCaseQty()\n\t{\n\t\treturn wAllocateCaseQty;\n\t}",
"public long getTotalStockCaseQty()\n\t{\n\t\treturn wTotalStockCaseQty;\n\t}",
"long getTotalQty();",
"public BigDecimal getTotalCargoQty();",
"public int getResultCaseQty()\n\t{\n\t\treturn wResultCaseQty;\n\t}",
"int calculateTotalCapacity();",
"public void setTotalAllocatePieceQty(long arg)\n\t{\n\t\twTotalAllocatePieceQty = arg;\n\t}",
"public java.math.BigDecimal getTotalCr () {\n\t\treturn totalCr;\n\t}",
"int getReservedQuantity();",
"public static int getTotalCases() {\n\t\treturn totalCases;\n\t}",
"public long getMntTotal()\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(MNTTOTAL$24, 0);\r\n if (target == null)\r\n {\r\n return 0L;\r\n }\r\n return target.getLongValue();\r\n }\r\n }",
"public Number getQty_Total() {\n return (Number) getAttributeInternal(QTY_TOTAL);\n }",
"public int totalAllocatedOrders();",
"public void setTotalCargoQty (BigDecimal TotalCargoQty);",
"public long getAllocationPieceQty()\n\t{\n\t\treturn getBigDecimal(StockControlStock.ALLOCATION_PIECE_QTY).longValue();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$ANTLR end "K_COUNT" $ANTLR start "K_SET" | public final void mK_SET() throws RecognitionException {
try {
int _type = K_SET;
int _channel = DEFAULT_TOKEN_CHANNEL;
// /Users/devdatta.kulkarni/Documents/Cassandra/apache-cassandra-0.8.6-src/src/java/org/apache/cassandra/cql/Cql.g:502:6: ( S E T )
// /Users/devdatta.kulkarni/Documents/Cassandra/apache-cassandra-0.8.6-src/src/java/org/apache/cassandra/cql/Cql.g:502:16: S E T
{
mS();
mE();
mT();
}
state.type = _type;
state.channel = _channel;
}
finally {
}
} | [
"Rule SetType() {\n // Push 1 SetTypeNode onto the value stack\n return Sequence(\n \"set \",\n Optional(CppType()),\n \"<\",\n FieldType(),\n \"> \",\n actions.pushSetTypeNode());\n }",
"public long getAllLiteralCount();",
"public final void mK() throws RecognitionException {\n try {\n // /Users/devdatta.kulkarni/Documents/Cassandra/apache-cassandra-0.8.6-src/src/java/org/apache/cassandra/cql/Cql.g:537:11: ( ( 'k' | 'K' ) )\n // /Users/devdatta.kulkarni/Documents/Cassandra/apache-cassandra-0.8.6-src/src/java/org/apache/cassandra/cql/Cql.g:537:13: ( 'k' | 'K' )\n {\n if ( input.LA(1)=='K'||input.LA(1)=='k' ) {\n input.consume();\n\n }\n else {\n MismatchedSetException mse = new MismatchedSetException(null,input);\n recover(mse);\n throw mse;}\n\n\n }\n\n }\n finally {\n }\n }",
"public final void term() throws Exception {\n\t\ttry {\n\t\t\t// C:\\\\Users\\\\Michael\\\\Documents\\\\Senior Design\\\\pseudoLanguage\\\\Language.g:158:6: ( ID | VALUE )\n\t\t\t// C:\\\\Users\\\\Michael\\\\Documents\\\\Senior Design\\\\pseudoLanguage\\\\Language.g:\n\t\t\t{\n\t\t\tif ( input.LA(1)==ID||input.LA(1)==VALUE ) {\n\t\t\t\tinput.consume();\n\t\t\t\tstate.errorRecovery=false;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tMismatchedSetException mse = new MismatchedSetException(null,input);\n\t\t\t\tthrow mse;\n\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\tcatch (RecognitionException re) {\n\t\t\treportError(re);\n\t\t\trecover(input,re);\n\t\t}\n\t\tfinally {\n\t\t\t// do for sure before leaving\n\t\t}\n\t}",
"public void Kset(int k)\n{\n\tthis.k=k;\n}",
"public SetAndCount(Set<String> set) {\n super();\n this.set.addAll(set);\n this.count = set.size();\n }",
"int getAbnfGrammarCount();",
"public void setCount(XPath v)\n {\n m_countMatchPattern = v;\n }",
"public abstract void setVarCount(int varCount);",
"Token fixSET( Token token) throws TokenStreamException\r\n {\r\n \r\n \t/* \r\n \t * This is bad... comments between = and . will get lost.\r\n \t * \r\n \t */\r\n MExprToken next = (MExprToken) getNextToken();\r\n while( next.getType() == MExprANTLRParserTokenTypes.WHITESPACE ||\r\n \t\tnext.getType() == MExprANTLRParserTokenTypes.COMMENT) {\r\n \tnext = (MExprToken) getNextToken();\r\n }\r\n \r\n if ( next.getType() != MExprANTLRParserTokenTypes.DOT) {\r\n \tpushToken( next);\r\n \treturn token;\r\n }\r\n \t\r\n \tMExprToken newToken = (MExprToken) makeToken(MExprANTLRParserTokenTypes.UNSET, \"=.\", token);\r\n \tnewToken.charEnd = next.getCharEnd();\r\n \treturn fixPostfix(\"UNSETXX\", MExprANTLRParserTokenTypes.UNSETINFIX,\r\n newToken);\r\n }",
"ValueCounts(int c, char v) {\n\t\tthis.count = c;\n\t\tthis.value = v;\n\t}",
"public void set(int symbol, int freq);",
"public int valueCount(K key);",
"public final void type() throws Exception {\n\t\ttry {\n\t\t\t// C:\\\\Users\\\\Michael\\\\Documents\\\\Senior Design\\\\pseudoLanguage\\\\Language.g:54:6: ( VAR | ARR )\n\t\t\t// C:\\\\Users\\\\Michael\\\\Documents\\\\Senior Design\\\\pseudoLanguage\\\\Language.g:\n\t\t\t{\n\t\t\tif ( input.LA(1)==ARR||input.LA(1)==VAR ) {\n\t\t\t\tinput.consume();\n\t\t\t\tstate.errorRecovery=false;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tMismatchedSetException mse = new MismatchedSetException(null,input);\n\t\t\t\tthrow mse;\n\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\tcatch (RecognitionException re) {\n\t\t\treportError(re);\n\t\t\trecover(input,re);\n\t\t}\n\t\tfinally {\n\t\t\t// do for sure before leaving\n\t\t}\n\t}",
"com.vitessedata.llql.llql_proto.LLQLQuery.SetOpOrBuilder getSetopOrBuilder();",
"SetExpression createSetExpression();",
"@Override\n public String toString() {\n return \"SetAndCount [count=\" + count + \", set=\" + set + \"]\";\n }",
"com.vitessedata.llql.llql_proto.LLQLQuery.SetOp getSetop();",
"public final CliParser.setStatement_return setStatement() throws RecognitionException {\n CliParser.setStatement_return retval = new CliParser.setStatement_return();\n retval.start = input.LT(1);\n\n CommonTree root_0 = null;\n\n Token SET116=null;\n Token char_literal118=null;\n Token WITH119=null;\n Token TTL120=null;\n Token char_literal121=null;\n CliParser.value_return objectValue = null;\n\n CliParser.value_return ttlValue = null;\n\n CliParser.columnFamilyExpr_return columnFamilyExpr117 = null;\n\n\n CommonTree SET116_tree=null;\n CommonTree char_literal118_tree=null;\n CommonTree WITH119_tree=null;\n CommonTree TTL120_tree=null;\n CommonTree char_literal121_tree=null;\n RewriteRuleTokenStream stream_SET=new RewriteRuleTokenStream(adaptor,\"token SET\");\n RewriteRuleTokenStream stream_86=new RewriteRuleTokenStream(adaptor,\"token 86\");\n RewriteRuleTokenStream stream_WITH=new RewriteRuleTokenStream(adaptor,\"token WITH\");\n RewriteRuleTokenStream stream_TTL=new RewriteRuleTokenStream(adaptor,\"token TTL\");\n RewriteRuleSubtreeStream stream_columnFamilyExpr=new RewriteRuleSubtreeStream(adaptor,\"rule columnFamilyExpr\");\n RewriteRuleSubtreeStream stream_value=new RewriteRuleSubtreeStream(adaptor,\"rule value\");\n try {\n // /home/kane/apache-cassandra-0.7.4-src/src/java/org/apache/cassandra/cli/Cli.g:247:5: ( SET columnFamilyExpr '=' objectValue= value ( WITH TTL '=' ttlValue= value )? -> ^( NODE_THRIFT_SET columnFamilyExpr $objectValue ( $ttlValue)? ) )\n // /home/kane/apache-cassandra-0.7.4-src/src/java/org/apache/cassandra/cli/Cli.g:247:7: SET columnFamilyExpr '=' objectValue= value ( WITH TTL '=' ttlValue= value )?\n {\n SET116=(Token)match(input,SET,FOLLOW_SET_in_setStatement1642); if (state.failed) return retval; \n if ( state.backtracking==0 ) stream_SET.add(SET116);\n\n pushFollow(FOLLOW_columnFamilyExpr_in_setStatement1644);\n columnFamilyExpr117=columnFamilyExpr();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) stream_columnFamilyExpr.add(columnFamilyExpr117.getTree());\n char_literal118=(Token)match(input,86,FOLLOW_86_in_setStatement1646); if (state.failed) return retval; \n if ( state.backtracking==0 ) stream_86.add(char_literal118);\n\n pushFollow(FOLLOW_value_in_setStatement1650);\n objectValue=value();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) stream_value.add(objectValue.getTree());\n // /home/kane/apache-cassandra-0.7.4-src/src/java/org/apache/cassandra/cli/Cli.g:247:50: ( WITH TTL '=' ttlValue= value )?\n int alt12=2;\n int LA12_0 = input.LA(1);\n\n if ( (LA12_0==WITH) ) {\n alt12=1;\n }\n switch (alt12) {\n case 1 :\n // /home/kane/apache-cassandra-0.7.4-src/src/java/org/apache/cassandra/cli/Cli.g:247:51: WITH TTL '=' ttlValue= value\n {\n WITH119=(Token)match(input,WITH,FOLLOW_WITH_in_setStatement1653); if (state.failed) return retval; \n if ( state.backtracking==0 ) stream_WITH.add(WITH119);\n\n TTL120=(Token)match(input,TTL,FOLLOW_TTL_in_setStatement1655); if (state.failed) return retval; \n if ( state.backtracking==0 ) stream_TTL.add(TTL120);\n\n char_literal121=(Token)match(input,86,FOLLOW_86_in_setStatement1657); if (state.failed) return retval; \n if ( state.backtracking==0 ) stream_86.add(char_literal121);\n\n pushFollow(FOLLOW_value_in_setStatement1661);\n ttlValue=value();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) stream_value.add(ttlValue.getTree());\n\n }\n break;\n\n }\n\n\n\n // AST REWRITE\n // elements: objectValue, columnFamilyExpr, ttlValue\n // token labels: \n // rule labels: retval, ttlValue, objectValue\n // token list labels: \n // rule list labels: \n // wildcard labels: \n if ( state.backtracking==0 ) {\n retval.tree = root_0;\n RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.tree:null);\n RewriteRuleSubtreeStream stream_ttlValue=new RewriteRuleSubtreeStream(adaptor,\"rule ttlValue\",ttlValue!=null?ttlValue.tree:null);\n RewriteRuleSubtreeStream stream_objectValue=new RewriteRuleSubtreeStream(adaptor,\"rule objectValue\",objectValue!=null?objectValue.tree:null);\n\n root_0 = (CommonTree)adaptor.nil();\n // 248:9: -> ^( NODE_THRIFT_SET columnFamilyExpr $objectValue ( $ttlValue)? )\n {\n // /home/kane/apache-cassandra-0.7.4-src/src/java/org/apache/cassandra/cli/Cli.g:248:12: ^( NODE_THRIFT_SET columnFamilyExpr $objectValue ( $ttlValue)? )\n {\n CommonTree root_1 = (CommonTree)adaptor.nil();\n root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(NODE_THRIFT_SET, \"NODE_THRIFT_SET\"), root_1);\n\n adaptor.addChild(root_1, stream_columnFamilyExpr.nextTree());\n adaptor.addChild(root_1, stream_objectValue.nextTree());\n // /home/kane/apache-cassandra-0.7.4-src/src/java/org/apache/cassandra/cli/Cli.g:248:60: ( $ttlValue)?\n if ( stream_ttlValue.hasNext() ) {\n adaptor.addChild(root_1, stream_ttlValue.nextTree());\n\n }\n stream_ttlValue.reset();\n\n adaptor.addChild(root_0, root_1);\n }\n\n }\n\n retval.tree = root_0;}\n }\n\n retval.stop = input.LT(-1);\n\n if ( state.backtracking==0 ) {\n\n retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);\n adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);\n }\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n \tretval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);\n\n }\n finally {\n }\n return retval;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Write header into baos | private static void writeHeader(ByteArrayOutputStream baos, int length,
int address) throws Exception
{
// write header and datablock into baos
if (debugMode)
System.out.println("Write Header: Length: " + length +
" (0x" + Integer.toHexString(length).toUpperCase() +
") Address: 0x" +
Integer.toHexString(address).toUpperCase());
// write length
baos.write(IntToFixedByteArray(length,3));
// write address
baos.write(IntToFixedByteArray(address,3));
} | [
"public void write(CCompatibleOutputStream os) throws Exception {\n header.write(os);\n super.write(os);\n }",
"private void writeHEADER() throws IOException {\n\t\tmeta.compute_checksum();\n\t\tmeta.write();\n\t\t\n\t\t// We could also generate a non-aldus metafile :\n\t\t// writeClipboardHeader(meta);\n\t\t\n\t\t// Generate the standard header common to all metafiles.\n\t\thead.write();\n\t}",
"protected void writeHeader() throws IOException, ValidationException, ConversionException{\n\n List<String> header = getHeader();\n writer.writeNext(header.toArray(new String[header.size()]));\n writer.flush();\n headerWritten = true;\n }",
"ByteBuf writeHeader(ByteBuf header, CodecRegistration codec, ByteBuf data);",
"public static void writeHeader(DataOutput dos,SpectrumHeader spectrumHeader) throws IOException {\n\n\t\tdos.write(fileSignature);\n\t\tdos.writeInt(spectrumHeader.k);\n\t\tdos.writeLong(spectrumHeader.nkmers);\n\t}",
"public void writeHeader(String header) throws IOException {\n write(header + \"\\r\\n\");\n }",
"private void writeHeader() throws IOException {\n\t\t\tfinal RandomAccessOutputStream output = getStream();\n\t\t\toutput.order(true);\n\t\t\t// Rewind the stream to file start\n\t\t\toutput.seek(0);\n\t\t\t// Write the metadata into the file header\n\t\t\tfinal Metadata metadata = getMetadata();\n\t\t\toutput.write(FIF_ID);\n\t\t\toutput.writeInt(metadata.width);\n\t\t\toutput.writeInt(metadata.height);\n\t\t\toutput.writeInt(metadata.depth);\n\t\t\toutput.writeInt(metadata.physicalWidth);\n\t\t\toutput.writeInt(metadata.physicalHeight);\n\t\t\toutput.writeInt(metadata.physicalDepth);\n\t\t\toutput.writeInt(metadata.getDateInt());\n\t\t\toutput.writeBytes(metadata.getPaddedInstrument());\n\t\t\toutput.writeDouble(metadata.excitationLevel);\n\t\t}",
"private void writeHeader (ByteBuffer buffer) throws IOException {\n\tMultipartHeader h = \n\t new MultipartHeader (Header.CRLF + \"--\" + separator);\n\tRange r = ranges.get (currentRange);\n\tif (contentType != null)\n\t h.setHeader (\"Content-Type\", contentType);\n\th.setHeader (\"Content-Range\", \"bytes \" + r.getStart () + \"-\" + \n\t\t r.getEnd () + \"/\" + totalSize);\n\tbuffer.put (h.toString ().getBytes (\"US-ASCII\"));\n }",
"void writeFileHeader() throws IOException {\n\tsetFilePointer(0) ;\n\ttry {\n\t cgFile.writeInt(MAGIC_NUMBER) ;\n\t cgFile.writeInt(majorVersionNumber) ;\n\t cgFile.writeInt(minorVersionNumber) ;\n\t cgFile.writeInt(minorMinorVersionNumber) ;\n\t cgFile.writeInt(objectCount) ;\n\t cgFile.writeInt(0) ; // long word alignment\n\t cgFile.writeLong(directoryOffset) ;\n\t if (print)\n\t\tSystem.out.println(\"wrote file header for \" + fileName) ;\n\t}\n\tcatch (IOException e) {\n\t throw new IOException\n\t\t(e.getMessage() +\n\t\t \"\\ncould not write file header for \" + fileName) ;\n\t}\n }",
"public void writeHeader() throws IOException {\n\n header = new byte[ShapeConst.SHAPE_FILE_HEADER_LENGTH];\n\n ByteUtils.writeBEInt(header, 0, ShapeConst.SHAPE_FILE_CODE);\n ByteUtils.writeBEInt(header, 24, 50);\n\n // empty shape file size in 16 bit words\n ByteUtils.writeLEInt(header, 28, ShapeConst.SHAPE_FILE_VERSION);\n ByteUtils.writeLEInt(header, 32, ShapeConst.SHAPE_TYPE_NULL);\n ByteUtils.writeLEDouble(header, 36, 0.0);\n ByteUtils.writeLEDouble(header, 44, 0.0);\n ByteUtils.writeLEDouble(header, 52, 0.0);\n ByteUtils.writeLEDouble(header, 60, 0.0);\n\n rafShp.seek(0);\n rafShp.write(header, 0, ShapeConst.SHAPE_FILE_HEADER_LENGTH);\n\n }",
"private void writeHeaderAndData(DataOutputStream out) throws IOException {\n ensureBlockReady();\n out.write(onDiskBytesWithHeader);\n if (compressAlgo == NONE && minorVersion > MINOR_VERSION_NO_CHECKSUM) {\n if (onDiskChecksum == HConstants.EMPTY_BYTE_ARRAY) {\n throw new IOException(\"A \" + blockType + \" without compression should have checksums \"\n + \" stored separately.\");\n }\n out.write(onDiskChecksum);\n }\n }",
"private void outputHeader()\n throws IOException {\n out.write(\"begin \".getBytes());\n out.write(Integer.toString(userPerms).getBytes());\n out.write(Integer.toString(groupPerms).getBytes());\n out.write(Integer.toString(othersPerms).getBytes());\n out.write(' ');\n out.write(name.getBytes());\n out.write('\\n');\n headerPending = false;\n }",
"protected int serializeHeader(DataOutputStream dos) throws IOException {\n // Write the header. It is already set and ready to use, having been\n // created when the Trie2 was unserialized or when it was frozen.\n int bytesWritten = 0;\n\n dos.writeInt(header.signature);\n dos.writeShort(header.options);\n dos.writeShort(header.indexLength);\n dos.writeShort(header.shiftedDataLength);\n dos.writeShort(header.index2NullOffset);\n dos.writeShort(header.dataNullOffset);\n dos.writeShort(header.shiftedHighStart);\n bytesWritten += 16;\n\n // Write the index\n int i;\n for (i=0; i< header.indexLength; i++) {\n dos.writeChar(index[i]);\n }\n bytesWritten += header.indexLength;\n return bytesWritten;\n }",
"private void writeChunkHeader() throws IOException {\n\t\tRWUtil.write64(chunkBuffer, ByteSignature.CHUNK.getValue());\n\t}",
"public void writeHeader(int shptype, SHPEnvelope mbr) throws IOException {\n\n byte[] header = new byte[ShapeConst.SHAPE_FILE_HEADER_LENGTH];\n\n ByteUtils.writeBEInt(header, 0, ShapeConst.SHAPE_FILE_CODE);\n ByteUtils.writeBEInt(header, 24, filelength);\n ByteUtils.writeLEInt(header, 28, ShapeConst.SHAPE_FILE_VERSION);\n ByteUtils.writeLEInt(header, 32, shptype);\n ShapeUtils.writeBox(header, 36, mbr);\n\n raf.seek(0);\n raf.write(header, 0, ShapeConst.SHAPE_FILE_HEADER_LENGTH);\n }",
"public void writeHeader(int filelength, int shptype, SHPEnvelope mbr) throws IOException {\n\n header = new byte[ShapeConst.SHAPE_FILE_HEADER_LENGTH];\n\n ByteUtils.writeBEInt(header, 0, ShapeConst.SHAPE_FILE_CODE);\n ByteUtils.writeBEInt(header, 24, filelength / 2);\n ByteUtils.writeLEInt(header, 28, ShapeConst.SHAPE_FILE_VERSION);\n ByteUtils.writeLEInt(header, 32, shptype);\n ShapeUtils.writeBox(header, 36, mbr);\n\n rafShp.seek(0);\n rafShp.write(header, 0, ShapeConst.SHAPE_FILE_HEADER_LENGTH);\n }",
"private void sendHeader() throws IOException {\n\t\tbyte[] bytes = header.toBytes();\n\t\tif (outBuf.capacity() >= bytes.length) {\n\t\t\toutBuf.clear();\n\t\t}\n\t\telse {\n\t\t\toutBuf = ByteBuffer.allocateDirect(bytes.length);\n\t\t}\n\t\toutBuf.put(bytes, 0, bytes.length);\n\t\toutBuf.flip();\n\t\tchannel.register(selector, SelectionKey.OP_READ | SelectionKey.OP_WRITE );\t\n\t}",
"@Override\r\n\t protected void writeStreamHeader() throws IOException {\n\t reset();\r\n\t }",
"@Override\n protected void writeStreamHeader() throws IOException {\n writeByte(STREAM_VERSION);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Utility method to navigate throw the tree and extract the paths for given expression type | public void paths(Class<? extends IExpression> expressionType, IExpression parent, List<IExpression> currentPath, List<List<IExpression>> paths) {
for (IExpression expression : parent.getExpressions()) {
List<IExpression> currentPath_ = HashUtil.getList(currentPath);
currentPath_.add(expression);
if (expressionType.isAssignableFrom(expression.getClass())) {
paths.add(currentPath_);
} else {
paths(expressionType, expression, currentPath_, paths);
}
}
} | [
"String getPathMatchingExpression();",
"private String getPath(Element e) {\n String path = \"\";\n Element parent = e.getParentElement();\n while (parent != null) {\n path = getSyntax(parent) + path;\n parent = parent.getParentElement();\n }\n return path;\n\n }",
"protected Expression parsePathExpression() throws XPathException {\r\n switch (t.currentToken) {\r\n case Token.SLASH:\r\n nextToken();\r\n final RootExpression start = new RootExpression();\r\n setLocation(start);\r\n if (disallowedAtStartOfRelativePath()) {\r\n grumble(\"Operator '\" + Token.tokens[t.currentToken] + \"' is not allowed after '/'\");\r\n }\r\n if (atStartOfRelativePath()) {\r\n final Expression path = parseRemainingPath(start);\r\n setLocation(path);\r\n return path;\r\n } else {\r\n return start;\r\n }\r\n\r\n case Token.SLSL:\r\n // The logic for absolute path expressions changed in 8.4 so that //A/B/C parses to\r\n // (((root()/descendant-or-self::node())/A)/B)/C rather than\r\n // (root()/descendant-or-self::node())/(((A)/B)/C) as previously. This is to allow\r\n // the subsequent //A optimization to kick in.\r\n nextToken();\r\n final RootExpression start2 = new RootExpression();\r\n setLocation(start2);\r\n final AxisExpression axisExp = new AxisExpression(Axis.DESCENDANT_OR_SELF, null);\r\n setLocation(axisExp);\r\n final Expression exp = parseRemainingPath(new SlashExpression(start2, axisExp));\r\n setLocation(exp);\r\n return exp;\r\n default:\r\n return parseRelativePath();\r\n }\r\n\r\n }",
"private Type traverseTree(Node parsedTree) {\n Expression exp = new Expression(Type.EMPTY, Type.EMPTY, Connector.empty); // Creation of a new expression with empty fields\n\n\t\t// Determines the type from left to right of the given expression\n for (Node child : parsedTree.getChildren()) {\n \texp = evalExpressionAndSetLeft(addChildToExpression(child, exp));\n }\n return exp.getLeftExpressionType();\n }",
"public ArrayList<Path> getInterTraversalResultsAsPaths(Node node) \n\t{\t\n\t\tArrayList<Path> paths = new ArrayList<Path>();\n\t\tTraverser custom = getInterTraverser(node);\n\t\tfor (Path p : custom)\n\t\t{\n\t\t\tpaths.add(p);\n\t\t\t//output += \"At depth \" + p.length() + \" => \" \n\t\t\t//+ p.endNode().getId() + p.endNode().getProperty( \"type\" ) + \"\\n\"; \t\n\t\t}\n\t\treturn paths;\n\t}",
"void visit(XPathExpressionPath expressionPath);",
"public interface PathExpressionService {\n /**\n * Compile an expression.\n *\n * @param path The original path.\n * @param offset The offset of the expression being compiled in the original path.\n * @param inputString The expression to compile.\n * @return The compiled form of the expression. This value will be passed to evaluate.\n * @throws InvalidPathSyntaxException If there was a problem compiling the expression.\n */\n CompiledExpressionHolder compile(String path, int offset, String inputString)\n throws InvalidPathSyntaxException;\n\n /**\n * Evaluated a compiled expression.\n *\n * @param code The compiled form of the expression.\n * @param root The root object that is being traversed with JSON-path.\n * @param key The key when iterating over object fields or NULL if not-applicable.\n * @param value The value when iterating over an object/array.\n * @return The result of the expression.\n * @throws InvalidPathException If there was a problem executing the expression.\n */\n Object evaluate(CompiledExpressionHolder code, Object scopes, Object root, Object key, Object\n value) throws InvalidPathException;\n}",
"protected void visit_paths(ITreeNode node)\n {\n // You should *not* place your code right here. \n // Instead, you should override this method via a subclass.\n visitUnknown(node); // Default Behavior\n }",
"public interface ASTPath\n{\n\tvoid debugSelf(IndentPrinter destination);\n\tvoid setParent(ASTChildList.ListKey key, ASTParent newParent);\n\tvoid compileSelf(LangCompiler compiler);\n\tASTBase getDeclaration();\n\tString getName();\n\tString getEnd();\n\tSpiritType getExpressionType();\n\n}",
"public TreePath getTreePath(Element e) {\n DocCommentInfo info = dcTreeCache.get(e);\n if (info != null && info.treePath != null) {\n return info.treePath;\n }\n info = configuration.cmtUtils.getSyntheticCommentInfo(e);\n if (info != null && info.treePath != null) {\n return info.treePath;\n }\n Map<Element, TreePath> elementToTreePath = configuration.workArounds.getElementToTreePath();\n TreePath path = elementToTreePath.get(e);\n if (path != null || elementToTreePath.containsKey(e)) {\n // expedite the path and one that is a null\n return path;\n }\n return elementToTreePath.computeIfAbsent(e, docTrees::getPath);\n }",
"public abstract ASTPath getASTPath ();",
"public RDFList path(RDFList exp) {\r\n RDFList ll = new RDFList(exp.head(), exp.getList());\r\n Expression re = list();\r\n\r\n for (Expression ee : exp.getList()){\r\n Triple t = createPath(exp.head(), re, ee);\r\n ll.add(t);\r\n }\r\n \r\n return ll;\r\n }",
"public PathExpressionIF createPathExpression();",
"protected abstract Class<? extends IExpression> getRootExpressionClass();",
"@Test(expected = TreeNodeException.class)\n public void testPathToRootException() {\n node3.path(root);\n }",
"public abstract XPathExpression getExpression();",
"protected void selectTraceableExpressions(Map<String, Expression> mapExprs)\n {\n for (AstNode node : children())\n {\n if (node instanceof Expression expr)\n {\n if (expr.isValidated() && expr.isTraceworthy())\n {\n String sExpr = expr.toString();\n if (!mapExprs.containsKey(sExpr))\n {\n mapExprs.put(sExpr, expr);\n }\n }\n\n if (expr.isConstant())\n {\n // don't recurse constants\n continue;\n }\n }\n\n node.selectTraceableExpressions(mapExprs);\n }\n }",
"public static List<String> getFieldPaths(Class<?> dtoType, boolean lookingInner) {\n List<String> fieldPaths = new ArrayList<>();\n List<Field> fields = ObjectUtils.getFields(dtoType, true);\n for (Field field : fields) {\n fieldPaths.addAll(getFieldPaths(field, lookingInner));\n }\n return fieldPaths;\n }",
"public FilterExpression convertToFilterExpression(PathExpression pathExp, TypeHierarchy th)\r\n throws XPathException {\r\n return null;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the value of the 'var107' field. | public java.lang.CharSequence getVar107() {
return var107;
} | [
"public java.lang.CharSequence getVar107() {\n return var107;\n }",
"public java.lang.Integer getVar109() {\n return var109;\n }",
"public java.lang.Integer getVar109() {\n return var109;\n }",
"public java.lang.Integer getVar105() {\n return var105;\n }",
"public java.lang.CharSequence getVar108() {\n return var108;\n }",
"public java.lang.Integer getVar106() {\n return var106;\n }",
"public java.lang.Integer getVar105() {\n return var105;\n }",
"public java.lang.CharSequence getVar108() {\n return var108;\n }",
"public java.lang.Integer getVar106() {\n return var106;\n }",
"public java.lang.Integer getVar187() {\n return var187;\n }",
"public java.lang.Integer getVar187() {\n return var187;\n }",
"public java.lang.Integer getVar159() {\n return var159;\n }",
"public java.lang.Integer getVar159() {\n return var159;\n }",
"public java.lang.Integer getVar132() {\n return var132;\n }",
"public java.lang.Integer getVar177() {\n return var177;\n }",
"public java.lang.Integer getVar114() {\n return var114;\n }",
"public void setVar107(java.lang.CharSequence value) {\n this.var107 = value;\n }",
"public java.lang.Integer getVar78() {\n return var78;\n }",
"public java.lang.Integer getVar132() {\n return var132;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return a Map from the stream. If there are similar keys in the stream, the merge function will be applied to merge the values of those keys | default Map<K, V> collect(BinaryOperator<V> mergeFunction) {
return collect(toMap(Entry::getKey, Entry::getValue, mergeFunction));
} | [
"default MapStream<K, List<V>> mergeKeys() {\n return of(collect(groupingBy(Entry::getKey, mapping(Entry::getValue, toList()))));\n }",
"default MapStream<K, V> mergeKeys(BinaryOperator<V> mergeFunction) {\n return of(collect(mergeFunction));\n }",
"public static Map<String, String> convertTomap(Stream<String> stream, String delimiter) {\n logger.info(\"converting stream of strings to Map using delimiter : \" + delimiter);\n return stream.filter(current_line -> current_line.length() > 0)\n .map(cl -> cl.split(delimiter))\n .filter(cl -> cl.length > 1)\n .collect(Collectors.toMap(cl -> cl[0].trim(), cl -> cl[1].trim(), (val1, val2) -> val2.trim()));\n }",
"@Test\r\n void convertStreamBean2MapMethod() {\r\n\t\tStream<TransactionBean> transactionBeanStream = transactions.stream();\r\n\t\t// Convert stream -> Map<Object, Object> -> Map<String, TransactionBean>\r\n\t\tMap<String, TransactionBean> afterStreamMap = (Map<String, TransactionBean>)transactionBeanStream.peek(System.out::println).collect(Collectors.toMap(p -> p.getValue(), p -> p));\r\n\t\tassertSame(\"wrong type\", Transaction.GROCERY, afterStreamMap.get(\"r1\").getType());\r\n\t\tassertSame(\"wrong type\", Transaction.Test, afterStreamMap.get(\"r2\").getType());\r\n\t\tassertSame(\"wrong type\", Transaction.GROCERY, afterStreamMap.get(\"r3\").getType());\r\n }",
"@Test\n public void toMap_6() {\n\n Map<String, String> result = sonnet.stream()\n .collect(\n toMap(\n line -> line.substring(0, 1),\n line -> line,\n (line1, line2) -> line1.concat(\"\\n\").concat(line2)\n )\n );\n\n assertThat(result.size()).isEqualTo(8);\n assertThat(result).contains(\n Map.entry(\"P\", \"Pity the world, or else this glutton be,\"),\n Map.entry(\"A\", \"And only herald to the gaudy spring,\\n\" +\n \"And, tender churl, mak'st waste in niggarding:\"),\n Map.entry(\"B\", \"But as the riper should by time decease,\\n\" +\n \"But thou contracted to thine own bright eyes,\"),\n Map.entry(\"T\", \"That thereby beauty's rose might never die,\\n\" +\n \"Thy self thy foe, to thy sweet self too cruel:\\n\" +\n \"Thou that art now the world's fresh ornament,\\n\" +\n \"To eat the world's due, by the grave and thee.\"),\n Map.entry(\"F\", \"From fairest creatures we desire increase,\\n\" +\n \"Feed'st thy light's flame with self-substantial fuel,\"),\n Map.entry(\"W\", \"Within thine own bud buriest thy content,\"),\n Map.entry(\"H\", \"His tender heir might bear his memory:\"),\n Map.entry(\"M\", \"Making a famine where abundance lies,\")\n );\n }",
"public static <T> Map<T, Long> countByStreamGroupBy(List<T> list) {\n return list.stream().collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));\n }",
"private Map<String, Integer> getInstructionCounterMapFromStream(String stream) {\n Map<String, Integer> instructionCount = new HashMap<>();\n String[] streamInstructionSets = stream.split(\";\");\n for (String streamInstructionSet : streamInstructionSets) {\n String instruction = streamInstructionSet.split(\",\")[0].split(\"\\\\.\")[1];\n instructionCount.put(instruction, instructionCount.getOrDefault(instruction, 0) + 1);\n }\n return instructionCount;\n }",
"default MapStream<V, K> inverseMapping() {\n return new DefaultMapStream<>(map(e -> new SimpleImmutableEntry<>(e.getValue(), e.getKey())));\n }",
"default SMap<K, V> filter(final BiPredicate<? super K, ? super V> f) {\n\n return this //\n .entries() //\n .filter(e -> f.test(e.key, e.val)) //\n .reduce( //\n Indolently.map(), //\n (map, e) -> map.push(e.key, e.val));\n }",
"private Map<UUID, String> getStreamIdToTableNameMap() {\n Map<UUID, String> streamIdToTableNameMap = new HashMap<>();\n runtime.getTableRegistry().listTables().forEach(tableName -> {\n String name = TableRegistry.getFullyQualifiedTableName(tableName);\n streamIdToTableNameMap.put(CorfuRuntime.getStreamID(name), name);\n });\n return streamIdToTableNameMap;\n }",
"public Map<Long, TumblrStream> getAllTumblrStreams(){\r\n if(tumblrStreamMap == null){\r\n //Cache the queries\r\n getAllTumblrQueries();\r\n //Fetch and cache the streams\r\n tumblrStreamMap = getAll(TUMBLR_STREAM, CURSOR_TUMBLR_STREAM_CONVERTER);\r\n }\r\n return tumblrStreamMap;\r\n }",
"public static HashMap merge(Map map1, Map map2) {\r\n\t\tHashMap retval = new HashMap(calcCapacity(map1.size() + map2.size()));\r\n\r\n\t\tretval.putAll(map1);\r\n\t\tretval.putAll(map2);\r\n\r\n\t\treturn retval;\r\n\t}",
"public Map<Long, TwitterStream> getAllTwitterStreams(){\r\n if(twitterStreamMap == null){\r\n //Cache the queries\r\n getAllTwitterQueries();\r\n //Fetch and cache the streams\r\n twitterStreamMap = getAll(TWITTER_STREAM, CURSOR_TWITTER_STREAM_CONVERTER);\r\n }\r\n return twitterStreamMap;\r\n }",
"public static <K,V> Map<K,V> getBy(Iterable<V> values, Function<V,K> keyMapper){\n\t\treturn StreamTool.stream(values).collect(CollectorTool.toMap(keyMapper));\n\t}",
"public static <K, V, T> Collector<T, Map<K, V>, Map<K, V>> mapBy(\r\n\t\t\tFunction<? super T, ? extends K> keyExtractor,\r\n\t\t\tFunction<? super T, ? extends V> valueExtractor) {\r\n\t\t\r\n\t\treturn Collector.of(\r\n\t\t\t\tHashMap::new,\r\n\t\t\t\t(map, t) -> map.put(keyExtractor.apply(t),\r\n\t\t\t\t\t\tvalueExtractor.apply(t)), (map1, map2) -> {\r\n\t\t\t\t\tmap1.putAll(map2);\r\n\t\t\t\t\treturn map1;\r\n\t\t\t\t}, Characteristics.CONCURRENT, Characteristics.UNORDERED,\r\n\t\t\t\tCharacteristics.IDENTITY_FINISH);\r\n\r\n\t}",
"public static void addToMap()\n {\n Map<String, Integer> map = new HashMap<>();\n\n BiConsumer<String, Integer> mapAdderEveryTime = (s, i) -> map.put(s, i);\n\n mapAdderEveryTime.accept(\"key1\", 4);\n mapAdderEveryTime.accept(\"key2\", 4);\n\n BiConsumer<String, Integer> mapAdderIfPresent = (s, i) -> {\n map.computeIfPresent(s, (key, value) -> (value % 4 == 0) ? 0 : value +1);\n };\n\n mapAdderIfPresent.accept(\"key1\", 1);\n\n System.out.println(map);\n }",
"public LinkedHashMap<String, FileHandleStatus> saveFilesByStreamMap(LinkedHashMap<String, InputStream> streamMap,\n ContentType contentType) throws IOException {\n // Assign file key\n final AssignFileKeyParams params = new AssignFileKeyParams(\n assignFileKeyParams.getReplication(),\n streamMap.size(),\n assignFileKeyParams.getDataCenter(),\n assignFileKeyParams.getTtl(),\n assignFileKeyParams.getCollection()\n );\n\n final AssignFileKeyResult assignFileKeyResult =\n masterWrapper.assignFileKey(params);\n String uploadUrl;\n if (usingPublicUrl)\n uploadUrl = assignFileKeyResult.getPublicUrl();\n else\n uploadUrl = assignFileKeyResult.getUrl();\n\n // Upload file\n LinkedHashMap<String, FileHandleStatus> resultMap = new LinkedHashMap<String, FileHandleStatus>();\n int index = 0;\n for (String fileName : streamMap.keySet()) {\n if (index == 0)\n resultMap.put(fileName, new FileHandleStatus(assignFileKeyResult.getFid(),\n volumeWrapper.uploadFile(\n uploadUrl,\n assignFileKeyResult.getFid(),\n fileName,\n streamMap.get(fileName),\n timeToLive,\n contentType)));\n else\n resultMap.put(fileName, new FileHandleStatus(assignFileKeyResult.getFid() + \"_\" + String.valueOf(index),\n volumeWrapper.uploadFile(\n uploadUrl,\n assignFileKeyResult.getFid() + \"_\" + String.valueOf(index),\n fileName,\n streamMap.get(fileName),\n timeToLive,\n contentType)));\n index++;\n }\n return resultMap;\n }",
"<S, Dk, Dv> Map<Dk, Dv> mapAsMap(Iterable<S> source, Type<S> sourceType, Type<? extends Map<Dk, Dv>> destinationType);",
"private Map<String, String> parseDictionary(XMLStreamReader parser) throws XMLStreamException {\n\n Map<String, String> map = new HashMap<>();\n\n String key = \"\";\n String value = \"\";\n int event = parser.next();\n while (event != XMLStreamReader.END_DOCUMENT) {\n switch (event) {\n case XMLStreamReader.START_ELEMENT:\n String name = parser.getName().getLocalPart();\n if (Constants.KEY_TAG.equals(name)) {\n key = parser.getElementText();\n } else if (Constants.VALUE_TAG.equals(name)) {\n value = parser.getElementText();\n map.put(key, value);\n }\n break;\n }\n event = parser.next();\n }\n\n return map;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
POST /prixtickets : Create a new prixTicket. | @PostMapping("/prix-tickets")
@Timed
public ResponseEntity<PrixTicketDTO> createPrixTicket(@RequestBody PrixTicketDTO prixTicketDTO) throws URISyntaxException {
log.debug("REST request to save PrixTicket : {}", prixTicketDTO);
if (prixTicketDTO.getId() != null) {
throw new BadRequestAlertException("A new prixTicket cannot already have an ID", ENTITY_NAME, "idexists");
}
PrixTicketDTO result = prixTicketService.save(prixTicketDTO);
return ResponseEntity.created(new URI("/api/prix-tickets/" + result.getId()))
.headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString()))
.body(result);
} | [
"@PostMapping(\"/tickets\")\n @Timed\n public ResponseEntity<Ticket> createTicket(@Valid @RequestBody Ticket ticket) throws URISyntaxException {\n log.debug(\"REST request to save Ticket : {}\", ticket);\n if (ticket.getId() != null) {\n throw new BadRequestAlertException(\"A new ticket cannot already have an ID\", ENTITY_NAME, \"idexists\");\n }\n Ticket result = ticketRepository.save(ticket);\n return ResponseEntity.created(new URI(\"/api/tickets/\" + result.getId()))\n .headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString()))\n .body(result);\n }",
"net.zyuiop.ovhapi.api.objects.support.NewMessageInfo postTicketsCreate(java.lang.String body, java.lang.String subject, java.lang.String type) throws java.io.IOException;",
"public static void createTicket(Ticket ticket) {\n try {\n Connection conn = Main.conn;\n PreparedStatement statement = conn.prepareStatement(\"INSERT INTO bs_tickets (username, admin, status, question, server, date_created, date_accepted, date_resolved) VALUES (?, ?, ?, ?, ?, ?, ?, ?)\");\n\n statement.setString(1, ticket.username);\n statement.setString(2, ticket.admin);\n statement.setString(3, ticket.status);\n statement.setString(4, ticket.question);\n statement.setString(5, ticket.server);\n statement.setInt(6, ticket.date_created);\n statement.setInt(7, ticket.date_accepted);\n statement.setInt(8, ticket.date_resolved);\n\n statement.executeUpdate();\n }\n catch (SQLException e) {\n e.printStackTrace();\n }\n }",
"@Override\n public Optional<Ticket> createTicket(TicketForm form) {\n DestinacijaId destinacijaIdPocetna = new DestinacijaId(form.getPocetnaId());\n Destinacija pocetnaD = destinacijaRepository.findById(destinacijaIdPocetna).orElseThrow(TicketNotFoundException::new);\n DestinacijaId destinacijaIdKrajna = new DestinacijaId(form.getKrajnaId());\n Destinacija krajnaD = destinacijaRepository.findById(destinacijaIdKrajna).orElseThrow(TicketNotFoundException::new);\n //kreiram ticket so podatocite koi gi zemam od ticketform za name, price, soldTickets i pocetna i krajna destinacija\n Ticket p = Ticket.build(form.getTicketName(),Money.valueOf(Currency.MKD,(double)form.getPriceNumber()),form.getSoldTickets(), pocetnaD, krajnaD);\n //go zacuvuvam noviot ticket\n ticketRepository.save(p);\n return Optional.of(p);\n }",
"public void createTicket(Ticket ticket)\n\t{\n\t\tSession ses = HibernateUtil.getSession();\n\t\t\n\t\tses.save(ticket);\n\t\t\n\t\tHibernateUtil.closeSession();\n\t}",
"public Ticket() {\n\n }",
"public Ticket() {}",
"public Ticket()\n {\n serialNumber = getNextSerialNumber();\n }",
"@Override\n public TicketDto createNewTicket(int noOfLines) {\n if (noOfLines <= 0)\n {\n return null;\n }\n\n TicketDto ticket = TicketDto.builder().build();\n ticket.setTicketLines(ticketLineScv.createLines(ticket, noOfLines));\n return this.ticketDao.save(ticket);\n }",
"protected void newTicket (String id, String user) {\n java.util.List<String> Tickets = getTickets().getStringList(\"Tickets\");\n Tickets.add(id); \n getTickets().set(\"Tickets\", Tickets);\n getTickets().set(\"counts.\"+user, getTickets().getInt(\"counts.\"+user) + 1);\n }",
"public PagoTicket() {\n initComponents();\n }",
"void postTicketsTicketIdReopen(long ticketId, java.lang.String body) throws java.io.IOException;",
"public PBuyTicketRecord() {\n super(PBuyTicket.P_BUY_TICKET);\n }",
"public void XxGamMaCreateTicket(Number nPayment, \n OAPageContext pageContext) {\n //Buscamos el Payment con el id para poder asociarlo con el nuevo ticket\n // searchPayment(nPayment);\n //Obteniendo el registro actual de XxGamMaTicketPVORowImpl\n XxGamMaPaymentReqVORowImpl rowXxGamMaPaymentReqVO = null;\n rowXxGamMaPaymentReqVO = (XxGamMaPaymentReqVORowImpl)getCurrentRow();\n\n RowIterator riXxGamMaPaymentPVO = null;\n //Verificando que el row no venga vacio\n if (rowXxGamMaPaymentReqVO == null) {\n throw new OAException(\"No es posible crear el ticket\", \n OAException.ERROR);\n\n }\n //Obteniendo el row iterador de ticket para los vuelos\n riXxGamMaPaymentPVO = rowXxGamMaPaymentReqVO.getXxGamMaTicketPVO();\n if (riXxGamMaPaymentPVO == null) {\n throw new OAException(\"No es posible crear el ticket\", \n OAException.ERROR);\n\n }\n XxGamMaTicketPVOImpl voXxGamMaTicketPVOImpl = null;\n //Creamos variable de AM para obtener su referencia\n XxGamModAntAMImpl amXxGamModAnt = null;\n try {\n /** AGAA Obtiene la Filial **/\n String filial = \n (String)pageContext.getTransactionValue(\"orgNameEmp\");\n\n //Obtenemos el AM\n amXxGamModAnt = getXxGamModAntAM();\n //Obtenemos la referencia a la implementacion de la VO deTicket\n voXxGamMaTicketPVOImpl = amXxGamModAnt.getXxGamMaTicketPVO3();\n //Llamamos el metodo para agregar un nuevo vuelo\n voXxGamMaTicketPVOImpl.addNewTicket(filial);\n } catch (Exception e) {\n e.printStackTrace();\n throw new OAException(\"No es posible crear el ticket\", \n OAException.ERROR);\n }\n }",
"public void addTicket(phonecallTicket ticket){\n try {\n \n System.out.println(\"Number of tickets? \" + (total()+1));\n String insert =\"INSERT INTO JEREMY.TICKET \"\n + \"(ID,NAME,PHONE,TAG,DATE,PROBLEM,NOTES,STATUS) \"\n + \"VALUES \"\n \n + \"(\" + (total() +1) +\",'\"\n +ticket.who+\"','\"\n +ticket.phone+\"','\"\n +ticket.tag+\"',' \"\n +ticket.date+\"',' \"\n +ticket.problem+\"',' \"\n +ticket.notes+\"','\"\n +\"NEW\"+\"')\";\n \n System.out.println(insert);\n \n stmt.executeUpdate(insert);\n \n rs = stmt.executeQuery(\"SELECT * FROM JEREMY.TICKET\");\n total();\n } catch (Exception e) {\n System.out.println(\"SQL problem \" + e);\n }\n tickets.add(ticket);\n }",
"@PostMapping(\"/ticket-actions\")\n @Timed\n public ResponseEntity<TicketActionDTO> createTicketAction(@RequestBody TicketActionDTO ticketActionDTO) throws URISyntaxException {\n log.debug(\"REST request to save TicketAction : {}\", ticketActionDTO);\n if (ticketActionDTO.getId() != null) {\n return ResponseEntity.badRequest().headers(HeaderUtil.createFailureAlert(\"ticketAction\", \"idexists\", \"A new ticketAction cannot already have an ID\")).body(null);\n }\n TicketActionDTO result = ticketActionService.save(ticketActionDTO);\n return ResponseEntity.created(new URI(\"/api/ticket-actions/\" + result.getId()))\n .headers(HeaderUtil.createEntityCreationAlert(\"ticketAction\", result.getId().toString()))\n .body(result);\n }",
"public TestTicket() {\n\t}",
"public Ticket issueTicket(String username, String url){\n String id = generateID(username,url);\n Ticket ticket = new Ticket(id, url, username);\n tickets.addElement(ticket);\n return ticket;\n }",
"@Override\n\tpublic MealTicket create(String custom_key) {\n\t\tMealTicket mealTicket = new MealTicketImpl();\n\n\t\tmealTicket.setNew(true);\n\t\tmealTicket.setPrimaryKey(custom_key);\n\n\t\treturn mealTicket;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Factory method for creating a leccmachinespecific executor. | @Override
public CALExecutor makeExecutor(ExecutionContext context) {
return new org.openquark.cal.internal.machine.lecc.Executor(theProgram, resourceAccess, context);
} | [
"ExecutorService newExecutor(String name);",
"Machine createMachine();",
"@Override\n\t\tpublic ExecutorService createExecutorService() {\n\t\t\treturn Executors.newFixedThreadPool(this.teamSize, this.threadFactory);\n\t\t}",
"private DefaultExecutorSupplier() {\n\n // setting the thread factory\n ThreadFactory backgroundPriorityThreadFactory = new\n PriorityThreadFactory(Process.THREAD_PRIORITY_BACKGROUND);\n\n // setting the thread pool executor for mSeverRequests;\n mSeverRequests = new ThreadPoolExecutor(\n NUMBER_OF_CORES * 2,\n NUMBER_OF_CORES * 2,\n 60L,\n TimeUnit.SECONDS,\n new LinkedBlockingQueue<Runnable>(),\n backgroundPriorityThreadFactory\n );\n\n // setting the thread pool executor for mImageRequests;\n mImageRequests = new ThreadPoolExecutor(\n NUMBER_OF_CORES * 2,\n NUMBER_OF_CORES * 2,\n 60L,\n TimeUnit.SECONDS,\n new LinkedBlockingQueue<Runnable>(),\n backgroundPriorityThreadFactory\n );\n\n mForPriorityBackgroundTasks = new PriorityThreadPoolExecutor(\n NUMBER_OF_CORES * 2,\n NUMBER_OF_CORES * 2,\n 60L,\n TimeUnit.SECONDS,\n backgroundPriorityThreadFactory\n );\n\n // setting the thread pool executor for mMainThreadExecutor;\n mMainThreadExecutor = new MainThreadExecutor();\n }",
"public static DirectCallExecutor newExecutor() {\n\t\treturn NEVER_PAUSING_EXECUTOR;\n\t}",
"public SequentialExecutor(Executor executor)\r\n {\r\n myExecutor = Utilities.checkNull(executor, \"executor\");\r\n }",
"public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {\n return InstantiatingExecutorProvider.newBuilder();\n }",
"public abstract T executor(@Nullable Executor executor);",
"public ChainExecutor() {\n }",
"void registerDefaultExecutor(byte protocolCode, ExecutorService executor);",
"RScheduledExecutorService getExecutorService(String name, Codec codec);",
"public LibcivlcExecutor(String name, Executor primaryExecutor,\n\t\t\tModelFactory modelFactory, SymbolicUtility symbolicUtil,\n\t\t\tSymbolicAnalyzer symbolicAnalyzer, CIVLConfiguration civlConfig,\n\t\t\tLibraryExecutorLoader libExecutorLoader,\n\t\t\tLibraryEvaluatorLoader libEvaluatorLoader) {\n\t\tsuper(name, primaryExecutor, modelFactory, symbolicUtil,\n\t\t\t\tsymbolicAnalyzer, civlConfig, libExecutorLoader,\n\t\t\t\tlibEvaluatorLoader);\n\t}",
"public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {\n return ReservationServiceStubSettings.defaultExecutorProviderBuilder();\n }",
"private Robot createRobot(String name) throws Exception {\n String[] names = name.split(\",\");\n return (Robot) Class.forName(equi.get(names[0])).getConstructor(String.class).newInstance(names[1]);\n }",
"RScheduledExecutorService getExecutorService(String name, Codec codec, ExecutorOptions options);",
"Executor asExecutor();",
"public abstract java.util.concurrent.Executor getExecutor();",
"public abstract ExecutorService getExecutorService();",
"ICodecExecutor createCodecExecutor(Object identifier);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a Shape instance with specified x, y, deltaX and deltaY values. The Shape object is created with a default width and height. | public Shape(int x, int y, int deltaX, int deltaY) {
this(x, y, deltaX, deltaY, DEFAULT_WIDTH, DEFAULT_HEIGHT);
} | [
"public Shape(int x, int y, int deltaX, int deltaY) {\n\t\tthis(x, y, deltaX, deltaY, DEFAULT_WIDTH, DEFAULT_HEIGHT);\n\t}",
"public Shape(int x, int y, int deltaX, int deltaY, int width, int height) {\n\t\t_x = x;\n\t\t_y = y;\n\t\t_deltaX = deltaX;\n\t\t_deltaY = deltaY;\n\t\t_width = width;\n\t\t_height = height;\n\t}",
"public Shape(int x, int y, int deltaX, int deltaY, int width, int height) {\r\n\t\tfX = x;\r\n\t\tfY = y;\r\n\t\tfDeltaX = deltaX;\r\n\t\tfDeltaY = deltaY;\r\n\t\tfWidth = width;\r\n\t\tfHeight = height;\r\n\t\tfillColor = Color.blue;\r\n\t\tborderColor = Color.black;\r\n\t}",
"public Shape() {\n\t\tthis(DEFAULT_X_POS, DEFAULT_Y_POS, DEFAULT_DELTA_X, DEFAULT_DELTA_Y, DEFAULT_WIDTH, DEFAULT_HEIGHT);\n\t}",
"public Shape(int x, int y) {\r\n\t\tthis(x, y, DEFAULT_DELTA_X, DEFAULT_DELTA_Y, DEFAULT_WIDTH, DEFAULT_HEIGHT);\r\n\t}",
"public Shape(int x, int y) {\n\t\tthis(x, y, DEFAULT_DELTA_X, DEFAULT_DELTA_Y, DEFAULT_WIDTH, DEFAULT_HEIGHT);\n\t}",
"public HexagonShape(int x, int y, int deltaX, int deltaY) {\n\t\tsuper(x, y, deltaX, deltaY);\n\t}",
"Shape createShape();",
"public Shape() { this(X_DEFAULT, Y_DEFAULT); }",
"public PacmanShape(int x, int y, int deltaX, int deltaY) {\n\t\tsuper(x,y,deltaX,deltaY);\n\t}",
"public HexagonShape(int x, int y, int deltaX, int deltaY, int width,\n\t\t\tint height) {\n\t\tsuper(x, y, deltaX, deltaY, width, height);\n\t}",
"public Shape(int x, int y, int deltaX, int deltaY, int width, int height,String text) {\n\t\t_x = x;\n\t\t_y = y;\n\t\t_deltaX = deltaX;\n\t\t_deltaY = deltaY;\n\t\t_width = width;\n\t\t_height = height;\n\t\tthis.text = text;\n\t}",
"void createShape(double theX, double theY);",
"public Shape(){\n\t\tthis(new Point(0,0), 0);\n\t}",
"public Shape()\n {\n this(Anchor.CENTER.anchoredAt(Anchor.CENTER.ofView()).sized(100, 100));\n }",
"public CarrierShape(int x, int y, int deltaX, int deltaY, int width, int height)\n {\n super(x,y,deltaX,deltaY,width,height);\n }",
"public CarrierShape(int x, int y, int deltaX, int deltaY, int width, int height) {\n\t\tsuper(x, y, deltaX, deltaY, width, height);\n\t}",
"void createShape();",
"public Shape createShape(int x, int y) {\n\t\t\n\t\tColor colorMode = this.view.getColorPanel().getColor();\n\t\tint thickness = this.view.getToolPanel().getThickness();\n\t\tBoolean isFill = this.view.getToolPanel().getIsFilled();\n\t\t\n\t\tPolyline poly = new Polyline(colorMode,thickness,isFill);\n\t\t\n\t\tpoly.addPoint(new Point(x,y));\n\n\t\treturn poly;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method was generated by MyBatis Generator. This method returns the value of the database column TRSDEAL_BALLOON_CALC.PAYMENT_DATE | public Date getPAYMENT_DATE() {
return PAYMENT_DATE;
} | [
"public Date getPayOrderDT() {\n return payOrderDT;\n }",
"public Date getDateToPay() {\n return dateToPay;\n }",
"public Date getPaidDate(){\n //return paid date\n return new Date(this.paidDate);\n }",
"public String getLastPaymentDate() {\n\t\treturn stateEqualMasterDao.getElementValueList(\"PAYMENT_DATE\").get(0);\n\t}",
"public String getPaymentDate() {\n return paymentDate;\n }",
"public String getPaymentDate() {\n return paymentDate;\n }",
"public void setPAYMENT_DATE(Date PAYMENT_DATE) {\r\n this.PAYMENT_DATE = PAYMENT_DATE;\r\n }",
"public static String getBillDueDate(String account){\n return \"select cb_duedate from current_bills where cb_account = '\"+account+\"'\";\n }",
"@GET\n @Path(\"payments/payment_delivery_date\")\n PaymentDeliveryDate getPaymentDeliveryDate(\n @HeaderParam(\"X-Auth-Token\") String authToken,\n @HeaderParam(\"User-Agent\") String userAgent,\n @QueryParam(\"payment_date\") java.sql.Date paymentDate,\n @QueryParam(\"payment_type\") String paymentType,\n @QueryParam(\"currency\") String currency,\n @QueryParam(\"bank_country\") String bankCountry\n ) throws ResponseException;",
"@Override\n\tpublic java.util.Date getPaymentDate() {\n\t\treturn _esfShooterAffiliationChrono.getPaymentDate();\n\t}",
"public Date getPayDate() {\n return payDate;\n }",
"public java.util.Date getPaymentreceiptdate () {\r\n\t\treturn paymentreceiptdate;\r\n\t}",
"public java.util.Date getBill_date() {\n return bill_date;\n }",
"public void setPaymentDate(String value) {\n this.paymentDate = value;\n }",
"public String getActualpaydate() {\n return actualpaydate;\n }",
"TradeBO getSettlementDate(TradeBO trade);",
"public java.util.Date getTransactionDate() {\n return ((gw.cc.financials.entity.Transaction)__getDelegateManager().getImplementation(\"gw.cc.financials.entity.Transaction\")).getTransactionDate();\n }",
"public java.util.Calendar getBankPaymentDate() {\n return bankPaymentDate;\n }",
"public static String getAccountingToDate(Record record){\r\n return record.getStringValue(ACCOUNTING_TO_DATE);\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds context to the "public" namespace | public void setPublicContext(String key, String value) {
setContext(PUBLIC_NAMESPACE, key, value);
} | [
"public void setContext(Object context);",
"Context createContext();",
"public void setCurrentContext(HttpContext context) {\r\n this.currentContext = context;\r\n }",
"public void setContext(Context context) {\n this.contextMain = context;\n }",
"public void setContext(Object context)\n {\n this.context = context;\n }",
"WebAppInterface(Context context) {\r\n this.context = context;\r\n }",
"protected void setContext(RestContext context) throws ServletException {\n\t\tthis.context.set(context);\n\t}",
"public void contextAdded(Context context);",
"private void setUpContext() {\n\t\tserver.createContext(\"/user/login\", new LoginHandler(\"testDatabase\"));\r\n\t\tserver.createContext(\"/user/register\", new RegisterHandler(\"testDatabase\"));\r\n\t\tserver.createContext(\"/person\", new PersonHandler(\"testDatabase\"));\r\n\t\t//server.createContext(\"/event\", new EventHandler(\"familyHistory\"));\r\n\t\t\r\n\t\tserver.createContext(\"/\", new DefaultHandler());\r\n\t}",
"void setContext(Map context);",
"protected void setWingContext(WingContext context)\n {\n this.context = context;\n }",
"@Override\n public void setContext (Object context){\n this.context = (Context)context;\n }",
"private Context(Context cxt) {\n putAll(cxt);\n }",
"Context getGlobal();",
"public void setUserContext(UserContext userContext);",
"public PAPIContentHandlerContext () {\n requestContextStack = new ArrayList ();\n elementStack = new ArrayList ();\n attributesStack = new ArrayList ();\n handlerStack = new ArrayList ();\n }",
"static void setActiveContext(ApplicationContext context) {\n SchemaCompilerApplicationContext.context = context;\n }",
"private SpineCfHNamespaceContext() {}",
"<T extends OFPContext> void addContext(@NonNull T context);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
remove brackets around IPv6 address in host name | String cleanHostString(String host) {
if (host.charAt(0) == '[' && host.charAt(host.length() - 1) == ']') {
host = host.substring(1, host.length() - 1);
}
return host;
} | [
"private static String correctIPv6Str(String s) {\n int counter = 0;\n for (int i = 0; i < s.length(); i++) {\n if (s.charAt(i) == ':') {\n counter++;\n if (i > 0) {\n if (s.charAt(i - 1) == ':') {\n return s;\n }\n }\n }\n }\n if (counter != 7) {\n return s + \"::\";\n } else {\n return s;\n }\n }",
"java.lang.String getIpv6();",
"private static String applyRFC2732(String hostname) {\n if (hostname.indexOf(\":\") != -1) {\n // Assuming an IPv6 literal because of the ':'\n return \"[\" + hostname + \"]\";\n }\n return hostname;\n }",
"private static String ipv6ToString(byte[] address) {\n Logger log = getLogger();\n // This code was modeled after similar code in Sun's sun.security.x509.IPAddressName,\n // used by sun.security.x509.X509CertImpl.\n StringBuilder builder = new StringBuilder();\n byte[] ip = new byte[16];\n System.arraycopy(address, 0, ip, 0, 16);\n try {\n builder.append(InetAddress.getByAddress(ip).getHostAddress());\n } catch (UnknownHostException e) {\n // Thrown if address is illegal length.\n // Can't happen, we know that address is the right length.\n log.error(\"Unknown host exception processing IP address byte array: {}\", e.getMessage());\n return null;\n }\n \n if(hasMask(address)) {\n log.error(\"IPv6 subnet masks are currently unsupported\");\n return null;\n /*\n byte[] mask = new byte[16];\n for(int i = 16; i < 32; i++) {\n mask[i - 16] = address[i];\n }\n \n // TODO need to process bitmask array\n // to determine and validate subnet mask\n BitArray bitarray = new BitArray(128, mask);\n int j;\n for (j = 0; j < 128 && bitarray.get(j); j++);\n builder.append(\"/\");\n builder.append(j).toString();\n for (; j < 128; j++) {\n if (bitarray.get(j)) {\n log.error(\"Invalid IPv6 subdomain: set bit \" + j + \" not contiguous\");\n return null;\n }\n }\n */\n }\n return builder.toString();\n }",
"java.lang.String getIpv6Public();",
"private String cleanHostHeader(String header) {\n String[] hostPieces = header.split(\":\")[1].split(\"\\\\.\");\n if(hostPieces.length > 2) {\n return \"Host: \"+(\"redacted.\"+hostPieces[hostPieces.length-2]+\".\"+hostPieces[hostPieces.length-1]);\n } else {\n return \"Host: \"+(\"redacted.\"+hostPieces[hostPieces.length-1]);\n }\n }",
"public static final DNSName toRevIp6Name(byte[] hostAAAA,\n int offset, int len)\n throws NullPointerException, ArrayIndexOutOfBoundsException\n {\n int digit = hostAAAA.length;\n byte value;\n digit = 0;\n if (len > 0)\n {\n value = hostAAAA[offset];\n value = hostAAAA[(offset += len) - 1];\n if ((digit = (len << 2) - 1) < 0)\n digit = -1 >>> 1;\n }\n StringBuffer sBuf = new StringBuffer(digit);\n if (len > 0)\n do\n {\n if ((digit = (value = hostAAAA[--offset]) &\n ((1 << 4) - 1)) > '9' - '0')\n digit += 'a' - '9' - 1;\n sBuf.append((char)(digit + '0')).\n append((char)DNSName.SEPARATOR);\n if ((digit = (value >>> 4) & ((1 << 4) - 1)) > '9' - '0')\n digit += 'a' - '9' - 1;\n sBuf.append((char)(digit + '0'));\n if (--len <= 0)\n break;\n sBuf.append((char)DNSName.SEPARATOR);\n } while (true);\n return new DNSName(new String(sBuf), DNSName.IP6_INT);\n }",
"private static String getIPv6UrlRepresentation(Inet6Address address) {\n return getIPv6UrlRepresentation(address.getAddress());\n }",
"private static String getIPv6UrlRepresentation(byte[] addressBytes) {\n // first, convert bytes to 16 bit chunks\n int[] hextets = new int[8];\n for (int i = 0; i < hextets.length; i++) {\n hextets[i] = (addressBytes[2 * i] & 0xFF) << 8 | (addressBytes[2 * i + 1] & 0xFF);\n }\n\n // now, find the sequence of zeros that should be compressed\n int bestRunStart = -1;\n int bestRunLength = -1;\n int runStart = -1;\n for (int i = 0; i < hextets.length + 1; i++) {\n if (i < hextets.length && hextets[i] == 0) {\n if (runStart < 0) {\n runStart = i;\n }\n } else if (runStart >= 0) {\n int runLength = i - runStart;\n if (runLength > bestRunLength) {\n bestRunStart = runStart;\n bestRunLength = runLength;\n }\n runStart = -1;\n }\n }\n if (bestRunLength >= 2) {\n Arrays.fill(hextets, bestRunStart, bestRunStart + bestRunLength, -1);\n }\n\n // convert into text form\n StringBuilder buf = new StringBuilder(40);\n buf.append('[');\n\n boolean lastWasNumber = false;\n for (int i = 0; i < hextets.length; i++) {\n boolean thisIsNumber = hextets[i] >= 0;\n if (thisIsNumber) {\n if (lastWasNumber) {\n buf.append(':');\n }\n buf.append(Integer.toHexString(hextets[i]));\n } else {\n if (i == 0 || lastWasNumber) {\n buf.append(\"::\");\n }\n }\n lastWasNumber = thisIsNumber;\n }\n buf.append(']');\n return buf.toString();\n }",
"public static byte[] parseIPv6Literal(String s) {\n s = s != null ? s.trim() : \"\";\n if (s.length() > 0 && s.charAt(0) == '[' && s.charAt(s.length() - 1) == ']') {\n s = s.substring(1, s.length() - 1).trim();\n }\n int x = s.lastIndexOf(':');\n int y = s.indexOf('.');\n // Contains a dot! Look for IPv4 literal suffix.\n if (x >= 0 && y > x) {\n byte[] ip4Suffix = parseIPv4Literal(s.substring(x + 1));\n if (ip4Suffix == null) {\n return null;\n }\n s = s.substring(0, x) + \":\" + ip4ToHex(ip4Suffix);\n }\n\n // Check that we only have a single occurence of \"::\".\n x = s.indexOf(\"::\");\n if (x >= 0 && s.indexOf(\"::\", x + 1) >= 0) {\n return null;\n }\n\n // This array helps us expand the \"::\" into the zeroes it represents.\n String[] raw = new String[]{\"0000\", \"0000\", \"0000\", \"0000\", \"0000\", \"0000\", \"0000\", \"0000\"};\n if (s.indexOf(\"::\") >= 0) {\n String[] split = s.split(\"::\", -1);\n String[] prefix = splitOnColon(split[0]);\n String[] suffix = splitOnColon(split[1]);\n\n // Make sure the \"::\" zero-expander has some room to expand!\n if (prefix.length + suffix.length > 7) {\n return null;\n }\n for (int i = 0; i < prefix.length; i++) {\n raw[i] = prependZeroes(prefix[i]);\n }\n int startPos = raw.length - suffix.length;\n for (int i = 0; i < suffix.length; i++) {\n raw[startPos + i] = prependZeroes(suffix[i]);\n }\n } else {\n // Okay, whew, no \"::\" zero-expander, but we still have to make sure\n // each element contains 4 hex characters.\n raw = splitOnColon(s);\n if (raw.length != 8) {\n return null;\n }\n for (int i = 0; i < raw.length; i++) {\n raw[i] = prependZeroes(raw[i]);\n }\n }\n\n byte[] ip6 = new byte[16];\n int i = 0;\n for (String tok : raw) {\n if (tok.length() > 4) {\n return null;\n }\n String prefix = tok.substring(0, 2);\n String suffix = tok.substring(2, 4);\n try {\n ip6[i++] = (byte) Integer.parseInt(prefix, 16);\n ip6[i++] = (byte) Integer.parseInt(suffix, 16);\n } catch (NumberFormatException nfe) {\n return null;\n }\n }\n return ip6;\n }",
"public void decode(){\n String host = this.matcher.group(1);\n ArrayList<String> ipv6 = new ArrayList<>();\n for (int i=0; i < host.length(); i+=4){\n ipv6.add(host.substring(i, i+4).replaceAll(\"^0{0,3}\", \"\"));\n }\n this.host = String.join(\":\", ipv6);\n\n String port = this.matcher.group(2);\n // Decode as hex and ensure result is padded to 4 characters\n String portAsHex = BurpExtender.leftPad(Long.toHexString(Long.parseLong(port)), 4, '0');\n String reversedHex = portAsHex.substring(2, 4) + portAsHex.substring(0, 2);\n this.port = BurpExtender.hexStringToDecString(reversedHex);\n }",
"public void externalAddressRemoved(AddressSource source, boolean ipv6);",
"public static native long NetAddress_ipv6(byte[] addr, short port);",
"@Nullable\n @SerializedName(\"ipaddress-v6-loopback-0\")\n String getIpaddressV6Loopback0();",
"public void decode(){\n String routeId = this.matcher.group(1);\n String host = this.matcher.group(2);\n ArrayList<String> ipv6 = new ArrayList<>();\n for (int i=0; i < host.length(); i+=4){\n ipv6.add(host.substring(i, i+4).replaceAll(\"^0{0,3}\", \"\"));\n }\n this.host = String.join(\":\", ipv6) + \"%\" + routeId;\n\n this.port = this.matcher.group(3);\n }",
"java.lang.String getReplaceIp();",
"public String getIpv6() {\n return ipv6;\n }",
"private static final String getHostnameFrom(String str) {\n String[] tmp = str.split(\":\");\n if( tmp.length > 0 && tmp[0] != null ) return tmp[0];\n else return \"0.0.0.0\";\n }",
"private static String getHost(final String host) {\n final int colonIndex = host.indexOf(':');\n\n if (colonIndex == -1) {\n return host;\n }\n\n return host.substring(0, colonIndex);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the result of interpreting the object as an instance of 'Group'. This implementation returns null; returning a nonnull result will terminate the switch. | public T caseGroup(Group object) {
return null;
} | [
"public T caseGroupClass(GroupClass object) {\r\n\t\treturn null;\r\n\t}",
"public T caseGroupM(GroupM object) {\n\t\treturn null;\n\t}",
"public T caseGroupOpt(GroupOpt object)\n\t{\n\t\treturn null;\n\t}",
"public T caseGroupType(GroupType object) {\n\t\treturn null;\n\t}",
"public T caseGroupComponents(GroupComponents object) {\r\n\t\treturn null;\r\n\t}",
"public T caseGroupBoxElement(GroupBoxElement object)\n {\n return null;\n }",
"public T caseActorGroup(ActorGroup object) {\n\t\treturn null;\n\t}",
"public T caseQuestionnaireGroup(QuestionnaireGroup object) {\n\t\treturn null;\n\t}",
"Object getGroupID(String groupName) throws Exception;",
"public ObjectGroup getObjectGroup() {\r\n return ObjectGroup.forType(id);\r\n }",
"public Object getObject() {\n return getGroup();\n }",
"public T caseGroupContent(GroupContent object) {\n\t\treturn null;\n\t}",
"public T caseGroupMember(GroupMember object) {\n\t\treturn null;\n\t}",
"@Override\n\tpublic ECGroup getGroup() {\n\t\treturn (ECGroup) grp;\n\t}",
"public T caseUserGroup(UserGroup object) {\n\t\treturn null;\n\t}",
"IGroup getRootGroup();",
"private static Group getObjectFromCursor(ResultSet resultset) throws SQLException {\r\n\t\tGroup group = new Group();\r\n\t\tgroup.id = resultset.getInt(\"id\");\r\n\t\tgroup.name = resultset.getString(\"name\");\r\n group.keyword = resultset.getString(\"keyword\");\r\n group.level = resultset.getInt(\"level\");\r\n\t\treturn group;\r\n\t}",
"public boolean isGroupable() {return groupable;}",
"public T caseLoadGroup(LoadGroup object) {\n\t\treturn null;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If attribute is not a primary key, set null at position position of ps, else set attribute | public void setNull (PreparedStatement ps, String line, boolean key, int position, Date attribute) throws SQLException {
if (line.length() == 0 && !key) {
ps.setDate(position, null);
} else {
ps.setDate(position, attribute);
}
} | [
"public void setNull (PreparedStatement ps, String line, boolean key, int position, int attribute) throws SQLException {\n\t\tif (line.length() == 0 && !key) {\n\t\t\tps.setNull(position, java.sql.Types.INTEGER);\n\t\t} else {\n\t\t\tattribute = Integer.parseInt(line);\n\t\t\tps.setInt(position, attribute);\n\t\t}\n\t}",
"@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\t_dmGTShipPosition.setPrimaryKey(primaryKey);\n\t}",
"public void setPrimaryKey(long pk);",
"@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\t_rule.setPrimaryKey(primaryKey);\n\t}",
"public void setPrimaryKey(Proposal_HordingPK primaryKey);",
"@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\t_modelo.setPrimaryKey(primaryKey);\n\t}",
"@Override\n\tpublic void setPrimaryKey(int primaryKey) {\n\t\t_wfms_Associate_History.setPrimaryKey(primaryKey);\n\t}",
"@Override\n public void setPrimaryKey(long primaryKey) {\n _partido.setPrimaryKey(primaryKey);\n }",
"@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\t_paper.setPrimaryKey(primaryKey);\n\t}",
"@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\t_lineaGastoCategoria.setPrimaryKey(primaryKey);\n\t}",
"@Override\n protected void onNullNonKeyAttribute(String attributeName) {\n /* When doing a force put, we can safely ignore the null-valued attributes. */\n return;\n }",
"@Override\n public void setPrimaryKey(long primaryKey) {\n _review.setPrimaryKey(primaryKey);\n }",
"@Override\n public void setPrimaryKey(long primaryKey) {\n _entity1.setPrimaryKey(primaryKey);\n }",
"@Override\n public void setPrimaryKey(long primaryKey) {\n _person.setPrimaryKey(primaryKey);\n }",
"@Override\n public void setPrimaryKey(long primaryKey) {\n _proposalContestPhaseAttribute.setPrimaryKey(primaryKey);\n }",
"@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\t_expandoColumn.setPrimaryKey(primaryKey);\n\t}",
"@Override\n public void setPrimaryKey(long primaryKey) {\n _gameScore.setPrimaryKey(primaryKey);\n }",
"public PropertyDefinition setPrimaryKeyOrder(int pOrder);",
"@Override\n\tpublic void setPrimaryKey(long primaryKey) {\n\t\t_faqCategoryQuestion.setPrimaryKey(primaryKey);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, fboId[0]); This multiplies the view matrix by the model matrix, and stores the result in the MVP matrix (which currently contains model view). | private void drawStatic() {
Matrix.multiplyMM(mMVPMatrix, 0, mViewMatrix, 0, mModelMatrix, 0);
// Pass in the modelview matrix.
GLES20.glUniformMatrix4fv(mMVMatrixHandle, 1, false, mMVPMatrix, 0);
// This multiplies the modelview matrix by the projection matrix, and stores the result in the MVP matrix
// (which now contains model * view * projection).
Matrix.multiplyMM(mTemporaryMatrix, 0, mProjectionMatrix, 0, mMVPMatrix, 0);
System.arraycopy(mTemporaryMatrix, 0, mMVPMatrix, 0, 16);
// Pass in the combined matrix.
GLES20.glUniformMatrix4fv(mMVPMatrixHandle, 1, false, mMVPMatrix, 0);
// Pass in the light position in eye space.
GLES20.glUniform3f(mLightPosHandle, mLightPosInEyeSpace[0], mLightPosInEyeSpace[1], mLightPosInEyeSpace[2]);
} | [
"public void pushModelMatrix()\r\n\t{\r\n\t\tgl.glMatrixMode(GL_MODELVIEW);\r\n\t\tgl.glPushMatrix();\r\n\t}",
"public void bind() {GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, mFrameBufferHandle[0]);}",
"private void updateMvpMatrix() {\n multiplyMM(modelViewMatrix, 0, viewMatrix, 0, modelMatrix, 0);\n invertM(tempMatrix, 0, modelViewMatrix, 0);\n transposeM(it_modelViewMatrix, 0, tempMatrix, 0);\n multiplyMM(modelViewProjectionMatrix, 0, projectionMatrix, 0, modelViewMatrix, 0);\n }",
"public void bindFrameBuffer() {\r\n\t\tGL11.glBindTexture(GL11.GL_TEXTURE_2D, 0);\r\n\t\tGL30.glBindFramebuffer(GL30.GL_DRAW_FRAMEBUFFER, frameBuffer);\r\n\t\tGL11.glViewport(0, 0, width, height);\r\n\t}",
"public void updateMvpMatrix()\n\t\t{\n\t\t\t// Set the matrix, specifying the edges of the visible canvas and the near and far clipping planes.\n\t\t\tMatrix.orthoM(mvpMatrix, 0,\n\t\t\t\t\t-viewportWidth / (2f * zoom) + cameraX,\n\t\t\t\t\tviewportWidth / (2f * zoom) + cameraX,\n\t\t\t\t\t-viewportHeight / (2f * zoom) + cameraY,\n\t\t\t\t\tviewportHeight / (2f * zoom) + cameraY, -1, 1);\n\t\t}",
"public void bind(){\n glBindFramebuffer(GL_FRAMEBUFFER, id);\n }",
"protected void setModelViewMatrix(DrawContext dc)\n {\n if (dc.getGL() == null)\n {\n String message = Logging.getMessage(\"nullValue.DrawingContextGLIsNull\");\n Logging.logger().severe(message);\n throw new IllegalStateException(message);\n }\n\n Matrix matrix = dc.getView().getModelviewMatrix();\n matrix = matrix.multiply(this.computeRenderMatrix(dc));\n\n GL2 gl = dc.getGL().getGL2(); // GL initialization checks for GL2 compatibility.\n gl.glMatrixMode(GL2.GL_MODELVIEW);\n\n double[] matrixArray = new double[16];\n matrix.toArray(matrixArray, 0, false);\n gl.glLoadMatrixd(matrixArray, 0);\n }",
"static public void captureViewMatrix(GL2 gl) {\n if (gl != null) {\n // m_iProjection = projection;\n gl.glGetDoublev(GLMatrixFunc.GL_MODELVIEW_MATRIX, m_adModelview, 0);\n gl.glGetDoublev(GLMatrixFunc.GL_PROJECTION_MATRIX, m_adProjection, 0);\n gl.glGetIntegerv(GL.GL_VIEWPORT, m_aiViewport, 0);\n }\n }",
"public PMVMatrix(boolean useBackingArray) {\n projectFloat = new ProjectFloat();\n \n // I Identity\n // T Texture\n // P Projection\n // Mv ModelView\n // Mvi Modelview-Inverse\n // Mvit Modelview-Inverse-Transpose\n if(useBackingArray) {\n matrixBufferArray = new float[6*16];\n matrixBuffer = null;\n // matrixBuffer = FloatBuffer.wrap(new float[12*16]);\n } else {\n matrixBufferArray = null;\n matrixBuffer = Buffers.newDirectByteBuffer(6*16 * Buffers.SIZEOF_FLOAT);\n matrixBuffer.mark();\n }\n \n matrixIdent = slice2Float(matrixBuffer, matrixBufferArray, 0*16, 1*16); // I\n matrixTex = slice2Float(matrixBuffer, matrixBufferArray, 1*16, 1*16); // T\n matrixPMvMvit = slice2Float(matrixBuffer, matrixBufferArray, 2*16, 4*16); // P + Mv + Mvi + Mvit \n matrixPMvMvi = slice2Float(matrixBuffer, matrixBufferArray, 2*16, 3*16); // P + Mv + Mvi\n matrixPMv = slice2Float(matrixBuffer, matrixBufferArray, 2*16, 2*16); // P + Mv\n matrixP = slice2Float(matrixBuffer, matrixBufferArray, 2*16, 1*16); // P\n matrixMv = slice2Float(matrixBuffer, matrixBufferArray, 3*16, 1*16); // Mv\n matrixMvi = slice2Float(matrixBuffer, matrixBufferArray, 4*16, 1*16); // Mvi\n matrixMvit = slice2Float(matrixBuffer, matrixBufferArray, 5*16, 1*16); // Mvit\n \n if(null != matrixBuffer) {\n matrixBuffer.reset();\n } \n ProjectFloat.gluMakeIdentityf(matrixIdent);\n \n vec3f = new float[3];\n matrixMult = new float[16];\n matrixTrans = new float[16];\n matrixRot = new float[16];\n matrixScale = new float[16];\n matrixOrtho = new float[16];\n matrixFrustum = new float[16];\n ProjectFloat.gluMakeIdentityf(matrixTrans, 0);\n ProjectFloat.gluMakeIdentityf(matrixRot, 0);\n ProjectFloat.gluMakeIdentityf(matrixScale, 0);\n ProjectFloat.gluMakeIdentityf(matrixOrtho, 0);\n ProjectFloat.gluMakeZero(matrixFrustum, 0);\n \n matrixPStack = new ArrayList<float[]>();\n matrixMvStack= new ArrayList<float[]>();\n \n // default values and mode\n glMatrixMode(GL_PROJECTION);\n glLoadIdentity();\n glMatrixMode(GL_MODELVIEW);\n glLoadIdentity();\n glMatrixMode(GL.GL_TEXTURE);\n glLoadIdentity();\n setDirty();\n update();\n }",
"private void setUpVBOs(){\n\t\tgl.glGenBuffers(1,vboVertexHandle,0);\n\t\tgl.glGenBuffers(1,vboNormalHandle,0);\n\t\tgl.glGenBuffers(1,vboTexCoordHandle,0);\n\t\t\n\t\tif(!m.isLoaded()) // draw nothing if there is no model loaded, so stop init VBO\n\t\t\treturn;\n\t\t\n\t\tint sizeOfBuffers = m.faces.size() * 36; // 3*3*4\n\t\tFloatBuffer vertices = reserveData(sizeOfBuffers); // allocate memory for buffer\n\t\tFloatBuffer normals = reserveData(sizeOfBuffers); // allocate memory for buffer\n\t\tFloatBuffer texcoords = reserveData(sizeOfBuffers); // allocate memory for buffer\n\t\tfor(Face face : m.faces){\n\t\t\tvertices.put(asFloats(m.vertices.get((int) face.vertex.x-1)));\n\t\t\tvertices.put(asFloats(m.vertices.get((int) face.vertex.y-1)));\n\t\t\tvertices.put(asFloats(m.vertices.get((int) face.vertex.z-1)));\n\t\t\t\n\t\t\ttexcoords.put(asFloats(m.texcoords.get((int) face.texcoord.x-1)));\n\t\t\ttexcoords.put(asFloats(m.texcoords.get((int) face.texcoord.y-1)));\n\t\t\ttexcoords.put(asFloats(m.texcoords.get((int) face.texcoord.z-1)));\n\t\t\t\n\t\t\tnormals.put(asFloats(m.normals.get((int) face.normals.x-1)));\n\t\t\tnormals.put(asFloats(m.normals.get((int) face.normals.y-1)));\n\t\t\tnormals.put(asFloats(m.normals.get((int) face.normals.z-1)));\n\t\t}\n\t\t// make the buffers readable for GL\n\t\tvertices.flip();\n\t\tnormals.flip();\n\t\ttexcoords.flip();\n\t\t\n\t\tgl.glBindBuffer(GL.GL_ARRAY_BUFFER, vboVertexHandle[0]);\n\t\tgl.glBufferData(GL.GL_ARRAY_BUFFER,sizeOfBuffers,vertices, GL.GL_STATIC_DRAW);\n\t\tgl.glBindBuffer(GL.GL_ARRAY_BUFFER,vboNormalHandle[0]);\n\t\tgl.glBufferData(GL.GL_ARRAY_BUFFER,sizeOfBuffers,normals, GL.GL_STATIC_DRAW);\n\t\tgl.glBindBuffer(GL.GL_ARRAY_BUFFER,vboTexCoordHandle[0]);\n\t\tgl.glBufferData(GL.GL_ARRAY_BUFFER,sizeOfBuffers,texcoords, GL.GL_STATIC_DRAW);\n\t\t\n\t\tgl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0); // unbind the buffer\n\t}",
"public void popModelMatrix()\r\n\t{\r\n\t\tgl.glMatrixMode(GL_MODELVIEW);\r\n\t\tgl.glPopMatrix();\r\n\t}",
"public interface GLMatrixFunc {\r\n\r\n public static final int GL_MATRIX_MODE = 0x0BA0;\r\n /** Matrix mode modelview */\r\n public static final int GL_MODELVIEW = 0x1700;\r\n /** Matrix mode projection */\r\n public static final int GL_PROJECTION = 0x1701;\r\n // public static final int GL_TEXTURE = 0x1702; // Use GL.GL_TEXTURE due to ambiguous GL usage\r\n /** Matrix access name for modelview */\r\n public static final int GL_MODELVIEW_MATRIX = 0x0BA6;\r\n /** Matrix access name for projection */\r\n public static final int GL_PROJECTION_MATRIX = 0x0BA7;\r\n /** Matrix access name for texture */\r\n public static final int GL_TEXTURE_MATRIX = 0x0BA8;\r\n\r\n /**\r\n * Copy the named matrix into the given storage.\r\n * @param pname {@link #GL_MODELVIEW_MATRIX}, {@link #GL_PROJECTION_MATRIX} or {@link #GL_TEXTURE_MATRIX}\r\n * @param params the FloatBuffer's position remains unchanged,\r\n * which is the same behavior than the native JOGL GL impl\r\n */\r\n public void glGetFloatv(int pname, java.nio.FloatBuffer params);\r\n\r\n /**\r\n * Copy the named matrix to the given storage at offset.\r\n * @param pname {@link #GL_MODELVIEW_MATRIX}, {@link #GL_PROJECTION_MATRIX} or {@link #GL_TEXTURE_MATRIX}\r\n * @param params storage\r\n * @param params_offset storage offset\r\n */\r\n public void glGetFloatv(int pname, float[] params, int params_offset);\r\n\r\n /**\r\n * glGetIntegerv\r\n * @param pname {@link #GL_MATRIX_MODE} to receive the current matrix mode\r\n * @param params the FloatBuffer's position remains unchanged\r\n * which is the same behavior than the native JOGL GL impl\r\n */\r\n public void glGetIntegerv(int pname, IntBuffer params);\r\n public void glGetIntegerv(int pname, int[] params, int params_offset);\r\n\r\n /**\r\n * Sets the current matrix mode.\r\n * @param mode {@link #GL_MODELVIEW}, {@link #GL_PROJECTION} or {@link GL#GL_TEXTURE GL_TEXTURE}.\r\n */\r\n public void glMatrixMode(int mode) ;\r\n\r\n /**\r\n * Push the current matrix to it's stack, while preserving it's values.\r\n * <p>\r\n * There exist one stack per matrix mode, i.e. {@link #GL_MODELVIEW}, {@link #GL_PROJECTION} and {@link GL#GL_TEXTURE GL_TEXTURE}.\r\n * </p>\r\n */\r\n public void glPushMatrix();\r\n\r\n /**\r\n * Pop the current matrix from it's stack.\r\n * @see #glPushMatrix()\r\n */\r\n public void glPopMatrix();\r\n\r\n /**\r\n * Load the current matrix with the identity matrix\r\n */\r\n public void glLoadIdentity() ;\r\n\r\n /**\r\n * Load the current matrix w/ the provided one.\r\n * @param params the FloatBuffer's position remains unchanged,\r\n * which is the same behavior than the native JOGL GL impl\r\n */\r\n public void glLoadMatrixf(java.nio.FloatBuffer m) ;\r\n /**\r\n * Load the current matrix w/ the provided one.\r\n */\r\n public void glLoadMatrixf(float[] m, int m_offset);\r\n\r\n /**\r\n * Multiply the current matrix: [c] = [c] x [m]\r\n * @param m the FloatBuffer's position remains unchanged,\r\n * which is the same behavior than the native JOGL GL impl\r\n */\r\n public void glMultMatrixf(java.nio.FloatBuffer m) ;\r\n /**\r\n * Multiply the current matrix: [c] = [c] x [m]\r\n */\r\n public void glMultMatrixf(float[] m, int m_offset);\r\n\r\n /**\r\n * Translate the current matrix.\r\n */\r\n public void glTranslatef(float x, float y, float z) ;\r\n\r\n /**\r\n * Rotate the current matrix.\r\n */\r\n public void glRotatef(float angle, float x, float y, float z);\r\n\r\n /**\r\n * Scale the current matrix.\r\n */\r\n public void glScalef(float x, float y, float z) ;\r\n\r\n /**\r\n * {@link #glMultMatrixf(FloatBuffer) Multiply} the current matrix with the orthogonal matrix.\r\n */\r\n public void glOrthof(float left, float right, float bottom, float top, float zNear, float zFar) ;\r\n\r\n /**\r\n * {@link #glMultMatrixf(FloatBuffer) Multiply} the current matrix with the frustum matrix.\r\n */\r\n public void glFrustumf(float left, float right, float bottom, float top, float zNear, float zFar);\r\n\r\n}",
"public void begin() {\n if (id == 0)\n throw new IllegalStateException(\"can't use FBO as it has been destroyed..\");\n glViewport(0, 0, getWidth(), getHeight());\n glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, id);\n //glReadBuffer(GL_COLOR_ATTACHMENT0);\n }",
"public void renderModel(){\r\n \tif(visible){\r\n\t\t\tif(modelLocation != null){\r\n\t\t\t\tif(!modelDisplayLists.containsKey(modelLocation)){\r\n\t\t\t\t\tparseModel(modelLocation);\r\n\t\t\t\t}\r\n\t\t\t\tGL11.glPushMatrix();\r\n\t\t\t\t//Translate to position and rotate to isometric view if required.\r\n\t\t\t\tGL11.glTranslatef(x, y, 100);\r\n\t\t\t\tGL11.glRotatef(180, 0, 0, 1);\r\n\t\t\t\tif(isometric){\r\n\t\t\t\t\tGL11.glRotatef(45, 0, 1, 0);\r\n\t\t\t\t\tGL11.glRotatef(35.264F, 1, 0, 1);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//If set to rotate, do so now based on time.\r\n\t\t\t\tif(spin){\r\n\t\t\t\t\tGL11.glRotatef((36*System.currentTimeMillis()/1000)%360, 0, 1, 0);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//Scale based on our scaling factor and render.\r\n\t\t\t\tif(!staticScaling){\r\n\t\t\t\t\tscale = modelScalingFactors.get(modelLocation);\r\n\t\t\t\t}\r\n\t\t\t\tGL11.glScalef(scale*scaleFactor, scale*scaleFactor, scale*scaleFactor);\r\n\t\t\t\tGL11.glCallList(modelDisplayLists.get(modelLocation));\r\n\t\t\t\tGL11.glPopMatrix();\r\n\t\t\t}\r\n\t\t}\r\n }",
"public void setView(){\n getViewport();\n gl.glMatrixMode(GL2.GL_PROJECTION);\n gl.glLoadIdentity();\n double rx, ry;\n \n switch(projection) {\n case ONETRACE:\n dscale=Math.abs(ascale/(ymax-ymin));\n gl.glOrtho(0.0, 1.0, 0.0, aspect, 0.0, -1.0);\n gl.glTranslated(-xoffset/xscale, yoffset*aspect, 0.0);\n gl.glScaled(1.0/xscale, ascale/(ymax - ymin), 1.0);\n getProjectionMatrix();\n break;\n case OBLIQUE:\n double fdx = 1 - Math.abs(delx);\n double xoff=(delx >= 0)?0:Math.abs(delx); \n double yoff=aspect/(traces - 1);\n double xview = -fdx * xoffset/xscale;\n \n double dyz=0.9*(1-yoff/aspect)*dely;\n yoff=(yoff-0.5)*dely+0.5;\n \n double dzx=delx;\n double mat[]=new double[16];\n mat[0]=2; mat[4]=0; mat[8]=2*dzx; mat[12]=-1;\n mat[1]=0; mat[5]=2/aspect; mat[9]=2*dyz; mat[13]=-1;\n mat[2]=0; mat[6]=0; mat[10]=2; mat[14]=-1;\n mat[3]=0; mat[7]=0; mat[11]=0; mat[15]=1;\n \n dscale=Math.abs(ascale/(ymax-ymin));\n gl.glLoadMatrixd(mat,0);\n gl.glTranslated(xview+xoff, yoff+yoffset, 0.0);\n gl.glScaled(fdx/xscale, dscale, 1.0);\n getProjectionMatrix();\n break;\n case TWOD:\n {\n \tdouble ca=Math.cos(tilt*RPD);\n \tdouble ys=0.5*Math.abs(ascale/(ymax-ymin)); \n \tdouble zs=2.0+ys;\n \tdscale=ys;\n gl.glOrtho(-0.5, 0.5, aspect/2,-aspect/2, -zs, zs);\n gl.glTranslated( -(xoffset+0.5)/yscale, 0.0, 0);\n gl.glRotated(90, 1, 0, 0);\n gl.glTranslated(0, 0, zoffset/yscale-0.5*aspect*ca);\n gl.glScaled(1/yscale, 1, 1/yscale);\n gl.glRotated(tilt, 1, 0, 0);\n gl.glTranslated(0.5, 0, 0.5);\n gl.glRotated(twist, 0, 1, 0);\n gl.glScaled(1, ys, 1);\n gl.glTranslated(-0.5, 0, -0.5);\n getProjectionMatrix();\n }\n break;\n case SLICES:\n case THREED:\n \tdouble ca=Math.cos(rotx*RPD);\n \tgl.glOrtho(-0.5, 0.5, -0.5*aspect, 0.5*aspect, 1, -1);\n gl.glTranslated( -0.5/zscale, 0.0, 0);\n gl.glRotated(90, 1, 0, 0);\n gl.glTranslated(0, 0, -0.5*aspect*ca);\n gl.glScaled(1/zscale, 1/zscale, 1/zscale);\n gl.glRotated(rotx, 1, 0, 0);\n gl.glTranslated(0.5, 0, 0.5);\n gl.glRotated(roty, 0, -1, 0);\n gl.glTranslated(-0.5, 0, -0.5);\n getProjectionMatrix();\n break;\n \n }\n setEyeVector();\n gl.glMatrixMode(GL2.GL_MODELVIEW);\n gl.glLoadIdentity();\n }",
"@JsProperty(name = \"viewMatrix\")\n public native Matrix4 viewMatrix();",
"protected synchronized void resetModelViewMatrix()\n {\n Matrix4d transform = new Matrix4d();\n // translate so that the viewer is at the origin\n Matrix4d translation = new Matrix4d();\n translation.setTranslation(myPosition.getLocation().multiply(-1.));\n // rotate to put the viewer pointing in the -z direction with the up\n // vector along the +y axis.\n Quaternion quat = Quaternion.lookAt(myPosition.getDir().multiply(-1.), myPosition.getUp());\n Matrix4d rotation = new Matrix4d();\n rotation.setRotationQuaternion(quat);\n // set the transform.\n transform.multLocal(rotation);\n transform.multLocal(translation);\n myModelViewMatrix = transform.toFloatArray();\n setInverseModelViewMatrix(transform.invert());\n clearModelToWindowTransform();\n }",
"protected void applyMatrices () {\n combinedMatrix.set(projectionMatrix).mul(transformMatrix);\n getShader().setUniformMatrix(\"u_projTrans\", combinedMatrix);\n }",
"protected void updateMatrices() {\n\n\t\tcanvasToScreenMatrix.reset();\n\t\tcanvasToScreenMatrix.preTranslate(canvasTranslation.x, canvasTranslation.y);\n\t\tcanvasToScreenMatrix.preScale(canvasScale, canvasScale);\n\n\t\tscreenToCanvasMatrix.reset();\n\t\tif (!canvasToScreenMatrix.invert(screenToCanvasMatrix)) {\n\t\t\tLog.e(TAG, \"updateMatrices: Unable to invert canvasToScreenMatrix\");\n\t\t}\n\n\t\t// update viewportCanvasRect\n\t\tscreenToCanvasMatrix.mapRect(viewportCanvasRect, viewportScreenRect);\n\n\t\t// this is required to maintain viewport center location during rotations\n\t\tcanvasOriginRelativeToViewportCenter = new PointF();\n\t\tcanvasOriginRelativeToViewportCenter.x = getCanvasTranslationX() - viewportScreenRect.centerX();\n\t\tcanvasOriginRelativeToViewportCenter.y = getCanvasTranslationY() - viewportScreenRect.centerY();\n\n\t\t// and notify doodle\n\t\tdoodle.canvasMatricesUpdated();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test finding an order by cart order GUID will not return an order that does not match the cart order GUID. | @DirtiesDatabase
@Test
public void testFindLatestOrderGuidByCartOrderGuidWhenManyOrdersExistForACartOrderButDoesNotMatchCartOrderGuidArgument() {
createOrderWithCartOrderGuid(product, CART_ORDER_GUID);
String result = orderService.findLatestOrderGuidByCartOrderGuid(DIFFERENT_CART_ORDER_GUID);
assertNull("There should be no order guid returned.", result);
} | [
"@DirtiesDatabase\n\t@Test\n\tpublic void testFindLatestOrderGuidByCartOrderGuidWhenNoCartOrdersExist() {\n\t\t// create an order with no cart order GUID assigned\n\t\tpersistOrder(product);\n\t\tString result = orderService.findLatestOrderGuidByCartOrderGuid(NON_EXISTENT_CART_ORDER_GUID);\n\t\tassertNull(\"There should be no order guid returned.\", result);\n\t}",
"@DirtiesDatabase\n\t@Test\n\tpublic void testFindLatestOrderGuidByCartOrderGuidWhenManyOrdersExistForACartOrder() {\n\t\tOrder firstOrder = createOrderWithCartOrderGuid(product, CART_ORDER_GUID);\n\t\tOrder secondOrder = createOrderWithCartOrderGuid(product, CART_ORDER_GUID);\n\t\tOrder thirdOrder = createOrderWithCartOrderGuid(product, CART_ORDER_GUID);\n\n\t\tString result = orderService.findLatestOrderGuidByCartOrderGuid(CART_ORDER_GUID);\n\t\tassertFalse(\"The returned order guid should not equal the first order created.\", firstOrder.getGuid().equals(result));\n\t\tassertFalse(\"The returned order guid should not equal the second order created.\", secondOrder.getGuid().equals(result));\n\t\tassertEquals(\"The order guid should be the same as the last order created.\", thirdOrder.getGuid(), result);\n\t}",
"@DirtiesDatabase\n\t@Test\n\tpublic void testFindBySearchCriteriaStoreCodeWithoutExcludedOrderStatusSetToFailedOrder() {\n\t\tOrder order = createAndPersistFailedOrder(product);\n\n\t\tOrderSearchCriteria criteria = getBeanFactory().getBean(ContextIdNames.ORDER_SEARCH_CRITERIA);\n\t\tSet<String> storeCodes = new HashSet<String>();\n\t\tstoreCodes.add(scenario.getStore().getCode());\n\t\tcriteria.setStoreCodes(storeCodes);\n\n\t\tList<Order> results = orderService.findOrdersBySearchCriteria(criteria, 0, MAX_RESULTS);\n\t\tassertEquals(\"One order should have been found\", 1, results.size());\n\t\tassertEquals(\"The search result should be the expected order\", order, results.get(0));\n\t}",
"@DirtiesDatabase\n\t@Test\n\tpublic void testFindProductCodesPurchasedByUserExcludeFailedOrder() {\n\t\t// construct and save new shopping cart\n\t\tOrder order = createOrder();\n\t\torder.failOrder();\n\t\torder = orderService.update(order);\n\n\t\t// Make sure we get that list back\n\t\tPurchaseHistorySearchCriteria criteria = createPurchaseHistorySearchCriteria(null, //no from date\n\t\t\t\tnew Date()); // now\n\n\t\tList<String> purchasedProductCodes = orderService.findProductCodesPurchasedByUser(criteria);\n\t\tassertNotNull(purchasedProductCodes);\n\t\tassertTrue(\"The product codes for a failed order should not be retrieved.\", purchasedProductCodes.isEmpty());\n\t}",
"@Test\n\tpublic void testOrderWithoutShoppingCart() {\n\t\ttry {\n\t\t\tassertEquals(orderService.order(order), null);\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}",
"@DirtiesDatabase\n\t@Test\n\tpublic void testFindOrderByCustomerGuid() {\n\t\tOrder order = createOrder();\n\n\t\tString customerGuid = shopper.getCustomer().getGuid();\n\t\tList<Order> orderByCustomerGuid = orderService.findOrderByCustomerGuid(customerGuid, true);\n\t\tassertEquals(\"There should be 1 order found\", 1, orderByCustomerGuid.size());\n\t\tassertEquals(\"The order should be the one we created\", order, orderByCustomerGuid.get(0));\n\t\tList<Order> orderByOtherCustomer = orderService.findOrderByCustomerGuid(INVALID_GUID, true);\n\t\tassertTrue(\"There should be no orders found when customer guid does not match.\", orderByOtherCustomer.isEmpty());\n\n\t\torder.failOrder();\n\t\torder = orderService.update(order);\n\n\t\torderByCustomerGuid = orderService.findOrderByCustomerGuid(customerGuid, true);\n\t\tassertTrue(\"There should be no orders found\", orderByCustomerGuid.isEmpty());\n\t}",
"@DirtiesDatabase\n\t@Test\n\t@SuppressWarnings(\"deprecation\")\n\tpublic void testFindOrderByCustomerGuidAndStoreCodeWithoutFullInfo() {\n\t\tOrder order = createOrder();\n\n\t\tString customerGuid = shopper.getCustomer().getGuid();\n\t\tList<Order> retrievedOrders = orderService.findOrdersByCustomerGuidAndStoreCode(customerGuid, store.getCode(), false);\n\t\tassertEquals(\"There should be 1 order found\", 1, retrievedOrders.size());\n\n\t\tOrder retrievedOrder = retrievedOrders.get(0);\n\t\tassertEquals(\"The order number should be the one we created\", order.getOrderNumber(), retrievedOrder.getOrderNumber());\n\t\tassertEquals(\"The order store name should be the one we created\", order.getStore().getName(), retrievedOrder.getStore().getName());\n\t\tassertEquals(\"The order store url should be the one we created\", order.getStore().getUrl(), retrievedOrder.getStore().getUrl());\n\t\tassertEquals(\"The order total should be the one we created\", order.getTotal(), retrievedOrder.getTotal());\n\t\tassertEquals(\"The order created date should be the one we created\", order.getCreatedDate(), retrievedOrder.getCreatedDate());\n\t\tassertEquals(\"The order status should be the one we created\", order.getStatus(), retrievedOrder.getStatus());\n\t\tassertNull(\"Billing address field shouldn't be retrieved\", retrievedOrder.getBillingAddress());\n\t\tassertNull(\"Applied rules field shouldn't be retrieved\", retrievedOrder.getAppliedRules());\n\n\t\tList<Order> orderByOtherCustomer = orderService.findOrdersByCustomerGuidAndStoreCode(INVALID_GUID, store.getCode(), false);\n\t\tassertTrue(\"There should be no orders found when customer guid does not match.\", orderByOtherCustomer.isEmpty());\n\t}",
"@DirtiesDatabase\n\t@Test\n\tpublic void testFindOrderByCustomerGuidAndStoreCode() {\n\t\tOrder order = createOrder();\n\n\t\tString customerGuid = shopper.getCustomer().getGuid();\n\t\tList<Order> orderByCustomerGuid = orderService.findOrdersByCustomerGuidAndStoreCode(customerGuid, store.getCode(), true);\n\t\tassertEquals(\"There should be 1 order found\", 1, orderByCustomerGuid.size());\n\t\tassertEquals(\"The order should be the one we created\", order, orderByCustomerGuid.get(0));\n\t\tList<Order> orderByOtherCustomer = orderService.findOrdersByCustomerGuidAndStoreCode(INVALID_GUID, store.getCode(), true);\n\t\tassertTrue(\"There should be no orders found when customer guid does not match.\", orderByOtherCustomer.isEmpty());\n\n\t\torder.failOrder();\n\t\torder = orderService.update(order);\n\n\t\torderByCustomerGuid = orderService.findOrdersByCustomerGuidAndStoreCode(customerGuid, store.getCode(), true);\n\t\tassertTrue(\"There should be no orders found\", orderByCustomerGuid.isEmpty());\n\t}",
"@org.junit.Test\r\n\tpublic void itemNotInCartException() throws ProductNotFoundException{\r\n\t\tShoppingCart cart=new ShoppingCart();\r\n\t\tProduct tomato=new Product(\"Tomato\",3);\r\n\t\tcart.addItem(new Product(\"Orange\",5));\r\n\t\t\r\n\t\t//trying to remove a tomato from the cart\r\n\t\ttry {\r\n\t\t\tcart.removeItem(tomato);\r\n\t\t\tfail();\r\n\t\t\t\r\n\t\t}catch(ProductNotFoundException e) {\r\n\t\t\t\r\n\t\t}\r\n\t}",
"public static boolean testRemoveItemNotFoundInCart() {\n boolean testPassed = true; // boolean local variable evaluated to true if this test passed,\n // false otherwise\n String[] cart = new String[20]; // shopping cart with capacity to store 20 items\n int count = 0; // number of items present in the cart (initially the cart is empty)\n count = ShoppingCart.add(0, cart, count);\n count = ShoppingCart.add(0, cart, count);\n count = ShoppingCart.remove(\"Banana\", cart, count); // calls remove method to remove item that\n // is not in the cart\n // Checks that removal of item not in the cart does not affect occurrences of items in the cart\n if (ShoppingCart.occurrencesOf(0, cart, count) != 2) {\n System.out.println(\"Problem detected: Removing \\\"banana\\\" from the cart should not reduce \"\n + \"the count because it isn't present in the cart\");\n testPassed = false;\n }\n return testPassed;\n }",
"@Test\n public void testPayUnpaidOrderFails() throws Exception {\n\n // login with sufficient rights\n shop.login(admin.getUsername(), admin.getPassword());\n\n // issue an order\n int orderId = shop.issueOrder(productCode, 10, 1);\n\n // trying to pay for an order with receiveCashPayment fails\n assertEquals(-1, shop.receiveCashPayment(orderId, 10), 0.001);\n\n // verify order is still in ISSUED state\n assertEquals(\"ISSUED\", shop.getAllOrders().stream()\n .filter(b -> b.getBalanceId() == orderId)\n .map(Order::getStatus)\n .findAny()\n .orElse(null));\n\n // verify system's balance did not change\n assertEquals(totalBalance, shop.computeBalance(), 0.001);\n }",
"@Test\n public void InvalidOrderId() throws IOException {\n String invalidOrderId=\"\";\n String filename = \"BillingLines.json\";\n String filePath = Utilities.buildFilePath(\"BillingLineItems/\", filename);\n String payload = Utilities.readFile(filePath);\n JSONObject obj = new JSONObject(payload);\n obj.remove(\"orderId\");\n obj.put(\"orderId\", invalidOrderId);\n payload = obj.toString();\n Response response = APIRequests.executeRequest(url, path, payload, \"\", \"post\");\n String errorMsg = \"\";\n if (response.getBody().asString().contains(\"errors\")) {\n errorMsg = Utilities.getErrorMessage(response.getBody().asString());\n\n }\n String errorMsg1 = errorMsg;\n String errMsg_notFound = \"Order Id not found.\";\n String errMsg_invalidFormat = \"Error converting value \\\"\" + invalidOrderId + \"\\\" to type 'System.Guid'. Path 'orderId'\";\n Assert.assertEquals(\"Check error message for non exisiting ID \", errMsg_invalidFormat, errorMsg1);\n\n }",
"@Test\n public void testGetOrder() throws Exception {\n Order order = service.getOrder(\"123\");\n assertNotNull(order);\n order = service.getOrder(\"321\");\n assertNull(order);\n }",
"@DirtiesDatabase\n\t@Test\n\tpublic void testFindFailedOrderUids() {\n\t\tOrder order = persistOrder(product);\n\n\t\tfinal long ninetyDaysInMillis = 90L * 24 * 60 * 60 * 1000;\n\t\tDate now = timeService.getCurrentTime();\n\t\tDate past = new Date(now.getTime() - ninetyDaysInMillis);\n\n\t\tfinal int maxResults = 10;\n\t\tList<Long> failedOrders = orderService.getFailedOrderUids(past, maxResults);\n\t\tassertTrue(\"There should be no failed orders\", failedOrders.isEmpty());\n\n\t\tfailedOrders = orderService.getFailedOrderUids(now, maxResults);\n\t\tassertTrue(\"There should be no failed orders\", failedOrders.isEmpty());\n\n\t\torder.failOrder();\n\t\torder = orderService.update(order);\n\n\t\tfailedOrders = orderService.getFailedOrderUids(past, maxResults);\n\t\tassertTrue(\"There should be no failed orders\", failedOrders.isEmpty());\n\n\t\tfailedOrders = orderService.getFailedOrderUids(now, maxResults);\n\t\tassertEquals(\"There should be one order returned\", 1, failedOrders.size());\n\n\t\tLong failedOrderUid = failedOrders.get(0);\n\t\tassertEquals(\"The failed order should be the we updated\", order.getUidPk(), failedOrderUid.longValue());\n\t}",
"public void testCancelledPurchaseOrderItemQuantities() throws Exception {\n GenericValue cancelProduct = createTestProduct(\"Physical product for testing PO item quantities after cancellation\", admin);\n createMainSupplierForProduct(cancelProduct.getString(\"productId\"), demoSupplier.getString(\"partyId\"), new BigDecimal(\"10.0\"), \"USD\", new BigDecimal(\"0.0\"), admin);\n \n Map<GenericValue, BigDecimal> orderSpec = new HashMap<GenericValue, BigDecimal>();\n orderSpec.put(cancelProduct, new BigDecimal(\"10.0\"));\n PurchaseOrderFactory pof = testCreatesPurchaseOrder(orderSpec, demoSupplier, facilityContactMechId);\n String orderId = pof.getOrderId();\n \n // cancel the cancel product\n pof.cancelProduct(cancelProduct, new BigDecimal(\"10.0\"));\n \n OrderRepositoryInterface repository = getOrderRepository(admin);\n Order order = repository.getOrderById(pof.getOrderId());\n OrderItem cancelOrderItem = repository.getOrderItem(order, \"00001\");\n assertEquals(\"Order [\" + orderId + \"] item [\" + cancelOrderItem.getOrderItemSeqId() + \"] quantity is not correct\", cancelOrderItem.getQuantity(), new BigDecimal(\"10.0\"));\n assertEquals(\"Order [\" + orderId + \"] item [\" + cancelOrderItem.getOrderItemSeqId() + \"] cancelled quantity is not correct\", cancelOrderItem.getCancelQuantity(), new BigDecimal(\"10.0\"));\n assertEquals(\"Order [\" + orderId + \"] item [\" + cancelOrderItem.getOrderItemSeqId() + \"] ordered quantity is not correct\", cancelOrderItem.getOrderedQuantity(), new BigDecimal(\"0.0\"));\n assertEquals(\"Order [\" + orderId + \"] item [\" + cancelOrderItem.getOrderItemSeqId() + \"] invoiced quantity is not correct\", cancelOrderItem.getInvoicedQuantity(), new BigDecimal(\"0.0\"));\n assertEquals(\"Order [\" + orderId + \"] item [\" + cancelOrderItem.getOrderItemSeqId() + \"] invoiced value is not correct\", cancelOrderItem.getInvoicedValue(), new BigDecimal(\"0.0\"));\n assertEquals(\"Order [\" + orderId + \"] item [\" + cancelOrderItem.getOrderItemSeqId() + \"] remaining to ship quantity is not correct\", cancelOrderItem.getRemainingToShipQuantity(), new BigDecimal(\"0.0\"));\n assertEquals(\"Order [\" + orderId + \"] item [\" + cancelOrderItem.getOrderItemSeqId() + \"] subtotal is not correct\", cancelOrderItem.getSubTotal(), new BigDecimal(\"0.0\"));\n assertEquals(\"Order [\" + orderId + \"] item [\" + cancelOrderItem.getOrderItemSeqId() + \"] uninvoiced value is not correct\", cancelOrderItem.getUninvoicedValue(), new BigDecimal(\"0.0\"));\n }",
"@Test\n\tpublic void testGetItemByGuid() {\n\t\tfinal BeanFactory beanFactory = context.mock(BeanFactory.class);\n\t\tBeanFactoryExpectationsFactory expectationsFactory = new BeanFactoryExpectationsFactory(context, beanFactory);\n\t\ttry {\n\t\t\tShoppingCart shoppingCart = new ShoppingCartImpl() {\n\n\t\t\t\t{\n\t\t\t\t\tsetShoppingItemHasRecurringPricePredicate(new ShoppingItemHasRecurringPricePredicate() {\n\t\t\t\t\t\tprivate static final long serialVersionUID = -5127530597906325001L;\n\n\t\t\t\t\t\tpublic boolean evaluate(final ShoppingItem shoppingItem) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tprivate static final long serialVersionUID = -5295285904220022476L;\n\n\t\t\t\t@Override\n\t\t\t\tpublic void fireRules() {\n\t\t\t\t\t// don't care about the rule logic\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tfinal ShoppingItem cartItem1 = context.mock(ShoppingItem.class);\n\t\t\tfinal ShoppingItem cartItem2 = context.mock(ShoppingItem.class, \"cartItem2\");\n\n\t\t\tfinal ShoppingCartMemento shoppingCartMemento = new ShoppingCartMementoImpl();\n\n\t\t\tfinal ProductSku productSku1 = context.mock(ProductSku.class);\n\t\t\tfinal ProductSku productSku2 = context.mock(ProductSku.class, \"sku2\");\n\n\t\t\tcontext.checking(new Expectations() { {\n\t\t\t\tallowing(beanFactory).getBean(\"shoppingCartMemento\"); will(returnValue(shoppingCartMemento));\n\t\t\t\tallowing(cartItem1).isConfigurable(); will(returnValue(false));\n\t\t\t\tallowing(cartItem2).isConfigurable(); will(returnValue(false));\n\t\t\t\tallowing(cartItem1).getProductSku(); will(returnValue(productSku1));\n\t\t\t\tallowing(cartItem2).getProductSku(); will(returnValue(productSku2));\n\t\t\t\tallowing(productSku1).getSkuCode(); will(returnValue(\"33333\"));\n\t\t\t\tallowing(productSku2).getSkuCode(); will(returnValue(\"44444\"));\n\t\t\t\tallowing(cartItem1).getGuid(); will(returnValue(CART_ITEM_1_GUID));\n\t\t\t\tallowing(cartItem2).getGuid(); will(returnValue(CART_ITEM_2_GUID));\n\t\t\t} });\n\n\t\t\tshoppingCart.addCartItem(cartItem1);\n\t\t\tshoppingCart.addCartItem(cartItem2);\n\n\t\t\tfinal String expected = new String(\"11111\"); // NOPMD: to test correctness of string comparison we need an object\n\t\t\tShoppingItem returnedCartItem1 = shoppingCart.getCartItemByGuid(expected);\n\n\t\t\tassertEquals(\"The item found should be the same as the item added.\", cartItem1, returnedCartItem1);\n\t\t} finally {\n\t\t\texpectationsFactory.close();\n\t\t}\n\t}",
"public static boolean testRemoveItemNotFoundInCart() {\n\t \nboolean testPassed = false; \n\t \n\t String[] cart = {\"beef\", \"sausage\", \"chicken\", \"ham\", \"fish\"}; \n\t \n\t String itemToRemove = \"pork\";\n\t \n\t int count = 5;\n\t \n\t if (ShoppingCart.remove(itemToRemove, cart, count) == 5) {\n\t\t \n\t\t System.out.print(\"Test passed\");\n\t\t \n\t\t testPassed = true;\n\t\t \n\t }\n\t \n\t else {\n\t\t \n\t\t testPassed = false;\n\t\t \n\t\t System.out.print(\"Test failed\"); \n\t }\n\t \n\t return testPassed;\n }",
"@Test(expected = ProductNotFoundException.class)\n public void TestProductNotFoundException() throws ProductNotFoundException {\n HashMap<Character, Product> productList = new HashMap<Character, Product>();\n Product product = new Product('A', 20, 2, 1);\n productList.put(product.getName(), product);\n\n product = new Product('B', 50, 5, 3);\n productList.put(product.getName(), product);\n\n product = new Product('C', 30, 3, 2);\n productList.put(product.getName(), product);\n\n com.jama.domain.Supermarket supermarket = new com.jama.domain.Supermarket(productList);\n\n int totalPrice = supermarket.checkout(\"BCABBACBCBX\");\n assertEquals(\"Total prices are not equal.\", new Integer(230), new Integer(totalPrice));\n }",
"@Test\n\tpublic void testFindProductSkuByGuidWithNullReturn() {\n\t\tcontext.checking(new Expectations() {\n\t\t\t{\n\t\t\t\tallowing(getMockPersistenceEngine()).retrieveByNamedQuery(with(any(String.class)), with(any(Object[].class)));\n\t\t\t\twill(returnValue(Collections.emptyList()));\n\t\t\t}\n\t\t});\n\t\tassertNull(this.importGuidHelper.findProductSkuByGuid(NON_EXIST_GUID));\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parameterized constructor taking the data source, item writer and output file path. | public ResultHandlerDaoFactory(DataSource datasource, ItemWriter itemWriter, String outputFilePath) {
setDatasource(datasource);
setItemWriter(itemWriter);
setOutputFilePath(outputFilePath);
} | [
"public ResultHandlerDaoFactory(DataSource datasource, ItemWriter itemWriter, Writer writer) {\n setDatasource(datasource);\n setItemWriter(itemWriter);\n setWriter(writer);\n }",
"public ResultHandlerDaoFactory(DataSource datasource, ItemWriter itemWriter) {\n this(datasource, itemWriter, (Writer) null);\n }",
"public DataReader(String filename)\n {\n this.filename=filename;\n }",
"public CSVReaderWriter() {}",
"public WritablePropertySourceImpl() {\n super();\n }",
"private ItemGenerator()\r\n\t{\r\n\t\t//Scanner read = null;\r\n\t\tItemGenerator.itemList = new ArrayList<Item>();\r\n\t\t//Get item information from itemList.txt and store in itemList\r\n\t \ttry \r\n\t \t{\r\n\t\t\t/*read*/ writer = new PrintWriter /*Scanner*/(new File(\"itemList.txt\"));\r\n\t\t\twhile(/*read*/writer.hasNext()) {\r\n\t\t\t\tString line = /*read*/writer.nextLine();\r\n\r\n\t\t\t\tItem item = new Item(line);\r\n\t\t\t\tItemGenerator.itemList.add(item);\r\n\t\t\t}\r\n\t\t\t/*read*/writer.close();\r\n\t \t}\r\n\t \tcatch(FileNotFoundException e)\r\n\t \t{\r\n\t \tSystem.out.println(\"FNF - place file in the project folder. \");\r\n\t \t}\r\n\t}",
"private DataFile() {}",
"public DataSource()\n\t{\n\t}",
"public SourceGenerator() {\n this(null); //-- use default factory\n }",
"public JdoSource() {\n super();\n }",
"public Datasource()\n\t{\n\t}",
"public FileService(String fileName){\r\n \r\n //String is passed in first and then converted to an actual file\r\n File file = new File(fileName); //need to create exception handling here!!!\r\n \r\n //set properties\r\n inputStrategy = new CsvInput();\r\n inputStrategy.setFile(file);\r\n \r\n outputStrategy = new CsvOutput();\r\n outputStrategy.setFile(file);\r\n }",
"public SimpleXMLFileIndexingWriter() {\n\t}",
"private void constructDestination() {\r\n\t\tString destinationPath = documentsPath + File.separator\r\n\t\t\t\t+ \"MusicOrganizerOutput\" + File.separator + artist\r\n\t\t\t\t+ File.separator + albumTitle + File.separator + songTitle\r\n\t\t\t\t+ \".\" + fileExtension;\r\n\t\t\r\n\t\t// Instantiate the destination File\r\n\t\tdestinationFile = new File(destinationPath);\r\n\t}",
"public FileSystemSink() {}",
"public DataSource() {\r\n\t}",
"public Results(String outputFileName) {\n fileName = outputFileName;\n myLogger.writeMessage(\"Constructor for Results was called.\", MyLogger.DebugLevel.CONSTRUCTOR);\n }",
"public SourcesConverter() {\n }",
"public CopySink() {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Instantiates a new id repo app unchecked exception. | public IdRepoAppUncheckedException(IdRepoErrorConstants exceptionConstant, Throwable rootCause, String id) {
this(exceptionConstant.getErrorCode(), exceptionConstant.getErrorMessage(), rootCause);
this.id = id;
} | [
"public IdRepoAppUncheckedException() {\n\t\tsuper();\n\t}",
"public IdRepoAppUncheckedException(IdRepoErrorConstants exceptionConstant, String id) {\n\t\tthis(exceptionConstant.getErrorCode(), exceptionConstant.getErrorMessage());\n\t\tthis.id = id;\n\t}",
"public IdRepoAppUncheckedException(IdRepoErrorConstants exceptionConstant) {\n\t\tthis(exceptionConstant.getErrorCode(), exceptionConstant.getErrorMessage());\n\t}",
"public ProjectIDException() {\r\n\t\tsuper();\r\n\t}",
"public ApplicationRuntimeException() {\n // Default Constructor\n }",
"public IdRepoAppUncheckedException(IdRepoErrorConstants exceptionConstant, Throwable rootCause) {\n\t\tthis(exceptionConstant.getErrorCode(), exceptionConstant.getErrorMessage(), rootCause);\n\t}",
"public PacketReceiverAppException(PlatformErrorMessages exceptionConstant, String id) {\n\t\tthis(exceptionConstant.getCode(), exceptionConstant.getMessage());\n\t\tthis.id = id;\n\t}",
"public LibraryException() { }",
"public PoolNotFoundException() {\n super();\n }",
"protected abstract Application createApplication();",
"public PacketReceiverAppException(PlatformErrorMessages exceptionConstant, Throwable rootCause, String id) {\n\t\tthis(exceptionConstant.getCode(), exceptionConstant.getMessage(), rootCause);\n\t\tthis.id = id;\n\t}",
"public ProjectIDException(String msg) {\r\n\t\tsuper(msg);\r\n\t}",
"public NotCreatedEntityManagerException() {\n }",
"public RepoOpener() {\n }",
"private DefaultAppFactory() {\r\n }",
"public ShellIOException() {\n\t}",
"Application createApplication();",
"public ApplicationCreator() {\n }",
"public SnowowlRuntimeException() {\n\t\tsuper();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.